aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2012-10-22 22:31:46 +0000
committerKevin Enderby <enderby@apple.com>2012-10-22 22:31:46 +0000
commit3ed0316f756e2f1730f46654776fcf77f5ace7aa (patch)
treec7769b081a31d4e7194751368e2090ba967bfb2b /include
parent8ee16c7b661ce0b1c1d33db07b57ad2c88b5a8b2 (diff)
downloadexternal_llvm-3ed0316f756e2f1730f46654776fcf77f5ace7aa.zip
external_llvm-3ed0316f756e2f1730f46654776fcf77f5ace7aa.tar.gz
external_llvm-3ed0316f756e2f1730f46654776fcf77f5ace7aa.tar.bz2
Add support for annotated disassembly output for X86 and arm.
Per the October 12, 2012 Proposal for annotated disassembly output sent out by Jim Grosbach this set of changes implements this for X86 and arm. The llvm-mc tool now has a -mdis option to produced the marked up disassembly and a couple of small example test cases have been added. rdar://11764962 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm-c/Disassembler.h9
-rw-r--r--include/llvm/MC/MCInstPrinter.h9
2 files changed, 17 insertions, 1 deletions
diff --git a/include/llvm-c/Disassembler.h b/include/llvm-c/Disassembler.h
index 69fdc64..b8c4ad9 100644
--- a/include/llvm-c/Disassembler.h
+++ b/include/llvm-c/Disassembler.h
@@ -146,6 +146,15 @@ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo,
LLVMSymbolLookupCallback SymbolLookUp);
/**
+ * Set the disassembler's options. Returns 1 if it can set the Options and 0
+ * otherwise.
+ */
+int LLVMSetDisasmOptions(LLVMDisasmContextRef DC, uint64_t Options);
+
+/* The option to produce marked up assembly. */
+#define LLVMDisassembler_Option_UseMarkup 1
+
+/**
* Dispose of a disassembler context.
*/
void LLVMDisasmDispose(LLVMDisasmContextRef DC);
diff --git a/include/llvm/MC/MCInstPrinter.h b/include/llvm/MC/MCInstPrinter.h
index 3c4f28b..f17c347 100644
--- a/include/llvm/MC/MCInstPrinter.h
+++ b/include/llvm/MC/MCInstPrinter.h
@@ -33,12 +33,16 @@ protected:
/// The current set of available features.
unsigned AvailableFeatures;
+ /// True if we are printing marked up assembly.
+ bool UseMarkup;
+
/// Utility function for printing annotations.
void printAnnotation(raw_ostream &OS, StringRef Annot);
public:
MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii,
const MCRegisterInfo &mri)
- : CommentStream(0), MAI(mai), MII(mii), MRI(mri), AvailableFeatures(0) {}
+ : CommentStream(0), MAI(mai), MII(mii), MRI(mri), AvailableFeatures(0),
+ UseMarkup(0) {}
virtual ~MCInstPrinter();
@@ -59,6 +63,9 @@ public:
unsigned getAvailableFeatures() const { return AvailableFeatures; }
void setAvailableFeatures(unsigned Value) { AvailableFeatures = Value; }
+
+ bool getUseMarkup() const { return UseMarkup; }
+ void setUseMarkup(bool Value) { UseMarkup = Value; }
};
} // namespace llvm