[LLVMdev] How to add an include file

Eli Friedman eli.friedman at gmail.com
Tue Jul 7 02:43:52 PDT 2009

On Tue, Jul 7, 2009 at 1:42 AM, David Minor<dahvid.minor at gmail.com> wrote:
> Hi Eli,
> Let's say I have a file ClassA.h, that pairs with a file ClassA.cpp
> to product a library libClassA.a.
> ClassA.h contains the single declaration.
> class A {...};
> I want to transform it to:
> #include "ClassB.h"
> class A : public class B {...};
> ClassB.h is the header file for a library libClassB.a built from ClassB.cpp
> and ClassB.h.
> I can clearly link libClassB with libClassA. But how can I bring in the
> header file so that it's declarations will be known in ClassA.h.  Remember
> this is happening during a pass.

You have to rebuild libClassA.a from scratch; the generation of
bitcode makes too many hard-coded assumptions about the layout of
classes to manipulate the bitcode accurately.


More information about the llvm-dev mailing list