]> granicus.if.org Git - clang/commit
[XRay] Add -fxray-{always,never}-instrument= flags to clang
authorDean Michael Berris <dberris@google.com>
Thu, 30 Mar 2017 00:29:36 +0000 (00:29 +0000)
committerDean Michael Berris <dberris@google.com>
Thu, 30 Mar 2017 00:29:36 +0000 (00:29 +0000)
commitca9fad67afe0d4c4757747486a116b3fca09e565
treed1585384d6ac980a0e4946f28d27568ed7908bfb
parent6cecba61e47d6be93136d0caaeba3d7e54962e8f
[XRay] Add -fxray-{always,never}-instrument= flags to clang

Summary:
The -fxray-always-instrument= and -fxray-never-instrument= flags take
filenames that are used to imbue the XRay instrumentation attributes
using a whitelist mechanism (similar to the sanitizer special cases
list). We use the same syntax and semantics as the sanitizer blacklists
files in the implementation.

As implemented, we respect the attributes that are already defined in
the source file (i.e. those that have the
[[clang::xray_{always,never}_instrument]] attributes) before applying
the always/never instrument lists.

Reviewers: rsmith, chandlerc

Subscribers: jfb, mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D30388

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299041 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
include/clang/AST/ASTContext.h
include/clang/Basic/LangOptions.def
include/clang/Basic/LangOptions.h
include/clang/Basic/XRayLists.h [new file with mode: 0644]
include/clang/Driver/Options.td
include/clang/Driver/ToolChain.h
include/clang/Driver/XRayArgs.h [new file with mode: 0644]
lib/AST/ASTContext.cpp
lib/Basic/CMakeLists.txt
lib/Basic/LangOptions.cpp
lib/Basic/XRayLists.cpp [new file with mode: 0644]
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
lib/Driver/CMakeLists.txt
lib/Driver/ToolChain.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Driver/XRayArgs.cpp [new file with mode: 0644]
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/xray-always-instrument.cpp [new file with mode: 0644]