mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Assmebler symbol attribute directives don't work on temporary symbols.
Assembler private local symbols aren't legal targets of symbol attributes, so issue a diagnostic for them. Based on patch by Stepan Dyatkovskiy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139807 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
79c40a011b
commit
10ec65004d
@ -1960,12 +1960,17 @@ bool AsmParser::ParseDirectiveSymbolAttribute(MCSymbolAttr Attr) {
|
|||||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
StringRef Name;
|
StringRef Name;
|
||||||
|
SMLoc Loc = getTok().getLoc();
|
||||||
|
|
||||||
if (ParseIdentifier(Name))
|
if (ParseIdentifier(Name))
|
||||||
return TokError("expected identifier in directive");
|
return Error(Loc, "expected identifier in directive");
|
||||||
|
|
||||||
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name);
|
||||||
|
|
||||||
|
// Assembler local symbols don't make any sense here. Complain loudly.
|
||||||
|
if (Sym->isTemporary())
|
||||||
|
return Error(Loc, "non-local symbol required in directive");
|
||||||
|
|
||||||
getStreamer().EmitSymbolAttribute(Sym, Attr);
|
getStreamer().EmitSymbolAttribute(Sym, Attr);
|
||||||
|
|
||||||
if (getLexer().is(AsmToken::EndOfStatement))
|
if (getLexer().is(AsmToken::EndOfStatement))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user