fix printing of 'call void'
MODIFY
ir/instr.cpp
ir/instr.cpp
@@ -536,7 +536,11 @@ void FnCall::print(ostream &os) const {
auto type = getType().toString();
if (!type.empty())
type += ' ';
- os << getName() << " = call " << type << fnName << '(';
+
+ if (!dynamic_cast<VoidType*>(&getType()))
+ os << getName() << " = ";
+
+ os << "call " << type << fnName << '(';
bool first = true;
for (auto arg : args) {

MODIFY
tv/tv.cpp
tv/tv.cpp
@@ -127,7 +127,8 @@ string value_name(const llvm::Value &v) {
if (!v.getName().empty())
return name = '%' + v.getName().str();
- return name = '%' + to_string(value_id_counter++);
+ return name = v.getType()->isVoidTy() ? "<void>"
+ : '%' + to_string(value_id_counter++);
}
Type* llvm_type2alive(const llvm::Type *ty) {

fix printing of 'call void'