This corrects WrapperGen generating incorrect wrappers for functions
that take no arguments. Previously it would generate a wrapper with a
single argument of type void.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| libc/utils/tools/WrapperGen/Main.cpp | ||
|---|---|---|
| 51 | May be check that the ArgsList.size() is zero? If zero, break out of the for loop, else report a descriptive error? | |
submit comments
| libc/utils/tools/WrapperGen/Main.cpp | ||
|---|---|---|
| 51 | ArgsList.size() is still 1 if there are no arguments, that's where the argument of type void is coming from. If ArgsList.size() was ever 0 it wouldn't even enter the for loop, as that's the check at the top. I did change the continue to a break though. | |
| libc/utils/tools/WrapperGen/Main.cpp | ||
|---|---|---|
| 51 | Sorry! I intended to say, when you find a void arg type, check that ArgsList.size() == 1. If not, report a descriptive error. | |
| libc/utils/tools/WrapperGen/Main.cpp | ||
|---|---|---|
| 60 | Say something like, "The specification for function " + FunctionName + " lists other arguments along with a void argument." Pointing out that the specification is at fault tells the user where to go look. | |
May be check that the ArgsList.size() is zero? If zero, break out of the for loop, else report a descriptive error?