aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-23 06:41:41 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-23 06:41:41 +0000
commit114baee1fa017daefad2339c77b45b9ca3d79a41 (patch)
treea8a1320a7ad94ac750fcca331a8db207f2fea637 /include
parent28d65722d6f283b327b5815914382077fe9c0ab4 (diff)
downloadexternal_llvm-114baee1fa017daefad2339c77b45b9ca3d79a41.zip
external_llvm-114baee1fa017daefad2339c77b45b9ca3d79a41.tar.gz
external_llvm-114baee1fa017daefad2339c77b45b9ca3d79a41.tar.bz2
Add the IR attribute 'sspstrong'.
SSPStrong applies a heuristic to insert stack protectors in these situations: * A Protector is required for functions which contain an array, regardless of type or length. * A Protector is required for functions which contain a structure/union which contains an array, regardless of type or length. Note, there is no limit to the depth of nesting. * A protector is required when the address of a local variable (i.e., stack based variable) is exposed. (E.g., such as through a local whose address is taken as part of the RHS of an assignment or a local whose address is taken as part of a function argument.) This patch implements the SSPString attribute to be equivalent to SSPRequired. This will change in a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm-c/Core.h5
-rw-r--r--include/llvm/IR/Attributes.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h
index f2fe764..5b7422f 100644
--- a/include/llvm-c/Core.h
+++ b/include/llvm-c/Core.h
@@ -173,10 +173,11 @@ typedef enum {
LLVMUWTable = 1 << 30,
LLVMNonLazyBind = 1 << 31
- /* FIXME: This attribute is currently not included in the C API as
+ /* FIXME: These attributes are currently not included in the C API as
a temporary measure until the API/ABI impact to the C API is understood
and the path forward agreed upon.
- LLVMAddressSafety = 1ULL << 32
+ LLVMAddressSafety = 1ULL << 32,
+ LLVMStackProtectStrongAttribute = 1ULL<<33
*/
} LLVMAttribute;
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index de214d1..813718f 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -90,6 +90,7 @@ public:
///< alignstack=(1))
StackProtect, ///< Stack protection.
StackProtectReq, ///< Stack protection required.
+ StackProtectStrong, ///< Strong Stack protection.
StructRet, ///< Hidden pointer to structure to return
UWTable, ///< Function must be in a unwind table
ZExt, ///< Zero extended before/after call
@@ -463,6 +464,7 @@ public:
.removeAttribute(Attribute::OptimizeForSize)
.removeAttribute(Attribute::StackProtect)
.removeAttribute(Attribute::StackProtectReq)
+ .removeAttribute(Attribute::StackProtectStrong)
.removeAttribute(Attribute::NoRedZone)
.removeAttribute(Attribute::NoImplicitFloat)
.removeAttribute(Attribute::Naked)