// When intrinsic functions are encountered which require upgrading they are
// stored here with their replacement function.
- typedef std::vector<std::pair<Function*, Function*> > UpgradedIntrinsicMap;
+ typedef DenseMap<Function*, Function*> UpgradedIntrinsicMap;
UpgradedIntrinsicMap UpgradedIntrinsics;
// Map the bitcode's custom MDKind ID to the Module's MDKind ID.
for (Function &F : *TheModule) {
Function *NewFn;
if (UpgradeIntrinsicFunction(&F, NewFn))
- UpgradedIntrinsics.push_back(std::make_pair(&F, NewFn));
+ UpgradedIntrinsics[&F] = NewFn;
}
// Look for global variables which need to be renamed.
I.first->eraseFromParent();
}
}
- std::vector<std::pair<Function*, Function*> >().swap(UpgradedIntrinsics);
+ UpgradedIntrinsics.clear();
for (unsigned I = 0, E = InstsWithTBAATag.size(); I < E; I++)
UpgradeInstWithTBAATag(InstsWithTBAATag[I]);