@@ -810,9 +810,9 @@ ConcreteCompilerVariable* UnknownType::hasnext(IREmitter& emitter, const OpInfo&
810810 return boolFromI1 (emitter, rtn_val);
811811}
812812
813- CompilerVariable* makeFunction (IREmitter& emitter, CLFunction * f, CompilerVariable* closure, llvm::Value* globals,
813+ CompilerVariable* makeFunction (IREmitter& emitter, FunctionMetadata * f, CompilerVariable* closure, llvm::Value* globals,
814814 const std::vector<ConcreteCompilerVariable*>& defaults) {
815- // Unlike the CLFunction *, which can be shared between recompilations, the Box* around it
815+ // Unlike the FunctionMetadata *, which can be shared between recompilations, the Box* around it
816816 // should be created anew every time the functiondef is encountered
817817
818818 llvm::Value* closure_v;
@@ -844,8 +844,9 @@ CompilerVariable* makeFunction(IREmitter& emitter, CLFunction* f, CompilerVariab
844844 // We know this function call can't throw, so it's safe to use emitter.getBuilder()->CreateCall() rather than
845845 // emitter.createCall().
846846 llvm::Value* boxed = emitter.getBuilder ()->CreateCall (
847- g.funcs .boxCLFunction , std::vector<llvm::Value*>{ embedRelocatablePtr (f, g.llvm_clfunction_type_ptr ), closure_v,
848- globals, scratch, getConstantInt (defaults.size (), g.i64 ) });
847+ g.funcs .createFunctionFromMetadata ,
848+ std::vector<llvm::Value*>{ embedRelocatablePtr (f, g.llvm_functionmetadata_type_ptr ), closure_v, globals,
849+ scratch, getConstantInt (defaults.size (), g.i64 ) });
849850
850851 if (convertedClosure)
851852 convertedClosure->decvref (emitter);
@@ -914,12 +915,12 @@ class AbstractFunctionType : public CompilerType {
914915
915916 static CompilerType* fromRT (BoxedFunction* rtfunc, bool stripfirst) {
916917 std::vector<Sig*> sigs;
917- CLFunction* clf = rtfunc->f ;
918+ FunctionMetadata* md = rtfunc->md ;
918919
919920 assert (!rtfunc->can_change_defaults );
920921
921- for (int i = 0 ; i < clf ->versions .size (); i++) {
922- CompiledFunction* cf = clf ->versions [i];
922+ for (int i = 0 ; i < md ->versions .size (); i++) {
923+ CompiledFunction* cf = md ->versions [i];
923924
924925 FunctionSpecialization* fspec = cf->spec ;
925926
@@ -1864,14 +1865,14 @@ class NormalObjectType : public ConcreteCompilerType {
18641865 // but I don't think we should be running into that case.
18651866 RELEASE_ASSERT (!rtattr_func->can_change_defaults , " could handle this but unexpected" );
18661867
1867- CLFunction* cl = rtattr_func->f ;
1868- assert (cl );
1868+ FunctionMetadata* md = rtattr_func->md ;
1869+ assert (md );
18691870
18701871 ParamReceiveSpec paramspec = rtattr_func->getParamspec ();
1871- if (cl ->takes_varargs || paramspec.takes_kwargs )
1872+ if (md ->takes_varargs || paramspec.takes_kwargs )
18721873 return NULL ;
18731874
1874- RELEASE_ASSERT (paramspec.num_args == cl ->numReceivedArgs (), " " );
1875+ RELEASE_ASSERT (paramspec.num_args == md ->numReceivedArgs (), " " );
18751876 RELEASE_ASSERT (args.size () + 1 >= paramspec.num_args - paramspec.num_defaults
18761877 && args.size () + 1 <= paramspec.num_args ,
18771878 " %d" , info.unw_info .current_stmt ->lineno );
@@ -1880,9 +1881,9 @@ class NormalObjectType : public ConcreteCompilerType {
18801881 CompiledFunction* best_exception_mismatch = NULL ;
18811882 bool found = false ;
18821883 // TODO have to find the right version.. similar to resolveclfunc?
1883- for (int i = 0 ; i < cl ->versions .size (); i++) {
1884- cf = cl ->versions [i];
1885- assert (cf->spec ->arg_types .size () == cl ->numReceivedArgs ());
1884+ for (int i = 0 ; i < md ->versions .size (); i++) {
1885+ cf = md ->versions [i];
1886+ assert (cf->spec ->arg_types .size () == md ->numReceivedArgs ());
18861887
18871888 bool fits = true ;
18881889 for (int j = 0 ; j < args.size (); j++) {
@@ -1914,7 +1915,7 @@ class NormalObjectType : public ConcreteCompilerType {
19141915 RELEASE_ASSERT (cf->code , " " );
19151916
19161917 std::vector<llvm::Type*> arg_types;
1917- RELEASE_ASSERT (paramspec.num_args == cl ->numReceivedArgs (), " " );
1918+ RELEASE_ASSERT (paramspec.num_args == md ->numReceivedArgs (), " " );
19181919 for (int i = 0 ; i < paramspec.num_args ; i++) {
19191920 // TODO support passing unboxed values as arguments
19201921 assert (cf->spec ->arg_types [i]->llvmType () == g.llvm_value_type_ptr );
0 commit comments