diff options
author | chriseth <c@ethdev.com> | 2016-03-02 05:56:39 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-03-30 08:37:00 +0800 |
commit | f0494307232e52dcc268f5f32d26cc89d7e98e3a (patch) | |
tree | 5a03eae3515eb50d67388e7d7d1193d016baaddf /libsolidity/ast | |
parent | 949b00ed591303c531ed8fa73087b710b7a554de (diff) | |
download | dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar.gz dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.tar.zst dexon-solidity-f0494307232e52dcc268f5f32d26cc89d7e98e3a.zip |
Code generation (missing external access and source locations).
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/AST.cpp | 7 | ||||
-rw-r--r-- | libsolidity/ast/AST.h | 15 | ||||
-rw-r--r-- | libsolidity/ast/ASTAnnotations.h | 11 |
3 files changed, 28 insertions, 5 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index b5affa8e..294daa13 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -363,6 +363,13 @@ StatementAnnotation& Statement::annotation() const return static_cast<StatementAnnotation&>(*m_annotation); } +InlineAssemblyAnnotation& InlineAssembly::annotation() const +{ + if (!m_annotation) + m_annotation = new InlineAssemblyAnnotation(); + return static_cast<InlineAssemblyAnnotation&>(*m_annotation); +} + ReturnAnnotation& Return::annotation() const { if (!m_annotation) diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index f53c78f2..7bb2529a 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -855,8 +855,11 @@ public: virtual StatementAnnotation& annotation() const override; }; -// Forward-declaration to InlineAssembly.h -class AsmData; +namespace assembly +{ +// Forward-declaration to AsmData.h +struct Block; +} /** * Inline assembly. @@ -867,16 +870,18 @@ public: InlineAssembly( SourceLocation const& _location, ASTPointer<ASTString> const& _docString, - std::shared_ptr<AsmData> const& _operations + std::shared_ptr<assembly::Block> const& _operations ): Statement(_location, _docString), m_operations(_operations) {} virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; - AsmData const& operations() const { return *m_operations; } + assembly::Block const& operations() const { return *m_operations; } + + virtual InlineAssemblyAnnotation& annotation() const override; private: - std::shared_ptr<AsmData> m_operations; + std::shared_ptr<assembly::Block> m_operations; }; /** diff --git a/libsolidity/ast/ASTAnnotations.h b/libsolidity/ast/ASTAnnotations.h index 235338bb..2a192e47 100644 --- a/libsolidity/ast/ASTAnnotations.h +++ b/libsolidity/ast/ASTAnnotations.h @@ -110,6 +110,17 @@ struct StatementAnnotation: ASTAnnotation, DocumentedAnnotation { }; +namespace assembly +{ +struct Identifier; // forward +} + +struct InlineAssemblyAnnotation: StatementAnnotation +{ + /// Mapping containing resolved references to external identifiers. + std::map<assembly::Identifier const*, Declaration const*> externalReferences; +}; + struct ReturnAnnotation: StatementAnnotation { /// Reference to the return parameters of the function. |