mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Fix getMDs() interface such that it does not expose implementation details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84885 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -87,6 +87,8 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
|
||||
EnumerateType(I->getType());
|
||||
|
||||
MetadataContext &TheMetadata = F->getContext().getMetadata();
|
||||
typedef SmallVector<std::pair<unsigned, TrackingVH<MDNode> >, 2> MDMapTy;
|
||||
MDMapTy MDs;
|
||||
for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
|
||||
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;++I){
|
||||
for (User::const_op_iterator OI = I->op_begin(), E = I->op_end();
|
||||
@ -99,11 +101,11 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
|
||||
EnumerateAttributes(II->getAttributes());
|
||||
|
||||
// Enumerate metadata attached with this instruction.
|
||||
const MetadataContext::MDMapTy *MDs = TheMetadata.getMDs(I);
|
||||
if (MDs)
|
||||
for (MetadataContext::MDMapTy::const_iterator MI = MDs->begin(),
|
||||
ME = MDs->end(); MI != ME; ++MI)
|
||||
EnumerateMetadata(MI->second);
|
||||
MDs.clear();
|
||||
TheMetadata.getMDs(I, MDs);
|
||||
for (MDMapTy::const_iterator MI = MDs.begin(), ME = MDs.end(); MI != ME;
|
||||
++MI)
|
||||
EnumerateMetadata(MI->second);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user