-
-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hi there, first off thanks to the developer for the very cool open source tool!
At the moment, im trying use clangql for a project, and have this issue when a file contains both standalone function declarations and function definition, clangql would retrieve the function declaration instead of the definition.
For example running this query on Nic Baker's Clay: clangql -f clay/clay.c -q "select * from functions -o json
gives me this output on the last element:
"name":"Clay__GetParentElementId","return_type":"uint32_t","signature":"uint32_t (void)","source_loc":"clay/clay.c:890:26"}
However, looking at the source code, this is just the function declaration, and the full definition is provided in line 1280:
uint32_t Clay__GetParentElementId(void) {
Clay_Context* context = Clay_GetCurrentContext();
return Clay_LayoutElementArray_Get(&context->layoutElements, Clay__int32_tArray_GetValue(&context->openLayoutElementStack, context->openLayoutElementStack.length - 2))->id;
}
In my current use case I need to retrieve only the full function definitions. Any ideas on how to go around this?
Disclaimer: I'm not familiar with C programming, but my current project require me to dig into C source codes.
Kindly thanks,
Afrizal