Skip to content

Commit 0832480

Browse files
committed
Rebase fixes, ScopedSetter fixes
1 parent c96d46a commit 0832480

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

llvm/include/llvm/IR/PrintPasses.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ template <typename T> class ScopedDbgInfoFormatSetter {
9393
~ScopedDbgInfoFormatSetter() { Obj.setIsNewDbgInfoFormat(OldState); }
9494
};
9595

96+
template<typename T> ScopedDbgInfoFormatSetter(T &Obj, bool NewState) -> ScopedDbgInfoFormatSetter<T>;
97+
9698
} // namespace llvm
9799

98100
#endif // LLVM_IR_PRINTPASSES_H

llvm/lib/IR/AsmWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ class SlotTracker : public AbstractSlotTrackerStorage {
861861
/// Add all of the metadata from an instruction.
862862
void processInstructionMetadata(const Instruction &I);
863863

864-
/// Add all of the metadata from an DbgRecord.
864+
/// Add all of the metadata from a DbgRecord.
865865
void processDbgRecordMetadata(const DbgRecord &DPV);
866866
};
867867

@@ -4071,8 +4071,8 @@ void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
40714071

40724072
// Output all of the instructions in the basic block...
40734073
for (const Instruction &I : *BB) {
4074-
for (const DPValue &DPV : I.getDbgValueRange())
4075-
printDPValueLine(DPV);
4074+
for (const DbgRecord &DR : I.getDbgValueRange())
4075+
printDbgRecordLine(DR);
40764076
printInstructionLine(I);
40774077
}
40784078

llvm/lib/IR/IRPrintingPasses.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class PrintModulePassWrapper : public ModulePass {
4343
bool runOnModule(Module &M) override {
4444
// RemoveDIs: Regardless of the format we've processed this module in, use
4545
// `WriteNewDbgInfoFormat` to determine which format we use to write it.
46-
ScopedDbgInfoFormatSetter(M, WriteNewDbgInfoFormat);
46+
ScopedDbgInfoFormatSetter FormatSetter(M, WriteNewDbgInfoFormat);
4747

4848
if (llvm::isFunctionInPrintList("*")) {
4949
if (!Banner.empty())
@@ -86,7 +86,7 @@ class PrintFunctionPassWrapper : public FunctionPass {
8686
bool runOnFunction(Function &F) override {
8787
// RemoveDIs: Regardless of the format we've processed this function in, use
8888
// `WriteNewDbgInfoFormat` to determine which format we use to write it.
89-
ScopedDbgInfoFormatSetter(F, WriteNewDbgInfoFormat);
89+
ScopedDbgInfoFormatSetter FormatSetter(F, WriteNewDbgInfoFormat);
9090

9191
if (isFunctionInPrintList(F.getName())) {
9292
if (forcePrintModuleIR())

llvm/lib/IRPrinter/IRPrintingPasses.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PrintModulePass::PrintModulePass(raw_ostream &OS, const std::string &Banner,
3838
PreservedAnalyses PrintModulePass::run(Module &M, ModuleAnalysisManager &AM) {
3939
// RemoveDIs: Regardless of the format we've processed this module in, use
4040
// `WriteNewDbgInfoFormat` to determine which format we use to write it.
41-
ScopedDbgInfoFormatSetter(M, WriteNewDbgInfoFormat);
41+
ScopedDbgInfoFormatSetter FormatSetter(M, WriteNewDbgInfoFormat);
4242

4343
if (llvm::isFunctionInPrintList("*")) {
4444
if (!Banner.empty())
@@ -77,7 +77,7 @@ PreservedAnalyses PrintFunctionPass::run(Function &F,
7777
FunctionAnalysisManager &) {
7878
// RemoveDIs: Regardless of the format we've processed this function in, use
7979
// `WriteNewDbgInfoFormat` to determine which format we use to write it.
80-
ScopedDbgInfoFormatSetter(F, WriteNewDbgInfoFormat);
80+
ScopedDbgInfoFormatSetter FormatSetter(F, WriteNewDbgInfoFormat);
8181

8282
if (isFunctionInPrintList(F.getName())) {
8383
if (forcePrintModuleIR())

llvm/test/DebugInfo/dpvalue-print-nocrash.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
; RUN: opt -passes="instcombine" -debug %s -o /dev/null 2>&1 | FileCheck %s
33
; REQUIRES: asserts
44

5-
; CHECK: CLONE: DPValue value {
6-
; CHECK-SAME: marker @0x0
5+
; CHECK: CLONE: #dbg_value(
76

87
define ptr @func_10(i32 %p_11) {
98
entry:

0 commit comments

Comments
 (0)