[PATCH] Add warning capabilities in LLVM (backend part)

Quentin Colombet qcolombet at apple.com
Fri Nov 15 10:17:11 PST 2013


Hi dblaikie, echristo, rengolin, chandlerc,

Hi,

This patch implements the proposal discussed a few months ago (http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063845.html) regarding adding warning capabilities in LLVM.

//// Overview ////

The patch adds a new LLVMContext::report that can be used to communicate to the front-end, if any, that something of interest happened.
The report contains the following information:
- The kind of the report: What this is this about.
- The severity of the report: How bad this is.
- The default message to print: What should be reported.
- A data field: Some meta information.

The data field should be used to communicate all sort of data to the front-end. Ultimately, this field should provide enough information to the front-end so that it could build its own diagnostic if it does not want to print the default message.
This means that both the back-end and the front-end should agree on the structure of this field based on the pair kind/severity.
This feature is not stressed by this patch.

This patch introduces a new ReportHandlerTy and a new ReportContext that should be set by the front-end to be able to map these reports in its own diagnostics system.

//// Next Steps ////

- Send the patch for clang (I have it on hold).
- Switch to this reporting for all warnings printing happening in the backend.
- Switch the InlineAsmDiagHandler to the new reporting mechanism. This involves a bit of work, especially regarding the meta data.

Thanks for your reviews.

Cheers,
Quentin

PS: Sorry for the delay, it took my ages to get to this point in my todolist.

http://llvm-reviews.chandlerc.com/D2190

Files:
  include/llvm/IR/LLVMContext.h
  lib/CodeGen/PrologEpilogInserter.cpp
  lib/IR/LLVMContext.cpp
  lib/IR/LLVMContextImpl.cpp
  lib/IR/LLVMContextImpl.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2190.1.patch
Type: text/x-patch
Size: 7688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131115/91210cd9/attachment.bin>


More information about the llvm-commits mailing list