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>
Tue, 26 Jan 2021 19:11:39 +0000 (11:11 -0800)
commit4edf35f11a9e20bd5df3cb47283715f0ff38b751
treed8fd7bbd93f7ea0cf187fd995468b85518183918
parent32cc5564e2707c6036230ef3929c0d783ccea04c
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
29 files changed:
clang/docs/ClangCommandLineReference.rst
clang/docs/SourceBasedCodeCoverage.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]