aboutsummaryrefslogtreecommitdiffstats
path: root/Compiler.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-16 05:57:39 +0800
committerChristian <c@ethdev.com>2014-12-17 06:49:45 +0800
commitb2e3771598c985afac1aa76b32e67ad2744f7cf1 (patch)
treef12c59f9bcfb85605c6f5cf1f9c348d0c545e174 /Compiler.h
parent5b802b685e794832bf8834183bf6c9604e513bbf (diff)
downloaddexon-solidity-b2e3771598c985afac1aa76b32e67ad2744f7cf1.tar
dexon-solidity-b2e3771598c985afac1aa76b32e67ad2744f7cf1.tar.gz
dexon-solidity-b2e3771598c985afac1aa76b32e67ad2744f7cf1.tar.bz2
dexon-solidity-b2e3771598c985afac1aa76b32e67ad2744f7cf1.tar.lz
dexon-solidity-b2e3771598c985afac1aa76b32e67ad2744f7cf1.tar.xz
dexon-solidity-b2e3771598c985afac1aa76b32e67ad2744f7cf1.tar.zst
dexon-solidity-b2e3771598c985afac1aa76b32e67ad2744f7cf1.zip
Add functions needed by constructor.
Diffstat (limited to 'Compiler.h')
-rw-r--r--Compiler.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Compiler.h b/Compiler.h
index 57e40cda..b30e85ae 100644
--- a/Compiler.h
+++ b/Compiler.h
@@ -38,10 +38,16 @@ public:
void streamAssembly(std::ostream& _stream) const { m_context.streamAssembly(_stream); }
private:
- /// Creates a new compiler context / assembly, packs the current code into the data part and
+ /// Registers the global objects and the non-function objects inside the contract with the context.
+ void initializeContext(ContractDefinition const& _contract, std::vector<MagicVariableDeclaration const*> const& _magicGlobals,
+ std::map<ContractDefinition const*, bytes const*> const& _contracts);
+ /// Adds the code that is run at creation time. Should be run after exchanging the run-time context
+ /// with a new and initialized context.
/// adds the constructor code.
- void packIntoContractCreator(ContractDefinition const& _contract,
- std::map<ContractDefinition const*, bytes const*> const& _contracts);
+ void packIntoContractCreator(ContractDefinition const& _contract, CompilerContext const& _runtimeContext);
+ void appendConstructorCall(FunctionDefinition const& _constructor);
+ /// Recursively searches the call graph and returns all functions needed by the constructor (including itself).
+ std::set<FunctionDefinition const*> getFunctionsNeededByConstructor(FunctionDefinition const& _constructor);
void appendFunctionSelector(ContractDefinition const& _contract);
/// Creates code that unpacks the arguments for the given function, from memory if
/// @a _fromMemory is true, otherwise from call data. @returns the size of the data in bytes.