[cfe-dev] Making Sema public

Lukasz Janyst ljanyst at cern.ch
Fri Dec 19 08:16:55 PST 2008


On Thu, Dec 18, 2008 at 5:50 AM, Chris Lattner <clattner at apple.com> wrote:
> I'd be
> ok with adding a top-level hook that does a virtual method call to do a
> "last chance" resolution if normal lookup fails.  Would this work for you?

Hi Chris,

   I am not really sure where you want to add this kind of method...
One could probably add a possibility of registering a callback
function with a Preprocessor. Anyways, the "last chance" resolution is
not really what I need. You would have to call my function in every
scope being searched even if you find something (since my identifier
may be a better match for a call) and this may be too big a price to
be paid in terms of the execution time.

   My goal is not to make Sema public but to have a possibility of
merging two translation units. I think you need to find a way to do
that anyways if you want to have the precompled headers functionality
working. In that case also the code generation will have to be
decoupled from Sema (I mean the ASTConsumer::HandleTagDeclDefinition
callback) but that could be probably easily implemented by having a
sort of tag nodes in the AST telling the consumer that a certain state
has been reached. Should I go ahead and implement the latter? What do
we do about the merging of AST?

Cheers,
   Lukasz



More information about the cfe-dev mailing list