diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-02-13 09:28:54 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-02-13 09:28:54 +0000 |
commit | 2be2fd073003c0988723d2894dfb117ad90be11b (patch) | |
tree | 474d12cad56fc69fa8a413a9f486093ab47f7a2b /include/llvm/MC/MCFixup.h | |
parent | 0bcf074867d4d366f7988a219c7a53265fcb4f23 (diff) | |
download | llvm-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.h | 12 |
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 |