[llvm] 45e390c - [ORC] Report paths in errors when creating StaticLibrarySearchGenerators.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 17 12:01:16 PDT 2022


Author: Lang Hames
Date: 2022-04-17T12:01:06-07:00
New Revision: 45e390cfee76560c7d449b198e17e8a6d16447d7

URL: https://github.com/llvm/llvm-project/commit/45e390cfee76560c7d449b198e17e8a6d16447d7
DIFF: https://github.com/llvm/llvm-project/commit/45e390cfee76560c7d449b198e17e8a6d16447d7.diff

LOG: [ORC] Report paths in errors when creating StaticLibrarySearchGenerators.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
index cbc27980f57a3..95cf89ec3f8bf 100644
--- a/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
@@ -273,10 +273,10 @@ Expected<std::unique_ptr<StaticLibraryDefinitionGenerator>>
 StaticLibraryDefinitionGenerator::Load(
     ObjectLayer &L, const char *FileName,
     GetObjectFileInterface GetObjFileInterface) {
-  auto ArchiveBuffer = errorOrToExpected(MemoryBuffer::getFile(FileName));
+  auto ArchiveBuffer = MemoryBuffer::getFile(FileName);
 
   if (!ArchiveBuffer)
-    return ArchiveBuffer.takeError();
+    return createFileError(FileName, ArchiveBuffer.getError());
 
   return Create(L, std::move(*ArchiveBuffer), std::move(GetObjFileInterface));
 }
@@ -288,7 +288,7 @@ StaticLibraryDefinitionGenerator::Load(
 
   auto B = object::createBinary(FileName);
   if (!B)
-    return B.takeError();
+    return createFileError(FileName, B.takeError());
 
   // If this is a regular archive then create an instance from it.
   if (isa<object::Archive>(B->getBinary()))


        


More information about the llvm-commits mailing list