IR: MDNode => Value: Instruction::getAllMetadataOtherThanDebugLoc()

Change `Instruction::getAllMetadataOtherThanDebugLoc()` from a vector of
`MDNode` to one of `Value`.  Part of PR21433.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221167 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2014-11-03 18:13:57 +00:00
parent c3606b6b2e
commit 5e84760dde
11 changed files with 23 additions and 24 deletions
+4 -4
View File
@@ -321,7 +321,7 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
EnumerateValueSymbolTable(M->getValueSymbolTable());
EnumerateNamedMetadata(M);
SmallVector<std::pair<unsigned, MDNode*>, 8> MDs;
SmallVector<std::pair<unsigned, Value *>, 8> MDs;
// Enumerate types used by function bodies and argument lists.
for (const Function &F : *M) {
@@ -347,7 +347,7 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
MDs.clear();
I.getAllMetadataOtherThanDebugLoc(MDs);
for (unsigned i = 0, e = MDs.size(); i != e; ++i)
EnumerateMetadata(MDs[i].second);
EnumerateMetadata(cast<MDNode>(MDs[i].second));
if (!I.getDebugLoc().isUnknown()) {
MDNode *Scope, *IA;
@@ -741,10 +741,10 @@ void ValueEnumerator::incorporateFunction(const Function &F) {
FnLocalMDVector.push_back(MD);
}
SmallVector<std::pair<unsigned, MDNode*>, 8> MDs;
SmallVector<std::pair<unsigned, Value *>, 8> MDs;
I->getAllMetadataOtherThanDebugLoc(MDs);
for (unsigned i = 0, e = MDs.size(); i != e; ++i) {
MDNode *N = MDs[i].second;
auto *N = cast<MDNode>(MDs[i].second);
if (N->isFunctionLocal() && N->getFunction())
FnLocalMDVector.push_back(N);
}