[WebAssembly] Object: Remove redundant method. NFC.
authorSam Clegg <sbc@chromium.org>
Tue, 5 Feb 2019 16:30:21 +0000 (16:30 +0000)
committerSam Clegg <sbc@chromium.org>
Tue, 5 Feb 2019 16:30:21 +0000 (16:30 +0000)
Differential Revision: https://reviews.llvm.org/D57719

llvm-svn: 353183

llvm/include/llvm/Object/Wasm.h
llvm/lib/Object/WasmObjectFile.cpp

index ba84205..ec498a3 100644 (file)
@@ -228,7 +228,6 @@ private:
   const WasmSection &getWasmSection(DataRefImpl Ref) const;
   const wasm::WasmRelocation &getWasmRelocation(DataRefImpl Ref) const;
 
-  const uint8_t *getPtr(size_t Offset) const;
   Error parseSection(WasmSection &Sec);
   Error parseCustomSection(WasmSection &Sec, ReadContext &Ctx);
 
index 3a5dc38..7423dc9 100644 (file)
@@ -255,7 +255,7 @@ WasmObjectFile::WasmObjectFile(MemoryBufferRef Buffer, Error &Err)
   }
 
   ReadContext Ctx;
-  Ctx.Start = getPtr(0);
+  Ctx.Start = reinterpret_cast<const uint8_t *>(getData().data());
   Ctx.Ptr = Ctx.Start + 4;
   Ctx.End = Ctx.Start + getData().size();
 
@@ -1173,10 +1173,6 @@ Error WasmObjectFile::parseDataSection(ReadContext &Ctx) {
   return Error::success();
 }
 
-const uint8_t *WasmObjectFile::getPtr(size_t Offset) const {
-  return reinterpret_cast<const uint8_t *>(getData().data() + Offset);
-}
-
 const wasm::WasmObjectHeader &WasmObjectFile::getHeader() const {
   return Header;
 }