C++: Hide that IR DataFlow::Node is Instruction#1888
Conversation
We haven't come to a conclusion on whether these two types will remain identical forever. To make sure we're able to change it in the future, this change makes it impossible to cast between the two types. Callers must use the `asInstruction` member predicate to convert.
|
Having |
|
Our conclusion at this morning's meeting was that we will probably want |
rdmarsh2
left a comment
There was a problem hiding this comment.
LTGM other than the nonblocking comment
| this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) | ||
| } | ||
|
|
||
| string toString() { result = instr.toString() } |
There was a problem hiding this comment.
This isn't a regression and shouldn't block the merge, but I wonder if this is the right thing to do. When using the AST dataflow library, it's common to select node.toString() rather than node.asExpr().toString. This toString() (and the previous inherited one) mean this isn't a pure drop-in replacement.
@rdmarsh2 and @dave-bartolomeo, we've talked about making this change a couple of times. Here's what it would look like. What do you think?