Don't use LLVMRustStringWriteImpl
outside of RawRustStringOstream
This commit is contained in:
parent
6295686a37
commit
730626dbd9
@ -1624,5 +1624,6 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
|
|||||||
CfiFunctionDefs, CfiFunctionDecls);
|
CfiFunctionDefs, CfiFunctionDecls);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LLVMRustStringWriteImpl(KeyOut, Key.c_str(), Key.size());
|
auto OS = RawRustStringOstream(KeyOut);
|
||||||
|
OS << Key.str();
|
||||||
}
|
}
|
||||||
|
@ -1510,8 +1510,8 @@ LLVMRustUnpackSMDiagnostic(LLVMSMDiagnosticRef DRef, RustStringRef MessageOut,
|
|||||||
const SourceMgr &LSM = *D.getSourceMgr();
|
const SourceMgr &LSM = *D.getSourceMgr();
|
||||||
const MemoryBuffer *LBuf =
|
const MemoryBuffer *LBuf =
|
||||||
LSM.getMemoryBuffer(LSM.FindBufferContainingLoc(D.getLoc()));
|
LSM.getMemoryBuffer(LSM.FindBufferContainingLoc(D.getLoc()));
|
||||||
LLVMRustStringWriteImpl(BufferOut, LBuf->getBufferStart(),
|
auto BufferOS = RawRustStringOstream(BufferOut);
|
||||||
LBuf->getBufferSize());
|
BufferOS << LBuf->getBuffer();
|
||||||
|
|
||||||
*LocOut = D.getLoc().getPointer() - LBuf->getBufferStart();
|
*LocOut = D.getLoc().getPointer() - LBuf->getBufferStart();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user