]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/trans/builder.rs
librustc: Permit by-value-self methods to be invoked on objects
[rust.git] / src / librustc / middle / trans / builder.rs
index 4078268c6a5d8d43b9b88ce809406f511b6ebcce..a9c1adac3d7cf01e07c3926d4706708e8a087367 100644 (file)
@@ -31,9 +31,9 @@ pub struct Builder<'a> {
 
 // This is a really awful way to get a zero-length c-string, but better (and a
 // lot more efficient) than doing str::as_c_str("", ...) every time.
-pub fn noname() -> *c_char {
+pub fn noname() -> *const c_char {
     static cnull: c_char = 0;
-    &cnull as *c_char
+    &cnull as *const c_char
 }
 
 impl<'a> Builder<'a> {
@@ -159,6 +159,14 @@ pub fn invoke(&self,
                   attributes: &[(uint, u64)])
                   -> ValueRef {
         self.count_insn("invoke");
+
+        debug!("Invoke {} with args ({})",
+               self.ccx.tn.val_to_str(llfn),
+               args.iter()
+                   .map(|&v| self.ccx.tn.val_to_str(v))
+                   .collect::<Vec<String>>()
+                   .connect(", "));
+
         unsafe {
             let v = llvm::LLVMBuildInvoke(self.llbuilder,
                                           llfn,
@@ -564,14 +572,14 @@ pub fn struct_gep(&self, ptr: ValueRef, idx: uint) -> ValueRef {
         }
     }
 
-    pub fn global_string(&self, _str: *c_char) -> ValueRef {
+    pub fn global_string(&self, _str: *const c_char) -> ValueRef {
         self.count_insn("globalstring");
         unsafe {
             llvm::LLVMBuildGlobalString(self.llbuilder, _str, noname())
         }
     }
 
-    pub fn global_string_ptr(&self, _str: *c_char) -> ValueRef {
+    pub fn global_string_ptr(&self, _str: *const c_char) -> ValueRef {
         self.count_insn("globalstringptr");
         unsafe {
             llvm::LLVMBuildGlobalStringPtr(self.llbuilder, _str, noname())
@@ -774,7 +782,7 @@ pub fn add_comment(&self, text: &str) {
         }
     }
 
-    pub fn inline_asm_call(&self, asm: *c_char, cons: *c_char,
+    pub fn inline_asm_call(&self, asm: *const c_char, cons: *const c_char,
                          inputs: &[ValueRef], output: Type,
                          volatile: bool, alignstack: bool,
                          dia: AsmDialect) -> ValueRef {