[clang] [clang] Use DenseMap::insert_range (NFC) (PR #133655)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 30 13:25:37 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/133655
None
>From 9fe28b2669aae7fec6353c7c1fe60aae434b98b8 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 30 Mar 2025 13:16:22 -0700
Subject: [PATCH] [clang] Use DenseMap::insert_range (NFC)
---
clang/lib/AST/VTableBuilder.cpp | 6 ++----
clang/lib/CodeGen/CodeGenModule.cpp | 3 +--
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp | 4 ++--
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp
index 18893b996b5d6..6c97b8718c65e 100644
--- a/clang/lib/AST/VTableBuilder.cpp
+++ b/clang/lib/AST/VTableBuilder.cpp
@@ -3736,8 +3736,7 @@ void MicrosoftVTableContext::computeVTableRelatedInformation(
}
}
- MethodVFTableLocations.insert(NewMethodLocations.begin(),
- NewMethodLocations.end());
+ MethodVFTableLocations.insert_range(NewMethodLocations);
if (Context.getLangOpts().DumpVTableLayouts)
dumpMethodLocations(RD, NewMethodLocations, llvm::outs());
}
@@ -3824,8 +3823,7 @@ const VirtualBaseInfo &MicrosoftVTableContext::computeVBTableRelatedInformation(
// virtual bases come first so that the layout is the same.
const VirtualBaseInfo &BaseInfo =
computeVBTableRelatedInformation(VBPtrBase);
- VBI->VBTableIndices.insert(BaseInfo.VBTableIndices.begin(),
- BaseInfo.VBTableIndices.end());
+ VBI->VBTableIndices.insert_range(BaseInfo.VBTableIndices);
}
// New vbases are added to the end of the vbtable.
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 5dbd50be6ca1a..43345da268868 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -853,8 +853,7 @@ void CodeGenModule::Release() {
if (CXX20ModuleInits && Primary && !Primary->isHeaderLikeModule())
EmitModuleInitializers(Primary);
EmitDeferred();
- DeferredDecls.insert(EmittedDeferredDecls.begin(),
- EmittedDeferredDecls.end());
+ DeferredDecls.insert_range(EmittedDeferredDecls);
EmittedDeferredDecls.clear();
EmitVTablesOpportunistically();
applyGlobalValReplacements();
diff --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 52dec2013a24f..52d922abbcaec 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -1099,7 +1099,7 @@ Expected<bool> getSymbolsFromBitcode(MemoryBufferRef Buffer, OffloadKind Kind,
// If the file gets extracted we update the table with the new symbols.
if (ShouldExtract)
- Syms.insert(std::begin(TmpSyms), std::end(TmpSyms));
+ Syms.insert_range(TmpSyms);
return ShouldExtract;
}
@@ -1154,7 +1154,7 @@ Expected<bool> getSymbolsFromObject(const ObjectFile &Obj, OffloadKind Kind,
// If the file gets extracted we update the table with the new symbols.
if (ShouldExtract)
- Syms.insert(std::begin(TmpSyms), std::end(TmpSyms));
+ Syms.insert_range(TmpSyms);
return ShouldExtract;
}
More information about the cfe-commits
mailing list