aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2013-06-21 11:34:16 -0700
committerMark Seaborn <mseaborn@chromium.org>2013-06-21 11:34:16 -0700
commit222873819b08b3758f82bc2f432a99dcd76397de (patch)
treeecc203076dba68796eed8856145276b05bd1a339 /lib/Bitcode
parentc51cdee071a24059cc510297a3a6ad4cf5c8f4fa (diff)
PNaCl wire format: Remove function attributes from pexe reader/writer
Remove support for reading and writing the PARAMATTR_BLOCK_ID and PARAMATTR_GROUP_BLOCK_ID blocks. These blocks will no longer be written into pexes. While PNaCl doesn't allow function attributes on normal functions, Function::Create() always inserts them back on intrinsics, so previously the PARAMATTR blocks were being written into pexes. Remove paramattr fields from two record types: * MODULE_CODE_FUNCTION records (function declarations). Also remove the fields that follow paramattr, which PNaCl also does not use. * FUNC_CODE_INST_CALL (function calls). BUG=https://code.google.com/p/nativeclient/issues/detail?id=3506 TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k Review URL: https://codereview.chromium.org/17419013
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp199
-rw-r--r--lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h16
-rw-r--r--lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp88
-rw-r--r--lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp31
-rw-r--r--lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h31
5 files changed, 7 insertions, 358 deletions
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
index 2b2ca32ad7..f829642f20 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
@@ -47,7 +47,6 @@ void NaClBitcodeReader::FreeState() {
ValueList.clear();
MDValueList.clear();
- std::vector<AttributeSet>().swap(MAttributes);
std::vector<BasicBlock*>().swap(FunctionBBs);
std::vector<Function*>().swap(FunctionsWithBodies);
DeferredFunctionInfo.clear();
@@ -441,163 +440,6 @@ Type *NaClBitcodeReader::getTypeByID(unsigned ID) {
//===----------------------------------------------------------------------===//
-/// \brief This fills an AttrBuilder object with the LLVM attributes that have
-/// been decoded from the given integer. This function must stay in sync with
-/// 'encodeLLVMAttributesForBitcode'.
-static void decodeLLVMAttributesForBitcode(AttrBuilder &B,
- uint64_t EncodedAttrs) {
- // FIXME: Remove in 4.0.
-
- // The alignment is stored as a 16-bit raw value from bits 31--16. We shift
- // the bits above 31 down by 11 bits.
- unsigned Alignment = (EncodedAttrs & (0xffffULL << 16)) >> 16;
- assert((!Alignment || isPowerOf2_32(Alignment)) &&
- "Alignment must be a power of two.");
-
- if (Alignment)
- B.addAlignmentAttr(Alignment);
- B.addRawValue(((EncodedAttrs & (0xfffffULL << 32)) >> 11) |
- (EncodedAttrs & 0xffff));
-}
-
-bool NaClBitcodeReader::ParseAttributeBlock() {
- DEBUG(dbgs() << "-> ParseAttributeBlock\n");
- if (Stream.EnterSubBlock(naclbitc::PARAMATTR_BLOCK_ID))
- return Error("Malformed block record");
-
- if (!MAttributes.empty())
- return Error("Multiple PARAMATTR blocks found!");
-
- SmallVector<uint64_t, 64> Record;
-
- SmallVector<AttributeSet, 8> Attrs;
-
- // Read all the records.
- while (1) {
- NaClBitstreamEntry Entry = Stream.advanceSkippingSubblocks();
-
- switch (Entry.Kind) {
- case NaClBitstreamEntry::SubBlock: // Handled for us already.
- case NaClBitstreamEntry::Error:
- return Error("Error at end of PARAMATTR block");
- case NaClBitstreamEntry::EndBlock:
- DEBUG(dbgs() << "<- ParseAttributeBlock\n");
- return false;
- case NaClBitstreamEntry::Record:
- // The interesting case.
- break;
- }
-
- // Read a record.
- Record.clear();
- switch (Stream.readRecord(Entry.ID, Record)) {
- default: // Default behavior: ignore.
- break;
- case naclbitc::PARAMATTR_CODE_ENTRY_OLD: { // ENTRY: [paramidx0, attr0, ...]
- // FIXME: Remove in 4.0.
- if (Record.size() & 1)
- return Error("Invalid ENTRY record");
-
- for (unsigned i = 0, e = Record.size(); i != e; i += 2) {
- AttrBuilder B;
- decodeLLVMAttributesForBitcode(B, Record[i+1]);
- Attrs.push_back(AttributeSet::get(Context, Record[i], B));
- }
-
- MAttributes.push_back(AttributeSet::get(Context, Attrs));
- Attrs.clear();
- break;
- }
- case naclbitc::PARAMATTR_CODE_ENTRY: { // ENTRY: [attrgrp0, attrgrp1, ...]
- for (unsigned i = 0, e = Record.size(); i != e; ++i)
- Attrs.push_back(MAttributeGroups[Record[i]]);
-
- MAttributes.push_back(AttributeSet::get(Context, Attrs));
- Attrs.clear();
- break;
- }
- }
- }
-}
-
-bool NaClBitcodeReader::ParseAttributeGroupBlock() {
- DEBUG(dbgs() << "-> ParseAttributeGroupBlock\n");
- if (Stream.EnterSubBlock(naclbitc::PARAMATTR_GROUP_BLOCK_ID))
- return Error("Malformed block record");
-
- if (!MAttributeGroups.empty())
- return Error("Multiple PARAMATTR_GROUP blocks found!");
-
- SmallVector<uint64_t, 64> Record;
-
- // Read all the records.
- while (1) {
- NaClBitstreamEntry Entry = Stream.advanceSkippingSubblocks();
-
- switch (Entry.Kind) {
- case NaClBitstreamEntry::SubBlock: // Handled for us already.
- case NaClBitstreamEntry::Error:
- return Error("Error at end of PARAMATTR_GROUP block");
- case NaClBitstreamEntry::EndBlock:
- DEBUG(dbgs() << "<- ParseAttributeGroupBlock\n");
- return false;
- case NaClBitstreamEntry::Record:
- // The interesting case.
- break;
- }
-
- // Read a record.
- Record.clear();
- switch (Stream.readRecord(Entry.ID, Record)) {
- default: // Default behavior: ignore.
- break;
- case naclbitc::PARAMATTR_GRP_CODE_ENTRY: {
- // ENTRY: [grpid, idx, a0, a1, ...]
- if (Record.size() < 3)
- return Error("Invalid ENTRY record");
-
- uint64_t GrpID = Record[0];
- uint64_t Idx = Record[1]; // Index of the object this attribute refers to.
-
- AttrBuilder B;
- for (unsigned i = 2, e = Record.size(); i != e; ++i) {
- if (Record[i] == 0) { // Enum attribute
- B.addAttribute(Attribute::AttrKind(Record[++i]));
- } else if (Record[i] == 1) { // Align attribute
- if (Attribute::AttrKind(Record[++i]) == Attribute::Alignment)
- B.addAlignmentAttr(Record[++i]);
- else
- B.addStackAlignmentAttr(Record[++i]);
- } else { // String attribute
- assert((Record[i] == 3 || Record[i] == 4) &&
- "Invalid attribute group entry");
- bool HasValue = (Record[i++] == 4);
- SmallString<64> KindStr;
- SmallString<64> ValStr;
-
- while (Record[i] != 0 && i != e)
- KindStr += Record[i++];
- assert(Record[i] == 0 && "Kind string not null terminated");
-
- if (HasValue) {
- // Has a value associated with it.
- ++i; // Skip the '0' that terminates the "kind" string.
- while (Record[i] != 0 && i != e)
- ValStr += Record[i++];
- assert(Record[i] == 0 && "Value string not null terminated");
- }
-
- B.addAttribute(KindStr.str(), ValStr.str());
- }
- }
-
- MAttributeGroups[GrpID] = AttributeSet::get(Context, Idx, B);
- break;
- }
- }
- }
-}
-
bool NaClBitcodeReader::ParseTypeTable() {
DEBUG(dbgs() << "-> ParseTypeTable\n");
if (Stream.EnterSubBlock(naclbitc::TYPE_BLOCK_ID_NEW))
@@ -1550,14 +1392,6 @@ bool NaClBitcodeReader::ParseModule(bool Resume) {
if (Stream.ReadBlockInfoBlock())
return Error("Malformed BlockInfoBlock");
break;
- case naclbitc::PARAMATTR_BLOCK_ID:
- if (ParseAttributeBlock())
- return true;
- break;
- case naclbitc::PARAMATTR_GROUP_BLOCK_ID:
- if (ParseAttributeGroupBlock())
- return true;
- break;
case naclbitc::TYPE_BLOCK_ID_NEW:
if (ParseTypeTable())
return true;
@@ -1737,10 +1571,9 @@ bool NaClBitcodeReader::ParseModule(bool Resume) {
GlobalInits.push_back(std::make_pair(NewGV, InitID-1));
break;
}
- // FUNCTION: [type, callingconv, isproto, linkage, paramattr,
- // alignment, section, visibility, gc, unnamed_addr]
+ // FUNCTION: [type, callingconv, isproto, linkage]
case naclbitc::MODULE_CODE_FUNCTION: {
- if (Record.size() < 8)
+ if (Record.size() < 4)
return Error("Invalid MODULE_CODE_FUNCTION record");
Type *Ty = getTypeByID(Record[0]);
if (!Ty) return Error("Invalid MODULE_CODE_FUNCTION record");
@@ -1757,24 +1590,6 @@ bool NaClBitcodeReader::ParseModule(bool Resume) {
Func->setCallingConv(GetDecodedCallingConv(Record[1]));
bool isProto = Record[2];
Func->setLinkage(GetDecodedLinkage(Record[3]));
- Func->setAttributes(getAttributes(Record[4]));
-
- Func->setAlignment((1 << Record[5]) >> 1);
- if (Record[6]) {
- if (Record[6]-1 >= SectionTable.size())
- return Error("Invalid section ID");
- Func->setSection(SectionTable[Record[6]-1]);
- }
- Func->setVisibility(GetDecodedVisibility(Record[7]));
- if (Record.size() > 8 && Record[8]) {
- if (Record[8]-1 > GCTable.size())
- return Error("Invalid GC ID");
- Func->setGC(GCTable[Record[8]-1].c_str());
- }
- bool UnnamedAddr = false;
- if (Record.size() > 9)
- UnnamedAddr = Record[9];
- Func->setUnnamedAddr(UnnamedAddr);
ValueList.push_back(Func);
// If this is a function with a body, remember the prototype we are
@@ -2673,14 +2488,13 @@ bool NaClBitcodeReader::ParseFunctionBody(Function *F) {
break;
}
case naclbitc::FUNC_CODE_INST_CALL: {
- // CALL: [paramattrs, cc, fnty, fnid, arg0, arg1...]
- if (Record.size() < 3)
+ // CALL: [cc, fnty, fnid, arg0, arg1...]
+ if (Record.size() < 2)
return Error("Invalid CALL record");
- AttributeSet PAL = getAttributes(Record[0]);
- unsigned CCInfo = Record[1];
+ unsigned CCInfo = Record[0];
- unsigned OpNum = 2;
+ unsigned OpNum = 1;
Value *Callee;
if (getValueTypePair(Record, OpNum, NextValueNo, Callee))
return Error("Invalid CALL record");
@@ -2719,7 +2533,6 @@ bool NaClBitcodeReader::ParseFunctionBody(Function *F) {
InstructionList.push_back(I);
cast<CallInst>(I)->setCallingConv(GetDecodedCallingConv(CCInfo>>1));
cast<CallInst>(I)->setTailCall(CCInfo & 1);
- cast<CallInst>(I)->setAttributes(PAL);
break;
}
case naclbitc::FUNC_CODE_INST_VAARG: { // VAARG: [valistty, valist, instty]
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
index 935e77011e..a291aaa941 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
@@ -20,7 +20,6 @@
#include "llvm/Bitcode/NaCl/NaClBitstreamReader.h"
#include "llvm/Bitcode/NaCl/NaClLLVMBitCodes.h"
#include "llvm/GVMaterializer.h"
-#include "llvm/IR/Attributes.h"
#include "llvm/IR/OperandTraits.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/ValueHandle.h"
@@ -146,14 +145,6 @@ class NaClBitcodeReader : public GVMaterializer {
std::vector<std::pair<GlobalVariable*, unsigned> > GlobalInits;
std::vector<std::pair<GlobalAlias*, unsigned> > AliasInits;
- /// MAttributes - The set of attributes by index. Index zero in the
- /// file is for null, and is thus not represented here. As such all indices
- /// are off by one.
- std::vector<AttributeSet> MAttributes;
-
- /// \brief The set of attribute groups.
- std::map<unsigned, AttributeSet> MAttributeGroups;
-
/// FunctionBBs - While parsing a function body, this is a list of the basic
/// blocks for the function.
std::vector<BasicBlock*> FunctionBBs;
@@ -258,11 +249,6 @@ private:
if (ID >= FunctionBBs.size()) return 0; // Invalid ID
return FunctionBBs[ID];
}
- AttributeSet getAttributes(unsigned i) const {
- if (i-1 < MAttributes.size())
- return MAttributes[i-1];
- return AttributeSet();
- }
/// getValueTypePair - Read a value/type pair out of the specified record from
/// slot 'Slot'. Increment Slot past the number of slots used in the record.
@@ -331,8 +317,6 @@ private:
}
bool ParseModule(bool Resume);
- bool ParseAttributeBlock();
- bool ParseAttributeGroupBlock();
bool ParseTypeTable();
bool ParseTypeTableBody();
diff --git a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
index 4295c6caf0..3fa90f88a0 100644
--- a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
+++ b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp
@@ -205,78 +205,6 @@ static void WriteStringRecord(unsigned Code, StringRef Str,
Stream.EmitRecord(Code, Vals, AbbrevToUse);
}
-static void WriteAttributeGroupTable(const NaClValueEnumerator &VE,
- NaClBitstreamWriter &Stream) {
- const std::vector<AttributeSet> &AttrGrps = VE.getAttributeGroups();
- if (AttrGrps.empty()) return;
- DEBUG(dbgs() << "-> WriteAbbributeGroupTable\n");
-
- Stream.EnterSubblock(naclbitc::PARAMATTR_GROUP_BLOCK_ID);
-
- SmallVector<uint64_t, 64> Record;
- for (unsigned i = 0, e = AttrGrps.size(); i != e; ++i) {
- AttributeSet AS = AttrGrps[i];
- for (unsigned i = 0, e = AS.getNumSlots(); i != e; ++i) {
- AttributeSet A = AS.getSlotAttributes(i);
-
- Record.push_back(VE.getAttributeGroupID(A));
- Record.push_back(AS.getSlotIndex(i));
-
- for (AttributeSet::iterator I = AS.begin(0), E = AS.end(0);
- I != E; ++I) {
- Attribute Attr = *I;
- if (Attr.isEnumAttribute()) {
- Record.push_back(0);
- Record.push_back(Attr.getKindAsEnum());
- } else if (Attr.isAlignAttribute()) {
- Record.push_back(1);
- Record.push_back(Attr.getKindAsEnum());
- Record.push_back(Attr.getValueAsInt());
- } else {
- StringRef Kind = Attr.getKindAsString();
- StringRef Val = Attr.getValueAsString();
-
- Record.push_back(Val.empty() ? 3 : 4);
- Record.append(Kind.begin(), Kind.end());
- Record.push_back(0);
- if (!Val.empty()) {
- Record.append(Val.begin(), Val.end());
- Record.push_back(0);
- }
- }
- }
-
- Stream.EmitRecord(naclbitc::PARAMATTR_GRP_CODE_ENTRY, Record);
- Record.clear();
- }
- }
-
- Stream.ExitBlock();
- DEBUG(dbgs() << "<- WriteAbbributeGroupTable\n");
-}
-
-static void WriteAttributeTable(const NaClValueEnumerator &VE,
- NaClBitstreamWriter &Stream) {
- const std::vector<AttributeSet> &Attrs = VE.getAttributes();
- if (Attrs.empty()) return;
- DEBUG(dbgs() << "-> WriteAttributeTable\n");
-
- Stream.EnterSubblock(naclbitc::PARAMATTR_BLOCK_ID);
-
- SmallVector<uint64_t, 64> Record;
- for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
- const AttributeSet &A = Attrs[i];
- for (unsigned i = 0, e = A.getNumSlots(); i != e; ++i)
- Record.push_back(VE.getAttributeGroupID(A.getSlotAttributes(i)));
-
- Stream.EmitRecord(naclbitc::PARAMATTR_CODE_ENTRY, Record);
- Record.clear();
- }
-
- Stream.ExitBlock();
- DEBUG(dbgs() << "<- WriteAttributeTable\n");
-}
-
/// WriteTypeTable - Write out the type table for a module.
static void WriteTypeTable(const NaClValueEnumerator &VE,
NaClBitstreamWriter &Stream) {
@@ -615,18 +543,11 @@ static void WriteModuleInfo(const Module *M, const NaClValueEnumerator &VE,
// Emit the function proto information.
for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) {
- // FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment,
- // section, visibility, gc, unnamed_addr]
+ // FUNCTION: [type, callingconv, isproto, linkage]
Vals.push_back(VE.getTypeID(F->getType()));
Vals.push_back(GetEncodedCallingConv(F->getCallingConv()));
Vals.push_back(F->isDeclaration());
Vals.push_back(getEncodedLinkage(F));
- Vals.push_back(VE.getAttributeID(F->getAttributes()));
- Vals.push_back(Log2_32(F->getAlignment())+1);
- Vals.push_back(F->hasSection() ? SectionMap[F->getSection()] : 0);
- Vals.push_back(getEncodedVisibility(F));
- Vals.push_back(F->hasGC() ? GCMap[F->getGC()] : 0);
- Vals.push_back(F->hasUnnamedAddr());
unsigned AbbrevToUse = 0;
Stream.EmitRecord(naclbitc::MODULE_CODE_FUNCTION, Vals, AbbrevToUse);
@@ -1501,7 +1422,6 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
Code = naclbitc::FUNC_CODE_INST_CALL;
- Vals.push_back(VE.getAttributeID(CI.getAttributes()));
Vals.push_back((GetEncodedCallingConv(CI.getCallingConv()) << 1)
| unsigned(CI.isTailCall()));
PushValueAndType(CI.getCalledValue(), InstID, Vals, VE); // Callee
@@ -1857,12 +1777,6 @@ static void WriteModule(const Module *M, NaClBitstreamWriter &Stream) {
// Emit blockinfo, which defines the standard abbreviations etc.
WriteBlockInfo(VE, Stream);
- // Emit information about attribute groups.
- WriteAttributeGroupTable(VE, Stream);
-
- // Emit information about parameter attributes.
- WriteAttributeTable(VE, Stream);
-
// Emit information describing all of the types in the module.
WriteTypeTable(VE, Stream);
diff --git a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp
index e5554b206a..845a608255 100644
--- a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp
+++ b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp
@@ -50,7 +50,6 @@ NaClValueEnumerator::NaClValueEnumerator(const Module *M) {
// Enumerate the functions.
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
EnumerateValue(I);
- EnumerateAttributes(cast<Function>(I)->getAttributes());
}
// Enumerate the aliases.
@@ -97,10 +96,6 @@ NaClValueEnumerator::NaClValueEnumerator(const Module *M) {
EnumerateOperandType(*OI);
}
EnumerateType(I->getType());
- if (const CallInst *CI = dyn_cast<CallInst>(I))
- EnumerateAttributes(CI->getAttributes());
- else if (const InvokeInst *II = dyn_cast<InvokeInst>(I))
- EnumerateAttributes(II->getAttributes());
// Enumerate metadata attached with this instruction.
MDs.clear();
@@ -497,28 +492,6 @@ void NaClValueEnumerator::EnumerateOperandType(const Value *V) {
EnumerateMetadata(V);
}
-void NaClValueEnumerator::EnumerateAttributes(AttributeSet PAL) {
- if (PAL.isEmpty()) return; // null is always 0.
-
- // Do a lookup.
- unsigned &Entry = AttributeMap[PAL];
- if (Entry == 0) {
- // Never saw this before, add it.
- Attribute.push_back(PAL);
- Entry = Attribute.size();
- }
-
- // Do lookups for all attribute groups.
- for (unsigned i = 0, e = PAL.getNumSlots(); i != e; ++i) {
- AttributeSet AS = PAL.getSlotAttributes(i);
- unsigned &Entry = AttributeGroupMap[AS];
- if (Entry == 0) {
- AttributeGroups.push_back(AS);
- Entry = AttributeGroups.size();
- }
- }
-}
-
void NaClValueEnumerator::incorporateFunction(const Function &F) {
InstructionCount = 0;
NumModuleValues = Values.size();
@@ -547,10 +520,6 @@ void NaClValueEnumerator::incorporateFunction(const Function &F) {
// Optimize the constant layout.
OptimizeConstants(FirstFuncConstantID, Values.size());
- // Add the function's parameter attributes so they are available for use in
- // the function's instruction.
- EnumerateAttributes(F.getAttributes());
-
FirstInstID = Values.size();
SmallVector<MDNode *, 8> FnLocalMDVector;
diff --git a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h
index 0239c34ddc..86c0385cde 100644
--- a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h
+++ b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h
@@ -17,7 +17,6 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/IR/Attributes.h"
#include <vector>
namespace llvm {
@@ -30,7 +29,6 @@ class Function;
class Module;
class MDNode;
class NamedMDNode;
-class AttributeSet;
class ValueSymbolTable;
class MDSymbolTable;
class raw_ostream;
@@ -62,14 +60,6 @@ private:
SmallVector<const MDNode *, 8> FunctionLocalMDs;
ValueMapType MDValueMap;
- typedef DenseMap<AttributeSet, unsigned> AttributeGroupMapType;
- AttributeGroupMapType AttributeGroupMap;
- std::vector<AttributeSet> AttributeGroups;
-
- typedef DenseMap<AttributeSet, unsigned> AttributeMapType;
- AttributeMapType AttributeMap;
- std::vector<AttributeSet> Attribute;
-
/// GlobalBasicBlockIDs - This map memoizes the basic block ID's referenced by
/// the "getGlobalBasicBlockID" method.
mutable DenseMap<const BasicBlock*, unsigned> GlobalBasicBlockIDs;
@@ -112,20 +102,6 @@ public:
unsigned getInstructionID(const Instruction *I) const;
void setInstructionID(const Instruction *I);
- unsigned getAttributeID(AttributeSet PAL) const {
- if (PAL.isEmpty()) return 0; // Null maps to zero.
- AttributeMapType::const_iterator I = AttributeMap.find(PAL);
- assert(I != AttributeMap.end() && "Attribute not in NaClValueEnumerator!");
- return I->second;
- }
-
- unsigned getAttributeGroupID(AttributeSet PAL) const {
- if (PAL.isEmpty()) return 0; // Null maps to zero.
- AttributeGroupMapType::const_iterator I = AttributeGroupMap.find(PAL);
- assert(I != AttributeGroupMap.end() && "Attribute not in NaClValueEnumerator!");
- return I->second;
- }
-
/// getFunctionConstantRange - Return the range of values that corresponds to
/// function-local constants.
void getFunctionConstantRange(unsigned &Start, unsigned &End) const {
@@ -142,12 +118,6 @@ public:
const std::vector<const BasicBlock*> &getBasicBlocks() const {
return BasicBlocks;
}
- const std::vector<AttributeSet> &getAttributes() const {
- return Attribute;
- }
- const std::vector<AttributeSet> &getAttributeGroups() const {
- return AttributeGroups;
- }
/// getGlobalBasicBlockID - This returns the function-specific ID for the
/// specified basic block. This is relatively expensive information, so it
@@ -171,7 +141,6 @@ private:
void EnumerateValue(const Value *V);
void EnumerateType(Type *T, bool InsideOptimizeTypes=false);
void EnumerateOperandType(const Value *V);
- void EnumerateAttributes(AttributeSet PAL);
void EnumerateValueSymbolTable(const ValueSymbolTable &ST);
void EnumerateNamedMetadata(const Module *M);