[PATCH] D34595: Changed Opts.EABIVersion type string to llvm::EABI enum class

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 30 20:12:30 PDT 2017


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:2550
     StringRef Value = A->getValue();
     llvm::EABI EABIVersion = llvm::StringSwitch<llvm::EABI>(Value)
                                  .Case("default", llvm::EABI::Default)
----------------
yamaguchi wrote:
> ruiu wrote:
> > ruiu wrote:
> > > yamaguchi wrote:
> > > > ruiu wrote:
> > > > > How about assigning directly to Opts.EABIVersion? If you do, you can eliminate this temporary variable.
> > > > @ruiu 
> > > > I thought about it, but I was not sure if we can set llvm::EABI::Unknown to Opts.EABIVersion.
> > > In terms of your system, you can. And if you abort when it is Unknown, it doesn't matter whether it's unknown or not, no?
> > Sorry for the silly typo. I meant "in terms of the type system".
> I'm not very happy about setting invalid value to Opts.EABIVersion, but I will change this if you strongly feel so.
I'm fine with your code. Mine was just a suggestion.


https://reviews.llvm.org/D34595





More information about the llvm-commits mailing list