diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2020-11-17 17:17:44 -0800 |
---|---|---|
committer | Nick Desaulniers <ndesaulniers@google.com> | 2020-11-17 17:27:14 -0800 |
commit | f4c6080ab820219c5bf78b0c2143e7fa194da296 (patch) | |
tree | f396fe0699171b36e03a76554abb301b558f46b9 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | dd6087cac087046b5cd29a21e7fff2732fb35997 (diff) | |
download | llvm-f4c6080ab820219c5bf78b0c2143e7fa194da296.zip llvm-f4c6080ab820219c5bf78b0c2143e7fa194da296.tar.gz llvm-f4c6080ab820219c5bf78b0c2143e7fa194da296.tar.bz2 |
Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch"
This reverts commit b7926ce6d7a83cdf70c68d82bc3389c04009b841.
Going with a simpler approach.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index f50aaf3..1f81faa 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1642,14 +1642,14 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D, if (!hasUnwindExceptions(LangOpts)) B.addAttribute(llvm::Attribute::NoUnwind); - if (D && D->hasAttr<NoStackProtectorAttr>()) - B.addAttribute(llvm::Attribute::NoStackProtect); - else if (LangOpts.getStackProtector() == LangOptions::SSPOn) - B.addAttribute(llvm::Attribute::StackProtect); - else if (LangOpts.getStackProtector() == LangOptions::SSPStrong) - B.addAttribute(llvm::Attribute::StackProtectStrong); - else if (LangOpts.getStackProtector() == LangOptions::SSPReq) - B.addAttribute(llvm::Attribute::StackProtectReq); + if (!D || !D->hasAttr<NoStackProtectorAttr>()) { + if (LangOpts.getStackProtector() == LangOptions::SSPOn) + B.addAttribute(llvm::Attribute::StackProtect); + else if (LangOpts.getStackProtector() == LangOptions::SSPStrong) + B.addAttribute(llvm::Attribute::StackProtectStrong); + else if (LangOpts.getStackProtector() == LangOptions::SSPReq) + B.addAttribute(llvm::Attribute::StackProtectReq); + } if (!D) { // If we don't have a declaration to control inlining, the function isn't |