[llvm] [Bitcode] Avoid repeated hash lookups (NFC) (PR #128824)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 25 22:19:16 PST 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/128824
None
>From a1301cbcbcf72be591efd47ff42a0146081d31e3 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 25 Feb 2025 09:07:20 -0800
Subject: [PATCH] [Bitcode] Avoid repeated hash lookups (NFC)
---
llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 3609ffe5d80f3..c20cc78f040ab 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -539,9 +539,10 @@ class MetadataLoader::MetadataLoaderImpl {
if (!Visited.insert(S).second)
break;
}
- ParentSubprogram[InitialScope] = llvm::dyn_cast_or_null<DISubprogram>(S);
- return ParentSubprogram[InitialScope];
+ auto &PS = ParentSubprogram[InitialScope];
+ PS = llvm::dyn_cast_or_null<DISubprogram>(S);
+ return PS;
}
/// Move local imports from DICompileUnit's 'imports' field to
More information about the llvm-commits
mailing list