[PATCH] D80258: Fix SourceMgrDiagnosticHandler::convertLocToSMLoc for unknown line/column scenerio.

Jing Pu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 19:49:23 PDT 2020


Jing marked an inline comment as done.
Jing added inline comments.


================
Comment at: mlir/lib/IR/Diagnostics.cpp:515
+  if (loc.getLine() == 0 || loc.getColumn() == 0)
+    return llvm::SMLoc();
+
----------------
mehdi_amini wrote:
> How do we actually identify when the loc is referring really to the beginning of the file? There isn't a way to figure out?
SourceMgr::FindLocForLineAndColumn assumes the indices are one-based, but treats line 0 specially that also points the first line.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80258





More information about the llvm-commits mailing list