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