diff options
author | Keith Wyss <wyssman@gmail.com> | 2018-04-17 21:32:43 +0000 |
---|---|---|
committer | Keith Wyss <wyssman@gmail.com> | 2018-04-17 21:32:43 +0000 |
commit | f437e35671089ab3bdbf11b65a53fe22b9f24172 (patch) | |
tree | 9f8b082482b37dfca41de5824b722545c5198fc3 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 3d86823f3d22296f2eb9883d1b84d3fa90c73054 (diff) | |
download | bcm5719-llvm-f437e35671089ab3bdbf11b65a53fe22b9f24172.tar.gz bcm5719-llvm-f437e35671089ab3bdbf11b65a53fe22b9f24172.zip |
[XRay] Add clang builtin for xray typed events.
Summary:
A clang builtin for xray typed events. Differs from
__xray_customevent(...) by the presence of a type tag that is vended by
compiler-rt in typical usage. This allows xray handlers to expand logged
events with their type description and plugins to process traced events
based on type.
This change depends on D45633 for the intrinsic definition.
Reviewers: dberris, pelikan, rnk, eizan
Subscribers: cfe-commits, llvm-commits
Differential Revision: https://reviews.llvm.org/D45716
llvm-svn: 330220
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 92564043e07..bf5312550b7 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -466,7 +466,7 @@ bool CodeGenFunction::ShouldXRayInstrumentFunction() const { } /// AlwaysEmitXRayCustomEvents - Return true if we should emit IR for calls to -/// the __xray_customevent(...) builin calls, when doing XRay instrumentation. +/// the __xray_customevent(...) builtin calls, when doing XRay instrumentation. bool CodeGenFunction::AlwaysEmitXRayCustomEvents() const { return CGM.getCodeGenOpts().XRayInstrumentFunctions && (CGM.getCodeGenOpts().XRayAlwaysEmitCustomEvents || @@ -474,6 +474,13 @@ bool CodeGenFunction::AlwaysEmitXRayCustomEvents() const { XRayInstrKind::Custom); } +bool CodeGenFunction::AlwaysEmitXRayTypedEvents() const { + return CGM.getCodeGenOpts().XRayInstrumentFunctions && + (CGM.getCodeGenOpts().XRayAlwaysEmitTypedEvents || + CGM.getCodeGenOpts().XRayInstrumentationBundle.Mask == + XRayInstrKind::Typed); +} + llvm::Constant * CodeGenFunction::EncodeAddrForUseInPrologue(llvm::Function *F, llvm::Constant *Addr) { |