[LLVMdev] Declaring constant global variables

Eli Friedman eli.friedman at gmail.com
Thu Apr 8 12:29:33 PDT 2010


On Thu, Apr 8, 2010 at 12:18 PM, Zheng Wang <jason.wangz at gmail.com> wrote:
> 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"

Try passing the given declaration to "llc -march=cpp".

-Eli



More information about the llvm-dev mailing list