@@ -1196,7 +1196,7 @@ index
11961196
11971197 const ::llvm ::AttributeList attrs
11981198 = 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 );
12001200
12011201 auto fn = module.getOrInsertFunction (s_name, fnType, attrs);
12021202 ::llvm ::SmallString< 32 > newName;
@@ -1238,7 +1238,17 @@ instName_0
12381238(void)instNameType;
12391239::llvm ::Type * const instName_0Type = getInstName_0 ()- > getType ();
12401240(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 ;
12421252}
12431253
12441254
@@ -1256,6 +1266,7 @@ instName_0
12561266 void InstNameConflictDoubleOp ::setInstName_0 (::llvm ::Value * instName_0) {
12571267 setArgOperand (1 , instName_0);
12581268 }
1269+ ::llvm ::Value * InstNameConflictDoubleOp ::getResult () {return this ;}
12591270
12601271
12611272
@@ -1269,7 +1280,7 @@ instName_0
12691280
12701281 const ::llvm ::AttributeList attrs
12711282 = 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 );
12731284
12741285 auto fn = module.getOrInsertFunction (s_name, fnType, attrs);
12751286 ::llvm ::SmallString< 32 > newName;
@@ -1308,7 +1319,17 @@ instName
13081319 }
13091320 ::llvm ::Type * const instNameType = getInstName ()- > getType ();
13101321(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 ;
13121333}
13131334
13141335
@@ -1319,6 +1340,7 @@ instName
13191340 void InstNameConflictOp ::setInstName (::llvm ::Value * instName) {
13201341 setArgOperand (0 , instName);
13211342 }
1343+ ::llvm ::Value * InstNameConflictOp ::getResult () {return this ;}
13221344
13231345
13241346
@@ -1332,7 +1354,7 @@ instName
13321354
13331355 const ::llvm ::AttributeList attrs
13341356 = 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 );
13361358
13371359 auto fn = module.getOrInsertFunction (s_name, fnType, attrs);
13381360 ::llvm ::SmallString< 32 > newName;
@@ -1371,7 +1393,17 @@ instName
13711393 << " , expected at least 0\n" ;
13721394 return false ;
13731395 }
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 ;
13751407}
13761408
13771409
@@ -1380,6 +1412,7 @@ instName
13801412 value_op_iterator (arg_begin () + 0 ),
13811413 value_op_iterator (arg_end ()));
13821414 }
1415+ ::llvm ::Value * InstNameConflictVarargsOp ::getResult () {return this ;}
13831416
13841417
13851418
0 commit comments