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

Nimrod Partush nimrodpar at gmail.com
Sun Nov 21 01:21:18 PST 2010


No no, the function is entirely in that code file and there is no forward
declaration.

On Sat, Nov 20, 2010 at 10:49 PM, Chris Lattner <clattner at apple.com> wrote:

>
> 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




-- 
Regards,
Nimrod
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101121/9f823b71/attachment.html>


More information about the cfe-dev mailing list