Support for instrumenting only selected files or functions
authorPetr Hosek <phosek@google.com>
Fri, 15 Jan 2021 09:14:37 +0000 (01:14 -0800)
committerPetr Hosek <phosek@google.com>
Wed, 27 Jan 2021 01:13:34 +0000 (17:13 -0800)
commitbb9eb198298099742c823dce11c5edacc9c48d4e
tree4d997db42ad6bcd384b6326bef0b2409cdb734b1
parentfc3192026b3156d39c223cc092297c39dd8013f3
Support for instrumenting only selected files or functions

This change implements support for applying profile instrumentation
only to selected files or functions. The implementation uses the
sanitizer special case list format to select which files and functions
to instrument, and relies on the new noprofile IR attribute to exclude
functions from instrumentation.

Differential Revision: https://reviews.llvm.org/D94820
28 files changed:
clang/docs/ClangCommandLineReference.rst
clang/docs/UsersManual.rst
clang/include/clang/AST/ASTContext.h
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Basic/ProfileList.h [new file with mode: 0644]
clang/include/clang/Driver/Options.td
clang/lib/AST/ASTContext.cpp
clang/lib/Basic/CMakeLists.txt
clang/lib/Basic/ProfileList.cpp [new file with mode: 0644]
clang/lib/CodeGen/CodeGenFunction.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/CodeGen/CodeGenPGO.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/profile-filter.c [new file with mode: 0644]
llvm/include/llvm/Bitcode/LLVMBitCodes.h
llvm/include/llvm/IR/Attributes.td
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/AsmParser/LLToken.h
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/lib/Transforms/Utils/CodeExtractor.cpp
llvm/test/Transforms/PGOProfile/noprofile.ll [new file with mode: 0644]