aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast/AST.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/ast/AST.cpp')
-rw-r--r--libsolidity/ast/AST.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp
index 1e1e4839..c5fb35f6 100644
--- a/libsolidity/ast/AST.cpp
+++ b/libsolidity/ast/AST.cpp
@@ -84,6 +84,16 @@ SourceUnitAnnotation& SourceUnit::annotation() const
return dynamic_cast<SourceUnitAnnotation&>(*m_annotation);
}
+vector<SourceUnit const*> SourceUnit::referencedSourceUnits() const
+{
+ vector<SourceUnit const*> sourceUnits;
+ for (ImportDirective const* importDirective: filteredNodes<ImportDirective>(nodes()))
+ {
+ sourceUnits.push_back(importDirective->annotation().sourceUnit);
+ }
+ return sourceUnits;
+}
+
SourceUnit const& Declaration::sourceUnit() const
{
solAssert(!!m_scope, "");