Skip to content

Commit

Permalink
Symbol Resolver Pass
Browse files Browse the repository at this point in the history
* added as pass data result the symbol table of the pass
  - related to ref sealangdotorg/sea#22
  • Loading branch information
ppaulweber committed Apr 5, 2017
1 parent a783234 commit 6a240df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/analyze/SymbolResolverPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "SymbolResolverPass.h"

#include "../Logger.h"
#include "../Namespace.h"
#include "../ast/RecursiveVisitor.h"

#include "../casm-ir/src/Builtin.h"
Expand Down Expand Up @@ -286,7 +285,7 @@ u1 SymbolResolverPass::run( libpass::PassResult& pr )
#endif

pr.setResult< SymbolResolverPass >(
libstdhl::make< Data >( specification ) );
libstdhl::make< Data >( specification, symTblVisitor.symboltable() ) );

return true;
}
Expand Down
13 changes: 12 additions & 1 deletion src/analyze/SymbolResolverPass.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "../analyze/AttributionPass.h"

#include "../Namespace.h"
#include "../ast/Specification.h"

namespace libcasm_fe
Expand All @@ -49,10 +50,20 @@ namespace libcasm_fe
public:
using Ptr = std::shared_ptr< Data >;

Data( const Ast::Specification::Ptr& specification )
Data( const Ast::Specification::Ptr& specification,
const Namespace::Ptr& symboltable )
: AttributionPass::Data( specification )
, m_symboltable( symboltable )
{
}

Namespace::Ptr symboltable( void ) const
{
return m_symboltable;
}

private:
Namespace::Ptr m_symboltable;
};
};
}
Expand Down

0 comments on commit 6a240df

Please sign in to comment.