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 {
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
You can’t perform that action at this time.
0 commit comments