[llvm] r333403 - [mips] Escape else-after-return. NFC
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 4 14:32:06 PDT 2018
Ah, I wasn't clear on what you meant by "escape" - avoid/remove? Sure sure,
seems good. Thanks! :)
On Mon, Jun 4, 2018 at 1:50 PM Simon Atanasyan <simon at atanasyan.com> wrote:
> I hope the change is just refactoring and does not change any
> functionality.
>
> On Mon, Jun 4, 2018 at 7:57 PM, David Blaikie <dblaikie at gmail.com> wrote:
> > Test case?
> >
> > On Tue, May 29, 2018 at 2:55 AM Simon Atanasyan via llvm-commits
> > <llvm-commits at lists.llvm.org> wrote:
> >>
> >> Author: atanasyan
> >> Date: Tue May 29 02:51:28 2018
> >> New Revision: 333403
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=333403&view=rev
> >> Log:
> >> [mips] Escape else-after-return. NFC
> >>
> >> Modified:
> >> llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> >>
> >> Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
> >> URL:
> >>
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=333403&r1=333402&r2=333403&view=diff
> >>
> >>
> ==============================================================================
> >> --- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
> >> +++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Tue May 29
> >> 02:51:28 2018
> >> @@ -7210,130 +7210,131 @@ bool MipsAsmParser::parseDirectiveNaN()
> >> }
> >>
> >> bool MipsAsmParser::parseDirectiveSet() {
> >> - MCAsmParser &Parser = getParser();
> >> - // Get the next token.
> >> - const AsmToken &Tok = Parser.getTok();
> >> + const AsmToken &Tok = getParser().getTok();
> >> + StringRef IdVal = Tok.getString();
> >> + SMLoc Loc = Tok.getLoc();
> >>
> >> - if (Tok.getString() == "noat") {
> >> + if (IdVal == "noat")
> >> return parseSetNoAtDirective();
> >> - } else if (Tok.getString() == "at") {
> >> + if (IdVal == "at")
> >> return parseSetAtDirective();
> >> - } else if (Tok.getString() == "arch") {
> >> + if (IdVal == "arch")
> >> return parseSetArchDirective();
> >> - } else if (Tok.getString() == "bopt") {
> >> - Warning(Tok.getLoc(), "'bopt' feature is unsupported");
> >> + if (IdVal == "bopt") {
> >> + Warning(Loc, "'bopt' feature is unsupported");
> >> getParser().Lex();
> >> return false;
> >> - } else if (Tok.getString() == "nobopt") {
> >> + }
> >> + if (IdVal == "nobopt") {
> >> // We're already running in nobopt mode, so nothing to do.
> >> getParser().Lex();
> >> return false;
> >> - } else if (Tok.getString() == "fp") {
> >> + }
> >> + if (IdVal == "fp")
> >> return parseSetFpDirective();
> >> - } else if (Tok.getString() == "oddspreg") {
> >> + if (IdVal == "oddspreg")
> >> return parseSetOddSPRegDirective();
> >> - } else if (Tok.getString() == "nooddspreg") {
> >> + if (IdVal == "nooddspreg")
> >> return parseSetNoOddSPRegDirective();
> >> - } else if (Tok.getString() == "pop") {
> >> + if (IdVal == "pop")
> >> return parseSetPopDirective();
> >> - } else if (Tok.getString() == "push") {
> >> + if (IdVal == "push")
> >> return parseSetPushDirective();
> >> - } else if (Tok.getString() == "reorder") {
> >> + if (IdVal == "reorder")
> >> return parseSetReorderDirective();
> >> - } else if (Tok.getString() == "noreorder") {
> >> + if (IdVal == "noreorder")
> >> return parseSetNoReorderDirective();
> >> - } else if (Tok.getString() == "macro") {
> >> + if (IdVal == "macro")
> >> return parseSetMacroDirective();
> >> - } else if (Tok.getString() == "nomacro") {
> >> + if (IdVal == "nomacro")
> >> return parseSetNoMacroDirective();
> >> - } else if (Tok.getString() == "mips16") {
> >> + if (IdVal == "mips16")
> >> return parseSetMips16Directive();
> >> - } else if (Tok.getString() == "nomips16") {
> >> + if (IdVal == "nomips16")
> >> return parseSetNoMips16Directive();
> >> - } else if (Tok.getString() == "nomicromips") {
> >> + if (IdVal == "nomicromips") {
> >> clearFeatureBits(Mips::FeatureMicroMips, "micromips");
> >> getTargetStreamer().emitDirectiveSetNoMicroMips();
> >> - Parser.eatToEndOfStatement();
> >> + getParser().eatToEndOfStatement();
> >> return false;
> >> - } else if (Tok.getString() == "micromips") {
> >> + }
> >> + if (IdVal == "micromips") {
> >> if (hasMips64r6()) {
> >> - Error(Tok.getLoc(),
> >> - ".set micromips directive is not supported with MIPS64R6");
> >> + Error(Loc, ".set micromips directive is not supported with
> >> MIPS64R6");
> >> return false;
> >> }
> >> return parseSetFeature(Mips::FeatureMicroMips);
> >> - } else if (Tok.getString() == "mips0") {
> >> + }
> >> + if (IdVal == "mips0")
> >> return parseSetMips0Directive();
> >> - } else if (Tok.getString() == "mips1") {
> >> + if (IdVal == "mips1")
> >> return parseSetFeature(Mips::FeatureMips1);
> >> - } else if (Tok.getString() == "mips2") {
> >> + if (IdVal == "mips2")
> >> return parseSetFeature(Mips::FeatureMips2);
> >> - } else if (Tok.getString() == "mips3") {
> >> + if (IdVal == "mips3")
> >> return parseSetFeature(Mips::FeatureMips3);
> >> - } else if (Tok.getString() == "mips4") {
> >> + if (IdVal == "mips4")
> >> return parseSetFeature(Mips::FeatureMips4);
> >> - } else if (Tok.getString() == "mips5") {
> >> + if (IdVal == "mips5")
> >> return parseSetFeature(Mips::FeatureMips5);
> >> - } else if (Tok.getString() == "mips32") {
> >> + if (IdVal == "mips32")
> >> return parseSetFeature(Mips::FeatureMips32);
> >> - } else if (Tok.getString() == "mips32r2") {
> >> + if (IdVal == "mips32r2")
> >> return parseSetFeature(Mips::FeatureMips32r2);
> >> - } else if (Tok.getString() == "mips32r3") {
> >> + if (IdVal == "mips32r3")
> >> return parseSetFeature(Mips::FeatureMips32r3);
> >> - } else if (Tok.getString() == "mips32r5") {
> >> + if (IdVal == "mips32r5")
> >> return parseSetFeature(Mips::FeatureMips32r5);
> >> - } else if (Tok.getString() == "mips32r6") {
> >> + if (IdVal == "mips32r6")
> >> return parseSetFeature(Mips::FeatureMips32r6);
> >> - } else if (Tok.getString() == "mips64") {
> >> + if (IdVal == "mips64")
> >> return parseSetFeature(Mips::FeatureMips64);
> >> - } else if (Tok.getString() == "mips64r2") {
> >> + if (IdVal == "mips64r2")
> >> return parseSetFeature(Mips::FeatureMips64r2);
> >> - } else if (Tok.getString() == "mips64r3") {
> >> + if (IdVal == "mips64r3")
> >> return parseSetFeature(Mips::FeatureMips64r3);
> >> - } else if (Tok.getString() == "mips64r5") {
> >> + if (IdVal == "mips64r5")
> >> return parseSetFeature(Mips::FeatureMips64r5);
> >> - } else if (Tok.getString() == "mips64r6") {
> >> + if (IdVal == "mips64r6") {
> >> if (inMicroMipsMode()) {
> >> - Error(Tok.getLoc(), "MIPS64R6 is not supported with microMIPS");
> >> + Error(Loc, "MIPS64R6 is not supported with microMIPS");
> >> return false;
> >> }
> >> return parseSetFeature(Mips::FeatureMips64r6);
> >> - } else if (Tok.getString() == "dsp") {
> >> + }
> >> + if (IdVal == "dsp")
> >> return parseSetFeature(Mips::FeatureDSP);
> >> - } else if (Tok.getString() == "dspr2") {
> >> + if (IdVal == "dspr2")
> >> return parseSetFeature(Mips::FeatureDSPR2);
> >> - } else if (Tok.getString() == "nodsp") {
> >> + if (IdVal == "nodsp")
> >> return parseSetNoDspDirective();
> >> - } else if (Tok.getString() == "msa") {
> >> + if (IdVal == "msa")
> >> return parseSetMsaDirective();
> >> - } else if (Tok.getString() == "nomsa") {
> >> + if (IdVal == "nomsa")
> >> return parseSetNoMsaDirective();
> >> - } else if (Tok.getString() == "mt") {
> >> + if (IdVal == "mt")
> >> return parseSetMtDirective();
> >> - } else if (Tok.getString() == "nomt") {
> >> + if (IdVal == "nomt")
> >> return parseSetNoMtDirective();
> >> - } else if (Tok.getString() == "softfloat") {
> >> + if (IdVal == "softfloat")
> >> return parseSetSoftFloatDirective();
> >> - } else if (Tok.getString() == "hardfloat") {
> >> + if (IdVal == "hardfloat")
> >> return parseSetHardFloatDirective();
> >> - } else if (Tok.getString() == "crc") {
> >> + if (IdVal == "crc")
> >> return parseSetFeature(Mips::FeatureCRC);
> >> - } else if (Tok.getString() == "nocrc") {
> >> + if (IdVal == "nocrc")
> >> return parseSetNoCRCDirective();
> >> - } else if (Tok.getString() == "virt") {
> >> + if (IdVal == "virt")
> >> return parseSetFeature(Mips::FeatureVirt);
> >> - } else if (Tok.getString() == "novirt") {
> >> + if (IdVal == "novirt")
> >> return parseSetNoVirtDirective();
> >> - } else if (Tok.getString() == "ginv") {
> >> + if (IdVal == "ginv")
> >> return parseSetFeature(Mips::FeatureGINV);
> >> - } else if (Tok.getString() == "noginv") {
> >> + if (IdVal == "noginv")
> >> return parseSetNoGINVDirective();
> >> - } else {
> >> - // It is just an identifier, look for an assignment.
> >> - return parseSetAssignment();
> >> - }
> >>
> >> - return true;
> >> + // It is just an identifier, look for an assignment.
> >> + return parseSetAssignment();
> >> }
> >>
> >> /// parseDataDirective
> >>
> >>
> >> _______________________________________________
> >> llvm-commits mailing list
> >> llvm-commits at lists.llvm.org
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
> --
> Simon Atanasyan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180604/8cf54773/attachment.html>
More information about the llvm-commits
mailing list