Skip to content

Commit 774b12c

Browse files
[memprof] Initialize AllocInfoIter and CallSitesIter (NFC) (#124972)
This patch initializes AllocInfoIter and CallSitesIter to their respective end(). I'm doing this not because I'm worried about uninitialized iterators, but because the resulting code looks shorter and makes it clear which data structure each iterator is associated with.
1 parent 8a86e6a commit 774b12c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,9 +1096,8 @@ readMemprof(Module &M, Function &F, IndexedInstrProfReader *MemProfReader,
10961096
// can happen because we don't currently have discriminators to
10971097
// distinguish the case when a single line/col maps to both an allocation
10981098
// and another callsite).
1099-
std::map<uint64_t, std::set<const AllocationInfo *>>::iterator
1100-
AllocInfoIter;
1101-
decltype(LocHashToCallSites)::iterator CallSitesIter;
1099+
auto AllocInfoIter = LocHashToAllocInfo.end();
1100+
auto CallSitesIter = LocHashToCallSites.end();
11021101
for (const DILocation *DIL = I.getDebugLoc(); DIL != nullptr;
11031102
DIL = DIL->getInlinedAt()) {
11041103
// Use C++ linkage name if possible. Need to compile with

0 commit comments

Comments
 (0)