Fix typo "of" -> "or" and change the way a line was formatted to fit
[oota-llvm.git] / lib / VMCore / LLVMContext.cpp
index 1803a9a66664c511c6db2ce272fbd1066a41df64..5a8ea5cf6d34db0e8358b49013b149cd236d2064 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #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 <set>
-
 using namespace llvm;
 
 static ManagedStatic<LLVMContext> GlobalContext;
@@ -43,26 +42,3 @@ GetElementPtrConstantExpr::GetElementPtrConstantExpr
     OperandList[i+1] = IdxList[i];
 }
 
-bool LLVMContext::RemoveDeadMetadata() {
-  std::vector<const MDNode *> DeadMDNodes;
-  bool Changed = false;
-  while (1) {
-
-    for (SmallPtrSet<const MDNode *, 8>::iterator
-           I = pImpl->MDNodes.begin(),
-           E = pImpl->MDNodes.end(); I != E; ++I) {
-      const MDNode *N = cast<MDNode>(*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;
-}