-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: Fix small PrintAST and PrintIR issue #18277
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
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.
Copilot encountered an error and was unable to review this pull request. You can try again, by re-requesting a review.
| key = "semmle.label" and | ||
| exists(string kinds | | ||
| kinds = | ||
| concat(EdgeKind k | |
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.
If this is changed to a strictcount you could remove line 428, right?
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.
I still need 428 to correctly bind succBlock in the other side of the or, I think.
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.
In the key = "semmle.order" case? That's bound by getSuccessorIndex anyway. Although, I do see that you need to rewrite the exists slightly to get rid of the resulting cartesian product with kind.
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.
In the
key = "semmle.order"case? That's bound bygetSuccessorIndexanyway.
Ah, you're right.
So are you thinking of something like:
query predicate edges(PrintableIRBlock pred, PrintableIRBlock succ, string key, string value) {
exists(IRBlock predBlock, IRBlock succBlock |
predBlock = pred.getBlock() and
succBlock = succ.getBlock() and
(
key = "semmle.label" and
exists(string kinds |
kinds =
strictconcat(EdgeKind k |
predBlock.getSuccessor(k) = succBlock
|
k.toString(), "|" order by k.toString()
)
|
if predBlock.getBackEdgeSuccessor(_) = succBlock
then value = kinds + " (back edge)"
else value = kinds
)
or
key = "semmle.order" and
value = getSuccessorIndex(predBlock, succBlock).toString()
)
)
}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.
Exactly 👍
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.
Done in f9bfd96
MathiasVP
left a comment
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! The CI failures looks unrelated!
OverloadedArrayExpradd a test and fixPull Request checklist
All query authors
.qhelp. See the documentation in this repository.Internal query authors only
.ql,.qll, or.qhelpfiles. See the documentation (internal access required).