[LLVMdev] one question about up reference

Chris Lattner sabre at nondot.org
Mon Jun 6 08:39:20 PDT 2005


On Mon, 6 Jun 2005, aqex wrote:
> hi,
> I have one question about up reference, why use \nested_level_count in type description.
> and have to handle it in HandleUpRefs() (AsmParser/llvmAsmParser.y)  ,
>
> why not just insert type name and return in calcTypeName() (AsmWriter.cpp) ;
>
> As you mention in "How to build recursively type" ,
>
> %mylist = type { %mylist*, int }  is accepted .
>
> Is it neccessary to use \nested_level_count ?
>
> I'm very thankful if you can give me some C code example to show it .

Upreferences are used when the symbol table is stripped.  The above type 
can be written like this without a name:

  {\2*, int}

This is important because LLVM does not require every type to have a name, 
but I wouldn't recommend language front-ends to generate these.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list