aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2012-01-20 21:21:01 +0000
committerDevang Patel <dpatel@apple.com>2012-01-20 21:21:01 +0000
commitfdd3b30151bc391efce74f4592a9a3bb595565a2 (patch)
treefeaa06b2f4dcc29e024bf33f95d3edf03e3000bb /lib/Target/X86
parentcf0e269d16f3d784b428c9b1b1e22d1f9e8bb91d (diff)
downloadexternal_llvm-fdd3b30151bc391efce74f4592a9a3bb595565a2.zip
external_llvm-fdd3b30151bc391efce74f4592a9a3bb595565a2.tar.gz
external_llvm-fdd3b30151bc391efce74f4592a9a3bb595565a2.tar.bz2
Intel syntax: Parse ... PTR [-8]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 67c4a64..83ab6a6 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -669,6 +669,11 @@ X86Operand *X86AsmParser::ParseIntelBracExpression(unsigned Size) {
return ErrorOperand(End, "expected ']' token!");
Parser.Lex();
End = Parser.getTok().getLoc();
+
+ // handle [-42]
+ if (!BaseReg && !IndexReg)
+ return X86Operand::CreateMem(Disp, Start, End, Size);
+
return X86Operand::CreateMem(SegReg, Disp, BaseReg, IndexReg, Scale,
Start, End, Size);
}