@@ -1882,37 +1882,23 @@ impl TypeNames {
1882
1882
1883
1883
/* Memory-managed interface to target data. */
1884
1884
1885
- pub struct target_data_res {
1886
- pub td : TargetDataRef ,
1885
+ pub struct TargetData {
1886
+ pub lltd : TargetDataRef
1887
1887
}
1888
1888
1889
- impl Drop for target_data_res {
1889
+ impl Drop for TargetData {
1890
1890
fn drop ( & mut self ) {
1891
1891
unsafe {
1892
- llvm:: LLVMDisposeTargetData ( self . td ) ;
1892
+ llvm:: LLVMDisposeTargetData ( self . lltd ) ;
1893
1893
}
1894
1894
}
1895
1895
}
1896
1896
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
-
1908
1897
pub fn mk_target_data ( string_rep : & str ) -> TargetData {
1909
- let lltd = string_rep. with_c_str ( |buf| {
1910
- unsafe { llvm:: LLVMCreateTargetData ( buf) }
1911
- } ) ;
1912
-
1913
1898
TargetData {
1914
- lltd : lltd,
1915
- dtor : @target_data_res ( lltd)
1899
+ lltd : string_rep. with_c_str ( |buf| {
1900
+ unsafe { llvm:: LLVMCreateTargetData ( buf) }
1901
+ } )
1916
1902
}
1917
1903
}
1918
1904
@@ -1949,35 +1935,22 @@ impl Drop for ObjectFile {
1949
1935
1950
1936
/* Memory-managed interface to section iterators. */
1951
1937
1952
- pub struct section_iter_res {
1953
- pub si : SectionIteratorRef ,
1938
+ pub struct SectionIter {
1939
+ pub llsi : SectionIteratorRef
1954
1940
}
1955
1941
1956
- impl Drop for section_iter_res {
1942
+ impl Drop for SectionIter {
1957
1943
fn drop ( & mut self ) {
1958
1944
unsafe {
1959
- llvm:: LLVMDisposeSectionIterator ( self . si ) ;
1945
+ llvm:: LLVMDisposeSectionIterator ( self . llsi ) ;
1960
1946
}
1961
1947
}
1962
1948
}
1963
1949
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
-
1975
1950
pub fn mk_section_iter ( llof : ObjectFileRef ) -> SectionIter {
1976
1951
unsafe {
1977
- let llsi = llvm:: LLVMGetSections ( llof) ;
1978
1952
SectionIter {
1979
- llsi : llsi,
1980
- dtor : @section_iter_res ( llsi)
1953
+ llsi : llvm:: LLVMGetSections ( llof)
1981
1954
}
1982
1955
}
1983
1956
}
0 commit comments