summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-02-28 16:50:51 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-21 20:41:52 (GMT)
commitf5a055c74c47bc2bb9e76ba0eab72eb0c5bdf3c4 (patch)
tree2fe0e735f9c45695660b44f1f7dd21ac33f0ecae /src
parent3b40cc53502afa476384b2c62ec6fee9f521b1fd (diff)
downloadCastXML-f5a055c74c47bc2bb9e76ba0eab72eb0c5bdf3c4.zip
CastXML-f5a055c74c47bc2bb9e76ba0eab72eb0c5bdf3c4.tar.gz
CastXML-f5a055c74c47bc2bb9e76ba0eab72eb0c5bdf3c4.tar.bz2
Output: Factor out start decl addition
Diffstat (limited to 'src')
-rw-r--r--src/Output.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Output.cxx b/src/Output.cxx
index bda9a97..bb09490 100644
--- a/src/Output.cxx
+++ b/src/Output.cxx
@@ -146,6 +146,9 @@ class ASTVisitor: public ASTVisitorBase
/** Allocate a dump node for a source file entry. */
unsigned int AddDumpFile(clang::FileEntry const* f);
+ /** Add a starting declaration for output. */
+ void AddStartDecl(clang::Decl const* d);
+
/** Queue leftover nodes that do not need complete output. */
void QueueIncompleteDumpNodes();
@@ -383,6 +386,12 @@ unsigned int ASTVisitor::AddDumpFile(clang::FileEntry const* f)
}
//----------------------------------------------------------------------------
+void ASTVisitor::AddStartDecl(clang::Decl const* d)
+{
+ this->AddDumpNode(d, true);
+}
+
+//----------------------------------------------------------------------------
void ASTVisitor::QueueIncompleteDumpNodes()
{
// Queue declaration nodes that do not need complete output.
@@ -989,7 +998,7 @@ void ASTVisitor::LookupStart(clang::DeclContext const* dc,
if(pos == name.npos) {
for(clang::DeclContext::lookup_const_iterator i = r.begin(), e = r.end();
i != e; ++i) {
- this->AddDumpNode(*i, true);
+ this->AddStartDecl(*i);
}
} else {
std::string rest = name.substr(pos+2);
@@ -1014,7 +1023,7 @@ void ASTVisitor::HandleTranslationUnit(clang::TranslationUnitDecl const* tu)
}
} else {
// No start specified. Use whole translation unit.
- this->AddDumpNode(tu, true);
+ this->AddStartDecl(tu);
}
// Start dump with gccxml-compatible format.