aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCInst.h14
-rw-r--r--include/llvm/MC/MCInstPrinter.h4
2 files changed, 17 insertions, 1 deletions
diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h
index d384764774..d443536d40 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;
diff --git a/include/llvm/MC/MCInstPrinter.h b/include/llvm/MC/MCInstPrinter.h
index 39002dabca..4c12d10d5b 100644
--- a/include/llvm/MC/MCInstPrinter.h
+++ b/include/llvm/MC/MCInstPrinter.h
@@ -41,6 +41,10 @@ public:
///
virtual void printInst(const MCInst *MI, raw_ostream &OS) = 0;
+ /// printAnnotations - Print the annotation comments attached to specified
+ /// MCInst to the specified raw_ostream.
+ void printAnnotations(const MCInst *MI, raw_ostream &OS);
+
/// getOpcodeName - Return the name of the specified opcode enum (e.g.
/// "MOV32ri") or empty if we can't resolve it.
virtual StringRef getOpcodeName(unsigned Opcode) const;