diff options
| author | bors <bors@rust-lang.org> | 2015-01-25 16:09:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-25 16:09:48 +0000 |
| commit | d15192317aa025ff06faa56ca00950fb7ce6ff4b (patch) | |
| tree | f73000348615874afc4caa279494fd3f4bf77bc9 /src/rustllvm/RustWrapper.cpp | |
| parent | 102ab57d8085fcb87c02dae929959ccaaa9af548 (diff) | |
| parent | 4cfb70026c91a338518a17579bcd62a32a0a413d (diff) | |
| download | rust-d15192317aa025ff06faa56ca00950fb7ce6ff4b.tar.gz rust-d15192317aa025ff06faa56ca00950fb7ce6ff4b.zip | |
Auto merge of #21518 - Zoxc:asm-err, r=luqmana
Before:
```
error: invalid operand for inline asm constraint 'i' at line 11
```
Note that 11 is not the line the inline assembly appears in.
After:
```
src/arch/x64/multiboot/bootstrap.rs:203:5: 209:9 error: invalid operand for inline asm constraint 'i'
src/arch/x64/multiboot/bootstrap.rs:203 asm! {
src/arch/x64/multiboot/bootstrap.rs:204 [multiboot => %ecx, mod attsyntax]
src/arch/x64/multiboot/bootstrap.rs:205
src/arch/x64/multiboot/bootstrap.rs:206 ljmp {size_of::<Descriptor>() => %i}, $bootstrap.64
src/arch/x64/multiboot/bootstrap.rs:207 }
src/arch/x64/multiboot/bootstrap.rs:208
...
error: aborting due to previous error
```
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index bce73a27699..728ff1461fc 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -894,6 +894,22 @@ LLVMUnpackOptimizationDiagnostic( *message_out = wrap(&opt->getMsg()); } +extern "C" void +LLVMUnpackInlineAsmDiagnostic( + LLVMDiagnosticInfoRef di, + unsigned *cookie_out, + LLVMTwineRef *message_out, + LLVMValueRef *instruction_out) +{ + // Undefined to call this not on an inline assembly diagnostic! + llvm::DiagnosticInfoInlineAsm *ia + = static_cast<llvm::DiagnosticInfoInlineAsm*>(unwrap(di)); + + *cookie_out = ia->getLocCookie(); + *message_out = wrap(&ia->getMsgStr()); + *instruction_out = wrap(ia->getInstruction()); +} + extern "C" void LLVMWriteDiagnosticInfoToString(LLVMDiagnosticInfoRef di, RustStringRef str) { raw_rust_string_ostream os(str); DiagnosticPrinterRawOStream dp(os); |
