-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
C++: Add Parameter nodes for functions without bodies #16246
C++: Add Parameter nodes for functions without bodies #16246
Conversation
b6a9e7d
to
b43aae1
Compare
e3bf902
to
bcda4a1
Compare
I'm missing something - I think. How do we know that the bodiless parameter nodes are actually only for functions without bodies? I don't see an explicit condition for this anywhere. |
That's the |
Ah, my brain filtered that out completely because of the horrendous formatting of the diff on my small screen 🤦 |
This PR fixes an annoyance with
ParameterNode
s in C/C++ dataflow: Parameters of functions without a definition (i.e., when we only have a set of declarations) don't generateParameterNode
s.This is because we define
ParameterNode
s using theInitializeParameter
instruction in the IR, and without a function body there's no instructions associated with the function.This PR fixes this by generating new dataflow nodes (from
Parameter
s) and marking those asParameterNode
s.Ideally, only 98a3f2d and 06f52c2 would've been necessary. However, the current setup for marking parameter nodes wasn't very easy to extend to something that wasn't defined in terms of
Instruction
s so it took some refactoring (see 111ad8b) to allow for this. That commit should be totally behavior preserving.Commit-by-commit review recommended.
cc @bdrodes