Do not stream const vars; for static ones, do not print "extern".

This commit is contained in:
Axel Naumann 2014-09-19 16:54:04 +02:00 committed by sftnight
parent fdadde3cd7
commit 585be00d64

View File

@ -561,7 +561,8 @@ namespace cling {
return;
}
if (D->isDefinedOutsideFunctionOrMethod() && D->getStorageClass() != SC_Extern)
if (D->isDefinedOutsideFunctionOrMethod() && D->getStorageClass() != SC_Extern
&& D->getStorageClass() != SC_Static)
Out() << "extern ";
m_Policy.Bool = true;
@ -1132,8 +1133,8 @@ namespace cling {
}
bool ForwardDeclPrinter::shouldSkipImpl(VarDecl *D) {
if (D->getStorageClass() == SC_Static) {
Log() << D->getName() <<" Var : Static\n";
if (D->getType().isConstQualified()) {
Log() << D->getName() <<" Var : Const\n";
m_Visited[D->getCanonicalDecl()] = false;
return true;
}