rustc: Remove the memory-managed interface to LLVM memory buffers; passing them around transfers ownership
This commit is contained in:
parent
6fdb81fa17
commit
1d8b0e8f8a
@ -3,7 +3,6 @@
|
||||
import driver.session;
|
||||
import front.ast;
|
||||
import lib.llvm.llvmext;
|
||||
import lib.llvm.mk_memory_buffer;
|
||||
import lib.llvm.mk_object_file;
|
||||
import lib.llvm.mk_section_iter;
|
||||
import middle.fold;
|
||||
|
@ -1381,23 +1381,6 @@ fn mk_pass_manager() -> pass_manager {
|
||||
ret rec(llpm=llpm, dtor=pass_manager_dtor(llpm));
|
||||
}
|
||||
|
||||
/* Memory-managed interface to memory buffers. */
|
||||
|
||||
obj memory_buffer_dtor(MemoryBufferRef MemBuf) {
|
||||
drop { llvm.LLVMDisposeMemoryBuffer(MemBuf); }
|
||||
}
|
||||
|
||||
type memory_buffer = rec(MemoryBufferRef llmb, memory_buffer_dtor dtor);
|
||||
|
||||
fn mk_memory_buffer(sbuf path) -> memory_buffer {
|
||||
auto llmb = llvmext.LLVMRustCreateMemoryBufferWithContentsOfFile(path);
|
||||
if ((llmb as int) == 0) {
|
||||
log "failed to create memory buffer";
|
||||
fail;
|
||||
}
|
||||
ret rec(llmb=llmb, dtor=memory_buffer_dtor(llmb));
|
||||
}
|
||||
|
||||
/* Memory-managed interface to object files. */
|
||||
|
||||
obj object_file_dtor(ObjectFileRef ObjectFile) {
|
||||
|
Loading…
Reference in New Issue
Block a user