diff options
author | Philip Herron <herron.philip@googlemail.com> | 2020-05-21 22:38:04 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2020-11-28 21:13:15 +0000 |
commit | bcfe32f59d624ab90990c2c00bfef0fc85f62430 (patch) | |
tree | afa2483714069bb997e00ffb4a07382cac1b3605 /gcc/rust/backend/rust-compile.h | |
parent | c37f46274613f72c3724c6c95bf78af32f316bd1 (diff) | |
download | gcc-bcfe32f59d624ab90990c2c00bfef0fc85f62430.zip gcc-bcfe32f59d624ab90990c2c00bfef0fc85f62430.tar.gz gcc-bcfe32f59d624ab90990c2c00bfef0fc85f62430.tar.bz2 |
This creates the initial design for the pass to compile to GIMPLE by managing blocks in the scope
Diffstat (limited to 'gcc/rust/backend/rust-compile.h')
-rw-r--r-- | gcc/rust/backend/rust-compile.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile.h b/gcc/rust/backend/rust-compile.h index 2bc77d1..045afbf 100644 --- a/gcc/rust/backend/rust-compile.h +++ b/gcc/rust/backend/rust-compile.h @@ -4,7 +4,7 @@ #include "rust-ast-full.h" #include "rust-ast-visitor.h" #include "rust-backend.h" -#include "scope.h" +#include "cscope.h" namespace Rust { namespace Compile { @@ -229,13 +229,18 @@ private: Backend *backend; // utils - bool compileVarDecl (AST::LetStmt *stmt, std::vector<Bvariable *> &vars); + bool compileVarDecl (Bfunction *fndecl, AST::LetStmt *stmt, + std::vector<Bvariable *> &vars); + + Bexpression *compileBooleanLiteral (std::string val); + Bexpression *compileFloatLiteral (std::string val, Location locus); + Bexpression *compileIntegerLiteral (std::string val, Location locus); // state - Analysis::Scope<AST::Type *> scope; - std::vector<AST::IdentifierPattern> patternBuffer; - ::Bfunction *currentFndecl; + Scope scope; ::Btype *translatedType; + std::vector<AST::IdentifierPattern> patternBuffer; + std::vector< ::Bexpression *> exprs; // careful these are the vectors we pass into the GCC middle-end std::vector< ::Btype *> type_decls; |