Skip to content

Commit ac408a6

Browse files
committed
Address remaining outstanding comments
1 parent a428a69 commit ac408a6

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

llvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern cl::opt<bool> WriteNewDbgInfoFormat;
3131
// Backup all of the existing settings that may be modified when
3232
// PreserveInputDbgFormat=true, so that when the test is finished we return them
3333
// (and the "preserve" setting) to their original values.
34-
auto TempSettingChange() {
34+
static auto SaveDbgInfoFormat() {
3535
return make_scope_exit(
3636
[OldPreserveInputDbgFormat = PreserveInputDbgFormat.getValue(),
3737
OldUseNewDbgInfoFormat = UseNewDbgInfoFormat.getValue(),
@@ -1345,7 +1345,7 @@ TEST(IRInstructionMapper, DebugInfoInvisible) {
13451345
13461346
declare void @llvm.dbg.value(metadata)
13471347
!0 = distinct !{!"test\00", i32 10})";
1348-
auto SettingGuard = TempSettingChange();
1348+
auto SettingGuard = SaveDbgInfoFormat();
13491349
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
13501350
LLVMContext Context;
13511351
std::unique_ptr<Module> M = makeLLVMModule(Context, ModuleString);
@@ -1968,7 +1968,7 @@ TEST(IRSimilarityCandidate, IdenticalWithDebug) {
19681968
declare void @llvm.dbg.value(metadata)
19691969
!0 = distinct !{!"test\00", i32 10}
19701970
!1 = distinct !{!"test\00", i32 11})";
1971-
auto SettingGuard = TempSettingChange();
1971+
auto SettingGuard = SaveDbgInfoFormat();
19721972
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
19731973
LLVMContext Context;
19741974
std::unique_ptr<Module> M = makeLLVMModule(Context, ModuleString);

llvm/unittests/Transforms/Utils/LocalTest.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern cl::opt<bool> WriteNewDbgInfoFormat;
3535
// Backup all of the existing settings that may be modified when
3636
// PreserveInputDbgFormat=true, so that when the test is finished we return them
3737
// (and the "preserve" setting) to their original values.
38-
auto TempSettingChange() {
38+
static auto SaveDbgInfoFormat() {
3939
return make_scope_exit(
4040
[OldPreserveInputDbgFormat = PreserveInputDbgFormat.getValue(),
4141
OldUseNewDbgInfoFormat = UseNewDbgInfoFormat.getValue(),
@@ -141,7 +141,7 @@ TEST(Local, ReplaceDbgDeclare) {
141141
// FIXME: PreserveInputDbgFormat is set to true because this test has
142142
// been written to expect debug intrinsics rather than debug records; use the
143143
// intrinsic format until we update the test checks.
144-
auto SettingGuard = TempSettingChange();
144+
auto SettingGuard = SaveDbgInfoFormat();
145145
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
146146

147147
// Original C source to get debug info for a local variable:
@@ -525,7 +525,7 @@ struct SalvageDebugInfoTest : ::testing::Test {
525525
// the intrinsic format until we update the test checks. Note that the
526526
// temporary setting of this flag only needs to cover the parsing step, not
527527
// the test body itself.
528-
auto SettingGuard = TempSettingChange();
528+
auto SettingGuard = SaveDbgInfoFormat();
529529
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
530530

531531
M = parseIR(C,
@@ -627,9 +627,10 @@ TEST_F(SalvageDebugInfoTest, RecursiveBlockSimplification) {
627627
TEST(Local, wouldInstructionBeTriviallyDead) {
628628
LLVMContext Ctx;
629629
// FIXME: PreserveInputDbgFormat is set to true because this test has
630-
// been written to expect debug intrinsics rather than debug records; use the
631-
// intrinsic format until we update the test checks.
632-
auto SettingGuard = TempSettingChange();
630+
// been written to expect debug intrinsics rather than debug records.
631+
// TODO: This test doesn't have a DbgRecord equivalent form so delete
632+
// it when debug intrinsics are removed.
633+
auto SettingGuard = SaveDbgInfoFormat();
633634
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
634635
std::unique_ptr<Module> M = parseIR(Ctx,
635636
R"(
@@ -723,7 +724,7 @@ TEST(Local, FindDbgUsers) {
723724
// FIXME: PreserveInputDbgFormat is set to true because this test has
724725
// been written to expect debug intrinsics rather than debug records; use the
725726
// intrinsic format until we update the test checks.
726-
auto SettingGuard = TempSettingChange();
727+
auto SettingGuard = SaveDbgInfoFormat();
727728
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
728729
std::unique_ptr<Module> M = parseIR(Ctx,
729730
R"(
@@ -845,7 +846,7 @@ TEST(Local, ReplaceAllDbgUsesWith) {
845846
// FIXME: PreserveInputDbgFormat is set to true because this test has
846847
// been written to expect debug intrinsics rather than debug records; use the
847848
// intrinsic format until we update the test checks.
848-
auto SettingGuard = TempSettingChange();
849+
auto SettingGuard = SaveDbgInfoFormat();
849850
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
850851

851852
// Note: The datalayout simulates Darwin/x86_64.
@@ -1398,7 +1399,7 @@ TEST(Local, ReplaceDbgVariableRecord) {
13981399
// FIXME: PreserveInputDbgFormat is set to true because this test has
13991400
// been written to expect debug intrinsics rather than debug records; use the
14001401
// intrinsic format until we update the test checks.
1401-
auto SettingGuard = TempSettingChange();
1402+
auto SettingGuard = SaveDbgInfoFormat();
14021403
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
14031404

14041405
// Test that RAUW also replaces the operands of DbgVariableRecord objects,

0 commit comments

Comments
 (0)