================
@@ -1053,6 +1054,37 @@ void CodeGenFunction::StartFunction(GlobalDecl GD,
QualType RetTy,
}
}
+ // Annotate C++ special member functions so that CopyProfPass can instrument
+ // them, provided the object is at least as large as the size threshold.
+ if (CGM.getCodeGenOpts().CopyProf) {
+ const auto *MD = dyn_cast_or_null<CXXMethodDecl>(D);
+ const auto *CD = MD ? dyn_cast<CXXConstructorDecl>(MD) : nullptr;
+ // It's either some sort of c'tor (but not any move function), or either of
+ // copy assignment operator / d'tor.
+ bool IsCandidate =
----------------
newgre wrote:
Is it general style to make local variables that are not mutated "const", or is
this personal preference? There seems to be quite a bit of code that does not
use this style?
I've simplified the logic a bit so it looks different now. PTAL.
https://github.com/llvm/llvm-project/pull/225905
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits