Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Commit cdc0b77

Browse files
committed
[CIR][CodeGen] Use MapVector instead of StringMap for Replacements
1 parent 0c130cd commit cdc0b77

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4268,7 +4268,7 @@ void CIRGenModule::replacePointerTypeArgs(cir::FuncOp oldF, cir::FuncOp newF) {
42684268

42694269
void CIRGenModule::applyReplacements() {
42704270
for (auto &i : Replacements) {
4271-
StringRef mangledName = i.first();
4271+
StringRef mangledName = i.first;
42724272
mlir::Operation *replacement = i.second;
42734273
auto *entry = getGlobalValue(mangledName);
42744274
if (!entry)

clang/lib/CIR/CodeGen/CIRGenModule.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,7 @@ class CIRGenModule : public CIRGenTypeCache {
10221022
llvm::StringMap<clang::GlobalDecl, llvm::BumpPtrAllocator> Manglings;
10231023

10241024
// FIXME: should we use llvm::TrackingVH<mlir::Operation> here?
1025-
typedef llvm::StringMap<mlir::Operation *> ReplacementsTy;
1026-
ReplacementsTy Replacements;
1025+
llvm::MapVector<StringRef, mlir::Operation *> Replacements;
10271026
/// Call replaceAllUsesWith on all pairs in Replacements.
10281027
void applyReplacements();
10291028

0 commit comments

Comments
 (0)