comparison src/interp-core/jit-typeinfo.h @ 15124:0464e3ceb85b

Skip functions when resolving end context in JIT * src/interp-core/jit-ir.cc (jit_magic_end::resolve_context): Skip functions. * src/interp-core/jit-typeinfo.cc (jit_type::jit_type): Add askip_paren parameter. (jit_typeinfo::addbuiltin): Skip end resolution for builtin functions. * src/interp-core/jit-typeinfo.h (jit_type::skip_paren): New function. (jit_typeinfo::new_type): Add skip_paren argument.
author Max Brister <max@2bass.com>
date Tue, 07 Aug 2012 14:59:58 -0500
parents d29f2583cf7b
children bd6bb87e2bea
comparison
equal deleted inserted replaced
15123:4e0ab3b28418 15124:0464e3ceb85b
130 { 130 {
131 public: 131 public:
132 typedef llvm::Value *(*convert_fn) (llvm::IRBuilderD&, llvm::Value *); 132 typedef llvm::Value *(*convert_fn) (llvm::IRBuilderD&, llvm::Value *);
133 133
134 jit_type (const std::string& aname, jit_type *aparent, llvm::Type *allvm_type, 134 jit_type (const std::string& aname, jit_type *aparent, llvm::Type *allvm_type,
135 int aid); 135 bool askip_paren, int aid);
136 136
137 // a user readable type name 137 // a user readable type name
138 const std::string& name (void) const { return mname; } 138 const std::string& name (void) const { return mname; }
139 139
140 // a unique id for the type 140 // a unique id for the type
148 148
149 // how this type gets passed as a function argument 149 // how this type gets passed as a function argument
150 llvm::Type *to_llvm_arg (void) const; 150 llvm::Type *to_llvm_arg (void) const;
151 151
152 size_t depth (void) const { return mdepth; } 152 size_t depth (void) const { return mdepth; }
153
154 bool skip_paren (void) const { return mskip_paren; }
153 155
154 // -------------------- Calling Convention information -------------------- 156 // -------------------- Calling Convention information --------------------
155 157
156 // A function declared like: mytype foo (int arg0, int arg1); 158 // A function declared like: mytype foo (int arg0, int arg1);
157 // Will be converted to: void foo (mytype *retval, int arg0, int arg1) 159 // Will be converted to: void foo (mytype *retval, int arg0, int arg1)
193 std::string mname; 195 std::string mname;
194 jit_type *mparent; 196 jit_type *mparent;
195 llvm::Type *llvm_type; 197 llvm::Type *llvm_type;
196 int mid; 198 int mid;
197 size_t mdepth; 199 size_t mdepth;
200 bool mskip_paren;
198 201
199 bool msret[jit_convention::length]; 202 bool msret[jit_convention::length];
200 bool mpointer_arg[jit_convention::length]; 203 bool mpointer_arg[jit_convention::length];
201 204
202 convert_fn mpack[jit_convention::length]; 205 convert_fn mpack[jit_convention::length];
623 626
624 const jit_function& do_end (jit_value *value, jit_value *index, 627 const jit_function& do_end (jit_value *value, jit_value *index,
625 jit_value *count); 628 jit_value *count);
626 629
627 jit_type *new_type (const std::string& name, jit_type *parent, 630 jit_type *new_type (const std::string& name, jit_type *parent,
628 llvm::Type *llvm_type); 631 llvm::Type *llvm_type, bool skip_paren = false);
629 632
630 633
631 void add_print (jit_type *ty, void *fptr); 634 void add_print (jit_type *ty, void *fptr);
632 635
633 void add_binary_op (jit_type *ty, int op, int llvm_op); 636 void add_binary_op (jit_type *ty, int op, int llvm_op);