r259950 - Eliminate an unnecessary enum, use the LLVM version. NFC
Paul Robinson via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 5 15:23:25 PST 2016
Author: probinson
Date: Fri Feb 5 17:23:25 2016
New Revision: 259950
URL: http://llvm.org/viewvc/llvm-project?rev=259950&view=rev
Log:
Eliminate an unnecessary enum, use the LLVM version. NFC
Modified:
cfe/trunk/include/clang/Frontend/CodeGenOptions.def
cfe/trunk/include/clang/Frontend/CodeGenOptions.h
cfe/trunk/lib/CodeGen/BackendUtil.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=259950&r1=259949&r2=259950&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Fri Feb 5 17:23:25 2016
@@ -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.
Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.h?rev=259950&r1=259949&r2=259950&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.h Fri Feb 5 17:23:25 2016
@@ -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 <map>
#include <memory>
#include <string>
@@ -59,13 +60,6 @@ public:
Mixed = 2
};
- enum DebuggerKind {
- DebuggerKindDefault,
- DebuggerKindGDB,
- DebuggerKindLLDB,
- DebuggerKindSCE
- };
-
enum TLSModel {
GeneralDynamicTLSModel,
LocalDynamicTLSModel,
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=259950&r1=259949&r2=259950&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Feb 5 17:23:25 2016
@@ -558,19 +558,7 @@ TargetMachine *EmitAssemblyHelper::Creat
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;
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=259950&r1=259949&r2=259950&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Feb 5 17:23:25 2016
@@ -428,15 +428,15 @@ static bool ParseCodeGenArgs(CodeGenOpti
}
if (Arg *A = Args.getLastArg(OPT_debugger_tuning_EQ)) {
unsigned Val = llvm::StringSwitch<unsigned>(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<CodeGenOptions::DebuggerKind>(Val));
+ Opts.setDebuggerTuning(static_cast<llvm::DebuggerKind>(Val));
}
Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags);
Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);
More information about the cfe-commits
mailing list