Record the outcome of VPAuto (auto detection if a value should be printed out).

This commit is contained in:
Vassil Vassilev 2014-05-16 17:35:56 +02:00 committed by sftnight
parent 214376a899
commit 245f098fe1
2 changed files with 8 additions and 2 deletions

View File

@ -298,6 +298,7 @@ namespace cling {
void setIssuedDiags(IssuedDiags val) { m_IssuedDiags = val; }
const CompilationOptions& getCompilationOpts() const { return m_Opts; }
CompilationOptions& getCompilationOpts() { return m_Opts; }
void setCompilationOpts(const CompilationOptions& CO) {
assert(getState() == kCollecting && "Something wrong with you?");
m_Opts = CO;

View File

@ -79,8 +79,13 @@ namespace cling {
case CompilationOptions::VPAuto:
if ((int)CS->size() > indexOfLastExpr+1
&& (*(CS->body_begin() + indexOfLastExpr + 1))
&& isa<NullStmt>(*(CS->body_begin() + indexOfLastExpr + 1)))
return true; // If next is NullStmt disable VP is disabled - exit.
&& isa<NullStmt>(*(CS->body_begin() + indexOfLastExpr + 1))) {
// If next is NullStmt disable VP is disabled - exit. Signal this in
// the CO of the transaction.
Transaction* T = getTransaction();
T->getCompilationOpts().ValuePrinting = CompilationOptions::VPDisabled;
return true;
}
break;
}