diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-10 06:47:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-10 06:47:55 +0100 |
| commit | 436f2ec58cecdba7b03a05d89a90e6bce1e13500 (patch) | |
| tree | 56fef9d057cfc9f7f93aece0d55a9050605249ff /src/librustc_codegen_llvm | |
| parent | 08095f4978b1dbf1aba584969e314a3caac705a2 (diff) | |
| parent | d32924f89d1324386588bd23b0437cdeca1e0fc8 (diff) | |
Rollup merge of #69836 - JohnTitor:immediate-outputs, r=nagisa
Check if output is immediate value Fixes #62046 r? @nagisa
Diffstat (limited to 'src/librustc_codegen_llvm')
| -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())); } |
