diff options
| author | Mircea Trofin <mtrofin@google.com> | 2018-03-21 22:27:31 +0000 |
|---|---|---|
| committer | Mircea Trofin <mtrofin@google.com> | 2018-03-21 22:27:31 +0000 |
| commit | 556f8f6adc39e306749ace5582b2842981c0cd7f (patch) | |
| tree | ba5670f4a5fe1185200057e77ecf35c66d871147 /llvm/unittests/ProfileData | |
| parent | eb629994554a05a4d3e59d6b5c09d312416d096e (diff) | |
| download | bcm5719-llvm-556f8f6adc39e306749ace5582b2842981c0cd7f.tar.gz bcm5719-llvm-556f8f6adc39e306749ace5582b2842981c0cd7f.zip | |
[InstrProf] Encapsulates access to AddrToMD5Map.
Summary:
This fixes a unittest failure introduced by D44717
D44717 introduced lazy sorting of the internal data structures of the
symbol table. The AddrToMD5Map getter was potentially exposing
inconsistent (unsorted) state. We could sort in the accessor, however,
a client may store the pointer and thus bypass the internal state
management of the symbol table. The alternative in this CL blocks
direct access to the state, thus ensuring consistent
externally-observable state.
Reviewers: davidxl, xur, eraman
Reviewed By: xur
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D44757
llvm-svn: 328163
Diffstat (limited to 'llvm/unittests/ProfileData')
| -rw-r--r-- | llvm/unittests/ProfileData/InstrProfTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp index 309241dfe6b..09be2e3dad7 100644 --- a/llvm/unittests/ProfileData/InstrProfTest.cpp +++ b/llvm/unittests/ProfileData/InstrProfTest.cpp @@ -770,7 +770,7 @@ TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write_mapping) { Symtab.mapAddress(uint64_t(callee4), 0x4000ULL); // Missing mapping for callee5 - VPData->deserializeTo(Record, &Symtab.getAddrHashMap()); + VPData->deserializeTo(Record, &Symtab); // Now read data from Record and sanity check the data ASSERT_EQ(5U, Record.getNumValueSites(IPVK_IndirectCallTarget)); |

