X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FLLVMContext.cpp;h=5a8ea5cf6d34db0e8358b49013b149cd236d2064;hb=d2e63b7fdbdfd0f6986cc1563a6f0cc9446926c9;hp=1803a9a66664c511c6db2ce272fbd1066a41df64;hpb=3a29d2d3279d53b757c31b4cc72f0b3f7082d4c2;p=oota-llvm.git diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp index 1803a9a6666..5a8ea5cf6d3 100644 --- a/lib/VMCore/LLVMContext.cpp +++ b/lib/VMCore/LLVMContext.cpp @@ -13,12 +13,11 @@ //===----------------------------------------------------------------------===// #include "llvm/LLVMContext.h" +#include "llvm/Metadata.h" #include "llvm/Constants.h" #include "llvm/Instruction.h" #include "llvm/Support/ManagedStatic.h" #include "LLVMContextImpl.h" -#include - using namespace llvm; static ManagedStatic GlobalContext; @@ -43,26 +42,3 @@ GetElementPtrConstantExpr::GetElementPtrConstantExpr OperandList[i+1] = IdxList[i]; } -bool LLVMContext::RemoveDeadMetadata() { - std::vector DeadMDNodes; - bool Changed = false; - while (1) { - - for (SmallPtrSet::iterator - I = pImpl->MDNodes.begin(), - E = pImpl->MDNodes.end(); I != E; ++I) { - const MDNode *N = cast(*I); - if (N->use_empty()) - DeadMDNodes.push_back(N); - } - - if (DeadMDNodes.empty()) - return Changed; - - while (!DeadMDNodes.empty()) { - const MDNode *N = DeadMDNodes.back(); DeadMDNodes.pop_back(); - delete N; - } - } - return Changed; -}