OLD | NEW |
1 //===-- NaClBitcodeBlockDist.h -----------------------------------------===// | 1 //===-- NaClBitcodeBlockDist.h -----------------------------------------===// |
2 // Defines distribution maps for blocks within PNaCl bitcode. | 2 // Defines distribution maps for blocks within PNaCl bitcode. |
3 // | 3 // |
4 // The LLVM Compiler Infrastructure | 4 // The LLVM Compiler Infrastructure |
5 // | 5 // |
6 // This file is distributed under the University of Illinois Open Source | 6 // This file is distributed under the University of Illinois Open Source |
7 // License. See LICENSE.TXT for details. | 7 // License. See LICENSE.TXT for details. |
8 // | 8 // |
9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
10 // | 10 // |
11 // Defines a distribution map for blocks which tracks the number of bits | 11 // Defines a distribution map for blocks which tracks the number of bits |
12 // in each block, as well as the percentage of the file each bitcode block | 12 // in each block, as well as the percentage of the file each bitcode block |
13 // ID holds. | 13 // ID holds. |
14 | 14 |
15 | 15 |
16 #ifndef LLVM_BITCODE_NACL_NACLBITCODEBLOCKDIST_H | 16 #ifndef LLVM_BITCODE_NACL_NACLBITCODEBLOCKDIST_H |
17 #define LLVM_BITCODE_NACL_NACLBITCODEBLOCKDIST_H | 17 #define LLVM_BITCODE_NACL_NACLBITCODEBLOCKDIST_H |
18 | 18 |
19 #include "llvm/Bitcode/NaCl/NaClBitcodeBitsDist.h" | 19 #include "llvm/Bitcode/NaCl/NaClBitcodeBitsDist.h" |
20 | 20 |
21 namespace llvm { | 21 namespace llvm { |
22 | 22 |
23 class NaClBitcodeBlockDistElement : public NaClBitcodeBitsDistElement { | 23 class NaClBitcodeBlockDistElement : public NaClBitcodeBitsDistElement { |
24 NaClBitcodeBlockDistElement(const NaClBitcodeBlockDistElement&) | 24 NaClBitcodeBlockDistElement(const NaClBitcodeBlockDistElement&) = delete; |
25 LLVM_DELETED_FUNCTION; | |
26 void operator=(const NaClBitcodeBlockDistElement&); | 25 void operator=(const NaClBitcodeBlockDistElement&); |
27 | 26 |
28 public: | 27 public: |
29 static bool classof(const NaClBitcodeDistElement *Element) { | 28 static bool classof(const NaClBitcodeDistElement *Element) { |
30 return Element->getKind() >= RDE_BlockDist && | 29 return Element->getKind() >= RDE_BlockDist && |
31 Element->getKind() < RDE_BlockDistLast; | 30 Element->getKind() < RDE_BlockDistLast; |
32 } | 31 } |
33 | 32 |
34 // Top-level constructor to create instances of this class. | 33 // Top-level constructor to create instances of this class. |
35 explicit NaClBitcodeBlockDistElement( | 34 explicit NaClBitcodeBlockDistElement( |
(...skipping 19 matching lines...) Expand all Loading... |
55 /// Prints out statistics for the row with the given value. | 54 /// Prints out statistics for the row with the given value. |
56 virtual void PrintRowStats(raw_ostream &Stream, | 55 virtual void PrintRowStats(raw_ostream &Stream, |
57 const NaClBitcodeDist *Distribution) const; | 56 const NaClBitcodeDist *Distribution) const; |
58 | 57 |
59 virtual void PrintRowValue(raw_ostream &Stream, | 58 virtual void PrintRowValue(raw_ostream &Stream, |
60 NaClBitcodeDistValue Value, | 59 NaClBitcodeDistValue Value, |
61 const NaClBitcodeDist *Distribution) const; | 60 const NaClBitcodeDist *Distribution) const; |
62 }; | 61 }; |
63 | 62 |
64 class NaClBitcodeBlockDist : public NaClBitcodeDist { | 63 class NaClBitcodeBlockDist : public NaClBitcodeDist { |
65 NaClBitcodeBlockDist(const NaClBitcodeBlockDist&) LLVM_DELETED_FUNCTION; | 64 NaClBitcodeBlockDist(const NaClBitcodeBlockDist&) = delete; |
66 void operator=(const NaClBitcodeBlockDist&) LLVM_DELETED_FUNCTION; | 65 void operator=(const NaClBitcodeBlockDist&) = delete; |
67 | 66 |
68 public: | 67 public: |
69 static bool classof(const NaClBitcodeDist *Dist) { | 68 static bool classof(const NaClBitcodeDist *Dist) { |
70 return Dist->getKind() >= RD_BlockDist && | 69 return Dist->getKind() >= RD_BlockDist && |
71 Dist->getKind() < RD_BlockDistLast; | 70 Dist->getKind() < RD_BlockDistLast; |
72 } | 71 } |
73 | 72 |
74 static NaClBitcodeBlockDistElement DefaultSentinal; | 73 static NaClBitcodeBlockDistElement DefaultSentinal; |
75 | 74 |
76 explicit NaClBitcodeBlockDist( | 75 explicit NaClBitcodeBlockDist( |
(...skipping 10 matching lines...) Expand all Loading... |
87 // | 86 // |
88 // Note: If the name is not known, an "UnknownBlock" name is | 87 // Note: If the name is not known, an "UnknownBlock" name is |
89 // generated and returned. | 88 // generated and returned. |
90 static std::string GetName(unsigned BlockID); | 89 static std::string GetName(unsigned BlockID); |
91 | 90 |
92 }; | 91 }; |
93 | 92 |
94 } | 93 } |
95 | 94 |
96 #endif | 95 #endif |
OLD | NEW |