summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-07-22 15:29:37 -0700
committerFangrui Song <i@maskray.me>2023-07-22 15:29:38 -0700
commite6a9b06dc0b974eb16186a71099b88a631afdf52 (patch)
tree5cf05da8deedbc85edc016826f75843f7e0477c1 /clang/lib/CodeGen/CodeGenModule.cpp
parent2b0f5df7b4e01d5b9b380fd72a19df021b9a3b98 (diff)
[CodeGen] Stabilize C2/D2 to C1/D1 replacement order
The conversion iterates over CodeGenModule::Replacements (a StringMap) and replaces C2/D2 and moves C1/D1 ( commit 0196a1d98f8a206259a4b5ce93c21807243af92f in 2013, to make the output look nicer). The iteration order is not guaranteed to be deterministic, and may cause destructors.cpp to exhibit different function orders. Use a MapVector instead. While here, fix an IWYU issue by adding an explicit include, though MapVector is already used in CodeGenModule.h.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index bb5d1800b30c..e2beb77d196f 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -497,7 +497,7 @@ void CodeGenModule::addReplacement(StringRef Name, llvm::Constant *C) {
void CodeGenModule::applyReplacements() {
for (auto &I : Replacements) {
- StringRef MangledName = I.first();
+ StringRef MangledName = I.first;
llvm::Constant *Replacement = I.second;
llvm::GlobalValue *Entry = GetGlobalValue(MangledName);
if (!Entry)