@@ -1882,37 +1882,23 @@ impl TypeNames {
18821882
18831883/* Memory-managed interface to target data. */
18841884
1885- pub struct target_data_res {
1886- pub td : TargetDataRef ,
1885+ pub struct TargetData {
1886+ pub lltd : TargetDataRef
18871887}
18881888
1889- impl Drop for target_data_res {
1889+ impl Drop for TargetData {
18901890 fn drop ( & mut self ) {
18911891 unsafe {
1892- llvm:: LLVMDisposeTargetData ( self . td ) ;
1892+ llvm:: LLVMDisposeTargetData ( self . lltd ) ;
18931893 }
18941894 }
18951895}
18961896
1897- pub fn target_data_res ( td : TargetDataRef ) -> target_data_res {
1898- target_data_res {
1899- td : td
1900- }
1901- }
1902-
1903- pub struct TargetData {
1904- pub lltd : TargetDataRef ,
1905- dtor : @target_data_res
1906- }
1907-
19081897pub fn mk_target_data ( string_rep : & str ) -> TargetData {
1909- let lltd = string_rep. with_c_str ( |buf| {
1910- unsafe { llvm:: LLVMCreateTargetData ( buf) }
1911- } ) ;
1912-
19131898 TargetData {
1914- lltd : lltd,
1915- dtor : @target_data_res ( lltd)
1899+ lltd : string_rep. with_c_str ( |buf| {
1900+ unsafe { llvm:: LLVMCreateTargetData ( buf) }
1901+ } )
19161902 }
19171903}
19181904
@@ -1949,35 +1935,22 @@ impl Drop for ObjectFile {
19491935
19501936/* Memory-managed interface to section iterators. */
19511937
1952- pub struct section_iter_res {
1953- pub si : SectionIteratorRef ,
1938+ pub struct SectionIter {
1939+ pub llsi : SectionIteratorRef
19541940}
19551941
1956- impl Drop for section_iter_res {
1942+ impl Drop for SectionIter {
19571943 fn drop ( & mut self ) {
19581944 unsafe {
1959- llvm:: LLVMDisposeSectionIterator ( self . si ) ;
1945+ llvm:: LLVMDisposeSectionIterator ( self . llsi ) ;
19601946 }
19611947 }
19621948}
19631949
1964- pub fn section_iter_res ( si : SectionIteratorRef ) -> section_iter_res {
1965- section_iter_res {
1966- si : si
1967- }
1968- }
1969-
1970- pub struct SectionIter {
1971- pub llsi : SectionIteratorRef ,
1972- dtor : @section_iter_res
1973- }
1974-
19751950pub fn mk_section_iter ( llof : ObjectFileRef ) -> SectionIter {
19761951 unsafe {
1977- let llsi = llvm:: LLVMGetSections ( llof) ;
19781952 SectionIter {
1979- llsi : llsi,
1980- dtor : @section_iter_res ( llsi)
1953+ llsi : llvm:: LLVMGetSections ( llof)
19811954 }
19821955 }
19831956}
0 commit comments