You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
931 B
46 lines
931 B
10 years ago
|
|
||
|
#include "Type.h"
|
||
|
|
||
|
#include <llvm/IR/DerivedTypes.h>
|
||
|
|
||
10 years ago
|
namespace dev
|
||
|
{
|
||
|
namespace eth
|
||
|
{
|
||
|
namespace jit
|
||
10 years ago
|
{
|
||
|
|
||
10 years ago
|
llvm::IntegerType* Type::i256;
|
||
10 years ago
|
llvm::PointerType* Type::WordPtr;
|
||
10 years ago
|
llvm::IntegerType* Type::lowPrecision;
|
||
10 years ago
|
llvm::IntegerType* Type::Byte;
|
||
|
llvm::PointerType* Type::BytePtr;
|
||
10 years ago
|
llvm::Type* Type::Void;
|
||
10 years ago
|
llvm::IntegerType* Type::MainReturn;
|
||
10 years ago
|
|
||
|
void Type::init(llvm::LLVMContext& _context)
|
||
|
{
|
||
|
i256 = llvm::Type::getIntNTy(_context, 256);
|
||
10 years ago
|
WordPtr = i256->getPointerTo();
|
||
10 years ago
|
lowPrecision = llvm::Type::getInt64Ty(_context);
|
||
10 years ago
|
Byte = llvm::Type::getInt8Ty(_context);
|
||
|
BytePtr = Byte->getPointerTo();
|
||
10 years ago
|
Void = llvm::Type::getVoidTy(_context);
|
||
10 years ago
|
MainReturn = llvm::Type::getInt32Ty(_context);
|
||
|
}
|
||
|
|
||
10 years ago
|
llvm::ConstantInt* Constant::get(uint64_t _n)
|
||
10 years ago
|
{
|
||
|
return llvm::ConstantInt::get(Type::i256, _n);
|
||
|
}
|
||
|
|
||
10 years ago
|
llvm::ConstantInt* Constant::get(ReturnCode _returnCode)
|
||
10 years ago
|
{
|
||
|
return llvm::ConstantInt::get(Type::MainReturn, static_cast<uint64_t>(_returnCode));
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
}
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|