-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm] format and terminate namespaces with closing comment #94917
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
Conversation
@llvm/pr-subscribers-mlgo @llvm/pr-subscribers-llvm-analysis Author: Mohammed Keyvanzadeh (VoltrexKeyva) ChangesNamespaces are terminated with a closing comment in the majority of the codebase so do the same here for consistency. Full diff: https://github.com/llvm/llvm-project/pull/94917.diff 1 Files Affected:
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp
index 307dddd51ece0..ccba8b3831c8f 100644
--- a/llvm/lib/Analysis/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp
@@ -46,7 +46,7 @@ using namespace llvm;
namespace llvm {
cl::opt<unsigned> MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden,
cl::init(4));
-}
+} // namespace llvm
STATISTIC(MaxSCCIterations, "Maximum CGSCCPassMgr iterations on one SCC");
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
I don't think the formatting comment is correct here, is this a bug? |
Can someone verify if the Clang-Format check failure is a bug? CC @llvm/issue-subscribers-clang-format |
This is a limitation of clang-format:
You can work around this by fixing the indentation of the lines within the namespace in the same patch:
|
0db673b
to
2f88bf0
Compare
Namespaces are terminated with a closing comment in the majority of the codebase so do the same here for consistency.
36f5d6a
to
2fffc28
Compare
@owenca done. |
@VoltrexKeyva it seems like you pushed a bunch of changes that shouldn't have ended up in this PR? Also, please don't force push. It doesn't really matter in this case, but it breaks the location association for comments. |
All changes are intentional, the formatting changes are to make the clang-format check happy due to its limitation as pointed out in #94917 (comment) The force push is to update the branch with the latest commits in main using rebasing as there doesn't seem to be any other viable way without creating a merge commit. I haven't force pushed the relevant changes. Shall I do something else when trying to pull the latest changes? |
Formatting changes should probably be done in a separate commit.
You should merge main into your branch. The PR will be squashed into one commit when it gets landed. |
You mean in a separate PR? Because it is in a separate commit: 2fffc28
Got it. |
Sorry, yes. Commits within an individual PR don't really matter as they will all get squashed when landing. |
Adding namespace end comments is also a formatting change. |
Makes sense. Keeping it in this patch would be fine too then, but the title/description needs to be adjusted. |
What do you suggest? |
Whatever is easiest for you. I think that would be reusing this PR, but either way should be fine. |
Sorry I don't follow, the title/description seems descriptive enough unless you want me to mention the formatting changes as well. Also what do you mean by "I think that would be reusing this PR"? |
If you're making formatting changes too, those should be mentioned in the commit title/description.
It would be easiest in my workflow to add the formatting changes to this PR. I would assume that is the case for you too, but do whatever is easiest for you. |
Oh okay, wouldn't I need to force push to update the commit message? Is that okay? |
You can just edit the PR description through the Github Web UI. The PR description is what is used for the commit description that actually lands. The messages of the individual commits don't matter other than at PR creation time. |
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Sorry for taking up so much of your time in discussion on this. I'll try and make things more clear in the future.
Namespaces are terminated with a closing comment in the majority of the codebase so do the same here for consistency. Also format code within some namespaces to make clang-format happy.
Namespaces are terminated with a closing comment in the majority of the codebase so do the same here for consistency. Also format code within some namespaces to make clang-format happy.