summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-15 19:39:23 +0000
committerChris Lattner <sabre@nondot.org>2010-01-15 19:39:23 +0000
commite17df0b7f006e5500a90276ea08b2dddb88e6c1b (patch)
tree315782eb0170f91fc1e69398da76807faac6122c /llvm/lib
parent015cfb157765f015d1a895ed1da2483e32bbbedb (diff)
downloadbcm5719-llvm-e17df0b7f006e5500a90276ea08b2dddb88e6c1b.tar.gz
bcm5719-llvm-e17df0b7f006e5500a90276ea08b2dddb88e6c1b.zip
fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression. llvm-svn: 93536
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index b350c9fd6b4..c2459c9e654 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -279,10 +279,10 @@ X86Operand *X86ATTAsmParser::ParseOperand() {
}
case AsmToken::Dollar: {
// $42 -> immediate.
+ SMLoc Start = getLexer().getTok().getLoc(), End;
getLexer().Lex();
const MCExpr *Val;
- SMLoc Start, End;
- if (getParser().ParseExpression(Val, Start, End))
+ if (getParser().ParseExpression(Val, End))
return 0;
return X86Operand::CreateImm(Val, Start, End);
}
@@ -302,15 +302,15 @@ X86Operand *X86ATTAsmParser::ParseMemOperand() {
// it.
const MCExpr *Disp = MCConstantExpr::Create(0, getParser().getContext());
if (getLexer().isNot(AsmToken::LParen)) {
- SMLoc ExprStart, ExprEnd;
- if (getParser().ParseExpression(Disp, MemStart, ExprEnd)) return 0;
+ SMLoc ExprEnd;
+ if (getParser().ParseExpression(Disp, ExprEnd)) return 0;
// After parsing the base expression we could either have a parenthesized
// memory address or not. If not, return now. If so, eat the (.
if (getLexer().isNot(AsmToken::LParen)) {
// Unless we have a segment register, treat this as an immediate.
if (SegReg == 0)
- return X86Operand::CreateImm(Disp, ExprStart, ExprEnd);
+ return X86Operand::CreateImm(Disp, MemStart, ExprEnd);
return X86Operand::CreateMem(SegReg, Disp, 0, 0, 1, MemStart, ExprEnd);
}
OpenPOWER on IntegriCloud