OLD | NEW |
1 //==- ThreadedStreamingCache.h - Cache for StreamingMemoryObject -*- C++ -*-==// | 1 //==- ThreadedStreamingCache.h - Cache for StreamingMemoryObject -*- C++ -*-==// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 | 9 |
10 #ifndef THREADEDSTREAMINGCACHE_H | 10 #ifndef THREADEDSTREAMINGCACHE_H |
(...skipping 11 matching lines...) Expand all Loading... |
22 // Its interface is exactly the same as StreamableMemoryObject. | 22 // Its interface is exactly the same as StreamableMemoryObject. |
23 | 23 |
24 class ThreadedStreamingCache : public llvm::StreamableMemoryObject { | 24 class ThreadedStreamingCache : public llvm::StreamableMemoryObject { |
25 public: | 25 public: |
26 explicit ThreadedStreamingCache(llvm::StreamingMemoryObject *S); | 26 explicit ThreadedStreamingCache(llvm::StreamingMemoryObject *S); |
27 virtual uint64_t getBase() const LLVM_OVERRIDE { return 0; } | 27 virtual uint64_t getBase() const LLVM_OVERRIDE { return 0; } |
28 virtual uint64_t getExtent() const LLVM_OVERRIDE; | 28 virtual uint64_t getExtent() const LLVM_OVERRIDE; |
29 virtual int readByte(uint64_t address, uint8_t* ptr) const LLVM_OVERRIDE; | 29 virtual int readByte(uint64_t address, uint8_t* ptr) const LLVM_OVERRIDE; |
30 virtual int readBytes(uint64_t address, | 30 virtual int readBytes(uint64_t address, |
31 uint64_t size, | 31 uint64_t size, |
32 uint8_t* buf, | 32 uint8_t* buf) const LLVM_OVERRIDE; |
33 uint64_t* copied) const LLVM_OVERRIDE; | |
34 virtual const uint8_t *getPointer(uint64_t address, | 33 virtual const uint8_t *getPointer(uint64_t address, |
35 uint64_t size) const LLVM_OVERRIDE { | 34 uint64_t size) const LLVM_OVERRIDE { |
36 // This could be fixed by ensuring the bytes are fetched and making a copy, | 35 // This could be fixed by ensuring the bytes are fetched and making a copy, |
37 // requiring that the bitcode size be known, or otherwise ensuring that | 36 // requiring that the bitcode size be known, or otherwise ensuring that |
38 // the memory doesn't go away/get reallocated, but it's | 37 // the memory doesn't go away/get reallocated, but it's |
39 // not currently necessary. Users that need the pointer don't stream. | 38 // not currently necessary. Users that need the pointer don't stream. |
40 llvm_unreachable("getPointer in streaming memory objects not allowed"); | 39 llvm_unreachable("getPointer in streaming memory objects not allowed"); |
41 return NULL; | 40 return NULL; |
42 } | 41 } |
43 virtual bool isValidAddress(uint64_t address) const LLVM_OVERRIDE; | 42 virtual bool isValidAddress(uint64_t address) const LLVM_OVERRIDE; |
(...skipping 24 matching lines...) Expand all Loading... |
68 mutable uint64_t MinObjectSize; | 67 mutable uint64_t MinObjectSize; |
69 // Current base address for the cache. | 68 // Current base address for the cache. |
70 mutable uint64_t CacheBase; | 69 mutable uint64_t CacheBase; |
71 | 70 |
72 ThreadedStreamingCache( | 71 ThreadedStreamingCache( |
73 const ThreadedStreamingCache&) LLVM_DELETED_FUNCTION; | 72 const ThreadedStreamingCache&) LLVM_DELETED_FUNCTION; |
74 void operator=(const ThreadedStreamingCache&) LLVM_DELETED_FUNCTION; | 73 void operator=(const ThreadedStreamingCache&) LLVM_DELETED_FUNCTION; |
75 }; | 74 }; |
76 | 75 |
77 #endif // THREADEDSTREAMINGCACHE_H | 76 #endif // THREADEDSTREAMINGCACHE_H |
OLD | NEW |