[PATCH] D47303: [analyzer] NFC: Merge object construction related state traits into one.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 25 17:03:22 PDT 2018

NoQ added inline comments.

Comment at: lib/StaticAnalyzer/Core/ExprEngine.cpp:377
+  if (!State->contains<ObjectsUnderConstruction>(Key)) {
+    return State->set<ObjectsUnderConstruction>(Key, V);
george.karpenkov wrote:
> nitpick: most C++ containers eliminate the need for two lookups by allowing the `get` method to return a reference. I'm not sure whether this can be done here though.
It's likely to be harder than usual because one doesn't simply obtain a non-const reference to an object from an immutable map.

That's said, it's quite unimportant what do we do if the object is already there.


More information about the cfe-commits mailing list