aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-upgrade/UpgradeParser.cpp.cvs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-upgrade/UpgradeParser.cpp.cvs')
-rw-r--r--tools/llvm-upgrade/UpgradeParser.cpp.cvs110
1 files changed, 58 insertions, 52 deletions
diff --git a/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
index 9ead1b3..a539441 100644
--- a/tools/llvm-upgrade/UpgradeParser.cpp.cvs
+++ b/tools/llvm-upgrade/UpgradeParser.cpp.cvs
@@ -2548,12 +2548,12 @@ static const unsigned short int yyrline[] =
3062, 3063, 3067, 3068, 3067, 3080, 3081, 3086, 3087, 3088,
3089, 3093, 3097, 3098, 3099, 3100, 3121, 3125, 3139, 3140,
3145, 3145, 3153, 3163, 3166, 3175, 3186, 3191, 3200, 3211,
- 3211, 3214, 3218, 3222, 3227, 3237, 3255, 3264, 3329, 3333,
- 3340, 3352, 3367, 3397, 3407, 3417, 3421, 3428, 3429, 3433,
- 3436, 3442, 3461, 3479, 3495, 3509, 3523, 3534, 3552, 3561,
- 3570, 3577, 3598, 3622, 3628, 3634, 3640, 3656, 3740, 3748,
- 3749, 3753, 3754, 3758, 3764, 3771, 3777, 3784, 3791, 3804,
- 3830
+ 3211, 3214, 3218, 3222, 3227, 3237, 3255, 3264, 3332, 3336,
+ 3343, 3355, 3370, 3400, 3410, 3420, 3424, 3431, 3432, 3436,
+ 3439, 3445, 3464, 3482, 3498, 3512, 3526, 3537, 3555, 3564,
+ 3573, 3580, 3601, 3625, 3631, 3637, 3643, 3659, 3746, 3754,
+ 3755, 3759, 3760, 3764, 3770, 3777, 3783, 3790, 3797, 3810,
+ 3836
};
#endif
@@ -5865,7 +5865,10 @@ yyreduce:
(yyval.TermInstVal).S.copy((yyvsp[-10].TypeVal).S);
} else {
FTySign = (yyvsp[-10].TypeVal).S;
- (yyval.TermInstVal).S.copy((yyvsp[-10].TypeVal).S.get(0)); // 0th element of FuncTy sign is result ty
+ // Get the signedness of the result type. $3 is the pointer to the
+ // function type so we get the 0th element to extract the function type,
+ // and then the 0th element again to get the result type.
+ (yyval.TermInstVal).S.copy((yyvsp[-10].TypeVal).S.get(0).get(0));
}
(yyvsp[-9].ValIDVal).S.makeComposite(FTySign);
Value *V = getVal(PFTy, (yyvsp[-9].ValIDVal)); // Get the function we're calling...
@@ -5903,7 +5906,7 @@ yyreduce:
break;
case 268:
-#line 3329 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3332 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TermInstVal).TI = new UnwindInst();
(yyval.TermInstVal).S.makeSignless();
@@ -5911,7 +5914,7 @@ yyreduce:
break;
case 269:
-#line 3333 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3336 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.TermInstVal).TI = new UnreachableInst();
(yyval.TermInstVal).S.makeSignless();
@@ -5919,7 +5922,7 @@ yyreduce:
break;
case 270:
-#line 3340 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3343 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.JumpTable) = (yyvsp[-5].JumpTable);
(yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S);
@@ -5935,7 +5938,7 @@ yyreduce:
break;
case 271:
-#line 3352 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3355 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.JumpTable) = new std::vector<std::pair<Constant*, BasicBlock*> >();
(yyvsp[-3].ValIDVal).S.copy((yyvsp[-4].PrimType).S);
@@ -5951,7 +5954,7 @@ yyreduce:
break;
case 272:
-#line 3367 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3370 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
bool omit = false;
if ((yyvsp[-1].StrVal))
@@ -5984,7 +5987,7 @@ yyreduce:
break;
case 273:
-#line 3397 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3400 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Used for PHI nodes
(yyval.PHIList).P = new std::list<std::pair<Value*, BasicBlock*> >();
(yyval.PHIList).S.copy((yyvsp[-5].TypeVal).S);
@@ -5998,7 +6001,7 @@ yyreduce:
break;
case 274:
-#line 3407 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3410 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.PHIList) = (yyvsp[-6].PHIList);
(yyvsp[-3].ValIDVal).S.copy((yyvsp[-6].PHIList).S);
@@ -6010,7 +6013,7 @@ yyreduce:
break;
case 275:
-#line 3417 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3420 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ // Used for call statements, and memory insts...
(yyval.ValueList) = new std::vector<ValueInfo>();
(yyval.ValueList)->push_back((yyvsp[0].ValueVal));
@@ -6018,7 +6021,7 @@ yyreduce:
break;
case 276:
-#line 3421 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3424 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.ValueList) = (yyvsp[-2].ValueList);
(yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal));
@@ -6026,26 +6029,26 @@ yyreduce:
break;
case 278:
-#line 3429 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3432 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = 0; ;}
break;
case 279:
-#line 3433 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3436 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BoolVal) = true;
;}
break;
case 280:
-#line 3436 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3439 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.BoolVal) = false;
;}
break;
case 281:
-#line 3442 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3445 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
(yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
@@ -6068,7 +6071,7 @@ yyreduce:
break;
case 282:
-#line 3461 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3464 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
(yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
@@ -6090,7 +6093,7 @@ yyreduce:
break;
case 283:
-#line 3479 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3482 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
(yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
@@ -6110,7 +6113,7 @@ yyreduce:
break;
case 284:
-#line 3495 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3498 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
(yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
@@ -6128,7 +6131,7 @@ yyreduce:
break;
case 285:
-#line 3509 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3512 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[-2].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
(yyvsp[0].ValIDVal).S.copy((yyvsp[-3].TypeVal).S);
@@ -6146,7 +6149,7 @@ yyreduce:
break;
case 286:
-#line 3523 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3526 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
warning("Use of obsolete 'not' instruction: Replacing with 'xor");
const Type *Ty = (yyvsp[0].ValueVal).V->getType();
@@ -6161,7 +6164,7 @@ yyreduce:
break;
case 287:
-#line 3534 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3537 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[0].ValueVal).V->getType()->isInteger() ||
cast<IntegerType>((yyvsp[0].ValueVal).V->getType())->getBitWidth() != 8)
@@ -6183,7 +6186,7 @@ yyreduce:
break;
case 288:
-#line 3552 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3555 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *DstTy = (yyvsp[0].TypeVal).PAT->get();
if (!DstTy->isFirstClassType())
@@ -6196,7 +6199,7 @@ yyreduce:
break;
case 289:
-#line 3561 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3564 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!(yyvsp[-4].ValueVal).V->getType()->isInteger() ||
cast<IntegerType>((yyvsp[-4].ValueVal).V->getType())->getBitWidth() != 1)
@@ -6209,7 +6212,7 @@ yyreduce:
break;
case 290:
-#line 3570 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3573 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[0].TypeVal).PAT->get();
NewVarArgs = true;
@@ -6220,7 +6223,7 @@ yyreduce:
break;
case 291:
-#line 3577 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3580 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType();
const Type* DstTy = (yyvsp[0].TypeVal).PAT->get();
@@ -6245,7 +6248,7 @@ yyreduce:
break;
case 292:
-#line 3598 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3601 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* ArgTy = (yyvsp[-2].ValueVal).V->getType();
const Type* DstTy = (yyvsp[0].TypeVal).PAT->get();
@@ -6273,7 +6276,7 @@ yyreduce:
break;
case 293:
-#line 3622 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3625 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V))
error("Invalid extractelement operands");
@@ -6283,7 +6286,7 @@ yyreduce:
break;
case 294:
-#line 3628 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3631 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V))
error("Invalid insertelement operands");
@@ -6293,7 +6296,7 @@ yyreduce:
break;
case 295:
-#line 3634 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3637 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal).V, (yyvsp[-2].ValueVal).V, (yyvsp[0].ValueVal).V))
error("Invalid shufflevector operands");
@@ -6303,7 +6306,7 @@ yyreduce:
break;
case 296:
-#line 3640 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3643 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[0].PHIList).P->front().first->getType();
if (!Ty->isFirstClassType())
@@ -6323,7 +6326,7 @@ yyreduce:
break;
case 297:
-#line 3656 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3659 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
// Handle the short call syntax
const PointerType *PFTy;
@@ -6359,7 +6362,10 @@ yyreduce:
(yyval.InstVal).S.copy((yyvsp[-4].TypeVal).S);
} else {
FTySign = (yyvsp[-4].TypeVal).S;
- (yyval.InstVal).S.copy((yyvsp[-4].TypeVal).S.get(0)); // 0th element of FuncTy signedness is result sign
+ // Get the signedness of the result type. $3 is the pointer to the
+ // function type so we get the 0th element to extract the function type,
+ // and then the 0th element again to get the result type.
+ (yyval.InstVal).S.copy((yyvsp[-4].TypeVal).S.get(0).get(0));
}
(yyvsp[-3].ValIDVal).S.makeComposite(FTySign);
@@ -6411,34 +6417,34 @@ yyreduce:
break;
case 298:
-#line 3740 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3746 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyval.InstVal) = (yyvsp[0].InstVal);
;}
break;
case 299:
-#line 3748 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3754 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = (yyvsp[0].ValueList); ;}
break;
case 300:
-#line 3749 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3755 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.ValueList) = new std::vector<ValueInfo>(); ;}
break;
case 301:
-#line 3753 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3759 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = true; ;}
break;
case 302:
-#line 3754 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3760 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{ (yyval.BoolVal) = false; ;}
break;
case 303:
-#line 3758 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3764 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-1].TypeVal).PAT->get();
(yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S);
@@ -6448,7 +6454,7 @@ yyreduce:
break;
case 304:
-#line 3764 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3770 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-4].TypeVal).PAT->get();
(yyvsp[-1].ValIDVal).S.makeUnsigned();
@@ -6459,7 +6465,7 @@ yyreduce:
break;
case 305:
-#line 3771 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3777 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-1].TypeVal).PAT->get();
(yyval.InstVal).S.makeComposite((yyvsp[-1].TypeVal).S);
@@ -6469,7 +6475,7 @@ yyreduce:
break;
case 306:
-#line 3777 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3783 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *Ty = (yyvsp[-4].TypeVal).PAT->get();
(yyvsp[-1].ValIDVal).S.makeUnsigned();
@@ -6480,7 +6486,7 @@ yyreduce:
break;
case 307:
-#line 3784 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3790 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type *PTy = (yyvsp[0].ValueVal).V->getType();
if (!isa<PointerType>(PTy))
@@ -6491,7 +6497,7 @@ yyreduce:
break;
case 308:
-#line 3791 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3797 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
const Type* Ty = (yyvsp[-1].TypeVal).PAT->get();
(yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S);
@@ -6508,7 +6514,7 @@ yyreduce:
break;
case 309:
-#line 3804 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3810 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[0].ValIDVal).S.copy((yyvsp[-1].TypeVal).S);
const PointerType *PTy = dyn_cast<PointerType>((yyvsp[-1].TypeVal).PAT->get());
@@ -6538,7 +6544,7 @@ yyreduce:
break;
case 310:
-#line 3830 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3836 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
{
(yyvsp[-1].ValIDVal).S.copy((yyvsp[-2].TypeVal).S);
const Type* Ty = (yyvsp[-2].TypeVal).PAT->get();
@@ -6562,7 +6568,7 @@ yyreduce:
}
/* Line 1126 of yacc.c. */
-#line 6566 "UpgradeParser.tab.c"
+#line 6572 "UpgradeParser.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
@@ -6830,7 +6836,7 @@ yyreturn:
}
-#line 3848 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
+#line 3854 "/proj/llvm/llvm-1/tools/llvm-upgrade/UpgradeParser.y"
int yyerror(const char *ErrorMsg) {