aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-06-26 08:56:33 +0000
committerKostya Serebryany <kcc@google.com>2012-06-26 08:56:33 +0000
commitb9d2b3b8edf7a0dc56e55acb1cf87338d5648daa (patch)
treef5ffedf387328d4b7203ad778649a226ccd11b7d /lib/CodeGen/CGDeclCXX.cpp
parente92b1f4917bfb669a09d220dc979fc3676df4da8 (diff)
[asan] add missing asan instrumentation in generated global init functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp
index a27516bb5b..893628e08a 100644
--- a/lib/CodeGen/CGDeclCXX.cpp
+++ b/lib/CodeGen/CGDeclCXX.cpp
@@ -228,6 +228,9 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM,
if (!CGM.getLangOpts().Exceptions)
Fn->setDoesNotThrow();
+ if (CGM.getLangOpts().AddressSanitizer)
+ Fn->addFnAttr(llvm::Attribute::AddressSafety);
+
return Fn;
}