Automatically stream to parent if not skipped.

This commit is contained in:
Axel Naumann 2014-09-23 14:31:25 +02:00 committed by sftnight
parent 3db7197ea9
commit 52fb16d57f
2 changed files with 12 additions and 9 deletions

View File

@ -510,16 +510,18 @@ namespace cling {
Out() << ";\n";
}
m_Indentation -= m_Policy.Indentation;
std::string output = subStream.take(true);
Out() << output;
if (m_SkipFlag) {
return;
}
} else
Out() << ' ';
// D->getBody()->printPretty(Out, 0, SubPolicy, Indentation);
}
std::string output = stream.take(true);
Out() << output << ";\n";
if (m_SkipFlag) {
return;
}
}
void ForwardDeclPrinter::VisitFriendDecl(FriendDecl *D) {
@ -892,10 +894,6 @@ namespace cling {
else {
Visit(D->getTemplatedDecl());
}
if (!m_SkipFlag) {
std::string output = Stream.take(true);
Out() << output;
}
}
void ForwardDeclPrinter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {

View File

@ -259,8 +259,13 @@ namespace cling {
m_pr.m_Policy = *pol;
}
~StreamRAII() {
if (!m_HavePopped)
if (!m_HavePopped) {
m_pr.m_StreamStack.pop();
m_Stream.flush();
if (!m_pr.m_SkipFlag) {
m_pr.Log() << m_Output;
}
}
m_pr.m_Policy = m_oldPol;
}
std::string take(bool pop = false) {