mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-02 05:17:15 +00:00
Make ObjectFile and BitcodeReader always own the MemoryBuffer.
This allows us to just use a std::unique_ptr to store the pointer to the buffer. The flip side is that they have to support releasing the buffer back to the caller. Overall this looks like a more efficient and less brittle api. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -400,10 +400,13 @@ std::error_code Module::materializeAll() {
|
||||
return Materializer->MaterializeModule(this);
|
||||
}
|
||||
|
||||
std::error_code Module::materializeAllPermanently() {
|
||||
std::error_code Module::materializeAllPermanently(bool ReleaseBuffer) {
|
||||
if (std::error_code EC = materializeAll())
|
||||
return EC;
|
||||
|
||||
if (ReleaseBuffer)
|
||||
Materializer->releaseBuffer();
|
||||
|
||||
Materializer.reset();
|
||||
return std::error_code();
|
||||
}
|
||||
|
Reference in New Issue
Block a user