forked from OSchip/llvm-project
Split isUsingLTO() outside of embedBitcodeInObject() and embedBitcodeMarkerOnly().
Summary: These accessors maps directly to the command line option. Reviewers: steven_wu Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29065 llvm-svn: 292960
This commit is contained in:
parent
8e11fbd15d
commit
6683e22c25
|
@ -304,13 +304,8 @@ public:
|
|||
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;
|
||||
|
|
|
@ -3180,7 +3180,8 @@ InputInfo Driver::BuildJobsForActionNoCache(
|
|||
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)
|
||||
|
|
|
@ -4258,14 +4258,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
}
|
||||
|
||||
// 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 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
// 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) {
|
||||
|
|
Loading…
Reference in New Issue