diff options
author | Dean Michael Berris <dberris@google.com> | 2017-03-30 22:46:45 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2017-03-30 22:46:45 +0000 |
commit | 504fc2262a347ec9b527a9430dddcb00b265471f (patch) | |
tree | efc9b226dd8a23d86b901a670d43e1466bdaa464 /clang/lib | |
parent | bf8f75930590b7d7279c4f0ab9cee3c1e614a669 (diff) | |
download | bcm5719-llvm-504fc2262a347ec9b527a9430dddcb00b265471f.tar.gz bcm5719-llvm-504fc2262a347ec9b527a9430dddcb00b265471f.zip |
[XRay][clang] Fix the -fxray-instruction-threshold flag processing
Summary:
The refactoring introduced a regression in the flag processing for
-fxray-instruction-threshold which causes it to not get passed properly.
This change should restore the previous behaviour.
Reviewers: rnk, pelikan
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D31491
llvm-svn: 299126
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/XRayArgs.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Driver/XRayArgs.cpp b/clang/lib/Driver/XRayArgs.cpp index 0e0fe6ffa41..8d68a8432d3 100644 --- a/clang/lib/Driver/XRayArgs.cpp +++ b/clang/lib/Driver/XRayArgs.cpp @@ -16,8 +16,8 @@ #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" -#include "llvm/Support/SpecialCaseList.h" #include "llvm/Support/ScopedPrinter.h" +#include "llvm/Support/SpecialCaseList.h" using namespace clang; using namespace clang::driver; @@ -91,8 +91,8 @@ void XRayArgs::addArgs(const ToolChain &TC, const ArgList &Args, return; CmdArgs.push_back(XRayInstrumentOption); - CmdArgs.push_back(Args.MakeArgString(XRayInstructionThresholdOption + - llvm::to_string(InstructionThreshold))); + CmdArgs.push_back(Args.MakeArgString(Twine(XRayInstructionThresholdOption) + + Twine(InstructionThreshold))); for (const auto &Always : AlwaysInstrumentFiles) { SmallString<64> AlwaysInstrumentOpt(XRayAlwaysInstrumentOption); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index bea29e2de7c..a9d805b7db2 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -721,7 +721,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Opts.InstrumentFunctions = Args.hasArg(OPT_finstrument_functions); Opts.XRayInstrumentFunctions = Args.hasArg(OPT_fxray_instrument); Opts.XRayInstructionThreshold = - getLastArgIntValue(Args, OPT_fxray_instruction_threshold_, 200, Diags); + getLastArgIntValue(Args, OPT_fxray_instruction_threshold_EQ, 200, Diags); Opts.InstrumentForProfiling = Args.hasArg(OPT_pg); Opts.CallFEntry = Args.hasArg(OPT_mfentry); Opts.EmitOpenCLArgMetadata = Args.hasArg(OPT_cl_kernel_arg_info); @@ -2308,9 +2308,11 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, getLastArgIntValue(Args, OPT_fsanitize_address_field_padding, 0, Diags); Opts.SanitizerBlacklistFiles = Args.getAllArgValues(OPT_fsanitize_blacklist); - // -fxray-{always,never}-instrument= filenames. + // -fxray-instrument Opts.XRayInstrument = Args.hasFlag(OPT_fxray_instrument, OPT_fnoxray_instrument, false); + + // -fxray-{always,never}-instrument= filenames. Opts.XRayAlwaysInstrumentFiles = Args.getAllArgValues(OPT_fxray_always_instrument); Opts.XRayNeverInstrumentFiles = |