This repository was archived by the owner on Feb 21, 2026. It is now read-only.
Commit 4b3e543
authored
[CIR][CodeGen] Use MapVector instead of StringMap for Replacements (#2116)
Fix #1938
Minimized benchmark:
```cpp
#include <vector>
class my_class {
public:
std::vector<void*> my_vec;
};
my_class inst;
```
When using `llvm::StringMap` transitive replacements may be out of
order. So use `llvm::MapVector` which is also used in clang's CodeGen.
https://github.com/llvm/clangir/blob/0c130cda66d792752fa52f57aabdf561a49482fd/clang/lib/CodeGen/CodeGenModule.h#L439
I couldn't reproduce the MRE with `#include "std-cxx.h"`, any other way
to add the test?1 parent 0c130cd commit 4b3e543
2 files changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4268 | 4268 | | |
4269 | 4269 | | |
4270 | 4270 | | |
4271 | | - | |
| 4271 | + | |
4272 | 4272 | | |
4273 | 4273 | | |
4274 | 4274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
1026 | | - | |
| 1025 | + | |
1027 | 1026 | | |
1028 | 1027 | | |
1029 | 1028 | | |
| |||
0 commit comments