mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
X86: 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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229214 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -116,11 +116,8 @@ X86TargetMachine::~X86TargetMachine() {}
|
||||
|
||||
const X86Subtarget *
|
||||
X86TargetMachine::getSubtargetImpl(const Function &F) const {
|
||||
AttributeSet FnAttrs = F.getAttributes();
|
||||
Attribute CPUAttr =
|
||||
FnAttrs.getAttribute(AttributeSet::FunctionIndex, "target-cpu");
|
||||
Attribute FSAttr =
|
||||
FnAttrs.getAttribute(AttributeSet::FunctionIndex, "target-features");
|
||||
Attribute CPUAttr = F.getFnAttribute("target-cpu");
|
||||
Attribute FSAttr = F.getFnAttribute("target-features");
|
||||
|
||||
std::string CPU = !CPUAttr.hasAttribute(Attribute::None)
|
||||
? CPUAttr.getValueAsString().str()
|
||||
@@ -134,8 +131,7 @@ X86TargetMachine::getSubtargetImpl(const Function &F) const {
|
||||
// function before we can generate a subtarget. We also need to use
|
||||
// it as a key for the subtarget since that can be the only difference
|
||||
// between two functions.
|
||||
Attribute SFAttr =
|
||||
FnAttrs.getAttribute(AttributeSet::FunctionIndex, "use-soft-float");
|
||||
Attribute SFAttr = F.getFnAttribute("use-soft-float");
|
||||
bool SoftFloat = !SFAttr.hasAttribute(Attribute::None)
|
||||
? SFAttr.getValueAsString() == "true"
|
||||
: Options.UseSoftFloat;
|
||||
|
Reference in New Issue
Block a user