OLD | NEW |
(Empty) | |
| 1 //===-- NaClBitcodeAbbrevDist.cpp -------------------------------------------===
// |
| 2 // Implements distribution maps for abbreviations associated with |
| 3 // bitcode records. |
| 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 #include "llvm/Bitcode/NaCl/NaClBitcodeAbbrevDist.h" |
| 13 |
| 14 using namespace llvm; |
| 15 |
| 16 NaClBitcodeAbbrevDistElement::~NaClBitcodeAbbrevDistElement() {} |
| 17 |
| 18 NaClBitcodeDistElement *NaClBitcodeAbbrevDistElement::CreateElement( |
| 19 NaClBitcodeDistValue Value) const { |
| 20 return new NaClBitcodeAbbrevDistElement(); |
| 21 } |
| 22 |
| 23 void NaClBitcodeAbbrevDistElement:: |
| 24 GetValueList(const NaClBitcodeRecord &Record, |
| 25 ValueListType &ValueList) const { |
| 26 ValueList.push_back(Record.GetAbbreviationIndex()); |
| 27 } |
| 28 |
| 29 void NaClBitcodeAbbrevDistElement::AddRecord(const NaClBitcodeRecord &Record) { |
| 30 NaClBitcodeDistElement::AddRecord(Record); |
| 31 CodeDist.AddRecord(Record); |
| 32 } |
| 33 |
| 34 const char *NaClBitcodeAbbrevDistElement::GetTitle() const { |
| 35 return "Abbreviation Indices"; |
| 36 } |
| 37 |
| 38 const char *NaClBitcodeAbbrevDistElement::GetValueHeader() const { |
| 39 return " Index"; |
| 40 } |
| 41 |
| 42 void NaClBitcodeAbbrevDistElement:: |
| 43 PrintRowValue(raw_ostream &Stream, |
| 44 NaClBitcodeDistValue Value, |
| 45 const NaClBitcodeDist *Distribution) const { |
| 46 Stream << format("%7u", Value); |
| 47 } |
| 48 |
| 49 const SmallVectorImpl<NaClBitcodeDist*> *NaClBitcodeAbbrevDistElement:: |
| 50 GetNestedDistributions() const { |
| 51 return &NestedDists; |
| 52 } |
| 53 |
| 54 NaClBitcodeAbbrevDistElement NaClBitcodeAbbrevDistElement::Sentinel; |
| 55 |
| 56 NaClBitcodeAbbrevDist::~NaClBitcodeAbbrevDist() {} |
| 57 |
| 58 NaClBitcodeDistElement* NaClBitcodeAbbrevDist:: |
| 59 CreateElement(NaClBitcodeDistValue Value) const { |
| 60 return new NaClBitcodeAbbrevDistElement(BlockID); |
| 61 } |
OLD | NEW |