From cac0088e9192467621dea9824296bf2447722464 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 12 Nov 2014 02:13:27 +0000 Subject: [PATCH] Remove the now unused StringRefMemoryObject.h. llvm-svn: 221755 --- llvm/include/llvm/Support/StringRefMemoryObject.h | 41 ---------------------- .../RuntimeDyld/RuntimeDyldChecker.cpp | 1 - llvm/lib/MC/MCDisassembler/Disassembler.cpp | 1 - llvm/lib/Support/CMakeLists.txt | 1 - llvm/lib/Support/StringRefMemoryObject.cpp | 29 --------------- llvm/tools/llvm-mc/Disassembler.cpp | 1 - llvm/tools/llvm-objdump/llvm-objdump.h | 1 - 7 files changed, 75 deletions(-) delete mode 100644 llvm/include/llvm/Support/StringRefMemoryObject.h delete mode 100644 llvm/lib/Support/StringRefMemoryObject.cpp diff --git a/llvm/include/llvm/Support/StringRefMemoryObject.h b/llvm/include/llvm/Support/StringRefMemoryObject.h deleted file mode 100644 index 8a349ea..0000000 --- a/llvm/include/llvm/Support/StringRefMemoryObject.h +++ /dev/null @@ -1,41 +0,0 @@ -//===- llvm/Support/StringRefMemoryObject.h ---------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the StringRefMemObject class, a simple -// wrapper around StringRef implementing the MemoryObject interface. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_STRINGREFMEMORYOBJECT_H -#define LLVM_SUPPORT_STRINGREFMEMORYOBJECT_H - -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Compiler.h" -#include "llvm/Support/MemoryObject.h" - -namespace llvm { - -/// StringRefMemoryObject - Simple StringRef-backed MemoryObject -class StringRefMemoryObject : public MemoryObject { - StringRef Bytes; - uint64_t Base; -public: - StringRefMemoryObject(StringRef Bytes, uint64_t Base = 0) - : Bytes(Bytes), Base(Base) {} - - uint64_t getBase() const override { return Base; } - uint64_t getExtent() const override { return Bytes.size(); } - - int readByte(uint64_t Addr, uint8_t *Byte) const override; - int readBytes(uint64_t Addr, uint64_t Size, uint8_t *Buf) const override; -}; - -} - -#endif diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp index 5b3bd1d..692b2f2 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp @@ -12,7 +12,6 @@ #include "llvm/MC/MCContext.h" #include "llvm/MC/MCDisassembler.h" #include "llvm/MC/MCInst.h" -#include "llvm/Support/StringRefMemoryObject.h" #include "llvm/Support/Path.h" #include "RuntimeDyldCheckerImpl.h" #include "RuntimeDyldImpl.h" diff --git a/llvm/lib/MC/MCDisassembler/Disassembler.cpp b/llvm/lib/MC/MCDisassembler/Disassembler.cpp index bb2d707..52c4664 100644 --- a/llvm/lib/MC/MCDisassembler/Disassembler.cpp +++ b/llvm/lib/MC/MCDisassembler/Disassembler.cpp @@ -21,7 +21,6 @@ #include "llvm/MC/MCSymbolizer.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" -#include "llvm/Support/StringRefMemoryObject.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index 38481f1..794372d 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -85,7 +85,6 @@ add_llvm_library(LLVMSupport StringMap.cpp StringPool.cpp StringRef.cpp - StringRefMemoryObject.cpp SystemUtils.cpp Timer.cpp ToolOutputFile.cpp diff --git a/llvm/lib/Support/StringRefMemoryObject.cpp b/llvm/lib/Support/StringRefMemoryObject.cpp deleted file mode 100644 index e035ed1..0000000 --- a/llvm/lib/Support/StringRefMemoryObject.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//===- lib/Support/StringRefMemoryObject.cpp --------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/StringRefMemoryObject.h" - -using namespace llvm; - -int StringRefMemoryObject::readByte(uint64_t Addr, uint8_t *Byte) const { - if (Addr >= Base + getExtent() || Addr < Base) - return -1; - *Byte = Bytes[Addr - Base]; - return 0; -} - -int StringRefMemoryObject::readBytes(uint64_t Addr, - uint64_t Size, - uint8_t *Buf) const { - uint64_t Offset = Addr - Base; - if (Addr >= Base + getExtent() || Offset + Size > getExtent() || Addr < Base) - return -1; - memcpy(Buf, Bytes.data() + Offset, Size); - return 0; -} diff --git a/llvm/tools/llvm-mc/Disassembler.cpp b/llvm/tools/llvm-mc/Disassembler.cpp index 75124db..95d146a 100644 --- a/llvm/tools/llvm-mc/Disassembler.cpp +++ b/llvm/tools/llvm-mc/Disassembler.cpp @@ -22,7 +22,6 @@ #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSubtargetInfo.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/StringRefMemoryObject.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/tools/llvm-objdump/llvm-objdump.h b/llvm/tools/llvm-objdump/llvm-objdump.h index 5ecbb12..ef1509f 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.h +++ b/llvm/tools/llvm-objdump/llvm-objdump.h @@ -13,7 +13,6 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/DataTypes.h" -#include "llvm/Support/StringRefMemoryObject.h" namespace llvm { namespace object { -- 2.7.4