MC: Label definitions are permitted after .set directives

.set directives may be overridden by other .set directives as well as
label definitions.

This fixes PR22019.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer
2014-12-24 10:27:50 +00:00
parent 3681929e11
commit e54eacce75
5 changed files with 49 additions and 1 deletions

View File

@@ -1298,6 +1298,9 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
Sym = getContext().GetOrCreateSymbol(IDVal);
} else
Sym = Ctx.CreateDirectionalLocalSymbol(LocalLabelVal);
Sym->redefineIfPossible();
if (!Sym->isUndefined() || Sym->isVariable())
return Error(IDLoc, "invalid symbol redefinition");
@@ -2217,6 +2220,8 @@ bool AsmParser::parseAssignment(StringRef Name, bool allow_redef,
} else
Sym = getContext().GetOrCreateSymbol(Name);
Sym->setRedefinable(allow_redef);
// Do the assignment.
Out.EmitAssignment(Sym, Value);
if (NoDeadStrip)