Branch: refs/heads/main
Revision: 4ede1a8f22cd0debc3b865cba115cc0db6c87fb7
Author: benharsh
Link: Dyno: Various type converter improvements for c_ptr and parenless methods by benharsh · Pull Request #27227 · chapel-lang/chapel · GitHub
Log Message:
Dyno: Various type converter improvements for c_ptr and parenless methods (#27227)
This PR contains a variety of improvements encountered while working
towards resolution of ranges (in support of param loops, not included in
this PR), which necessitated the resolution of c_ptr and parenless
methods. The changes are as follows:
- Prevent a recursive issue with creating _new wrappers
- fix field indices to ignore type and param fields, and 'super' field
- implement param-indexing for varargs
- fix implementation of if-expressions with param conditionals
- correct UintType conversion
- elision of various type/param expressions
- allow extern type alias conversion
- support for explicit and implicit parenless methods
For c_ptr
in particular:
- Move 'saveGenericSubstitutions' logic into AggregateType method
- add 'convertAST' variant that takes a method tag, allowing more
fine-grained conversion as needed - make 'flattenPrimaryMethod' available to typed converter
- fix bug with returning references
- have 'convertAggregateDecl' check if it's already converted a type
This PR also adds a breakpoint in CHPL_ASSERT
to help with some lldb
scripts I've written to switch to the frame where CHPL_ASSERT
is
actually used. I was unable to get these scripts to work with
std::abort
.
[reviewed-by @DanilaFe]
Diff:
M compiler/AST/AggregateType.cpp
M compiler/include/AggregateType.h
M compiler/include/convert-uast.h
M compiler/passes/cleanup.cpp
M compiler/passes/convert-help.cpp
M compiler/passes/convert-help.h
M compiler/passes/convert-typed-uast.cpp
M compiler/passes/convert-uast.cpp
M compiler/resolution/cleanups.cpp
M frontend/lib/resolution/default-functions.cpp
M frontend/lib/util/assertions.cpp
M test/frontend/Print.chpl
A test/frontend/TestParenless.chpl
A test/frontend/TestParenless.good
A test/frontend/TestStandard.chpl
A test/frontend/TestStandard.good
M test/frontend/TestVarargs.chpl
M test/frontend/TestVarargs.good
A test/frontend/TestWidths.chpl
A test/frontend/TestWidths.good
https://github.com/chapel-lang/chapel/pull/27227.diff