From 1f70f86c7a43a8b54660638eb74f1162c8c38c8d Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Mon, 5 Nov 2007 21:20:28 +0000 Subject: [PATCH] Make labels work in asm blocks; allow labels as parameters. Rename ValueRefList to ParamList in AsmParser, since its only use is for parameters. llvm-svn: 43734 --- lib/AsmParser/ParserInternals.h | 4 +- lib/AsmParser/llvmAsmParser.cpp.cvs | 1495 +++++++++-------- lib/AsmParser/llvmAsmParser.h.cvs | 2 +- lib/AsmParser/llvmAsmParser.y | 40 +- lib/AsmParser/llvmAsmParser.y.cvs | 40 +- lib/Bitcode/Reader/BitcodeReader.cpp | 5 +- lib/CodeGen/AsmPrinter.cpp | 19 +- lib/CodeGen/SelectionDAG/ScheduleDAG.cpp | 9 +- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 50 +- lib/CodeGen/SelectionDAG/TargetLowering.cpp | 9 +- test/CodeGen/X86/asm-block-labels.ll | 41 + 11 files changed, 921 insertions(+), 793 deletions(-) create mode 100644 test/CodeGen/X86/asm-block-labels.ll diff --git a/lib/AsmParser/ParserInternals.h b/lib/AsmParser/ParserInternals.h index 61de652c516..80a5692e11e 100644 --- a/lib/AsmParser/ParserInternals.h +++ b/lib/AsmParser/ParserInternals.h @@ -241,12 +241,12 @@ struct ArgListEntry { typedef std::vector ArgListType; -struct ValueRefListEntry { +struct ParamListEntry { Value *Val; uint16_t Attrs; }; -typedef std::vector ValueRefList; +typedef std::vector ParamList; } // End llvm namespace diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index 7f94f1d0527..eec7105b52c 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -1,5 +1,5 @@ -/* A Bison parser, made from /Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y +/* A Bison parser, made from /Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y by GNU Bison version 1.28 */ #define YYBISON 1 /* Identify Bison output. */ @@ -155,7 +155,7 @@ #define HIDDEN 398 #define PROTECTED 399 -#line 14 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1109,7 +1109,7 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { } -#line 968 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 968 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1126,7 +1126,7 @@ typedef union { llvm::ArgListType *ArgList; llvm::TypeWithAttrs TypeWithAttrs; llvm::TypeWithAttrsList *TypeWithAttrsList; - llvm::ValueRefList *ValueRefList; + llvm::ParamList *ParamList; // Represent the RHS of PHI node std::listlength(); i != e; ++i) if ((*yyvsp[0].StrVal)[i] == '"' || (*yyvsp[0].StrVal)[i] == '\\') @@ -2906,23 +2929,23 @@ case 123: ; break;} case 124: -#line 1293 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1293 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.StrVal = 0; ; break;} case 125: -#line 1294 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1294 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.StrVal = yyvsp[0].StrVal; ; break;} case 126: -#line 1299 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1299 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" {; break;} case 127: -#line 1300 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1300 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" {; break;} case 128: -#line 1301 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1301 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; @@ -2930,7 +2953,7 @@ case 128: ; break;} case 129: -#line 1306 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1306 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) GEN_ERROR("Alignment must be a power of two"); @@ -2939,21 +2962,21 @@ case 129: ; break;} case 137: -#line 1322 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1322 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeVal = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR ; break;} case 138: -#line 1326 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1326 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); CHECK_FOR_ERROR ; break;} case 139: -#line 1330 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1330 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? if (*yyvsp[-1].TypeVal == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); @@ -2963,7 +2986,7 @@ case 139: ; break;} case 140: -#line 1337 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1337 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR @@ -2971,7 +2994,7 @@ case 140: ; break;} case 141: -#line 1342 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1342 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Type UpReference if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder @@ -2982,7 +3005,7 @@ case 141: ; break;} case 142: -#line 1350 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1350 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Params; ParamAttrsVector Attrs; @@ -3015,7 +3038,7 @@ case 142: ; break;} case 143: -#line 1380 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Params; ParamAttrsVector Attrs; @@ -3048,7 +3071,7 @@ case 143: ; break;} case 144: -#line 1411 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1411 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Sized array type? yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); delete yyvsp[-1].TypeVal; @@ -3056,7 +3079,7 @@ case 144: ; break;} case 145: -#line 1416 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1416 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Vector type? const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) @@ -3071,7 +3094,7 @@ case 145: ; break;} case 146: -#line 1428 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1428 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = yyvsp[-1].TypeList->begin(), @@ -3084,14 +3107,14 @@ case 146: ; break;} case 147: -#line 1438 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1438 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR ; break;} case 148: -#line 1442 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1442 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { std::vector Elements; for (std::list::iterator I = yyvsp[-2].TypeList->begin(), @@ -3104,21 +3127,21 @@ case 148: ; break;} case 149: -#line 1452 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1452 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); CHECK_FOR_ERROR ; break;} case 150: -#line 1459 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1459 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs; ; break;} case 151: -#line 1466 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1466 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); @@ -3128,13 +3151,13 @@ case 151: ; break;} case 152: -#line 1473 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1473 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeVal = new PATypeHolder(Type::VoidTy); ; break;} case 153: -#line 1478 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1478 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeWithAttrsList = new TypeWithAttrsList(); yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); @@ -3142,14 +3165,14 @@ case 153: ; break;} case 154: -#line 1483 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1483 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR ; break;} case 156: -#line 1491 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1491 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -3159,7 +3182,7 @@ case 156: ; break;} case 157: -#line 1498 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1498 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeWithAttrsList = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; @@ -3169,14 +3192,14 @@ case 157: ; break;} case 158: -#line 1505 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1505 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeWithAttrsList = new TypeWithAttrsList(); CHECK_FOR_ERROR ; break;} case 159: -#line 1513 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1513 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TypeList = new std::list(); yyval.TypeList->push_back(*yyvsp[0].TypeVal); @@ -3185,7 +3208,7 @@ case 159: ; break;} case 160: -#line 1519 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1519 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; @@ -3193,7 +3216,7 @@ case 160: ; break;} case 161: -#line 1531 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1531 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); @@ -3224,7 +3247,7 @@ case 161: ; break;} case 162: -#line 1559 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1559 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -3243,7 +3266,7 @@ case 162: ; break;} case 163: -#line 1575 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1575 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -3273,7 +3296,7 @@ case 163: ; break;} case 164: -#line 1602 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1602 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); @@ -3304,7 +3327,7 @@ case 164: ; break;} case 165: -#line 1630 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1630 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); if (STy == 0) @@ -3333,7 +3356,7 @@ case 165: ; break;} case 166: -#line 1656 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1656 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -3356,7 +3379,7 @@ case 166: ; break;} case 167: -#line 1676 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1676 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); if (STy == 0) @@ -3385,7 +3408,7 @@ case 167: ; break;} case 168: -#line 1702 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1702 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); @@ -3408,7 +3431,7 @@ case 168: ; break;} case 169: -#line 1722 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1722 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -3423,7 +3446,7 @@ case 169: ; break;} case 170: -#line 1734 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1734 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -3433,7 +3456,7 @@ case 170: ; break;} case 171: -#line 1741 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1741 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -3502,7 +3525,7 @@ case 171: ; break;} case 172: -#line 1807 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1807 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -3515,7 +3538,7 @@ case 172: ; break;} case 173: -#line 1817 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1817 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -3528,7 +3551,7 @@ case 173: ; break;} case 174: -#line 1827 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1827 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) GEN_ERROR("Constant value doesn't fit in type"); @@ -3537,7 +3560,7 @@ case 174: ; break;} case 175: -#line 1833 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1833 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { @@ -3550,7 +3573,7 @@ case 175: ; break;} case 176: -#line 1843 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1843 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) GEN_ERROR("Constant value doesn't fit in type"); @@ -3559,7 +3582,7 @@ case 176: ; break;} case 177: -#line 1849 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1849 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // arbitrary precision integer constants uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { @@ -3572,7 +3595,7 @@ case 177: ; break;} case 178: -#line 1859 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1859 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); yyval.ConstVal = ConstantInt::getTrue(); @@ -3580,7 +3603,7 @@ case 178: ; break;} case 179: -#line 1864 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1864 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); yyval.ConstVal = ConstantInt::getFalse(); @@ -3588,7 +3611,7 @@ case 179: ; break;} case 180: -#line 1869 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1869 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Floating point constants if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, *yyvsp[0].FPVal)) GEN_ERROR("Floating point constant invalid for type"); @@ -3602,7 +3625,7 @@ case 180: ; break;} case 181: -#line 1882 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1882 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -3617,7 +3640,7 @@ case 181: ; break;} case 182: -#line 1894 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1894 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa(yyvsp[-2].ConstVal->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); @@ -3642,7 +3665,7 @@ case 182: ; break;} case 183: -#line 1916 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1916 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); @@ -3653,7 +3676,7 @@ case 183: ; break;} case 184: -#line 1924 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1924 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Binary operator types must match"); @@ -3662,7 +3685,7 @@ case 184: ; break;} case 185: -#line 1930 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1930 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Logical operator types must match"); @@ -3676,7 +3699,7 @@ case 185: ; break;} case 186: -#line 1941 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1941 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("icmp operand types must match"); @@ -3684,7 +3707,7 @@ case 186: ; break;} case 187: -#line 1946 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1946 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("fcmp operand types must match"); @@ -3692,7 +3715,7 @@ case 187: ; break;} case 188: -#line 1951 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1951 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid extractelement operands"); @@ -3701,7 +3724,7 @@ case 188: ; break;} case 189: -#line 1957 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1957 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid insertelement operands"); @@ -3710,7 +3733,7 @@ case 189: ; break;} case 190: -#line 1963 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1963 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid shufflevector operands"); @@ -3719,14 +3742,14 @@ case 190: ; break;} case 191: -#line 1972 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1972 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR ; break;} case 192: -#line 1976 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1976 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ConstVector = new std::vector(); yyval.ConstVector->push_back(yyvsp[0].ConstVal); @@ -3734,23 +3757,23 @@ case 192: ; break;} case 193: -#line 1984 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1984 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; ; break;} case 194: -#line 1984 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1984 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; ; break;} case 195: -#line 1987 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; ; break;} case 196: -#line 1987 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; ; break;} case 197: -#line 1990 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1990 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { const Type* VTy = yyvsp[-1].TypeVal->get(); Value *V = getVal(VTy, yyvsp[0].ValIDVal); @@ -3765,7 +3788,7 @@ case 197: ; break;} case 198: -#line 2002 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2002 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { Constant *Val = yyvsp[-3].ConstVal; const Type *DestTy = yyvsp[-1].TypeVal->get(); @@ -3780,7 +3803,7 @@ case 198: ; break;} case 199: -#line 2023 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2023 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -3788,7 +3811,7 @@ case 199: ; break;} case 200: -#line 2028 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2028 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); @@ -3796,34 +3819,34 @@ case 200: ; break;} case 203: -#line 2041 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2041 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = false; ; break;} case 204: -#line 2041 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2041 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.FunctionDone(); CHECK_FOR_ERROR ; break;} case 205: -#line 2045 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2045 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ; break;} case 206: -#line 2045 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2045 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ; break;} case 207: -#line 2048 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2048 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ; break;} case 208: -#line 2051 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2051 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); @@ -3850,7 +3873,7 @@ case 208: ; break;} case 209: -#line 2075 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2075 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); @@ -3864,7 +3887,7 @@ case 209: ; break;} case 210: -#line 2086 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2086 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { /* "Externally Visible" Linkage */ if (yyvsp[0].ConstVal == 0) @@ -3875,13 +3898,13 @@ case 210: ; break;} case 211: -#line 2093 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2093 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ; break;} case 212: -#line 2097 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2097 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); @@ -3890,13 +3913,13 @@ case 212: ; break;} case 213: -#line 2102 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2102 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; ; break;} case 214: -#line 2106 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2106 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); @@ -3906,14 +3929,14 @@ case 214: ; break;} case 215: -#line 2112 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2112 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR ; break;} case 216: -#line 2116 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2116 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { std::string Name; if (yyvsp[-4].StrVal) { @@ -3956,19 +3979,19 @@ case 216: ; break;} case 217: -#line 2156 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2156 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ; break;} case 218: -#line 2159 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2159 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ; break;} case 219: -#line 2165 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2165 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) @@ -3980,21 +4003,21 @@ case 219: ; break;} case 220: -#line 2175 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2175 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; ; break;} case 221: -#line 2179 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2179 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setDataLayout(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; ; break;} case 223: -#line 2186 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2186 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; @@ -4002,7 +4025,7 @@ case 223: ; break;} case 224: -#line 2191 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2191 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; @@ -4010,13 +4033,13 @@ case 224: ; break;} case 225: -#line 2196 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2196 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ; break;} case 226: -#line 2205 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2205 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -4029,7 +4052,7 @@ case 226: ; break;} case 227: -#line 2215 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2215 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -4042,14 +4065,14 @@ case 227: ; break;} case 228: -#line 2226 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2226 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = yyvsp[0].ArgList; CHECK_FOR_ERROR ; break;} case 229: -#line 2230 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2230 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = yyvsp[-2].ArgList; struct ArgListEntry E; @@ -4061,7 +4084,7 @@ case 229: ; break;} case 230: -#line 2239 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2239 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = new ArgListType; struct ArgListEntry E; @@ -4073,14 +4096,14 @@ case 230: ; break;} case 231: -#line 2248 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2248 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ArgList = 0; CHECK_FOR_ERROR ; break;} case 232: -#line 2254 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2254 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { std::string FunctionName(*yyvsp[-6].StrVal); delete yyvsp[-6].StrVal; // Free strdup'd memory! @@ -4202,7 +4225,7 @@ case 232: ; break;} case 235: -#line 2376 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2376 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.FunctionVal = CurFun.CurrentFunction; @@ -4213,14 +4236,14 @@ case 235: ; break;} case 238: -#line 2387 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2387 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR ; break;} case 239: -#line 2392 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2392 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); @@ -4230,77 +4253,77 @@ case 239: ; break;} case 240: -#line 2404 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2404 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; CHECK_FOR_ERROR ; break;} case 241: -#line 2408 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2408 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; CHECK_FOR_ERROR ; break;} case 242: -#line 2413 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2413 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); CHECK_FOR_ERROR ; break;} case 243: -#line 2417 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2417 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); CHECK_FOR_ERROR ; break;} case 244: -#line 2421 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2421 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); CHECK_FOR_ERROR ; break;} case 245: -#line 2425 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2425 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR ; break;} case 246: -#line 2429 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2429 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR ; break;} case 247: -#line 2433 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2433 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::createNull(); CHECK_FOR_ERROR ; break;} case 248: -#line 2437 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2437 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::createUndef(); CHECK_FOR_ERROR ; break;} case 249: -#line 2441 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2441 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. yyval.ValIDVal = ValID::createZeroInit(); CHECK_FOR_ERROR ; break;} case 250: -#line 2445 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2445 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); int NumElements = yyvsp[-1].ConstVector->size(); @@ -4328,14 +4351,14 @@ case 250: ; break;} case 251: -#line 2470 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2470 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); CHECK_FOR_ERROR ; break;} case 252: -#line 2474 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2474 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::createInlineAsm(*yyvsp[-2].StrVal, *yyvsp[0].StrVal, yyvsp[-3].BoolVal); delete yyvsp[-2].StrVal; @@ -4344,21 +4367,21 @@ case 252: ; break;} case 253: -#line 2484 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2484 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); CHECK_FOR_ERROR ; break;} case 254: -#line 2488 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2488 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); CHECK_FOR_ERROR ; break;} case 255: -#line 2492 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2492 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? yyval.ValIDVal = ValID::createLocalName(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; @@ -4366,7 +4389,7 @@ case 255: ; break;} case 256: -#line 2497 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2497 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? yyval.ValIDVal = ValID::createGlobalName(*yyvsp[0].StrVal); delete yyvsp[0].StrVal; @@ -4374,7 +4397,7 @@ case 256: ; break;} case 259: -#line 2510 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2510 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -4384,21 +4407,21 @@ case 259: ; break;} case 260: -#line 2519 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2519 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR ; break;} case 261: -#line 2523 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2523 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR ; break;} case 262: -#line 2532 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2532 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR @@ -4409,7 +4432,7 @@ case 262: ; break;} case 263: -#line 2541 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2541 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal)) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) @@ -4421,14 +4444,14 @@ case 263: ; break;} case 264: -#line 2550 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2550 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty space between instruction lists yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); CHECK_FOR_ERROR ; break;} case 265: -#line 2554 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2554 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Labelled (named) basic block yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(*yyvsp[0].StrVal)); delete yyvsp[0].StrVal; @@ -4437,21 +4460,21 @@ case 265: ; break;} case 266: -#line 2561 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2561 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); CHECK_FOR_ERROR ; break;} case 267: -#line 2565 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2565 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... yyval.TermInstVal = new ReturnInst(); CHECK_FOR_ERROR ; break;} case 268: -#line 2569 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2569 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR @@ -4459,7 +4482,7 @@ case 268: ; break;} case 269: -#line 2574 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2574 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?"); BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); @@ -4472,7 +4495,7 @@ case 269: ; break;} case 270: -#line 2584 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2584 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); CHECK_FOR_ERROR @@ -4494,7 +4517,7 @@ case 270: ; break;} case 271: -#line 2603 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2603 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); CHECK_FOR_ERROR @@ -4506,7 +4529,7 @@ case 271: ; break;} case 272: -#line 2613 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2613 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -4521,7 +4544,7 @@ case 272: ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-6].ParamAttrs; Attrs.push_back(PAWI); } - ValueRefList::iterator I = yyvsp[-8].ValueRefList->begin(), E = yyvsp[-8].ValueRefList->end(); + ParamList::iterator I = yyvsp[-8].ParamList->begin(), E = yyvsp[-8].ParamList->end(); unsigned index = 1; for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); @@ -4552,7 +4575,7 @@ case 272: // Check the arguments ValueList Args; - if (yyvsp[-8].ValueRefList->empty()) { // Has no arguments? + if (yyvsp[-8].ParamList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -4562,7 +4585,7 @@ case 272: // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = yyvsp[-8].ValueRefList->begin(), ArgE = yyvsp[-8].ValueRefList->end(); + ParamList::iterator ArgI = yyvsp[-8].ParamList->begin(), ArgE = yyvsp[-8].ParamList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -4583,26 +4606,26 @@ case 272: InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end()); II->setCallingConv(yyvsp[-12].UIntVal); yyval.TermInstVal = II; - delete yyvsp[-8].ValueRefList; + delete yyvsp[-8].ParamList; CHECK_FOR_ERROR ; break;} case 273: -#line 2692 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2692 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TermInstVal = new UnwindInst(); CHECK_FOR_ERROR ; break;} case 274: -#line 2696 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2696 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.TermInstVal = new UnreachableInst(); CHECK_FOR_ERROR ; break;} case 275: -#line 2703 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2703 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.JumpTable = yyvsp[-5].JumpTable; Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); @@ -4616,7 +4639,7 @@ case 275: ; break;} case 276: -#line 2714 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2714 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.JumpTable = new std::vector >(); Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); @@ -4631,7 +4654,7 @@ case 276: ; break;} case 277: -#line 2727 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2727 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); @@ -4642,7 +4665,7 @@ case 277: ; break;} case 278: -#line 2737 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2737 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription()); @@ -4656,7 +4679,7 @@ case 278: ; break;} case 279: -#line 2748 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2748 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.PHIList = yyvsp[-6].PHIList; Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal); @@ -4667,61 +4690,79 @@ case 279: ; break;} case 280: -#line 2758 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2758 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); // Used for call and invoke instructions - yyval.ValueRefList = new ValueRefList(); - ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); - yyval.ValueRefList->push_back(E); + yyval.ParamList = new ParamList(); + ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); delete yyvsp[-2].TypeVal; ; break;} case 281: -#line 2767 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2767 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" +{ + // Labels are only valid in ASMs + yyval.ParamList = new ParamList(); + ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); + ; + break;} +case 282: +#line 2773 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - yyval.ValueRefList = yyvsp[-4].ValueRefList; - ValueRefListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); - yyval.ValueRefList->push_back(E); + yyval.ParamList = yyvsp[-4].ParamList; + ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-2].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR ; break;} -case 282: -#line 2776 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ValueRefList = new ValueRefList(); ; - break;} case 283: -#line 2779 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ValueList = new std::vector(); ; +#line 2782 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamList = yyvsp[-4].ParamList; + ParamListEntry E; E.Attrs = yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); + CHECK_FOR_ERROR + ; break;} case 284: -#line 2780 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2788 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamList = new ParamList(); ; + break;} +case 285: +#line 2791 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = new std::vector(); ; + break;} +case 286: +#line 2792 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.ValueList = yyvsp[-2].ValueList; yyval.ValueList->push_back(yyvsp[0].ValueVal); CHECK_FOR_ERROR ; break;} -case 285: -#line 2787 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 287: +#line 2799 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; CHECK_FOR_ERROR ; break;} -case 286: -#line 2791 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 288: +#line 2803 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; CHECK_FOR_ERROR ; break;} -case 287: -#line 2796 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 289: +#line 2808 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); @@ -4744,8 +4785,8 @@ case 287: delete yyvsp[-3].TypeVal; ; break;} -case 288: -#line 2817 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 290: +#line 2829 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); @@ -4764,8 +4805,8 @@ case 288: delete yyvsp[-3].TypeVal; ; break;} -case 289: -#line 2834 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 291: +#line 2846 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); @@ -4781,8 +4822,8 @@ case 289: delete yyvsp[-3].TypeVal; ; break;} -case 290: -#line 2848 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 292: +#line 2860 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); @@ -4798,8 +4839,8 @@ case 290: delete yyvsp[-3].TypeVal; ; break;} -case 291: -#line 2862 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 293: +#line 2874 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); @@ -4813,8 +4854,8 @@ case 291: delete yyvsp[0].TypeVal; ; break;} -case 292: -#line 2874 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 294: +#line 2886 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); @@ -4824,8 +4865,8 @@ case 292: CHECK_FOR_ERROR ; break;} -case 293: -#line 2882 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 295: +#line 2894 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); @@ -4834,8 +4875,8 @@ case 293: CHECK_FOR_ERROR ; break;} -case 294: -#line 2889 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 296: +#line 2901 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid extractelement operands"); @@ -4843,8 +4884,8 @@ case 294: CHECK_FOR_ERROR ; break;} -case 295: -#line 2895 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 297: +#line 2907 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid insertelement operands"); @@ -4852,8 +4893,8 @@ case 295: CHECK_FOR_ERROR ; break;} -case 296: -#line 2901 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 298: +#line 2913 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid shufflevector operands"); @@ -4861,8 +4902,8 @@ case 296: CHECK_FOR_ERROR ; break;} -case 297: -#line 2907 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 299: +#line 2919 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = yyvsp[0].PHIList->front().first->getType(); if (!Ty->isFirstClassType()) @@ -4879,8 +4920,8 @@ case 297: CHECK_FOR_ERROR ; break;} -case 298: -#line 2923 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 300: +#line 2935 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { // Handle the short syntax @@ -4896,7 +4937,7 @@ case 298: Attrs.push_back(PAWI); } unsigned index = 1; - ValueRefList::iterator I = yyvsp[-2].ValueRefList->begin(), E = yyvsp[-2].ValueRefList->end(); + ParamList::iterator I = yyvsp[-2].ParamList->begin(), E = yyvsp[-2].ParamList->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) @@ -4930,7 +4971,7 @@ case 298: // Check the arguments ValueList Args; - if (yyvsp[-2].ValueRefList->empty()) { // Has no arguments? + if (yyvsp[-2].ParamList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -4941,7 +4982,7 @@ case 298: // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = yyvsp[-2].ValueRefList->begin(), ArgE = yyvsp[-2].ValueRefList->end(); + ParamList::iterator ArgI = yyvsp[-2].ParamList->begin(), ArgE = yyvsp[-2].ParamList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -4961,34 +5002,34 @@ case 298: CI->setTailCall(yyvsp[-7].BoolVal); CI->setCallingConv(yyvsp[-6].UIntVal); yyval.InstVal = CI; - delete yyvsp[-2].ValueRefList; + delete yyvsp[-2].ParamList; delete yyvsp[-5].TypeVal; CHECK_FOR_ERROR ; break;} -case 299: -#line 3007 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 301: +#line 3019 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR ; break;} -case 300: -#line 3012 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 302: +#line 3024 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = true; CHECK_FOR_ERROR ; break;} -case 301: -#line 3016 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 303: +#line 3028 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { yyval.BoolVal = false; CHECK_FOR_ERROR ; break;} -case 302: -#line 3023 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 304: +#line 3035 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -4997,8 +5038,8 @@ case 302: CHECK_FOR_ERROR ; break;} -case 303: -#line 3030 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 305: +#line 3042 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); @@ -5008,8 +5049,8 @@ case 303: delete yyvsp[-4].TypeVal; ; break;} -case 304: -#line 3038 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 306: +#line 3050 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); @@ -5018,8 +5059,8 @@ case 304: CHECK_FOR_ERROR ; break;} -case 305: -#line 3045 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 307: +#line 3057 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); @@ -5029,8 +5070,8 @@ case 305: delete yyvsp[-4].TypeVal; ; break;} -case 306: -#line 3053 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 308: +#line 3065 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa(yyvsp[0].ValueVal->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -5039,8 +5080,8 @@ case 306: CHECK_FOR_ERROR ; break;} -case 307: -#line 3061 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 309: +#line 3073 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -5056,8 +5097,8 @@ case 307: delete yyvsp[-2].TypeVal; ; break;} -case 308: -#line 3075 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 310: +#line 3087 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -5076,8 +5117,8 @@ case 308: delete yyvsp[-2].TypeVal; ; break;} -case 309: -#line 3092 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +case 311: +#line 3104 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); @@ -5316,7 +5357,7 @@ yyerrhandle: } return 1; } -#line 3109 "/Volumes/MacOS9/gcc/llvm/lib/AsmParser/llvmAsmParser.y" +#line 3121 "/Volumes/MacOS9/gcc/llvm-gcc-main/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions diff --git a/lib/AsmParser/llvmAsmParser.h.cvs b/lib/AsmParser/llvmAsmParser.h.cvs index d6cf28d31e8..84d89159276 100644 --- a/lib/AsmParser/llvmAsmParser.h.cvs +++ b/lib/AsmParser/llvmAsmParser.h.cvs @@ -14,7 +14,7 @@ typedef union { llvm::ArgListType *ArgList; llvm::TypeWithAttrs TypeWithAttrs; llvm::TypeWithAttrsList *TypeWithAttrsList; - llvm::ValueRefList *ValueRefList; + llvm::ParamList *ParamList; // Represent the RHS of PHI node std::list ConstVector %type ArgList ArgListH %type PHIList -%type ValueRefList // For call param lists & GEP indices +%type ParamList // For call param lists & GEP indices %type IndexList // For GEP indices %type TypeListI %type ArgTypeList ArgTypeListI @@ -2609,7 +2609,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... $$ = S; CHECK_FOR_ERROR } - | INVOKE OptCallingConv ResultTypes ValueRef '(' ValueRefList ')' OptFuncAttrs + | INVOKE OptCallingConv ResultTypes ValueRef '(' ParamList ')' OptFuncAttrs TO LABEL ValueRef UNWIND LABEL ValueRef { // Handle the short syntax @@ -2624,7 +2624,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8; Attrs.push_back(PAWI); } - ValueRefList::iterator I = $6->begin(), E = $6->end(); + ParamList::iterator I = $6->begin(), E = $6->end(); unsigned index = 1; for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); @@ -2665,7 +2665,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = $6->begin(), ArgE = $6->end(); + ParamList::iterator ArgI = $6->begin(), ArgE = $6->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -2755,25 +2755,37 @@ PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes }; -ValueRefList : Types ValueRef OptParamAttrs { +ParamList : Types ValueRef OptParamAttrs { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription()); // Used for call and invoke instructions - $$ = new ValueRefList(); - ValueRefListEntry E; E.Attrs = $3; E.Val = getVal($1->get(), $2); + $$ = new ParamList(); + ParamListEntry E; E.Attrs = $3; E.Val = getVal($1->get(), $2); $$->push_back(E); delete $1; } - | ValueRefList ',' Types ValueRef OptParamAttrs { + | LABEL ValueRef OptParamAttrs { + // Labels are only valid in ASMs + $$ = new ParamList(); + ParamListEntry E; E.Attrs = $3; E.Val = getBBVal($2); + $$->push_back(E); + } + | ParamList ',' Types ValueRef OptParamAttrs { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); $$ = $1; - ValueRefListEntry E; E.Attrs = $5; E.Val = getVal($3->get(), $4); + ParamListEntry E; E.Attrs = $5; E.Val = getVal($3->get(), $4); $$->push_back(E); delete $3; CHECK_FOR_ERROR } - | /*empty*/ { $$ = new ValueRefList(); }; + | ParamList ',' LABEL ValueRef OptParamAttrs { + $$ = $1; + ParamListEntry E; E.Attrs = $5; E.Val = getBBVal($4); + $$->push_back(E); + CHECK_FOR_ERROR + } + | /*empty*/ { $$ = new ParamList(); }; IndexList // Used for gep instructions and constant expressions : /*empty*/ { $$ = new std::vector(); } @@ -2919,7 +2931,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { delete $2; // Free the list... CHECK_FOR_ERROR } - | OptTailCall OptCallingConv ResultTypes ValueRef '(' ValueRefList ')' + | OptTailCall OptCallingConv ResultTypes ValueRef '(' ParamList ')' OptFuncAttrs { // Handle the short syntax @@ -2935,7 +2947,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { Attrs.push_back(PAWI); } unsigned index = 1; - ValueRefList::iterator I = $6->begin(), E = $6->end(); + ParamList::iterator I = $6->begin(), E = $6->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) @@ -2980,7 +2992,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = $6->begin(), ArgE = $6->end(); + ParamList::iterator ArgI = $6->begin(), ArgE = $6->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs index d2e5256de88..70845385840 100644 --- a/lib/AsmParser/llvmAsmParser.y.cvs +++ b/lib/AsmParser/llvmAsmParser.y.cvs @@ -981,7 +981,7 @@ Module *llvm::RunVMAsmParser(const char * AsmString, Module * M) { llvm::ArgListType *ArgList; llvm::TypeWithAttrs TypeWithAttrs; llvm::TypeWithAttrsList *TypeWithAttrsList; - llvm::ValueRefList *ValueRefList; + llvm::ParamList *ParamList; // Represent the RHS of PHI node std::list ConstVector %type ArgList ArgListH %type PHIList -%type ValueRefList // For call param lists & GEP indices +%type ParamList // For call param lists & GEP indices %type IndexList // For GEP indices %type TypeListI %type ArgTypeList ArgTypeListI @@ -2609,7 +2609,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... $$ = S; CHECK_FOR_ERROR } - | INVOKE OptCallingConv ResultTypes ValueRef '(' ValueRefList ')' OptFuncAttrs + | INVOKE OptCallingConv ResultTypes ValueRef '(' ParamList ')' OptFuncAttrs TO LABEL ValueRef UNWIND LABEL ValueRef { // Handle the short syntax @@ -2624,7 +2624,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = $8; Attrs.push_back(PAWI); } - ValueRefList::iterator I = $6->begin(), E = $6->end(); + ParamList::iterator I = $6->begin(), E = $6->end(); unsigned index = 1; for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); @@ -2665,7 +2665,7 @@ BBTerminatorInst : RET ResolvedVal { // Return with a result... // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = $6->begin(), ArgE = $6->end(); + ParamList::iterator ArgI = $6->begin(), ArgE = $6->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -2755,25 +2755,37 @@ PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes }; -ValueRefList : Types ValueRef OptParamAttrs { +ParamList : Types ValueRef OptParamAttrs { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription()); // Used for call and invoke instructions - $$ = new ValueRefList(); - ValueRefListEntry E; E.Attrs = $3; E.Val = getVal($1->get(), $2); + $$ = new ParamList(); + ParamListEntry E; E.Attrs = $3; E.Val = getVal($1->get(), $2); $$->push_back(E); delete $1; } - | ValueRefList ',' Types ValueRef OptParamAttrs { + | LABEL ValueRef OptParamAttrs { + // Labels are only valid in ASMs + $$ = new ParamList(); + ParamListEntry E; E.Attrs = $3; E.Val = getBBVal($2); + $$->push_back(E); + } + | ParamList ',' Types ValueRef OptParamAttrs { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$3)->getDescription()); $$ = $1; - ValueRefListEntry E; E.Attrs = $5; E.Val = getVal($3->get(), $4); + ParamListEntry E; E.Attrs = $5; E.Val = getVal($3->get(), $4); $$->push_back(E); delete $3; CHECK_FOR_ERROR } - | /*empty*/ { $$ = new ValueRefList(); }; + | ParamList ',' LABEL ValueRef OptParamAttrs { + $$ = $1; + ParamListEntry E; E.Attrs = $5; E.Val = getBBVal($4); + $$->push_back(E); + CHECK_FOR_ERROR + } + | /*empty*/ { $$ = new ParamList(); }; IndexList // Used for gep instructions and constant expressions : /*empty*/ { $$ = new std::vector(); } @@ -2919,7 +2931,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { delete $2; // Free the list... CHECK_FOR_ERROR } - | OptTailCall OptCallingConv ResultTypes ValueRef '(' ValueRefList ')' + | OptTailCall OptCallingConv ResultTypes ValueRef '(' ParamList ')' OptFuncAttrs { // Handle the short syntax @@ -2935,7 +2947,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { Attrs.push_back(PAWI); } unsigned index = 1; - ValueRefList::iterator I = $6->begin(), E = $6->end(); + ParamList::iterator I = $6->begin(), E = $6->end(); for (; I != E; ++I, ++index) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) @@ -2980,7 +2992,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = $6->begin(), ArgE = $6->end(); + ParamList::iterator ArgI = $6->begin(), ArgE = $6->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 72785579967..0bacf0fe70e 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1506,7 +1506,10 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { SmallVector Args; // Read the fixed params. for (unsigned i = 0, e = FTy->getNumParams(); i != e; ++i, ++OpNum) { - Args.push_back(getFnValueByID(Record[OpNum], FTy->getParamType(i))); + if (FTy->getParamType(i)->getTypeID()==Type::LabelTyID) + Args.push_back(getBasicBlock(Record[OpNum])); + else + Args.push_back(getFnValueByID(Record[OpNum], FTy->getParamType(i))); if (Args.back() == 0) return Error("Invalid CALL record"); } diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index e7c7448f9ba..3500d1245a0 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -1188,13 +1188,18 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { unsigned OpFlags = MI->getOperand(OpNo).getImmedValue(); ++OpNo; // Skip over the ID number. - AsmPrinter *AP = const_cast(this); - if ((OpFlags & 7) == 4 /*ADDR MODE*/) { - Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant, - Modifier[0] ? Modifier : 0); - } else { - Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant, - Modifier[0] ? Modifier : 0); + if (Modifier[0]=='l') // labels are target independent + printBasicBlockLabel(MI->getOperand(OpNo).getMachineBasicBlock(), + false, false); + else { + AsmPrinter *AP = const_cast(this); + if ((OpFlags & 7) == 4 /*ADDR MODE*/) { + Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant, + Modifier[0] ? Modifier : 0); + } else { + Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant, + Modifier[0] ? Modifier : 0); + } } } if (Error) { diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp index c98c1312fd6..ec84b705bbf 100644 --- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp +++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp @@ -803,10 +803,13 @@ void ScheduleDAG::EmitNode(SDNode *Node, unsigned InstanceNo, if (ConstantSDNode *CS = dyn_cast(Node->getOperand(i))) { MI->addImmOperand(CS->getValue()); - } else { - GlobalAddressSDNode *GA = - cast(Node->getOperand(i)); + } else if (GlobalAddressSDNode *GA = + dyn_cast(Node->getOperand(i))) { MI->addGlobalAddressOperand(GA->getGlobal(), GA->getOffset()); + } else { + BasicBlockSDNode *BB = + cast(Node->getOperand(i)); + MI->addMachineBasicBlockOperand(BB->getBasicBlock()); } } break; diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 44d81883359..5c2765b9168 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -3489,31 +3489,37 @@ void SelectionDAGLowering::visitInlineAsm(CallInst &I) { } // If this is an input or an indirect output, process the call argument. + // BasicBlocks are labels, currently appearing only in asm's. if (OpInfo.CallOperandVal) { - OpInfo.CallOperand = getValue(OpInfo.CallOperandVal); - const Type *OpTy = OpInfo.CallOperandVal->getType(); - // If this is an indirect operand, the operand is a pointer to the - // accessed type. - if (OpInfo.isIndirect) - OpTy = cast(OpTy)->getElementType(); - - // If OpTy is not a first-class value, it may be a struct/union that we - // can tile with integers. - if (!OpTy->isFirstClassType() && OpTy->isSized()) { - unsigned BitSize = TD->getTypeSizeInBits(OpTy); - switch (BitSize) { - default: break; - case 1: - case 8: - case 16: - case 32: - case 64: - OpTy = IntegerType::get(BitSize); - break; + if (isa(OpInfo.CallOperandVal)) + OpInfo.CallOperand = + DAG.getBasicBlock(FuncInfo.MBBMap[cast(OpInfo.CallOperandVal)]); + else { + OpInfo.CallOperand = getValue(OpInfo.CallOperandVal); + const Type *OpTy = OpInfo.CallOperandVal->getType(); + // If this is an indirect operand, the operand is a pointer to the + // accessed type. + if (OpInfo.isIndirect) + OpTy = cast(OpTy)->getElementType(); + + // If OpTy is not a first-class value, it may be a struct/union that we + // can tile with integers. + if (!OpTy->isFirstClassType() && OpTy->isSized()) { + unsigned BitSize = TD->getTypeSizeInBits(OpTy); + switch (BitSize) { + default: break; + case 1: + case 8: + case 16: + case 32: + case 64: + OpTy = IntegerType::get(BitSize); + break; + } } + + OpVT = TLI.getValueType(OpTy, true); } - - OpVT = TLI.getValueType(OpTy, true); } OpInfo.ConstraintVT = OpVT; diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index cffb03da520..9309cf46bd2 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1396,10 +1396,15 @@ void TargetLowering::LowerAsmOperandForConstraint(SDOperand Op, SelectionDAG &DAG) { switch (ConstraintLetter) { default: break; + case 'X': // Allows any operand; labels (basic block) use this. + if (Op.getOpcode() == ISD::BasicBlock) { + Ops.push_back(Op); + return; + } + // fall through case 'i': // Simple Integer or Relocatable Constant case 'n': // Simple Integer - case 's': // Relocatable Constant - case 'X': { // Allows any operand. + case 's': { // Relocatable Constant // These operands are interested in values of the form (GV+C), where C may // be folded in as an offset of GV, or it may be explicitly added. Also, it // is possible and fine if either GV or C are missing. diff --git a/test/CodeGen/X86/asm-block-labels.ll b/test/CodeGen/X86/asm-block-labels.ll new file mode 100644 index 00000000000..284a9fb00fd --- /dev/null +++ b/test/CodeGen/X86/asm-block-labels.ll @@ -0,0 +1,41 @@ +; RUN: llvm-as < %s | opt -std-compile-opts | llc +; ModuleID = 'block12.c' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin8" + +define void @bar() { +entry: + br label %"LASM$foo" + +"LASM$foo": ; preds = %entry + call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect ".line 1", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect "int $$1", "~{dirflag},~{fpsr},~{flags},~{memory}"( ) + call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect ".line 2", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect "brl ${0:l}", "X,~{dirflag},~{fpsr},~{flags},~{memory}"( label %"LASM$foo" ) + br label %return + +return: ; preds = %"LASM$foo" + ret void +} + +define void @baz() { +entry: + call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect ".line 3", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect "brl ${0:l}", "X,~{dirflag},~{fpsr},~{flags},~{memory}"( label %"LASM$foo" ) + call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect ".line 4", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect "int $$1", "~{dirflag},~{fpsr},~{flags},~{memory}"( ) + br label %"LASM$foo" + +"LASM$foo": ; preds = %entry + call void asm sideeffect ".file \22block12.c\22", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect ".line 5", "~{dirflag},~{fpsr},~{flags}"( ) + call void asm sideeffect "int $$1", "~{dirflag},~{fpsr},~{flags},~{memory}"( ) + br label %return + +return: ; preds = %"LASM$foo" + ret void +}