[PATCH] D20374: [Driver] Fix the case when use -fembed-bitcode and -flto= together
Steven Wu via cfe-commits
cfe-commits at lists.llvm.org
Wed May 18 10:11:03 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL269961: [Driver] Fix the case when use -fembed-bitcode and -flto= together (authored by steven_wu).
Changed prior to commit:
http://reviews.llvm.org/D20374?vs=57645&id=57646#toc
Repository:
rL LLVM
http://reviews.llvm.org/D20374
Files:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/test/Driver/embed-bitcode.c
Index: cfe/trunk/test/Driver/embed-bitcode.c
===================================================================
--- cfe/trunk/test/Driver/embed-bitcode.c
+++ cfe/trunk/test/Driver/embed-bitcode.c
@@ -27,6 +27,8 @@
// CHECK-SAVE-TEMP: -cc1as
// RUN: %clang -c %s -flto -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO
+// RUN: %clang -c %s -flto=full -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO
+// RUN: %clang -c %s -flto=thin -fembed-bitcode 2>&1 -### | FileCheck %s -check-prefix=CHECK-LTO
// CHECK-LTO: -cc1
// CHECK-LTO: -emit-llvm-bc
// CHECK-LTO-NOT: warning: argument unused during compilation: '-fembed-bitcode'
Index: cfe/trunk/lib/Driver/Driver.cpp
===================================================================
--- cfe/trunk/lib/Driver/Driver.cpp
+++ cfe/trunk/lib/Driver/Driver.cpp
@@ -504,9 +504,11 @@
.Default(SaveTempsCwd);
}
+ setLTOMode(Args);
+
// Ignore -fembed-bitcode options with LTO
// since the output will be bitcode anyway.
- if (!Args.hasFlag(options::OPT_flto, options::OPT_fno_lto, false)) {
+ if (getLTOMode() == LTOK_None) {
if (Arg *A = Args.getLastArg(options::OPT_fembed_bitcode_EQ)) {
StringRef Name = A->getValue();
unsigned Model = llvm::StringSwitch<unsigned>(Name)
@@ -526,8 +528,6 @@
Args.ClaimAllArgs(options::OPT_fembed_bitcode_EQ);
}
- setLTOMode(Args);
-
std::unique_ptr<llvm::opt::InputArgList> UArgs =
llvm::make_unique<InputArgList>(std::move(Args));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20374.57646.patch
Type: text/x-patch
Size: 1525 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160518/2b630121/attachment.bin>
More information about the cfe-commits
mailing list