aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Archive.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-02-21 20:10:59 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-02-21 20:10:59 +0000
commitf12b82824aca2711b8b2e838341ae7e1b266d213 (patch)
tree98ccf79a54b142687abb093a95b434e519777966 /llvm/lib/Object/Archive.cpp
parent38882022af8038f008fdbe0f9e0307f8c711c248 (diff)
downloadllvm-f12b82824aca2711b8b2e838341ae7e1b266d213.zip
llvm-f12b82824aca2711b8b2e838341ae7e1b266d213.tar.gz
llvm-f12b82824aca2711b8b2e838341ae7e1b266d213.tar.bz2
Add a SymbolicFile interface between Binary and ObjectFile.
This interface allows IRObjectFile to be implemented without having dummy methods for all section and segment related methods. Both llvm-ar and llvm-nm are changed to use it. Unfortunately the mangler is still not plugged in since it requires some refactoring to make a Module hold a DataLayout. llvm-svn: 201881
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r--llvm/lib/Object/Archive.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp
index 286e9ee..99bc4a5 100644
--- a/llvm/lib/Object/Archive.cpp
+++ b/llvm/lib/Object/Archive.cpp
@@ -182,12 +182,13 @@ error_code Archive::Child::getMemoryBuffer(OwningPtr<MemoryBuffer> &Result,
return error_code::success();
}
-error_code Archive::Child::getAsBinary(OwningPtr<Binary> &Result) const {
+error_code Archive::Child::getAsBinary(OwningPtr<Binary> &Result,
+ LLVMContext *Context) const {
OwningPtr<Binary> ret;
OwningPtr<MemoryBuffer> Buff;
if (error_code ec = getMemoryBuffer(Buff))
return ec;
- ErrorOr<Binary *> BinaryOrErr = createBinary(Buff.take());
+ ErrorOr<Binary *> BinaryOrErr = createBinary(Buff.take(), Context);
if (error_code EC = BinaryOrErr.getError())
return EC;
Result.reset(BinaryOrErr.get());