Skip to content

Commit

Permalink
Completed major refactoring of type resolution, ensuring unambiguity,…
Browse files Browse the repository at this point in the history
… improving speed by order of magnitude
  • Loading branch information
christerswahn committed Oct 23, 2017
1 parent 47e2d4c commit b0ee548
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
4 changes: 1 addition & 3 deletions proto/autotest/lib/equality_test.tx
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ type GenTest<L,R> {
Self.test_eq_val( left, same, diff );
Self.test_eq_ref( left, same, diff );
Self.test_eq_arr_cop( left, same, diff );
## TODO: Comparison of arrays of references doesn't work well due to duplicate type specialization generation,
## leading to is-a relationship test not always working.
##Self.test_eq_arr_ref( left, same, diff );
Self.test_eq_arr_ref( left, same, diff );
}
}

Expand Down
22 changes: 14 additions & 8 deletions proto/src/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,29 @@ Array object assignment, review and test semantics

Default initialization of array elements (at least if it's array of arrays)

Dynamic-length arrays tests - bounds checking, copying, etc - PARTIALLY DONE

Ensure VALUE type parameters are always correctly initialized



Ensure Ref<P> is-a Ref<Q> if P is-a Q



For VALUEs below a threshold (e.g. <= 4), coge-gen individual specializations for efficiency



Array initialization from sequence
arr := []Int( seq ); ## of type Sequencable<Int>
arr := [ seq... ];
arr := [ 0..2... ];

Auto-conversion of array initialization elements (literals; also from sequences?)

Dynamic-length arrays tests - bounds checking, copying, etc - PARTIALLY DONE

Support negative array indexing from array end

Ensure VALUE type parameters are always correctly initialized

Ensure Ref<P> is-a Ref<O> if P is-a O



Ensure fields are always initialized (with the default constructor if no init expr provided)
Expand All @@ -156,8 +164,6 @@ Implement advanced implicit constructor concept
Constructor initialization validation check: That each constructor properly initializes all members (without inlined initializers)


For VALUEs below a threshold (e.g. <= 4), coge-gen individual specializations for efficiency


Virtual dereferencing of abstract references for array subscripting, implicitly creating a reference to the element?
r : &Array; s : &Array;
Expand Down
9 changes: 8 additions & 1 deletion proto/src/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,14 @@ void TxDriver::add_source_file( const TxIdentifier& moduleName, const std::strin
}

int TxDriver::llvm_compile( const std::string& outputFileName ) {
this->genContext->generate_runtime_type_info();
try {
this->genContext->generate_runtime_type_info();
}
catch ( const codecheck_error& err ) {
LOG_DEBUG( (&_LOG), "Caught code check error generating runtime type info: " << err );
return 1;
}

this->genContext->declare_builtin_code();

int codegen_errors = 0;
Expand Down

0 comments on commit b0ee548

Please sign in to comment.