mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
IR: Use a bitmask to access GlobalObject subclass data
Make room for more than just `Function::isMaterializable()` in the `GlobalObject` subclass data bitfield. Since we're treating it like a bitfield, change `Function::Function()` to zero-out the whole thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235770 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -206,10 +206,12 @@ void Argument::removeAttr(AttributeSet AS) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
bool Function::isMaterializable() const {
|
||||
return getGlobalObjectSubClassData();
|
||||
return getGlobalObjectSubClassData() & IsMaterializableBit;
|
||||
}
|
||||
|
||||
void Function::setIsMaterializable(bool V) { setGlobalObjectSubClassData(V); }
|
||||
void Function::setIsMaterializable(bool V) {
|
||||
setGlobalObjectBit(IsMaterializableBit, V);
|
||||
}
|
||||
|
||||
LLVMContext &Function::getContext() const {
|
||||
return getType()->getContext();
|
||||
@@ -244,7 +246,7 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage, const Twine &name,
|
||||
Ty(Ty) {
|
||||
assert(FunctionType::isValidReturnType(getReturnType()) &&
|
||||
"invalid return type");
|
||||
setIsMaterializable(false);
|
||||
setGlobalObjectSubClassData(0);
|
||||
SymTab = new ValueSymbolTable();
|
||||
|
||||
// If the function has arguments, mark them as lazily built.
|
||||
|
||||
Reference in New Issue
Block a user