Implement categories for special case lists.
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 9 Jul 2013 22:03:17 +0000 (22:03 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Tue, 9 Jul 2013 22:03:17 +0000 (22:03 +0000)
commit46e11c4c97fe1c424241e4098801456303a5c86e
tree16ead929d708047b076e827d2157d951c57d81ab
parentc7087f8e423c8f3eda453d7fc3843191dac4143b
Implement categories for special case lists.

A special case list can now specify categories for specific globals,
which can be used to instruct an instrumentation pass to treat certain
functions or global variables in a specific way, such as by omitting
certain aspects of instrumentation while keeping others, or informing
the instrumentation pass that a specific uninstrumentable function
has certain semantics, thus allowing the pass to instrument callers
according to those semantics.

For example, AddressSanitizer now uses the "init" category instead of
global-init prefixes for globals whose initializers should not be
instrumented, but which in all other respects should be instrumented.

The motivating use case is DataFlowSanitizer, which will have a
number of different categories for uninstrumentable functions, such
as "functional" which specifies that a function has pure functional
semantics, or "discard" which indicates that a function's return
value should not be labelled.

Differential Revision: http://llvm-reviews.chandlerc.com/D1092

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185978 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/SpecialCaseList.h
lib/Transforms/Instrumentation/AddressSanitizer.cpp
lib/Transforms/Utils/SpecialCaseList.cpp
unittests/Transforms/Utils/SpecialCaseList.cpp