Skip to content

[NFC] Use const& avoiding copies #90334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2024
Merged

Conversation

SimplyDanny
Copy link
Member

@SimplyDanny SimplyDanny commented Apr 27, 2024

Fixes #90285.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 27, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 27, 2024

@llvm/pr-subscribers-clang

Author: Danny Mösch (SimplyDanny)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/90334.diff

1 Files Affected:

  • (modified) clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp (+1-1)
diff --git a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
index d58f5bb0919906..f8dced5dbafb60 100644
--- a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
+++ b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
@@ -295,7 +295,7 @@ class InterfaceStubFunctionsConsumer : public ASTConsumer {
       OS << "Symbols:\n";
       for (const auto &E : Symbols) {
         const MangledSymbol &Symbol = E.second;
-        for (auto Name : Symbol.Names) {
+        for (const auto &Name : Symbol.Names) {
           OS << "  - { Name: \""
              << (Symbol.ParentName.empty() || Instance.getLangOpts().CPlusPlus
                      ? ""

@SimplyDanny
Copy link
Member Author

The failing Windows tests seem to be related to my change, yet I can't see what actually failed. Can you help me figure out what's wrong, @lipracer?

@lipracer
Copy link
Member

lipracer commented May 4, 2024

This change seems to be unrelated to the platform, and I don't think it's the change that caused the CI error. From the compiled log, it seems that there is not enough memory space.
3eb6d694feb6b9b289d0fff72552fb88

@SimplyDanny
Copy link
Member Author

This change seems to be unrelated to the platform, and I don't think it's the change that caused the CI error. From the compiled log, it seems that there is not enough memory space. 3eb6d694feb6b9b289d0fff72552fb88

Okay, that's good news. I wasn't sure because I've not found any other builds to fail like this and mine reported failure twice. But indeed I face the same excessive RAM consumption when building the flang target locally on main.

@SimplyDanny SimplyDanny merged commit d751e40 into llvm:main May 6, 2024
4 checks passed
@SimplyDanny SimplyDanny deleted the avoid-copy branch May 8, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp:298: Poor choice of range variable type ?
3 participants