@@ -1196,7 +1196,7 @@ index
1196
1196
1197
1197
const ::llvm::AttributeList attrs
1198
1198
= ExampleDialect::get(context).getAttributeList(4);
1199
- auto fnType = ::llvm::FunctionType::get(::llvm::Type::getVoidTy (context), true );
1199
+ auto fnType = ::llvm::FunctionType::get(::llvm::IntegerType::get (context, 32 ), true );
1200
1200
1201
1201
auto fn = module.getOrInsertFunction(s_name, fnType, attrs);
1202
1202
::llvm::SmallString<32> newName;
@@ -1238,7 +1238,17 @@ instName_0
1238
1238
(void)instNameType;
1239
1239
::llvm::Type * const instName_0Type = getInstName_0()->getType();
1240
1240
(void)instName_0Type;
1241
- return true ;
1241
+ ::llvm::Type * const resultType = getResult()->getType();
1242
+ (void)resultType;
1243
+
1244
+ if (::llvm::IntegerType::get(context, 32) != resultType) {
1245
+ errs << " unexpected value of $result:\n" ;
1246
+ errs << " expected: " << printable(::llvm::IntegerType::get(context, 32)) << '\n ' ;
1247
+ errs << " actual: " << printable(resultType) << '\n ' ;
1248
+
1249
+ return false ;
1250
+ }
1251
+ return true ;
1242
1252
}
1243
1253
1244
1254
@@ -1256,6 +1266,7 @@ instName_0
1256
1266
void InstNameConflictDoubleOp::setInstName_0(::llvm::Value * instName_0) {
1257
1267
setArgOperand(1, instName_0);
1258
1268
}
1269
+ ::llvm::Value *InstNameConflictDoubleOp::getResult() {return this;}
1259
1270
1260
1271
1261
1272
@@ -1269,7 +1280,7 @@ instName_0
1269
1280
1270
1281
const ::llvm::AttributeList attrs
1271
1282
= ExampleDialect::get(context).getAttributeList(4);
1272
- auto fnType = ::llvm::FunctionType::get(::llvm::Type::getVoidTy (context), true );
1283
+ auto fnType = ::llvm::FunctionType::get(::llvm::IntegerType::get (context, 32 ), true );
1273
1284
1274
1285
auto fn = module.getOrInsertFunction(s_name, fnType, attrs);
1275
1286
::llvm::SmallString<32> newName;
@@ -1308,7 +1319,17 @@ instName
1308
1319
}
1309
1320
::llvm::Type * const instNameType = getInstName()->getType();
1310
1321
(void)instNameType;
1311
- return true ;
1322
+ ::llvm::Type * const resultType = getResult()->getType();
1323
+ (void)resultType;
1324
+
1325
+ if (::llvm::IntegerType::get(context, 32) != resultType) {
1326
+ errs << " unexpected value of $result:\n" ;
1327
+ errs << " expected: " << printable(::llvm::IntegerType::get(context, 32)) << '\n ' ;
1328
+ errs << " actual: " << printable(resultType) << '\n ' ;
1329
+
1330
+ return false ;
1331
+ }
1332
+ return true ;
1312
1333
}
1313
1334
1314
1335
@@ -1319,6 +1340,7 @@ instName
1319
1340
void InstNameConflictOp::setInstName(::llvm::Value * instName) {
1320
1341
setArgOperand(0, instName);
1321
1342
}
1343
+ ::llvm::Value *InstNameConflictOp::getResult() {return this;}
1322
1344
1323
1345
1324
1346
@@ -1332,7 +1354,7 @@ instName
1332
1354
1333
1355
const ::llvm::AttributeList attrs
1334
1356
= ExampleDialect::get(context).getAttributeList(4);
1335
- auto fnType = ::llvm::FunctionType::get(::llvm::Type::getVoidTy (context), true );
1357
+ auto fnType = ::llvm::FunctionType::get(::llvm::IntegerType::get (context, 32 ), true );
1336
1358
1337
1359
auto fn = module.getOrInsertFunction(s_name, fnType, attrs);
1338
1360
::llvm::SmallString<32> newName;
@@ -1371,7 +1393,17 @@ instName
1371
1393
<< ", expected at least 0\n" ;
1372
1394
return false ;
1373
1395
}
1374
- return true ;
1396
+ ::llvm::Type * const resultType = getResult()->getType();
1397
+ (void)resultType;
1398
+
1399
+ if (::llvm::IntegerType::get(context, 32) != resultType) {
1400
+ errs << " unexpected value of $result:\n" ;
1401
+ errs << " expected: " << printable(::llvm::IntegerType::get(context, 32)) << '\n ' ;
1402
+ errs << " actual: " << printable(resultType) << '\n ' ;
1403
+
1404
+ return false ;
1405
+ }
1406
+ return true ;
1375
1407
}
1376
1408
1377
1409
@@ -1380,6 +1412,7 @@ instName
1380
1412
value_op_iterator(arg_begin() + 0),
1381
1413
value_op_iterator(arg_end()));
1382
1414
}
1415
+ ::llvm::Value *InstNameConflictVarargsOp::getResult() {return this;}
1383
1416
1384
1417
1385
1418
0 commit comments