[cfe-dev] Lookup table in clang.

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Thu Jan 14 15:53:20 PST 2021


Nah, B doesn't get touched - B has a variable that has a type (A*)
which has a type (A) that is specifically the declaration of A -
redeclarable ( https://clang.llvm.org/doxygen/classclang_1_1Redeclarable.html
) is then used to describe the chain of declarations and allow any
reference to a declaration to be resolved to the "canonical
declaration" which, if the redeclarable is defined, the canonical
declaration is the definition (if I recall/understand correctly).

On Thu, Jan 14, 2021 at 3:43 PM Deepak Rajendrakumaran via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> Hello,
>
> I’m familiar with LLVM API and IR but not well versed in clang intervals.
>
> I’m trying to figure out how the lookup table implementation works in clang.
>
> To be specific, I’m trying to figure out how forward declaration -> use -> definition is handled.
>
> For example.
>
> Struct A;// declared- added to table?
>
> // B created with pointer to A and added to table?
> Struct B {
>        A *a;
> }
>
> // does B get updated?
> Struct A {
>       Type bar;
> }
>
>
>
> Is there any documentation available to figure out the clang internals to know where to start looking to figure this out?
>
> I’m guessing type system( to understand relation between declared and defined types) and lookup table implementation should be a good starting point to figure out how it works. Suggestions?
>
> Regards,
> Deepak
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list