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

Unified Diff: include/llvm/Bitcode/NaCl/NaClCompressCodeDist.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/NaClCompressBlockDist.h ('k') | include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Bitcode/NaCl/NaClCompressCodeDist.h
diff --git a/include/llvm/Bitcode/NaCl/NaClCompressCodeDist.h b/include/llvm/Bitcode/NaCl/NaClCompressCodeDist.h
new file mode 100644
index 0000000000000000000000000000000000000000..71b1775482afd45943d8f40cf74307f67a49fa94
--- /dev/null
+++ b/include/llvm/Bitcode/NaCl/NaClCompressCodeDist.h
@@ -0,0 +1,63 @@
+//===-- NaClCompressCodeDist.h -------------------------------------------===//
+// Defines distribution maps for record codes for 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_NACLCOMPRESSCODEDIST_H
+#define LLVM_BITCODE_NACL_NACLCOMPRESSCODEDIST_H
+
+#include "llvm/Bitcode/NaCl/NaClBitcodeCodeDist.h"
+#include "llvm/Bitcode/NaCl/NaClBitcodeSizeDist.h"
+
+namespace llvm {
+
+/// Defines a record code distribution, with nested distributions separating
+/// the code distributions based on size and values.
+class NaClCompressCodeDistElement : public NaClBitcodeCodeDistElement {
+public:
+ static bool classof(const NaClBitcodeDistElement *Element) {
+ return Element->getKind() >= RDE_CompressCodeDist &&
+ Element->getKind() < RDE_CompressCodeDistLast;
+ }
+
+ NaClCompressCodeDistElement()
+ : NaClBitcodeCodeDistElement(RDE_CompressCodeDist),
+ SizeDist(NaClBitcodeDist::RecordStorage,
+ &NaClBitcodeSizeDistElement::Sentinel) {
+ NestedDists.push_back(&SizeDist);
+ }
+
+ virtual ~NaClCompressCodeDistElement();
+
+ virtual NaClBitcodeDistElement *CreateElement(
+ NaClBitcodeDistValue Value) const;
+
+ virtual void AddRecord(const NaClBitcodeRecord &Record);
+
+ virtual const SmallVectorImpl<NaClBitcodeDist*> *
+ GetNestedDistributions() const;
+
+ NaClBitcodeDist &GetSizeDist() {
+ return SizeDist;
+ }
+
+ /// The sentinel used to generate instances of this in
+ /// a record code distribution map.
+ static NaClCompressCodeDistElement Sentinel;
+
+private:
+ // Nested blocks used by GetNestedDistributions.
+ SmallVector<NaClBitcodeDist*, 1> NestedDists;
+
+ /// The distribution of values, based on size.
+ NaClBitcodeDist SizeDist;
+};
+
+}
+
+#endif
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClCompressBlockDist.h ('k') | include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698