aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorShafik Yaghmour <shafik.yaghmour@intel.com>2025-05-01 09:52:09 -0700
committerGitHub <noreply@github.com>2025-05-01 09:52:09 -0700
commitacc40ed0a747ad8f5dbb93788da7ce104c36c0a3 (patch)
treed41181b7a54d209afd54265f3119594df4972098 /clang/lib/Lex/ModuleMap.cpp
parentdadd91e793a7622e0ca34ad9c3993a01a437b651 (diff)
downloadllvm-acc40ed0a747ad8f5dbb93788da7ce104c36c0a3.zip
llvm-acc40ed0a747ad8f5dbb93788da7ce104c36c0a3.tar.gz
llvm-acc40ed0a747ad8f5dbb93788da7ce104c36c0a3.tar.bz2
[Clang][NFC] Use const auto & to avoid copy (#138069)
Static analysis flagged this code as causing a copy when we never modify ModName and therefore we can use const auto & and avoid copying.
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index a1394fd..74fe55f 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -1959,7 +1959,7 @@ void ModuleMapLoader::handleExportDecl(const modulemap::ExportDecl &ED) {
}
void ModuleMapLoader::handleExportAsDecl(const modulemap::ExportAsDecl &EAD) {
- auto ModName = EAD.Id.front();
+ const auto &ModName = EAD.Id.front();
if (!ActiveModule->ExportAsModule.empty()) {
if (ActiveModule->ExportAsModule == ModName.first) {