Skip to content

Commit

Permalink
Print a more helpful message when encountering an unhandled type.
Browse files Browse the repository at this point in the history
This makes us print a readable type name, rather than the integral value
of the TypeID.

Change-Id: I64e26146c55668e0c70fdac33a48333d283da3dc
  • Loading branch information
xyzsam committed Feb 1, 2018
1 parent 582632e commit ae526a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion full-trace/full_trace.cpp
Expand Up @@ -525,7 +525,20 @@ void Tracer::printParamLine(Instruction *I, int param_num, const char *reg_id,
vv_reg_id, v_is_phi, vv_prev_bbid };
IRB.CreateCall(TL_log_vector, args);
} else {
fprintf(stderr, "normal data else: %d, %s\n", datatype, reg_id);
errs() << "[WARNING]: Encountered unhandled datatype ";
if (datatype <= Type::LastPrimitiveTyID) {
Type* t = Type::getPrimitiveType(curr_module->getContext(), datatype);
errs() << *t;
} else if (datatype == Type::FunctionTyID) {
errs() << "FunctionType";
} else if (datatype == Type::StructTyID) {
errs() << "StructType";
} else if (datatype == Type::ArrayTyID) {
errs() << "ArrayType";
} else {
errs() << "UnknownType";
}
errs() << " on variable " << reg_id << "\n";
}
} else {
Value *v_value = ConstantInt::get(IRB.getInt64Ty(), 0);
Expand Down

0 comments on commit ae526a3

Please sign in to comment.