diff options
author | Fangrui Song <i@maskray.me> | 2024-07-22 21:56:45 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-07-22 21:56:45 -0700 |
commit | ae3c85a708dcb8e9a1721d69943232af3e263099 (patch) | |
tree | cd50dd8f56731e3996be24c9e2c330f503a45fca /llvm/lib/MC/MCMachOStreamer.cpp | |
parent | 9cc11b98a76c9b2f39b84f709566aac6f962f07a (diff) | |
download | llvm-ae3c85a708dcb8e9a1721d69943232af3e263099.zip llvm-ae3c85a708dcb8e9a1721d69943232af3e263099.tar.gz llvm-ae3c85a708dcb8e9a1721d69943232af3e263099.tar.bz2 |
MCAssembler: Move CGProfile to MCObjectWriter
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCMachOStreamer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp index 1d5d1c6..63c54e6 100644 --- a/llvm/lib/MC/MCMachOStreamer.cpp +++ b/llvm/lib/MC/MCMachOStreamer.cpp @@ -123,7 +123,7 @@ public: void emitCGProfileEntry(const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count) override { if (!From->getSymbol().isTemporary() && !To->getSymbol().isTemporary()) - getAssembler().CGProfile.push_back({From, To, Count}); + getWriter().getCGProfile().push_back({From, To, Count}); } void finishImpl() override; @@ -506,9 +506,10 @@ void MCMachOStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) { void MCMachOStreamer::finalizeCGProfile() { MCAssembler &Asm = getAssembler(); - if (Asm.CGProfile.empty()) + MCObjectWriter &W = getWriter(); + if (W.getCGProfile().empty()) return; - for (MCAssembler::CGProfileEntry &E : Asm.CGProfile) { + for (auto &E : W.getCGProfile()) { finalizeCGProfileEntry(E.From); finalizeCGProfileEntry(E.To); } @@ -520,7 +521,7 @@ void MCMachOStreamer::finalizeCGProfile() { changeSection(CGProfileSection); // For each entry, reserve space for 2 32-bit indices and a 64-bit count. size_t SectionBytes = - Asm.CGProfile.size() * (2 * sizeof(uint32_t) + sizeof(uint64_t)); + W.getCGProfile().size() * (2 * sizeof(uint32_t) + sizeof(uint64_t)); cast<MCDataFragment>(*CGProfileSection->begin()) .getContents() .resize(SectionBytes); |