File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ enum TypeKind {
59
59
UnimplementedType = 255 , // YKFIXME: Will eventually be deleted.
60
60
};
61
61
62
- string valueToString (Value *V ) {
62
+ template < class T > string toString (T *X ) {
63
63
string S;
64
64
raw_string_ostream SS (S);
65
- V ->print (SS);
65
+ X ->print (SS);
66
66
return S;
67
67
}
68
68
@@ -163,7 +163,7 @@ class YkIRWriter {
163
163
void serialiseUnimplementedOperand (Value *V) {
164
164
OutStreamer.emitInt8 (OperandKind::String);
165
165
OutStreamer.emitInt8 (' ?' );
166
- serialiseString (valueToString (V));
166
+ serialiseString (toString (V));
167
167
}
168
168
169
169
void serialiseOperand (Instruction *Parent, Value *V) {
@@ -209,7 +209,7 @@ class YkIRWriter {
209
209
// num_operands:
210
210
OutStreamer.emitInt32 (1 );
211
211
// problem instruction:
212
- serialiseStringOperand (valueToString (I).data ());
212
+ serialiseStringOperand (toString (I).data ());
213
213
}
214
214
215
215
void serialiseBlock (BasicBlock &BB) {
@@ -238,6 +238,7 @@ class YkIRWriter {
238
238
OutStreamer.emitInt32 (ITy->getBitWidth ());
239
239
} else {
240
240
OutStreamer.emitInt8 (TypeKind::UnimplementedType);
241
+ serialiseString (toString (Ty));
241
242
}
242
243
}
243
244
You can’t perform that action at this time.
0 commit comments