X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FObject%2FObjectFile.cpp;h=058bc3436a615d65f9a9a6164514106bd7e1a73e;hb=f4ec8bfaecef4e38f713b9e05d89869b023e1ce8;hp=2e6b9e6505a7f418d28ecd5cc9d04c834e4d4573;hpb=584fe2db6ad04974b569da2d90860cc2b75c025b;p=oota-llvm.git diff --git a/lib/Object/ObjectFile.cpp b/lib/Object/ObjectFile.cpp index 2e6b9e6505a..058bc3436a6 100644 --- a/lib/Object/ObjectFile.cpp +++ b/lib/Object/ObjectFile.cpp @@ -16,6 +16,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Support/system_error.h" using namespace llvm; @@ -25,7 +26,16 @@ void ObjectFile::anchor() { } ObjectFile::ObjectFile(unsigned int Type, MemoryBuffer *Source, bool BufferOwned) - : Binary(Type, Source, BufferOwned) {} + : SymbolicFile(Type, Source, BufferOwned) {} + +error_code ObjectFile::printSymbolName(raw_ostream &OS, + DataRefImpl Symb) const { + StringRef Name; + if (error_code EC = getSymbolName(Symb, Name)) + return EC; + OS << Name; + return object_error::success; +} error_code ObjectFile::getSymbolAlignment(DataRefImpl DRI, uint32_t &Result) const { @@ -80,5 +90,5 @@ ErrorOr ObjectFile::createObjectFile(StringRef ObjectPath) { OwningPtr File; if (error_code EC = MemoryBuffer::getFile(ObjectPath, File)) return EC; - return createObjectFile(File.take()); + return createObjectFile(File.release()); }