Skip to content

Conversation

jbj
Copy link
Contributor

@jbj jbj commented Aug 7, 2020

For IR data flow I also added a definitionByReferenceNodeFromArgument predicate to improve compatibility with AST data flow.

@jbj jbj added the C++ label Aug 7, 2020
@jbj jbj requested a review from a team as a code owner August 7, 2020 13:38
@jbj
Copy link
Contributor Author

jbj commented Aug 7, 2020

Ping @johnlugton @adityasharad

adityasharad
adityasharad previously approved these changes Aug 7, 2020
Copy link
Collaborator

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!
A minor suggestion for readability, but overall I trust your judgement on the most accurate way to describe these nodes.

Comment on lines +502 to +511
/**
* Gets the `Node` corresponding to a definition by reference of the variable
* that is passed as unconverted `argument` of a call.
*/
DefinitionByReferenceNode definitionByReferenceNodeFromArgument(Expr argument) {
result.getArgument() = argument
}

Copy link
Contributor

Choose a reason for hiding this comment

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

The body of definitionByReferenceNodeFromArgument is identical to definitionByReferenceNode on line 479. Is there supposed to be a distinction, or is it just a duplicated predicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I've deprecated definitionByReferenceNode since it was IR-only and updated its callers.

Comment on lines +46 to +49
* This predicate only has a result on nodes that represent the value of
* evaluating the expression. For data flowing _out of_ an expression, like
* when an argument is passed by reference, use `asDefiningArgument` instead
* of `asExpr`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be its own paragraph?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept it as one paragraph in the hope that the reader would be less likely to skip the sentences after the first one. Ideally we'd find a way to qualify the first sentence so it contains a forward reference to the explanation about its restrictions, similar to how the word "non-conversion" is a forward reference to the final paragraph.

@jbj jbj added this to the 1.25 milestone Aug 13, 2020
@jbj jbj changed the base branch from master to rc/1.25 August 13, 2020 13:23
@jbj jbj requested review from a team as code owners August 13, 2020 13:23
@jbj jbj changed the base branch from rc/1.25 to master August 13, 2020 13:23
@jbj jbj removed request for a team August 13, 2020 13:23
@jbj
Copy link
Contributor Author

jbj commented Aug 13, 2020

I had a branch retarget accident with this PR. Sorry for the spam, language teams.

jbj and others added 4 commits August 13, 2020 15:27
For IR data flow I also added a `definitionByReferenceNodeFromArgument`
predicate to improve compatibility with AST data flow.
This predicate name was only used in IR data flow, not in AST data flow.
@jbj jbj requested review from jf205 and shati-patel as code owners August 13, 2020 13:27
@jbj jbj changed the base branch from master to rc/1.25 August 13, 2020 13:28
@jbj jbj removed request for jf205 and shati-patel August 13, 2020 13:28
@jbj
Copy link
Contributor Author

jbj commented Aug 13, 2020

I've retargeted this to rc/1.25.

@jbj
Copy link
Contributor Author

jbj commented Aug 13, 2020

@rdmarsh2 I think you can safely ignore the failing checks. They are transient failures in tests that shouldn't have run in the first place but were triggered during my retargeting accident and are no longer re-triggered.

Copy link
Contributor

@rdmarsh2 rdmarsh2 left a comment

Choose a reason for hiding this comment

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

LGTM

@rdmarsh2 rdmarsh2 merged commit 4a07bd5 into github:rc/1.25 Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants