From 455768e2af7ef774b40510a82d034a78a4504639 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 1 Aug 2014 20:09:39 +0000 Subject: Revert r214547 due to test breakage. llvm-svn: 214549 --- clang/lib/CodeGen/CodeGenModule.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 55d47060ff9..a14558f975a 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3305,16 +3305,9 @@ void CodeGenModule::EmitVersionIdentMetadata() { } void CodeGenModule::EmitTargetMetadata() { - // Warning, new MangledDeclNames may be appended within this loop. - // We rely on MapVector insertions adding new elements to the end - // of the container. - // FIXME: Move this loop into the one target that needs it, and only - // loop over those declarations for which we couldn't emit the target - // metadata when we emitted the declaration. - for (unsigned I = 0; I != MangledDeclNames.size(); ++I) { - auto &Val = *(MangledDeclNames.begin() + I); - const Decl *D = Val.first.getDecl()->getMostRecentDecl(); - llvm::GlobalValue *GV = GetGlobalValue(Val.second); + for (auto &I : MangledDeclNames) { + const Decl *D = I.first.getDecl()->getMostRecentDecl(); + llvm::GlobalValue *GV = GetGlobalValue(I.second); getTargetCodeGenInfo().emitTargetMD(D, GV, *this); } } -- cgit v1.2.3