diff --git a/lib/Transforms/EosioApply/EosioApply.cpp b/lib/Transforms/EosioApply/EosioApply.cpp index 3f06594d9505..3550799fb48f 100644 --- a/lib/Transforms/EosioApply/EosioApply.cpp +++ b/lib/Transforms/EosioApply/EosioApply.cpp @@ -47,6 +47,14 @@ 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())); + + 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())) wasm_ctor_call->setCallingConv(F_->getCallingConv()); diff --git a/tools/clang b/tools/clang index 65c99a019ef4..6a2b43d5cb01 160000 --- a/tools/clang +++ b/tools/clang @@ -1 +1 @@ -Subproject commit 65c99a019ef4cffed9c5f68bdfd8079ab35f4289 +Subproject commit 6a2b43d5cb01f666af0dbfb31a3cbf2e17967909 diff --git a/tools/lld b/tools/lld index d8c5baf41bb4..0b7dcedddfe8 160000 --- a/tools/lld +++ b/tools/lld @@ -1 +1 @@ -Subproject commit d8c5baf41bb4da5cc5c8525cc49f659180fb3c1f +Subproject commit 0b7dcedddfe8a6c7499365349791f7003b4e7b0d