Propogate the error message, not just the error state.
authorJim Grosbach <grosbach@apple.com>
Tue, 22 Mar 2011 18:19:42 +0000 (18:19 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 22 Mar 2011 18:19:42 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128094 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/RuntimeDyld.h
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
tools/llvm-rtdyld/llvm-rtdyld.cpp

index 629dccff2342b95761bb81fd498aeef1d61c4abc..2b5a69181727c08e8e31b28135696cedb8186410 100644 (file)
@@ -38,6 +38,7 @@ public:
   // FIXME: Should be parameterized to get the memory block associated with
   // a particular loaded object.
   sys::MemoryBlock getMemoryBlock();
+  StringRef getErrorString();
 };
 
 } // end namespace llvm
index a57055eb8d2db590c130a157e79e77378f9a8875..aa4f2f9ad0b394d638a5ecc24b30d3346ea56b97 100644 (file)
@@ -334,4 +334,9 @@ sys::MemoryBlock RuntimeDyld::getMemoryBlock() {
   return Dyld->getMemoryBlock();
 }
 
+StringRef RuntimeDyld::getErrorString()
+{
+  return Dyld->getErrorString();
+}
+
 } // end namespace llvm
index 4e224261cbffdfe2bafc677ec2d0f6d5215acf78..286a3f251d8deba1fefaf96144f2c5eeabab0665 100644 (file)
@@ -63,8 +63,9 @@ static int executeInput() {
   RuntimeDyld Dyld;
 
   // Load the object file into it.
-  if (Dyld.loadObject(InputBuffer.take()))
-    return true;
+  if (Dyld.loadObject(InputBuffer.take())) {
+    return Error(Dyld.getErrorString());
+  }
 
   // Get the address of "_main".
   void *MainAddress = Dyld.getSymbolAddress("_main");