aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-05-24 20:40:51 +0000
committerHans Wennborg <hans@hanshq.net>2016-05-24 20:40:51 +0000
commit7a00888a08fa68212a5679263c8f82313fa036ea (patch)
treee23b6810f2594c10b8e81e46dce8c7021632f3fb /clang/lib/Driver/Tools.cpp
parent042975183e8f6e970d12195588b27b67560a9712 (diff)
downloadllvm-7a00888a08fa68212a5679263c8f82313fa036ea.zip
llvm-7a00888a08fa68212a5679263c8f82313fa036ea.tar.gz
llvm-7a00888a08fa68212a5679263c8f82313fa036ea.tar.bz2
[Driver] Add support for -finline-functions and /Ob2 flags
-finline-functions and /Ob2 are currently ignored by Clang. The only way to enable inlining is to use the global O flags, which also enable other options, or to emit LLVM bitcode using Clang, then running opt by hand with the inline pass. This patch allows to simply use the -finline-functions flag (same as GCC) or /Ob2 in clang-cl mode to enable inlining without other optimizations. This is the first patch of a serie to improve support for the /Ob flags. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20576 llvm-svn: 270609
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r--clang/lib/Driver/Tools.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 67bce6b..7c363e0 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -5332,8 +5332,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (Args.hasArg(options::OPT_fno_inline))
CmdArgs.push_back("-fno-inline");
- if (Args.hasArg(options::OPT_fno_inline_functions))
- CmdArgs.push_back("-fno-inline-functions");
+ if (Arg* InlineArg = Args.getLastArg(options::OPT_finline_functions,
+ options::OPT_fno_inline_functions))
+ InlineArg->render(Args, CmdArgs);
ObjCRuntime objcRuntime = AddObjCRuntimeArgs(Args, CmdArgs, rewriteKind);