Skip to content

Commit 521aa40

Browse files
Artem Gindinsonigcbot
authored andcommitted
Re-apply LLVM 15 MCStreamer API naming fixes
Re-apply `MCStreamer` API changes from eb6c96c that have been reverted due to the caused regression. Change the original approach by simplifying the `finish()` API wrapper - let LLVM initialize the default `EndLoc` argument value instead.
1 parent f958667 commit 521aa40

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

IGC/DebugInfo/StreamEmitter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@ const MCSection *StreamEmitter::GetDwarfFrameSection() const {
491491

492492
void StreamEmitter::SwitchSection(const MCSection *pSection,
493493
const MCExpr *pSubsection) const {
494-
m_pMCStreamer->SwitchSection(const_cast<MCSection *>(pSection), pSubsection);
494+
IGCLLVM::switchSection(m_pMCStreamer, const_cast<MCSection *>(pSection),
495+
pSubsection);
495496
}
496497

497498
MCSymbol *StreamEmitter::GetSymbol(const GlobalValue *pGV) const {
@@ -781,7 +782,7 @@ void StreamEmitter::SetMCLineTableSymbol(MCSymbol *pSym, unsigned id) const {
781782
}
782783

783784
void StreamEmitter::Finalize() const {
784-
m_pMCStreamer->Finish();
785+
IGCLLVM::finish(m_pMCStreamer);
785786
m_pMCStreamer->reset();
786787
}
787788

IGC/WrapperLLVM/include/llvmWrapper/MC/MCStreamer.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ inline void initSections(llvm::MCStreamer *streamer, bool NoExecStack, const llv
2020
streamer->InitSections(NoExecStack);
2121
#endif
2222
}
23+
24+
inline void switchSection(llvm::MCStreamer *streamer, llvm::MCSection *Section,
25+
const llvm::MCExpr *Subsection = nullptr) {
26+
#if LLVM_VERSION_MAJOR >= 15
27+
streamer->switchSection(Section, Subsection);
28+
#else
29+
streamer->SwitchSection(Section, Subsection);
30+
#endif
31+
}
32+
33+
inline void finish(llvm::MCStreamer *streamer) {
34+
#if LLVM_VERSION_MAJOR >= 15
35+
streamer->finish();
36+
#else
37+
streamer->Finish();
38+
#endif
39+
}
2340
}
2441

2542
#endif

0 commit comments

Comments
 (0)