From f21c9617f83ebc6e8955984b7c4ba6e60e72b566 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sat, 13 Apr 2013 01:28:18 +0000 Subject: [PATCH] Use MapVector rather than simulating it. llvm-svn: 179438 --- clang/lib/CodeGen/CodeGenModule.cpp | 10 +++++----- clang/lib/CodeGen/CodeGenModule.h | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 4126bea..aacabc7 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1748,8 +1748,6 @@ void CodeGenModule::MaybeHandleStaticInExternC(const SomeDecl *D, // in extern "C" regions, none of them gets that name. if (!R.second) R.first->second = 0; - else - StaticExternCIdents.push_back(D->getIdentifier()); } void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { @@ -2958,9 +2956,11 @@ static void EmitGlobalDeclMetadata(CodeGenModule &CGM, /// to such functions with an unmangled name from inline assembly within the /// same translation unit. void CodeGenModule::EmitStaticExternCAliases() { - for (unsigned I = 0, N = StaticExternCIdents.size(); I != N; ++I) { - IdentifierInfo *Name = StaticExternCIdents[I]; - llvm::GlobalValue *Val = StaticExternCValues[Name]; + for (StaticExternCMap::iterator I = StaticExternCValues.begin(), + E = StaticExternCValues.end(); + I != E; ++I) { + IdentifierInfo *Name = I->first; + llvm::GlobalValue *Val = I->second; if (Val && !getModule().getNamedValue(Name->getName())) AddUsedGlobal(new llvm::GlobalAlias(Val->getType(), Val->getLinkage(), Name->getName(), Val, &getModule())); diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index f8b0971..1eb0ebb 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -307,10 +307,9 @@ class CodeGenModule : public CodeGenTypeCache { /// Map used to track internal linkage functions declared within /// extern "C" regions. - typedef llvm::DenseMap StaticExternCMap; + typedef llvm::MapVector StaticExternCMap; StaticExternCMap StaticExternCValues; - std::vector StaticExternCIdents; /// CXXGlobalInits - Global variables with initializers that need to run /// before main. -- 2.7.4