[llvm] Improving ThinLTO error message for inline assembly errors (PR #102211)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 10:00:24 PDT 2024


================
@@ -188,6 +189,29 @@ SourceMgr::SrcBuffer::~SrcBuffer() {
   }
 }
 
+StringRef SourceMgr::getDebugFilename(SMLoc Loc, unsigned BufferID) const {
+  if (!BufferID)
+    BufferID = FindBufferContainingLoc(Loc);
+  assert(BufferID && "Invalid location!");
+
+  auto &SB = getBufferInfo(BufferID);
+
+  return SB.SourceFilename;
+}
+
+std::pair<unsigned, unsigned>
+SourceMgr::getDebugLineAndColumn(SMLoc Loc, unsigned BufferID) const {
+  if (!BufferID)
+    BufferID = FindBufferContainingLoc(Loc);
+  assert(BufferID && "Invalid location!");
+
+  auto &SB = getBufferInfo(BufferID);
+
----------------
MaskRay wrote:

delete blank line.

We generally don't force a blank line after a variable declaration.

https://github.com/llvm/llvm-project/pull/102211


More information about the llvm-commits mailing list