summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorShuxin Yang <shuxin.llvm@gmail.com>2013-08-14 04:36:53 +0000
committerShuxin Yang <shuxin.llvm@gmail.com>2013-08-14 04:36:53 +0000
commit538a17691cb81ced5f20462f568e848fd572f2cd (patch)
tree1cd79ef3dbc598b0d00222551a69335eb3bd76c8 /clang/lib/Driver/Driver.cpp
parentcb065a671300f8cea4a4f5316a1c4d9f7b4c7072 (diff)
downloadbcm5719-llvm-538a17691cb81ced5f20462f568e848fd572f2cd.tar.gz
bcm5719-llvm-538a17691cb81ced5f20462f568e848fd572f2cd.zip
Driver::IsUsingLTO() no longer return true when seeing -emit-llvm.
The rationale for this change is to differentiate following two situations: 1) clang -c -emit-llvm a.c 2) clang -c -flto a.c Reviewed by Eric Christopher. Thanks a lot! llvm-svn: 188352
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 32a7d1aafd3..e301d89f3f7 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1339,6 +1339,10 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase,
types::ID Output =
Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC;
return new CompileJobAction(Input, Output);
+ } else if (Args.hasArg(options::OPT_emit_llvm)) {
+ types::ID Output =
+ Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR : types::TY_LLVM_BC;
+ return new CompileJobAction(Input, Output);
} else {
return new CompileJobAction(Input, types::TY_PP_Asm);
}
@@ -1351,9 +1355,7 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase,
}
bool Driver::IsUsingLTO(const ArgList &Args) const {
- // Check for -emit-llvm or -flto.
- if (Args.hasArg(options::OPT_emit_llvm) ||
- Args.hasFlag(options::OPT_flto, options::OPT_fno_lto, false))
+ if (Args.hasFlag(options::OPT_flto, options::OPT_fno_lto, false))
return true;
// Check for -O4.
OpenPOWER on IntegriCloud