OLD | NEW |
(Empty) | |
| 1 //===-- NaClBitcodeSubblockDist.h -----------------------------------------===// |
| 2 // Defines distribution maps for subblock values within an |
| 3 // (externally specified) block. |
| 4 // |
| 5 // The LLVM Compiler Infrastructure |
| 6 // |
| 7 // This file is distributed under the University of Illinois Open Source |
| 8 // License. See LICENSE.TXT for details. |
| 9 // |
| 10 //===----------------------------------------------------------------------===// |
| 11 // |
| 12 // Defines the notion subblock distribution map. Shows what subblocks appear |
| 13 // within a given block (defined externally to the distribution map). |
| 14 |
| 15 #ifndef LLVM_BITCODE_NACL_NACLBITCODESUBBLOCKDIST_H |
| 16 #define LLVM_BITCODE_NACL_NACLBITCODESUBBLOCKDIST_H |
| 17 |
| 18 #include "llvm/Bitcode/NaCl/NaClBitcodeDist.h" |
| 19 |
| 20 namespace llvm { |
| 21 |
| 22 /// Collects the distribution of subblocks within an (externally defined) |
| 23 /// block. |
| 24 class NaClBitcodeSubblockDistElement : public NaClBitcodeDistElement { |
| 25 NaClBitcodeSubblockDistElement(const NaClBitcodeSubblockDistElement &) |
| 26 LLVM_DELETED_FUNCTION; |
| 27 void operator=(const NaClBitcodeSubblockDistElement&); |
| 28 |
| 29 public: |
| 30 static bool classof(const NaClBitcodeDistElement *Element) { |
| 31 return Element->getKind() >= RDE_SubblockDist && |
| 32 Element->getKind() < RDE_SubblockDistLast; |
| 33 } |
| 34 |
| 35 NaClBitcodeSubblockDistElement() |
| 36 : NaClBitcodeDistElement(RDE_SubblockDist) {} |
| 37 |
| 38 virtual ~NaClBitcodeSubblockDistElement(); |
| 39 |
| 40 virtual NaClBitcodeDistElement *CreateElement( |
| 41 NaClBitcodeDistValue Value) const; |
| 42 |
| 43 virtual const char *GetTitle() const; |
| 44 |
| 45 virtual const char *GetValueHeader() const; |
| 46 |
| 47 virtual void PrintRowValue(raw_ostream &Stream, |
| 48 NaClBitcodeDistValue Value, |
| 49 const NaClBitcodeDist *Distribution) const; |
| 50 }; |
| 51 |
| 52 /// Collects the distribution of subblocks within an (externally |
| 53 /// defined) block. Assumes distribution elements are instances of |
| 54 /// NaClBitcodeSubblockDistElement. |
| 55 class NaClBitcodeSubblockDist : public NaClBitcodeDist { |
| 56 NaClBitcodeSubblockDist(const NaClBitcodeSubblockDist&) LLVM_DELETED_FUNCTION; |
| 57 void operator=(const NaClBitcodeSubblockDist&) LLVM_DELETED_FUNCTION; |
| 58 |
| 59 public: |
| 60 static bool classof(const NaClBitcodeDist *Dist) { |
| 61 return Dist->getKind() >= RD_SubblockDist && |
| 62 Dist->getKind() < RD_SubblockDistLast; |
| 63 } |
| 64 |
| 65 static NaClBitcodeSubblockDistElement DefaultSentinal; |
| 66 |
| 67 NaClBitcodeSubblockDist() |
| 68 : NaClBitcodeDist(BlockStorage, &DefaultSentinal, RD_SubblockDist) |
| 69 {} |
| 70 |
| 71 virtual ~NaClBitcodeSubblockDist(); |
| 72 }; |
| 73 |
| 74 } |
| 75 |
| 76 #endif |
OLD | NEW |