Skip to content
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

execgen: preserve comments around callsite of inlined function #67291

Merged
merged 1 commit into from
Jul 9, 2021

Conversation

DrewKimball
Copy link
Collaborator

This patch modifies the execgen inline directive to ensure that
comments before and after the callsites of inlined functions are
not removed. Example:

func a() {
  // This comment should not be removed.
  b()
  // This one too.
}

// execgen:inline
func b() {
  foo = bar
}
=>
func a() {
  // This comment should not be removed.
  {
    foo = bar
  }
  // This one too.
}

// execgen:inline
const _ = "inlined_b"

Release note: None

@DrewKimball DrewKimball requested a review from jordanlewis July 7, 2021 05:01
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

This patch modifies the execgen `inline` directive to ensure that
comments before and after the callsites of inlined functions are
not removed. Example:
```
func a() {
  // This comment should not be removed.
  b()
  // This one too.
}

// execgen:inline
func b() {
  foo = bar
}
=>
func a() {
  // This comment should not be removed.
  {
    foo = bar
  }
  // This one too.
}

// execgen:inline
const _ = "inlined_b"
```

Release note: None
@DrewKimball
Copy link
Collaborator Author

TFTR!

@DrewKimball
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 9, 2021

Build succeeded:

@craig craig bot merged commit 0a48b0b into cockroachdb:master Jul 9, 2021
@DrewKimball DrewKimball deleted the execgen branch July 9, 2021 23:17
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