mirror of
https://github.com/intel/llvm.git
synced 2026-01-31 07:27:33 +08:00
Move setTargetAttributes after setGVProperties in SetFunctionAttributes
AMDGPU currently relies on global properties being set before setTargetProperties is called. Existing targets like MIPS which rely on setTargetProperties do not rely on the current behavior, so this patch moves the call later in SetFunctionAttributes. Differential Revision: https://reviews.llvm.org/D60967 llvm-svn: 359039
This commit is contained in:
@@ -1558,12 +1558,8 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
|
||||
|
||||
const auto *FD = cast<FunctionDecl>(GD.getDecl());
|
||||
|
||||
if (!IsIncompleteFunction) {
|
||||
if (!IsIncompleteFunction)
|
||||
SetLLVMFunctionAttributes(GD, getTypes().arrangeGlobalDeclaration(GD), F);
|
||||
// Setup target-specific attributes.
|
||||
if (F->isDeclaration())
|
||||
getTargetCodeGenInfo().setTargetAttributes(FD, F, *this);
|
||||
}
|
||||
|
||||
// Add the Returned attribute for "this", except for iOS 5 and earlier
|
||||
// where substantial code, including the libstdc++ dylib, was compiled with
|
||||
@@ -1583,6 +1579,10 @@ void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,
|
||||
setLinkageForGV(F, FD);
|
||||
setGVProperties(F, FD);
|
||||
|
||||
// Setup target-specific attributes.
|
||||
if (!IsIncompleteFunction && F->isDeclaration())
|
||||
getTargetCodeGenInfo().setTargetAttributes(FD, F, *this);
|
||||
|
||||
if (const auto *CSA = FD->getAttr<CodeSegAttr>())
|
||||
F->setSection(CSA->getName());
|
||||
else if (const auto *SA = FD->getAttr<SectionAttr>())
|
||||
|
||||
Reference in New Issue
Block a user