summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/ObjectFile.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-06-13 11:53:31 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-06-13 11:53:31 +0000
commitaa41981dd897001f789cbc8a4c8c12a6fe641f3e (patch)
tree7c85a2261e023da73f44f2a53fb465be7102b706 /llvm/lib/Object/ObjectFile.cpp
parent902695c488574625b4c6d824c3dbafa4296770b4 (diff)
downloadbcm5719-llvm-aa41981dd897001f789cbc8a4c8c12a6fe641f3e.tar.gz
bcm5719-llvm-aa41981dd897001f789cbc8a4c8c12a6fe641f3e.zip
Revert the last two commits in the series. r132911, r132912.
llvm-svn: 132913
Diffstat (limited to 'llvm/lib/Object/ObjectFile.cpp')
-rw-r--r--llvm/lib/Object/ObjectFile.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp
index a7798df33fe..47b63115a94 100644
--- a/llvm/lib/Object/ObjectFile.cpp
+++ b/llvm/lib/Object/ObjectFile.cpp
@@ -21,8 +21,18 @@
using namespace llvm;
using namespace object;
-ObjectFile::ObjectFile(unsigned int Type, MemoryBuffer *source, error_code &ec)
- : Binary(Type, source) {
+ObjectFile::ObjectFile(MemoryBuffer *Object)
+ : MapFile(Object) {
+ assert(MapFile && "Must be a valid MemoryBuffer!");
+ base = reinterpret_cast<const uint8_t *>(MapFile->getBufferStart());
+}
+
+ObjectFile::~ObjectFile() {
+ delete MapFile;
+}
+
+StringRef ObjectFile::getFilename() const {
+ return MapFile->getBufferIdentifier();
}
ObjectFile *ObjectFile::createObjectFile(MemoryBuffer *Object) {
OpenPOWER on IntegriCloud