@@ -91,7 +91,18 @@ template <typename LatticeT>
9191void transferSmartPointerLikeCachedDeref (
9292 const CallExpr *DerefExpr, RecordStorageLocation *SmartPointerLoc,
9393 TransferState<LatticeT> &State,
94- llvm::function_ref<void (StorageLocation &)> InitializeLoc);
94+ llvm::function_ref<void (QualType, StorageLocation &)> InitializeLoc);
95+ template <typename LatticeT>
96+ void transferSmartPointerLikeCachedDeref (
97+ const CallExpr *DerefExpr, RecordStorageLocation *SmartPointerLoc,
98+ TransferState<LatticeT> &State,
99+ llvm::function_ref<void (StorageLocation &)> InitializeLoc) {
100+ transferSmartPointerLikeCachedDeref<LatticeT>(
101+ DerefExpr, SmartPointerLoc, State,
102+ [InitializeLoc](QualType T, StorageLocation &Loc) {
103+ InitializeLoc (Loc);
104+ });
105+ }
95106
96107// / A transfer function for `operator->` (and `get`) calls that can be cached.
97108// / Runs the `InitializeLoc` callback to initialize any new StorageLocations.
@@ -103,13 +114,24 @@ template <typename LatticeT>
103114void transferSmartPointerLikeCachedGet (
104115 const CallExpr *GetExpr, RecordStorageLocation *SmartPointerLoc,
105116 TransferState<LatticeT> &State,
106- llvm::function_ref<void (StorageLocation &)> InitializeLoc);
117+ llvm::function_ref<void (QualType, StorageLocation &)> InitializeLoc);
118+ template <typename LatticeT>
119+ void transferSmartPointerLikeCachedGet (
120+ const CallExpr *GetExpr, RecordStorageLocation *SmartPointerLoc,
121+ TransferState<LatticeT> &State,
122+ llvm::function_ref<void (StorageLocation &)> InitializeLoc) {
123+ transferSmartPointerLikeCachedGet<LatticeT>(
124+ GetExpr, SmartPointerLoc, State,
125+ [InitializeLoc](QualType T, StorageLocation &Loc) {
126+ InitializeLoc (Loc);
127+ });
128+ }
107129
108130template <typename LatticeT>
109131void transferSmartPointerLikeCachedDeref (
110132 const CallExpr *DerefExpr, RecordStorageLocation *SmartPointerLoc,
111133 TransferState<LatticeT> &State,
112- llvm::function_ref<void (StorageLocation &)> InitializeLoc) {
134+ llvm::function_ref<void (QualType, StorageLocation &)> InitializeLoc) {
113135 if (State.Env .getStorageLocation (*DerefExpr) != nullptr )
114136 return ;
115137 if (SmartPointerLoc == nullptr )
@@ -145,7 +167,7 @@ template <typename LatticeT>
145167void transferSmartPointerLikeCachedGet (
146168 const CallExpr *GetExpr, RecordStorageLocation *SmartPointerLoc,
147169 TransferState<LatticeT> &State,
148- llvm::function_ref<void (StorageLocation &)> InitializeLoc) {
170+ llvm::function_ref<void (QualType, StorageLocation &)> InitializeLoc) {
149171 if (SmartPointerLoc == nullptr )
150172 return ;
151173
0 commit comments