Skip to content

[globalopt] Clean up doxygen comments in GlobalOpt.cpp. #15480

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
Mar 24, 2018

Conversation

gottesmm
Copy link
Contributor

I need to fix a few things in GlobalOpt to deal with +0 changes I believe. So
while I am here, I am just cleaning up the file a little bit.

I need to fix a few things in GlobalOpt to deal with +0 changes I believe. So
while I am here, I am just cleaning up the file a little bit.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 7cb869a into swiftlang:master Mar 24, 2018
@gottesmm gottesmm deleted the globalopt_doxygen_comments branch March 24, 2018 18:03
Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -300,7 +331,7 @@ static SILFunction *genGetterFromInit(StoreInst *Store,
return GetterF;
}

/// If this is a read from a global let variable, map it.
// If this is a write to a global let variable, map it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some guiding principle for when you're using doc-comments vs. normal comments?

(I personally find the whole thing silly since no one would ever be reading a doc page to understand the internal implementation of a SIL pass, but if I know the rule I'll try to follow it)

Copy link
Contributor Author

@gottesmm gottesmm Mar 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes there is a principle. In the body of a method/function always '//'. On a method declaration, '///' this is a doxygen comment that should show up. On a method impl, you should add file level comments as '//'. These are intended to not be in the public interface, but are more implementation details. Functions that are static and are not declared anywhere separately, I will use three slashes since that is the interface to the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants