fix printing 'ERROR: ERROR' with exceptions
MODIFY
ir/function.cpp
ir/function.cpp
@@ -129,11 +129,11 @@ void Function::syncDataWithSrc(const Function &src) {
in_tgt->copySMTName(*dynamic_cast<Input*>(IS->get()));
if (!(IS->get()->getType() == IT->get()->getType()).isTrue())
- throw AliveException("ERROR: Source and target args have different type", false);
+ throw AliveException("Source and target args have different type", false);
}
if (IS != ES || IT != ET)
- throw AliveException("ERROR: Source and target have different number of args",
+ throw AliveException("Source and target have different number of args",
false);
}

MODIFY
ir/state.cpp
ir/state.cpp
@@ -56,7 +56,7 @@ const StateValue& State::operator[](const Value &val) {
}
if (hit_half_memory_limit())
- throw AliveException("ERROR: Out of memory; skipping function.", false);
+ throw AliveException("Out of memory; skipping function.", false);
auto sval_new = sval.subst(repls);
if (sval_new.eq(sval)) {
@@ -118,7 +118,7 @@ bool State::startBB(const BasicBlock &bb) {
void State::addJump(const BasicBlock &dst, expr &&cond) {
if (seen_bbs.count(&dst))
- throw AliveException("ERROR: Loops are not supported yet! Skipping function.",
+ throw AliveException("Loops are not supported yet! Skipping function.",
false);
cond &= domain.first;

MODIFY
scripts/stats.php
scripts/stats.php
@@ -15,6 +15,8 @@ foreach (glob("logs/*.txt") as $f) {
$txt = file_get_contents($f);
preg_match_all('/ERROR: (.+)/S', $txt, $m);
foreach($m[1] as $err) {
+ if (strstr($err, 'Unsupported '))
+ continue;
@++$errors[$err];
}

MODIFY
tools/alive-tv.cpp
tools/alive-tv.cpp
@@ -181,7 +181,7 @@ static bool compareFunctions(llvm::Function &F1, llvm::Function &F2,
llvm::Triple &targetTriple, unsigned &goodCount,
unsigned &badCount, unsigned &errorCount) {
if (cmpTypes(F1.getFunctionType(), F2.getFunctionType(), &F1, &F2)) {
- cerr << "Only functions with identical signatures can be checked\n";
+ cerr << "ERROR: Only functions with identical signatures can be checked\n";
++errorCount;
return true;
}
@@ -191,7 +191,8 @@ static bool compareFunctions(llvm::Function &F1, llvm::Function &F2,
auto Func1 = llvm2alive(F1, llvm::TargetLibraryInfoWrapperPass(targetTriple)
.getTLI(F1));
if (!Func1) {
- cerr << "Could not translate '" + (std::string)F1.getName() + "' to Alive IR\n";
+ cerr << "ERROR: Could not translate '" << F1.getName().str()
+ << "' to Alive IR\n";
++errorCount;
return true;
}
@@ -199,7 +200,8 @@ static bool compareFunctions(llvm::Function &F1, llvm::Function &F2,
auto Func2 = llvm2alive(F2, llvm::TargetLibraryInfoWrapperPass(targetTriple)
.getTLI(F2));
if (!Func2) {
- cerr << "Could not translate '" + (std::string)F2.getName() + "' to Alive IR\n";
+ cerr << "ERROR: Could not translate '" << F2.getName().str()
+ << "' to Alive IR\n";
++errorCount;
return true;
}
@@ -311,10 +313,10 @@ int main(int argc, char **argv) {
}
}
- cerr << "Summary:\n";
- cerr << " " << goodCount << " correct transformations\n";
- cerr << " " << badCount << " incorrect transformations\n";
- cerr << " " << errorCount << " errors\n";
+ cerr << "Summary:\n"
+ " " << goodCount << " correct transformations\n"
+ " " << badCount << " incorrect transformations\n"
+ " " << errorCount << " errors\n";
smt_init.reset();

fix printing 'ERROR: ERROR' with exceptions