[MC] Parse end-of-line for .addrsig & .addrsig_sym

This commit is contained in:
Fangrui Song 2021-03-06 16:26:27 -08:00
parent fd785f98aa
commit e5eb3e3836
2 changed files with 9 additions and 7 deletions

View File

@ -5782,14 +5782,16 @@ bool AsmParser::parseDirectivePrint(SMLoc DirectiveLoc) {
}
bool AsmParser::parseDirectiveAddrsig() {
if (parseToken(AsmToken::EndOfStatement))
return true;
getStreamer().emitAddrsig();
return false;
}
bool AsmParser::parseDirectiveAddrsigSym() {
StringRef Name;
if (check(parseIdentifier(Name),
"expected identifier in '.addrsig_sym' directive"))
if (check(parseIdentifier(Name), "expected identifier") ||
parseToken(AsmToken::EndOfStatement))
return true;
MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
getStreamer().emitAddrsigSym(Sym);

View File

@ -71,15 +71,15 @@
// CHECK-NEXT: ]
// ASM: .addrsig
// ASM-NEXT: .addrsig_sym g1
.addrsig
// ASM: .addrsig_sym g1
.addrsig_sym g1
.globl g2
// ASM: .addrsig_sym g3
// ASM-NEXT: .addrsig_sym local
// ASM-NEXT: .addrsig_sym .Llocal
.addrsig_sym g3
// ASM: .addrsig_sym local
.addrsig_sym local
// ASM: .addrsig_sym .Llocal
.addrsig_sym .Llocal
local: