aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp')
-rw-r--r--clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
index fbb8d8a..faeabdc 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -359,7 +359,7 @@ void Environment::pushCallInternal(const FunctionDecl *FuncDecl,
QualType ParamType = Param->getType();
if (ParamType->isReferenceType()) {
- auto &Val = takeOwnership(std::make_unique<ReferenceValue>(*ArgLoc));
+ auto &Val = create<ReferenceValue>(*ArgLoc);
setValue(Loc, Val);
} else if (auto *ArgVal = getValue(*ArgLoc)) {
setValue(Loc, *ArgVal);
@@ -685,7 +685,7 @@ Value *Environment::createValueUnlessSelfReferential(
// with integers, and so distinguishing them serves no purpose, but could
// prevent convergence.
CreatedValuesCount++;
- return &takeOwnership(std::make_unique<IntegerValue>());
+ return &create<IntegerValue>();
}
if (Type->isReferenceType()) {
@@ -702,7 +702,7 @@ Value *Environment::createValueUnlessSelfReferential(
setValue(PointeeLoc, *PointeeVal);
}
- return &takeOwnership(std::make_unique<ReferenceValue>(PointeeLoc));
+ return &create<ReferenceValue>(PointeeLoc);
}
if (Type->isPointerType()) {
@@ -719,7 +719,7 @@ Value *Environment::createValueUnlessSelfReferential(
setValue(PointeeLoc, *PointeeVal);
}
- return &takeOwnership(std::make_unique<PointerValue>(PointeeLoc));
+ return &create<PointerValue>(PointeeLoc);
}
if (Type->isStructureOrClassType() || Type->isUnionType()) {
@@ -739,8 +739,7 @@ Value *Environment::createValueUnlessSelfReferential(
Visited.erase(FieldType.getCanonicalType());
}
- return &takeOwnership(
- std::make_unique<StructValue>(std::move(FieldValues)));
+ return &create<StructValue>(std::move(FieldValues));
}
return nullptr;