Skip to content

Commit 86935d2

Browse files
authored
[LLVMCore] Add some new functions
1 parent b63a93b commit 86935d2

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

llvm/include/llvm/IR/BasicBlock.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,10 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
427427
void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr,
428428
bool ShouldPreserveUseListOrder = false,
429429
bool IsForDebug = false) const;
430-
430+
void println(raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr,
431+
bool ShouldPreserveUseListOrder = false,
432+
bool IsForDebug = false) const;
433+
431434
//===--------------------------------------------------------------------===//
432435
/// Instruction iterator methods
433436
///

llvm/include/llvm/IR/Function.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,9 @@ class LLVM_EXTERNAL_VISIBILITY Function : public GlobalObject,
940940
void print(raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr,
941941
bool ShouldPreserveUseListOrder = false,
942942
bool IsForDebug = false) const;
943+
void println(raw_ostream &OS, AssemblyAnnotationWriter *AAW = nullptr,
944+
bool ShouldPreserveUseListOrder = false,
945+
bool IsForDebug = false) const;
943946

944947
/// viewCFG - This function is meant for use from the debugger. You can just
945948
/// say 'call F->viewCFG()' and a ghostview window should pop up from the

llvm/include/llvm/IR/Value.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,11 @@ class Value {
234234
/// Implement operator<< on Value.
235235
/// @{
236236
void print(raw_ostream &O, bool IsForDebug = false) const;
237+
void println(raw_ostream &O, bool IsForDebug = false) const;
237238
void print(raw_ostream &O, ModuleSlotTracker &MST,
238239
bool IsForDebug = false) const;
240+
void println(raw_ostream &O, ModuleSlotTracker &MST,
241+
bool IsForDebug = false) const;
239242
/// @}
240243

241244
/// Print the name of this Value out to the specified raw_ostream.

llvm/lib/IR/AsmWriter.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4597,6 +4597,12 @@ void Function::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
45974597
W.printFunction(this);
45984598
}
45994599

4600+
void Function::println(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
4601+
bool ShouldPreserveUseListOrder, bool IsForDebug) const {
4602+
print(ROS, AAW, ShouldPreserveUseListOrder, IsForDebug);
4603+
ROS << "\n";
4604+
}
4605+
46004606
void BasicBlock::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
46014607
bool ShouldPreserveUseListOrder,
46024608
bool IsForDebug) const {
@@ -4608,6 +4614,13 @@ void BasicBlock::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
46084614
W.printBasicBlock(this);
46094615
}
46104616

4617+
void BasicBlock::println(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
4618+
bool ShouldPreserveUseListOrder,
4619+
bool IsForDebug) const {
4620+
print(ROS, AAW, ShouldPreserveUseListOrder, IsForDebug);
4621+
ROS << "\n";
4622+
}
4623+
46114624
void Module::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
46124625
bool ShouldPreserveUseListOrder, bool IsForDebug) const {
46134626
SlotTracker SlotTable(this);
@@ -4702,6 +4715,11 @@ void Value::print(raw_ostream &ROS, bool IsForDebug) const {
47024715
print(ROS, MST, IsForDebug);
47034716
}
47044717

4718+
void Value::println(raw_ostream &ROS, bool IsForDebug) const {
4719+
print(ROS, IsForDebug);
4720+
ROS << "\n";
4721+
}
4722+
47054723
void Value::print(raw_ostream &ROS, ModuleSlotTracker &MST,
47064724
bool IsForDebug) const {
47074725
formatted_raw_ostream OS(ROS);
@@ -4748,6 +4766,12 @@ void Value::print(raw_ostream &ROS, ModuleSlotTracker &MST,
47484766
}
47494767
}
47504768

4769+
void Value::println(raw_ostream &ROS, ModuleSlotTracker &MST,
4770+
bool IsForDebug) const {
4771+
print(ROS, MST, IsForDebug);
4772+
ROS << "\n";
4773+
}
4774+
47514775
/// Print without a type, skipping the TypePrinting object.
47524776
///
47534777
/// \return \c true iff printing was successful.

0 commit comments

Comments
 (0)