clang
8.0.0
|
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "UninitializedObject.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeMap.h"
Go to the source code of this file.
Functions | |
static const TypedValueRegion * | getConstructedRegion (const CXXConstructorDecl *CtorDecl, CheckerContext &Context) |
Returns the region that was constructed by CtorDecl, or nullptr if that isn't possible. More... | |
static bool | willObjectBeAnalyzedLater (const CXXConstructorDecl *Ctor, CheckerContext &Context) |
Checks whether the object constructed by Ctor will be analyzed later (e.g. More... | |
static bool | shouldIgnoreRecord (const RecordDecl *RD, StringRef Pattern) |
Checks whether RD contains a field with a name or type name that matches Pattern . More... | |
static void | printTail (llvm::raw_ostream &Out, const FieldChainInfo::FieldChain L) |
Prints every element except the last to Out . More... | |
|
static |
Returns the region that was constructed by CtorDecl, or nullptr if that isn't possible.
Definition at line 442 of file UninitializedObjectChecker.cpp.
References clang::ento::MemRegion::getAs(), clang::Type::getAsCXXRecordDecl(), clang::ento::SVal::getAsRegion(), clang::ento::SValBuilder::getCXXThis(), clang::ento::CheckerContext::getStackFrame(), clang::ento::CheckerContext::getState(), clang::ento::CheckerContext::getSValBuilder(), and clang::ento::TypedValueRegion::getValueType().
Referenced by willObjectBeAnalyzedLater().
|
static |
Prints every element except the last to Out
.
Since ImmutableLists store elements in reverse order, and have no reverse iterators, we use a recursive function to print the fieldchain correctly. The last element in the chain is to be printed by FieldChainInfo::print
.
Definition at line 426 of file UninitializedObjectChecker.cpp.
Referenced by clang::ento::FieldChainInfo::contains(), and clang::ento::FieldChainInfo::printNoteMsg().
|
static |
Checks whether RD contains a field with a name or type name that matches Pattern
.
Definition at line 486 of file UninitializedObjectChecker.cpp.
References clang::RecordDecl::fields().
Referenced by clang::ento::FindUninitializedFields::FindUninitializedFields().
|
static |
Checks whether the object constructed by Ctor
will be analyzed later (e.g.
if the object is a field of another object, in which case we'd check it multiple times).
Definition at line 457 of file UninitializedObjectChecker.cpp.
References getConstructedRegion(), clang::LocationContext::getDecl(), clang::ento::CheckerContext::getLocationContext(), clang::LocationContext::getParent(), and clang::ento::SubRegion::isSubRegionOf().