mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #6407 from ethereum/changeNamespace
Remove "using namespace" from header and move Instruction to dev::eth.
This commit is contained in:
@@ -241,7 +241,7 @@ vector<Declaration const*> NameAndTypeResolver::cleanedDeclarations(
|
||||
|
||||
void NameAndTypeResolver::warnVariablesNamedLikeInstructions()
|
||||
{
|
||||
for (auto const& instruction: c_instructions)
|
||||
for (auto const& instruction: dev::eth::c_instructions)
|
||||
{
|
||||
string const instructionName{boost::algorithm::to_lower_copy(instruction.first)};
|
||||
auto declarations = nameFromCurrentScope(instructionName, true);
|
||||
|
||||
@@ -108,11 +108,11 @@ public:
|
||||
|
||||
private:
|
||||
std::function<void(StateMutability, SourceLocation const&)> m_reportMutability;
|
||||
void checkInstruction(SourceLocation _location, solidity::Instruction _instruction)
|
||||
void checkInstruction(SourceLocation _location, dev::eth::Instruction _instruction)
|
||||
{
|
||||
if (eth::SemanticInformation::invalidInViewFunctions(_instruction))
|
||||
m_reportMutability(StateMutability::NonPayable, _location);
|
||||
else if (_instruction == Instruction::CALLVALUE)
|
||||
else if (_instruction == dev::eth::Instruction::CALLVALUE)
|
||||
m_reportMutability(StateMutability::Payable, _location);
|
||||
else if (eth::SemanticInformation::invalidInPureFunctions(_instruction))
|
||||
m_reportMutability(StateMutability::View, _location);
|
||||
|
||||
@@ -32,8 +32,9 @@
|
||||
|
||||
using namespace std;
|
||||
using namespace dev;
|
||||
using namespace dev::eth;
|
||||
using namespace langutil;
|
||||
using namespace solidity;
|
||||
using namespace dev::solidity;
|
||||
|
||||
void ArrayUtils::copyArrayToStorage(ArrayType const& _targetType, ArrayType const& _sourceType) const
|
||||
{
|
||||
|
||||
@@ -53,11 +53,9 @@
|
||||
|
||||
using namespace std;
|
||||
using namespace langutil;
|
||||
|
||||
namespace dev
|
||||
{
|
||||
namespace solidity
|
||||
{
|
||||
using namespace dev::eth;
|
||||
using namespace dev;
|
||||
using namespace dev::solidity;
|
||||
|
||||
void CompilerContext::addStateVariable(
|
||||
VariableDeclaration const& _declaration,
|
||||
@@ -554,6 +552,3 @@ void CompilerContext::FunctionCompilationQueue::startFunction(Declaration const&
|
||||
m_functionsToCompile.pop();
|
||||
m_alreadyCompiledFunctions.insert(&_function);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
|
||||
/// Append elements to the current instruction list and adjust @a m_stackOffset.
|
||||
CompilerContext& operator<<(eth::AssemblyItem const& _item) { m_asm->append(_item); return *this; }
|
||||
CompilerContext& operator<<(Instruction _instruction) { m_asm->append(_instruction); return *this; }
|
||||
CompilerContext& operator<<(dev::eth::Instruction _instruction) { m_asm->append(_instruction); return *this; }
|
||||
CompilerContext& operator<<(u256 const& _value) { m_asm->append(_value); return *this; }
|
||||
CompilerContext& operator<<(bytes const& _data) { m_asm->append(_data); return *this; }
|
||||
|
||||
|
||||
@@ -31,11 +31,9 @@
|
||||
|
||||
using namespace std;
|
||||
using namespace langutil;
|
||||
|
||||
namespace dev
|
||||
{
|
||||
namespace solidity
|
||||
{
|
||||
using namespace dev;
|
||||
using namespace dev::eth;
|
||||
using namespace dev::solidity;
|
||||
|
||||
unsigned const CompilerUtils::dataStartOffset = 4;
|
||||
size_t const CompilerUtils::freeMemoryPointer = 64;
|
||||
@@ -1414,6 +1412,3 @@ unsigned CompilerUtils::prepareMemoryStore(Type const& _type, bool _padToWords)
|
||||
|
||||
return numBytes;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
using namespace std;
|
||||
using namespace dev;
|
||||
using namespace langutil;
|
||||
using namespace dev::eth;
|
||||
using namespace dev::solidity;
|
||||
|
||||
namespace
|
||||
|
||||
@@ -39,11 +39,10 @@
|
||||
|
||||
using namespace std;
|
||||
using namespace langutil;
|
||||
using namespace dev;
|
||||
using namespace dev::eth;
|
||||
using namespace dev::solidity;
|
||||
|
||||
namespace dev
|
||||
{
|
||||
namespace solidity
|
||||
{
|
||||
|
||||
void ExpressionCompiler::compile(Expression const& _expression)
|
||||
{
|
||||
@@ -2269,6 +2268,3 @@ CompilerUtils ExpressionCompiler::utils()
|
||||
{
|
||||
return CompilerUtils(m_context);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
|
||||
using namespace std;
|
||||
using namespace dev;
|
||||
using namespace dev::eth;
|
||||
using namespace dev::solidity;
|
||||
using namespace langutil;
|
||||
using namespace solidity;
|
||||
|
||||
|
||||
StackVariable::StackVariable(CompilerContext& _compilerContext, VariableDeclaration const& _declaration):
|
||||
|
||||
@@ -239,7 +239,7 @@ Json::Value collectEVMObject(eth::LinkerObject const& _object, string const* _so
|
||||
{
|
||||
Json::Value output = Json::objectValue;
|
||||
output["object"] = _object.toHex();
|
||||
output["opcodes"] = solidity::disassemble(_object.bytecode);
|
||||
output["opcodes"] = dev::eth::disassemble(_object.bytecode);
|
||||
output["sourceMap"] = _sourceMap ? *_sourceMap : "";
|
||||
output["linkReferences"] = formatLinkReferences(_object.linkReferences);
|
||||
return output;
|
||||
|
||||
Reference in New Issue
Block a user