use an accessor to simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81997 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-09-16 04:12:47 +00:00
parent 206a357684
commit 3b13d361d0

View File

@ -208,15 +208,12 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res) {
Res = MCUnaryExpr::CreateLNot(Res, getContext());
return false;
case AsmToken::String:
case AsmToken::Identifier: {
case AsmToken::Identifier:
// This is a label, this should be parsed as part of an expression, to
// handle things like LFOO+4.
MCSymbol *Sym = CreateSymbol(Lexer.getTok().getIdentifier());
Res = MCSymbolRefExpr::Create(Sym, getContext());
Res = MCSymbolRefExpr::Create(Lexer.getTok().getIdentifier(), getContext());
Lexer.Lex(); // Eat identifier.
return false;
}
case AsmToken::Integer:
Res = MCConstantExpr::Create(Lexer.getTok().getIntVal(), getContext());
Lexer.Lex(); // Eat token.