From 423a4ac7a7074e139c4f4c2f786d6b71d1b0965e Mon Sep 17 00:00:00 2001 From: larryk85 Date: Thu, 19 Nov 2020 16:51:48 -0500 Subject: [PATCH 1/8] add support for auto fill in of contract --- lib/Transforms/EosioApply/EosioApply.cpp | 6 ++++++ tools/lld | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/EosioApply/EosioApply.cpp b/lib/Transforms/EosioApply/EosioApply.cpp index 3f06594d9505..28bf14a65e01 100644 --- a/lib/Transforms/EosioApply/EosioApply.cpp +++ b/lib/Transforms/EosioApply/EosioApply.cpp @@ -47,6 +47,12 @@ namespace { 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())); + + CallInst* set_contract_call = builder.CreateCall(set_contract, {F.arg_begin()}, ""); + if (const Function* F_ = dyn_cast(set_contract.getCallee()->stripPointerCasts())) + set_contract_call->setCallingConv(F_->getCallingConv()); + CallInst* wasm_ctor_call = builder.CreateCall(wasm_ctors, {}, ""); if (const Function* F_ = dyn_cast(wasm_ctors.getCallee()->stripPointerCasts())) wasm_ctor_call->setCallingConv(F_->getCallingConv()); diff --git a/tools/lld b/tools/lld index d8c5baf41bb4..bb2cbc7aca6f 160000 --- a/tools/lld +++ b/tools/lld @@ -1 +1 @@ -Subproject commit d8c5baf41bb4da5cc5c8525cc49f659180fb3c1f +Subproject commit bb2cbc7aca6f5aea8f439b7115fab287404e9f9f From 859187f0ecad267573ebaaa240491330211ffe75 Mon Sep 17 00:00:00 2001 From: Qing Yang Date: Tue, 30 Mar 2021 12:45:01 -0400 Subject: [PATCH 2/8] change git branch for submodule clang --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 3199caea1505..ee706af287da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,7 @@ [submodule "tools/clang"] path = tools/clang url = https://github.com/eosio/clang.git + branch = qy-read-only-action [submodule "tools/lld"] path = tools/lld url = https://github.com/eosio/lld.git From a14a183af1178567b76b78efabff8fbfe035b07a Mon Sep 17 00:00:00 2001 From: Qing Yang Date: Wed, 31 Mar 2021 22:41:00 -0400 Subject: [PATCH 3/8] update commit hash of clang submodule --- tools/clang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clang b/tools/clang index 65c99a019ef4..6ed535cee8e3 160000 --- a/tools/clang +++ b/tools/clang @@ -1 +1 @@ -Subproject commit 65c99a019ef4cffed9c5f68bdfd8079ab35f4289 +Subproject commit 6ed535cee8e399d4503235f4287feae57e8e68dd From 9363732253564cfc53a43745a9383462603446fe Mon Sep 17 00:00:00 2001 From: Qing Yang Date: Thu, 20 May 2021 22:44:58 -0400 Subject: [PATCH 4/8] bump clang to latest eosio branch --- tools/clang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/clang b/tools/clang index 6ed535cee8e3..6a2b43d5cb01 160000 --- a/tools/clang +++ b/tools/clang @@ -1 +1 @@ -Subproject commit 6ed535cee8e399d4503235f4287feae57e8e68dd +Subproject commit 6a2b43d5cb01f666af0dbfb31a3cbf2e17967909 From 725482725dcc73ea6c3921f4a02de8ca587ae3c7 Mon Sep 17 00:00:00 2001 From: Qing Yang Date: Thu, 20 May 2021 22:52:18 -0400 Subject: [PATCH 5/8] remove branch setting for clang --- .gitmodules | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index ee706af287da..3199caea1505 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "tools/clang"] path = tools/clang url = https://github.com/eosio/clang.git - branch = qy-read-only-action [submodule "tools/lld"] path = tools/lld url = https://github.com/eosio/lld.git From aadf0358ef0f3bf6c4c2abf2a14ae4de3aeee57d Mon Sep 17 00:00:00 2001 From: Huang-Ming Huang Date: Thu, 7 Oct 2021 12:40:34 -0500 Subject: [PATCH 6/8] fix compile crt0 --- lib/Transforms/EosioApply/EosioApply.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/EosioApply/EosioApply.cpp b/lib/Transforms/EosioApply/EosioApply.cpp index 28bf14a65e01..3550799fb48f 100644 --- a/lib/Transforms/EosioApply/EosioApply.cpp +++ b/lib/Transforms/EosioApply/EosioApply.cpp @@ -49,9 +49,11 @@ namespace { auto set_contract = F.getParent()->getOrInsertFunction("eosio_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(set_contract.getCallee()->stripPointerCasts())) - set_contract_call->setCallingConv(F_->getCallingConv()); + if (F.getName().equals("apply")) { + CallInst* set_contract_call = builder.CreateCall(set_contract, {F.arg_begin()}, ""); + if (const Function* F_ = dyn_cast(set_contract.getCallee()->stripPointerCasts())) + set_contract_call->setCallingConv(F_->getCallingConv()); + } CallInst* wasm_ctor_call = builder.CreateCall(wasm_ctors, {}, ""); if (const Function* F_ = dyn_cast(wasm_ctors.getCallee()->stripPointerCasts())) From ef22eb35f384e6e45189a893471d3762d2949fa4 Mon Sep 17 00:00:00 2001 From: Huang-Ming Huang Date: Fri, 8 Oct 2021 13:20:59 -0500 Subject: [PATCH 7/8] update lld --- tools/lld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lld b/tools/lld index bb2cbc7aca6f..238068579fb5 160000 --- a/tools/lld +++ b/tools/lld @@ -1 +1 @@ -Subproject commit bb2cbc7aca6f5aea8f439b7115fab287404e9f9f +Subproject commit 238068579fb50b25b5f3b5fded8b34561bbfe208 From bbcdf1d460ec2966d55168af131a5060b77f3b7a Mon Sep 17 00:00:00 2001 From: Huang-Ming Huang Date: Fri, 7 Jan 2022 19:39:00 +0000 Subject: [PATCH 8/8] fix eosio_set_contract_name function not found issue --- tools/lld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lld b/tools/lld index 238068579fb5..0b7dcedddfe8 160000 --- a/tools/lld +++ b/tools/lld @@ -1 +1 @@ -Subproject commit 238068579fb50b25b5f3b5fded8b34561bbfe208 +Subproject commit 0b7dcedddfe8a6c7499365349791f7003b4e7b0d