New signatures for Preprocessor and ASTContext constructors

Hello,

Because of technical problems in my computer I had to rebuild the Clang libraries I were using. Since now I can’t know what version of Clang I was using earlier, I had to build the latest one available in the SVN repositories.

Due to this issue, now my code doesn’t compile because of all the changes in the signatures of several functions I’m using. I’ve been able to fix some of these incompatibilities, but I still have two function calls that don’t work:

First, I’m trying to create a Preprocessor instance. In former versions, the constructor method had this signature: clang::Preprocessor::Preprocessor(clang::DiagnosticsEngine&, clang::LangOptions&, clang::TargetInfo&, clang::SourceManager&, clang::HeaderSearch&)’, but now it is clang::Preprocessor::Preprocessor(clang::DiagnosticsEngine&, clang::LangOptions&, const clang::TargetInfo*, clang::SourceManager&, clang::HeaderSearch&, clang::ModuleLoader&, clang::IdentifierInfoLookup*, bool, bool). I know that IdentifierInfoLookup* and the two bools have default values, but I don’t know how to build a proper instance of a ModuleLoader.

Next, I’m also creating an ASTContext, but the compiler doesn’t accept the instance of Builtin::Context i’m passing into, because It identifies the instance as clang::Builtin::Context(&)() instead of clang::Builtin::Context&, unsigned int, bool). ¿How can I build an instance of Builtin::Context properly?

Thanks,

Jorge Fdez. Fabeiro

P.S.: Sorry for my bad English, :wink:

Next, I'm also creating an ASTContext, but the compiler doesn't accept the
instance of Builtin::Context i'm passing into, because It identifies the
instance as clang::Builtin::Context(&)() instead of
clang::Builtin::Context&, unsigned int, bool). ¿How can I build an instance
of Builtin::Context properly?

That looks like you have a reference to a function that returns a
Context, so you probably need to change this:

Builtin::Context

to this:

Builtin::Context()

I hope that helps,
- David