summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-08-01 20:09:39 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-08-01 20:09:39 +0000
commit455768e2af7ef774b40510a82d034a78a4504639 (patch)
tree7f6dd69f6ebeaffb4f10848e1a77c9ba76453b9d /clang/lib/CodeGen
parent45afa389d6a026208d088ce0c918ba74d60afd55 (diff)
downloadbcm5719-llvm-455768e2af7ef774b40510a82d034a78a4504639.tar.gz
bcm5719-llvm-455768e2af7ef774b40510a82d034a78a4504639.zip
Revert r214547 due to test breakage.
llvm-svn: 214549
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp13
-rw-r--r--clang/lib/CodeGen/ModuleBuilder.cpp9
2 files changed, 6 insertions, 16 deletions
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);
}
}
diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp
index 52522e69ef3..c5d18d3286a 100644
--- a/clang/lib/CodeGen/ModuleBuilder.cpp
+++ b/clang/lib/CodeGen/ModuleBuilder.cpp
@@ -94,13 +94,10 @@ namespace {
for (DeclGroupRef::iterator I = DG.begin(), E = DG.end(); I != E; ++I)
Builder->EmitTopLevelDecl(*I);
- // Emit any deferred inline method definitions. Note that more deferred
- // methods may be added during this loop.
- while (!DeferredInlineMethodDefinitions.empty()) {
- CXXMethodDecl *MD = DeferredInlineMethodDefinitions.back();
- DeferredInlineMethodDefinitions.pop_back();
+ // Emit any deferred inline method definitions.
+ for (CXXMethodDecl *MD : DeferredInlineMethodDefinitions)
Builder->EmitTopLevelDecl(MD);
- }
+ DeferredInlineMethodDefinitions.clear();
return true;
}
OpenPOWER on IntegriCloud