9#ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_TAGGEDUNIONMODELING_H
10#define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_TAGGEDUNIONMODELING_H
18#include "llvm/ADT/FoldingSet.h"
35template <
class TypeMap>
43 if (
Call.isInSystemHeader())
47 State = State->remove<TypeMap>(Region);
52template <
class TypeMap>
60 auto ArgSVal =
Call.getArgSVal(0);
62 const auto *ArgMemRegion = ArgSVal.getAsRegion();
68 if (IsCopy || IsMove) {
69 const QualType *OtherQType = State->get<TypeMap>(ArgMemRegion);
74 State = State->remove<TypeMap>(ThisRegion);
80 State = State->remove<TypeMap>(ArgMemRegion);
82 State = State->set<TypeMap>(ThisRegion, *OtherQType);
86 auto ArgQType = ArgSVal.getType(
C.getASTContext());
87 const Type *ArgTypePtr = ArgQType.getTypePtr();
90 State = State->set<TypeMap>(ThisRegion, WoPointer);
93 C.addTransition(State);
A (possibly-)qualified type.
The base class of the type hierarchy.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
Represents an abstract call to a function or method along a particular path.
MemRegion - The root abstract class for all memory regions.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
const MemRegion * getAsRegion() const
ProgramStateRef removeInformationStoredForDeadInstances(const CallEvent &Call, ProgramStateRef State, ArrayRef< const MemRegion * > Regions)
bool isCopyAssignmentCall(const CallEvent &Call)
static bool isStdType(const Type *Type, llvm::StringRef TypeName)
bool isMoveAssignmentCall(const CallEvent &Call)
bool isCopyConstructorCall(const CallEvent &Call)
void handleConstructorAndAssignment(const CallEvent &Call, CheckerContext &C, SVal ThisSVal)
bool isStdVariant(const Type *Type)
bool isMoveConstructorCall(const CallEvent &Call)