refactor for-loop as range-loop before making changes.

Differential Revision: http://reviews.llvm.org/D4176

llvm-svn: 212262
This commit is contained in:
Robert Lytton 2014-07-03 09:30:29 +00:00
parent c3d3217525
commit 5b88f78f7a
1 changed files with 6 additions and 10 deletions

View File

@ -3297,11 +3297,9 @@ void CodeGenModule::EmitDeclMetadata() {
llvm::NamedMDNode *GlobalMetadata = nullptr;
// StaticLocalDeclMap
for (llvm::DenseMap<GlobalDecl,StringRef>::iterator
I = MangledDeclNames.begin(), E = MangledDeclNames.end();
I != E; ++I) {
llvm::GlobalValue *Addr = getModule().getNamedValue(I->second);
EmitGlobalDeclMetadata(*this, GlobalMetadata, I->first, Addr);
for (auto &I : MangledDeclNames) {
llvm::GlobalValue *Addr = getModule().getNamedValue(I.second);
EmitGlobalDeclMetadata(*this, GlobalMetadata, I.first, Addr);
}
}
@ -3317,11 +3315,9 @@ void CodeGenFunction::EmitDeclMetadata() {
llvm::NamedMDNode *GlobalMetadata = nullptr;
for (llvm::DenseMap<const Decl*, llvm::Value*>::iterator
I = LocalDeclMap.begin(), E = LocalDeclMap.end(); I != E; ++I) {
const Decl *D = I->first;
llvm::Value *Addr = I->second;
for (auto &I : LocalDeclMap) {
const Decl *D = I.first;
llvm::Value *Addr = I.second;
if (auto *Alloca = dyn_cast<llvm::AllocaInst>(Addr)) {
llvm::Value *DAddr = GetPointerConstant(getLLVMContext(), D);
Alloca->setMetadata(DeclPtrKind, llvm::MDNode::get(Context, DAddr));