[cfe-dev] Ownership of declarations in clang?

Eli Friedman eli.friedman at gmail.com
Mon Feb 25 15:03:19 PST 2008


Currently, clang leaks a lot of stuff.  I was looking at this using
valgrind, and then I was trying to figure out what code is supposed to
be responsible for cleaning up the declarations generated by Sema
after the file is finished being parsed.  I wasn't able to find any
such code.

What exactly is the expected ownership model for the declarations
generated by Sema?  They obviously need to be around until we are
finished parsing the file, but by then, it appears only the parser
(specifically, the root scope) is holding onto pointers to
declarations, and it doesn't know how to delete them.

-Eli



More information about the cfe-dev mailing list