diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-03-09 05:00:03 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-03-09 07:48:08 +0900 |
| commit | d32924f89d1324386588bd23b0437cdeca1e0fc8 (patch) | |
| tree | 1477262a6b21101bc690def180b0de58b3344836 /src/librustc_codegen_llvm/asm.rs | |
| parent | 1d5241c96208ca7d925442b1a5fa45ad18717a6f (diff) | |
| download | rust-d32924f89d1324386588bd23b0437cdeca1e0fc8.tar.gz rust-d32924f89d1324386588bd23b0437cdeca1e0fc8.zip | |
Check if output is immediate value
Diffstat (limited to 'src/librustc_codegen_llvm/asm.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/asm.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/librustc_codegen_llvm/asm.rs b/src/librustc_codegen_llvm/asm.rs index c8f0fe8c723..7975a70ab26 100644 --- a/src/librustc_codegen_llvm/asm.rs +++ b/src/librustc_codegen_llvm/asm.rs @@ -29,11 +29,17 @@ impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> { let mut indirect_outputs = vec![]; for (i, (out, &place)) in ia.outputs.iter().zip(&outputs).enumerate() { if out.is_rw { - inputs.push(self.load_operand(place).immediate()); + let operand = self.load_operand(place); + if let OperandValue::Immediate(_) = operand.val { + inputs.push(operand.immediate()); + } ext_constraints.push(i.to_string()); } if out.is_indirect { - indirect_outputs.push(self.load_operand(place).immediate()); + let operand = self.load_operand(place); + if let OperandValue::Immediate(_) = operand.val { + indirect_outputs.push(operand.immediate()); + } } else { output_types.push(place.layout.llvm_type(self.cx())); } |
