cleanup/container_not_context_container
vardec_varass_dependency
feature/resolver_proxies
bugfix/handle_param_count_arg_mismatch
cleanup/pushback_removal
cleanup/path_trail_deps
cleanup/variable_in_variable_ass
feature/container_update_1
feature/aliases
cleanup/context_drop_container
cleanup/depgen_root_removal
feature/modifiers
bugfix/dgen_expressionless_returns
cleanup/remove_dnodegeneratorbase
feature/comments
feature/operator_precedence
feature/reporting
bugfix/single_line_comment_bug
feature/logging_upgrade
feature/multi_module
feature/unused_vars_detection
feature/container_methods
feature/strat_resolve_collectors
feature/predicate_based_resolver
feature/poolmngr
hotfix/func_defs_in_dep_generator
feature/lexer_improvements
feature/structs
feature/behavec_preinline
bugfix/fix_multi_compile
master
feature/annotations
hotfix/simply_varexp_dnode_generation
hotfix/jcli_upgrade_fix
feature/class_static_init
feature/universal_coercion
feature/cloneability
hotfix/expect_exception_change
bugfix/recursive_return_statement_check
bugfix/require_return
bugfix/return_type
feature/cleanup1
feature/clean_lexer_interface
research/gmalloc
feature/type_enforcer_cast_instr_emit
feature/meta_programming
feature/direct_func_call
bugfix/return_position
bugfix/is_same_type_fallback
feature/lexer_interface
feature/parser_interface
arrays
pointers
bugfix/function_parameter_type_parse
casting
literal_encodings
extern_symbols
compiler_object
uniform_stdalone_varass
remove_typequeue
linearizer_cleanup
parsetypedev_fix
modules
loops
conditionals
vdva_func_param_merge
function_parameters_fix
path_dependency
function_dep
parser
compiler_levels
develop
constants_float
constants
typecheck
deps_refactor
weighting
typecheck_refactor_varexp_makeacyclic
lexer
codegen
testing_thing
typecheck_refactor_varexp
typecheck_refactor
typecheck_codegen_educedparseclass
typecheck_codegen
type_check_codegen_reducedparseclass_excep
typecheck_reliancetree
static_support
codegen.sync-conflict-20210606-150925-O3W7KWN
typecheck.sync-conflict-20210606-150925-O3W7KWN
struct_support
develop.sync-conflict-20210606-150924-O3W7KWN
symbol_table
entity_declaration_type_checking
parser.sync-conflict-20210405-185821-O3W7KWN
parser_exception_before
develop_before_lexer_parser_merge_parseName
if_statement_parsing
exception_except
master.sync-conflict-20210316-165421-O3W7KWN
expression_parsing
expression_parsing.sync-conflict-20210316-090018-O3W7KWN
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.0
v0.2.0
v0.1.0
v0.0.5
v0.0.4
v0.0.3
v0.0.2
v0.0.1
pointers_coerce
pointer_cast_merge
parsetypeddeclaration_onlytype_parsecast_new
multimodule/changeset2
multimodule/changeset1
${ noResults }
1 Commits (master)
Author | SHA1 | Message | Date |
---|---|---|---|
Tristan B. V. Kildaire |
493da1a4e7
|
Pointer support (#2)
* Make branches not identical * Removed temporary file * Typecheck - Added `attemptPointerAriehmeticCoercion(Value, Value)` * Typechecker - Moved `attemptPointerAriehmeticCoercion(Value, Value)` to class-level and made privately accessible * Test cases - Added pointer arithmetic in the form of `*(ptr+0)` to `simple_pointer.t` to start testing it out * Typechecker - When handling `BinaryOperatorExpression` call `attemptPointerAriehmeticCoercion(Value, Value)` with both `(vLhsInstr, vRhsInstr)` before we call `vLhsInstr.getInstrType()` and `vRhsInstr.getInstrType()` before `isSameType(vLhsType, vRhsType)`. By doing so we attempt to coerce the types of both instructions if one is a pointer and another is an integer, else do nothing * DGen - When emitting for `PointerDereferenceAssignmentInstruction` we didn't wrap `<expr>` with `()`. So instead of `*(<expre>)` we got `*<expr>` which doesn't work if you're doing pointer arithmetic * Test cases - Added `simple_pointer_cast.t` to test casting (currently broken parsing-wise) DGen - Added a todo for semantic tests for the `simple_pointer_cast.t` test case * Parser - Added a TODO - we need a `parseType()` * Test cases - Removed `simple_cast_complex_type.t` as it is wrong, syntax wise * Test cases - Removed coercion usage, I am only testing the casting here (explicit) * Test cases - Removed `simple_pointer_cast.t` and replace it with `simple_pointer_cast_le.t` which casts the integer pointer to a byte pointer and sets the lowest significant byte (little endian hence at base of integer) to `2+2` DGen - Added semantic test for `simple_pointer_cast_le.t` * Test cases - Update `simple_pointer_cast_le.t` to do some pointer airthmetic at the byte-level of the 32-bit integer DGen - Updated the semantic test code generation for `simple_pointer_cast_le.t` to check for new values * Added 'simple_pointer_cast_le.t' to Emit tests * TypeChecker - Update `isSameType(Type t1, Type t2)` to now handle pointers explicitly and in a recursive manner based on their referred types - This check occurs before the `Integer` type check therefore following the rule of most specific types to least * Test cases - Added new test case `simple_pointer_malloc.t` - Added semantic code test generation for `simple_pointer_malloc.t` - Added `malloc_test.sh` to compile and generate `mem.o` from `mem.c` to link it then with `simple_pointer_malloc.t` - Added `mem.c` external C file to generate the required `mem.o` for linking against `simple_pointer_malloc.t` * Test cases - Updated `malloc_test.sh` to look for any `brk()` system calls and fixed its interpreter path |
1 year ago |