[PATCH] Inline allocator call when c++-allocator-inlining is specified as true

Jordan Rose jordan_rose at apple.com
Wed Jan 29 09:25:47 PST 2014


  This looks good to me, except that I wouldn't bother turning on allocators in NewDelete-custom.cpp until we're using the new-region for construction. (Otherwise we'd get a leak whether or not there actually is one, wouldn't we?) Do you have any opinion on that, though?


================
Comment at: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:340-342
@@ +339,5 @@
+    CEMgr.getCXXAllocatorCall(CNE, State, LCtx);
+  PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
+                                Call->getSourceRange().getBegin(),
+                                "Error evaluating New Allocator Call");
+
----------------
I would move this up before the CallEvent creation, just in case //that// crashes. We can use the CXXNewExpr's location instead.


http://llvm-reviews.chandlerc.com/D2646



More information about the cfe-commits mailing list