summaryrefslogtreecommitdiff
path: root/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
commit5e45dc40d329829ad23bf444f32dca221215e239 (patch)
tree717bb23e6e1af2314d66495c62843a8a8725a5f1 /lib/Object/ObjectFile.cpp
parentbc437ebbca77cf8a7e2e47e3666c4a0114ccc2d1 (diff)
downloadllvm-5e45dc40d329829ad23bf444f32dca221215e239.tar.gz
llvm-5e45dc40d329829ad23bf444f32dca221215e239.tar.bz2
llvm-5e45dc40d329829ad23bf444f32dca221215e239.tar.xz
Revert the last two commits in the series. r132911, r132912.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/ObjectFile.cpp')
-rw-r--r--lib/Object/ObjectFile.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Object/ObjectFile.cpp b/lib/Object/ObjectFile.cpp
index a7798df33f..47b63115a9 100644
--- a/lib/Object/ObjectFile.cpp
+++ b/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) {