Skip to content

Commit 0c8f4f8

Browse files
committed
Reenable -disable-llvm-passes lost in pulldown.
1 parent 0b9a749 commit 0c8f4f8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4463,8 +4463,7 @@ def disable_llvm_verifier : Flag<["-"], "disable-llvm-verifier">,
44634463
MarshallingInfoNegativeFlag<"CodeGenOpts.VerifyModule">;
44644464
def disable_llvm_passes : Flag<["-"], "disable-llvm-passes">,
44654465
HelpText<"Use together with -emit-llvm to get pristine LLVM IR from the "
4466-
"frontend by not running any LLVM passes at all">,
4467-
MarshallingInfoFlag<"CodeGenOpts.DisableLLVMPasses">;
4466+
"frontend by not running any LLVM passes at all">;
44684467
def disable_llvm_optzns : Flag<["-"], "disable-llvm-optzns">,
44694468
Alias<disable_llvm_passes>;
44704469
def disable_lifetimemarkers : Flag<["-"], "disable-lifetime-markers">,

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,11 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
923923
{std::string(Split.first), std::string(Split.second)});
924924
}
925925

926+
Opts.DisableLLVMPasses =
927+
Args.hasArg(OPT_disable_llvm_passes) ||
928+
(Args.hasArg(OPT_fsycl_is_device) && Triple.isSPIR() &&
929+
Args.hasArg(OPT_fno_sycl_early_optimizations));
930+
926931
const llvm::Triple::ArchType DebugEntryValueArchs[] = {
927932
llvm::Triple::x86, llvm::Triple::x86_64, llvm::Triple::aarch64,
928933
llvm::Triple::arm, llvm::Triple::armeb, llvm::Triple::mips,

0 commit comments

Comments
 (0)