diff options
author | Petr Hosek <phosek@google.com> | 2021-01-15 01:14:37 -0800 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2021-01-26 17:13:34 -0800 |
commit | bb9eb198298099742c823dce11c5edacc9c48d4e (patch) | |
tree | 4d997db42ad6bcd384b6326bef0b2409cdb734b1 /clang/lib/CodeGen/CodeGenModule.h | |
parent | fc3192026b3156d39c223cc092297c39dd8013f3 (diff) | |
download | llvm-bb9eb198298099742c823dce11c5edacc9c48d4e.zip llvm-bb9eb198298099742c823dce11c5edacc9c48d4e.tar.gz llvm-bb9eb198298099742c823dce11c5edacc9c48d4e.tar.bz2 |
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index c595705..618e2f8 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1277,6 +1277,10 @@ public: bool imbueXRayAttrs(llvm::Function *Fn, SourceLocation Loc, StringRef Category = StringRef()) const; + /// Returns true if function at the given location should be excluded from + /// profile instrumentation. + bool isProfileInstrExcluded(llvm::Function *Fn, SourceLocation Loc) const; + SanitizerMetadata *getSanitizerMetadata() { return SanitizerMD.get(); } |