/* Memory-managed object interface to type handles. */
pub struct TypeNames {
- named_types: RefCell<HashMap<StrBuf, TypeRef>>,
+ named_types: RefCell<HashMap<String, TypeRef>>,
}
impl TypeNames {
self.named_types.borrow().find_equiv(&s).map(|x| Type::from_ref(*x))
}
- pub fn type_to_str(&self, ty: Type) -> StrBuf {
+ pub fn type_to_str(&self, ty: Type) -> String {
unsafe {
let s = llvm::LLVMTypeToString(ty.to_ref());
let ret = from_c_str(s);
}
}
- pub fn types_to_str(&self, tys: &[Type]) -> StrBuf {
- let strs: Vec<StrBuf> = tys.iter().map(|t| self.type_to_str(*t)).collect();
+ pub fn types_to_str(&self, tys: &[Type]) -> String {
+ let strs: Vec<String> = tys.iter().map(|t| self.type_to_str(*t)).collect();
format_strbuf!("[{}]", strs.connect(",").to_strbuf())
}
- pub fn val_to_str(&self, val: ValueRef) -> StrBuf {
+ pub fn val_to_str(&self, val: ValueRef) -> String {
unsafe {
let s = llvm::LLVMValueToString(val);
let ret = from_c_str(s);