Skip to content

Commit 417e0a7

Browse files
committed
Add ifdef and prints
1 parent 2d61478 commit 417e0a7

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

lib/programmemory.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#include <utility>
4646
#include <vector>
4747

48+
#include <iostream>
49+
4850
ExprIdToken::ExprIdToken(const Token* tok) : tok(tok), exprid(tok ? tok->exprId() : 0) {}
4951

5052
nonneg int ExprIdToken::getExpressionId() const {
@@ -487,9 +489,20 @@ static void addVars(ProgramMemory& pm, const ProgramMemory::Map& vars)
487489
}
488490
}
489491

492+
static void debugPrint(const ProgramMemory& pm)
493+
{
494+
for(auto&& p:pm) {
495+
std::cout << p.first->expressionString() << " => " << p.second.toString() << std::endl;
496+
}
497+
}
498+
490499
void ProgramMemoryState::addState(const Token* tok, const ProgramMemory::Map& vars)
491500
{
492-
#if 0
501+
std::cout << "**************************************************************\n";
502+
std::cout << "addState: " << tok->expressionString() << std::endl;
503+
std::cout << "Before:\n";
504+
debugPrint(state);
505+
#if 1
493506
ProgramMemory local = state;
494507
addVars(local, vars);
495508
fillProgramMemoryFromConditions(local, tok, settings);
@@ -507,6 +520,8 @@ void ProgramMemoryState::addState(const Token* tok, const ProgramMemory::Map& va
507520
addVars(pm, vars);
508521
replace(std::move(pm), tok);
509522
#endif
523+
std::cout << "After:\n";
524+
debugPrint(state);
510525
}
511526

512527
void ProgramMemoryState::assume(const Token* tok, bool b, bool isEmpty)

0 commit comments

Comments
 (0)