[PATCH] D44970: [XRay][clang] Add flag to choose instrumentation bundles

Eric Christopher via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 10 18:19:35 PDT 2018


echristo added inline comments.


================
Comment at: clang/include/clang/Frontend/CodeGenOptions.h:110
 
+  enum XRayInstrumentationPointBundle {
+    XRay_All,             // Always emit all the instrumentation points.
----------------
dberris wrote:
> pelikan wrote:
> > To me, this feels like a bitfield would be a better match.
> > All = Function | Custom
> > None = 0
> Thought about that, but the ergonomics from the user-side isn't as good. Having to know about which kinds of sleds specifically to enable seems much harder to explain. Using bundles that we control from the beginning keeps this much simpler.
I dunno, I think I agree with the other commenter. This feels awkward.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:3245
+
+    using XRayBundles = CodeGenOptions::XRayInstrumentationPointBundle;
+    auto Bundle = CGM.getCodeGenOpts().getXRayInstrumentationBundle();
----------------
Break this out into some sort of function to determine which one we want? We do this a couple times.


https://reviews.llvm.org/D44970





More information about the cfe-commits mailing list