Browse Source

Merge commit '4d2dc802e8b2a69b72fd93eff21bc42651536a8d' into evmjit

Conflicts:
	evmjit/libevmjit/Arith256.cpp
	evmjit/libevmjit/ExecutionEngine.cpp
	evmjit/libevmjit/Runtime.h
cl-refactor
Paweł Bylica 10 years ago
parent
commit
a2e7dca4c6
  1. 2
      evmjit/CMakeLists.txt
  2. 9
      evmjit/libevmjit/Arith256.cpp
  3. 1
      evmjit/libevmjit/Arith256.h
  4. 5
      evmjit/libevmjit/BasicBlock.cpp
  5. 4
      evmjit/libevmjit/BasicBlock.h
  6. 12
      evmjit/libevmjit/Cache.cpp
  7. 4
      evmjit/libevmjit/Cache.h
  8. 1
      evmjit/libevmjit/Common.h
  9. 29
      evmjit/libevmjit/Compiler.cpp
  10. 1
      evmjit/libevmjit/Compiler.h
  11. 98
      evmjit/libevmjit/CompilerHelper.cpp
  12. 154
      evmjit/libevmjit/CompilerHelper.h
  13. 77
      evmjit/libevmjit/Endianness.cpp
  14. 50
      evmjit/libevmjit/Endianness.h
  15. 1
      evmjit/libevmjit/ExecStats.cpp
  16. 4
      evmjit/libevmjit/ExecStats.h
  17. 25
      evmjit/libevmjit/ExecutionEngine.cpp
  18. 4
      evmjit/libevmjit/ExecutionEngine.h
  19. 9
      evmjit/libevmjit/Ext.cpp
  20. 4
      evmjit/libevmjit/Ext.h
  21. 8
      evmjit/libevmjit/GasMeter.cpp
  22. 1
      evmjit/libevmjit/GasMeter.h
  23. 1
      evmjit/libevmjit/Instruction.h
  24. 9
      evmjit/libevmjit/Memory.cpp
  25. 1
      evmjit/libevmjit/Memory.h
  26. 1
      evmjit/libevmjit/Runtime.cpp
  27. 79
      evmjit/libevmjit/Runtime.h
  28. 1
      evmjit/libevmjit/RuntimeData.h
  29. 1
      evmjit/libevmjit/RuntimeManager.h
  30. 7
      evmjit/libevmjit/Stack.cpp
  31. 1
      evmjit/libevmjit/Stack.h
  32. 3
      evmjit/libevmjit/Type.h
  33. 3
      evmjit/libevmjit/Utils.h
  34. 8
      evmjit/libevmjit/preprocessor/llvm_includes_end.h
  35. 13
      evmjit/libevmjit/preprocessor/llvm_includes_start.h

2
evmjit/CMakeLists.txt

@ -7,7 +7,7 @@ set(CMAKE_AUTOMOC OFF)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
else()
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra")
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wconversion")
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")

9
evmjit/libevmjit/Arith256.cpp

@ -1,13 +1,14 @@
#include "Arith256.h"
#include "Type.h"
#include "Endianness.h"
#include <iostream>
#include <iomanip>
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
#include <iostream>
#include <iomanip>
#include "Type.h"
#include "Endianness.h"
namespace dev
{

1
evmjit/libevmjit/Arith256.h

@ -1,4 +1,5 @@
#pragma once
#include "CompilerHelper.h"
namespace dev

5
evmjit/libevmjit/BasicBlock.cpp

@ -1,5 +1,6 @@
#include "BasicBlock.h"
#include "Type.h"
#include <iostream>
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/CFG.h>
@ -9,7 +10,7 @@
#include <llvm/Support/raw_os_ostream.h>
#include "preprocessor/llvm_includes_end.h"
#include <iostream>
#include "Type.h"
namespace dev
{

4
evmjit/libevmjit/BasicBlock.h

@ -1,7 +1,9 @@
#pragma once
#include <vector>
#include "Common.h"
#include "Stack.h"
#include <vector>
namespace dev
{

12
evmjit/libevmjit/Cache.cpp

@ -1,5 +1,7 @@
#include "Cache.h"
#include "ExecutionEngine.h"
#include <iostream>
#include <cassert>
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/Module.h>
@ -10,8 +12,8 @@
#include <llvm/Support/raw_os_ostream.h>
#include "preprocessor/llvm_includes_end.h"
#include <cassert>
#include <iostream>
#include "ExecutionEngine.h"
#include "Utils.h"
namespace dev
{
@ -42,7 +44,9 @@ std::unique_ptr<llvm::Module> Cache::getObject(std::string const& id)
g_listener->stateChanged(ExecState::CacheLoad);
CACHE_LOG << id << ": search\n";
assert(!g_lastObject);
if (!CHECK(!g_lastObject))
g_lastObject = nullptr;
llvm::SmallString<256> cachePath;
llvm::sys::path::system_temp_directory(false, cachePath);
llvm::sys::path::append(cachePath, "evm_objs", id);

4
evmjit/libevmjit/Cache.h

@ -1,7 +1,9 @@
#pragma once
#include <llvm/ExecutionEngine/ObjectCache.h>
#include <memory>
#include <llvm/ExecutionEngine/ObjectCache.h>
namespace dev
{
namespace eth

1
evmjit/libevmjit/Common.h

@ -1,4 +1,5 @@
#pragma once
#include <vector>
#include <tuple>
#include <cstdint>

29
evmjit/libevmjit/Compiler.cpp

@ -1,14 +1,9 @@
#include "Compiler.h"
#include "Instruction.h"
#include "Type.h"
#include "Memory.h"
#include "Stack.h"
#include "Ext.h"
#include "GasMeter.h"
#include "Utils.h"
#include "Endianness.h"
#include "Arith256.h"
#include "RuntimeManager.h"
#include <functional>
#include <fstream>
#include <chrono>
#include <sstream>
#include "preprocessor/llvm_includes_start.h"
#include <llvm/ADT/PostOrderIterator.h>
@ -20,10 +15,16 @@
#include <llvm/Transforms/Scalar.h>
#include "preprocessor/llvm_includes_end.h"
#include <functional>
#include <fstream>
#include <chrono>
#include <sstream>
#include "Instruction.h"
#include "Type.h"
#include "Memory.h"
#include "Stack.h"
#include "Ext.h"
#include "GasMeter.h"
#include "Utils.h"
#include "Endianness.h"
#include "Arith256.h"
#include "RuntimeManager.h"
namespace dev
{

1
evmjit/libevmjit/Compiler.h

@ -1,4 +1,5 @@
#pragma once
#include "Common.h"
#include "BasicBlock.h"

98
evmjit/libevmjit/CompilerHelper.cpp

@ -1,47 +1,51 @@
#include "CompilerHelper.h"
#include "RuntimeManager.h"
#include <llvm/IR/Module.h>
namespace dev
{
namespace eth
{
namespace jit
{
CompilerHelper::CompilerHelper(llvm::IRBuilder<>& _builder) :
m_builder(_builder)
{}
llvm::Module* CompilerHelper::getModule()
{
assert(m_builder.GetInsertBlock());
assert(m_builder.GetInsertBlock()->getParent()); // BB must be in a function
return m_builder.GetInsertBlock()->getParent()->getParent();
}
llvm::Function* CompilerHelper::getMainFunction()
{
// TODO: Rename or change semantics of getMainFunction() function
assert(m_builder.GetInsertBlock());
auto mainFunc = m_builder.GetInsertBlock()->getParent();
assert(mainFunc);
if (mainFunc == &mainFunc->getParent()->getFunctionList().front()) // Main function is the first one in module
return mainFunc;
return nullptr;
}
llvm::CallInst* CompilerHelper::createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args)
{
return getBuilder().CreateCall(_func, {_args.begin(), _args.size()});
}
RuntimeHelper::RuntimeHelper(RuntimeManager& _runtimeManager):
CompilerHelper(_runtimeManager.getBuilder()),
m_runtimeManager(_runtimeManager)
{}
}
}
}
#include "CompilerHelper.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/Module.h>
#include "preprocessor/llvm_includes_end.h"
#include "RuntimeManager.h"
namespace dev
{
namespace eth
{
namespace jit
{
CompilerHelper::CompilerHelper(llvm::IRBuilder<>& _builder) :
m_builder(_builder)
{}
llvm::Module* CompilerHelper::getModule()
{
assert(m_builder.GetInsertBlock());
assert(m_builder.GetInsertBlock()->getParent()); // BB must be in a function
return m_builder.GetInsertBlock()->getParent()->getParent();
}
llvm::Function* CompilerHelper::getMainFunction()
{
// TODO: Rename or change semantics of getMainFunction() function
assert(m_builder.GetInsertBlock());
auto mainFunc = m_builder.GetInsertBlock()->getParent();
assert(mainFunc);
if (mainFunc == &mainFunc->getParent()->getFunctionList().front()) // Main function is the first one in module
return mainFunc;
return nullptr;
}
llvm::CallInst* CompilerHelper::createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args)
{
return getBuilder().CreateCall(_func, {_args.begin(), _args.size()});
}
RuntimeHelper::RuntimeHelper(RuntimeManager& _runtimeManager):
CompilerHelper(_runtimeManager.getBuilder()),
m_runtimeManager(_runtimeManager)
{}
}
}
}

154
evmjit/libevmjit/CompilerHelper.h

@ -1,79 +1,79 @@
#pragma once
#pragma once
#include "preprocessor/llvm_includes_start.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IRBuilder.h>
#include "preprocessor/llvm_includes_end.h"
namespace dev
{
namespace eth
{
namespace jit
{
class RuntimeManager;
/// Base class for compiler helpers like Memory, GasMeter, etc.
class CompilerHelper
{
protected:
CompilerHelper(llvm::IRBuilder<>& _builder);
CompilerHelper(const CompilerHelper&) = delete;
CompilerHelper& operator=(CompilerHelper) = delete;
/// Reference to the IR module being compiled
llvm::Module* getModule();
/// Reference to the main module function
llvm::Function* getMainFunction();
/// Reference to parent compiler IR builder
llvm::IRBuilder<>& m_builder;
llvm::IRBuilder<>& getBuilder() { return m_builder; }
llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args);
friend class RuntimeHelper;
};
/// Compiler helper that depends on runtime data
class RuntimeHelper : public CompilerHelper
{
protected:
RuntimeHelper(RuntimeManager& _runtimeManager);
RuntimeManager& getRuntimeManager() { return m_runtimeManager; }
private:
RuntimeManager& m_runtimeManager;
};
/// Saves the insert point of the IR builder and restores it when destructed
struct InsertPointGuard
{
InsertPointGuard(llvm::IRBuilder<>& _builder) :
m_builder(_builder),
m_insertBB(m_builder.GetInsertBlock()),
m_insertPt(m_builder.GetInsertPoint())
{}
InsertPointGuard(const InsertPointGuard&) = delete;
void operator=(InsertPointGuard) = delete;
~InsertPointGuard()
{
m_builder.SetInsertPoint(m_insertBB, m_insertPt);
}
private:
llvm::IRBuilder<>& m_builder;
llvm::BasicBlock* m_insertBB;
llvm::BasicBlock::iterator m_insertPt;
};
}
}
}
#include "preprocessor/llvm_includes_end.h"
namespace dev
{
namespace eth
{
namespace jit
{
class RuntimeManager;
/// Base class for compiler helpers like Memory, GasMeter, etc.
class CompilerHelper
{
protected:
CompilerHelper(llvm::IRBuilder<>& _builder);
CompilerHelper(const CompilerHelper&) = delete;
CompilerHelper& operator=(CompilerHelper) = delete;
/// Reference to the IR module being compiled
llvm::Module* getModule();
/// Reference to the main module function
llvm::Function* getMainFunction();
/// Reference to parent compiler IR builder
llvm::IRBuilder<>& m_builder;
llvm::IRBuilder<>& getBuilder() { return m_builder; }
llvm::CallInst* createCall(llvm::Function* _func, std::initializer_list<llvm::Value*> const& _args);
friend class RuntimeHelper;
};
/// Compiler helper that depends on runtime data
class RuntimeHelper : public CompilerHelper
{
protected:
RuntimeHelper(RuntimeManager& _runtimeManager);
RuntimeManager& getRuntimeManager() { return m_runtimeManager; }
private:
RuntimeManager& m_runtimeManager;
};
/// Saves the insert point of the IR builder and restores it when destructed
struct InsertPointGuard
{
InsertPointGuard(llvm::IRBuilder<>& _builder) :
m_builder(_builder),
m_insertBB(m_builder.GetInsertBlock()),
m_insertPt(m_builder.GetInsertPoint())
{}
InsertPointGuard(const InsertPointGuard&) = delete;
void operator=(InsertPointGuard) = delete;
~InsertPointGuard()
{
m_builder.SetInsertPoint(m_insertBB, m_insertPt);
}
private:
llvm::IRBuilder<>& m_builder;
llvm::BasicBlock* m_insertBB;
llvm::BasicBlock::iterator m_insertPt;
};
}
}
}

77
evmjit/libevmjit/Endianness.cpp

@ -1,38 +1,39 @@
#include "Endianness.h"
#include "Type.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
namespace dev
{
namespace eth
{
namespace jit
{
llvm::Value* Endianness::bswapIfLE(llvm::IRBuilder<>& _builder, llvm::Value* _word)
{
union tester
{
unsigned int x;
unsigned char isLE;
};
if (tester{1}.isLE)
{
// FIXME: Disabled because of problems with BYTE
//if (auto constant = llvm::dyn_cast<llvm::ConstantInt>(_word))
// return _builder.getInt(constant->getValue().byteSwap());
// OPT: Cache func declaration?
auto bswapFunc = llvm::Intrinsic::getDeclaration(_builder.GetInsertBlock()->getParent()->getParent(), llvm::Intrinsic::bswap, Type::Word);
return _builder.CreateCall(bswapFunc, _word);
}
return _word;
}
}
}
}
#include "Endianness.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
#include "Type.h"
namespace dev
{
namespace eth
{
namespace jit
{
llvm::Value* Endianness::bswapIfLE(llvm::IRBuilder<>& _builder, llvm::Value* _word)
{
union tester
{
unsigned int x;
unsigned char isLE;
};
if (tester{1}.isLE)
{
// FIXME: Disabled because of problems with BYTE
//if (auto constant = llvm::dyn_cast<llvm::ConstantInt>(_word))
// return _builder.getInt(constant->getValue().byteSwap());
// OPT: Cache func declaration?
auto bswapFunc = llvm::Intrinsic::getDeclaration(_builder.GetInsertBlock()->getParent()->getParent(), llvm::Intrinsic::bswap, Type::Word);
return _builder.CreateCall(bswapFunc, _word);
}
return _word;
}
}
}
}

50
evmjit/libevmjit/Endianness.h

@ -1,25 +1,25 @@
#pragma once
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IRBuilder.h>
#include "preprocessor/llvm_includes_end.h"
namespace dev
{
namespace eth
{
namespace jit
{
struct Endianness
{
static llvm::Value* toBE(llvm::IRBuilder<>& _builder, llvm::Value* _word) { return bswapIfLE(_builder, _word); }
static llvm::Value* toNative(llvm::IRBuilder<>& _builder, llvm::Value* _word) { return bswapIfLE(_builder, _word); }
private:
static llvm::Value* bswapIfLE(llvm::IRBuilder<>& _builder, llvm::Value* _word);
};
}
}
}
#pragma once
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IRBuilder.h>
#include "preprocessor/llvm_includes_end.h"
namespace dev
{
namespace eth
{
namespace jit
{
struct Endianness
{
static llvm::Value* toBE(llvm::IRBuilder<>& _builder, llvm::Value* _word) { return bswapIfLE(_builder, _word); }
static llvm::Value* toNative(llvm::IRBuilder<>& _builder, llvm::Value* _word) { return bswapIfLE(_builder, _word); }
private:
static llvm::Value* bswapIfLE(llvm::IRBuilder<>& _builder, llvm::Value* _word);
};
}
}
}

1
evmjit/libevmjit/ExecStats.cpp

@ -1,4 +1,5 @@
#include "ExecStats.h"
#include <iostream>
#include <iomanip>
#include <cassert>

4
evmjit/libevmjit/ExecStats.h

@ -1,7 +1,9 @@
#pragma once
#include "ExecutionEngine.h"
#include <chrono>
#include "ExecutionEngine.h"
namespace dev
{
namespace eth

25
evmjit/libevmjit/ExecutionEngine.cpp

@ -1,9 +1,8 @@
#include "ExecutionEngine.h"
#include "Runtime.h"
#include "Compiler.h"
#include "Cache.h"
#include "ExecStats.h"
#include "BuildInfo.gen.h"
#include <array>
#include <cstdlib> // env options
#include <iostream>
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/Module.h>
@ -15,9 +14,12 @@
#include <llvm/Support/Host.h>
#include "preprocessor/llvm_includes_end.h"
#include <array>
#include <cstdlib> // env options
#include <iostream>
#include "Runtime.h"
#include "Compiler.h"
#include "Cache.h"
#include "ExecStats.h"
#include "Utils.h"
#include "BuildInfo.gen.h"
namespace dev
{
@ -97,7 +99,7 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env)
module->setTargetTriple(triple.str());
ee.reset(builder.create());
if (!ee)
if (!CHECK(ee))
return ReturnCode::LLVMConfigError;
module.release(); // Successfully created llvm::ExecutionEngine takes ownership of the module
ee->setObjectCache(objectCache);
@ -110,7 +112,7 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env)
auto entryFuncPtr = (EntryFuncPtr)ee->getFunctionAddress(mainFuncName);
if (!entryFuncPtr)
{
{
auto module = objectCache ? Cache::getObject(mainFuncName) : nullptr;
if (!module)
{
@ -126,7 +128,8 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env)
listener->stateChanged(ExecState::CodeGen);
entryFuncPtr = (EntryFuncPtr)ee->getFunctionAddress(mainFuncName);
}
assert(entryFuncPtr); //TODO: Replace it with safe exception
if (!CHECK(entryFuncPtr))
return ReturnCode::LLVMLinkError;
listener->stateChanged(ExecState::Execution);
auto returnCode = entryFuncPtr(&runtime);

4
evmjit/libevmjit/ExecutionEngine.h

@ -1,7 +1,9 @@
#pragma once
#include "RuntimeData.h"
#include <memory>
#include "RuntimeData.h"
namespace dev
{
namespace eth

9
evmjit/libevmjit/Ext.cpp

@ -1,13 +1,14 @@
#include "Ext.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
#include "RuntimeManager.h"
#include "Memory.h"
#include "Type.h"
#include "Endianness.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
namespace dev
{
namespace eth

4
evmjit/libevmjit/Ext.h

@ -1,7 +1,9 @@
#pragma once
#include "CompilerHelper.h"
#include <array>
#include "CompilerHelper.h"
namespace dev
{
namespace eth

8
evmjit/libevmjit/GasMeter.cpp

@ -1,11 +1,11 @@
#include "GasMeter.h"
#include "Ext.h"
#include "RuntimeManager.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
#include "Ext.h"
#include "RuntimeManager.h"
namespace dev
{

1
evmjit/libevmjit/GasMeter.h

@ -1,4 +1,5 @@
#pragma once
#include "CompilerHelper.h"
#include "Instruction.h"

1
evmjit/libevmjit/Instruction.h

@ -1,4 +1,5 @@
#pragma once
#include "Common.h"
namespace llvm

9
evmjit/libevmjit/Memory.cpp

@ -1,14 +1,15 @@
#include "Memory.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
#include "Type.h"
#include "Runtime.h"
#include "GasMeter.h"
#include "Endianness.h"
#include "RuntimeManager.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/IntrinsicInst.h>
#include "preprocessor/llvm_includes_end.h"
namespace dev
{
namespace eth

1
evmjit/libevmjit/Memory.h

@ -1,4 +1,5 @@
#pragma once
#include "CompilerHelper.h"
namespace dev

1
evmjit/libevmjit/Runtime.cpp

@ -1,4 +1,5 @@
#include "Runtime.h"
#include <cassert>
namespace dev

79
evmjit/libevmjit/Runtime.h

@ -1,39 +1,40 @@
#pragma once
#include "RuntimeData.h"
namespace dev
{
namespace eth
{
namespace jit
{
using StackImpl = std::vector<i256>;
using MemoryImpl = bytes;
class Runtime
{
public:
Runtime(RuntimeData* _data, Env* _env);
Runtime(const Runtime&) = delete;
Runtime& operator=(const Runtime&) = delete;
StackImpl& getStack() { return m_stack; }
MemoryImpl& getMemory() { return m_memory; }
bytes_ref getReturnData() const;
private:
RuntimeData& m_data; ///< Pointer to data. Expected by compiled contract.
Env& m_env; ///< Pointer to environment proxy. Expected by compiled contract.
void* m_currJmpBuf = nullptr; ///< Pointer to jump buffer. Expected by compiled contract.
byte* m_memoryData = nullptr;
i256 m_memorySize;
StackImpl m_stack;
MemoryImpl m_memory;
};
}
}
}
#pragma once
#include "RuntimeData.h"
namespace dev
{
namespace eth
{
namespace jit
{
using StackImpl = std::vector<i256>;
using MemoryImpl = bytes;
class Runtime
{
public:
Runtime(RuntimeData* _data, Env* _env);
Runtime(const Runtime&) = delete;
Runtime& operator=(const Runtime&) = delete;
StackImpl& getStack() { return m_stack; }
MemoryImpl& getMemory() { return m_memory; }
bytes_ref getReturnData() const;
private:
RuntimeData& m_data; ///< Pointer to data. Expected by compiled contract.
Env& m_env; ///< Pointer to environment proxy. Expected by compiled contract.
void* m_currJmpBuf = nullptr; ///< Pointer to jump buffer. Expected by compiled contract.
byte* m_memoryData = nullptr;
i256 m_memorySize;
StackImpl m_stack;
MemoryImpl m_memory;
};
}
}
}

1
evmjit/libevmjit/RuntimeData.h

@ -1,4 +1,5 @@
#pragma once
#include "Common.h"
namespace dev

1
evmjit/libevmjit/RuntimeManager.h

@ -1,4 +1,5 @@
#pragma once
#include "CompilerHelper.h"
#include "Type.h"
#include "RuntimeData.h"

7
evmjit/libevmjit/Stack.cpp

@ -1,8 +1,11 @@
#include "Stack.h"
#include "RuntimeManager.h"
#include "Runtime.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/Function.h>
#include "preprocessor/llvm_includes_end.h"
#include "RuntimeManager.h"
#include "Runtime.h"
namespace dev
{

1
evmjit/libevmjit/Stack.h

@ -1,4 +1,5 @@
#pragma once
#include "CompilerHelper.h"
namespace dev

3
evmjit/libevmjit/Type.h

@ -1,11 +1,12 @@
#pragma once
#include "Common.h"
#include "preprocessor/llvm_includes_start.h"
#include <llvm/IR/Type.h>
#include <llvm/IR/Constants.h>
#include "preprocessor/llvm_includes_end.h"
#include "Common.h"
namespace dev
{
namespace eth

3
evmjit/libevmjit/Utils.h

@ -16,6 +16,9 @@ struct JIT: public NoteChannel { static const char* name() { return "JIT"; } };
//#define clog(CHANNEL) std::cerr
#define clog(CHANNEL) std::ostream(nullptr)
// The same as assert, but expression is always evaluated and result returned
#define CHECK(expr) (assert(expr), expr)
}
}
}

8
evmjit/libevmjit/preprocessor/llvm_includes_end.h

@ -1,3 +1,5 @@
#pragma warning(pop)
#pragma GCC diagnostic pop
#if defined(_MSC_VER)
#pragma warning(pop)
#else
#pragma GCC diagnostic pop
#endif

13
evmjit/libevmjit/preprocessor/llvm_includes_start.h

@ -1,5 +1,8 @@
#pragma warning(push)
#pragma warning(disable: 4267 4244 4800)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4267 4244 4800)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wconversion"
#endif

Loading…
Cancel
Save