1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01: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.

llvm-svn: 139807
This commit is contained in:
Jim Grosbach 2011-09-15 17:56:49 +00:00
parent 444ae3ddc7
commit e341895736

View File

@ -1960,12 +1960,17 @@ bool AsmParser::ParseDirectiveSymbolAttribute(MCSymbolAttr Attr) {
if (getLexer().isNot(AsmToken::EndOfStatement)) {
for (;;) {
StringRef Name;
SMLoc Loc = getTok().getLoc();
if (ParseIdentifier(Name))
return TokError("expected identifier in directive");
return Error(Loc, "expected identifier in directive");
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);
if (getLexer().is(AsmToken::EndOfStatement))