diff options
author | Sam Parker <sam.parker@arm.com> | 2018-11-26 17:26:49 +0000 |
---|---|---|
committer | Sam Parker <sam.parker@arm.com> | 2018-11-26 17:26:49 +0000 |
commit | 000fbab01c943795f4ca2523a54433e5e450ba9d (patch) | |
tree | 3eef360fdb16ac67d58669f29f99efb9bc4cc09f /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | dcdf3ddff57edba3d57ed7983a74e27e09d6869b (diff) | |
download | bcm5719-llvm-000fbab01c943795f4ca2523a54433e5e450ba9d.tar.gz bcm5719-llvm-000fbab01c943795f4ca2523a54433e5e450ba9d.zip |
[NFC] Replace magic numbers with CodeGenOpt enums
Use enum values from llvm/Support/CodeGen.h for the optimisation
levels in CompilerInvocation.
llvm-svn: 347577
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 70a2e225c25..8840e2ed004 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -120,25 +120,25 @@ CompilerInvocationBase::~CompilerInvocationBase() = default; static unsigned getOptimizationLevel(ArgList &Args, InputKind IK, DiagnosticsEngine &Diags) { - unsigned DefaultOpt = 0; + unsigned DefaultOpt = llvm::CodeGenOpt::None; if (IK.getLanguage() == InputKind::OpenCL && !Args.hasArg(OPT_cl_opt_disable)) - DefaultOpt = 2; + DefaultOpt = llvm::CodeGenOpt::Default; if (Arg *A = Args.getLastArg(options::OPT_O_Group)) { if (A->getOption().matches(options::OPT_O0)) - return 0; + return llvm::CodeGenOpt::None; if (A->getOption().matches(options::OPT_Ofast)) - return 3; + return llvm::CodeGenOpt::Aggressive; assert(A->getOption().matches(options::OPT_O)); StringRef S(A->getValue()); if (S == "s" || S == "z" || S.empty()) - return 2; + return llvm::CodeGenOpt::Default; if (S == "g") - return 1; + return llvm::CodeGenOpt::Less; return getLastArgIntValue(Args, OPT_O, DefaultOpt, Diags); } |