From: Paul Robinson Date: Fri, 5 Feb 2016 23:23:25 +0000 (+0000) Subject: Eliminate an unnecessary enum, use the LLVM version. NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baf0087842d82d18a1a6e134e1c482dc4cf3e0bd;p=clang Eliminate an unnecessary enum, use the LLVM version. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259950 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/CodeGenOptions.def b/include/clang/Frontend/CodeGenOptions.def index 102c5aa4c0..4b89ee3201 100644 --- a/include/clang/Frontend/CodeGenOptions.def +++ b/include/clang/Frontend/CodeGenOptions.def @@ -188,7 +188,8 @@ VALUE_CODEGENOPT(SSPBufferSize, 32, 0) ENUM_CODEGENOPT(DebugInfo, codegenoptions::DebugInfoKind, 3, codegenoptions::NoDebugInfo) /// Tune the debug info for this debugger. -ENUM_CODEGENOPT(DebuggerTuning, DebuggerKind, 2, DebuggerKindDefault) +ENUM_CODEGENOPT(DebuggerTuning, llvm::DebuggerKind, 2, + llvm::DebuggerKind::Default) /// Dwarf version. Version zero indicates to LLVM that no DWARF should be /// emitted. diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index a43105b231..245b6e9177 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -17,6 +17,7 @@ #include "clang/Basic/DebugInfoOptions.h" #include "clang/Basic/Sanitizers.h" #include "llvm/Support/Regex.h" +#include "llvm/Target/TargetOptions.h" #include #include #include @@ -59,13 +60,6 @@ public: Mixed = 2 }; - enum DebuggerKind { - DebuggerKindDefault, - DebuggerKindGDB, - DebuggerKindLLDB, - DebuggerKindSCE - }; - enum TLSModel { GeneralDynamicTLSModel, LocalDynamicTLSModel, diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index d8f96db55a..032b2961c1 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -558,19 +558,7 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) { Options.DataSections = CodeGenOpts.DataSections; Options.UniqueSectionNames = CodeGenOpts.UniqueSectionNames; Options.EmulatedTLS = CodeGenOpts.EmulatedTLS; - switch (CodeGenOpts.getDebuggerTuning()) { - case CodeGenOptions::DebuggerKindGDB: - Options.DebuggerTuning = llvm::DebuggerKind::GDB; - break; - case CodeGenOptions::DebuggerKindLLDB: - Options.DebuggerTuning = llvm::DebuggerKind::LLDB; - break; - case CodeGenOptions::DebuggerKindSCE: - Options.DebuggerTuning = llvm::DebuggerKind::SCE; - break; - default: - break; - } + Options.DebuggerTuning = CodeGenOpts.getDebuggerTuning(); Options.MCOptions.MCRelaxAll = CodeGenOpts.RelaxAll; Options.MCOptions.MCSaveTempLabels = CodeGenOpts.SaveTempLabels; diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index f085af3086..2403385ca4 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -428,15 +428,15 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, } if (Arg *A = Args.getLastArg(OPT_debugger_tuning_EQ)) { unsigned Val = llvm::StringSwitch(A->getValue()) - .Case("gdb", CodeGenOptions::DebuggerKindGDB) - .Case("lldb", CodeGenOptions::DebuggerKindLLDB) - .Case("sce", CodeGenOptions::DebuggerKindSCE) + .Case("gdb", unsigned(llvm::DebuggerKind::GDB)) + .Case("lldb", unsigned(llvm::DebuggerKind::LLDB)) + .Case("sce", unsigned(llvm::DebuggerKind::SCE)) .Default(~0U); if (Val == ~0U) Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << A->getValue(); else - Opts.setDebuggerTuning(static_cast(Val)); + Opts.setDebuggerTuning(static_cast(Val)); } Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags); Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);