Skip to content

Commit b0ca543

Browse files
[memprof] Remove dead code in MemProfReader (NFC) (#117607)
The only constructor in current use is the one that takes IndexedMemProfData. Likewise, the only accessor in current use is takeMemProfData.
1 parent fdf1f69 commit b0ca543

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

llvm/include/llvm/ProfileData/MemProfReader.h

-38
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,6 @@ class MemProfReader {
4646
return Iterator(this);
4747
}
4848

49-
// Return a const reference to the internal Id to Frame mappings.
50-
LLVM_DEPRECATED("Use takeMemProfData instead", "takeMemProfData")
51-
const llvm::DenseMap<FrameId, Frame> &getFrameMapping() const {
52-
return IdToFrame;
53-
}
54-
55-
// Return a const reference to the internal Id to call stacks.
56-
LLVM_DEPRECATED("Use takeMemProfData instead", "takeMemProfData")
57-
const llvm::DenseMap<CallStackId, llvm::SmallVector<FrameId>> &
58-
getCallStacks() const {
59-
return CSIdToCallStack;
60-
}
61-
62-
// Return a const reference to the internal function profile data.
63-
LLVM_DEPRECATED("Use takeMemProfData instead", "takeMemProfData")
64-
const llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> &
65-
getProfileData() const {
66-
return FunctionProfileData;
67-
}
68-
6949
// Take the complete profile data.
7050
IndexedMemProfData takeMemProfData() {
7151
// TODO: Once we replace the three member variables, namely IdToFrame,
@@ -116,24 +96,6 @@ class MemProfReader {
11696
MemProfReader() = default;
11797
virtual ~MemProfReader() = default;
11898

119-
// Initialize the MemProfReader with the frame mappings and profile contents.
120-
LLVM_DEPRECATED("Construct MemProfReader with IndexedMemProfData",
121-
"MemProfReader")
122-
MemProfReader(
123-
llvm::DenseMap<FrameId, Frame> FrameIdMap,
124-
llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> ProfData);
125-
126-
// Initialize the MemProfReader with the frame mappings, call stack mappings,
127-
// and profile contents.
128-
LLVM_DEPRECATED("Construct MemProfReader with IndexedMemProfData",
129-
"MemProfReader")
130-
MemProfReader(
131-
llvm::DenseMap<FrameId, Frame> FrameIdMap,
132-
llvm::DenseMap<CallStackId, llvm::SmallVector<FrameId>> CSIdMap,
133-
llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> ProfData)
134-
: IdToFrame(std::move(FrameIdMap)), CSIdToCallStack(std::move(CSIdMap)),
135-
FunctionProfileData(std::move(ProfData)) {}
136-
13799
// Initialize the MemProfReader with the given MemProf profile.
138100
MemProfReader(IndexedMemProfData MemProfData) {
139101
for (const auto &[FrameId, F] : MemProfData.Frames)

llvm/lib/ProfileData/MemProfReader.cpp

-22
Original file line numberDiff line numberDiff line change
@@ -228,28 +228,6 @@ std::string getBuildIdString(const SegmentEntry &Entry) {
228228
}
229229
} // namespace
230230

231-
MemProfReader::MemProfReader(
232-
llvm::DenseMap<FrameId, Frame> FrameIdMap,
233-
llvm::MapVector<GlobalValue::GUID, IndexedMemProfRecord> ProfData)
234-
: IdToFrame(std::move(FrameIdMap)),
235-
FunctionProfileData(std::move(ProfData)) {
236-
// Populate CSId in each IndexedAllocationInfo and IndexedMemProfRecord
237-
// while storing CallStack in CSIdToCallStack.
238-
for (auto &KV : FunctionProfileData) {
239-
IndexedMemProfRecord &Record = KV.second;
240-
for (auto &AS : Record.AllocSites) {
241-
CallStackId CSId = hashCallStack(AS.CallStack);
242-
AS.CSId = CSId;
243-
CSIdToCallStack.insert({CSId, AS.CallStack});
244-
}
245-
for (auto &CS : Record.CallSites) {
246-
CallStackId CSId = hashCallStack(CS);
247-
Record.CallSiteIds.push_back(CSId);
248-
CSIdToCallStack.insert({CSId, CS});
249-
}
250-
}
251-
}
252-
253231
Expected<std::unique_ptr<RawMemProfReader>>
254232
RawMemProfReader::create(const Twine &Path, const StringRef ProfiledBinary,
255233
bool KeepName) {

0 commit comments

Comments
 (0)