Merge pull request #2677 from ethereum/barecall

Rename Bare to Barecall
This commit is contained in:
Alex Beregszaszi 2017-08-01 11:06:37 +01:00 committed by GitHub
commit 7e07eb6eea
4 changed files with 12 additions and 12 deletions

View File

@ -1050,7 +1050,7 @@ void TypeChecker::endVisit(ExpressionStatement const& _statement)
{ {
auto kind = callType->kind(); auto kind = callType->kind();
if ( if (
kind == FunctionType::Kind::Bare || kind == FunctionType::Kind::BareCall ||
kind == FunctionType::Kind::BareCallCode || kind == FunctionType::Kind::BareCallCode ||
kind == FunctionType::Kind::BareDelegateCall kind == FunctionType::Kind::BareDelegateCall
) )

View File

@ -477,7 +477,7 @@ MemberList::MemberMap IntegerType::nativeMembers(ContractDefinition const*) cons
if (isAddress()) if (isAddress())
return { return {
{"balance", make_shared<IntegerType >(256)}, {"balance", make_shared<IntegerType >(256)},
{"call", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::Bare, true, false, true)}, {"call", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::BareCall, true, false, true)},
{"callcode", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::BareCallCode, true, false, true)}, {"callcode", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::BareCallCode, true, false, true)},
{"delegatecall", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::BareDelegateCall, true)}, {"delegatecall", make_shared<FunctionType>(strings(), strings{"bool"}, FunctionType::Kind::BareDelegateCall, true)},
{"send", make_shared<FunctionType>(strings{"uint"}, strings{"bool"}, FunctionType::Kind::Send)}, {"send", make_shared<FunctionType>(strings{"uint"}, strings{"bool"}, FunctionType::Kind::Send)},
@ -2178,7 +2178,7 @@ string FunctionType::identifier() const
case Kind::External: id += "external"; break; case Kind::External: id += "external"; break;
case Kind::CallCode: id += "callcode"; break; case Kind::CallCode: id += "callcode"; break;
case Kind::DelegateCall: id += "delegatecall"; break; case Kind::DelegateCall: id += "delegatecall"; break;
case Kind::Bare: id += "bare"; break; case Kind::BareCall: id += "barecall"; break;
case Kind::BareCallCode: id += "barecallcode"; break; case Kind::BareCallCode: id += "barecallcode"; break;
case Kind::BareDelegateCall: id += "baredelegatecall"; break; case Kind::BareDelegateCall: id += "baredelegatecall"; break;
case Kind::Creation: id += "creation"; break; case Kind::Creation: id += "creation"; break;
@ -2346,7 +2346,7 @@ unsigned FunctionType::sizeOnStack() const
unsigned size = 0; unsigned size = 0;
if (kind == Kind::External || kind == Kind::CallCode || kind == Kind::DelegateCall) if (kind == Kind::External || kind == Kind::CallCode || kind == Kind::DelegateCall)
size = 2; size = 2;
else if (kind == Kind::Bare || kind == Kind::BareCallCode || kind == Kind::BareDelegateCall) else if (kind == Kind::BareCall || kind == Kind::BareCallCode || kind == Kind::BareDelegateCall)
size = 1; size = 1;
else if (kind == Kind::Internal) else if (kind == Kind::Internal)
size = 1; size = 1;
@ -2405,7 +2405,7 @@ MemberList::MemberMap FunctionType::nativeMembers(ContractDefinition const*) con
case Kind::ECRecover: case Kind::ECRecover:
case Kind::SHA256: case Kind::SHA256:
case Kind::RIPEMD160: case Kind::RIPEMD160:
case Kind::Bare: case Kind::BareCall:
case Kind::BareCallCode: case Kind::BareCallCode:
case Kind::BareDelegateCall: case Kind::BareDelegateCall:
{ {
@ -2509,7 +2509,7 @@ bool FunctionType::isBareCall() const
{ {
switch (m_kind) switch (m_kind)
{ {
case Kind::Bare: case Kind::BareCall:
case Kind::BareCallCode: case Kind::BareCallCode:
case Kind::BareDelegateCall: case Kind::BareDelegateCall:
case Kind::ECRecover: case Kind::ECRecover:

View File

@ -838,7 +838,7 @@ public:
External, ///< external call using CALL External, ///< external call using CALL
CallCode, ///< external call using CALLCODE, i.e. not exchanging the storage CallCode, ///< external call using CALLCODE, i.e. not exchanging the storage
DelegateCall, ///< external call using DELEGATECALL, i.e. not exchanging the storage DelegateCall, ///< external call using DELEGATECALL, i.e. not exchanging the storage
Bare, ///< CALL without function hash BareCall, ///< CALL without function hash
BareCallCode, ///< CALLCODE without function hash BareCallCode, ///< CALLCODE without function hash
BareDelegateCall, ///< DELEGATECALL without function hash BareDelegateCall, ///< DELEGATECALL without function hash
Creation, ///< external call using CREATE Creation, ///< external call using CREATE

View File

@ -546,7 +546,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
case FunctionType::Kind::External: case FunctionType::Kind::External:
case FunctionType::Kind::CallCode: case FunctionType::Kind::CallCode:
case FunctionType::Kind::DelegateCall: case FunctionType::Kind::DelegateCall:
case FunctionType::Kind::Bare: case FunctionType::Kind::BareCall:
case FunctionType::Kind::BareCallCode: case FunctionType::Kind::BareCallCode:
case FunctionType::Kind::BareDelegateCall: case FunctionType::Kind::BareDelegateCall:
_functionCall.expression().accept(*this); _functionCall.expression().accept(*this);
@ -642,7 +642,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
TypePointers{}, TypePointers{},
strings(), strings(),
strings(), strings(),
FunctionType::Kind::Bare, FunctionType::Kind::BareCall,
false, false,
nullptr, nullptr,
false, false,
@ -973,7 +973,7 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess)
case FunctionType::Kind::DelegateCall: case FunctionType::Kind::DelegateCall:
case FunctionType::Kind::CallCode: case FunctionType::Kind::CallCode:
case FunctionType::Kind::Send: case FunctionType::Kind::Send:
case FunctionType::Kind::Bare: case FunctionType::Kind::BareCall:
case FunctionType::Kind::BareCallCode: case FunctionType::Kind::BareCallCode:
case FunctionType::Kind::BareDelegateCall: case FunctionType::Kind::BareDelegateCall:
case FunctionType::Kind::Transfer: case FunctionType::Kind::Transfer:
@ -1560,7 +1560,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
utils().moveToStackTop(gasValueSize, _functionType.selfType()->sizeOnStack()); utils().moveToStackTop(gasValueSize, _functionType.selfType()->sizeOnStack());
auto funKind = _functionType.kind(); auto funKind = _functionType.kind();
bool returnSuccessCondition = funKind == FunctionType::Kind::Bare || funKind == FunctionType::Kind::BareCallCode; bool returnSuccessCondition = funKind == FunctionType::Kind::BareCall || funKind == FunctionType::Kind::BareCallCode;
bool isCallCode = funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::CallCode; bool isCallCode = funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::CallCode;
bool isDelegateCall = funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::DelegateCall; bool isDelegateCall = funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::DelegateCall;
@ -1579,7 +1579,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
TypePointers parameterTypes = _functionType.parameterTypes(); TypePointers parameterTypes = _functionType.parameterTypes();
bool manualFunctionId = false; bool manualFunctionId = false;
if ( if (
(funKind == FunctionType::Kind::Bare || funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::BareDelegateCall) && (funKind == FunctionType::Kind::BareCall || funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::BareDelegateCall) &&
!_arguments.empty() !_arguments.empty()
) )
{ {