Skip to content

Commit

Permalink
Changed Opts.EABIVersion type string to llvm::EABI enum class
Browse files Browse the repository at this point in the history
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

llvm-svn: 306953
  • Loading branch information
yamaguchi1024 committed Jul 1, 2017
1 parent ef1c2ba commit dc77150
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion clang/include/clang/Basic/TargetOptions.h
Expand Up @@ -18,6 +18,7 @@
#include <string>
#include <vector>
#include "clang/Basic/OpenCLOptions.h"
#include "llvm/Target/TargetOptions.h"

namespace clang {

Expand All @@ -41,7 +42,7 @@ class TargetOptions {
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;
Expand Down
4 changes: 2 additions & 2 deletions clang/lib/Basic/Targets.cpp
Expand Up @@ -5443,7 +5443,7 @@ class ARMTargetInfo : public TargetInfo {
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; }
Expand Down Expand Up @@ -6283,7 +6283,7 @@ class AArch64TargetInfo : public TargetInfo {
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; }
Expand Down
6 changes: 1 addition & 5 deletions clang/lib/CodeGen/BackendUtil.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Frontend/CompilerInvocation.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit dc77150

Please sign in to comment.