[Mlir-commits] [mlir] 670063e - Preserve the error message when MemoryBuffer creation fails

Mehdi Amini llvmlistbot at llvm.org
Fri Aug 21 11:03:41 PDT 2020


Author: Aden Grue
Date: 2020-08-21T18:03:25Z
New Revision: 670063eb220663b5a42fd4e9bd63f51d379c9aa0

URL: https://github.com/llvm/llvm-project/commit/670063eb220663b5a42fd4e9bd63f51d379c9aa0
DIFF: https://github.com/llvm/llvm-project/commit/670063eb220663b5a42fd4e9bd63f51d379c9aa0.diff

LOG: Preserve the error message when MemoryBuffer creation fails

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D86326

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/ExecutionEngine.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
index 83db795f8ce8..bad433306502 100644
--- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -251,7 +251,8 @@ Expected<std::unique_ptr<ExecutionEngine>> ExecutionEngine::create(
     for (auto libPath : sharedLibPaths) {
       auto mb = llvm::MemoryBuffer::getFile(libPath);
       if (!mb) {
-        errs() << "Fail to create MemoryBuffer for: " << libPath << "\n";
+        errs() << "Failed to create MemoryBuffer for: " << libPath
+               << "\nError: " << mb.getError().message() << "\n";
         continue;
       }
       auto &JD = session.createBareJITDylib(std::string(libPath));


        


More information about the Mlir-commits mailing list