forked from OSchip/llvm-project
[Object] make SourceMgr available to MCContext during inline asm symbols
collection Fixes PR51210.
This commit is contained in:
parent
0d3e4d9d4d
commit
1558bb80c0
|
@ -99,7 +99,11 @@ initializeRecordStreamer(const Module &M,
|
|||
if (!MCII)
|
||||
return;
|
||||
|
||||
MCContext MCCtx(TT, MAI.get(), MRI.get(), STI.get());
|
||||
std::unique_ptr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer(InlineAsm));
|
||||
SourceMgr SrcMgr;
|
||||
SrcMgr.AddNewSourceBuffer(std::move(Buffer), SMLoc());
|
||||
|
||||
MCContext MCCtx(TT, MAI.get(), MRI.get(), STI.get(), &SrcMgr);
|
||||
std::unique_ptr<MCObjectFileInfo> MOFI(
|
||||
T->createMCObjectFileInfo(MCCtx, /*PIC=*/false));
|
||||
MOFI->setSDKVersion(M.getSDKVersion());
|
||||
|
@ -107,9 +111,6 @@ initializeRecordStreamer(const Module &M,
|
|||
RecordStreamer Streamer(MCCtx, M);
|
||||
T->createNullTargetStreamer(Streamer);
|
||||
|
||||
std::unique_ptr<MemoryBuffer> Buffer(MemoryBuffer::getMemBuffer(InlineAsm));
|
||||
SourceMgr SrcMgr;
|
||||
SrcMgr.AddNewSourceBuffer(std::move(Buffer), SMLoc());
|
||||
std::unique_ptr<MCAsmParser> Parser(
|
||||
createMCAsmParser(SrcMgr, MCCtx, Streamer, *MAI));
|
||||
|
||||
|
|
Loading…
Reference in New Issue