diff options
author | Jessica Paquette <jpaquette@apple.com> | 2018-06-25 23:20:18 +0000 |
---|---|---|
committer | Jessica Paquette <jpaquette@apple.com> | 2018-06-25 23:20:18 +0000 |
commit | b9d5ee568a5c14f879e0af809945eaa090a24ebe (patch) | |
tree | a68df8a5fa9fbeecd2d117989b49bdf8541b014c /clang/lib | |
parent | 48c4885fe70087d9388424db68c744ce80c560c0 (diff) | |
download | bcm5719-llvm-b9d5ee568a5c14f879e0af809945eaa090a24ebe.tar.gz bcm5719-llvm-b9d5ee568a5c14f879e0af809945eaa090a24ebe.zip |
[MachineOutliner] NFC - simplify -moutline/-mno-outline logic
It's a bit cleaner to use `hasFlag` instead of nested ifs. This
just refactors the -moutline/-mno-outline logic to use that.
llvm-svn: 335549
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/ToolChains/Clang.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 5cb37967235..327fa6b57b5 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -1477,19 +1477,16 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, CmdArgs.push_back("-aarch64-enable-global-merge=true"); } - if (Arg *A = Args.getLastArg(options::OPT_moutline, - options::OPT_mno_outline)) { - if (A->getOption().matches(options::OPT_moutline)) { - CmdArgs.push_back("-mllvm"); - CmdArgs.push_back("-enable-machine-outliner"); + if (Args.hasFlag(options::OPT_moutline, options::OPT_mno_outline, false)) { + CmdArgs.push_back("-mllvm"); + CmdArgs.push_back("-enable-machine-outliner"); - // The outliner shouldn't compete with linkers that dedupe linkonceodr - // functions in LTO. Enable that behaviour by default when compiling with - // LTO. - if (getToolChain().getDriver().isUsingLTO()) { - CmdArgs.push_back("-mllvm"); - CmdArgs.push_back("-enable-linkonceodr-outlining"); - } + // The outliner shouldn't compete with linkers that dedupe linkonceodr + // functions in LTO. Enable that behaviour by default when compiling with + // LTO. + if (getToolChain().getDriver().isUsingLTO()) { + CmdArgs.push_back("-mllvm"); + CmdArgs.push_back("-enable-linkonceodr-outlining"); } } } |