@@ -925,7 +925,7 @@ fn type_to_str(names: type_names, ty: TypeRef) -> str {
925
925
}
926
926
927
927
fn type_to_str_inner ( names : type_names , outer0 : [ TypeRef ] , ty : TypeRef ) ->
928
- str unsafe {
928
+ str {
929
929
930
930
if names. type_has_name ( ty) { ret names. get_name ( ty) ; }
931
931
@@ -956,7 +956,7 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
956
956
7 {
957
957
ret "i" + std:: int:: str ( llvm:: LLVMGetIntTypeWidth ( ty) as int ) ;
958
958
}
959
- 8 {
959
+ 8 unsafe {
960
960
let s = "fn(" ;
961
961
let out_ty: TypeRef = llvm:: LLVMGetReturnType ( ty) ;
962
962
let n_args: uint = llvm:: LLVMCountParamTypes ( ty) ;
@@ -969,7 +969,7 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
969
969
s += type_to_str_inner ( names, outer, out_ty) ;
970
970
ret s;
971
971
}
972
- 9 {
972
+ 9 unsafe {
973
973
let s: str = "{" ;
974
974
let n_elts: uint = llvm:: LLVMCountStructElementTypes ( ty) ;
975
975
let elts: [ TypeRef ] = vec:: init_elt :: < TypeRef > ( 0 as TypeRef , n_elts) ;
@@ -1003,7 +1003,7 @@ fn type_to_str_inner(names: type_names, outer0: [TypeRef], ty: TypeRef) ->
1003
1003
}
1004
1004
}
1005
1005
1006
- fn float_width( llt: TypeRef ) -> uint unsafe {
1006
+ fn float_width( llt: TypeRef ) -> uint {
1007
1007
ret alt llvm : : LLVMGetTypeKind ( llt) {
1008
1008
1 { 32 u }
1009
1009
2 { 64 u }
@@ -1022,53 +1022,53 @@ fn fn_ty_param_tys(fn_ty: TypeRef) -> [TypeRef] unsafe {
1022
1022
1023
1023
/* Memory-managed interface to target data. */
1024
1024
1025
- resource target_data_res( TD : TargetDataRef ) unsafe {
1025
+ resource target_data_res ( TD : TargetDataRef ) {
1026
1026
llvm:: LLVMDisposeTargetData ( TD ) ;
1027
1027
}
1028
1028
1029
1029
type target_data = { lltd : TargetDataRef , dtor : @target_data_res } ;
1030
1030
1031
- fn mk_target_data ( string_rep : str ) -> target_data unsafe {
1031
+ fn mk_target_data ( string_rep : str ) -> target_data {
1032
1032
let lltd =
1033
1033
str:: as_buf ( string_rep, { |buf| llvm:: LLVMCreateTargetData ( buf) } ) ;
1034
1034
ret { lltd : lltd, dtor : @target_data_res ( lltd) } ;
1035
1035
}
1036
1036
1037
1037
/* Memory-managed interface to pass managers. */
1038
1038
1039
- resource pass_manager_res( PM : PassManagerRef ) unsafe {
1039
+ resource pass_manager_res ( PM : PassManagerRef ) {
1040
1040
llvm:: LLVMDisposePassManager ( PM ) ;
1041
1041
}
1042
1042
1043
1043
type pass_manager = { llpm : PassManagerRef , dtor : @pass_manager_res } ;
1044
1044
1045
- fn mk_pass_manager ( ) -> pass_manager unsafe {
1045
+ fn mk_pass_manager ( ) -> pass_manager {
1046
1046
let llpm = llvm:: LLVMCreatePassManager ( ) ;
1047
1047
ret { llpm : llpm, dtor : @pass_manager_res ( llpm) } ;
1048
1048
}
1049
1049
1050
1050
/* Memory-managed interface to object files. */
1051
1051
1052
- resource object_file_res( ObjectFile : ObjectFileRef ) unsafe {
1052
+ resource object_file_res ( ObjectFile : ObjectFileRef ) {
1053
1053
llvm:: LLVMDisposeObjectFile ( ObjectFile ) ;
1054
1054
}
1055
1055
1056
1056
type object_file = { llof : ObjectFileRef , dtor : @object_file_res } ;
1057
1057
1058
- fn mk_object_file ( llmb : MemoryBufferRef ) -> object_file unsafe {
1058
+ fn mk_object_file ( llmb : MemoryBufferRef ) -> object_file {
1059
1059
let llof = llvm:: LLVMCreateObjectFile ( llmb) ;
1060
1060
ret { llof : llof, dtor : @object_file_res ( llof) } ;
1061
1061
}
1062
1062
1063
1063
/* Memory-managed interface to section iterators. */
1064
1064
1065
- resource section_iter_res( SI : SectionIteratorRef ) unsafe {
1065
+ resource section_iter_res ( SI : SectionIteratorRef ) {
1066
1066
llvm:: LLVMDisposeSectionIterator ( SI ) ;
1067
1067
}
1068
1068
1069
1069
type section_iter = { llsi : SectionIteratorRef , dtor : @section_iter_res } ;
1070
1070
1071
- fn mk_section_iter ( llof : ObjectFileRef ) -> section_iter unsafe {
1071
+ fn mk_section_iter ( llof : ObjectFileRef ) -> section_iter {
1072
1072
let llsi = llvm:: LLVMGetSections ( llof) ;
1073
1073
ret { llsi : llsi, dtor : @section_iter_res ( llsi) } ;
1074
1074
}
0 commit comments