Updated the llvm-mc disassembler C API to support for the X86 target.
authorKevin Enderby <enderby@apple.com>
Thu, 23 Feb 2012 18:18:17 +0000 (18:18 +0000)
committerKevin Enderby <enderby@apple.com>
Thu, 23 Feb 2012 18:18:17 +0000 (18:18 +0000)
commitb80d571ea85db5d52fafed0523cf59e693502198
tree1561d5c37bf35aea02289e2922600e27b21daf55
parent18547223275755733fcee9e3c30025e7238f8607
Updated the llvm-mc disassembler C API to support for the X86 target.
rdar://10873652

As part of this I updated the llvm-mc disassembler C API to always call the
SymbolLookUp call back even if there is no getOpInfo call back.  If there is a
getOpInfo call back that is tried first and then if that gets no information
then the  SymbolLookUp is called.  I also made the code more robust by
memset(3)'ing to zero the LLVMOpInfo1 struct before then setting
SymbolicOp.Value before for the call to getOpInfo.  And also don't use any
values from the  LLVMOpInfo1 struct if getOpInfo returns 0.  And also don't
use any of the ReferenceType or ReferenceName values from SymbolLookUp if it
returns NULL. rdar://10873563 and rdar://10873683

For the X86 target also fixed bugs so the annotations get printed.

Also fixed a few places in the ARM target that was not producing symbolic
operands for some instructions.  rdar://10878166

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151267 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/Disassembler/ARMDisassembler.cpp
lib/Target/X86/AsmParser/X86AsmParser.cpp
lib/Target/X86/Disassembler/X86Disassembler.cpp
lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
test/MC/X86/x86-32.s