Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commented few print statements for better readability #382

Merged
merged 5 commits into from
Nov 10, 2021

Conversation

ArpitaDutta
Copy link
Member

Removed few print statements for better readability.

@rasoolmaghareh
Copy link
Member

Thanks @ArpitaDutta . Can you please add the condition for -debug-subsumption=4 to the code too. You can search for if (debugSubsumptionLevel >= 3) and see how it works.

@ArpitaDutta
Copy link
Member Author

ArpitaDutta commented Sep 10, 2021 via email

Copy link
Member

@rasoolmaghareh rasoolmaghareh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added 22 comments.

@@ -2858,11 +2858,15 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
Instruction *i = ki->inst;
// if this is starting a new BB then
// check for non-linear & new BB in speculation mode

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove white space.

if (INTERPOLATION_ENABLED && SpecTypeToUse != NO_SPEC &&
txTree->isSpeculationNode() &&
(i == &state.txTreeNode->getBasicBlock()->front())) {
// check non-linear
uintptr_t pp = state.txTreeNode->getProgramPoint();
//i->dump();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove these three lines. They are commented code.

@@ -537,15 +537,15 @@ TxPrettyExpressionBuilder::constructQuery(ConstraintManager &constraints,
std::string msg;
std::string tabs = makeTabs(1);
llvm::raw_string_ostream stream(msg);
stream << "antecedent:\n";
/*stream << "antecedent:\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4) .

@@ -1598,9 +1598,10 @@ bool TxSubsumptionTableEntry::subsumed(
}

if (debugSubsumptionLevel >= 2) {
klee_message("Querying for subsumption check:\n%s",
/* klee_message("Querying for subsumption check:\n%s",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4).

@@ -1634,9 +1635,10 @@ bool TxSubsumptionTableEntry::subsumed(

} else {
if (debugSubsumptionLevel >= 2) {
klee_message("Querying for subsumption check:\n%s",
/*klee_message("Querying for subsumption check:\n%s",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4).

@@ -633,11 +633,11 @@ void TxInterpolantValue::print(llvm::raw_ostream &stream,
std::string nextTabs = appendTab(prefix);
bool offsetDisplayed = false;

stream << prefix << "function/value: ";
/*stream << prefix << "function/value: ";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4) .

@@ -694,7 +694,7 @@ void TxInterpolantValue::print(llvm::raw_ostream &stream,
expr->print(stream);
}

if (!coreReasons.empty()) {
/* if (!coreReasons.empty()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4) .

@@ -795,7 +795,7 @@ void TxStateAddress::print(llvm::raw_ostream &stream,
std::string tabsNext = appendTab(prefix);

variable->print(stream, prefix);
stream << "\n";
/*stream << "\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4) .

@@ -923,19 +923,19 @@ void TxStateValue::printMinimal(llvm::raw_ostream &stream,
const std::string &prefix) const {
std::string tabsNext = appendTab(prefix);

stream << prefix << "function/value: ";
/*stream << prefix << "function/value: ";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4) .

stream << prefix << "expression: ";
if (!valueExpr.isNull())
valueExpr->print(stream);
else
stream << "NULL";
stream << "\n";
stream << prefix
<< "pointer to location object: " << reinterpret_cast<uintptr_t>(this);
/*stream << prefix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines should not be commented. As discussed in our last meeting these lines should be guarded by: if (debugSubsumptionLevel >= 4) .

@rasoolmaghareh
Copy link
Member

The code works properly on local tests.

@rasoolmaghareh rasoolmaghareh merged commit 3adde2a into master Nov 10, 2021
@rasoolmaghareh rasoolmaghareh deleted the prettyPrint branch November 10, 2021 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants