aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile.cc
diff options
context:
space:
mode:
authorSimplyTheOther <simplytheother@gmail.com>2020-11-12 22:22:41 +0800
committerSimplyTheOther <simplytheother@gmail.com>2020-12-08 21:10:28 +0800
commitf5ae2781823b3a2bcded1ac3446de83cc52403a9 (patch)
treee90b9876a23cd40e0da140aa62fb220ef22dfd58 /gcc/rust/backend/rust-compile.cc
parent37bbf2b8cbd4578f0fbe7cbbd573493481f62a45 (diff)
downloadgcc-f5ae2781823b3a2bcded1ac3446de83cc52403a9.zip
gcc-f5ae2781823b3a2bcded1ac3446de83cc52403a9.tar.gz
gcc-f5ae2781823b3a2bcded1ac3446de83cc52403a9.tar.bz2
Added more expression stripping
Fixed compile errors and started on enum expr stripping
Diffstat (limited to 'gcc/rust/backend/rust-compile.cc')
-rw-r--r--gcc/rust/backend/rust-compile.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 0589347..ca310ca 100644
--- a/gcc/rust/backend/rust-compile.cc
+++ b/gcc/rust/backend/rust-compile.cc
@@ -538,7 +538,7 @@ Compilation::visit (AST::StructExprFieldIdentifierValue &field)
bool found = false;
for (auto &df : decl->get_fields ())
{
- if (field.field_name.compare (df.field_name) == 0)
+ if (field.get_field_name ().compare (df.field_name) == 0)
{
found = true;
break;
@@ -546,16 +546,16 @@ Compilation::visit (AST::StructExprFieldIdentifierValue &field)
}
if (!found)
{
- rust_fatal_error (field.value->get_locus_slow (),
+ rust_fatal_error (field.get_value ()->get_locus_slow (),
"failed to lookup field index");
return;
}
Bexpression *value = NULL;
- VISIT_POP (field.value->get_locus_slow (), field.value.get (), value, exprs);
+ VISIT_POP (field.get_value ()->get_locus_slow (), field.get_value ().get (), value, exprs);
if (value == NULL)
{
- rust_fatal_error (field.value->get_locus_slow (),
+ rust_fatal_error (field.get_value ()->get_locus_slow (),
"failed to compile value to struct");
return;
}
@@ -566,10 +566,10 @@ void
Compilation::visit (AST::StructExprFieldIndexValue &field)
{
Bexpression *value = NULL;
- VISIT_POP (field.value->get_locus_slow (), field.value.get (), value, exprs);
+ VISIT_POP (field.get_value ()->get_locus_slow (), field.get_value ().get (), value, exprs);
if (value == NULL)
{
- rust_fatal_error (field.value->get_locus_slow (),
+ rust_fatal_error (field.get_value ()->get_locus_slow (),
"failed to compile value to struct");
return;
}
@@ -598,7 +598,7 @@ Compilation::visit (AST::StructExprStructFields &expr)
// FIXME type resolution pass should ensures these are in correct order
// and have defaults if required
- for (auto &field : expr.fields)
+ for (auto &field : expr.get_fields ())
{
Bexpression *value = NULL;
VISIT_POP (expr.get_locus (), field, value, exprs);
@@ -1332,7 +1332,7 @@ Compilation::visit (AST::LetStmt &stmt)
void
Compilation::visit (AST::ExprStmtWithoutBlock &stmt)
{
- stmt.expr->accept_vis (*this);
+ stmt.get_expr ()->accept_vis (*this);
}
void
@@ -1348,7 +1348,7 @@ Compilation::visit (AST::ExprStmtWithBlock &stmt)
start_location, end_location);
scope.PushBlock (code_block);
- stmt.expr->accept_vis (*this);
+ stmt.get_expr ()->accept_vis (*this);
// get trailing if required
for (auto &s : stmts)