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 /llvm/lib/IR/Attributes.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 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index cc9b78e..63384689 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -425,8 +425,6 @@ std::string Attribute::getAsString(bool InAttrGrp) const { return "speculative_load_hardening"; if (hasAttribute(Attribute::Speculatable)) return "speculatable"; - if (hasAttribute(Attribute::NoStackProtect)) - return "nossp"; if (hasAttribute(Attribute::StackProtect)) return "ssp"; if (hasAttribute(Attribute::StackProtectReq)) @@ -1941,17 +1939,9 @@ static void setOR(Function &Caller, const Function &Callee) { /// If the inlined function had a higher stack protection level than the /// calling function, then bump up the caller's stack protection level. static void adjustCallerSSPLevel(Function &Caller, const Function &Callee) { - assert(!(Callee.hasFnAttribute(Attribute::NoStackProtect) && - (Caller.hasFnAttribute(Attribute::StackProtect) || - Caller.hasFnAttribute(Attribute::StackProtectStrong) || - Caller.hasFnAttribute(Attribute::StackProtectReq))) && - "stack protected caller but callee requested no stack protector"); - assert(!(Caller.hasFnAttribute(Attribute::NoStackProtect) && - (Callee.hasFnAttribute(Attribute::StackProtect) || - Callee.hasFnAttribute(Attribute::StackProtectStrong) || - Callee.hasFnAttribute(Attribute::StackProtectReq))) && - "stack protected callee but caller requested no stack protector"); // If upgrading the SSP attribute, clear out the old SSP Attributes first. + // Having multiple SSP attributes doesn't actually hurt, but it adds useless + // clutter to the IR. AttrBuilder OldSSPAttr; OldSSPAttr.addAttribute(Attribute::StackProtect) .addAttribute(Attribute::StackProtectStrong) |