mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-11 08:29:25 +00:00
CodeGen: Canonicalize access to function attributes, NFC
Canonicalize access to function attributes to use the simpler API. getAttributes().getAttribute(AttributeSet::FunctionIndex, Kind) => getFnAttribute(Kind) getAttributes().hasAttribute(AttributeSet::FunctionIndex, Kind) => hasFnAttribute(Kind) Also, add `Function::getFnStackAlignment()`, and canonicalize: getAttributes().getStackAlignment(AttributeSet::FunctionIndex) => getFnStackAlignment() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229208 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -67,17 +67,14 @@ MachineFunction::MachineFunction(const Function *F, const TargetMachine &TM,
|
||||
STI->getFrameLowering()->isStackRealignable(),
|
||||
!F->hasFnAttribute("no-realign-stack"));
|
||||
|
||||
if (Fn->getAttributes().hasAttribute(AttributeSet::FunctionIndex,
|
||||
Attribute::StackAlignment))
|
||||
FrameInfo->ensureMaxAlignment(Fn->getAttributes().
|
||||
getStackAlignment(AttributeSet::FunctionIndex));
|
||||
if (Fn->hasFnAttribute(Attribute::StackAlignment))
|
||||
FrameInfo->ensureMaxAlignment(Fn->getFnStackAlignment());
|
||||
|
||||
ConstantPool = new (Allocator) MachineConstantPool(TM);
|
||||
Alignment = STI->getTargetLowering()->getMinFunctionAlignment();
|
||||
|
||||
// FIXME: Shouldn't use pref alignment if explicit alignment is set on Fn.
|
||||
if (!Fn->getAttributes().hasAttribute(AttributeSet::FunctionIndex,
|
||||
Attribute::OptimizeForSize))
|
||||
if (!Fn->hasFnAttribute(Attribute::OptimizeForSize))
|
||||
Alignment = std::max(Alignment,
|
||||
STI->getTargetLowering()->getPrefFunctionAlignment());
|
||||
|
||||
|
Reference in New Issue
Block a user