aboutsummaryrefslogtreecommitdiff
path: root/lib/Target
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
commit54482b472a888c9efe003ad694ecf47b21878f0e (patch)
treee1347f01f96931e2824b836b23c77311ddda77cb /lib/Target
parent0a3c5a54a144fd05a7feeb5c9e58da36edbe888c (diff)
fix a bug in range information for $42, eliminate an
unneeded argument from ParseExpression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index b350c9fd6b..c2459c9e65 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/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);
}