Browse Source

Mix changes after rebase

- @arkpar should take a look
cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
912b8569a4
  1. 8
      mix/CodeModel.cpp
  2. 3
      mix/CodeModel.h

8
mix/CodeModel.cpp

@ -77,15 +77,15 @@ namespace
{
IntegerType const* it = dynamic_cast<IntegerType const*>(_type);
unsigned size = it->getNumBits() / 8;
SolidityType::Type typeCode = it->isAddress() ? SolidityType::Type::Address : it->isHash() ? SolidityType::Type::Hash : it->isSigned() ? SolidityType::Type::SignedInteger : SolidityType::Type::UnsignedInteger;
SolidityType::Type typeCode = it->isAddress() ? SolidityType::Type::Address : it->isSigned() ? SolidityType::Type::SignedInteger : SolidityType::Type::UnsignedInteger;
return SolidityType { typeCode, size };
}
case Type::Category::Bool:
return SolidityType { SolidityType::Type::Bool, _type->getSizeOnStack() * 32 };
case Type::Category::String:
case Type::Category::FixedBytes:
{
StaticStringType const* s = dynamic_cast<StaticStringType const*>(_type);
return SolidityType { SolidityType::Type::String, static_cast<unsigned>(s->getNumBytes()) };
FixedBytesType const* s = dynamic_cast<FixedBytesType const*>(_type);
return SolidityType { SolidityType::Type::FixedBytes, static_cast<unsigned>(s->getNumBytes()) };
}
case Type::Category::Contract:
return SolidityType { SolidityType::Type::Address, _type->getSizeOnStack() * 32 };

3
mix/CodeModel.h

@ -72,10 +72,9 @@ struct SolidityType
{
SignedInteger,
UnsignedInteger,
Hash,
Bool,
Address,
String,
FixedBytes,
};
Type type;
unsigned size; //bytes

Loading…
Cancel
Save