llvm.org GIT mirror llvm / a48b83e
Remove the now unused StringRefMemoryObject.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221755 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 5 years ago
7 changed file(s) with 0 addition(s) and 75 deletion(s). Raw diff Collapse all Expand all
+0
-41
include/llvm/Support/StringRefMemoryObject.h less more
None //===- llvm/Support/StringRefMemoryObject.h ---------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declaration of the StringRefMemObject class, a simple
10 // wrapper around StringRef implementing the MemoryObject interface.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_SUPPORT_STRINGREFMEMORYOBJECT_H
15 #define LLVM_SUPPORT_STRINGREFMEMORYOBJECT_H
16
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/Compiler.h"
19 #include "llvm/Support/MemoryObject.h"
20
21 namespace llvm {
22
23 /// StringRefMemoryObject - Simple StringRef-backed MemoryObject
24 class StringRefMemoryObject : public MemoryObject {
25 StringRef Bytes;
26 uint64_t Base;
27 public:
28 StringRefMemoryObject(StringRef Bytes, uint64_t Base = 0)
29 : Bytes(Bytes), Base(Base) {}
30
31 uint64_t getBase() const override { return Base; }
32 uint64_t getExtent() const override { return Bytes.size(); }
33
34 int readByte(uint64_t Addr, uint8_t *Byte) const override;
35 int readBytes(uint64_t Addr, uint64_t Size, uint8_t *Buf) const override;
36 };
37
38 }
39
40 #endif
1111 #include "llvm/MC/MCContext.h"
1212 #include "llvm/MC/MCDisassembler.h"
1313 #include "llvm/MC/MCInst.h"
14 #include "llvm/Support/StringRefMemoryObject.h"
1514 #include "llvm/Support/Path.h"
1615 #include "RuntimeDyldCheckerImpl.h"
1716 #include "RuntimeDyldImpl.h"
2020 #include "llvm/MC/MCSymbolizer.h"
2121 #include "llvm/Support/ErrorHandling.h"
2222 #include "llvm/Support/FormattedStream.h"
23 #include "llvm/Support/StringRefMemoryObject.h"
2423 #include "llvm/Support/TargetRegistry.h"
2524
2625 using namespace llvm;
8484 StringMap.cpp
8585 StringPool.cpp
8686 StringRef.cpp
87 StringRefMemoryObject.cpp
8887 SystemUtils.cpp
8988 Timer.cpp
9089 ToolOutputFile.cpp
+0
-29
lib/Support/StringRefMemoryObject.cpp less more
None //===- lib/Support/StringRefMemoryObject.cpp --------------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/Support/StringRefMemoryObject.h"
10
11 using namespace llvm;
12
13 int StringRefMemoryObject::readByte(uint64_t Addr, uint8_t *Byte) const {
14 if (Addr >= Base + getExtent() || Addr < Base)
15 return -1;
16 *Byte = Bytes[Addr - Base];
17 return 0;
18 }
19
20 int StringRefMemoryObject::readBytes(uint64_t Addr,
21 uint64_t Size,
22 uint8_t *Buf) const {
23 uint64_t Offset = Addr - Base;
24 if (Addr >= Base + getExtent() || Offset + Size > getExtent() || Addr < Base)
25 return -1;
26 memcpy(Buf, Bytes.data() + Offset, Size);
27 return 0;
28 }
2121 #include "llvm/MC/MCStreamer.h"
2222 #include "llvm/MC/MCSubtargetInfo.h"
2323 #include "llvm/Support/MemoryBuffer.h"
24 #include "llvm/Support/StringRefMemoryObject.h"
2524 #include "llvm/Support/SourceMgr.h"
2625 #include "llvm/Support/TargetRegistry.h"
2726 #include "llvm/Support/raw_ostream.h"
1212 #include "llvm/ADT/StringRef.h"
1313 #include "llvm/Support/CommandLine.h"
1414 #include "llvm/Support/DataTypes.h"
15 #include "llvm/Support/StringRefMemoryObject.h"
1615
1716 namespace llvm {
1817 namespace object {