[LLVMdev] How to explain?

yue qiangyue at ict.ac.cn
Mon Dec 22 18:35:01 PST 2003


hi,

I want to know what is exact meaning in the following code.

target endian--
%struct..TorRec--
%struct.TorRec--
implementation--
;<sbyte>[#uses=1/0]--

how to explain them in details?
Does anyone give me a guide?
thanks

yueqiang
--------------------------------------------------------------
target endian = little
target pointersize = 32
         %struct..TorRec = type { int, void ()* }
         %struct.TorRec = type { int, void ()* }
%.str_1 = internal constant [13 x sbyte] c"hello world\0A\00" 
; <[13 x sbyte]*> [#uses=1]

implementation   ; Functions:

int %main() {
entry:
         br label %no_exit.i1

no_exit.i1:             ; preds = %entry, %no_exit.i1
         %Str.0.i = phi sbyte* [ %inc.i, %no_exit.i1 ], [ getelementptr 
([13 x sbyte]* %.str_1, long 0, long 0), %entry ]
                 ; <sbyte*> [#uses=2]
         %inc.i = getelementptr sbyte* %Str.0.i, long 1          ; 
<sbyte*> [#uses=2]
         %tmp.7.i = load sbyte* %Str.0.i         ; <sbyte> [#uses=1]
         %tmp.8.i = cast sbyte %tmp.7.i to int           ; <int> [#uses=1]
         %tmp.5.i = call int %putchar( int %tmp.8.i )            ; <int> 
[#uses=0]
         %tmp.2.i = load sbyte* %inc.i           ; <sbyte> [#uses=1]
         %tmp.3.i = setne sbyte %tmp.2.i, 0              ; <bool> [#uses=1]
         br bool %tmp.3.i, label %no_exit.i1, label %loopexit.i

loopexit.i:             ; preds = %no_exit.i1
         %tmp.9.i = call int %putchar( int 10 )          ; <int> [#uses=0]
         ret int 0
}

declare int %putchar(int)




More information about the llvm-dev mailing list