summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2018-09-21 08:32:49 +0000
committerDean Michael Berris <dberris@google.com>2018-09-21 08:32:49 +0000
commit5082e25196254e72e2bf9c374bef43d46fb0561c (patch)
treea05e5c4a30132e3e0e69e5f600b6e916c3cc4909 /clang/lib
parentb32274242d7eb86e7841a391303da59fce59f98e (diff)
downloadbcm5719-llvm-5082e25196254e72e2bf9c374bef43d46fb0561c.tar.gz
bcm5719-llvm-5082e25196254e72e2bf9c374bef43d46fb0561c.zip
[XRay][clang] Propagate -fxray-instrumentation-bundle to -cc1
Summary: Add a test and ensure that we propagate the -fxray-instrumentation-bundle flag from the driver invocation to the -cc1 options. Reviewers: mboerger, tejohnson Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52342 llvm-svn: 342715
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/XRayArgs.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Driver/XRayArgs.cpp b/clang/lib/Driver/XRayArgs.cpp
index 527fc3c9558..a2023289753 100644
--- a/clang/lib/Driver/XRayArgs.cpp
+++ b/clang/lib/Driver/XRayArgs.cpp
@@ -215,4 +215,19 @@ void XRayArgs::addArgs(const ToolChain &TC, const ArgList &Args,
ModeOpt += Mode;
CmdArgs.push_back(Args.MakeArgString(ModeOpt));
}
+
+ SmallString<64> Bundle("-fxray-instrumentation-bundle=");
+ if (InstrumentationBundle.full()) {
+ Bundle += "all";
+ } else if (InstrumentationBundle.empty()) {
+ Bundle += "none";
+ } else {
+ if (InstrumentationBundle.has(XRayInstrKind::Function))
+ Bundle += "function";
+ if (InstrumentationBundle.has(XRayInstrKind::Custom))
+ Bundle += "custom";
+ if (InstrumentationBundle.has(XRayInstrKind::Typed))
+ Bundle += "typed";
+ }
+ CmdArgs.push_back(Args.MakeArgString(Bundle));
}
OpenPOWER on IntegriCloud