Lookup table in clang.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Lookup table in clang.

shirley breuer via cfe-dev
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
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Lookup table in clang.

shirley breuer via cfe-dev
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
<[hidden email]> 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
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev