rustc: Remove the memory-managed interface to LLVM memory buffers; passing them around transfers ownership

This commit is contained in:
Patrick Walton 2011-03-15 18:08:30 -07:00
parent 6fdb81fa17
commit 1d8b0e8f8a
2 changed files with 0 additions and 18 deletions

View File

@ -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;

View File

@ -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) {