[LLVMdev] LLVM IR Type System Rewrite

Jan Sjodin jan_sjodin at yahoo.com
Sun Feb 27 02:42:31 PST 2011


With the named/unnamed/anonymous distinctions there seems to be two things going 
on:
1. Giving an ID to a struct type.
2. Naming a type for readability.

Would the new system force anonymous structs to be printed inline at every 
occurrence? The code might become hard to read with large anonymous types. Would 
it make sense to have both ID and Name? If a type has a name it could be printed 
using that. Perhaps there could be an extension to indicate that a type has an 
ID (something like "%'foo" vs. "%foo"). When printing with -strip any type with 
an ID (maybe a number) would be printed using the ID and a type without ID would 
have to be printed inline.

My opinion about the syntax is that if there is a semantic difference  between 
two types it should be very clear in the syntax (maybe a "'" isn't clear 
enough). In my mind, naming  things in LLVM is used more for convenience  or 
readability, rather than specifying semantics.

- Jan




----- Original Message ----
> From: Chris Lattner <clattner at apple.com>
> To: llvmdev Mailing List <llvmdev at cs.uiuc.edu>
> Sent: Sat, February 26, 2011 4:25:32 PM
> Subject: [LLVMdev] LLVM IR Type System Rewrite
> 
> Several people have been proding me to write up my thoughts on how to fix the  
>IR  type system for LLVM 3.0.  Here are some (fairly stream of  conscious) 
>thoughts on the  matter:
> http://nondot.org/sabre/LLVMNotes/TypeSystemRewrite.txt
> 
> Comments welcome!
> 
> -Chris
> _______________________________________________
> LLVM M Developers mailing list
> LLVMdev at cs.uiuc.edu           http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 



More information about the llvm-dev mailing list