mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Simplify and rename function overrideFunctionAttributes. NFC.
This is in preparation to making changes needed to stop resetting NoFramePointerElim in resetTargetOptions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238079 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -959,19 +959,6 @@ void Function::setPrologueData(Constant *PrologueData) {
|
||||
setValueSubclassData(PDData);
|
||||
}
|
||||
|
||||
void llvm::overrideFunctionAttribute(StringRef Kind, StringRef Value,
|
||||
Function &F) {
|
||||
auto &Ctx = F.getContext();
|
||||
AttributeSet Attrs = F.getAttributes(), AttrsToRemove;
|
||||
|
||||
AttrsToRemove =
|
||||
AttrsToRemove.addAttribute(Ctx, AttributeSet::FunctionIndex, Kind);
|
||||
Attrs = Attrs.removeAttributes(Ctx, AttributeSet::FunctionIndex,
|
||||
AttrsToRemove);
|
||||
Attrs = Attrs.addAttribute(Ctx, AttributeSet::FunctionIndex, Kind, Value);
|
||||
F.setAttributes(Attrs);
|
||||
}
|
||||
|
||||
void Function::setEntryCount(uint64_t Count) {
|
||||
MDBuilder MDB(getContext());
|
||||
setMetadata(LLVMContext::MD_prof, MDB.createFunctionEntryCount(Count));
|
||||
|
Reference in New Issue
Block a user