36 lines
1.6 KiB
Diff
36 lines
1.6 KiB
Diff
Index: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
|
|
===================================================================
|
|
--- a/lib/Target/X86/X86ISelLowering.cpp
|
|
+++ b/lib/Target/X86/X86ISelLowering.cpp
|
|
@@ -2098,7 +2098,8 @@
|
|
|
|
void X86TargetLowering::insertSSPDeclarations(Module &M) const {
|
|
// MSVC CRT provides functionalities for stack protection.
|
|
- if (Subtarget.getTargetTriple().isOSMSVCRT()) {
|
|
+ if (Subtarget.getTargetTriple().isWindowsMSVCEnvironment() ||
|
|
+ Subtarget.getTargetTriple().isWindowsItaniumEnvironment()) {
|
|
// MSVC CRT has a global variable holding security cookie.
|
|
M.getOrInsertGlobal("__security_cookie",
|
|
Type::getInt8PtrTy(M.getContext()));
|
|
@@ -2120,15 +2121,19 @@
|
|
|
|
Value *X86TargetLowering::getSDagStackGuard(const Module &M) const {
|
|
// MSVC CRT has a global variable holding security cookie.
|
|
- if (Subtarget.getTargetTriple().isOSMSVCRT())
|
|
+ if (Subtarget.getTargetTriple().isWindowsMSVCEnvironment() ||
|
|
+ Subtarget.getTargetTriple().isWindowsItaniumEnvironment()) {
|
|
return M.getGlobalVariable("__security_cookie");
|
|
+ }
|
|
return TargetLowering::getSDagStackGuard(M);
|
|
}
|
|
|
|
Value *X86TargetLowering::getSSPStackGuardCheck(const Module &M) const {
|
|
// MSVC CRT has a function to validate security cookie.
|
|
- if (Subtarget.getTargetTriple().isOSMSVCRT())
|
|
+ if (Subtarget.getTargetTriple().isWindowsMSVCEnvironment() ||
|
|
+ Subtarget.getTargetTriple().isWindowsItaniumEnvironment()) {
|
|
return M.getFunction("__security_check_cookie");
|
|
+ }
|
|
return TargetLowering::getSSPStackGuardCheck(M);
|
|
}
|