mirror of
https://github.com/intel/llvm.git
synced 2026-02-05 13:21:04 +08:00
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
This commit is contained in:
@@ -839,6 +839,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
|
||||
}
|
||||
}
|
||||
|
||||
if (CGM.getCodeGenOpts().getProfileInstr() != CodeGenOptions::ProfileNone)
|
||||
if (CGM.isProfileInstrExcluded(Fn, Loc))
|
||||
Fn->addFnAttr(llvm::Attribute::NoProfile);
|
||||
|
||||
unsigned Count, Offset;
|
||||
if (const auto *Attr =
|
||||
D ? D->getAttr<PatchableFunctionEntryAttr>() : nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user