@@ -3792,8 +3792,6 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
3792
3792
vectorize = true ;
3793
3793
} else if (name == " restriction" ) {
3794
3794
is_restriction = true ;
3795
- } else if (name == " with_goto" ) {
3796
- // TODO: Use goto attribute in function?
3797
3795
} else if (name == " inline" ) {
3798
3796
is_inline = true ;
3799
3797
} else if (name == " static" ) {
@@ -4336,8 +4334,6 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
4336
4334
4337
4335
public:
4338
4336
ASR::asr_t *asr;
4339
- std::map<std::string, std::tuple<int64_t , bool , Location>> goto_name2id;
4340
- int64_t gotoids;
4341
4337
std::vector<ASR::symbol_t *> do_loop_variables;
4342
4338
// Stores the name of imported functions and the modules they are imported from
4343
4339
std::map<std::string, std::string> imported_functions;
@@ -4347,13 +4343,12 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
4347
4343
bool main_module, std::map<int , ASR::symbol_t *> &ast_overload,
4348
4344
bool allow_implicit_casting_)
4349
4345
: CommonVisitor(al, lm, nullptr , diagnostics, main_module, ast_overload, " " , {}, allow_implicit_casting_),
4350
- asr{unit}, gotoids{ 0 }
4346
+ asr{unit}
4351
4347
{}
4352
4348
4353
4349
// Transforms statements to a list of ASR statements
4354
4350
// In addition, it also inserts the following nodes if needed:
4355
4351
// * ImplicitDeallocate
4356
- // * GoToTarget
4357
4352
// The `body` Vec must already be reserved
4358
4353
void transform_stmts (Vec<ASR::stmt_t *> &body, size_t n_body, AST::stmt_t **m_body) {
4359
4354
tmp = nullptr ;
@@ -4504,8 +4499,6 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
4504
4499
}
4505
4500
4506
4501
void visit_FunctionDef (const AST::FunctionDef_t &x) {
4507
- goto_name2id.clear ();
4508
- gotoids = 0 ;
4509
4502
SymbolTable *old_scope = current_scope;
4510
4503
ASR::symbol_t *t = current_scope->get_symbol (x.m_name );
4511
4504
if (ASR::is_a<ASR::Function_t>(*t)) {
@@ -4526,13 +4519,6 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
4526
4519
}
4527
4520
current_scope = old_scope;
4528
4521
tmp = nullptr ;
4529
-
4530
- for ( auto itr: goto_name2id ) {
4531
- if ( !std::get<1 >(itr.second ) ) {
4532
- throw SemanticError (" Label '" + itr.first + " ' is not defined in '"
4533
- + std::string (x.m_name ) + " '" , std::get<2 >(itr.second ));
4534
- }
4535
- }
4536
4522
}
4537
4523
4538
4524
void visit_Import (const AST::Import_t &x) {
@@ -5522,33 +5508,6 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
5522
5508
void visit_Attribute (const AST::Attribute_t &x) {
5523
5509
if (AST::is_a<AST::Name_t>(*x.m_value )) {
5524
5510
std::string value = AST::down_cast<AST::Name_t>(x.m_value )->m_id ;
5525
- if ( value == " label" ) {
5526
- std::string labelname = x.m_attr ;
5527
- if ( goto_name2id.find (labelname) == goto_name2id.end () ) {
5528
- goto_name2id[labelname] = std::make_tuple (gotoids, true , x.base .base .loc );
5529
- gotoids += 1 ;
5530
- } else if ( !std::get<1 >(goto_name2id[labelname]) ) {
5531
- goto_name2id[labelname] = std::make_tuple (
5532
- std::get<0 >(goto_name2id[labelname]),
5533
- true ,
5534
- std::get<2 >(goto_name2id[labelname])
5535
- );
5536
- }
5537
- int id = std::get<0 >(goto_name2id[labelname]);
5538
- tmp = ASR::make_GoToTarget_t (al, x.base .base .loc , id, x.m_attr );
5539
- return ;
5540
- }
5541
-
5542
- if (value == " goto" ){
5543
- std::string labelname = std::string (x.m_attr );
5544
- if ( goto_name2id.find (labelname) == goto_name2id.end () ) {
5545
- goto_name2id[labelname] = std::make_tuple (gotoids, false , x.base .base .loc );
5546
- gotoids += 1 ;
5547
- }
5548
- int id = std::get<0 >(goto_name2id[labelname]);
5549
- tmp = ASR::make_GoTo_t (al, x.base .base .loc , id, x.m_attr );
5550
- return ;
5551
- }
5552
5511
5553
5512
ASR::symbol_t *org_sym = current_scope->resolve_symbol (value);
5554
5513
if (!org_sym) {
0 commit comments