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

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 08:53:34 PST 2017


mehdi_amini accepted this revision.
mehdi_amini added a comment.
This revision is now accepted and ready to land.

LGMT



================
Comment at: tools/llc/llc.cpp:266
+  if (LocCookie)
+    errs() << "note: !srcloc = " << LocCookie << "\n";
 }
----------------
sanwou01 wrote:
> 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?
> Is this acceptable?

Sure! Thanks.



https://reviews.llvm.org/D30167





More information about the llvm-commits mailing list