From 72c1d0405b3075ae487a82d21ee15896aa5c1013 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Fri, 19 Sep 2014 16:54:04 +0200 Subject: [PATCH] Do not stream const vars; for static ones, do not print "extern". --- interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp b/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp index 1ebe663..e2a5701 100644 --- a/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp +++ b/interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp @@ -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; } -- 1.8.2