Propogate the error message, not just the error state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128094 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2011-03-22 18:19:42 +00:00
parent 34714a0609
commit b3eecaf19e
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
// a particular loaded object.
sys::MemoryBlock getMemoryBlock();
StringRef getErrorString();
};
} // end namespace llvm

View File

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

View 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");