Propogate the error message, not just the error state.

llvm-svn: 128094
This commit is contained in:
Jim Grosbach 2011-03-22 18:19:42 +00:00
parent d52744086f
commit 40411cc409
3 changed files with 9 additions and 2 deletions

View File

@ -38,6 +38,7 @@ public:
// FIXME: Should be parameterized to get the memory block associated with // FIXME: Should be parameterized to get the memory block associated with
// a particular loaded object. // a particular loaded object.
sys::MemoryBlock getMemoryBlock(); sys::MemoryBlock getMemoryBlock();
StringRef getErrorString();
}; };
} // end namespace llvm } // end namespace llvm

View File

@ -334,4 +334,9 @@ sys::MemoryBlock RuntimeDyld::getMemoryBlock() {
return Dyld->getMemoryBlock(); return Dyld->getMemoryBlock();
} }
StringRef RuntimeDyld::getErrorString()
{
return Dyld->getErrorString();
}
} // end namespace llvm } // end namespace llvm

View File

@ -63,8 +63,9 @@ static int executeInput() {
RuntimeDyld Dyld; RuntimeDyld Dyld;
// Load the object file into it. // Load the object file into it.
if (Dyld.loadObject(InputBuffer.take())) if (Dyld.loadObject(InputBuffer.take())) {
return true; return Error(Dyld.getErrorString());
}
// Get the address of "_main". // Get the address of "_main".
void *MainAddress = Dyld.getSymbolAddress("_main"); void *MainAddress = Dyld.getSymbolAddress("_main");