Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: include/llvm/Bitcode/NaCl/NaClCompressBlockDist.h

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h ('k') | include/llvm/Bitcode/NaCl/NaClCompressCodeDist.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Bitcode/NaCl/NaClCompressBlockDist.h
diff --git a/include/llvm/Bitcode/NaCl/NaClCompressBlockDist.h b/include/llvm/Bitcode/NaCl/NaClCompressBlockDist.h
new file mode 100644
index 0000000000000000000000000000000000000000..66c3bdc99b98330798eeac8ac20d80382cfcc0d2
--- /dev/null
+++ b/include/llvm/Bitcode/NaCl/NaClCompressBlockDist.h
@@ -0,0 +1,62 @@
+//===-- NaClCompressBlockDist.h -------------------------------------------===//
+// Defines distribution maps used to collect block and record
+// distributions for tool pnacl-bccompress.
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_BITCODE_NACL_NACLCOMPRESSBLOCKDIST_H
+#define LLVM_BITCODE_NACL_NACLCOMPRESSBLOCKDIST_H
+
+
+#include "llvm/Bitcode/NaCl/NaClBitcodeAbbrevDist.h"
+#include "llvm/Bitcode/NaCl/NaClBitcodeBlockDist.h"
+
+namespace llvm {
+
+/// Nests record distributions within the block they appear in,
+/// in a block distribution. The record distributions are refined
+/// by separating record codes that use the same abbreviation.
+class NaClCompressBlockDistElement : public NaClBitcodeBlockDistElement {
+public:
+ static bool classof(const NaClBitcodeDistElement *Element) {
+ return Element->getKind() >= RDE_PNaClCompressBlockDist
+ && Element->getKind() < RDE_PNaClCompressBlockDistLast;
+ }
+
+ explicit NaClCompressBlockDistElement(unsigned BlockID=0)
+ : NaClBitcodeBlockDistElement(RDE_PNaClCompressBlockDist),
+ AbbrevDist(BlockID) {
+ NestedDists.push_back(&AbbrevDist);
+ }
+
+ virtual ~NaClCompressBlockDistElement();
+
+ virtual NaClBitcodeDistElement*
+ CreateElement(NaClBitcodeDistValue Value) const;
+
+ virtual const SmallVectorImpl<NaClBitcodeDist*> *
+ GetNestedDistributions() const;
+
+ NaClBitcodeDist &GetAbbrevDist() {
+ return AbbrevDist;
+ }
+
+ // Sentinel for generating elements of this type.
+ static NaClCompressBlockDistElement Sentinel;
+
+private:
+ // Nested blocks used by GetNestedDistributions.
+ SmallVector<NaClBitcodeDist*, 1> NestedDists;
+
+ // The abbreviations/records associated with the corresponding block.
+ NaClBitcodeAbbrevDist AbbrevDist;
+};
+
+}
+
+#endif
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h ('k') | include/llvm/Bitcode/NaCl/NaClCompressCodeDist.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698