The ssp and sspreq function attributes should only be applied to function definitions, not declarations or calls.
llvm-svn: 88915
This commit is contained in:
@@ -348,6 +348,11 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
|
||||
if (D->hasAttr<NoInlineAttr>())
|
||||
F->addFnAttr(llvm::Attribute::NoInline);
|
||||
|
||||
if (Features.getStackProtectorMode() == LangOptions::SSPOn)
|
||||
F->addFnAttr(llvm::Attribute::StackProtect);
|
||||
else if (Features.getStackProtectorMode() == LangOptions::SSPReq)
|
||||
F->addFnAttr(llvm::Attribute::StackProtectReq);
|
||||
|
||||
if (const AlignedAttr *AA = D->getAttr<AlignedAttr>())
|
||||
F->setAlignment(AA->getAlignment()/8);
|
||||
// C++ ABI requires 2-byte alignment for member functions.
|
||||
|
||||
Reference in New Issue
Block a user