[LLVMdev] Declaring constant global variables

Zheng Wang jason.wangz at gmail.com
Thu Apr 8 12:18:40 PDT 2010


Hiya,

I want to declare a constant global variable as:

@.str = private constant [4 x i8] c"%f\0A\00", align 1 ; <[4 x i8]*> [#uses=1]

I guess I should firstly declare an arrayType object, then declare a
GlobalVariable object.

I have two problems:

1. What element type I should set for the arrayType?
2. How to set the constant value as :c"%f\0A\00"

Cheers,
Zheng



More information about the llvm-dev mailing list