Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4001542
instr-containers.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 9, 6:34 AM
Size
2 KB
Mime Type
text/x-c++
Expires
Sat, Jul 11, 6:34 AM (1 d, 3 h)
Engine
blob
Format
Raw Data
Handle
273428
Attached To
rXR Xreate
instr-containers.h
View Options
#ifndef CODEINSTRUCTIONS_H
#define CODEINSTRUCTIONS_H
#include "llvmlayer.h"
#include "ast.h"
#include <llvm/IR/Value.h>
#include <vector>
namespace xreate {
namespace containers {
class Instructions {
public:
Instructions(CodeScope *current, LLVMLayer* layer);
llvm::Value* compileIndex(const Symbol& dataSymbol, std::vector<llvm::Value*> indexes, std::string ident="");
llvm::Value* compileGetElement(std::string varIn, llvm::Value* stateLoop, std::string ident="");
/*
* - map Computation -> Llvm_Array: Prohibited, we do not know a result size
* - map Llvm_Array -> Computation: considered in `compileGetElement`
* - map Llvm_Array -> Llvm_Array considered by this method
*/
llvm::Value* compileMapArray(const Expression &expr, const std::string hintRetVar="");
llvm::Value* compileFold(const Expression& fold, const std::string& ident="");
llvm::Value* compileIf(const Expression& exprIf, const std::string& ident);
llvm::Value *compileConstantArray(const Expression &expr, const std::string& hintRetVar="");
private:
CodeScope* scope;
LLVMLayer* llvm;
llvm::IntegerType* const tyNum;
};
}}
#endif //CODEINSTRUCTIONS_H
/*
template<Operator Instruction>
struct InstructionClasses {};
template<>
struct InstructionClasses<Operator::LIST> {
typedef InstructionList Impl;
};
template<>
struct InstructionClasses<Operator::MAP> {
typedef InstructionMap Impl;
};
template<Operator Instruction>
class CodeInstruction: public InstructionClasses<Instruction>::Impl
{
typedef typename InstructionClasses<Instruction>::Impl InstructionImpl;
public:
CodeInstruction(CodeScope* parent)
: InstructionImpl(parent)
{}
llvm::Value *
compileExpression(const Expression &expr, LLVMLayer &l, const std::string * const hintRetVar)
{
if (expr.op == Instruction)
return InstructionImpl::compileDefault(expr, l, hintRetVar);
return CodeScope::compileExpression(expr, l, hintRetVar);
}
};
}
*/
Event Timeline
Log In to Comment