@@ -390,13 +390,11 @@ extern { pub type Metadata; }
390390extern { pub type BasicBlock ; }
391391extern { pub type Builder ; }
392392extern { pub type MemoryBuffer ; }
393- pub type MemoryBufferRef = * mut MemoryBuffer ;
394393extern { pub type PassManager ; }
395394pub type PassManagerRef = * mut PassManager ;
396395extern { pub type PassManagerBuilder ; }
397396pub type PassManagerBuilderRef = * mut PassManagerBuilder ;
398397extern { pub type ObjectFile ; }
399- pub type ObjectFileRef = * mut ObjectFile ;
400398extern { pub type SectionIterator ; }
401399pub type SectionIteratorRef = * mut SectionIterator ;
402400extern { pub type Pass ; }
@@ -1143,17 +1141,19 @@ extern "C" {
11431141 // Stuff that's in rustllvm/ because it's not upstream yet.
11441142
11451143 /// Opens an object file.
1146- pub fn LLVMCreateObjectFile ( MemBuf : MemoryBufferRef ) -> ObjectFileRef ;
1144+ pub fn LLVMCreateObjectFile (
1145+ MemBuf : & ' static mut MemoryBuffer ,
1146+ ) -> Option < & ' static mut ObjectFile > ;
11471147 /// Closes an object file.
1148- pub fn LLVMDisposeObjectFile ( ObjFile : ObjectFileRef ) ;
1148+ pub fn LLVMDisposeObjectFile ( ObjFile : & ' static mut ObjectFile ) ;
11491149
11501150 /// Enumerates the sections in an object file.
1151- pub fn LLVMGetSections ( ObjFile : ObjectFileRef ) -> SectionIteratorRef ;
1151+ pub fn LLVMGetSections ( ObjFile : & ObjectFile ) -> SectionIteratorRef ;
11521152 /// Destroys a section iterator.
11531153 pub fn LLVMDisposeSectionIterator ( SI : SectionIteratorRef ) ;
11541154 /// Returns true if the section iterator is at the end of the section
11551155 /// list:
1156- pub fn LLVMIsSectionIteratorAtEnd ( ObjFile : ObjectFileRef , SI : SectionIteratorRef ) -> Bool ;
1156+ pub fn LLVMIsSectionIteratorAtEnd ( ObjFile : & ObjectFile , SI : SectionIteratorRef ) -> Bool ;
11571157 /// Moves the section iterator to point to the next section.
11581158 pub fn LLVMMoveToNextSection ( SI : SectionIteratorRef ) ;
11591159 /// Returns the current section size.
@@ -1163,7 +1163,9 @@ extern "C" {
11631163
11641164 /// Reads the given file and returns it as a memory buffer. Use
11651165 /// LLVMDisposeMemoryBuffer() to get rid of it.
1166- pub fn LLVMRustCreateMemoryBufferWithContentsOfFile ( Path : * const c_char ) -> MemoryBufferRef ;
1166+ pub fn LLVMRustCreateMemoryBufferWithContentsOfFile (
1167+ Path : * const c_char ,
1168+ ) -> Option < & ' static mut MemoryBuffer > ;
11671169
11681170 pub fn LLVMStartMultithreaded ( ) -> Bool ;
11691171
0 commit comments