summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCFixup.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-13 09:28:54 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-13 09:28:54 +0000
commit2be2fd073003c0988723d2894dfb117ad90be11b (patch)
tree474d12cad56fc69fa8a413a9f486093ab47f7a2b /include/llvm/MC/MCFixup.h
parent0bcf074867d4d366f7988a219c7a53265fcb4f23 (diff)
downloadllvm-2be2fd073003c0988723d2894dfb117ad90be11b.tar.gz
llvm-2be2fd073003c0988723d2894dfb117ad90be11b.tar.bz2
llvm-2be2fd073003c0988723d2894dfb117ad90be11b.tar.xz
MCAssembler: Switch MCAsmFixup to storing MCFixupKind instead of just a size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96094 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCFixup.h')
-rw-r--r--include/llvm/MC/MCFixup.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/MC/MCFixup.h b/include/llvm/MC/MCFixup.h
index f325d65500..cd0dd1962a 100644
--- a/include/llvm/MC/MCFixup.h
+++ b/include/llvm/MC/MCFixup.h
@@ -89,6 +89,18 @@ public:
unsigned getOffset() const { return Offset; }
const MCExpr *getValue() const { return Value; }
+
+ /// getKindForSize - Return the generic fixup kind for a value with the given
+ /// size. It is an error to pass an unsupported size.
+ static MCFixupKind getKindForSize(unsigned Size) {
+ switch (Size) {
+ default: assert(0 && "Invalid generic fixup size!");
+ case 1: return FK_Data_1;
+ case 2: return FK_Data_2;
+ case 4: return FK_Data_4;
+ case 8: return FK_Data_8;
+ }
+ }
};
} // End llvm namespace