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



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to