[llvm-commits] When do we have to call MarkDeclarationReferenced?

Rafael Espindola espindola at google.com
Fri Feb 26 05:51:54 PST 2010


Working on bug 6353 I noticed that there are cases where we try to
codegen things that were not marked with MarkDeclarationReferenced but
there are also case where we mark things that are not output. For
example, in

struct box {
  virtual ~box();
};
struct pile_box : public box {
  pile_box(box *);
};

No code is output but everything in the vtable of pile_box is marked.
This is a missed compile time optimization or there are case where a
decl must be marked referenced but we don't need to output it?

I ask because I tried to move the marking earlier for some dels to
solve the issue described on
http://llvm.org/bugs/show_bug.cgi?id=6353#c12 but some Sema tests fail
because now some functions are marked as needed earlier then expected.

Also, exactly when do we need to use
ProcessPendingClassesWithUnmarkedVirtualMembers? In the commit message
it says it is because we have to wait for a potential template
instantiation, but we put decls that are not dependent on than list...

Thanks,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list