mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
use an accessor to simplify code.
llvm-svn: 81997
This commit is contained in:
parent
e9d86c0126
commit
fab7b49bb0
@ -208,15 +208,12 @@ bool AsmParser::ParsePrimaryExpr(const MCExpr *&Res) {
|
|||||||
Res = MCUnaryExpr::CreateLNot(Res, getContext());
|
Res = MCUnaryExpr::CreateLNot(Res, getContext());
|
||||||
return false;
|
return false;
|
||||||
case AsmToken::String:
|
case AsmToken::String:
|
||||||
case AsmToken::Identifier: {
|
case AsmToken::Identifier:
|
||||||
// This is a label, this should be parsed as part of an expression, to
|
// This is a label, this should be parsed as part of an expression, to
|
||||||
// handle things like LFOO+4.
|
// handle things like LFOO+4.
|
||||||
MCSymbol *Sym = CreateSymbol(Lexer.getTok().getIdentifier());
|
Res = MCSymbolRefExpr::Create(Lexer.getTok().getIdentifier(), getContext());
|
||||||
|
|
||||||
Res = MCSymbolRefExpr::Create(Sym, getContext());
|
|
||||||
Lexer.Lex(); // Eat identifier.
|
Lexer.Lex(); // Eat identifier.
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
case AsmToken::Integer:
|
case AsmToken::Integer:
|
||||||
Res = MCConstantExpr::Create(Lexer.getTok().getIntVal(), getContext());
|
Res = MCConstantExpr::Create(Lexer.getTok().getIntVal(), getContext());
|
||||||
Lexer.Lex(); // Eat token.
|
Lexer.Lex(); // Eat token.
|
||||||
|
Loading…
Reference in New Issue
Block a user