diff --git a/src/compiler/llvm_codegen_function.c b/src/compiler/llvm_codegen_function.c index d7cba6dc9..c799064fe 100644 --- a/src/compiler/llvm_codegen_function.c +++ b/src/compiler/llvm_codegen_function.c @@ -648,16 +648,13 @@ void llvm_emit_extern_decl(GenContext *context, Decl *decl) case DECL_BITSTRUCT: case DECL_STRUCT: case DECL_UNION: - llvm_emit_methods(context, decl->methods); llvm_get_type(context, decl->type); // TODO // Fix typeid break; case DECL_ENUM: - llvm_emit_methods(context, decl->methods); break; case DECL_ERRTYPE: gencontext_emit_introspection_type(context, decl); - llvm_emit_methods(context, decl->methods); // TODO // Fix typeid return; case DECL_TYPEDEF: diff --git a/src/compiler/sema_expr.c b/src/compiler/sema_expr.c index b794967df..dc8a0f150 100644 --- a/src/compiler/sema_expr.c +++ b/src/compiler/sema_expr.c @@ -2871,11 +2871,13 @@ CHECK_DEEPER: Decl *ambiguous = NULL; Decl *private = NULL; member = sema_resolve_method(context, decl, kw, &ambiguous, &private); - if (member) - { - context_register_external_symbol(context, member); - } } + + if (member && member->decl_kind == DECL_FUNC) + { + context_register_external_symbol(context, member); + } + // 11. If we didn't find a match... if (!member) { diff --git a/src/version.h b/src/version.h index eda790a8f..3f814420d 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define COMPILER_VERSION "PRE.1" \ No newline at end of file +#define COMPILER_VERSION "PRE.2" \ No newline at end of file diff --git a/test/test_suite/functions/test_regression.c3t b/test/test_suite/functions/test_regression.c3t index e8bd39f1c..023c963d3 100644 --- a/test/test_suite/functions/test_regression.c3t +++ b/test/test_suite/functions/test_regression.c3t @@ -238,9 +238,9 @@ fn Type getValue(Blob blob) %Blob = type { i32 } %Blob.0 = type { double } -%List = type { i64, i64, i32* } %LinkedList = type { i64, %Node*, %Node* } %Node = type { %Node*, %Node*, i32 } +%List = type { i64, i64, i32* } %Foo2 = type { i32 } %Bobo = type { i16, float, i16, i16, float, i16 } %"int[]" = type { i32*, i64 } diff --git a/test/test_suite/functions/test_regression_mingw.c3t b/test/test_suite/functions/test_regression_mingw.c3t index f39b5313b..d41f44b6f 100644 --- a/test/test_suite/functions/test_regression_mingw.c3t +++ b/test/test_suite/functions/test_regression_mingw.c3t @@ -240,9 +240,9 @@ fn Type getValue(Blob blob) %Blob = type { i32 } %Blob.0 = type { double } -%List = type { i64, i64, i32* } %LinkedList = type { i64, %Node*, %Node* } %Node = type { %Node*, %Node*, i32 } +%List = type { i64, i64, i32* } %Foo2 = type { i32 } %Bobo = type { i16, float, i16, i16, float, i16 } %"int[]" = type { i32*, i64 } @@ -288,83 +288,28 @@ declare i32 @test2.int.getMult(i32) declare double @test2.double.getMult(double) -; Function Attrs: nounwind -declare void @List.ensureCapacity(%List*) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__push"(%List*, i32) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__append"(%List*, i32) #0 - -; Function Attrs: nounwind -declare i32 @"std::array::list.int.List__pop"(%List*) #0 - -; Function Attrs: nounwind -declare i32 @"std::array::list.int.List__popFirst"(%List*) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__removeAt"(%List*, i64) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__pushFront"(%List*, i32) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__insertAt"(%List*, i64, i32) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__removeLast"(%List*) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__removeFirst"(%List*) #0 - -; Function Attrs: nounwind -declare i32* @"std::array::list.int.List__first"(%List*) #0 - -; Function Attrs: nounwind -declare i32* @"std::array::list.int.List__last"(%List*) #0 - -; Function Attrs: nounwind -declare zeroext i8 @"std::array::list.int.List__isEmpty"(%List*) #0 - -; Function Attrs: nounwind -declare i64 @"std::array::list.int.List__len"(%List*) #0 - -; Function Attrs: nounwind -declare i32 @"std::array::list.int.List__get"(%List*, i64) #0 - -; Function Attrs: nounwind -declare void @"std::array::list.int.List__free"(%List*) #0 - -; Function Attrs: nounwind -declare void @"std::array::linkedlist.int.LinkedList__push"(%LinkedList*, i32) #0 - -; Function Attrs: nounwind -declare void @LinkedList.linkFirst(%LinkedList*, i32) #0 - -; Function Attrs: nounwind -declare void @LinkedList.linkLast(%LinkedList*, i32) #0 - -; Function Attrs: nounwind -declare void @"std::array::linkedlist.int.LinkedList__free"(%LinkedList*) #0 - -; Function Attrs: nounwind -declare i64 @"std::array::linkedlist.int.LinkedList__len"(%LinkedList*) #0 - -; Function Attrs: nounwind -declare i32 @"std::array::linkedlist.int.LinkedList__get"(%LinkedList*, i64) #0 - -; Function Attrs: nounwind -declare void @LinkedList.linkBefore(%LinkedList*, %Node*, i32) #0 - -; Function Attrs: nounwind -declare void @LinkedList.unlinkLast(%LinkedList*, %Node*) #0 - -; Function Attrs: nounwind -declare void @LinkedList.unlink(%LinkedList*, %Node*) #0 - declare void @hello_world.hello() +declare void @"std::array::linkedlist.int.LinkedList__push"(%LinkedList*, i32) + +declare i64 @"std::array::linkedlist.int.LinkedList__len"(%LinkedList*) + +declare i32 @"std::array::linkedlist.int.LinkedList__get"(%LinkedList*, i64) + +declare void @"std::array::linkedlist.int.LinkedList__free"(%LinkedList*) + +declare void @"std::array::list.int.List__append"(%List*, i32) + +declare void @"std::array::list.int.List__push"(%List*, i32) + +declare void @"std::array::list.int.List__insertAt"(%List*, i64, i32) + +declare i64 @"std::array::list.int.List__len"(%List*) + +declare i32 @"std::array::list.int.List__get"(%List*, i64) + +declare void @"std::array::list.int.List__free"(%List*) + ; Function Attrs: nounwind define void @test.Foo2__printme(%Foo2* %0) #0 { entry: @@ -461,8 +406,6 @@ if.exit: ; preds = %entry ret i32 %6 } - - ; Function Attrs: nounwind define i32 @test.sum_us(%"int[]"* align 8 %0) #0 { entry: