[PATCH] D12215: [UBSan] Add the ability to print more precise error kind in summary line.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 16:43:22 PDT 2015


rsmith added inline comments.

================
Comment at: lib/ubsan/ubsan_handlers.cc:57-58
@@ -57,2 +56,4 @@
+  if (!Pointer) {
+    R.setErrorType(ErrorType::NullPointerUse);
     Diag(Loc, DL_Error, "%0 null pointer of type %1")
       << TypeCheckKinds[Data->TypeCheckKind] << Data->Type;
----------------
samsonov wrote:
> rsmith wrote:
> > Can we pass the error type to `Diag` in the place of `DL_Error` instead of specifying it separately?
> We still need error type somewhere outside `Diag`, because it will be used later when we print (or not print) summary, after several `Diag` invocations (for DL_Error and DL_Note).
We would make exactly one invocation to `Diag` with an error type, wouldn't we? Is the summary information computed separately from diagnostic emission?


http://reviews.llvm.org/D12215





More information about the cfe-commits mailing list