[Mlir-commits] [mlir] [NFC][CodeGen] Change CodeGenOpt::Level/CodeGenFileType into enum classes (PR #66295)

Paul T Robinson llvmlistbot at llvm.org
Thu Sep 14 06:46:23 PDT 2023


================
@@ -661,27 +661,27 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
 
 static unsigned getOptimizationLevel(ArgList &Args, InputKind IK,
                                      DiagnosticsEngine &Diags) {
-  unsigned DefaultOpt = llvm::CodeGenOpt::None;
+  unsigned DefaultOpt = 0;
   if ((IK.getLanguage() == Language::OpenCL ||
        IK.getLanguage() == Language::OpenCLCXX) &&
       !Args.hasArg(OPT_cl_opt_disable))
-    DefaultOpt = llvm::CodeGenOpt::Default;
+    DefaultOpt = 2;
----------------
pogo59 wrote:

I'm not keen on having these as magic numbers. Surely you can 
`static_cast<unsigned>(CodeGenOptLevel::Default)` or whatever.

https://github.com/llvm/llvm-project/pull/66295


More information about the Mlir-commits mailing list