Skip to content

Commit f1803c1

Browse files
committed
Add a string description on unimplemented types.
1 parent 9e05e5c commit f1803c1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ enum TypeKind {
5959
UnimplementedType = 255, // YKFIXME: Will eventually be deleted.
6060
};
6161

62-
string valueToString(Value *V) {
62+
template <class T> string toString(T *X) {
6363
string S;
6464
raw_string_ostream SS(S);
65-
V->print(SS);
65+
X->print(SS);
6666
return S;
6767
}
6868

@@ -163,7 +163,7 @@ class YkIRWriter {
163163
void serialiseUnimplementedOperand(Value *V) {
164164
OutStreamer.emitInt8(OperandKind::String);
165165
OutStreamer.emitInt8('?');
166-
serialiseString(valueToString(V));
166+
serialiseString(toString(V));
167167
}
168168

169169
void serialiseOperand(Instruction *Parent, Value *V) {
@@ -209,7 +209,7 @@ class YkIRWriter {
209209
// num_operands:
210210
OutStreamer.emitInt32(1);
211211
// problem instruction:
212-
serialiseStringOperand(valueToString(I).data());
212+
serialiseStringOperand(toString(I).data());
213213
}
214214

215215
void serialiseBlock(BasicBlock &BB) {
@@ -238,6 +238,7 @@ class YkIRWriter {
238238
OutStreamer.emitInt32(ITy->getBitWidth());
239239
} else {
240240
OutStreamer.emitInt8(TypeKind::UnimplementedType);
241+
serialiseString(toString(Ty));
241242
}
242243
}
243244

0 commit comments

Comments
 (0)