diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2018-11-27 19:00:25 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2018-11-29 18:19:44 +0100 |
| commit | ceb29e2ac45474a560b04ce4061d8a6cc50e1a33 (patch) | |
| tree | 876117be9a8cc977e6956e7082bd673117318485 /src/librustc_codegen_llvm/asm.rs | |
| parent | e45733048eb06da0976e736bb44fe906495d65e9 (diff) | |
| download | rust-ceb29e2ac45474a560b04ce4061d8a6cc50e1a33.tar.gz rust-ceb29e2ac45474a560b04ce4061d8a6cc50e1a33.zip | |
Use implicit deref instead of BuilderMethods::cx()
Diffstat (limited to 'src/librustc_codegen_llvm/asm.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/asm.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_codegen_llvm/asm.rs b/src/librustc_codegen_llvm/asm.rs index efbe7cad138..294596cea5f 100644 --- a/src/librustc_codegen_llvm/asm.rs +++ b/src/librustc_codegen_llvm/asm.rs @@ -57,7 +57,7 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> { // Default per-arch clobbers // Basically what clang does - let arch_clobbers = match &self.cx().sess().target.target.arch[..] { + let arch_clobbers = match &self.sess().target.target.arch[..] { "x86" | "x86_64" => vec!["~{dirflag}", "~{fpsr}", "~{flags}"], "mips" | "mips64" => vec!["~{$1}"], _ => Vec::new() @@ -76,9 +76,9 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> { // Depending on how many outputs we have, the return type is different let num_outputs = output_types.len(); let output_type = match num_outputs { - 0 => self.cx().type_void(), + 0 => self.type_void(), 1 => output_types[0], - _ => self.cx().type_struct(&output_types, false) + _ => self.type_struct(&output_types, false) }; let asm = CString::new(ia.asm.as_str().as_bytes()).unwrap(); @@ -108,13 +108,13 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> { // back to source locations. See #17552. unsafe { let key = "srcloc"; - let kind = llvm::LLVMGetMDKindIDInContext(self.cx().llcx, + let kind = llvm::LLVMGetMDKindIDInContext(self.llcx, key.as_ptr() as *const c_char, key.len() as c_uint); - let val: &'ll Value = self.cx().const_i32(ia.ctxt.outer().as_u32() as i32); + let val: &'ll Value = self.const_i32(ia.ctxt.outer().as_u32() as i32); llvm::LLVMSetMetadata(r, kind, - llvm::LLVMMDNodeInContext(self.cx().llcx, &val, 1)); + llvm::LLVMMDNodeInContext(self.llcx, &val, 1)); } true |
