-
Notifications
You must be signed in to change notification settings - Fork 0
/
program.ir
95 lines (90 loc) · 5.34 KB
/
program.ir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
(Signature LLVMGetGlobalContext () -> LLVMOpaqueContext)
(Signature LLVMModuleCreateWithName (String ) -> LLVMOpaqueModule)
(Signature LLVMSetTarget (LLVMOpaqueModule String ) -> EmptyTree)
(Signature LLVMInt8Type () -> LLVMOpaqueType)
(Signature LLVMInt32Type () -> LLVMOpaqueType)
(Signature LLVMArrayType (LLVMOpaqueType Int ) -> LLVMOpaqueType)
(Signature LLVMPointerType (LLVMOpaqueType Int ) -> LLVMOpaqueType)
(Signature LLVMFunctionType (LLVMOpaqueType (Array LLVMOpaqueType) Int LLVMBool ) -> LLVMOpaqueType)
(Signature arrayCreateLLVMTypeRef (Int ) -> (Array LLVMOpaqueType) )
(Signature arraySetLLVMTypeRef ((Array LLVMOpaqueType) Int LLVMOpaqueType ) -> EmptyTree)
(Signature LLVMGetNamedFunction (LLVMOpaqueModule String ) -> LLVMOpaqueValue)
(Signature LLVMAddFunction (LLVMOpaqueModule String LLVMOpaqueType ) -> LLVMOpaqueValue)
(Signature LLVMSetFunctionCallConv (LLVMOpaqueValue Int ) -> EmptyTree)
(Signature notNullValueRef (LLVMOpaqueValue ) -> Boolean)
(Signature LLVMTrue () -> LLVMBool)
(Signature LLVMFalse () -> LLVMBool)
(Signature LLVMDumpModule (LLVMOpaqueModule ) -> EmptyTree)
(Signature LLVMAddGlobal (LLVMOpaqueModule LLVMOpaqueType String ) -> LLVMOpaqueValue)
(Signature LLVMSetAlignment (LLVMOpaqueValue Int ) -> EmptyTree)
(Signature LLVMConstString (String Int LLVMBool ) -> LLVMOpaqueValue)
(Signature LLVMConstInt (LLVMOpaqueType Long LLVMBool ) -> LLVMOpaqueValue)
(Signature LLVMCreateBuilder () -> LLVMOpaqueBuilder)
(Signature LLVMBuildInBoundsGEP (LLVMOpaqueBuilder LLVMOpaqueValue (Array LLVMOpaqueValue) Int String ) -> LLVMOpaqueValue)
(Signature LLVMSetInitializer (LLVMOpaqueValue LLVMOpaqueValue ) -> EmptyTree)
(Signature LLVMAppendBasicBlock (LLVMOpaqueValue String ) -> LLVMOpaqueBasicBlock)
(Signature LLVMPositionBuilderAtEnd (LLVMOpaqueBuilder LLVMOpaqueBasicBlock ) -> EmptyTree)
(Signature LLVMBuildAlloca (LLVMOpaqueBuilder LLVMOpaqueType String ) -> LLVMOpaqueValue)
(Signature LLVMBuildStore (LLVMOpaqueBuilder LLVMOpaqueValue LLVMOpaqueValue ) -> LLVMOpaqueValue)
(Signature LLVMBuildCall (LLVMOpaqueBuilder LLVMOpaqueValue (Array LLVMOpaqueValue) Int String ) -> LLVMOpaqueValue)
(Signature LLVMSetTailCall (LLVMOpaqueValue LLVMBool ) -> EmptyTree)
(Signature LLVMBuildRetVoid (LLVMOpaqueBuilder ) -> LLVMOpaqueValue)
(Signature LLVMBuildRet (LLVMOpaqueBuilder LLVMOpaqueValue ) -> LLVMOpaqueValue)
(Signature intToLong (Int) -> Long)
(defun main1 ( )
(Block
(ValDef tt (ArrayCreate Int 12 ))
(ArrayAssign tt 2 1 )
(ValDef LLVMCCallConv 0 )
(ValDef ctx (LLVMGetGlobalContext ) )
(ValDef mod (LLVMModuleCreateWithName "debug.ll" ) )
(LLVMSetTarget mod "x86_64-apple-macosx10.10.0" )
(ValDef Int8Type (LLVMInt8Type ) )
(ValDef Int32Type (LLVMInt32Type ) )
(ValDef ArrayTy_0 (LLVMArrayType Int8Type 7 ) )
(ValDef PointerTy_1 (LLVMPointerType ArrayTy_0 0 ) )
(ValDef args_count13 0 )
(ValDef FuncTy_2_args (ArrayCreate LLVMOpaqueType args_count13 ))
(ValDef FuncTy_2 (LLVMFunctionType Int32Type FuncTy_2_args args_count13 (LLVMFalse ) ) )
(ValDef PointerTy_3 (LLVMPointerType Int32Type 0 ) )
(ValDef PointerTy_4 (LLVMPointerType Int8Type 0 ) )
(ValDef args_count6 1 )
(ValDef FuncTy_6_args (ArrayCreate LLVMOpaqueType args_count6 ))
(ArrayAssign FuncTy_6_args 0 PointerTy_4 )
(ValDef FuncTy_6 (LLVMFunctionType Int32Type FuncTy_6_args args_count6 (LLVMTrue ) ) )
(ValDef PointerTy_5 (LLVMPointerType FuncTy_6 0 ) )
(ValDef func_main (LLVMGetNamedFunction mod "main" ) )
(If (notNullValueRef func_main )
(Block
(Assign func_main (LLVMAddFunction mod "main" FuncTy_2 ) )
(LLVMSetFunctionCallConv func_main LLVMCCallConv ) )
Else
EmptyTree )
(ValDef func_printf (LLVMGetNamedFunction mod "printf" ) )
(If (notNullValueRef func_printf )
(Block
(Assign func_printf (LLVMAddFunction mod "printf" FuncTy_6 ) )
(LLVMSetFunctionCallConv func_printf LLVMCCallConv ) )
Else
EmptyTree )
(ValDef gvar_array__str (LLVMAddGlobal mod ArrayTy_0 ".str" ) )
(LLVMSetAlignment gvar_array__str 1 )
(ValDef const_array_7 (LLVMConstString "Hello" 7 (LLVMTrue ) ) )
(ValDef zero (LLVMConstInt Int32Type (intToLong 0) (LLVMFalse ) ) )
(ValDef const_ptr_10_indices (ArrayCreate LLVMOpaqueValue 2 ))
(ArrayAssign const_ptr_10_indices 0 zero )
(ArrayAssign const_ptr_10_indices 1 zero )
(ValDef builder (LLVMCreateBuilder ) )
(ValDef const_ptr_10 (LLVMBuildInBoundsGEP builder gvar_array__str const_ptr_10_indices 2 "NAME" ) )
(LLVMSetInitializer gvar_array__str const_array_7 )
(ValDef basicBlock (LLVMAppendBasicBlock func_main "entry" ) )
(LLVMPositionBuilderAtEnd builder basicBlock )
(ValDef ptr_12 (LLVMBuildAlloca builder Int32Type "ptr_12" ) )
(ValDef void_13 (LLVMBuildStore builder zero ptr_12 ) )
(ValDef ttt (ArrayCreate LLVMOpaqueValue 1 ))
(ArrayAssign ttt 0 const_ptr_10 )
(ValDef int32_14 (LLVMBuildCall builder func_printf ttt 1 "int32_14" ) )
(LLVMSetTailCall int32_14 (LLVMFalse ) )
(LLVMBuildRet builder zero )
(LLVMDumpModule mod )
(newString "helloDotty!" ) ) )