[PATCH] D29065: Split isUsingLTO() outside of embedBitcodeInObject() and embedBitcodeMarkerOnly().
Mehdi AMINI via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 23 18:40:02 PST 2017
mehdi_amini created this revision.
These accessors maps directly to the command line option.
https://reviews.llvm.org/D29065
Files:
clang/include/clang/Driver/Driver.h
clang/lib/Driver/Driver.cpp
clang/lib/Driver/Tools.cpp
Index: clang/lib/Driver/Tools.cpp
===================================================================
--- clang/lib/Driver/Tools.cpp
+++ clang/lib/Driver/Tools.cpp
@@ -4258,14 +4258,14 @@
}
// Embed-bitcode option.
- if (C.getDriver().embedBitcodeInObject() &&
+ if (C.getDriver().embedBitcodeInObject() && !C.getDriver().isUsingLTO() &&
(isa<BackendJobAction>(JA) || isa<AssembleJobAction>(JA))) {
// Add flags implied by -fembed-bitcode.
Args.AddLastArg(CmdArgs, options::OPT_fembed_bitcode_EQ);
// Disable all llvm IR level optimizations.
CmdArgs.push_back("-disable-llvm-passes");
}
- if (C.getDriver().embedBitcodeMarkerOnly())
+ if (C.getDriver().embedBitcodeMarkerOnly() && !C.getDriver().isUsingLTO())
CmdArgs.push_back("-fembed-bitcode=marker");
// We normally speed up the clang process a bit by skipping destructors at
@@ -6461,7 +6461,8 @@
// pristine IR generated by the frontend. Ideally, a new compile action should
// be added so both IR can be captured.
if (C.getDriver().isSaveTempsEnabled() &&
- !C.getDriver().embedBitcodeInObject() && isa<CompileJobAction>(JA))
+ !C.getDriver().embedBitcodeInObject() && !C.getDriver().isUsingLTO() &&
+ isa<CompileJobAction>(JA))
CmdArgs.push_back("-disable-llvm-passes");
if (Output.getType() == types::TY_Dependencies) {
Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -3180,7 +3180,8 @@
const JobAction *JA = cast<JobAction>(A);
ActionList CollapsedOffloadActions;
- ToolSelector TS(JA, *TC, C, isSaveTempsEnabled(), embedBitcodeInObject());
+ ToolSelector TS(JA, *TC, C, isSaveTempsEnabled(),
+ embedBitcodeInObject() && !isUsingLTO());
const Tool *T = TS.getTool(Inputs, CollapsedOffloadActions);
if (!T)
Index: clang/include/clang/Driver/Driver.h
===================================================================
--- clang/include/clang/Driver/Driver.h
+++ clang/include/clang/Driver/Driver.h
@@ -304,13 +304,8 @@
bool isSaveTempsObj() const { return SaveTemps == SaveTempsObj; }
bool embedBitcodeEnabled() const { return BitcodeEmbed != EmbedNone; }
- bool embedBitcodeInObject() const {
- // LTO has no object file output so ignore embed bitcode option in LTO.
- return (BitcodeEmbed == EmbedBitcode) && !isUsingLTO();
- }
- bool embedBitcodeMarkerOnly() const {
- return (BitcodeEmbed == EmbedMarker) && !isUsingLTO();
- }
+ bool embedBitcodeInObject() const { return (BitcodeEmbed == EmbedBitcode); }
+ bool embedBitcodeMarkerOnly() const { return (BitcodeEmbed == EmbedMarker); }
/// Compute the desired OpenMP runtime from the flags provided.
OpenMPRuntimeKind getOpenMPRuntime(const llvm::opt::ArgList &Args) const;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29065.85511.patch
Type: text/x-patch
Size: 2861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170124/c7dc64b8/attachment.bin>
More information about the cfe-commits
mailing list