summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-03-30 00:29:36 +0000
committerDean Michael Berris <dberris@google.com>2017-03-30 00:29:36 +0000
commit835832d37af3401601264fcd620e9af5720f041f (patch)
tree63202a36d92c4b7847d77cf960a5c9749f6c0cb5 /clang/lib/CodeGen/CodeGenFunction.cpp
parent2ccbac3fee49665c19a201d98e3f2690f50edd3a (diff)
downloadbcm5719-llvm-835832d37af3401601264fcd620e9af5720f041f.tar.gz
bcm5719-llvm-835832d37af3401601264fcd620e9af5720f041f.zip
[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 llvm-svn: 299041
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 11660b4f419..79c0694f902 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -786,9 +786,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
llvm::utostr(LogArgs->getArgumentCount()));
}
} else {
- Fn->addFnAttr(
- "xray-instruction-threshold",
- llvm::itostr(CGM.getCodeGenOpts().XRayInstructionThreshold));
+ if (!CGM.imbueXRayAttrs(Fn, Loc))
+ Fn->addFnAttr(
+ "xray-instruction-threshold",
+ llvm::itostr(CGM.getCodeGenOpts().XRayInstructionThreshold));
}
}
OpenPOWER on IntegriCloud