================
@@ -508,6 +508,17 @@ class TrivialFunctionAnalysisVisitor
if (auto *FnDecl = dyn_cast<FunctionDecl>(D)) {
if (FnDecl->isVirtualAsWritten())
return false;
+ auto ReturnType = FnDecl->getReturnType();
+ if (auto *Type = ReturnType.getTypePtrOrNull()) {
+ if (auto *AttrType = dyn_cast<AttributedType>(Type)) {
+ if (auto *Attr = AttrType->getAttr()) {
+ if (auto *AnnotateType = dyn_cast<AnnotateTypeAttr>(Attr)) {
+ if (AnnotateType->getAnnotation() == "webkit.nodelete")
+ return true;
+ }
+ }
+ }
+ }
----------------
rniwa wrote:
Makes sense. Adopted that approach.
https://github.com/llvm/llvm-project/pull/177839
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits