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
This commit is contained in:
Daniel Dunbar
2010-02-13 09:28:54 +00:00
parent 0bcf074867
commit 2be2fd0730
4 changed files with 39 additions and 13 deletions

View File

@@ -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