Author: Kazu Hirata Date: 2025-03-30T22:57:25-07:00 New Revision: 60199ee5396c2242c7d3cfa882e28312e6895c2a
URL: https://github.com/llvm/llvm-project/commit/60199ee5396c2242c7d3cfa882e28312e6895c2a DIFF: https://github.com/llvm/llvm-project/commit/60199ee5396c2242c7d3cfa882e28312e6895c2a.diff LOG: [clang] Use DenseMap::insert_range (NFC) (#133655) Added: Modified: clang/lib/AST/VTableBuilder.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp Removed: ################################################################################ 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; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits