Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define { i32, i32* }* @create_array() local_unnamed_addr gc "ocaml" {
- entry:
- %malloccall = tail call i8* @malloc(i32 32)
- %array_init = bitcast i8* %malloccall to i32*
- br label %test
- test: ; preds = %loop, %entry
- %i.0 = phi i32 [ 0, %entry ], [ %add_tmp, %loop ]
- %lt_tmp = icmp slt i32 %i.0, 8
- %bool_tmp = zext i1 %lt_tmp to i32
- %cond = icmp eq i32 %bool_tmp, 1
- br i1 %cond, label %loop, label %end
- loop: ; preds = %test
- %Element = getelementptr i32, i32* %array_init, i32 %i.0
- store i32 1, i32* %Element
- %add_tmp = add i32 %i.0, 1
- br label %test
- end: ; preds = %test
- %malloccall4 = tail call i8* @malloc(i32 ptrtoint ({ i32, i32* }* getelementptr ({ i32, i32* }, { i32, i32* }* null, i32 1) to i32))
- %array_wrapper = bitcast i8* %malloccall4 to { i32, i32* }*
- %array_length = getelementptr { i32, i32* }, { i32, i32* }* %array_wrapper, i32 0, i32 0
- store i32 8, i32* %array_length
- %array_ptr = getelementptr { i32, i32* }, { i32, i32* }* %array_wrapper, i32 0, i32 1
- store i32* %array_init, i32** %array_ptr
- ret { i32, i32* }* %array_wrapper
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement