#include "llvm/Instruction.h"
#include "llvm/Support/ManagedStatic.h"
#include "LLVMContextImpl.h"
-#include <set>
-
using namespace llvm;
static ManagedStatic<LLVMContext> GlobalContext;
OperandList[i+1] = IdxList[i];
}
-bool LLVMContext::RemoveDeadMetadata() {
- std::vector<const MDNode *> DeadMDNodes;
- bool Changed = false;
- while (1) {
-
- for (FoldingSet<MDNode>::iterator
- I = pImpl->MDNodeSet.begin(),
- E = pImpl->MDNodeSet.end(); I != E; ++I) {
- const MDNode *N = &(*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;
-}