Add domain specifier to variable declarations
With this change, the domain of variable declarations can be specified. Variables can have the integer domain, in which case additional integer- specific simplification rules apply. Aside from that, the noninteger domain represents precomputed values. An additional “unknown” domain is introduced to flag variable domains prior to determining whether they are integer or not.
This commit is contained in:
parent
921d5ed4f0
commit
541cb3fb47
@ -2,6 +2,7 @@
|
||||
#define __ANTHEM__AST_H
|
||||
|
||||
#include <anthem/ASTForward.h>
|
||||
#include <anthem/Utils.h>
|
||||
|
||||
namespace anthem
|
||||
{
|
||||
@ -369,6 +370,7 @@ struct VariableDeclaration
|
||||
VariableDeclaration &operator=(VariableDeclaration &&other) = default;
|
||||
|
||||
Type type;
|
||||
Domain domain{Domain::Unknown};
|
||||
std::string name;
|
||||
};
|
||||
|
||||
|
@ -33,6 +33,15 @@ enum class OperationResult
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum class Domain
|
||||
{
|
||||
Noninteger,
|
||||
Integer,
|
||||
Unknown,
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user