[PATCH] D20352: Add XRay flags to Clang

Dean Michael Berris via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 26 23:32:19 PDT 2016


dberris marked an inline comment as done.

================
Comment at: include/clang/Basic/Attr.td:432
@@ +431,3 @@
+                   CXX11<"clang", "xray_always_instrument">];
+  let Subjects = SubjectList<[CXXMethod, Function], WarnDiag,
+                              "ExpectedFunctionOrMethod">;
----------------
Yes it does, done.

================
Comment at: include/clang/Basic/Attr.td:433
@@ +432,3 @@
+  let Subjects = SubjectList<[CXXMethod, Function], WarnDiag,
+                              "ExpectedFunctionOrMethod">;
+  let Documentation = [Undocumented];  // TODO(dberris): Document this!
----------------
Done the latter to include ObjC methods.

================
Comment at: include/clang/Basic/Attr.td:437
@@ +436,3 @@
+
+def XRayNeverInstrument : InheritableAttr {
+  let Spellings = [GNU<"xray_never_instrument">,
----------------
This actually makes a lot of sense. I've done some of the consolidation to make it a lot easier to check in the code and to expand later on too. I suppose other attributes that are XRay-specific with additional values/arguments would make a better candidate for additional attributes. Will cross that bridge when we get to that part of the implementation. :)

================
Comment at: include/clang/Frontend/CodeGenOptions.def:75
@@ -74,3 +74,3 @@
 CODEGENOPT(FunctionSections  , 1, 0) ///< Set when -ffunction-sections is enabled.
 CODEGENOPT(InstrumentFunctions , 1, 0) ///< Set when -finstrument-functions is
                                        ///< enabled.
----------------
I'm open to this idea, except this might break compatibility with GCC (as this seems to be a gcc-inspired flag).

I'm happy to explore consolidating the different instrumentation flags under `-finstrument=` which then has namespace values internally (profile-..., xray-...) for different modes, etc. For now the simplest thing to do might be to have XRay do this independently first, then have a cleanup later to consolidate flags on the driver and deprecate the flags.


http://reviews.llvm.org/D20352





More information about the cfe-commits mailing list