[PATCH] D142029: [Assignment Tracking] Fix -fexperimental-assignment-tracking cc1 flag

Orlando Cazalet-Hyams via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 06:37:27 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0a996c82a75f: [Assignment Tracking] Fix -fexperimental-assignment-tracking cc1 flag (authored by Orlando).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142029/new/

https://reviews.llvm.org/D142029

Files:
  clang/include/clang/Driver/Options.td
  clang/test/CodeGen/assignment-tracking/flag.cpp


Index: clang/test/CodeGen/assignment-tracking/flag.cpp
===================================================================
--- clang/test/CodeGen/assignment-tracking/flag.cpp
+++ clang/test/CodeGen/assignment-tracking/flag.cpp
@@ -1,18 +1,24 @@
+//// Explicitly enabled:
 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone -O0 \
 // RUN:     -emit-llvm  -fexperimental-assignment-tracking %s -o -               \
-// RUN: | FileCheck %s --check-prefixes=FLAG
+// RUN: | FileCheck %s --check-prefixes=ENABLE
+//// Disabled by default:
 // RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone -O0 \
 // RUN:     -emit-llvm  %s -o -                                                  \
-// RUN: | FileCheck %s --check-prefixes=NO-FLAG
+// RUN: | FileCheck %s --check-prefixes=DISABLE
+//// Explicitly disabled:
+// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -debug-info-kind=standalone -O0 \
+// RUN:     -emit-llvm  %s -o - -fno-experimental-assignment-tracking            \
+// RUN: | FileCheck %s --check-prefixes=DISABLE
 
 // Check some assignment-tracking stuff appears in the output when the flag
-// -fexperimental-assignment-tracking is used, and that it doesn't when
-// the flag is not used (default behaviour: no assignment tracking).
+// -fexperimental-assignment-tracking is used, that it doesn't when
+// -fno-experimental-assignment-tracking is used or neither flag is specified.
 
-// FLAG: DIAssignID
-// FLAG: dbg.assign
+// ENABLE: DIAssignID
+// ENABLE: dbg.assign
 
-// NO-FLAG-NOT: DIAssignID
-// NO-FLAG-NOT: dbg.assign
+// DISABLE-NOT: DIAssignID
+// DISABLE-NOT: dbg.assign
 
 void fun(int a) {}
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -5702,10 +5702,11 @@
            "and non-deleting destructors. (No effect on Microsoft ABI)">,
   MarshallingInfoFlag<CodeGenOpts<"CtorDtorReturnThis">>;
 
-def fexperimental_assignment_tracking :
-  Flag<["-"], "fexperimental-assignment-tracking">, Group<f_Group>,
-  HelpText<"Enable assignment tracking debug info">,
-  MarshallingInfoFlag<CodeGenOpts<"EnableAssignmentTracking">>;
+defm experimental_assignment_tracking :
+  BoolOption<"f", "experimental-assignment-tracking",
+  CodeGenOpts<"EnableAssignmentTracking">, DefaultFalse,
+  PosFlag<SetTrue, [CC1Option]>, NegFlag<SetFalse>, BothFlags<[CoreOption]>>,
+  Group<f_Group>;
 
 } // let Flags = [CC1Option, NoDriverOption]
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142029.490814.patch
Type: text/x-patch
Size: 2555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230120/fc2a6370/attachment.bin>


More information about the cfe-commits mailing list