summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2020-01-04 16:58:11 -0800
committerFangrui Song <maskray@google.com>2020-01-10 09:57:39 -0800
commitf17ae668a96eeb69f0664f126cf672e1a05754d2 (patch)
tree6d63004713914e91e9f07fecec32233cac4be725 /clang/lib/CodeGen
parenta44c434b68e515ce9f2627367c83ff6b22328261 (diff)
downloadbcm5719-llvm-f17ae668a96eeb69f0664f126cf672e1a05754d2.tar.gz
bcm5719-llvm-f17ae668a96eeb69f0664f126cf672e1a05754d2.zip
[Driver][CodeGen] Add -fpatchable-function-entry=N[,0]
In the backend, this feature is implemented with the function attribute "patchable-function-entry". Both the attribute and XRay use TargetOpcode::PATCHABLE_FUNCTION_ENTER, so the two features are incompatible. Reviewed By: ostannard, MaskRay Differential Revision: https://reviews.llvm.org/D72222
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index e59fe060738..a976005e2e4 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -824,6 +824,9 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
// Attr->getStart is currently ignored.
Fn->addFnAttr("patchable-function-entry",
std::to_string(Attr->getCount()));
+ } else if (unsigned Count = CGM.getCodeGenOpts().PatchableFunctionEntryCount) {
+ Fn->addFnAttr("patchable-function-entry",
+ std::to_string(Count));
}
}
OpenPOWER on IntegriCloud