Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ docs/_build
#==============================================================================#
bindings/go/llvm/llvm_config.go
bindings/go/llvm/workdir
/.cmake_targets.txt
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See docs/CMake.html for instructions about how to build LLVM with CMake.
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.10)

if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
Expand Down Expand Up @@ -295,9 +295,13 @@ set(LLVM_ALL_TARGETS
# List of targets with JIT support:
set(LLVM_TARGETS_WITH_JIT X86 PowerPC AArch64 ARM Mips SystemZ)

set(LLVM_TARGETS_TO_BUILD "X86"
if(APPLE)
set(LLVM_TARGETS_TO_BUILD "AArch64;ARM"
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")

else()
set(LLVM_TARGETS_TO_BUILD "X86"
CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif()
set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "WebAssembly"
CACHE STRING "Semicolon-separated list of experimental targets to build.")

Expand Down
2 changes: 1 addition & 1 deletion docs/CMake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ and uses them to build a simple application ``simple-tool``.

.. code-block:: cmake

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.10)
project(SimpleProject)

find_package(LLVM REQUIRED CONFIG)
Expand Down
8 changes: 4 additions & 4 deletions lib/Transforms/SysioApply/SysioApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

using namespace llvm;

#define DEBUG_TYPE "eosio_apply"
#define DEBUG_TYPE "sysio_apply"
static cl::opt<std::string> entry_opt (
"entry",
cl::desc("Specify entry point")
Expand All @@ -40,14 +40,14 @@ namespace {
static char ID;
SysioApplyPass() : FunctionPass(ID) {}
bool runOnFunction(Function &F) override {
if (F.hasFnAttribute("eosio_wasm_entry") || F.getName().equals("apply")) {
if (F.hasFnAttribute("sysio_wasm_entry") || F.getName().equals("apply")) {
auto wasm_ctors = F.getParent()->getOrInsertFunction("__wasm_call_ctors", AttributeList{}, Type::getVoidTy(F.getContext()));
auto wasm_dtors = F.getParent()->getOrInsertFunction("__cxa_finalize", AttributeList{}, Type::getVoidTy(F.getContext()), Type::getInt32Ty(F.getContext()));

IRBuilder<> builder(&F.getEntryBlock());
builder.SetInsertPoint(&(F.getEntryBlock().front()));

auto set_contract = F.getParent()->getOrInsertFunction("eosio_set_contract_name", AttributeList{}, Type::getVoidTy(F.getContext()), Type::getInt64Ty(F.getContext()));
auto set_contract = F.getParent()->getOrInsertFunction("sysio_set_contract_name", AttributeList{}, Type::getVoidTy(F.getContext()), Type::getInt64Ty(F.getContext()));

CallInst* set_contract_call = builder.CreateCall(set_contract, {F.arg_begin()}, "");
if (const Function* F_ = dyn_cast<const Function>(set_contract.getCallee()->stripPointerCasts()))
Expand Down Expand Up @@ -75,7 +75,7 @@ namespace {
}

char SysioApplyPass::ID = 0;
static RegisterPass<SysioApplyPass> X("apply_fixup", "Eosio Apply Fixups");
static RegisterPass<SysioApplyPass> X("apply_fixup", "Sysio Apply Fixups");

static void registerSysioApplyPass(const PassManagerBuilder&, legacy::PassManagerBase& PM) { PM.add(new SysioApplyPass()); }
static RegisterStandardPasses RegisterMyPass(PassManagerBuilder::EP_EarlyAsPossible, registerSysioApplyPass);
24 changes: 12 additions & 12 deletions lib/Transforms/SysioSoftfloat/SysioSoftfloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

using namespace llvm;

#define DEBUG_TYPE "eosio_softfloat"
#define DEBUG_TYPE "sysio_softfloat"

namespace {
// SysioSoftfloat - Mutate the apply function as needed
Expand All @@ -38,44 +38,44 @@ namespace {
SysioSoftfloatPass() : FunctionPass(ID) {}

bool runOnFunction(Function &f) override {
auto f32add = f.getParent()->getOrInsertFunction("_eosio_f32_add", AttributeList{},
auto f32add = f.getParent()->getOrInsertFunction("_sysio_f32_add", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f32sub = f.getParent()->getOrInsertFunction("_eosio_f32_sub", AttributeList{},
auto f32sub = f.getParent()->getOrInsertFunction("_sysio_f32_sub", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f32mul = f.getParent()->getOrInsertFunction("_eosio_f32_mul", AttributeList{},
auto f32mul = f.getParent()->getOrInsertFunction("_sysio_f32_mul", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f32div = f.getParent()->getOrInsertFunction("_eosio_f32_div", AttributeList{},
auto f32div = f.getParent()->getOrInsertFunction("_sysio_f32_div", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f32rem = f.getParent()->getOrInsertFunction("_eosio_f32_rem", AttributeList{},
auto f32rem = f.getParent()->getOrInsertFunction("_sysio_f32_rem", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));

auto f64add = f.getParent()->getOrInsertFunction("_eosio_f64_add", AttributeList{},
auto f64add = f.getParent()->getOrInsertFunction("_sysio_f64_add", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f64sub = f.getParent()->getOrInsertFunction("_eosio_f64_sub", AttributeList{},
auto f64sub = f.getParent()->getOrInsertFunction("_sysio_f64_sub", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f64mul = f.getParent()->getOrInsertFunction("_eosio_f64_mul", AttributeList{},
auto f64mul = f.getParent()->getOrInsertFunction("_sysio_f64_mul", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f64div = f.getParent()->getOrInsertFunction("_eosio_f64_div", AttributeList{},
auto f64div = f.getParent()->getOrInsertFunction("_sysio_f64_div", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
auto f64rem = f.getParent()->getOrInsertFunction("_eosio_f64_rem", AttributeList{},
auto f64rem = f.getParent()->getOrInsertFunction("_sysio_f64_rem", AttributeList{},
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()),
Type::getFloatTy(f.getContext()));
Expand Down Expand Up @@ -148,7 +148,7 @@ namespace {
}

char SysioSoftfloatPass::ID = 0;
static RegisterPass<SysioSoftfloatPass> X("softfloat_fixup", "Eosio Softfloat Fixups");
static RegisterPass<SysioSoftfloatPass> X("softfloat_fixup", "Sysio Softfloat Fixups");

static void registerSysioSoftfloatPass(const PassManagerBuilder&, legacy::PassManagerBase& PM) { PM.add(new SysioSoftfloatPass()); }
static RegisterStandardPasses RegisterMyPass(PassManagerBuilder::EP_EarlyAsPossible, registerSysioSoftfloatPass);
4 changes: 2 additions & 2 deletions runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Setting CMake minimum required version should be at the very top of the file
# if this is the entry point.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.10)
project(Runtimes C CXX ASM)
endif()

Expand Down Expand Up @@ -56,7 +56,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
set_property(GLOBAL APPEND PROPERTY SUB_COMPONENTS ${name})
endfunction()

cmake_minimum_required(VERSION 3.4.3)
cmake_minimum_required(VERSION 3.10)
project(Runtimes C CXX ASM)

find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
Expand Down
2 changes: 1 addition & 1 deletion tools/lld
2 changes: 1 addition & 1 deletion utils/benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 2.8.12)
cmake_minimum_required (VERSION 3.10)

# Tell cmake 3.0+ that it's safe to clear the PROJECT_VERSION variable in the
# call to project() below.
Expand Down