return &create<IntegerValue>();
}
- if (Type->isReferenceType()) {
+ if (Type->isReferenceType() || Type->isPointerType()) {
CreatedValuesCount++;
- QualType PointeeType = Type->castAs<ReferenceType>()->getPointeeType();
+ QualType PointeeType = Type->getPointeeType();
auto &PointeeLoc = createStorageLocation(PointeeType);
if (Visited.insert(PointeeType.getCanonicalType()).second) {
setValue(PointeeLoc, *PointeeVal);
}
- return &create<ReferenceValue>(PointeeLoc);
- }
-
- if (Type->isPointerType()) {
- CreatedValuesCount++;
- QualType PointeeType = Type->castAs<PointerType>()->getPointeeType();
- auto &PointeeLoc = createStorageLocation(PointeeType);
-
- if (Visited.insert(PointeeType.getCanonicalType()).second) {
- Value *PointeeVal = createValueUnlessSelfReferential(
- PointeeType, Visited, Depth, CreatedValuesCount);
- Visited.erase(PointeeType.getCanonicalType());
-
- if (PointeeVal != nullptr)
- setValue(PointeeLoc, *PointeeVal);
- }
-
- return &create<PointerValue>(PointeeLoc);
+ if (Type->isReferenceType())
+ return &create<ReferenceValue>(PointeeLoc);
+ else
+ return &create<PointerValue>(PointeeLoc);
}
if (Type->isStructureOrClassType() || Type->isUnionType()) {