User Tools

Site Tools


struct_implementation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
struct_implementation [2010/05/12 13:56]
zhangvi1
struct_implementation [2010/12/15 15:53] (current)
Line 106: Line 106:
  
 Struct Alignment: Struct Alignment:
-  * Structs are declared as align 8 by llvm-gcc, so a char proceeded by an int takes up 8 bytes (3 unused). char, int, char takes up 12 bytes, however char, char, int uses 8. Also, clang initializes structs using llvm.memcpy align 4.+  * Structs are declared as align 8 by llvm-gcc, but seem to be internally align 4, so a char proceeded by an int takes up 8 bytes (3 unused). char, int, char takes up 12 bytes, however char, char, int uses 8.
  
 =======Instructions To Implement======= =======Instructions To Implement=======
Line 123: Line 123:
  
 bitcast: bitcast %struct.record* %1 to i8* bitcast: bitcast %struct.record* %1 to i8*
 +
 +ptrtoint: %78 = ptrtoint %struct.record* %77 to i32
  
 =======alloca======= =======alloca=======
Line 140: Line 142:
  
 =======bitcast======= =======bitcast=======
 +May not need to modify
 +
 +=======ptrtoint=======
 May not need to modify May not need to modify
  
struct_implementation.1273686974.txt.gz ยท Last modified: 2010/12/15 15:53 (external edit)