GlobalValue: Move trivial getAddressSpace getter to header

This commit is contained in:
Matt Arsenault 2022-11-28 15:06:09 -05:00
parent 16312c5d7a
commit 4e0ca5ef00
2 changed files with 3 additions and 6 deletions

View File

@ -198,7 +198,9 @@ public:
GlobalValue(const GlobalValue &) = delete;
unsigned getAddressSpace() const;
unsigned getAddressSpace() const {
return getType()->getAddressSpace();
}
enum class UnnamedAddr {
None,

View File

@ -118,11 +118,6 @@ bool GlobalValue::canBenefitFromLocalAlias() const {
!isa<GlobalIFunc>(this) && !isDeduplicateComdat(getComdat());
}
unsigned GlobalValue::getAddressSpace() const {
PointerType *PtrTy = getType();
return PtrTy->getAddressSpace();
}
void GlobalObject::setAlignment(MaybeAlign Align) {
assert((!Align || *Align <= MaximumAlignment) &&
"Alignment is greater than MaximumAlignment!");