Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Original message: Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap. llvm-svn: 214555
This commit is contained in:
@@ -3305,9 +3305,16 @@ void CodeGenModule::EmitVersionIdentMetadata() {
|
||||
}
|
||||
|
||||
void CodeGenModule::EmitTargetMetadata() {
|
||||
for (auto &I : MangledDeclNames) {
|
||||
const Decl *D = I.first.getDecl()->getMostRecentDecl();
|
||||
llvm::GlobalValue *GV = GetGlobalValue(I.second);
|
||||
// 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);
|
||||
getTargetCodeGenInfo().emitTargetMD(D, GV, *this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user