diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-11-16 13:54:43 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-11-16 14:09:23 +0000 |
commit | c47d5cbdee9b701fb7753b44530fcb51f80b20fa (patch) | |
tree | 2cd74fceb2f9cc92ae47988507fdf424fb3d3682 /gcc/alias.c | |
parent | 89e02f52d86c7120046236e654e49749c4b4ecb3 (diff) | |
download | gcc-c47d5cbdee9b701fb7753b44530fcb51f80b20fa.zip gcc-c47d5cbdee9b701fb7753b44530fcb51f80b20fa.tar.gz gcc-c47d5cbdee9b701fb7753b44530fcb51f80b20fa.tar.bz2 |
Initial support operator overloading on [lang = "add"]
This change incorporates a few changes.
1. Create new gcc/rust/backend/rust-compile-expr.cc to split out
implementation code
2. Create new type check context api calls:
- TypeCheckContext::lookup_operator_overload
- TypeCheckContext::insert_operator_overload
3. Update type checking for ArithmeticOrLogicalExpr to look for any
operator overloading
When we are looking for operator overloads we must look up the associated
lang item type for this paticular operation, to resolve the operation to
any known lang_items by looking up the specified lang_item to DefId. Then
we must probe for the lang_item candidate for this paticular lang_item
DefID to see if we can resolve it to a method call. Then based on the
autoderef rules in a MethodCallExpr we must verify that we don't end up
in a recursive operator overload by checking that the current context
is not the same as the actual operator overload for this type. Finally
we mark this expression as operator overload and setup everything as a
resolved MethodCallExpr.
Fixes #249
Diffstat (limited to 'gcc/alias.c')
0 files changed, 0 insertions, 0 deletions