[PATCH] D39428: [Analyzer] As suggested, use value storage for BodyFarm

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 03:20:40 PDT 2017


xazax.hun accepted this revision.
xazax.hun added a comment.

Some minor nits otherwise LGTM!



================
Comment at: include/clang/Analysis/AnalysisDeclContext.h:479
+  /// Get a reference to {@code BodyFarm} instance.
+  BodyFarm& getBodyFarm();
 
----------------
The reference is on the wrong side. 


================
Comment at: include/clang/Analysis/BodyFarm.h:43
+  /// Remove copy constructor to avoid accidental copying.
+  BodyFarm(const BodyFarm& other) = delete;
+
----------------
Reference is on the wrong side.


================
Comment at: lib/Analysis/AnalysisDeclContext.cpp:308
 
-BodyFarm *AnalysisDeclContextManager::getBodyFarm() {
-  if (!FunctionBodyFarm)
-    FunctionBodyFarm = llvm::make_unique<BodyFarm>(ASTCtx, Injector.get());
-  return FunctionBodyFarm.get();
+BodyFarm& AnalysisDeclContextManager::getBodyFarm() {
+  return FunctionBodyFarm;
----------------
Same as above.


https://reviews.llvm.org/D39428





More information about the cfe-commits mailing list