65 #ifndef LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H 66 #define LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H 104 void Profile(llvm::FoldingSetNodeID &
ID)
const { ID.AddPointer(
this); }
114 return FR == OtherFR;
133 virtual void printNoteMsg(llvm::raw_ostream &Out)
const = 0;
136 virtual void printPrefix(llvm::raw_ostream &Out)
const = 0;
139 virtual void printNode(llvm::raw_ostream &Out)
const = 0;
143 virtual void printSeparator(llvm::raw_ostream &Out)
const = 0;
145 virtual bool isBase()
const {
return false; }
165 FieldChain::Factory &ChainFactory;
179 template <
class FieldNodeT>
FieldChainInfo add(
const FieldNodeT &FN);
183 template <
class FieldNodeT>
FieldChainInfo replaceHead(
const FieldNodeT &FN);
186 bool isEmpty()
const {
return Chain.isEmpty(); }
191 void printNoteMsg(llvm::raw_ostream &Out)
const;
202 bool IsAnyFieldInitialized =
false;
204 FieldChainInfo::FieldChain::Factory ChainFactory;
227 std::pair<ProgramStateRef, const UninitFieldMap &>
getResults() {
228 return {
State, UninitFields};
302 bool isPrimitiveUninit(
const SVal &
V);
336 template <
class FieldNodeT>
338 assert(!contains(FN.getRegion()) &&
339 "Can't add a field that is already a part of the " 340 "fieldchain! Is this a cyclic reference?");
343 NewChain.Chain = ChainFactory.add(FN, Chain);
347 template <
class FieldNodeT>
350 return NewChain.
add(FN);
356 #endif // LLVM_CLANG_STATICANALYZER_UNINITIALIZEDOBJECT_H
TypedValueRegion - An abstract class representing regions having a typed value.
std::string IgnoredRecordsWithFieldPattern
A (possibly-)qualified type.
MemRegion - The root abstract class for all memory regions.
bool isSameRegion(const FieldRegion *OtherFR) const
Helper method for uniqueing.
bool ShouldConvertNotesToWarnings
const FieldRegion * getUninitRegion() const
FieldChainInfo(FieldChain::Factory &F)
bool isPrimitiveType(const QualType &T)
Returns true if T is a primitive type.
bool isAnyFieldInitialized()
Returns whether the analyzed region contains at least one initialized field.
bool isEnumeralType() const
FieldChainInfo add(const FieldNodeT &FN)
Constructs a new FieldChainInfo object with FN appended.
const FieldDecl * getDecl() const
const FieldNode & getHead() const
Represents a member of a struct/union/class.
bool isReferenceType() const
FieldNode(const FieldRegion *FR)
bool isDereferencableType(const QualType &T)
bool isScalarType() const
bool CheckPointeeInitialization
std::string getVariableName(const FieldDecl *Field)
Returns with Field's name.
Searches for and stores uninitialized fields in a non-union object.
void Profile(llvm::FoldingSetNodeID &ID) const
bool isBuiltinType() const
Helper methods to distinguish type categories.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
bool isAnyPointerType() const
virtual bool isBase() const
Represents a field chain.
bool isVectorType() const
Dataflow Directional Tag Classes.
const FieldDecl * getDecl() const
llvm::ImmutableList< const FieldNode & > FieldChain
std::map< const FieldRegion *, llvm::SmallString< 50 > > UninitFieldMap
bool isAtomicType() const
bool isFunctionType() const
FieldChainInfo replaceHead(const FieldNodeT &FN)
Constructs a new FieldChainInfo object with FN as the new head of the list.
A lightweight polymorphic wrapper around FieldRegion *.
std::pair< ProgramStateRef, const UninitFieldMap & > getResults()
Returns with the modified state and a map of (uninitialized region, note message) pairs...
const FieldRegion * getRegion() const