diff options
Diffstat (limited to 'lib/Bitcode/NaCl/Writer')
-rw-r--r-- | lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp | 5 | ||||
-rw-r--r-- | lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp | 19 | ||||
-rw-r--r-- | lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h | 9 |
3 files changed, 0 insertions, 33 deletions
diff --git a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp index afc8d83451..9f3626557b 100644 --- a/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp +++ b/lib/Bitcode/NaCl/Writer/NaClBitcodeWriter.cpp @@ -753,11 +753,6 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal, for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i) Record.push_back(VE.getValueID(C->getOperand(i))); AbbrevToUse = AggregateAbbrev; - } else if (const BlockAddress *BA = dyn_cast<BlockAddress>(C)) { - Code = naclbitc::CST_CODE_BLOCKADDRESS; - Record.push_back(VE.getTypeID(BA->getFunction()->getType())); - Record.push_back(VE.getValueID(BA->getFunction())); - Record.push_back(VE.getGlobalBasicBlockID(BA->getBasicBlock())); } else { #ifndef NDEBUG C->dump(); diff --git a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp index 01b4ff8df5..3ad224a04f 100644 --- a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp +++ b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp @@ -423,22 +423,3 @@ void NaClValueEnumerator::purgeFunction() { BasicBlocks.clear(); FnForwardTypeRefs.clear(); } - -static void IncorporateFunctionInfoGlobalBBIDs(const Function *F, - DenseMap<const BasicBlock*, unsigned> &IDMap) { - unsigned Counter = 0; - for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) - IDMap[BB] = ++Counter; -} - -/// getGlobalBasicBlockID - This returns the function-specific ID for the -/// specified basic block. This is relatively expensive information, so it -/// should only be used by rare constructs such as address-of-label. -unsigned NaClValueEnumerator::getGlobalBasicBlockID(const BasicBlock *BB) const { - unsigned &Idx = GlobalBasicBlockIDs[BB]; - if (Idx != 0) - return Idx-1; - - IncorporateFunctionInfoGlobalBBIDs(BB->getParent(), GlobalBasicBlockIDs); - return getGlobalBasicBlockID(BB); -} diff --git a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h index 21bbb2fb76..3e71740f92 100644 --- a/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h +++ b/lib/Bitcode/NaCl/Writer/NaClValueEnumerator.h @@ -55,10 +55,6 @@ private: ValueMapType ValueMap; ValueList Values; - /// GlobalBasicBlockIDs - This map memoizes the basic block ID's referenced by - /// the "getGlobalBasicBlockID" method. - mutable DenseMap<const BasicBlock*, unsigned> GlobalBasicBlockIDs; - typedef DenseMap<const Instruction*, unsigned> InstructionMapType; InstructionMapType InstructionMap; unsigned InstructionCount; @@ -133,11 +129,6 @@ public: return BasicBlocks; } - /// getGlobalBasicBlockID - This returns the function-specific ID for the - /// specified basic block. This is relatively expensive information, so it - /// should only be used by rare constructs such as address-of-label. - unsigned getGlobalBasicBlockID(const BasicBlock *BB) const; - /// incorporateFunction/purgeFunction - If you'd like to deal with a function, /// use these two methods to get its data into the NaClValueEnumerator! /// |