[PATCH] D34595: Changed Opts.EABIVersion type string to llvm::EABI enum class
Yuka Takahashi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 1 00:57:46 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL306953: Changed Opts.EABIVersion type string to llvm::EABI enum class (authored by yamaguchi).
Changed prior to commit:
https://reviews.llvm.org/D34595?vs=104976&id=104981#toc
Repository:
rL LLVM
https://reviews.llvm.org/D34595
Files:
cfe/trunk/include/clang/Basic/TargetOptions.h
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/CodeGen/BackendUtil.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
Index: cfe/trunk/lib/CodeGen/BackendUtil.cpp
===================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp
@@ -415,11 +415,7 @@
Options.RelaxELFRelocations = CodeGenOpts.RelaxELFRelocations;
// Set EABI version.
- Options.EABIVersion = llvm::StringSwitch<llvm::EABI>(TargetOpts.EABIVersion)
- .Case("4", llvm::EABI::EABI4)
- .Case("5", llvm::EABI::EABI5)
- .Case("gnu", llvm::EABI::GNU)
- .Default(llvm::EABI::Default);
+ Options.EABIVersion = TargetOpts.EABIVersion;
if (LangOpts.SjLjExceptions)
Options.ExceptionModel = llvm::ExceptionHandling::SjLj;
Index: cfe/trunk/lib/Basic/Targets.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets.cpp
+++ cfe/trunk/lib/Basic/Targets.cpp
@@ -5443,7 +5443,7 @@
if (Triple.getOS() == llvm::Triple::Linux ||
Triple.getOS() == llvm::Triple::UnknownOS)
this->MCountName =
- Opts.EABIVersion == "gnu" ? "\01__gnu_mcount_nc" : "\01mcount";
+ Opts.EABIVersion == llvm::EABI::GNU ? "\01__gnu_mcount_nc" : "\01mcount";
}
StringRef getABI() const override { return ABI; }
@@ -6283,7 +6283,7 @@
if (Triple.getOS() == llvm::Triple::Linux)
this->MCountName = "\01_mcount";
else if (Triple.getOS() == llvm::Triple::UnknownOS)
- this->MCountName = Opts.EABIVersion == "gnu" ? "\01_mcount" : "mcount";
+ this->MCountName = Opts.EABIVersion == llvm::EABI::GNU ? "\01_mcount" : "mcount";
}
StringRef getABI() const override { return ABI; }
Index: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp
@@ -2568,7 +2568,7 @@
Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
<< Value;
else
- Opts.EABIVersion = Value;
+ Opts.EABIVersion = EABIVersion;
}
Opts.CPU = Args.getLastArgValue(OPT_target_cpu);
Opts.FPMath = Args.getLastArgValue(OPT_mfpmath);
Index: cfe/trunk/include/clang/Basic/TargetOptions.h
===================================================================
--- cfe/trunk/include/clang/Basic/TargetOptions.h
+++ cfe/trunk/include/clang/Basic/TargetOptions.h
@@ -18,6 +18,7 @@
#include <string>
#include <vector>
#include "clang/Basic/OpenCLOptions.h"
+#include "llvm/Target/TargetOptions.h"
namespace clang {
@@ -41,7 +42,7 @@
std::string ABI;
/// The EABI version to use
- std::string EABIVersion;
+ llvm::EABI EABIVersion;
/// If given, the version string of the linker in use.
std::string LinkerVersion;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34595.104981.patch
Type: text/x-patch
Size: 2877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170701/5bc39499/attachment.bin>
More information about the llvm-commits
mailing list