Skip to content

Commit

Permalink
fixed kind initialization in variable decl
Browse files Browse the repository at this point in the history
  • Loading branch information
ctaylor committed Apr 22, 2023
1 parent 19e6b10 commit bba78c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion backend/include/hpx/symboltypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ struct SymbolBase {
};

struct Symbol : public SymbolBase {
//std::optional<std::reference_wrapper<SymbolBase>> parent;
};

struct SymbolTable {
Expand Down
6 changes: 3 additions & 3 deletions backend/src/symbolbuildingvisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool SymbolBuildingVisitor::enter(const uast::AstNode * ast) {
break;
case asttags::Array:
{
if(sym.has_value() && sym->get().kind->index() < 1) {
if(sym.has_value() && !sym->get().kind.has_value()) {
sym->get().kind = std::make_shared<array_kind>();
std::get<std::shared_ptr<array_kind>>(*sym->get().kind)->kind =
std::make_shared<kind_node_type>(kind_node_type{});
Expand Down Expand Up @@ -247,7 +247,7 @@ bool SymbolBuildingVisitor::enter(const uast::AstNode * ast) {
}
else {
symstack.emplace_back(Symbol{{
std::make_optional<kind_types>(range_kind{{}}),
range_kind{},
std::string{"range_" + emitChapelLine(ast)},
{}, -1, false, symbolTable.symbolTableRef->id
}});
Expand Down Expand Up @@ -661,7 +661,7 @@ bool SymbolBuildingVisitor::enter(const uast::AstNode * ast) {
const bool cfg = dynamic_cast<Variable const*>(ast)->isConfig();

symstack.emplace_back(Symbol{{
std::make_optional<kind_types>(),
{},
std::string{dynamic_cast<NamedDecl const*>(ast)->name().c_str()},
{}, kindqual, cfg, symbolTable.symbolTableRef->id
}});
Expand Down

0 comments on commit bba78c3

Please sign in to comment.