summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/target_command/a.c
diff options
context:
space:
mode:
authorBruno Ricci <riccibrun@gmail.com>2018-12-03 14:54:03 +0000
committerBruno Ricci <riccibrun@gmail.com>2018-12-03 14:54:03 +0000
commit4c9a019d1e22b67d65d0c42f133ccb29a1e3d54b (patch)
tree9e093b5fd9252b0ecba5e94785980620f8a00160 /lldb/packages/Python/lldbsuite/test/functionalities/target_command/a.c
parent7254d3c51c12ada02b1d75c5bfe22a7fdd87a120 (diff)
downloadbcm5719-llvm-4c9a019d1e22b67d65d0c42f133ccb29a1e3d54b.tar.gz
bcm5719-llvm-4c9a019d1e22b67d65d0c42f133ccb29a1e3d54b.zip
[AST][Sema] Remove CallExpr::setNumArgs
CallExpr::setNumArgs is the only thing that prevents storing the arguments in a trailing array. There is only 3 places in Sema where setNumArgs is called. D54900 dealt with one of them. This patch remove the other two calls to setNumArgs in ConvertArgumentsForCall. To do this we do the following changes: 1.) Replace the first call to setNumArgs by an assertion since we are moving the responsability to allocate enough space for the arguments from Sema::ConvertArgumentsForCall to its callers (which are Sema::BuildCallToMemberFunction, and Sema::BuildResolvedCallExpr). 2.) Add a new member function CallExpr::shrinkNumArgs, which can only be used to drop arguments and then replace the second call to setNumArgs by shrinkNumArgs. 3.) Add a new defaulted parameter MinNumArgs to CallExpr and its derived classes which specifies a minimum number of argument slots to allocate. The actual number of arguments slots allocated will be max(number of args, MinNumArgs) with the extra args nulled. Note that after the creation of the call expression all of the arguments will be non-null. It is just during the creation of the call expression that some of the last arguments can be temporarily null, until filled by default arguments. 4.) Update Sema::BuildCallToMemberFunction by passing the number of parameters in the function prototype to the constructor of CXXMemberCallExpr. Here the change is pretty straightforward. 5.) Update Sema::BuildResolvedCallExpr. Here the change is more complicated since the type-checking for the function type was done after the creation of the call expression. We need to move this before the creation of the call expression, and then pass the number of parameters in the function prototype (if any) to the constructor of the call expression. 6.) Update the deserialization of CallExpr and its derived classes. Differential Revision: https://reviews.llvm.org/D54902 Reviewed By: aaron.ballman llvm-svn: 348145
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/target_command/a.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud