[PATCH] D30167: [Assembler] Add test for !srcloc references in assembler diags

Sanne Wouda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 03:30:06 PST 2017


sanwou01 added inline comments.


================
Comment at: tools/llc/llc.cpp:266
+  if (LocCookie)
+    errs() << "note: !srcloc = " << LocCookie << "\n";
 }
----------------
mehdi_amini wrote:
> That could be noisy, wouldn't it? Maybe have an option to enable displaying this in llc?
> Also, it this note following another message? What does it look like? (the note alone wouldn't be great).
I did consider the noisiness of this message.  Consider, the note is only printed if
- !srcloc metadata is present; only the case in a clang-generated .ll file from a file containing inline assembly, and
- a diagnostic is emitted from IR with !srcloc metadata, and
- the .ll file is assembled using llc; none of the other tools are affected.
In short, this should not be very noisy.

Also, the note is always associated with the diagnostic printed by the SMD.print() above, so it is always printed after the proper diagnostic, e.g.:

```
<inline asm>:1:1: error: unknown instruction
              wibble
              ^
note: !srcloc = 107
```

Is this acceptable?


https://reviews.llvm.org/D30167





More information about the llvm-commits mailing list