Make sure globals created by UBSan are not instrumented by ASan.
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Jul 2014 17:50:06 +0000 (17:50 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Jul 2014 17:50:06 +0000 (17:50 +0000)
commit82b49e4abc2d71c474af2f616b125396e98d2f8c
treef397ddb8c5626f03a84e5f3f183f0a5130275d6e
parentedb71bdc75e762b67ecc121dd05f057c436822ed
Make sure globals created by UBSan are not instrumented by ASan.

Summary:
This change adds description of globals created by UBSan
instrumentation (UBSan handlers, type descriptors, filenames) to
llvm.asan.globals metadata, effectively "blacklisting" them. This can
dramatically decrease the data section in binaries built with UBSan+ASan,
as UBSan tends to create a lot of handlers, and ASan instrumentation
increases the global size to at least 64 bytes.

Test Plan: clang regression test suite

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, byoungyoung, kcc

Differential Revision: http://reviews.llvm.org/D4575

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213392 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/catch-undef-behavior.cpp