[llvm-commits] [llvm-gcc-4.2] r97676 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-internal.h llvm-types.cpp tree.c tree.h

Duncan Sands baldrick at free.fr
Fri Mar 5 01:07:43 PST 2010


Hi Stuart,

>>> +  // Random initialization of TypeRefinementDatabase if we're using a
>>> +  // PCH.  Won't work until the GCC PCH has been read in and digested.
>>
>> what do you mean by "random initialization"?
>
> This function has a name patterned after two similar functions that restore LLVM data structures from a PCH.  However, where those functions extract data from a bitcode file embedded in the PCH, this function extracts data saved in the GCC section.  Alas, it seems this function can't be invoked with its cousins, because the GCC part of the PCH hasn't yet been retrieved from disk when they're invoked.  Locating the call at this spot clearly solves the problem (late enough that the PCH has been read, but before LLVM uses the data stored in TypeRefinementDatabase::TypeUsers[]), but it still seems "wrong" to me.  In fact, it looked to me like a very "random" spot to call this function, thus the comment.  Perhaps I should give the function C linkage and invoke it from the GCC PCH logic?

thanks for the explanation.

Ciao,

Duncan.



More information about the llvm-commits mailing list