[Mlir-commits] [mlir] [mlir] Partially revert #162903 (PR #164464)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Oct 21 10:29:55 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Jan Svoboda (jansvoboda11)

<details>
<summary>Changes</summary>

With #<!-- -->163862, this is not really necessary and causes downstream issues.

---
Full diff: https://github.com/llvm/llvm-project/pull/164464.diff


1 Files Affected:

- (modified) mlir/lib/IR/Diagnostics.cpp (+2-4) 


``````````diff
diff --git a/mlir/lib/IR/Diagnostics.cpp b/mlir/lib/IR/Diagnostics.cpp
index 4d819188fa555..776b5c6588c71 100644
--- a/mlir/lib/IR/Diagnostics.cpp
+++ b/mlir/lib/IR/Diagnostics.cpp
@@ -378,10 +378,8 @@ struct SourceMgrDiagnosticHandlerImpl {
     }
 
     // Otherwise, try to load the source file.
-    auto bufferOrErr = llvm::MemoryBuffer::getFile(filename);
-    if (!bufferOrErr)
-      return 0;
-    unsigned id = mgr.AddNewSourceBuffer(std::move(*bufferOrErr), SMLoc());
+    std::string ignored;
+    unsigned id = mgr.AddIncludeFile(std::string(filename), SMLoc(), ignored);
     filenameToBufId[filename] = id;
     return id;
   }

``````````

</details>


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


More information about the Mlir-commits mailing list