[PATCH] D71851: Use the first location in the fused location for diagnostic handler

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 11:15:31 PST 2019


rriddle added a comment.
Herald added a subscriber: mehdi_amini.

Can you add a test case for this?



================
Comment at: mlir/lib/IR/Diagnostics.cpp:384
+/// Return a processable CallSiteLocation from the given location.
+static Optional<FileLineColLoc> getCallSiteLoc(Location loc) {
+  switch (loc->getKind()) {
----------------
This looks wrong, seems like it should be retuning a CallSiteLoc.


================
Comment at: mlir/lib/IR/Diagnostics.cpp:466
       emitDiagnostic(callerLoc, "called from", DiagnosticSeverity::Note);
-      if ((callLoc = callerLoc.dyn_cast<CallSiteLoc>()))
-        callerLoc = callLoc.getCaller();
+      if (auto subLoc = callerLoc.dyn_cast<CallSiteLoc>())
+        callerLoc = subLoc.getCaller();
----------------
Why not also use getCallSiteLoc here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71851/new/

https://reviews.llvm.org/D71851





More information about the llvm-commits mailing list