mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions
m::wasm::ConstantFolding Struct Reference

Helper struct to perform constant folding at compile time. More...

#include <WasmDSL.hpp>

Public Types

enum  boolean_result_t { UNDEF , TRUE , FALSE }
 

Static Public Member Functions

static boolean_result_t EvalBoolean (const ::wasm::Expression *expr)
 Tries to evaluate the given boolean expression expr using constant folding.
 

Detailed Description

Helper struct to perform constant folding at compile time.

Definition at line 621 of file WasmDSL.hpp.

Member Enumeration Documentation

◆ boolean_result_t

Enumerator
UNDEF 
TRUE 
FALSE 

Definition at line 623 of file WasmDSL.hpp.

Member Function Documentation

◆ EvalBoolean()

ConstantFolding::boolean_result_t ConstantFolding::EvalBoolean ( const ::wasm::Expression *  expr)
static

Tries to evaluate the given boolean expression expr using constant folding.

Returns UNDEF if the expression cannot be evaluated at compile time, TRUE if the expression evaluates to true at compile time, and FALSE otherwise. Currently supported are only expressions consisting of a single boolean constant, a negation (tested using eqZ instruction) of a constant boolean expression, and conjunctions or disjunctions of constant boolean expressions. Expressions like x == x are currently not supported.

Definition at line 49 of file WasmDSL.cpp.

References CASE, EvalBoolean(), FALSE, M_insist, TRUE, and UNDEF.

Referenced by EvalBoolean(), and m::wasm::If::~If().


The documentation for this struct was generated from the following files: