[PATCH] D34595: Made OPT_meabi value handling simpler
Yuka Takahashi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 24 07:18:28 PDT 2017
yamaguchi created this revision.
It was just checking if Value is variable or not, so I thought we don't
need StringSwitches here.
https://reviews.llvm.org/D34595
Files:
clang/lib/Frontend/CompilerInvocation.cpp
Index: clang/lib/Frontend/CompilerInvocation.cpp
===================================================================
--- clang/lib/Frontend/CompilerInvocation.cpp
+++ clang/lib/Frontend/CompilerInvocation.cpp
@@ -2547,17 +2547,11 @@
Opts.ABI = Args.getLastArgValue(OPT_target_abi);
if (Arg *A = Args.getLastArg(OPT_meabi)) {
StringRef Value = A->getValue();
- llvm::EABI EABIVersion = llvm::StringSwitch<llvm::EABI>(Value)
- .Case("default", llvm::EABI::Default)
- .Case("4", llvm::EABI::EABI4)
- .Case("5", llvm::EABI::EABI5)
- .Case("gnu", llvm::EABI::GNU)
- .Default(llvm::EABI::Unknown);
- if (EABIVersion == llvm::EABI::Unknown)
+ if (Value == "default" || Value == "4" || Value == "5" || Value == "gnu")
+ Opts.EABIVersion = Value;
+ else
Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
<< Value;
- else
- Opts.EABIVersion = Value;
}
Opts.CPU = Args.getLastArgValue(OPT_target_cpu);
Opts.FPMath = Args.getLastArgValue(OPT_mfpmath);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34595.103840.patch
Type: text/x-patch
Size: 1217 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170624/3e2b3f99/attachment.bin>
More information about the llvm-commits
mailing list