@@ -35,7 +35,7 @@ extern cl::opt<bool> WriteNewDbgInfoFormat;
35
35
// Backup all of the existing settings that may be modified when
36
36
// PreserveInputDbgFormat=true, so that when the test is finished we return them
37
37
// (and the "preserve" setting) to their original values.
38
- auto TempSettingChange () {
38
+ static auto SaveDbgInfoFormat () {
39
39
return make_scope_exit (
40
40
[OldPreserveInputDbgFormat = PreserveInputDbgFormat.getValue (),
41
41
OldUseNewDbgInfoFormat = UseNewDbgInfoFormat.getValue (),
@@ -141,7 +141,7 @@ TEST(Local, ReplaceDbgDeclare) {
141
141
// FIXME: PreserveInputDbgFormat is set to true because this test has
142
142
// been written to expect debug intrinsics rather than debug records; use the
143
143
// intrinsic format until we update the test checks.
144
- auto SettingGuard = TempSettingChange ();
144
+ auto SettingGuard = SaveDbgInfoFormat ();
145
145
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
146
146
147
147
// Original C source to get debug info for a local variable:
@@ -525,7 +525,7 @@ struct SalvageDebugInfoTest : ::testing::Test {
525
525
// the intrinsic format until we update the test checks. Note that the
526
526
// temporary setting of this flag only needs to cover the parsing step, not
527
527
// the test body itself.
528
- auto SettingGuard = TempSettingChange ();
528
+ auto SettingGuard = SaveDbgInfoFormat ();
529
529
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
530
530
531
531
M = parseIR (C,
@@ -627,9 +627,10 @@ TEST_F(SalvageDebugInfoTest, RecursiveBlockSimplification) {
627
627
TEST (Local, wouldInstructionBeTriviallyDead) {
628
628
LLVMContext Ctx;
629
629
// 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 ();
633
634
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
634
635
std::unique_ptr<Module> M = parseIR (Ctx,
635
636
R"(
@@ -723,7 +724,7 @@ TEST(Local, FindDbgUsers) {
723
724
// FIXME: PreserveInputDbgFormat is set to true because this test has
724
725
// been written to expect debug intrinsics rather than debug records; use the
725
726
// intrinsic format until we update the test checks.
726
- auto SettingGuard = TempSettingChange ();
727
+ auto SettingGuard = SaveDbgInfoFormat ();
727
728
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
728
729
std::unique_ptr<Module> M = parseIR (Ctx,
729
730
R"(
@@ -845,7 +846,7 @@ TEST(Local, ReplaceAllDbgUsesWith) {
845
846
// FIXME: PreserveInputDbgFormat is set to true because this test has
846
847
// been written to expect debug intrinsics rather than debug records; use the
847
848
// intrinsic format until we update the test checks.
848
- auto SettingGuard = TempSettingChange ();
849
+ auto SettingGuard = SaveDbgInfoFormat ();
849
850
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
850
851
851
852
// Note: The datalayout simulates Darwin/x86_64.
@@ -1398,7 +1399,7 @@ TEST(Local, ReplaceDbgVariableRecord) {
1398
1399
// FIXME: PreserveInputDbgFormat is set to true because this test has
1399
1400
// been written to expect debug intrinsics rather than debug records; use the
1400
1401
// intrinsic format until we update the test checks.
1401
- auto SettingGuard = TempSettingChange ();
1402
+ auto SettingGuard = SaveDbgInfoFormat ();
1402
1403
PreserveInputDbgFormat = cl::boolOrDefault::BOU_TRUE;
1403
1404
1404
1405
// Test that RAUW also replaces the operands of DbgVariableRecord objects,
0 commit comments