diff options
author | Stephen Tozer <stephen.tozer@sony.com> | 2024-05-01 16:56:34 +0100 |
---|---|---|
committer | Stephen Tozer <stephen.tozer@sony.com> | 2024-05-01 16:56:34 +0100 |
commit | 00821fed09969305b0003d3313c44d1e761a7131 (patch) | |
tree | 8d28038f25f4898cbc40a224b27f423d76e610b3 /llvm/unittests/IR/DebugInfoTest.cpp | |
parent | 2f01fd99eb8c8ab3db9aba72c4f00e31e9e60a05 (diff) | |
download | llvm-00821fed09969305b0003d3313c44d1e761a7131.zip llvm-00821fed09969305b0003d3313c44d1e761a7131.tar.gz llvm-00821fed09969305b0003d3313c44d1e761a7131.tar.bz2 |
Revert "[RemoveDIs] Load into new debug info format by default in LLVM (#89799)"
A unit test was broken by the above commit:
https://lab.llvm.org/buildbot/#/builders/139/builds/64627
This reverts commit 2f01fd99eb8c8ab3db9aba72c4f00e31e9e60a05.
Diffstat (limited to 'llvm/unittests/IR/DebugInfoTest.cpp')
-rw-r--r-- | llvm/unittests/IR/DebugInfoTest.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/unittests/IR/DebugInfoTest.cpp b/llvm/unittests/IR/DebugInfoTest.cpp index ef6aa7f..d06b979 100644 --- a/llvm/unittests/IR/DebugInfoTest.cpp +++ b/llvm/unittests/IR/DebugInfoTest.cpp @@ -237,9 +237,6 @@ TEST(DbgVariableIntrinsic, EmptyMDIsKillLocation) { // Duplicate of above test, but in DbgVariableRecord representation. TEST(MetadataTest, DeleteInstUsedByDbgVariableRecord) { LLVMContext C; - bool OldDbgValueMode = UseNewDbgInfoFormat; - UseNewDbgInfoFormat = true; - std::unique_ptr<Module> M = parseIR(C, R"( define i16 @f(i16 %a) !dbg !6 { %b = add i16 %a, 1, !dbg !11 @@ -265,7 +262,10 @@ TEST(MetadataTest, DeleteInstUsedByDbgVariableRecord) { !11 = !DILocation(line: 1, column: 1, scope: !6) )"); + bool OldDbgValueMode = UseNewDbgInfoFormat; + UseNewDbgInfoFormat = true; Instruction &I = *M->getFunction("f")->getEntryBlock().getFirstNonPHI(); + M->convertToNewDbgValues(); // Find the DbgVariableRecords using %b. SmallVector<DbgValueInst *, 2> DVIs; @@ -1044,8 +1044,9 @@ TEST(MetadataTest, ConvertDbgToDbgVariableRecord) { TEST(MetadataTest, DbgVariableRecordConversionRoutines) { LLVMContext C; - bool OldDbgValueMode = UseNewDbgInfoFormat; - UseNewDbgInfoFormat = false; + // For the purpose of this test, set and un-set the command line option + // corresponding to UseNewDbgInfoFormat. + UseNewDbgInfoFormat = true; std::unique_ptr<Module> M = parseIR(C, R"( define i16 @f(i16 %a) !dbg !6 { @@ -1076,11 +1077,6 @@ TEST(MetadataTest, DbgVariableRecordConversionRoutines) { !11 = !DILocation(line: 1, column: 1, scope: !6) )"); - // For the purpose of this test, set and un-set the command line option - // corresponding to UseNewDbgInfoFormat, but only after parsing, to ensure - // that the IR starts off in the old format. - UseNewDbgInfoFormat = true; - // Check that the conversion routines and utilities between dbg.value // debug-info format and DbgVariableRecords works. Function *F = M->getFunction("f"); @@ -1185,7 +1181,7 @@ TEST(MetadataTest, DbgVariableRecordConversionRoutines) { EXPECT_EQ(DVI2->getVariable(), DLV2); EXPECT_EQ(DVI2->getExpression(), Expr2); - UseNewDbgInfoFormat = OldDbgValueMode; + UseNewDbgInfoFormat = false; } } // end namespace |