summaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCInst.h
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-09-15 18:36:29 +0000
committerOwen Anderson <resistor@mac.com>2011-09-15 18:36:29 +0000
commitede042dc8d59ff48a48ef8e2271f2a7ee8324ba5 (patch)
tree1863d77a0f4430e093ef2933f38f299a5992c74b /include/llvm/MC/MCInst.h
parent01afdb3a45f63af540b43b414c6094220a8f91e7 (diff)
downloadexternal_llvm-ede042dc8d59ff48a48ef8e2271f2a7ee8324ba5.zip
external_llvm-ede042dc8d59ff48a48ef8e2271f2a7ee8324ba5.tar.gz
external_llvm-ede042dc8d59ff48a48ef8e2271f2a7ee8324ba5.tar.bz2
Add support for stored annotations to MCInst, and provide facilities for MC-based InstPrinters to print them out. Enhance the ARM and X86 InstPrinter's to do so in verbose mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCInst.h')
-rw-r--r--include/llvm/MC/MCInst.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h
index d384764..d443536 100644
--- a/include/llvm/MC/MCInst.h
+++ b/include/llvm/MC/MCInst.h
@@ -129,6 +129,7 @@ public:
class MCInst {
unsigned Opcode;
SmallVector<MCOperand, 8> Operands;
+ SmallVector<std::string, 1> Annotations;
public:
MCInst() : Opcode(0) {}
@@ -144,7 +145,15 @@ public:
Operands.push_back(Op);
}
- void clear() { Operands.clear(); }
+ void addAnnotation(const std::string &Annot) {
+ Annotations.push_back(Annot);
+ }
+
+ void clear() {
+ Operands.clear();
+ Annotations.clear();
+ }
+
size_t size() { return Operands.size(); }
typedef SmallVector<MCOperand, 8>::iterator iterator;
@@ -154,6 +163,9 @@ public:
return Operands.insert(I, Op);
}
+ size_t getNumAnnotations() const { return Annotations.size(); }
+ std::string getAnnotation(size_t i) const { return Annotations[i]; }
+
void print(raw_ostream &OS, const MCAsmInfo *MAI) const;
void dump() const;