summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuka Takahashi <yukatkh@gmail.com>2017-07-01 07:57:23 +0000
committerYuka Takahashi <yukatkh@gmail.com>2017-07-01 07:57:23 +0000
commit6439f18f22a00589c57821e2d15c67f9bb566ba3 (patch)
treebe620f933f52ed4b80df73bcb8317ad21d938f8c
parent6ac9c51ede0a50cca13dd4ac03562c036f7a3f48 (diff)
Changed Opts.EABIVersion type string to llvm::EABI enum class
Summary: Changed EABIVersion type from string to llvm::EABI. It seems it was just a typo and this is intended implementation. Differential Revision: https://reviews.llvm.org/D34595 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306953 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/TargetOptions.h3
-rw-r--r--lib/Basic/Targets.cpp4
-rw-r--r--lib/CodeGen/BackendUtil.cpp6
-rw-r--r--lib/Frontend/CompilerInvocation.cpp2
4 files changed, 6 insertions, 9 deletions
diff --git a/include/clang/Basic/TargetOptions.h b/include/clang/Basic/TargetOptions.h
index 6ca1ba39c8..9bb19c7b79 100644
--- a/include/clang/Basic/TargetOptions.h
+++ b/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 @@ public:
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;
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index e1af6415b2..eae010a4bd 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -5443,7 +5443,7 @@ public:
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 @@ public:
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; }
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index b528cb467b..9b3850abcc 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -415,11 +415,7 @@ static void initTargetOptions(llvm::TargetOptions &Options,
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;
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 5851595dab..00f6b9b46f 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -2568,7 +2568,7 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args,
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);