[cfe-dev] Empty function declaration when parsing Linux kernel code

Chris Lattner clattner at apple.com
Sat Nov 20 12:49:39 PST 2010


On Nov 20, 2010, at 11:26 AM, Nimrod Partush wrote:

> Hi All,
> 
> When i ParseAST Linux's mmap.c (for instance) i get that several of the functions don't have a body even though they are defined inside that file. For instance when i try to dump() the vma_adjust function:
> 
> void vma_adjust(struct vm_area_struct *vma, unsigned long start,unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert)
> 
> i get this weird thing:
> 
> int vma_adjust()
> 
> And getBody() return null.
> 
> It seems the entire FunctionDecl got lost or something. I haven't quite figured out what's in common for all these lost functions nor why does this happen.

Are you sure that you're not seeing a forward definition for that function?

For example, you should see both decls in:
int foo();
...
int foo(int x) {}

-Chris



More information about the cfe-dev mailing list