Skip to content

Commit

Permalink
Define register types explicitly
Browse files Browse the repository at this point in the history
This allows to re-use these types outside of the `stack_frame` struct.
Also added some docs.
#180
  • Loading branch information
aleasims committed Mar 13, 2024
1 parent 7aac86b commit 0cfc420
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions include/nil/blueprint/stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,18 @@ namespace nil {

template<typename VarType>
struct stack_frame {
std::map<const llvm::Value *, VarType> scalars;
std::map<const llvm::Value *, std::vector<VarType>> vectors;
/// @brief Type representing scalar registers.
using scalar_regs = std::map<const llvm::Value *, VarType>;

/// @brief Type representing vector registers.
using vector_regs = std::map<const llvm::Value *, std::vector<VarType>>;

/// @brief Registers holding scalar values (integers, pointers, native fields).
scalar_regs scalars;

/// @brief Registers holding vector values (non-native fields, curves, vectors, etc.).
vector_regs vectors;

const llvm::CallInst *caller;
};

Expand Down

0 comments on commit 0cfc420

Please sign in to comment.