From 0a1aa6cda2758b0926a95f87d39ffefb1cb90200 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Thu, 14 Sep 2023 14:10:14 -0700 Subject: [NFC][CodeGen] Change CodeGenOpt::Level/CodeGenFileType into enum classes (#66295) This will make it easy for callers to see issues with and fix up calls to createTargetMachine after a future change to the params of TargetMachine. This matches other nearby enums. For downstream users, this should be a fairly straightforward replacement, e.g. s/CodeGenOpt::Aggressive/CodeGenOptLevel::Aggressive or s/CGFT_/CodeGenFileType:: --- flang/lib/Frontend/CompilerInvocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index dba2ac1..6c0b90c 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -98,12 +98,12 @@ static bool parseShowColorsArgs(const llvm::opt::ArgList &args, /// Extracts the optimisation level from \a args. static unsigned getOptimizationLevel(llvm::opt::ArgList &args, clang::DiagnosticsEngine &diags) { - unsigned defaultOpt = llvm::CodeGenOpt::None; + unsigned defaultOpt = 0; if (llvm::opt::Arg *a = args.getLastArg(clang::driver::options::OPT_O_Group)) { if (a->getOption().matches(clang::driver::options::OPT_O0)) - return llvm::CodeGenOpt::None; + return 0; assert(a->getOption().matches(clang::driver::options::OPT_O)); -- cgit v1.1