[LLVMdev] An array of instructions?

Harel Cain harel.cain at gmail.com
Tue Jul 14 05:04:53 PDT 2009


Another question today: an array of string literals in my C program
was transformed to independent global variables, each holding one
string, and another array of getelementptr's to them, here it is:

@words= global [5 x i8*] [ i8* getelementptr ([10 x i8]* @.str11, i32
0, i32 0), i8* getelementptr ([6 x i8]* @.str12, i32 0, i32 0), i8*
getelementptr ([7 x i8]* @.str13, i32 0, i32 0), i8* getelementptr ([6
x i8]* @.str14, i32 0, i32 0), i8* getelementptr ([11 x i8]* @.str15,
i32 0, i32 0) ]             ; <[5 x i8*]*> [#uses=1]

Does this make sense? Are the elements of this array indeed regular
GetElementPtrInst's, which is a kind of Instruction? How can an
instruction live outside of a BasicBlock and a Function?


Thanks,
Harel



More information about the llvm-dev mailing list