| Index: include/llvm/Bitcode/NaCl/NaClBitcodeSubblockDist.h
|
| diff --git a/include/llvm/Bitcode/NaCl/NaClBitcodeSubblockDist.h b/include/llvm/Bitcode/NaCl/NaClBitcodeSubblockDist.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0ca8de570ace02378afa48f777853f6189dcdb75
|
| --- /dev/null
|
| +++ b/include/llvm/Bitcode/NaCl/NaClBitcodeSubblockDist.h
|
| @@ -0,0 +1,76 @@
|
| +//===-- NaClBitcodeSubblockDist.h -----------------------------------------===//
|
| +// Defines distribution maps for subblock values within an
|
| +// (externally specified) block.
|
| +//
|
| +// The LLVM Compiler Infrastructure
|
| +//
|
| +// This file is distributed under the University of Illinois Open Source
|
| +// License. See LICENSE.TXT for details.
|
| +//
|
| +//===----------------------------------------------------------------------===//
|
| +//
|
| +// Defines the notion subblock distribution map. Shows what subblocks appear
|
| +// within a given block (defined externally to the distribution map).
|
| +
|
| +#ifndef LLVM_BITCODE_NACL_NACLBITCODESUBBLOCKDIST_H
|
| +#define LLVM_BITCODE_NACL_NACLBITCODESUBBLOCKDIST_H
|
| +
|
| +#include "llvm/Bitcode/NaCl/NaClBitcodeDist.h"
|
| +
|
| +namespace llvm {
|
| +
|
| +/// Collects the distribution of subblocks within an (externally defined)
|
| +/// block.
|
| +class NaClBitcodeSubblockDistElement : public NaClBitcodeDistElement {
|
| + NaClBitcodeSubblockDistElement(const NaClBitcodeSubblockDistElement &)
|
| + LLVM_DELETED_FUNCTION;
|
| + void operator=(const NaClBitcodeSubblockDistElement&);
|
| +
|
| +public:
|
| + static bool classof(const NaClBitcodeDistElement *Element) {
|
| + return Element->getKind() >= RDE_SubblockDist &&
|
| + Element->getKind() < RDE_SubblockDistLast;
|
| + }
|
| +
|
| + NaClBitcodeSubblockDistElement()
|
| + : NaClBitcodeDistElement(RDE_SubblockDist) {}
|
| +
|
| + virtual ~NaClBitcodeSubblockDistElement();
|
| +
|
| + virtual NaClBitcodeDistElement *CreateElement(
|
| + NaClBitcodeDistValue Value) const;
|
| +
|
| + virtual const char *GetTitle() const;
|
| +
|
| + virtual const char *GetValueHeader() const;
|
| +
|
| + virtual void PrintRowValue(raw_ostream &Stream,
|
| + NaClBitcodeDistValue Value,
|
| + const NaClBitcodeDist *Distribution) const;
|
| +};
|
| +
|
| +/// Collects the distribution of subblocks within an (externally
|
| +/// defined) block. Assumes distribution elements are instances of
|
| +/// NaClBitcodeSubblockDistElement.
|
| +class NaClBitcodeSubblockDist : public NaClBitcodeDist {
|
| + NaClBitcodeSubblockDist(const NaClBitcodeSubblockDist&) LLVM_DELETED_FUNCTION;
|
| + void operator=(const NaClBitcodeSubblockDist&) LLVM_DELETED_FUNCTION;
|
| +
|
| +public:
|
| + static bool classof(const NaClBitcodeDist *Dist) {
|
| + return Dist->getKind() >= RD_SubblockDist &&
|
| + Dist->getKind() < RD_SubblockDistLast;
|
| + }
|
| +
|
| + static NaClBitcodeSubblockDistElement DefaultSentinal;
|
| +
|
| + NaClBitcodeSubblockDist()
|
| + : NaClBitcodeDist(BlockStorage, &DefaultSentinal, RD_SubblockDist)
|
| + {}
|
| +
|
| + virtual ~NaClBitcodeSubblockDist();
|
| +};
|
| +
|
| +}
|
| +
|
| +#endif
|
|
|