[PATCH] D50503: [analyzer][UninitializedObjectChecker] Refactoring p1.: ImmutableList factory is no longer static
Umann Kristóf via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 13 10:56:37 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL339591: [analyzer][UninitializedObjectChecker] Refactoring p1.: ImmutableList factory… (authored by Szelethus, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D50503?vs=159889&id=160400#toc
Repository:
rL LLVM
https://reviews.llvm.org/D50503
Files:
cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp
Index: cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp
===================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp
@@ -73,17 +73,21 @@
/// Note that this class is immutable, and new fields may only be added through
/// constructor calls.
class FieldChainInfo {
+public:
using FieldChain = llvm::ImmutableList<const FieldRegion *>;
+private:
+ FieldChain::Factory &Factory;
FieldChain Chain;
const bool IsDereferenced = false;
public:
- FieldChainInfo() = default;
+ FieldChainInfo() = delete;
+ FieldChainInfo(FieldChain::Factory &F) : Factory(F) {}
FieldChainInfo(const FieldChainInfo &Other, const bool IsDereferenced)
- : Chain(Other.Chain), IsDereferenced(IsDereferenced) {}
+ : Factory(Other.Factory), Chain(Other.Chain), IsDereferenced(IsDereferenced) {}
FieldChainInfo(const FieldChainInfo &Other, const FieldRegion *FR,
const bool IsDereferenced = false);
@@ -128,6 +132,7 @@
bool IsAnyFieldInitialized = false;
+ FieldChainInfo::FieldChain::Factory Factory;
UninitFieldSet UninitFields;
public:
@@ -217,10 +222,6 @@
} // end of anonymous namespace
-// Static variable instantionations.
-
-static llvm::ImmutableListFactory<const FieldRegion *> Factory;
-
// Utility function declarations.
/// Returns the object that was constructed by CtorDecl, or None if that isn't
@@ -355,7 +356,7 @@
CheckPointeeInitialization(CheckPointeeInitialization) {}
const UninitFieldSet &FindUninitializedFields::getUninitFields() {
- isNonUnionUninit(ObjectR, FieldChainInfo());
+ isNonUnionUninit(ObjectR, FieldChainInfo(Factory));
if (!IsPedantic && !IsAnyFieldInitialized)
UninitFields.clear();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50503.160400.patch
Type: text/x-patch
Size: 1869 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180813/bfcdf234/attachment.bin>
More information about the cfe-commits
mailing list