[PATCH] D14184: [clang] Add initial support for -meabi flag
Renato Golin via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 3 04:53:57 PST 2015
rengolin added inline comments.
================
Comment at: lib/Frontend/CompilerInvocation.cpp:458
@@ +457,3 @@
+ StringRef Value = A->getValue();
+ bool Valid = llvm::StringSwitch<bool>(Value)
+ .Case("default", true)
----------------
tinti wrote:
> tinti wrote:
> > compnerd wrote:
> > > If `llvm::EABI::EABIVersionType` had an `Invalid` value in the enumeration, you could convert directly to the value here, and report the error if the value was `Invalid`.
> > I chose this way because none of the other target options have it [1].
> >
> > Do you prefer with it?
> >
> > [1] https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Target/TargetOptions.h#L27
> Looks like that in LLVM the Invalid is not defined but in Clang there are target specific enums that define them [1].
>
> [1] https://github.com/llvm-mirror/clang/blob/master/lib/Driver/Tools.h#L263
@compnerd, it seems that this code is already checking for invalid values, I'm not sure what you're asking about.
Also, EABI::EABIVersionType has no field Invalid, and I don't think it should, either.
http://reviews.llvm.org/D14184
More information about the cfe-commits
mailing list