@@ -11162,8 +11162,7 @@ bool ARMAsmParser::parseLiteralValues(unsigned Size, SMLoc L) {
11162
11162
// / parseDirectiveThumb
11163
11163
// / ::= .thumb
11164
11164
bool ARMAsmParser::parseDirectiveThumb (SMLoc L) {
11165
- if (parseToken (AsmToken::EndOfStatement, " unexpected token in directive" ) ||
11166
- check (!hasThumb (), L, " target does not support Thumb mode" ))
11165
+ if (parseEOL () || check (!hasThumb (), L, " target does not support Thumb mode" ))
11167
11166
return true ;
11168
11167
11169
11168
if (!isThumb ())
@@ -11176,8 +11175,7 @@ bool ARMAsmParser::parseDirectiveThumb(SMLoc L) {
11176
11175
// / parseDirectiveARM
11177
11176
// / ::= .arm
11178
11177
bool ARMAsmParser::parseDirectiveARM (SMLoc L) {
11179
- if (parseToken (AsmToken::EndOfStatement, " unexpected token in directive" ) ||
11180
- check (!hasARM (), L, " target does not support ARM mode" ))
11178
+ if (parseEOL () || check (!hasARM (), L, " target does not support ARM mode" ))
11181
11179
return true ;
11182
11180
11183
11181
if (isThumb ())
@@ -11216,15 +11214,13 @@ bool ARMAsmParser::parseDirectiveThumbFunc(SMLoc L) {
11216
11214
Parser.getTok ().getIdentifier ());
11217
11215
getParser ().getStreamer ().emitThumbFunc (Func);
11218
11216
Parser.Lex ();
11219
- if (parseToken (AsmToken::EndOfStatement,
11220
- " unexpected token in '.thumb_func' directive" ))
11217
+ if (parseEOL ())
11221
11218
return true ;
11222
11219
return false ;
11223
11220
}
11224
11221
}
11225
11222
11226
- if (parseToken (AsmToken::EndOfStatement,
11227
- " unexpected token in '.thumb_func' directive" ))
11223
+ if (parseEOL ())
11228
11224
return true ;
11229
11225
11230
11226
// .thumb_func implies .thumb
@@ -11253,7 +11249,7 @@ bool ARMAsmParser::parseDirectiveSyntax(SMLoc L) {
11253
11249
" '.syntax divided' arm assembly not supported" ) ||
11254
11250
check (Mode != " unified" && Mode != " UNIFIED" , L,
11255
11251
" unrecognized syntax mode in .syntax directive" ) ||
11256
- parseToken (AsmToken::EndOfStatement, " unexpected token in directive " ))
11252
+ parseEOL ( ))
11257
11253
return true ;
11258
11254
11259
11255
// TODO tell the MC streamer the mode
@@ -11275,7 +11271,7 @@ bool ARMAsmParser::parseDirectiveCode(SMLoc L) {
11275
11271
}
11276
11272
Parser.Lex ();
11277
11273
11278
- if (parseToken (AsmToken::EndOfStatement, " unexpected token in directive " ))
11274
+ if (parseEOL ( ))
11279
11275
return true ;
11280
11276
11281
11277
if (Val == 16 ) {
@@ -11455,8 +11451,7 @@ bool ARMAsmParser::parseDirectiveEabiAttr(SMLoc L) {
11455
11451
Parser.Lex ();
11456
11452
}
11457
11453
11458
- if (Parser.parseToken (AsmToken::EndOfStatement,
11459
- " unexpected token in '.eabi_attribute' directive" ))
11454
+ if (Parser.parseEOL ())
11460
11455
return true ;
11461
11456
11462
11457
if (IsIntegerValue && IsStringValue) {
@@ -11512,8 +11507,7 @@ bool ARMAsmParser::parseDirectiveFPU(SMLoc L) {
11512
11507
// / parseDirectiveFnStart
11513
11508
// / ::= .fnstart
11514
11509
bool ARMAsmParser::parseDirectiveFnStart (SMLoc L) {
11515
- if (parseToken (AsmToken::EndOfStatement,
11516
- " unexpected token in '.fnstart' directive" ))
11510
+ if (parseEOL ())
11517
11511
return true ;
11518
11512
11519
11513
if (UC.hasFnStart ()) {
@@ -11534,8 +11528,7 @@ bool ARMAsmParser::parseDirectiveFnStart(SMLoc L) {
11534
11528
// / parseDirectiveFnEnd
11535
11529
// / ::= .fnend
11536
11530
bool ARMAsmParser::parseDirectiveFnEnd (SMLoc L) {
11537
- if (parseToken (AsmToken::EndOfStatement,
11538
- " unexpected token in '.fnend' directive" ))
11531
+ if (parseEOL ())
11539
11532
return true ;
11540
11533
// Check the ordering of unwind directives
11541
11534
if (!UC.hasFnStart ())
@@ -11551,8 +11544,7 @@ bool ARMAsmParser::parseDirectiveFnEnd(SMLoc L) {
11551
11544
// / parseDirectiveCantUnwind
11552
11545
// / ::= .cantunwind
11553
11546
bool ARMAsmParser::parseDirectiveCantUnwind (SMLoc L) {
11554
- if (parseToken (AsmToken::EndOfStatement,
11555
- " unexpected token in '.cantunwind' directive" ))
11547
+ if (parseEOL ())
11556
11548
return true ;
11557
11549
11558
11550
UC.recordCantUnwind (L);
@@ -11587,8 +11579,7 @@ bool ARMAsmParser::parseDirectivePersonality(SMLoc L) {
11587
11579
StringRef Name (Parser.getTok ().getIdentifier ());
11588
11580
Parser.Lex ();
11589
11581
11590
- if (parseToken (AsmToken::EndOfStatement,
11591
- " unexpected token in '.personality' directive" ))
11582
+ if (parseEOL ())
11592
11583
return true ;
11593
11584
11594
11585
UC.recordPersonality (L);
@@ -11620,8 +11611,7 @@ bool ARMAsmParser::parseDirectivePersonality(SMLoc L) {
11620
11611
// / parseDirectiveHandlerData
11621
11612
// / ::= .handlerdata
11622
11613
bool ARMAsmParser::parseDirectiveHandlerData (SMLoc L) {
11623
- if (parseToken (AsmToken::EndOfStatement,
11624
- " unexpected token in '.handlerdata' directive" ))
11614
+ if (parseEOL ())
11625
11615
return true ;
11626
11616
11627
11617
UC.recordHandlerData (L);
@@ -11719,8 +11709,7 @@ bool ARMAsmParser::parseDirectivePad(SMLoc L) {
11719
11709
if (!CE)
11720
11710
return Error (ExLoc, " pad offset must be an immediate" );
11721
11711
11722
- if (parseToken (AsmToken::EndOfStatement,
11723
- " unexpected token in '.pad' directive" ))
11712
+ if (parseEOL ())
11724
11713
return true ;
11725
11714
11726
11715
getTargetStreamer ().emitPad (CE->getValue ());
@@ -11741,8 +11730,7 @@ bool ARMAsmParser::parseDirectiveRegSave(SMLoc L, bool IsVector) {
11741
11730
SmallVector<std::unique_ptr<MCParsedAsmOperand>, 1 > Operands;
11742
11731
11743
11732
// Parse the register list
11744
- if (parseRegisterList (Operands, true , true ) ||
11745
- parseToken (AsmToken::EndOfStatement, " unexpected token in directive" ))
11733
+ if (parseRegisterList (Operands, true , true ) || parseEOL ())
11746
11734
return true ;
11747
11735
ARMOperand &Op = (ARMOperand &)*Operands[0 ];
11748
11736
if (!IsVector && !Op.isRegList ())
@@ -11825,7 +11813,7 @@ bool ARMAsmParser::parseDirectiveInst(SMLoc Loc, char Suffix) {
11825
11813
// / parseDirectiveLtorg
11826
11814
// / ::= .ltorg | .pool
11827
11815
bool ARMAsmParser::parseDirectiveLtorg (SMLoc L) {
11828
- if (parseToken (AsmToken::EndOfStatement, " unexpected token in directive " ))
11816
+ if (parseEOL ( ))
11829
11817
return true ;
11830
11818
getTargetStreamer ().emitCurrentConstantPool ();
11831
11819
return false ;
@@ -11834,7 +11822,7 @@ bool ARMAsmParser::parseDirectiveLtorg(SMLoc L) {
11834
11822
bool ARMAsmParser::parseDirectiveEven (SMLoc L) {
11835
11823
const MCSection *Section = getStreamer ().getCurrentSectionOnly ();
11836
11824
11837
- if (parseToken (AsmToken::EndOfStatement, " unexpected token in directive " ))
11825
+ if (parseEOL ( ))
11838
11826
return true ;
11839
11827
11840
11828
if (!Section) {
@@ -11859,9 +11847,7 @@ bool ARMAsmParser::parseDirectivePersonalityIndex(SMLoc L) {
11859
11847
11860
11848
const MCExpr *IndexExpression;
11861
11849
SMLoc IndexLoc = Parser.getTok ().getLoc ();
11862
- if (Parser.parseExpression (IndexExpression) ||
11863
- parseToken (AsmToken::EndOfStatement,
11864
- " unexpected token in '.personalityindex' directive" )) {
11850
+ if (Parser.parseExpression (IndexExpression) || parseEOL ()) {
11865
11851
return true ;
11866
11852
}
11867
11853
@@ -11962,8 +11948,7 @@ bool ARMAsmParser::parseDirectiveTLSDescSeq(SMLoc L) {
11962
11948
MCSymbolRefExpr::VK_ARM_TLSDESCSEQ, getContext ());
11963
11949
Lex ();
11964
11950
11965
- if (parseToken (AsmToken::EndOfStatement,
11966
- " unexpected token in '.tlsdescseq' directive" ))
11951
+ if (parseEOL ())
11967
11952
return true ;
11968
11953
11969
11954
getTargetStreamer ().AnnotateTLSDescriptorSequence (SRE);
@@ -12004,8 +11989,7 @@ bool ARMAsmParser::parseDirectiveMovSP(SMLoc L) {
12004
11989
Offset = CE->getValue ();
12005
11990
}
12006
11991
12007
- if (parseToken (AsmToken::EndOfStatement,
12008
- " unexpected token in '.movsp' directive" ))
11992
+ if (parseEOL ())
12009
11993
return true ;
12010
11994
12011
11995
getTargetStreamer ().emitMovSP (SPReg, Offset);
@@ -12092,8 +12076,7 @@ bool ARMAsmParser::parseDirectiveSEHAllocStack(SMLoc L, bool Wide) {
12092
12076
bool ARMAsmParser::parseDirectiveSEHSaveRegs (SMLoc L, bool Wide) {
12093
12077
SmallVector<std::unique_ptr<MCParsedAsmOperand>, 1 > Operands;
12094
12078
12095
- if (parseRegisterList (Operands) ||
12096
- parseToken (AsmToken::EndOfStatement, " unexpected token in directive" ))
12079
+ if (parseRegisterList (Operands) || parseEOL ())
12097
12080
return true ;
12098
12081
ARMOperand &Op = (ARMOperand &)*Operands[0 ];
12099
12082
if (!Op.isRegList ())
@@ -12135,8 +12118,7 @@ bool ARMAsmParser::parseDirectiveSEHSaveSP(SMLoc L) {
12135
12118
bool ARMAsmParser::parseDirectiveSEHSaveFRegs (SMLoc L) {
12136
12119
SmallVector<std::unique_ptr<MCParsedAsmOperand>, 1 > Operands;
12137
12120
12138
- if (parseRegisterList (Operands) ||
12139
- parseToken (AsmToken::EndOfStatement, " unexpected token in directive" ))
12121
+ if (parseRegisterList (Operands) || parseEOL ())
12140
12122
return true ;
12141
12123
ARMOperand &Op = (ARMOperand &)*Operands[0 ];
12142
12124
if (!Op.isDPRRegList ())
@@ -12558,8 +12540,7 @@ bool ARMAsmParser::parseDirectiveArchExtension(SMLoc L) {
12558
12540
SMLoc ExtLoc = Parser.getTok ().getLoc ();
12559
12541
Lex ();
12560
12542
12561
- if (parseToken (AsmToken::EndOfStatement,
12562
- " unexpected token in '.arch_extension' directive" ))
12543
+ if (parseEOL ())
12563
12544
return true ;
12564
12545
12565
12546
if (Name == " nocrypto" ) {
0 commit comments