Make value of static_objects_ a pointer.
PiperOrigin-RevId: 458414329
diff --git a/lifetime_analysis/object_repository.cc b/lifetime_analysis/object_repository.cc
index 70ade1c..7ddfb05 100644
--- a/lifetime_analysis/object_repository.cc
+++ b/lifetime_analysis/object_repository.cc
@@ -687,17 +687,17 @@
Object ObjectRepository::CreateStaticObject(clang::QualType type) {
auto iter = static_objects_.find(type);
if (iter != static_objects_.end()) {
- return iter->second;
+ return *iter->second;
}
- Object object = *CreateObject(Lifetime::Static(), type);
+ const Object* object = CreateObject(Lifetime::Static(), type);
static_objects_[type] = object;
CreateObjects(
- object, type, [](const clang::Expr*) { return Lifetime::Static(); },
+ *object, type, [](const clang::Expr*) { return Lifetime::Static(); },
true);
- return object;
+ return *object;
}
void ObjectRepository::CreateObjects(Object root_object, clang::QualType type,
diff --git a/lifetime_analysis/object_repository.h b/lifetime_analysis/object_repository.h
index 615dae9..d5b255f 100644
--- a/lifetime_analysis/object_repository.h
+++ b/lifetime_analysis/object_repository.h
@@ -250,7 +250,7 @@
llvm::DenseMap<const clang::Expr*, const Object*> call_expr_this_pointers_;
- llvm::DenseMap<clang::QualType, Object> static_objects_;
+ llvm::DenseMap<clang::QualType, const Object*> static_objects_;
};
} // namespace lifetimes