From jlaskey at apple.com Mon Feb 12 05:32:31 2007 From: jlaskey at apple.com (jlaskey at apple.com) Date: Mon, 12 Feb 2007 03:32:31 -0800 (PST) Subject: [llvm-commits] [123716] Reid's StripDeadPrototypes patch Message-ID: <20070212113231.254513D31ECD@src> Revision: 123716 Author: jlaskey Date: 2007-02-12 03:32:30 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Reid's StripDeadPrototypes patch Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-backend.cpp Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-11 11:46:07 UTC (rev 123715) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-12 11:32:30 UTC (rev 123716) @@ -260,62 +260,63 @@ HasPerModulePasses = true; PassManager *PM = PerModulePasses; if (flag_unit_at_a_time) - PM->add(createRaiseAllocationsPass()); // call %malloc -> malloc inst - PM->add(createCFGSimplificationPass()); // Clean up disgusting code - PM->add(createPromoteMemoryToRegisterPass());// Kill useless allocas + PM->add(createRaiseAllocationsPass()); // call %malloc -> malloc inst + PM->add(createCFGSimplificationPass()); // Clean up disgusting code + PM->add(createPromoteMemoryToRegisterPass()); // Kill useless allocas if (flag_unit_at_a_time) { - PM->add(createGlobalOptimizerPass()); // Optimize out global vars - PM->add(createGlobalDCEPass()); // Remove unused fns and globs - PM->add(createIPConstantPropagationPass());// IP Constant Propagation - PM->add(createDeadArgEliminationPass()); // Dead argument elimination + PM->add(createGlobalOptimizerPass()); // Optimize out global vars + PM->add(createGlobalDCEPass()); // Remove unused fns and globs + PM->add(createIPConstantPropagationPass()); // IP Constant Propagation + PM->add(createDeadArgEliminationPass()); // Dead argument elimination } - PM->add(createInstructionCombiningPass()); // Clean up after IPCP & DAE + PM->add(createInstructionCombiningPass()); // Clean up after IPCP & DAE // DISABLE PREDSIMPLIFY UNTIL PR967 is fixed. - //PM->add(createPredicateSimplifierPass()); // Canonicalize registers - PM->add(createCFGSimplificationPass()); // Clean up after IPCP & DAE + //PM->add(createPredicateSimplifierPass()); // Canonicalize registers + PM->add(createCFGSimplificationPass()); // Clean up after IPCP & DAE if (flag_unit_at_a_time) - PM->add(createPruneEHPass()); // Remove dead EH info + PM->add(createPruneEHPass()); // Remove dead EH info if (optimize > 1) { - if (flag_inline_trees > 1) // respect -fno-inline-functions - PM->add(createFunctionInliningPass()); // Inline small functions + if (flag_inline_trees > 1) // respect -fno-inline-functions + PM->add(createFunctionInliningPass()); // Inline small functions if (flag_unit_at_a_time) - PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations + PM->add(createSimplifyLibCallsPass()); // Library Call Optimizations if (optimize > 2) - PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args + PM->add(createArgumentPromotionPass()); // Scalarize uninlined fn args } - PM->add(createTailDuplicationPass()); // Simplify cfg by copying code - PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl. - PM->add(createCFGSimplificationPass()); // Merge & remove BBs - PM->add(createScalarReplAggregatesPass()); // Break up aggregate allocas - PM->add(createInstructionCombiningPass()); // Combine silly seq's - PM->add(createCondPropagationPass()); // Propagate conditionals - PM->add(createTailCallEliminationPass()); // Eliminate tail calls - PM->add(createCFGSimplificationPass()); // Merge & remove BBs - PM->add(createReassociatePass()); // Reassociate expressions - PM->add(createLICMPass()); // Hoist loop invariants - PM->add(createLoopUnswitchPass()); // Unswitch loops. - PM->add(createInstructionCombiningPass()); // Clean up after LICM/reassoc - PM->add(createIndVarSimplifyPass()); // Canonicalize indvars + PM->add(createTailDuplicationPass()); // Simplify cfg by copying code + PM->add(createInstructionCombiningPass()); // Cleanup for scalarrepl. + PM->add(createCFGSimplificationPass()); // Merge & remove BBs + PM->add(createScalarReplAggregatesPass()); // Break up aggregate allocas + PM->add(createInstructionCombiningPass()); // Combine silly seq's + PM->add(createCondPropagationPass()); // Propagate conditionals + PM->add(createTailCallEliminationPass()); // Eliminate tail calls + PM->add(createCFGSimplificationPass()); // Merge & remove BBs + PM->add(createReassociatePass()); // Reassociate expressions + PM->add(createLICMPass()); // Hoist loop invariants + PM->add(createLoopUnswitchPass()); // Unswitch loops. + PM->add(createInstructionCombiningPass()); // Clean up after LICM/reassoc + PM->add(createIndVarSimplifyPass()); // Canonicalize indvars if (flag_unroll_loops) - PM->add(createLoopUnrollPass()); // Unroll small loops - PM->add(createInstructionCombiningPass()); // Clean up after the unroller - PM->add(createLoadValueNumberingPass()); // GVN for load instructions - PM->add(createGCSEPass()); // Remove common subexprs - PM->add(createSCCPPass()); // Constant prop with SCCP + PM->add(createLoopUnrollPass()); // Unroll small loops + PM->add(createInstructionCombiningPass()); // Clean up after the unroller + PM->add(createLoadValueNumberingPass()); // GVN for load instructions + PM->add(createGCSEPass()); // Remove common subexprs + PM->add(createSCCPPass()); // Constant prop with SCCP // Run instcombine after redundancy elimination to exploit opportunities // opened up by them. PM->add(createInstructionCombiningPass()); - PM->add(createCondPropagationPass()); // Propagate conditionals - PM->add(createDeadStoreEliminationPass()); // Delete dead stores - PM->add(createAggressiveDCEPass()); // SSA based 'Aggressive DCE' - PM->add(createCFGSimplificationPass()); // Merge & remove BBs + PM->add(createCondPropagationPass()); // Propagate conditionals + PM->add(createDeadStoreEliminationPass()); // Delete dead stores + PM->add(createAggressiveDCEPass()); // SSA based 'Aggressive DCE' + PM->add(createCFGSimplificationPass()); // Merge & remove BBs if (optimize > 1 && flag_unit_at_a_time) - PM->add(createConstantMergePass()); // Merge dup global constants + PM->add(createConstantMergePass()); // Merge dup global constants + PM->add(createStripDeadPrototypesPass()); // Get rid of dead prototypes } if (emit_llvm_bc) { From dpatel at apple.com Mon Feb 12 11:41:51 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Mon, 12 Feb 2007 09:41:51 -0800 (PST) Subject: [llvm-commits] [123742] Quote PCH patch in preprocessed output. Message-ID: <20070212174151.83F7A3DA79E4@src> Revision: 123742 Author: dpatel Date: 2007-02-12 09:41:51 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Quote PCH patch in preprocessed output. Patch by Anton Korobeynikov. Modified Paths: -------------- apple-local/branches/llvm/gcc/c-ppoutput.c Modified: apple-local/branches/llvm/gcc/c-ppoutput.c =================================================================== --- apple-local/branches/llvm/gcc/c-ppoutput.c 2007-02-12 09:32:08 UTC (rev 123741) +++ apple-local/branches/llvm/gcc/c-ppoutput.c 2007-02-12 17:41:51 UTC (rev 123742) @@ -21,6 +21,8 @@ #include "system.h" #include "coretypes.h" #include "tm.h" +/* APPLE LOCAL LLVM */ +#include "toplev.h" #include "cpplib.h" #include "../libcpp/internal.h" #include "tree.h" @@ -435,6 +437,10 @@ { c_common_read_pch (pfile, name, fd, orig_name); - fprintf (print.outf, "#pragma GCC pch_preprocess \"%s\"\n", name); + /* APPLE LOCAL begin LLVM */ + fprintf (print.outf, "#pragma GCC pch_preprocess "); + output_quoted_string (print.outf, name); + fprintf (print.outf, "\n"); + /* APPLE LOCAL end LLVM */ print.src_line++; } From reid at x10sys.com Mon Feb 12 11:52:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 11:52:11 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/.cvsignore Message-ID: <200702121752.l1CHqBrN025330@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: .cvsignore added (r1.1) --- Log message: Ignore the Output directory. --- Diffs of the changes: (+1 -0) .cvsignore | 1 + 1 files changed, 1 insertion(+) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/.cvsignore diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/.cvsignore:1.1 *** /dev/null Mon Feb 12 11:52:05 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/.cvsignore Mon Feb 12 11:51:55 2007 *************** *** 0 **** --- 1 ---- + Output From reid at x10sys.com Mon Feb 12 11:53:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 11:53:16 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bit_concat.c bit_concat.reference_output bit_reduce.c bit_reduce.reference_output part_select.c part_select.reference_output bit_select.c Message-ID: <200702121753.l1CHrGAm025367@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bit_concat.c added (r1.1) bit_concat.reference_output added (r1.1) bit_reduce.c added (r1.1) bit_reduce.reference_output added (r1.1) part_select.c added (r1.1) part_select.reference_output added (r1.1) bit_select.c updated: 1.1 -> 1.2 --- Log message: Update/Add tests for the arbitrary bit width builtin functions. --- Diffs of the changes: (+323 -3) bit_concat.c | 62 ++++++++++++++++++++++ bit_concat.reference_output | 119 ++++++++++++++++++++++++++++++++++++++++++++ bit_reduce.c | 67 ++++++++++++++++++++++++ bit_reduce.reference_output | 18 ++++++ bit_select.c | 6 +- part_select.c | 54 +++++++++++++++++++ 6 files changed, 323 insertions(+), 3 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.1 *** /dev/null Mon Feb 12 11:53:09 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat.c Mon Feb 12 11:52:59 2007 *************** *** 0 **** --- 1,62 ---- + //===--- part_select.c --- Test The bit_select builtin --------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This test case tests the __builtin_part_select builtin function llvm-gcc. + // bit_select selects one bit out of a larger + // + //===----------------------------------------------------------------------===// + + #include + #include + + typedef unsigned int __attribute__((bitwidth(17))) BitType1; + typedef unsigned int __attribute__((bitwidth(19))) BitType2; + typedef unsigned long long __attribute__((bitwidth(36))) ConcatType; + int numbits1 = 17; + int numbits2 = 19; + + void printBits(ConcatType val, int numbits ) { + int j; + for (j = numbits-1; j >= 0; --j) { + if (__builtin_bit_select(val, j)) + printf("1"); + else + printf("0"); + } + } + + int main(int argc, char** argv) + { + BitType1 X = 0; + BitType2 Y = 0; + ConcatType Z = 0; + int i, j; + int count = (argc > 1 ? atoi(argv[1]) % 128 : 128); + + srand(count); + + for (i = 0; i < count; i++) { + Y = X = 0; + for (j = 0; j < numbits1; j++) { + X += (rand() % 2 == 0 ? 0 : 1); + X <<= 1; + } + for (j = 0; j < numbits2; j++) { + Y += (rand() % 2 == 0 ? 0 : 1); + Y <<= 1; + } + Z = __builtin_bit_concat(X, Y); + printf("bit_concat("); + printBits(X, numbits1); + printf(","); + printBits(Y, numbits2); + printf(") = "); + printBits(Z, numbits1 + numbits2); + printf("\n"); + } + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output:1.1 *** /dev/null Mon Feb 12 11:53:16 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output Mon Feb 12 11:52:59 2007 *************** *** 0 **** --- 1,119 ---- + bit_concat(01111000000011100,0100110100110111000) = 011110000000111000100110100110111000 + bit_concat(10111100010110100,0000010011010100000) = 101111000101101000000010011010100000 + bit_concat(10011000010110000,1010110100000110100) = 100110000101100001010110100000110100 + bit_concat(00001001101011100,1001000111110110110) = 000010011010111001001000111110110110 + bit_concat(11101001101111100,1001000011000010100) = 111010011011111001001000011000010100 + bit_concat(10000101010010000,0001111111111101110) = 100001010100100000001111111111101110 + bit_concat(11110111001001100,0101010101100111000) = 111101110010011000101010101100111000 + bit_concat(00100000010010010,0100010001100100000) = 001000000100100100100010001100100000 + bit_concat(01000110111110100,0010011001000001010) = 010001101111101000010011001000001010 + bit_concat(10101001111001100,0110110111000110100) = 101010011110011000110110111000110100 + bit_concat(10001101100001010,1111011010000010000) = 100011011000010101111011010000010000 + bit_concat(00110111110111100,0101111011011011000) = 001101111101111000101111011011011000 + bit_concat(10101100010011110,0011110000000010100) = 101011000100111100011110000000010100 + bit_concat(00001110001100010,0100100001011011110) = 000011100011000100100100001011011110 + bit_concat(00100000001001000,0000011110101100010) = 001000000010010000000011110101100010 + bit_concat(11111010110011010,1001011010011000100) = 111110101100110101001011010011000100 + bit_concat(01111010100010000,0011010111111010000) = 011110101000100000011010111111010000 + bit_concat(00010011010110000,1111000101101101110) = 000100110101100001111000101101101110 + bit_concat(10110111110111000,0000111001011101000) = 101101111101110000000111001011101000 + bit_concat(11100111011111100,0111010101111000110) = 111001110111111000111010101111000110 + bit_concat(00000111101110000,1000111001010101100) = 000001111011100001000111001010101100 + bit_concat(00010011011110010,1001101011101011000) = 000100110111100101001101011101011000 + bit_concat(01111100101001010,1000111110000000010) = 011111001010010101000111110000000010 + bit_concat(10100000110100000,1111111001001111010) = 101000001101000001111111001001111010 + bit_concat(01010000001000110,1001101010111110100) = 010100000010001101001101010111110100 + bit_concat(10111001110100110,1000011100010100000) = 101110011101001101000011100010100000 + bit_concat(10001010001010010,1000001010010000000) = 100010100010100101000001010010000000 + bit_concat(11111110111111110,1010000000001010110) = 111111101111111101010000000001010110 + bit_concat(00010011100100000,0010101000011000110) = 000100111001000000010101000011000110 + bit_concat(10101111101000010,0010011001011001100) = 101011111010000100010011001011001100 + bit_concat(00110100101001100,0100101001110010100) = 001101001010011000100101001110010100 + bit_concat(00010010100110110,1111000001000000100) = 000100101001101101111000001000000100 + bit_concat(11100001010111000,0101011011101011100) = 111000010101110000101011011101011100 + bit_concat(10011000001010000,1111001001111011000) = 100110000010100001111001001111011000 + bit_concat(01101000010001110,1101011110010011100) = 011010000100011101101011110010011100 + bit_concat(10111000111110100,0111110000110010000) = 101110001111101000111110000110010000 + bit_concat(00010111001011000,1101101100100101100) = 000101110010110001101101100100101100 + bit_concat(11011110011110100,1100110011101010000) = 110111100111101001100110011101010000 + bit_concat(10001110101000000,1000111010011001000) = 100011101010000001000111010011001000 + bit_concat(11100000000010000,1100111010110000100) = 111000000000100001100111010110000100 + bit_concat(10010001001000100,0001000000010000010) = 100100010010001000001000000010000010 + bit_concat(01110110100100010,0110111101100110100) = 011101101001000100110111101100110100 + bit_concat(01010010110111010,0000100111101101100) = 010100101101110100000100111101101100 + bit_concat(01110101110010010,0100100011111010000) = 011101011100100100100100011111010000 + bit_concat(10101100111011010,0000101000000000100) = 101011001110110100000101000000000100 + bit_concat(01010011111101100,1100100100111110000) = 010100111111011001100100100111110000 + bit_concat(01110000110111110,1111010101101100010) = 011100001101111101111010101101100010 + bit_concat(11101000111010100,0111001010001111110) = 111010001110101000111001010001111110 + bit_concat(11001100100001110,0101101000110101100) = 110011001000011100101101000110101100 + bit_concat(01001101011010010,1011110100000101100) = 010011010110100101011110100000101100 + bit_concat(00010111100011100,0011011001000000010) = 000101111000111000011011001000000010 + bit_concat(11001000100100010,0000000011010111110) = 110010001001000100000000011010111110 + bit_concat(10010000010010110,1000110101110100010) = 100100000100101101000110101110100010 + bit_concat(00111110101001000,1001110001000110000) = 001111101010010001001110001000110000 + bit_concat(11100100010101100,0000111000000011110) = 111001000101011000000111000000011110 + bit_concat(00111001111110010,1011001000011101110) = 001110011111100101011001000011101110 + bit_concat(11000111110101010,0000000010101010010) = 110001111101010100000000010101010010 + bit_concat(11110101000011010,0111110011011000110) = 111101010000110100111110011011000110 + bit_concat(11110011110010010,1100001111101010110) = 111100111100100101100001111101010110 + bit_concat(10100011010101100,0111011111000000000) = 101000110101011000111011111000000000 + bit_concat(01000010010011100,0111010000100100100) = 010000100100111000111010000100100100 + bit_concat(01100101111101010,0100110000000001100) = 011001011111010100100110000000001100 + bit_concat(10101111011110110,0101101101101111010) = 101011110111101100101101101101111010 + bit_concat(10011111100110100,1110000111010010000) = 100111111001101001110000111010010000 + bit_concat(11010101101010110,1110010011001011000) = 110101011010101101110010011001011000 + bit_concat(11001110100101000,1000110110010111110) = 110011101001010001000110110010111110 + bit_concat(00111101001010110,0001000011001001110) = 001111010010101100001000011001001110 + bit_concat(01111110100000110,1001101010001011000) = 011111101000001101001101010001011000 + bit_concat(11100100110110100,0101101100000010110) = 111001001101101000101101100000010110 + bit_concat(00011000000000010,0000101110100110000) = 000110000000000100000101110100110000 + bit_concat(01011011010010010,1010100101100001010) = 010110110100100101010100101100001010 + bit_concat(10111110100110010,0100110101000011110) = 101111101001100100100110101000011110 + bit_concat(00110101100110110,1001101101010110000) = 001101011001101101001101101010110000 + bit_concat(11001110110000010,0000111100000111110) = 110011101100000100000111100000111110 + bit_concat(01110110111011110,0000000111010111110) = 011101101110111100000000111010111110 + bit_concat(00100001011111110,0111010110001001100) = 001000010111111100111010110001001100 + bit_concat(01100010101101000,0001011111100001100) = 011000101011010000001011111100001100 + bit_concat(11110100010111000,1110000001101111000) = 111101000101110001110000001101111000 + bit_concat(11110011111000100,1010100111000111010) = 111100111110001001010100111000111010 + bit_concat(00011101111111010,1100000010111001010) = 000111011111110101100000010111001010 + bit_concat(11101000101010000,0011001111010010110) = 111010001010100000011001111010010110 + bit_concat(11110011001000100,0101000011001100010) = 111100110010001000101000011001100010 + bit_concat(00000111101000010,0001110000111111100) = 000001111010000100001110000111111100 + bit_concat(11101000001011000,1010001100110101010) = 111010000010110001010001100110101010 + bit_concat(01100001001100000,1101110001100001100) = 011000010011000001101110001100001100 + bit_concat(00000010010001010,1011101111001001000) = 000000100100010101011101111001001000 + bit_concat(01001111011111000,1010110111001001110) = 010011110111110001010110111001001110 + bit_concat(00101000101111010,0011101000111111100) = 001010001011110100011101000111111100 + bit_concat(10110000111111100,1011001100010000110) = 101100001111111001011001100010000110 + bit_concat(10101000010000110,0010111101011111010) = 101010000100001100010111101011111010 + bit_concat(01000010100100100,0110110001100100110) = 010000101001001000110110001100100110 + bit_concat(10100101111111000,1001111101110000110) = 101001011111110001001111101110000110 + bit_concat(01010101001011000,1101110111000101100) = 010101010010110001101110111000101100 + bit_concat(00011010101010010,1111011000110010100) = 000110101010100101111011000110010100 + bit_concat(10000101100100010,1011000011100010010) = 100001011001000101011000011100010010 + bit_concat(10110000001010100,0011101100111101110) = 101100000010101000011101100111101110 + bit_concat(11011010010010100,1110111001011000010) = 110110100100101001110111001011000010 + bit_concat(01000111101100100,0110010110000001010) = 010001111011001000110010110000001010 + bit_concat(10010100110011100,1010010011100010000) = 100101001100111001010010011100010000 + bit_concat(11100100100110010,0011101111111110010) = 111001001001100100011101111111110010 + bit_concat(00110101100100000,1100011010010110000) = 001101011001000001100011010010110000 + bit_concat(10101101001111010,1110100111100110000) = 101011010011110101110100111100110000 + bit_concat(00100010111110010,0110110101111111010) = 001000101111100100110110101111111010 + bit_concat(00000111010000100,0001110101000010010) = 000001110100001000001110101000010010 + bit_concat(00101001011101110,0101001010011111010) = 001010010111011100101001010011111010 + bit_concat(01001011100011000,1110011101110010000) = 010010111000110001110011101110010000 + bit_concat(01000001111000100,0101010111111001000) = 010000011110001000101010111111001000 + bit_concat(00011111101001010,1100111011111010000) = 000111111010010101100111011111010000 + bit_concat(11111010111101100,1100100001010001110) = 111110101111011001100100001010001110 + bit_concat(10111001111101010,0100011010001110000) = 101110011111010100100011010001110000 + bit_concat(00100010111110000,1110110101100010110) = 001000101111100001110110101100010110 + bit_concat(00110011111001100,1011100111000000100) = 001100111110011001011100111000000100 + bit_concat(01010110000110010,1110010011011110100) = 010101100001100101110010011011110100 + bit_concat(01011001000111010,1011110001011000010) = 010110010001110101011110001011000010 + bit_concat(01001011100010100,1011111011010011010) = 010010111000101001011111011010011010 + bit_concat(11101010001011110,1010100101001010000) = 111010100010111101010100101001010000 + bit_concat(01101001000110010,0100101000000101010) = 011010010001100100100101000000101010 + bit_concat(11011000000111110,1001100110101011000) = 110110000001111101001100110101011000 + exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c:1.1 *** /dev/null Mon Feb 12 11:53:16 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c Mon Feb 12 11:52:59 2007 *************** *** 0 **** --- 1,67 ---- + //===--- bit_reduce.c --- Test The bit_reduce builtins --------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This test case tests the __builtin_bit_*_reduce builtin functions. These + // builtins apply and/or/nor/xor/nxor operations to the bits of an integer type + // in succession until a single final bit is produced. + // + //===----------------------------------------------------------------------===// + + #include + #include + + #ifdef ENABLE_LARGE_INTEGERS + typedef int __attribute__((bitwidth(250))) BitType; + const BitType X = 0xAAAAAAAAAAAAAAAAULL; + int numbits = 250; + #else + typedef int __attribute__((bitwidth(47))) BitType; + const BitType X = 0xAAAAAAAAAAAAULL; + int numbits = 47; + #endif + + printBits(BitType val, int numbits ) { + int j; + for (j = numbits-1; j >= 0; --j) { + if (__builtin_bit_select(val, j)) + printf("1"); + else + printf("0"); + } + } + + int main(int argc, char** argv) + { + + #ifdef ENABLE_LARGE_INTEGERS + BitType Y = X * X; + #else + BitType Y = X; + #endif + int i, j; + int seed = (argc > 1 ? atoi(argv[1]): 31415927); + + srand(seed); + + for (i = 0; i < 128; i++) { + int num = rand(); + BitType Val = Y * num; + { + unsigned char And = __builtin_bit_and_reduce(Val); + unsigned char Nand = __builtin_bit_nand_reduce(Val); + unsigned char Or = __builtin_bit_or_reduce(Val); + unsigned char Nor = __builtin_bit_nor_reduce(Val); + unsigned char Xor = __builtin_bit_xor_reduce(Val); + unsigned char Nxor = __builtin_bit_nxor_reduce(Val); + printf("Value="); + printBits(Val, numbits); + printf(", and=%d, nand=%d, or=%d, nor=%d, xor=%d, nxor=%d\n", + And, Nand, Or, Nor, Xor, Nxor); + } + } + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output:1.1 *** /dev/null Mon Feb 12 11:53:16 2007 --- llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output Mon Feb 12 11:52:59 2007 *************** *** 0 **** --- 1,18 ---- + Tried to execute an unknown external function: i1 (...) * __builtin_bit_and_reduce + /proj/llvm/llvm-2/Debug/bin/lli((anonymous namespace)::PrintStackTrace()+0x1a)[0x871c18a] + /proj/llvm/llvm-2/Debug/bin/lli((anonymous namespace)::SignalHandler(int)+0x110)[0x871c4b2] + [0x8e5420] + /lib/libc.so.6(abort+0x101)[0x3234f1] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::callExternalFunction(llvm::Function*, std::vector > const&)+0x138)[0x845428c] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::callFunction(llvm::Function*, std::vector > const&)+0x11a)[0x844f356] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::visitCallSite(llvm::CallSite)+0x433)[0x844f9d9] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::visitCallInst(llvm::CallInst&)+0x2a)[0x845a998] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::InstVisitor::visitCall(llvm::CallInst&)+0x18)[0x845a9b2] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::InstVisitor::visit(llvm::Instruction&)+0x422)[0x845b5cc] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::run()+0x9d)[0x8450c21] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::runFunction(llvm::Function*, std::vector > const&)+0xc9)[0x84545a1] + /proj/llvm/llvm-2/Debug/bin/lli(llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, char const* const*)+0x218)[0x84729ac] + /proj/llvm/llvm-2/Debug/bin/lli(main+0x356)[0x83593aa] + /lib/libc.so.6(__libc_start_main+0xdc)[0x30f4e4] + /proj/llvm/llvm-2/Debug/bin/lli(__gxx_personality_v0+0x191)[0x8358fd1] + exit 134 Index: llvm-test/SingleSource/UnitTests/Integer/part_select.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.1 *** /dev/null Mon Feb 12 11:53:16 2007 --- llvm-test/SingleSource/UnitTests/Integer/part_select.c Mon Feb 12 11:52:59 2007 *************** *** 0 **** --- 1,54 ---- + //===--- part_select.c --- Test The bit_select builtin --------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This test case tests the __builtin_part_select builtin function llvm-gcc. + // bit_select selects one bit out of a larger + // + //===----------------------------------------------------------------------===// + + #include + #include + + #ifdef ENABLE_LARGE_INTEGERS + typedef int __attribute__((bitwidth(256))) BitType; + const BitType X = 0xAAAAAAAAULL; + int numbits = 256; + #else + typedef int __attribute__((bitwidth(47))) BitType; + const BitType X = 0xAAAAAAAAULL; + int numbits = 47; + #endif + + int main(int argc, char** argv) + { + + #ifdef ENABLE_LARGE_INTEGERS + BitType Y = X * X; + #else + BitType Y = X; + #endif + + srand(0); + + int i, j; + + for (i = 1; i <= numbits; ++i) { + BitType left = rand() % numbits; + BitType right = i; + BitType Z = __builtin_part_select(Y, left, right); + printf("part_select(Y, %3d, %3d) = ", (int)left, (int)right); + for (j = numbits; j > 0; --j) { + if (__builtin_bit_select(Z, j)) + printf("1"); + else + printf("0"); + } + printf("\n"); + } + + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/bit_select.c diff -u llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_select.c:1.1 Mon Feb 5 20:57:54 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_select.c Mon Feb 12 11:52:59 2007 @@ -14,11 +14,11 @@ #ifdef ENABLE_LARGE_INTEGERS typedef int __attribute__((bitwidth(250))) BitType; -const BitType X = 0xAAAAAAAAULL; +const BitType X = 0xAAAAAAAAAAAAAAAAULL; int numbits = 250; #else typedef int __attribute__((bitwidth(47))) BitType; -const BitType X = 0xAAAAAAAAULL; +const BitType X = 0xAAAAAAAAAAAAULL; int numbits = 47; #endif @@ -31,7 +31,7 @@ BitType Y = X; #endif - int i; + BitType i; for (i = numbits-1; i >= 0; --i) { if (__builtin_bit_select(Y, i)) From dpatel at apple.com Mon Feb 12 12:01:32 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Mon, 12 Feb 2007 10:01:32 -0800 (PST) Subject: [llvm-commits] [123743] Avoid including GCC's system headers. Message-ID: <20070212180132.9446F3DBED48@src> Revision: 123743 Author: dpatel Date: 2007-02-12 10:01:31 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Avoid including GCC's system headers. They poison stuff like malloc that we use in LLVM subsystem. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-debug.h Modified: apple-local/branches/llvm/gcc/llvm-debug.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-debug.h 2007-02-12 17:41:51 UTC (rev 123742) +++ apple-local/branches/llvm/gcc/llvm-debug.h 2007-02-12 18:01:31 UTC (rev 123743) @@ -31,10 +31,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" extern "C" { -#include "config.h" -#include "system.h" -#include "coretypes.h" -union tree_node; +#include "llvm.h" } #include From lauro.venancio at gmail.com Mon Feb 12 12:32:03 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 12 Feb 2007 12:32:03 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/Makefile Message-ID: <200702121832.l1CIW3Yk025997@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: Makefile updated: 1.23 -> 1.24 --- Log message: Fix build error on ARM. Since CompilerDriver.cpp revision 1.44, llvmc must be linked against LLVMCore.a (llvm::Module::~Module) and LLVMBCReader.a (llvm::getBytecodeModuleProvider). --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/tools/llvmc/Makefile diff -u llvm/tools/llvmc/Makefile:1.23 llvm/tools/llvmc/Makefile:1.24 --- llvm/tools/llvmc/Makefile:1.23 Wed Dec 13 02:09:48 2006 +++ llvm/tools/llvmc/Makefile Mon Feb 12 12:31:46 2007 @@ -8,7 +8,7 @@ ##===----------------------------------------------------------------------===## LEVEL = ../.. TOOLNAME = llvmc -LINK_COMPONENTS = support system +LINK_COMPONENTS = support system core bcreader CONFIG_FILES = c cpp ll st EXTRA_DIST = c cpp ll ConfigLexer.cpp.cvs ConfigLexer.l.cvs REQUIRES_EH := 1 From scottm at rushg.aero.org Mon Feb 12 12:40:36 2007 From: scottm at rushg.aero.org (Scott Michel) Date: Mon, 12 Feb 2007 10:40:36 -0800 Subject: [llvm-commits] updated TargetData mods... Message-ID: <20070212184036.GA10659@rush.aero.org> Resolved recent commit conflicts. -scooter -------------- next part -------------- A non-text attachment was scrubbed... Name: TargetData.diff Type: text/x-diff Size: 49858 bytes Desc: updated TargetData patch Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070212/76b78e81/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-cfrontend.diff Type: text/x-diff Size: 2383 bytes Desc: c frontend updates Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070212/76b78e81/attachment-0001.bin From sabre at nondot.org Mon Feb 12 12:53:16 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 12:53:16 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Value.h Message-ID: <200702121853.l1CIrG4k026663@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Value.h updated: 1.93 -> 1.94 --- Log message: Add new setName accessor which doesn't require creating a string. --- Diffs of the changes: (+1 -0) Value.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.93 llvm/include/llvm/Value.h:1.94 --- llvm/include/llvm/Value.h:1.93 Sun Feb 11 23:18:08 2007 +++ llvm/include/llvm/Value.h Mon Feb 12 12:52:59 2007 @@ -91,6 +91,7 @@ ValueName *getValueName() const { return Name; } void setName(const std::string &name); + void setName(const char *Name, unsigned NameLen); /// takeName - transfer the name from V to this value, setting V's name to /// empty. It is an error to call V->takeName(V). From sabre at nondot.org Mon Feb 12 12:53:18 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 12:53:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Value.cpp Message-ID: <200702121853.l1CIrI5Z026671@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Value.cpp updated: 1.66 -> 1.67 --- Log message: Add new setName accessor which doesn't require creating a string. --- Diffs of the changes: (+28 -20) Value.cpp | 48 ++++++++++++++++++++++++++++-------------------- 1 files changed, 28 insertions(+), 20 deletions(-) Index: llvm/lib/VMCore/Value.cpp diff -u llvm/lib/VMCore/Value.cpp:1.66 llvm/lib/VMCore/Value.cpp:1.67 --- llvm/lib/VMCore/Value.cpp:1.66 Sun Feb 11 23:18:08 2007 +++ llvm/lib/VMCore/Value.cpp Mon Feb 12 12:52:59 2007 @@ -119,33 +119,40 @@ } void Value::setName(const std::string &name) { - if (name.empty() && !hasName()) return; + setName(&name[0], name.size()); +} + +void Value::setName(const char *NameStr, unsigned NameLen) { + if (NameLen == 0 && !hasName()) return; if (getType() != Type::VoidTy && "Cannot assign a name to void values!"); - // Get the symbol table to update for this object. ValueSymbolTable *ST; if (getSymTab(this, ST)) return; // Cannot set a name on this value (e.g. constant). if (!ST) { // No symbol table to update? Just do the change. - if (name.empty()) { + if (NameLen == 0) { // Free the name for this value. Name->Destroy(); Name = 0; - } else { - if (Name) { - // Name isn't changing. - if (name.size() == Name->getKeyLength() && - !memcmp(Name->getKeyData(), &name[0], name.size())) - return; - Name->Destroy(); - } - - // Create the new name. - Name = ValueName::Create(&name[0], &name[name.size()]); - Name->setValue(this); + return; } + + if (Name) { + // Name isn't changing? + if (NameLen == Name->getKeyLength() && + !memcmp(Name->getKeyData(), NameStr, NameLen)) + return; + Name->Destroy(); + } + + // NOTE: Could optimize for the case the name is shrinking to not deallocate + // then reallocated. + + // Create the new name. + Name = ValueName::Create(NameStr, NameStr+NameLen); + Name->setValue(this); return; } @@ -153,8 +160,8 @@ // then reallocated. if (hasName()) { // Name isn't changing? - if (name.size() == Name->getKeyLength() && - !memcmp(Name->getKeyData(), &name[0], name.size())) + if (NameLen == Name->getKeyLength() && + !memcmp(Name->getKeyData(), NameStr, NameLen)) return; // Remove old name. @@ -162,14 +169,15 @@ Name->Destroy(); Name = 0; - if (name.empty()) - return; + if (NameLen == 0) + return; } // Name is changing to something new. - Name = ST->createValueName(&name[0], name.size(), this); + Name = ST->createValueName(NameStr, NameLen, this); } + /// takeName - transfer the name from V to this value, setting V's name to /// empty. It is an error to call V->takeName(V). void Value::takeName(Value *V) { From sabre at nondot.org Mon Feb 12 12:54:02 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 12:54:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Reader.cpp Reader.h Message-ID: <200702121854.l1CIs2nK026722@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.36 -> 1.37 Reader.cpp updated: 1.235 -> 1.236 Reader.h updated: 1.48 -> 1.49 --- Log message: avoid creating a temporary string when reading the symbol table for a module. This speeds up the bcreader 11%. --- Diffs of the changes: (+26 -9) Analyzer.cpp | 4 ++-- Reader.cpp | 30 +++++++++++++++++++++++------- Reader.h | 1 + 3 files changed, 26 insertions(+), 9 deletions(-) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.36 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.37 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.36 Sat Feb 10 08:07:56 2007 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Mon Feb 12 12:53:42 2007 @@ -250,10 +250,10 @@ } virtual void handleSymbolTableValue(unsigned TySlot, unsigned ValSlot, - const std::string& name) { + const char *Name, unsigned NameLen) { if (os) *os << " Value " << TySlot << " Slot=" << ValSlot - << " Name: " << name << "\n"; + << " Name: " << std::string(Name, Name+NameLen) << "\n"; if (ValSlot > bca.maxValueSlot) bca.maxValueSlot = ValSlot; } Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.235 llvm/lib/Bytecode/Reader/Reader.cpp:1.236 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.235 Wed Feb 7 15:41:01 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Feb 12 12:53:43 2007 @@ -132,6 +132,17 @@ return std::string((char*)OldAt, Size); } +void BytecodeReader::read_str(SmallVectorImpl &StrData) { + StrData.clear(); + unsigned Size = read_vbr_uint(); + const unsigned char *OldAt = At; + At += Size; + if (At > BlockEnd) // Size invalid? + error("Ran out of data reading a string!"); + StrData.append(OldAt, At); +} + + /// Read an arbitrary block of data inline void BytecodeReader::read_data(void *Ptr, void *End) { unsigned char *Start = (unsigned char *)Ptr; @@ -943,6 +954,8 @@ E = CurrentFunction->end(); I != E; ++I) BBMap.push_back(I); + SmallVector NameStr; + while (moreInBlock()) { // Symtab block header: [num entries][type id number] unsigned NumEntries = read_vbr_uint(); @@ -951,19 +964,22 @@ for (unsigned i = 0; i != NumEntries; ++i) { // Symtab entry: [def slot #][name] unsigned slot = read_vbr_uint(); - std::string Name = read_str(); + read_str(NameStr); Value *V = 0; if (Typ == LabelTySlot) { - if (slot < BBMap.size()) - V = BBMap[slot]; + V = (slot < BBMap.size()) ? BBMap[slot] : 0; } else { - V = getValue(Typ, slot, false); // Find mapping... + V = getValue(Typ, slot, false); // Find mapping. } - if (Handler) Handler->handleSymbolTableValue(Typ, slot, Name); + if (Handler) Handler->handleSymbolTableValue(Typ, slot, + &NameStr[0], NameStr.size()); if (V == 0) - error("Failed value look-up for name '" + Name + "', type #" + + error("Failed value look-up for name '" + + std::string(NameStr.begin(), NameStr.end()) + "', type #" + utostr(Typ) + " slot #" + utostr(slot)); - V->setName(Name); + V->setName(&NameStr[0], NameStr.size()); + + NameStr.clear(); } } checkPastBlockEnd("Symbol Table"); Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.48 llvm/lib/Bytecode/Reader/Reader.h:1.49 --- llvm/lib/Bytecode/Reader/Reader.h:1.48 Wed Feb 7 17:46:55 2007 +++ llvm/lib/Bytecode/Reader/Reader.h Mon Feb 12 12:53:43 2007 @@ -438,6 +438,7 @@ /// @brief Read a string inline std::string read_str(); + inline void read_str(SmallVectorImpl &StrData); /// @brief Read a float value inline void read_float(float& FloatVal); From sabre at nondot.org Mon Feb 12 12:54:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 12:54:03 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/BytecodeHandler.h Message-ID: <200702121854.l1CIs340026729@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Bytecode: BytecodeHandler.h updated: 1.15 -> 1.16 --- Log message: avoid creating a temporary string when reading the symbol table for a module. This speeds up the bcreader 11%. --- Diffs of the changes: (+1 -1) BytecodeHandler.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Bytecode/BytecodeHandler.h diff -u llvm/include/llvm/Bytecode/BytecodeHandler.h:1.15 llvm/include/llvm/Bytecode/BytecodeHandler.h:1.16 --- llvm/include/llvm/Bytecode/BytecodeHandler.h:1.15 Sat Feb 10 08:07:56 2007 +++ llvm/include/llvm/Bytecode/BytecodeHandler.h Mon Feb 12 12:53:42 2007 @@ -175,7 +175,7 @@ virtual void handleSymbolTableValue( unsigned i, ///< The index of the value in this plane unsigned slot, ///< Slot number of the named value - const std::string& name ///< Name of the value. + const char *name, unsigned NameLen ///< Name of the value. ) {} /// @brief Handle the end of a value symbol table From jlaskey at apple.com Mon Feb 12 13:06:08 2007 From: jlaskey at apple.com (Jim Laskey) Date: Mon, 12 Feb 2007 13:06:08 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Intrinsics.td Message-ID: <200702121906.l1CJ688R027150@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Intrinsics.td updated: 1.44 -> 1.45 --- Log message: Wrong value type. --- Diffs of the changes: (+1 -1) Intrinsics.td | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Intrinsics.td diff -u llvm/include/llvm/Intrinsics.td:1.44 llvm/include/llvm/Intrinsics.td:1.45 --- llvm/include/llvm/Intrinsics.td:1.44 Wed Feb 7 14:38:26 2007 +++ llvm/include/llvm/Intrinsics.td Mon Feb 12 13:05:51 2007 @@ -232,7 +232,7 @@ //===------------------ Exception Handling Intrinsics----------------------===// // def int_eh_exception : Intrinsic<[llvm_ptr_ty]>; -def int_eh_handlers : Intrinsic<[llvm_ptr_ty, llvm_ptr_ty, llvm_vararg_ty]>; +def int_eh_handlers : Intrinsic<[llvm_i32_ty, llvm_ptr_ty, llvm_vararg_ty]>; //===----------------------------------------------------------------------===// // Target-specific intrinsics From reid at x10sys.com Mon Feb 12 13:08:05 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 13:08:05 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output Message-ID: <200702121908.l1CJ85iS027250@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bit_concat.reference_output updated: 1.1 -> 1.2 --- Log message: Update the reference output to what is expected. --- Diffs of the changes: (+118 -118) bit_concat.reference_output | 236 ++++++++++++++++++++++---------------------- 1 files changed, 118 insertions(+), 118 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output:1.1 Mon Feb 12 11:52:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat.reference_output Mon Feb 12 13:07:49 2007 @@ -1,119 +1,119 @@ -bit_concat(01111000000011100,0100110100110111000) = 011110000000111000100110100110111000 -bit_concat(10111100010110100,0000010011010100000) = 101111000101101000000010011010100000 -bit_concat(10011000010110000,1010110100000110100) = 100110000101100001010110100000110100 -bit_concat(00001001101011100,1001000111110110110) = 000010011010111001001000111110110110 -bit_concat(11101001101111100,1001000011000010100) = 111010011011111001001000011000010100 -bit_concat(10000101010010000,0001111111111101110) = 100001010100100000001111111111101110 -bit_concat(11110111001001100,0101010101100111000) = 111101110010011000101010101100111000 -bit_concat(00100000010010010,0100010001100100000) = 001000000100100100100010001100100000 -bit_concat(01000110111110100,0010011001000001010) = 010001101111101000010011001000001010 -bit_concat(10101001111001100,0110110111000110100) = 101010011110011000110110111000110100 -bit_concat(10001101100001010,1111011010000010000) = 100011011000010101111011010000010000 -bit_concat(00110111110111100,0101111011011011000) = 001101111101111000101111011011011000 -bit_concat(10101100010011110,0011110000000010100) = 101011000100111100011110000000010100 -bit_concat(00001110001100010,0100100001011011110) = 000011100011000100100100001011011110 -bit_concat(00100000001001000,0000011110101100010) = 001000000010010000000011110101100010 -bit_concat(11111010110011010,1001011010011000100) = 111110101100110101001011010011000100 -bit_concat(01111010100010000,0011010111111010000) = 011110101000100000011010111111010000 -bit_concat(00010011010110000,1111000101101101110) = 000100110101100001111000101101101110 -bit_concat(10110111110111000,0000111001011101000) = 101101111101110000000111001011101000 -bit_concat(11100111011111100,0111010101111000110) = 111001110111111000111010101111000110 -bit_concat(00000111101110000,1000111001010101100) = 000001111011100001000111001010101100 -bit_concat(00010011011110010,1001101011101011000) = 000100110111100101001101011101011000 -bit_concat(01111100101001010,1000111110000000010) = 011111001010010101000111110000000010 -bit_concat(10100000110100000,1111111001001111010) = 101000001101000001111111001001111010 -bit_concat(01010000001000110,1001101010111110100) = 010100000010001101001101010111110100 -bit_concat(10111001110100110,1000011100010100000) = 101110011101001101000011100010100000 -bit_concat(10001010001010010,1000001010010000000) = 100010100010100101000001010010000000 -bit_concat(11111110111111110,1010000000001010110) = 111111101111111101010000000001010110 -bit_concat(00010011100100000,0010101000011000110) = 000100111001000000010101000011000110 -bit_concat(10101111101000010,0010011001011001100) = 101011111010000100010011001011001100 -bit_concat(00110100101001100,0100101001110010100) = 001101001010011000100101001110010100 -bit_concat(00010010100110110,1111000001000000100) = 000100101001101101111000001000000100 -bit_concat(11100001010111000,0101011011101011100) = 111000010101110000101011011101011100 -bit_concat(10011000001010000,1111001001111011000) = 100110000010100001111001001111011000 -bit_concat(01101000010001110,1101011110010011100) = 011010000100011101101011110010011100 -bit_concat(10111000111110100,0111110000110010000) = 101110001111101000111110000110010000 -bit_concat(00010111001011000,1101101100100101100) = 000101110010110001101101100100101100 -bit_concat(11011110011110100,1100110011101010000) = 110111100111101001100110011101010000 -bit_concat(10001110101000000,1000111010011001000) = 100011101010000001000111010011001000 -bit_concat(11100000000010000,1100111010110000100) = 111000000000100001100111010110000100 -bit_concat(10010001001000100,0001000000010000010) = 100100010010001000001000000010000010 -bit_concat(01110110100100010,0110111101100110100) = 011101101001000100110111101100110100 -bit_concat(01010010110111010,0000100111101101100) = 010100101101110100000100111101101100 -bit_concat(01110101110010010,0100100011111010000) = 011101011100100100100100011111010000 -bit_concat(10101100111011010,0000101000000000100) = 101011001110110100000101000000000100 -bit_concat(01010011111101100,1100100100111110000) = 010100111111011001100100100111110000 -bit_concat(01110000110111110,1111010101101100010) = 011100001101111101111010101101100010 -bit_concat(11101000111010100,0111001010001111110) = 111010001110101000111001010001111110 -bit_concat(11001100100001110,0101101000110101100) = 110011001000011100101101000110101100 -bit_concat(01001101011010010,1011110100000101100) = 010011010110100101011110100000101100 -bit_concat(00010111100011100,0011011001000000010) = 000101111000111000011011001000000010 -bit_concat(11001000100100010,0000000011010111110) = 110010001001000100000000011010111110 -bit_concat(10010000010010110,1000110101110100010) = 100100000100101101000110101110100010 -bit_concat(00111110101001000,1001110001000110000) = 001111101010010001001110001000110000 -bit_concat(11100100010101100,0000111000000011110) = 111001000101011000000111000000011110 -bit_concat(00111001111110010,1011001000011101110) = 001110011111100101011001000011101110 -bit_concat(11000111110101010,0000000010101010010) = 110001111101010100000000010101010010 -bit_concat(11110101000011010,0111110011011000110) = 111101010000110100111110011011000110 -bit_concat(11110011110010010,1100001111101010110) = 111100111100100101100001111101010110 -bit_concat(10100011010101100,0111011111000000000) = 101000110101011000111011111000000000 -bit_concat(01000010010011100,0111010000100100100) = 010000100100111000111010000100100100 -bit_concat(01100101111101010,0100110000000001100) = 011001011111010100100110000000001100 -bit_concat(10101111011110110,0101101101101111010) = 101011110111101100101101101101111010 -bit_concat(10011111100110100,1110000111010010000) = 100111111001101001110000111010010000 -bit_concat(11010101101010110,1110010011001011000) = 110101011010101101110010011001011000 -bit_concat(11001110100101000,1000110110010111110) = 110011101001010001000110110010111110 -bit_concat(00111101001010110,0001000011001001110) = 001111010010101100001000011001001110 -bit_concat(01111110100000110,1001101010001011000) = 011111101000001101001101010001011000 -bit_concat(11100100110110100,0101101100000010110) = 111001001101101000101101100000010110 -bit_concat(00011000000000010,0000101110100110000) = 000110000000000100000101110100110000 -bit_concat(01011011010010010,1010100101100001010) = 010110110100100101010100101100001010 -bit_concat(10111110100110010,0100110101000011110) = 101111101001100100100110101000011110 -bit_concat(00110101100110110,1001101101010110000) = 001101011001101101001101101010110000 -bit_concat(11001110110000010,0000111100000111110) = 110011101100000100000111100000111110 -bit_concat(01110110111011110,0000000111010111110) = 011101101110111100000000111010111110 -bit_concat(00100001011111110,0111010110001001100) = 001000010111111100111010110001001100 -bit_concat(01100010101101000,0001011111100001100) = 011000101011010000001011111100001100 -bit_concat(11110100010111000,1110000001101111000) = 111101000101110001110000001101111000 -bit_concat(11110011111000100,1010100111000111010) = 111100111110001001010100111000111010 -bit_concat(00011101111111010,1100000010111001010) = 000111011111110101100000010111001010 -bit_concat(11101000101010000,0011001111010010110) = 111010001010100000011001111010010110 -bit_concat(11110011001000100,0101000011001100010) = 111100110010001000101000011001100010 -bit_concat(00000111101000010,0001110000111111100) = 000001111010000100001110000111111100 -bit_concat(11101000001011000,1010001100110101010) = 111010000010110001010001100110101010 -bit_concat(01100001001100000,1101110001100001100) = 011000010011000001101110001100001100 -bit_concat(00000010010001010,1011101111001001000) = 000000100100010101011101111001001000 -bit_concat(01001111011111000,1010110111001001110) = 010011110111110001010110111001001110 -bit_concat(00101000101111010,0011101000111111100) = 001010001011110100011101000111111100 -bit_concat(10110000111111100,1011001100010000110) = 101100001111111001011001100010000110 -bit_concat(10101000010000110,0010111101011111010) = 101010000100001100010111101011111010 -bit_concat(01000010100100100,0110110001100100110) = 010000101001001000110110001100100110 -bit_concat(10100101111111000,1001111101110000110) = 101001011111110001001111101110000110 -bit_concat(01010101001011000,1101110111000101100) = 010101010010110001101110111000101100 -bit_concat(00011010101010010,1111011000110010100) = 000110101010100101111011000110010100 -bit_concat(10000101100100010,1011000011100010010) = 100001011001000101011000011100010010 -bit_concat(10110000001010100,0011101100111101110) = 101100000010101000011101100111101110 -bit_concat(11011010010010100,1110111001011000010) = 110110100100101001110111001011000010 -bit_concat(01000111101100100,0110010110000001010) = 010001111011001000110010110000001010 -bit_concat(10010100110011100,1010010011100010000) = 100101001100111001010010011100010000 -bit_concat(11100100100110010,0011101111111110010) = 111001001001100100011101111111110010 -bit_concat(00110101100100000,1100011010010110000) = 001101011001000001100011010010110000 -bit_concat(10101101001111010,1110100111100110000) = 101011010011110101110100111100110000 -bit_concat(00100010111110010,0110110101111111010) = 001000101111100100110110101111111010 -bit_concat(00000111010000100,0001110101000010010) = 000001110100001000001110101000010010 -bit_concat(00101001011101110,0101001010011111010) = 001010010111011100101001010011111010 -bit_concat(01001011100011000,1110011101110010000) = 010010111000110001110011101110010000 -bit_concat(01000001111000100,0101010111111001000) = 010000011110001000101010111111001000 -bit_concat(00011111101001010,1100111011111010000) = 000111111010010101100111011111010000 -bit_concat(11111010111101100,1100100001010001110) = 111110101111011001100100001010001110 -bit_concat(10111001111101010,0100011010001110000) = 101110011111010100100011010001110000 -bit_concat(00100010111110000,1110110101100010110) = 001000101111100001110110101100010110 -bit_concat(00110011111001100,1011100111000000100) = 001100111110011001011100111000000100 -bit_concat(01010110000110010,1110010011011110100) = 010101100001100101110010011011110100 -bit_concat(01011001000111010,1011110001011000010) = 010110010001110101011110001011000010 -bit_concat(01001011100010100,1011111011010011010) = 010010111000101001011111011010011010 -bit_concat(11101010001011110,1010100101001010000) = 111010100010111101010100101001010000 -bit_concat(01101001000110010,0100101000000101010) = 011010010001100100100101000000101010 -bit_concat(11011000000111110,1001100110101011000) = 110110000001111101001100110101011000 +bit_concat(00111100000001110,0010011010011011100) = 001111000000011100010011010011011100 +bit_concat(01011110001011010,0000001001101010000) = 010111100010110100000001001101010000 +bit_concat(01001100001011000,0101011010000011010) = 010011000010110000101011010000011010 +bit_concat(00000100110101110,0100100011111011011) = 000001001101011100100100011111011011 +bit_concat(01110100110111110,0100100001100001010) = 011101001101111100100100001100001010 +bit_concat(01000010101001000,0000111111111110111) = 010000101010010000000111111111110111 +bit_concat(01111011100100110,0010101010110011100) = 011110111001001100010101010110011100 +bit_concat(00010000001001001,0010001000110010000) = 000100000010010010010001000110010000 +bit_concat(00100011011111010,0001001100100000101) = 001000110111110100001001100100000101 +bit_concat(01010100111100110,0011011011100011010) = 010101001111001100011011011100011010 +bit_concat(01000110110000101,0111101101000001000) = 010001101100001010111101101000001000 +bit_concat(00011011111011110,0010111101101101100) = 000110111110111100010111101101101100 +bit_concat(01010110001001111,0001111000000001010) = 010101100010011110001111000000001010 +bit_concat(00000111000110001,0010010000101101111) = 000001110001100010010010000101101111 +bit_concat(00010000000100100,0000001111010110001) = 000100000001001000000001111010110001 +bit_concat(01111101011001101,0100101101001100010) = 011111010110011010100101101001100010 +bit_concat(00111101010001000,0001101011111101000) = 001111010100010000001101011111101000 +bit_concat(00001001101011000,0111100010110110111) = 000010011010110000111100010110110111 +bit_concat(01011011111011100,0000011100101110100) = 010110111110111000000011100101110100 +bit_concat(01110011101111110,0011101010111100011) = 011100111011111100011101010111100011 +bit_concat(00000011110111000,0100011100101010110) = 000000111101110000100011100101010110 +bit_concat(00001001101111001,0100110101110101100) = 000010011011110010100110101110101100 +bit_concat(00111110010100101,0100011111000000001) = 001111100101001010100011111000000001 +bit_concat(01010000011010000,0111111100100111101) = 010100000110100000111111100100111101 +bit_concat(00101000000100011,0100110101011111010) = 001010000001000110100110101011111010 +bit_concat(01011100111010011,0100001110001010000) = 010111001110100110100001110001010000 +bit_concat(01000101000101001,0100000101001000000) = 010001010001010010100000101001000000 +bit_concat(01111111011111111,0101000000000101011) = 011111110111111110101000000000101011 +bit_concat(00001001110010000,0001010100001100011) = 000010011100100000001010100001100011 +bit_concat(01010111110100001,0001001100101100110) = 010101111101000010001001100101100110 +bit_concat(00011010010100110,0010010100111001010) = 000110100101001100010010100111001010 +bit_concat(00001001010011011,0111100000100000010) = 000010010100110110111100000100000010 +bit_concat(01110000101011100,0010101101110101110) = 011100001010111000010101101110101110 +bit_concat(01001100000101000,0111100100111101100) = 010011000001010000111100100111101100 +bit_concat(00110100001000111,0110101111001001110) = 001101000010001110110101111001001110 +bit_concat(01011100011111010,0011111000011001000) = 010111000111110100011111000011001000 +bit_concat(00001011100101100,0110110110010010110) = 000010111001011000110110110010010110 +bit_concat(01101111001111010,0110011001110101000) = 011011110011110100110011001110101000 +bit_concat(01000111010100000,0100011101001100100) = 010001110101000000100011101001100100 +bit_concat(01110000000001000,0110011101011000010) = 011100000000010000110011101011000010 +bit_concat(01001000100100010,0000100000001000001) = 010010001001000100000100000001000001 +bit_concat(00111011010010001,0011011110110011010) = 001110110100100010011011110110011010 +bit_concat(00101001011011101,0000010011110110110) = 001010010110111010000010011110110110 +bit_concat(00111010111001001,0010010001111101000) = 001110101110010010010010001111101000 +bit_concat(01010110011101101,0000010100000000010) = 010101100111011010000010100000000010 +bit_concat(00101001111110110,0110010010011111000) = 001010011111101100110010010011111000 +bit_concat(00111000011011111,0111101010110110001) = 001110000110111110111101010110110001 +bit_concat(01110100011101010,0011100101000111111) = 011101000111010100011100101000111111 +bit_concat(01100110010000111,0010110100011010110) = 011001100100001110010110100011010110 +bit_concat(00100110101101001,0101111010000010110) = 001001101011010010101111010000010110 +bit_concat(00001011110001110,0001101100100000001) = 000010111100011100001101100100000001 +bit_concat(01100100010010001,0000000001101011111) = 011001000100100010000000001101011111 +bit_concat(01001000001001011,0100011010111010001) = 010010000010010110100011010111010001 +bit_concat(00011111010100100,0100111000100011000) = 000111110101001000100111000100011000 +bit_concat(01110010001010110,0000011100000001111) = 011100100010101100000011100000001111 +bit_concat(00011100111111001,0101100100001110111) = 000111001111110010101100100001110111 +bit_concat(01100011111010101,0000000001010101001) = 011000111110101010000000001010101001 +bit_concat(01111010100001101,0011111001101100011) = 011110101000011010011111001101100011 +bit_concat(01111001111001001,0110000111110101011) = 011110011110010010110000111110101011 +bit_concat(01010001101010110,0011101111100000000) = 010100011010101100011101111100000000 +bit_concat(00100001001001110,0011101000010010010) = 001000010010011100011101000010010010 +bit_concat(00110010111110101,0010011000000000110) = 001100101111101010010011000000000110 +bit_concat(01010111101111011,0010110110110111101) = 010101111011110110010110110110111101 +bit_concat(01001111110011010,0111000011101001000) = 010011111100110100111000011101001000 +bit_concat(01101010110101011,0111001001100101100) = 011010101101010110111001001100101100 +bit_concat(01100111010010100,0100011011001011111) = 011001110100101000100011011001011111 +bit_concat(00011110100101011,0000100001100100111) = 000111101001010110000100001100100111 +bit_concat(00111111010000011,0100110101000101100) = 001111110100000110100110101000101100 +bit_concat(01110010011011010,0010110110000001011) = 011100100110110100010110110000001011 +bit_concat(00001100000000001,0000010111010011000) = 000011000000000010000010111010011000 +bit_concat(00101101101001001,0101010010110000101) = 001011011010010010101010010110000101 +bit_concat(01011111010011001,0010011010100001111) = 010111110100110010010011010100001111 +bit_concat(00011010110011011,0100110110101011000) = 000110101100110110100110110101011000 +bit_concat(01100111011000001,0000011110000011111) = 011001110110000010000011110000011111 +bit_concat(00111011011101111,0000000011101011111) = 001110110111011110000000011101011111 +bit_concat(00010000101111111,0011101011000100110) = 000100001011111110011101011000100110 +bit_concat(00110001010110100,0000101111110000110) = 001100010101101000000101111110000110 +bit_concat(01111010001011100,0111000000110111100) = 011110100010111000111000000110111100 +bit_concat(01111001111100010,0101010011100011101) = 011110011111000100101010011100011101 +bit_concat(00001110111111101,0110000001011100101) = 000011101111111010110000001011100101 +bit_concat(01110100010101000,0001100111101001011) = 011101000101010000001100111101001011 +bit_concat(01111001100100010,0010100001100110001) = 011110011001000100010100001100110001 +bit_concat(00000011110100001,0000111000011111110) = 000000111101000010000111000011111110 +bit_concat(01110100000101100,0101000110011010101) = 011101000001011000101000110011010101 +bit_concat(00110000100110000,0110111000110000110) = 001100001001100000110111000110000110 +bit_concat(00000001001000101,0101110111100100100) = 000000010010001010101110111100100100 +bit_concat(00100111101111100,0101011011100100111) = 001001111011111000101011011100100111 +bit_concat(00010100010111101,0001110100011111110) = 000101000101111010001110100011111110 +bit_concat(01011000011111110,0101100110001000011) = 010110000111111100101100110001000011 +bit_concat(01010100001000011,0001011110101111101) = 010101000010000110001011110101111101 +bit_concat(00100001010010010,0011011000110010011) = 001000010100100100011011000110010011 +bit_concat(01010010111111100,0100111110111000011) = 010100101111111000100111110111000011 +bit_concat(00101010100101100,0110111011100010110) = 001010101001011000110111011100010110 +bit_concat(00001101010101001,0111101100011001010) = 000011010101010010111101100011001010 +bit_concat(01000010110010001,0101100001110001001) = 010000101100100010101100001110001001 +bit_concat(01011000000101010,0001110110011110111) = 010110000001010100001110110011110111 +bit_concat(01101101001001010,0111011100101100001) = 011011010010010100111011100101100001 +bit_concat(00100011110110010,0011001011000000101) = 001000111101100100011001011000000101 +bit_concat(01001010011001110,0101001001110001000) = 010010100110011100101001001110001000 +bit_concat(01110010010011001,0001110111111111001) = 011100100100110010001110111111111001 +bit_concat(00011010110010000,0110001101001011000) = 000110101100100000110001101001011000 +bit_concat(01010110100111101,0111010011110011000) = 010101101001111010111010011110011000 +bit_concat(00010001011111001,0011011010111111101) = 000100010111110010011011010111111101 +bit_concat(00000011101000010,0000111010100001001) = 000000111010000100000111010100001001 +bit_concat(00010100101110111,0010100101001111101) = 000101001011101110010100101001111101 +bit_concat(00100101110001100,0111001110111001000) = 001001011100011000111001110111001000 +bit_concat(00100000111100010,0010101011111100100) = 001000001111000100010101011111100100 +bit_concat(00001111110100101,0110011101111101000) = 000011111101001010110011101111101000 +bit_concat(01111101011110110,0110010000101000111) = 011111010111101100110010000101000111 +bit_concat(01011100111110101,0010001101000111000) = 010111001111101010010001101000111000 +bit_concat(00010001011111000,0111011010110001011) = 000100010111110000111011010110001011 +bit_concat(00011001111100110,0101110011100000010) = 000110011111001100101110011100000010 +bit_concat(00101011000011001,0111001001101111010) = 001010110000110010111001001101111010 +bit_concat(00101100100011101,0101111000101100001) = 001011001000111010101111000101100001 +bit_concat(00100101110001010,0101111101101001101) = 001001011100010100101111101101001101 +bit_concat(01110101000101111,0101010010100101000) = 011101010001011110101010010100101000 +bit_concat(00110100100011001,0010010100000010101) = 001101001000110010010010100000010101 +bit_concat(01101100000011111,0100110011010101100) = 011011000000111110100110011010101100 exit 0 From zhousheng00 at gmail.com Mon Feb 12 14:03:11 2007 From: zhousheng00 at gmail.com (Zhou Sheng) Date: Mon, 12 Feb 2007 14:03:11 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp Message-ID: <200702122003.l1CK3BFW028543@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: APInt.cpp updated: 1.7 -> 1.8 --- Log message: 1. Make APInt::shl work correctly and more efficiently. 2. Add functions to support the numberical conversion between APInt and double/float. --- Diffs of the changes: (+78 -10) APInt.cpp | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 78 insertions(+), 10 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.7 llvm/lib/Support/APInt.cpp:1.8 --- llvm/lib/Support/APInt.cpp:1.7 Fri Feb 9 01:48:24 2007 +++ llvm/lib/Support/APInt.cpp Mon Feb 12 14:02:55 2007 @@ -955,6 +955,69 @@ return A; } +/// DoubleRoundToAPInt - This function convert a double value to +/// a APInt value. +APInt llvm::APIntOps::DoubleRoundToAPInt(double Double) { + union { + double D; + uint64_t I; + } T; + T.D = Double; + bool isNeg = T.I >> 63; + int64_t exp = ((T.I >> 52) & 0x7ff) - 1023; + if (exp < 0) + return APInt(0); + uint64_t mantissa = ((T.I << 12) >> 12) | (1ULL << 52); + if (exp < 52) + return isNeg ? -APInt(mantissa >> (52 - exp)) : + APInt(mantissa >> (52 - exp)); + APInt Tmp(mantissa, exp + 1); + Tmp = Tmp.shl(exp - 52); + return isNeg ? -Tmp : Tmp; +} + +/// APIntRoundToDouble - This function convert this APInt to a double. +/// The layout for double is as following (IEEE Standard 754): +/// -------------------------------------- +/// | Sign Exponent Fraction Bias | +/// |-------------------------------------- | +/// | 1[63] 11[62-52] 52[51-00] 1023 | +/// -------------------------------------- +double APInt::APIntRoundToDouble(bool isSigned) const { + bool isNeg = isSigned ? (*this)[BitsNum-1] : false; + APInt Tmp(isNeg ? -(*this) : (*this)); + if (Tmp.isSingleWord()) + return isSigned ? double(int64_t(Tmp.VAL)) : double(Tmp.VAL); + unsigned n = Tmp.getNumWords() * 64 - Tmp.CountLeadingZeros(); + if (n <= 64) + return isSigned ? double(int64_t(Tmp.pVal[0])) : double(Tmp.pVal[0]); + // Exponent when normalized to have decimal point directly after + // leading one. This is stored excess 1023 in the exponent bit field. + uint64_t exp = n - 1; + + // Gross overflow. + assert(exp <= 1023 && "Infinity value!"); + + // Number of bits in mantissa including the leading one + // equals to 53. + uint64_t mantissa; + if (n % 64 >= 53) + mantissa = Tmp.pVal[whichWord(n - 1)] >> (n % 64 - 53); + else + mantissa = (Tmp.pVal[whichWord(n - 1)] << (53 - n % 64)) | + (Tmp.pVal[whichWord(n - 1) - 1] >> (11 + n % 64)); + // The leading bit of mantissa is implicit, so get rid of it. + mantissa &= ~(1ULL << 52); + uint64_t sign = isNeg ? (1ULL << 63) : 0; + exp += 1023; + union { + double D; + uint64_t I; + } T; + T.I = sign | (exp << 52) | mantissa; + return T.D; +} + /// Arithmetic right-shift this APInt by shiftAmt. /// @brief Arithmetic right-shift function. APInt APInt::ashr(unsigned shiftAmt) const { @@ -1004,17 +1067,22 @@ /// @brief Left-shift function. APInt APInt::shl(unsigned shiftAmt) const { APInt API(*this); - if (shiftAmt >= API.BitsNum) { - if (API.isSingleWord()) - API.VAL = 0; - else - memset(API.pVal, 0, API.getNumWords() * 8); - } else { - for (unsigned i = 0; i < shiftAmt; ++i) API.clear(i); - for (unsigned i = shiftAmt; i < API.BitsNum; ++i) { - if (API[i-shiftAmt]) API.set(i); - else API.clear(i); + if (API.isSingleWord()) + API.VAL <<= shiftAmt; + else if (shiftAmt >= API.BitsNum) + memset(API.pVal, 0, API.getNumWords() * 8); + else { + if (unsigned offset = shiftAmt / 64) { + for (unsigned i = API.getNumWords() - 1; i > offset - 1; --i) + API.pVal[i] = API.pVal[i-offset]; + memset(API.pVal, 0, offset * 8); } + shiftAmt %= 64; + unsigned i; + for (i = API.getNumWords() - 1; i > 0; --i) + API.pVal[i] = (API.pVal[i] << shiftAmt) | + (API.pVal[i-1] >> (64-shiftAmt)); + API.pVal[i] <<= shiftAmt; } return API; } From zhousheng00 at gmail.com Mon Feb 12 14:03:13 2007 From: zhousheng00 at gmail.com (Zhou Sheng) Date: Mon, 12 Feb 2007 14:03:13 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h Message-ID: <200702122003.l1CK3DPH028548@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.6 -> 1.7 --- Log message: 1. Make APInt::shl work correctly and more efficiently. 2. Add functions to support the numberical conversion between APInt and double/float. --- Diffs of the changes: (+24 -0) APInt.h | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.6 llvm/include/llvm/ADT/APInt.h:1.7 --- llvm/include/llvm/ADT/APInt.h:1.6 Fri Feb 9 01:47:22 2007 +++ llvm/include/llvm/ADT/APInt.h Mon Feb 12 14:02:55 2007 @@ -289,6 +289,9 @@ inline uint64_t getValue() { if (isSingleWord()) return VAL; + unsigned n = getNumWords() * 64 - CountLeadingZeros(); + if (n <= 64) + return pVal[0]; assert(0 && "This APInt's bitwidth > 64"); } @@ -385,6 +388,9 @@ CountLeadingZeros(); } + /// @brief Converts this APInt to a double value. + double APIntRoundToDouble(bool isSigned = false) const; + /// Arithmetic right-shift this APInt by shiftAmt. /// @brief Arithmetic right-shift function. APInt ashr(unsigned shiftAmt) const; @@ -456,6 +462,24 @@ /// using Euclid's algorithm. APInt GreatestCommonDivisor(const APInt& API1, const APInt& API2); +/// @brief Converts the given APInt to a double value. +inline double APIntRoundToDouble(const APInt& APIVal, bool isSigned = false) { + return APIVal.APIntRoundToDouble(isSigned); +} + +/// @brief Converts the given APInt to a float vlalue. +inline float APIntRoundToFloat(const APInt& APIVal) { + return float(APIntRoundToDouble(APIVal)); +} + +/// @brief Converts the given double value into a APInt. +APInt DoubleRoundToAPInt(double Double); + +/// @brief Converts the given float value into a APInt. +inline APInt FloatRoundToAPInt(float Float) { + return DoubleRoundToAPInt(double(Float)); +} + /// Arithmetic right-shift the APInt by shiftAmt. /// @brief Arithmetic right-shift function. inline APInt ashr(const APInt& LHS, unsigned shiftAmt) { From sabre at nondot.org Mon Feb 12 14:26:51 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 14:26:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200702122026.l1CKQp1C028932@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.154 -> 1.155 --- Log message: add a note --- Diffs of the changes: (+29 -0) README.txt | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.154 llvm/lib/Target/X86/README.txt:1.155 --- llvm/lib/Target/X86/README.txt:1.154 Thu Feb 8 17:53:38 2007 +++ llvm/lib/Target/X86/README.txt Mon Feb 12 14:26:34 2007 @@ -868,3 +868,32 @@ //===---------------------------------------------------------------------===// +This code: + +void test(int X) { + if (X) abort(); +} + +is currently compiled to (with -static): + +_test: + subl $12, %esp + cmpl $0, 16(%esp) + jne LBB1_1 #cond_true + addl $12, %esp + ret +LBB1_1: #cond_true + call L_abort$stub + +It would be better to produce: + +_test: + subl $12, %esp + cmpl $0, 16(%esp) + jne L_abort$stub + addl $12, %esp + ret + +This can be applied to any no-return function call that takes no arguments etc. + +//===---------------------------------------------------------------------===// From reid at x10sys.com Mon Feb 12 14:58:14 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 14:58:14 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bit_concat.c bit_reduce.c bit_reduce.reference_output part_select.c Message-ID: <200702122058.l1CKwELq029516@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bit_concat.c updated: 1.1 -> 1.2 bit_reduce.c updated: 1.1 -> 1.2 bit_reduce.reference_output updated: 1.1 -> 1.2 part_select.c updated: 1.1 -> 1.2 --- Log message: Update test programs. --- Diffs of the changes: (+159 -38) bit_concat.c | 2 bit_reduce.c | 43 +++++++----- bit_reduce.reference_output | 150 ++++++++++++++++++++++++++++++++++++++------ part_select.c | 2 4 files changed, 159 insertions(+), 38 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bit_concat.c diff -u llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_concat.c:1.1 Mon Feb 12 11:52:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_concat.c Mon Feb 12 14:57:48 2007 @@ -21,7 +21,7 @@ void printBits(ConcatType val, int numbits ) { int j; - for (j = numbits-1; j >= 0; --j) { + for (j = numbits; j > 0; --j) { if (__builtin_bit_select(val, j)) printf("1"); else Index: llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c diff -u llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c:1.1 Mon Feb 12 11:52:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c Mon Feb 12 14:57:48 2007 @@ -16,15 +16,15 @@ #ifdef ENABLE_LARGE_INTEGERS typedef int __attribute__((bitwidth(250))) BitType; -const BitType X = 0xAAAAAAAAAAAAAAAAULL; +const BitType X = 0xFFFFFFFFFFFFFFFFULL; int numbits = 250; #else -typedef int __attribute__((bitwidth(47))) BitType; -const BitType X = 0xAAAAAAAAAAAAULL; -int numbits = 47; +typedef int __attribute__((bitwidth(15))) BitType; +const BitType X = 0xFFFFFFFFFFFULL; +int numbits = 15; #endif -printBits(BitType val, int numbits ) { +void printBits(BitType val, int numbits ) { int j; for (j = numbits-1; j >= 0; --j) { if (__builtin_bit_select(val, j)) @@ -34,6 +34,20 @@ } } +void showReduction(BitType Val) { + printf("Value="); + _Bool And = __builtin_bit_and_reduce(Val); + _Bool Nand = __builtin_bit_nand_reduce(Val); + _Bool Or = __builtin_bit_or_reduce(Val); + _Bool Nor = __builtin_bit_nor_reduce(Val); + _Bool Xor = __builtin_bit_xor_reduce(Val); + _Bool Nxor = __builtin_bit_nxor_reduce(Val); + printBits(Val, numbits); + printf(", and=%d, nand=%d, or=%d, nor=%d, xor=%d, nxor=%d\n", + And, Nand, Or, Nor, Xor, Nxor); +} + + int main(int argc, char** argv) { @@ -47,21 +61,14 @@ srand(seed); + showReduction(0); + showReduction(1); + showReduction(-1); + for (i = 0; i < 128; i++) { - int num = rand(); + unsigned long long num = rand(); BitType Val = Y * num; - { - unsigned char And = __builtin_bit_and_reduce(Val); - unsigned char Nand = __builtin_bit_nand_reduce(Val); - unsigned char Or = __builtin_bit_or_reduce(Val); - unsigned char Nor = __builtin_bit_nor_reduce(Val); - unsigned char Xor = __builtin_bit_xor_reduce(Val); - unsigned char Nxor = __builtin_bit_nxor_reduce(Val); - printf("Value="); - printBits(Val, numbits); - printf(", and=%d, nand=%d, or=%d, nor=%d, xor=%d, nxor=%d\n", - And, Nand, Or, Nor, Xor, Nxor); - } + showReduction(Val); } return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output:1.1 Mon Feb 12 11:52:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bit_reduce.reference_output Mon Feb 12 14:57:48 2007 @@ -1,18 +1,132 @@ -Tried to execute an unknown external function: i1 (...) * __builtin_bit_and_reduce -/proj/llvm/llvm-2/Debug/bin/lli((anonymous namespace)::PrintStackTrace()+0x1a)[0x871c18a] -/proj/llvm/llvm-2/Debug/bin/lli((anonymous namespace)::SignalHandler(int)+0x110)[0x871c4b2] -[0x8e5420] -/lib/libc.so.6(abort+0x101)[0x3234f1] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::callExternalFunction(llvm::Function*, std::vector > const&)+0x138)[0x845428c] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::callFunction(llvm::Function*, std::vector > const&)+0x11a)[0x844f356] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::visitCallSite(llvm::CallSite)+0x433)[0x844f9d9] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::visitCallInst(llvm::CallInst&)+0x2a)[0x845a998] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::InstVisitor::visitCall(llvm::CallInst&)+0x18)[0x845a9b2] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::InstVisitor::visit(llvm::Instruction&)+0x422)[0x845b5cc] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::run()+0x9d)[0x8450c21] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::Interpreter::runFunction(llvm::Function*, std::vector > const&)+0xc9)[0x84545a1] -/proj/llvm/llvm-2/Debug/bin/lli(llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::vector, std::allocator >, std::allocator, std::allocator > > > const&, char const* const*)+0x218)[0x84729ac] -/proj/llvm/llvm-2/Debug/bin/lli(main+0x356)[0x83593aa] -/lib/libc.so.6(__libc_start_main+0xdc)[0x30f4e4] -/proj/llvm/llvm-2/Debug/bin/lli(__gxx_personality_v0+0x191)[0x8358fd1] -exit 134 +Value=000000000000000, and=0, nand=1, or=0, nor=1, xor=0, nxor=1 +Value=000000000000001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111111111111111, and=1, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110010011000001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000011100001000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=010100011010101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000110101110000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=000011110010000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=010000001100001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011111000100011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110001010100100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=011101010110011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000000111111010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=101101100000101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111111001011010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=000001001001110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=110101100011011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=101111000010101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010011111101100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=010010000001101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010010001010101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=100100010001001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110001101000100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111011100101111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110111101000011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111100001111101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=100001110010001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000001001011000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=000110111110110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=000110110001010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=011000011000010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=101111111011110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=001111101110010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=011010000111111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=100010010011111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010011001111010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=101110100010100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=101001000001110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=010111000001010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=111110101110101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001000000110001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001000010101110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=011100000100111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001001000101010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=110101110110011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011011010000001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001010001111000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=101011011001101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001010010010110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=011110001100100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111101011011010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=011100011101011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000010011101100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=101111000011101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011000000011010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=111010000101111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=101011010011010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=111001110101010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=111011010000111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110010010010000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=000000100110100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=010011101001001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=100010001101110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=010000010100110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=101101110001000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=000100100001100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=100011100011111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011100010011100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=101101100011010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=111010100101001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011011000010001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110101101001011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000010111010110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=110111000111000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111110101110101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111000110001001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010010010111001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001000111101101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=100100001010110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=011100101001111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=100111001010000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=100001100101111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111001000111001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=101001100111100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=010000101001100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=010001001010011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=100011101101011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111011111100110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=001010111111101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011110111110010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=101110001110110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=001011100110000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=110010100111011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010000011100100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=011011111010110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=100000011000011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010100111110000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111111011110101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111100101011111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000010100001010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=111010000011101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010111101110000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111000001010100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111100111110011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001110110100111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110110111001001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=110101101111100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=100001001100000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111111110110101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011001111010001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111101110101110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=100111000000101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111011100000000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=110110111100111, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=010000101000001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=001100001001100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=001000000111010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=110100010101100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=001000000110010, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=010011000110110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=010011010011110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=110110010101000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=011110101100110, and=0, nand=1, or=1, nor=0, xor=0, nxor=1 +Value=000101111011001, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=000110110001100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=111010100111100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=100110010011100, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=011011101111011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=111010000110000, and=0, nand=1, or=1, nor=1, xor=0, nxor=1 +Value=100010111111011, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +Value=011110010000101, and=0, nand=1, or=1, nor=0, xor=1, nxor=0 +exit 0 Index: llvm-test/SingleSource/UnitTests/Integer/part_select.c diff -u llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.1 llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.2 --- llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.1 Mon Feb 12 11:52:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/part_select.c Mon Feb 12 14:57:48 2007 @@ -39,7 +39,7 @@ for (i = 1; i <= numbits; ++i) { BitType left = rand() % numbits; BitType right = i; - BitType Z = __builtin_part_select(Y, left, right); + BitType Z = __builtin_bit_part_select(Y, left, right); printf("part_select(Y, %3d, %3d) = ", (int)left, (int)right); for (j = numbits; j > 0; --j) { if (__builtin_bit_select(Z, j)) From sabre at nondot.org Mon Feb 12 15:20:43 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 15:20:43 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200702122120.l1CLKhpO029898@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.155 -> 1.156 --- Log message: more notes --- Diffs of the changes: (+26 -3) README.txt | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.155 llvm/lib/Target/X86/README.txt:1.156 --- llvm/lib/Target/X86/README.txt:1.155 Mon Feb 12 14:26:34 2007 +++ llvm/lib/Target/X86/README.txt Mon Feb 12 15:20:26 2007 @@ -874,15 +874,15 @@ if (X) abort(); } -is currently compiled to (with -static): +is currently compiled to: _test: subl $12, %esp cmpl $0, 16(%esp) - jne LBB1_1 #cond_true + jne LBB1_1 addl $12, %esp ret -LBB1_1: #cond_true +LBB1_1: call L_abort$stub It would be better to produce: @@ -895,5 +895,28 @@ ret This can be applied to any no-return function call that takes no arguments etc. +Alternatively, the stack save/restore logic could be shrink-wrapped, producing +something like this: + +_test: + cmpl $0, 4(%esp) + jne LBB1_1 + ret +LBB1_1: + subl $12, %esp + call L_abort$stub + +Both are useful in different situations. Finally, it could be shrink-wrapped +and tail called, like this: + +_test: + cmpl $0, 4(%esp) + jne LBB1_1 + ret +LBB1_1: + pop %eax # realign stack. + call L_abort$stub + +Though this probably isn't worth it. //===---------------------------------------------------------------------===// From echeng at apple.com Mon Feb 12 15:27:36 2007 From: echeng at apple.com (echeng at apple.com) Date: Mon, 12 Feb 2007 13:27:36 -0800 (PST) Subject: [llvm-commits] [123745] Add llvm::createStripDeadPrototypesPass(). Message-ID: <20070212212736.02CC93EC236A@src> Revision: 123745 Author: echeng Date: 2007-02-12 13:27:35 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Add llvm::createStripDeadPrototypesPass(). Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-linker-hack.cpp Modified: apple-local/branches/llvm/gcc/llvm-linker-hack.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-linker-hack.cpp 2007-02-12 20:54:12 UTC (rev 123744) +++ apple-local/branches/llvm/gcc/llvm-linker-hack.cpp 2007-02-12 21:27:35 UTC (rev 123745) @@ -76,6 +76,7 @@ llvm::createTailCallEliminationPass(); llvm::createDeadStoreEliminationPass(); llvm::createIPConstantPropagationPass(); + llvm::createStripDeadPrototypesPass(); } /* APPLE LOCAL end LLVM (ENTIRE FILE!) */ From sabre at nondot.org Mon Feb 12 16:57:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 16:57:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LowerPacked.cpp ScalarReplAggregates.cpp Message-ID: <200702122257.l1CMv0LZ031891@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.629 -> 1.630 LowerPacked.cpp updated: 1.16 -> 1.17 ScalarReplAggregates.cpp updated: 1.72 -> 1.73 --- Log message: stop using methods that take vectors. --- Diffs of the changes: (+14 -9) InstructionCombining.cpp | 3 ++- LowerPacked.cpp | 4 ++-- ScalarReplAggregates.cpp | 16 ++++++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.629 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.630 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.629 Sat Feb 10 19:23:03 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Feb 12 16:56:41 2007 @@ -7832,7 +7832,8 @@ } if (!Indices.empty()) - return new GetElementPtrInst(SrcGEPOperands[0], Indices, GEP.getName()); + return new GetElementPtrInst(SrcGEPOperands[0], &Indices[0], + Indices.size(), GEP.getName()); } else if (GlobalValue *GV = dyn_cast(PtrOp)) { // GEP of global variable. If all of the indices for this GEP are Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.16 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.17 --- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.16 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Mon Feb 12 16:56:41 2007 @@ -231,7 +231,7 @@ // Get the pointer Value* val = new GetElementPtrInst(array, - Idx, + &Idx[0], Idx.size(), LI.getName() + ".ge." + utostr(i), &LI); @@ -329,7 +329,7 @@ // Generate the indices for getelementptr Idx[1] = ConstantInt::get(Type::Int32Ty,i); Value* val = new GetElementPtrInst(array, - Idx, + &Idx[0], Idx.size(), "store.ge." + utostr(i) + ".", &SI); Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.72 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.73 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.72 Sat Feb 10 19:23:03 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Mon Feb 12 16:56:41 2007 @@ -33,6 +33,7 @@ #include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Compiler.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/StringExtras.h" using namespace llvm; @@ -224,10 +225,11 @@ // getelement ptr instruction to finish the indexing. This may be // expanded itself once the worklist is rerun. // - std::vector NewArgs; + SmallVector NewArgs; NewArgs.push_back(Constant::getNullValue(Type::Int32Ty)); - NewArgs.insert(NewArgs.end(), GEPI->op_begin()+3, GEPI->op_end()); - RepValue = new GetElementPtrInst(AllocaToUse, NewArgs, "", GEPI); + NewArgs.append(GEPI->op_begin()+3, GEPI->op_end()); + RepValue = new GetElementPtrInst(AllocaToUse, &NewArgs[0], + NewArgs.size(), "", GEPI); RepValue->takeName(GEPI); } @@ -397,12 +399,14 @@ Constant::getNullValue(I.getOperand()->getType()), "isone", GEPI); // Insert the new GEP instructions, which are properly indexed. - std::vector Indices(GEPI->op_begin()+1, GEPI->op_end()); + SmallVector Indices(GEPI->op_begin()+1, GEPI->op_end()); Indices[1] = Constant::getNullValue(Type::Int32Ty); - Value *ZeroIdx = new GetElementPtrInst(GEPI->getOperand(0), Indices, + Value *ZeroIdx = new GetElementPtrInst(GEPI->getOperand(0), + &Indices[0], Indices.size(), GEPI->getName()+".0", GEPI); Indices[1] = ConstantInt::get(Type::Int32Ty, 1); - Value *OneIdx = new GetElementPtrInst(GEPI->getOperand(0), Indices, + Value *OneIdx = new GetElementPtrInst(GEPI->getOperand(0), + &Indices[0], Indices.size(), GEPI->getName()+".1", GEPI); // Replace all loads of the variable index GEP with loads from both // indexes and a select. From sabre at nondot.org Mon Feb 12 16:57:01 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 16:57:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp GlobalOpt.cpp Message-ID: <200702122257.l1CMv18p031898@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.36 -> 1.37 GlobalOpt.cpp updated: 1.96 -> 1.97 --- Log message: stop using methods that take vectors. --- Diffs of the changes: (+9 -5) ArgumentPromotion.cpp | 7 +++++-- GlobalOpt.cpp | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.36 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.37 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.36 Sat Feb 10 19:08:35 2007 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Mon Feb 12 16:56:41 2007 @@ -370,7 +370,9 @@ // Add a parameter to the function for each element passed in. for (ScalarizeTable::iterator SI = ArgIndices.begin(), E = ArgIndices.end(); SI != E; ++SI) - Params.push_back(GetElementPtrInst::getIndexedType(I->getType(), *SI)); + Params.push_back(GetElementPtrInst::getIndexedType(I->getType(), + &(*SI)[0], + SI->size())); if (ArgIndices.size() == 1 && ArgIndices.begin()->empty()) ++NumArgumentsPromoted; @@ -421,7 +423,8 @@ Value *V = *AI; LoadInst *OrigLoad = OriginalLoads[*SI]; if (!SI->empty()) { - V = new GetElementPtrInst(V, *SI, V->getName()+".idx", Call); + V = new GetElementPtrInst(V, &(*SI)[0], SI->size(), + V->getName()+".idx", Call); AA.copyValue(OrigLoad->getOperand(0), V); } Args.push_back(new LoadInst(V, V->getName()+".val", Call)); Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.96 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.97 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.96 Sat Feb 10 19:08:35 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Mon Feb 12 16:56:41 2007 @@ -908,11 +908,12 @@ Value *NewPtr = InsertedLoadsForPtr[FieldNo]; // Create the new GEP idx vector. - std::vector GEPIdx; + SmallVector GEPIdx; GEPIdx.push_back(GEPI->getOperand(1)); - GEPIdx.insert(GEPIdx.end(), GEPI->op_begin()+3, GEPI->op_end()); + GEPIdx.append(GEPI->op_begin()+3, GEPI->op_end()); - Value *NGEPI = new GetElementPtrInst(NewPtr, GEPIdx, GEPI->getName(), GEPI); + Value *NGEPI = new GetElementPtrInst(NewPtr, &GEPIdx[0], GEPIdx.size(), + GEPI->getName(), GEPI); GEPI->replaceAllUsesWith(NGEPI); GEPI->eraseFromParent(); } From sabre at nondot.org Mon Feb 12 16:57:02 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 16:57:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/LowerInvoke.cpp Message-ID: <200702122257.l1CMv2UW031903@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: LowerInvoke.cpp updated: 1.52 -> 1.53 --- Log message: stop using methods that take vectors. --- Diffs of the changes: (+4 -3) LowerInvoke.cpp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.52 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.53 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.52 Sat Feb 10 19:37:51 2007 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Mon Feb 12 16:56:41 2007 @@ -441,7 +441,7 @@ std::vector Idx; Idx.push_back(Constant::getNullValue(Type::Int32Ty)); Idx.push_back(ConstantInt::get(Type::Int32Ty, 1)); - OldJmpBufPtr = new GetElementPtrInst(JmpBuf, Idx, "OldBuf", + OldJmpBufPtr = new GetElementPtrInst(JmpBuf, &Idx[0], 2, "OldBuf", EntryBB->getTerminator()); // Copy the JBListHead to the alloca. @@ -480,7 +480,8 @@ "setjmp.cont"); Idx[1] = ConstantInt::get(Type::Int32Ty, 0); - Value *JmpBufPtr = new GetElementPtrInst(JmpBuf, Idx, "TheJmpBuf", + Value *JmpBufPtr = new GetElementPtrInst(JmpBuf, &Idx[0], Idx.size(), + "TheJmpBuf", EntryBB->getTerminator()); Value *SJRet = new CallInst(SetJmpFn, JmpBufPtr, "sjret", EntryBB->getTerminator()); @@ -530,7 +531,7 @@ std::vector Idx; Idx.push_back(Constant::getNullValue(Type::Int32Ty)); Idx.push_back(ConstantInt::get(Type::Int32Ty, 0)); - Idx[0] = new GetElementPtrInst(BufPtr, Idx, "JmpBuf", UnwindBlock); + Idx[0] = new GetElementPtrInst(BufPtr, &Idx[0], 2, "JmpBuf", UnwindBlock); Idx[1] = ConstantInt::get(Type::Int32Ty, 1); new CallInst(LongJmpFn, Idx, "", UnwindBlock); new UnreachableInst(UnwindBlock); From sabre at nondot.org Mon Feb 12 16:58:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 16:58:54 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y UpgradeParser.y.cvs Message-ID: <200702122258.l1CMwsI9031965@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp.cvs updated: 1.60 -> 1.61 UpgradeParser.h.cvs updated: 1.44 -> 1.45 UpgradeParser.y updated: 1.63 -> 1.64 UpgradeParser.y.cvs updated: 1.59 -> 1.60 --- Log message: stop using me thods that take a vector --- Diffs of the changes: (+4627 -3327) UpgradeParser.cpp.cvs | 7399 ++++++++++++++++++++++++++++---------------------- UpgradeParser.h.cvs | 511 ++- UpgradeParser.y | 4 UpgradeParser.y.cvs | 4 4 files changed, 4627 insertions(+), 3291 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.60 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.61 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.60 Sun Feb 11 15:39:05 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Mon Feb 12 16:58:37 2007 @@ -1,167 +1,386 @@ +/* A Bison parser, made by GNU Bison 2.3. */ -/* A Bison parser, made from /Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y - by GNU Bison version 1.28 */ +/* Skeleton implementation for Bison's Yacc-like parsers in C -#define YYBISON 1 /* Identify Bison output. */ + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ #define yyparse Upgradeparse -#define yylex Upgradelex +#define yylex Upgradelex #define yyerror Upgradeerror -#define yylval Upgradelval -#define yychar Upgradechar +#define yylval Upgradelval +#define yychar Upgradechar #define yydebug Upgradedebug #define yynerrs Upgradenerrs -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define SINTVAL 259 -#define UINTVAL 260 -#define FPVAL 261 -#define VOID 262 -#define BOOL 263 -#define SBYTE 264 -#define UBYTE 265 -#define SHORT 266 -#define USHORT 267 -#define INT 268 -#define UINT 269 -#define LONG 270 -#define ULONG 271 -#define FLOAT 272 -#define DOUBLE 273 -#define TYPE 274 -#define LABEL 275 -#define VAR_ID 276 -#define LABELSTR 277 -#define STRINGCONSTANT 278 -#define IMPLEMENTATION 279 -#define ZEROINITIALIZER 280 -#define TRUETOK 281 -#define FALSETOK 282 -#define BEGINTOK 283 -#define ENDTOK 284 -#define DECLARE 285 -#define GLOBAL 286 -#define CONSTANT 287 -#define SECTION 288 -#define VOLATILE 289 -#define TO 290 -#define DOTDOTDOT 291 -#define NULL_TOK 292 -#define UNDEF 293 -#define CONST 294 -#define INTERNAL 295 -#define LINKONCE 296 -#define WEAK 297 -#define APPENDING 298 -#define DLLIMPORT 299 -#define DLLEXPORT 300 -#define EXTERN_WEAK 301 -#define OPAQUE 302 -#define NOT 303 -#define EXTERNAL 304 -#define TARGET 305 -#define TRIPLE 306 -#define ENDIAN 307 -#define POINTERSIZE 308 -#define LITTLE 309 -#define BIG 310 -#define ALIGN 311 -#define DEPLIBS 312 -#define CALL 313 -#define TAIL 314 -#define ASM_TOK 315 -#define MODULE 316 -#define SIDEEFFECT 317 -#define CC_TOK 318 -#define CCC_TOK 319 -#define CSRETCC_TOK 320 -#define FASTCC_TOK 321 -#define COLDCC_TOK 322 -#define X86_STDCALLCC_TOK 323 -#define X86_FASTCALLCC_TOK 324 -#define DATALAYOUT 325 -#define RET 326 -#define BR 327 -#define SWITCH 328 -#define INVOKE 329 -#define UNREACHABLE 330 -#define UNWIND 331 -#define EXCEPT 332 -#define ADD 333 -#define SUB 334 -#define MUL 335 -#define DIV 336 -#define UDIV 337 -#define SDIV 338 -#define FDIV 339 -#define REM 340 -#define UREM 341 -#define SREM 342 -#define FREM 343 -#define AND 344 -#define OR 345 -#define XOR 346 -#define SHL 347 -#define SHR 348 -#define ASHR 349 -#define LSHR 350 -#define SETLE 351 -#define SETGE 352 -#define SETLT 353 -#define SETGT 354 -#define SETEQ 355 -#define SETNE 356 -#define ICMP 357 -#define FCMP 358 -#define MALLOC 359 -#define ALLOCA 360 -#define FREE 361 -#define LOAD 362 -#define STORE 363 -#define GETELEMENTPTR 364 -#define PHI_TOK 365 -#define SELECT 366 -#define VAARG 367 -#define EXTRACTELEMENT 368 -#define INSERTELEMENT 369 -#define SHUFFLEVECTOR 370 -#define VAARG_old 371 -#define VANEXT_old 372 -#define EQ 373 -#define NE 374 -#define SLT 375 -#define SGT 376 -#define SLE 377 -#define SGE 378 -#define ULT 379 -#define UGT 380 -#define ULE 381 -#define UGE 382 -#define OEQ 383 -#define ONE 384 -#define OLT 385 -#define OGT 386 -#define OLE 387 -#define OGE 388 -#define ORD 389 -#define UNO 390 -#define UEQ 391 -#define UNE 392 -#define CAST 393 -#define TRUNC 394 -#define ZEXT 395 -#define SEXT 396 -#define FPTRUNC 397 -#define FPEXT 398 -#define FPTOUI 399 -#define FPTOSI 400 -#define UITOFP 401 -#define SITOFP 402 -#define PTRTOINT 403 -#define INTTOPTR 404 -#define BITCAST 405 -#line 14 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + DLLIMPORT = 300, + DLLEXPORT = 301, + EXTERN_WEAK = 302, + OPAQUE = 303, + NOT = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ENDIAN = 308, + POINTERSIZE = 309, + LITTLE = 310, + BIG = 311, + ALIGN = 312, + DEPLIBS = 313, + CALL = 314, + TAIL = 315, + ASM_TOK = 316, + MODULE = 317, + SIDEEFFECT = 318, + CC_TOK = 319, + CCC_TOK = 320, + CSRETCC_TOK = 321, + FASTCC_TOK = 322, + COLDCC_TOK = 323, + X86_STDCALLCC_TOK = 324, + X86_FASTCALLCC_TOK = 325, + DATALAYOUT = 326, + RET = 327, + BR = 328, + SWITCH = 329, + INVOKE = 330, + UNREACHABLE = 331, + UNWIND = 332, + EXCEPT = 333, + ADD = 334, + SUB = 335, + MUL = 336, + DIV = 337, + UDIV = 338, + SDIV = 339, + FDIV = 340, + REM = 341, + UREM = 342, + SREM = 343, + FREM = 344, + AND = 345, + OR = 346, + XOR = 347, + SHL = 348, + SHR = 349, + ASHR = 350, + LSHR = 351, + SETLE = 352, + SETGE = 353, + SETLT = 354, + SETGT = 355, + SETEQ = 356, + SETNE = 357, + ICMP = 358, + FCMP = 359, + MALLOC = 360, + ALLOCA = 361, + FREE = 362, + LOAD = 363, + STORE = 364, + GETELEMENTPTR = 365, + PHI_TOK = 366, + SELECT = 367, + VAARG = 368, + EXTRACTELEMENT = 369, + INSERTELEMENT = 370, + SHUFFLEVECTOR = 371, + VAARG_old = 372, + VANEXT_old = 373, + EQ = 374, + NE = 375, + SLT = 376, + SGT = 377, + SLE = 378, + SGE = 379, + ULT = 380, + UGT = 381, + ULE = 382, + UGE = 383, + OEQ = 384, + ONE = 385, + OLT = 386, + OGT = 387, + OLE = 388, + OGE = 389, + ORD = 390, + UNO = 391, + UEQ = 392, + UNE = 393, + CAST = 394, + TRUNC = 395, + ZEXT = 396, + SEXT = 397, + FPTRUNC = 398, + FPEXT = 399, + FPTOUI = 400, + FPTOSI = 401, + UITOFP = 402, + SITOFP = 403, + PTRTOINT = 404, + INTTOPTR = 405, + BITCAST = 406 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define SINTVAL 260 +#define UINTVAL 261 +#define FPVAL 262 +#define VOID 263 +#define BOOL 264 +#define SBYTE 265 +#define UBYTE 266 +#define SHORT 267 +#define USHORT 268 +#define INT 269 +#define UINT 270 +#define LONG 271 +#define ULONG 272 +#define FLOAT 273 +#define DOUBLE 274 +#define TYPE 275 +#define LABEL 276 +#define VAR_ID 277 +#define LABELSTR 278 +#define STRINGCONSTANT 279 +#define IMPLEMENTATION 280 +#define ZEROINITIALIZER 281 +#define TRUETOK 282 +#define FALSETOK 283 +#define BEGINTOK 284 +#define ENDTOK 285 +#define DECLARE 286 +#define GLOBAL 287 +#define CONSTANT 288 +#define SECTION 289 +#define VOLATILE 290 +#define TO 291 +#define DOTDOTDOT 292 +#define NULL_TOK 293 +#define UNDEF 294 +#define CONST 295 +#define INTERNAL 296 +#define LINKONCE 297 +#define WEAK 298 +#define APPENDING 299 +#define DLLIMPORT 300 +#define DLLEXPORT 301 +#define EXTERN_WEAK 302 +#define OPAQUE 303 +#define NOT 304 +#define EXTERNAL 305 +#define TARGET 306 +#define TRIPLE 307 +#define ENDIAN 308 +#define POINTERSIZE 309 +#define LITTLE 310 +#define BIG 311 +#define ALIGN 312 +#define DEPLIBS 313 +#define CALL 314 +#define TAIL 315 +#define ASM_TOK 316 +#define MODULE 317 +#define SIDEEFFECT 318 +#define CC_TOK 319 +#define CCC_TOK 320 +#define CSRETCC_TOK 321 +#define FASTCC_TOK 322 +#define COLDCC_TOK 323 +#define X86_STDCALLCC_TOK 324 +#define X86_FASTCALLCC_TOK 325 +#define DATALAYOUT 326 +#define RET 327 +#define BR 328 +#define SWITCH 329 +#define INVOKE 330 +#define UNREACHABLE 331 +#define UNWIND 332 +#define EXCEPT 333 +#define ADD 334 +#define SUB 335 +#define MUL 336 +#define DIV 337 +#define UDIV 338 +#define SDIV 339 +#define FDIV 340 +#define REM 341 +#define UREM 342 +#define SREM 343 +#define FREM 344 +#define AND 345 +#define OR 346 +#define XOR 347 +#define SHL 348 +#define SHR 349 +#define ASHR 350 +#define LSHR 351 +#define SETLE 352 +#define SETGE 353 +#define SETLT 354 +#define SETGT 355 +#define SETEQ 356 +#define SETNE 357 +#define ICMP 358 +#define FCMP 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define PHI_TOK 366 +#define SELECT 367 +#define VAARG 368 +#define EXTRACTELEMENT 369 +#define INSERTELEMENT 370 +#define SHUFFLEVECTOR 371 +#define VAARG_old 372 +#define VANEXT_old 373 +#define EQ 374 +#define NE 375 +#define SLT 376 +#define SGT 377 +#define SLE 378 +#define SGE 379 +#define ULT 380 +#define UGT 381 +#define ULE 382 +#define UGE 383 +#define OEQ 384 +#define ONE 385 +#define OLT 386 +#define OGT 387 +#define OLE 388 +#define OGE 389 +#define ORD 390 +#define UNO 391 +#define UEQ 392 +#define UNE 393 +#define CAST 394 +#define TRUNC 395 +#define ZEXT 396 +#define SEXT 397 +#define FPTRUNC 398 +#define FPEXT 399 +#define FPTOUI 400 +#define FPTOSI 401 +#define UITOFP 402 +#define SITOFP 403 +#define PTRTOINT 404 +#define INTTOPTR 405 +#define BITCAST 406 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" #include "UpgradeInternals.h" #include "llvm/CallingConv.h" @@ -1438,7 +1657,7 @@ } const Type *IdxTy = - GetElementPtrInst::getIndexedType(PTy, VIndices, true); + GetElementPtrInst::getIndexedType(PTy, &VIndices[0], VIndices.size(), true); if (!IdxTy) error("Index list invalid for constant getelementptr"); return IdxTy; @@ -1601,8 +1820,29 @@ using namespace llvm; -#line 1454 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -typedef union { + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 1454 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -1642,1152 +1882,1835 @@ llvm::ICmpInst::Predicate IPred; llvm::FCmpInst::Predicate FPred; llvm::Module::Endianness Endianness; -} YYSTYPE; -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif +} +/* Line 193 of yacc.c. */ +#line 1888 "UpgradeParser.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -#define YYFINAL 605 -#define YYFLAG -32768 -#define YYNTBASE 166 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 405 ? yytranslate[x] : 245) - -static const short yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 155, - 156, 164, 2, 153, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 160, - 152, 161, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 157, 154, 159, 2, 2, 2, 2, 2, 165, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 158, - 2, 2, 162, 2, 163, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151 -}; +/* Copy the second part of user declarations. */ -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, - 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, - 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, - 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, - 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, - 161, 162, 164, 166, 168, 170, 172, 174, 176, 177, - 178, 180, 182, 184, 186, 188, 190, 193, 194, 197, - 198, 202, 205, 206, 208, 209, 213, 215, 218, 220, - 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, - 242, 244, 246, 248, 250, 252, 254, 256, 258, 261, - 266, 272, 278, 282, 285, 291, 296, 299, 301, 305, - 307, 311, 313, 314, 319, 323, 327, 332, 337, 341, - 348, 354, 357, 360, 363, 366, 369, 372, 375, 378, - 381, 384, 391, 397, 406, 413, 420, 427, 435, 443, - 450, 457, 466, 475, 479, 481, 483, 485, 487, 490, - 493, 498, 501, 503, 508, 511, 516, 517, 525, 526, - 534, 535, 543, 544, 552, 556, 561, 562, 564, 566, - 568, 572, 576, 580, 584, 588, 592, 594, 595, 597, - 599, 601, 602, 605, 609, 611, 613, 617, 619, 620, - 629, 631, 633, 637, 639, 641, 644, 645, 647, 649, - 650, 651, 657, 658, 660, 662, 664, 666, 668, 670, - 672, 674, 676, 680, 682, 688, 690, 692, 694, 696, - 699, 702, 705, 709, 712, 713, 715, 717, 719, 722, - 725, 729, 739, 749, 758, 772, 774, 776, 783, 789, - 792, 799, 807, 809, 813, 815, 816, 819, 821, 827, - 833, 839, 846, 853, 856, 861, 866, 873, 878, 883, - 888, 893, 900, 907, 910, 918, 920, 923, 924, 926, - 927, 931, 938, 942, 949, 952, 957, 964 -}; -static const short yyrhs[] = { 5, - 0, 6, 0, 3, 0, 4, 0, 79, 0, 80, - 0, 81, 0, 82, 0, 83, 0, 84, 0, 85, - 0, 86, 0, 87, 0, 88, 0, 89, 0, 90, - 0, 91, 0, 92, 0, 97, 0, 98, 0, 99, - 0, 100, 0, 101, 0, 102, 0, 119, 0, 120, - 0, 121, 0, 122, 0, 123, 0, 124, 0, 125, - 0, 126, 0, 127, 0, 128, 0, 129, 0, 130, - 0, 131, 0, 132, 0, 133, 0, 134, 0, 135, - 0, 136, 0, 137, 0, 138, 0, 125, 0, 126, - 0, 127, 0, 128, 0, 27, 0, 28, 0, 93, - 0, 94, 0, 95, 0, 96, 0, 140, 0, 141, - 0, 142, 0, 143, 0, 144, 0, 145, 0, 146, - 0, 147, 0, 148, 0, 149, 0, 150, 0, 151, - 0, 139, 0, 16, 0, 14, 0, 12, 0, 10, - 0, 17, 0, 15, 0, 13, 0, 11, 0, 175, - 0, 176, 0, 18, 0, 19, 0, 211, 152, 0, - 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, - 0, 46, 0, 47, 0, 0, 0, 65, 0, 66, - 0, 67, 0, 68, 0, 69, 0, 70, 0, 64, - 4, 0, 0, 57, 4, 0, 0, 153, 57, 4, - 0, 34, 24, 0, 0, 184, 0, 0, 153, 187, - 186, 0, 184, 0, 57, 4, 0, 190, 0, 8, - 0, 192, 0, 8, 0, 192, 0, 9, 0, 10, - 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, - 0, 16, 0, 17, 0, 18, 0, 19, 0, 21, - 0, 191, 0, 48, 0, 227, 0, 154, 4, 0, - 189, 155, 194, 156, 0, 157, 4, 158, 192, 159, - 0, 160, 4, 158, 192, 161, 0, 162, 193, 163, - 0, 162, 163, 0, 160, 162, 193, 163, 161, 0, - 160, 162, 163, 161, 0, 192, 164, 0, 192, 0, - 193, 153, 192, 0, 193, 0, 193, 153, 37, 0, - 37, 0, 0, 190, 157, 197, 159, 0, 190, 157, - 159, 0, 190, 165, 24, 0, 190, 160, 197, 161, - 0, 190, 162, 197, 163, 0, 190, 162, 163, 0, - 190, 160, 162, 197, 163, 161, 0, 190, 160, 162, - 163, 161, 0, 190, 38, 0, 190, 39, 0, 190, - 227, 0, 190, 196, 0, 190, 26, 0, 175, 167, - 0, 176, 4, 0, 9, 27, 0, 9, 28, 0, - 178, 7, 0, 174, 155, 195, 36, 190, 156, 0, - 110, 155, 195, 242, 156, 0, 112, 155, 195, 153, - 195, 153, 195, 156, 0, 168, 155, 195, 153, 195, - 156, 0, 169, 155, 195, 153, 195, 156, 0, 170, - 155, 195, 153, 195, 156, 0, 103, 171, 155, 195, - 153, 195, 156, 0, 104, 172, 155, 195, 153, 195, - 156, 0, 173, 155, 195, 153, 195, 156, 0, 114, - 155, 195, 153, 195, 156, 0, 115, 155, 195, 153, - 195, 153, 195, 156, 0, 116, 155, 195, 153, 195, - 153, 195, 156, 0, 197, 153, 195, 0, 195, 0, - 32, 0, 33, 0, 200, 0, 200, 220, 0, 200, - 222, 0, 200, 62, 61, 206, 0, 200, 25, 0, - 201, 0, 201, 179, 20, 188, 0, 201, 222, 0, - 201, 62, 61, 206, 0, 0, 201, 179, 180, 198, - 195, 202, 186, 0, 0, 201, 179, 50, 198, 190, - 203, 186, 0, 0, 201, 179, 45, 198, 190, 204, - 186, 0, 0, 201, 179, 47, 198, 190, 205, 186, - 0, 201, 51, 208, 0, 201, 58, 152, 209, 0, - 0, 24, 0, 56, 0, 55, 0, 53, 152, 207, - 0, 54, 152, 4, 0, 52, 152, 24, 0, 71, - 152, 24, 0, 157, 210, 159, 0, 210, 153, 24, - 0, 24, 0, 0, 22, 0, 24, 0, 211, 0, - 0, 190, 212, 0, 214, 153, 213, 0, 213, 0, - 214, 0, 214, 153, 37, 0, 37, 0, 0, 181, - 188, 211, 155, 215, 156, 185, 182, 0, 29, 0, - 162, 0, 180, 216, 217, 0, 30, 0, 163, 0, - 230, 219, 0, 0, 45, 0, 47, 0, 0, 0, - 31, 223, 221, 224, 216, 0, 0, 63, 0, 3, - 0, 4, 0, 7, 0, 27, 0, 28, 0, 38, - 0, 39, 0, 26, 0, 160, 197, 161, 0, 196, - 0, 61, 225, 24, 153, 24, 0, 166, 0, 211, - 0, 227, 0, 226, 0, 190, 228, 0, 230, 231, - 0, 218, 231, 0, 232, 179, 234, 0, 232, 236, - 0, 0, 23, 0, 77, 0, 78, 0, 72, 229, - 0, 72, 8, 0, 73, 21, 228, 0, 73, 9, - 228, 153, 21, 228, 153, 21, 228, 0, 74, 177, - 228, 153, 21, 228, 157, 235, 159, 0, 74, 177, - 228, 153, 21, 228, 157, 159, 0, 75, 181, 188, - 228, 155, 239, 156, 36, 21, 228, 233, 21, 228, - 0, 233, 0, 76, 0, 235, 177, 226, 153, 21, - 228, 0, 177, 226, 153, 21, 228, 0, 179, 241, - 0, 190, 157, 228, 153, 228, 159, 0, 237, 153, - 157, 228, 153, 228, 159, 0, 229, 0, 238, 153, - 229, 0, 238, 0, 0, 60, 59, 0, 59, 0, - 168, 190, 228, 153, 228, 0, 169, 190, 228, 153, - 228, 0, 170, 190, 228, 153, 228, 0, 103, 171, - 190, 228, 153, 228, 0, 104, 172, 190, 228, 153, - 228, 0, 49, 229, 0, 173, 229, 153, 229, 0, - 174, 229, 36, 190, 0, 112, 229, 153, 229, 153, - 229, 0, 113, 229, 153, 190, 0, 117, 229, 153, - 190, 0, 118, 229, 153, 190, 0, 114, 229, 153, - 229, 0, 115, 229, 153, 229, 153, 229, 0, 116, - 229, 153, 229, 153, 229, 0, 111, 237, 0, 240, - 181, 188, 228, 155, 239, 156, 0, 244, 0, 153, - 238, 0, 0, 35, 0, 0, 105, 190, 183, 0, - 105, 190, 153, 15, 228, 183, 0, 106, 190, 183, - 0, 106, 190, 153, 15, 228, 183, 0, 107, 229, - 0, 243, 108, 190, 228, 0, 243, 109, 229, 153, - 190, 228, 0, 110, 190, 228, 242, 0 -}; +/* Line 216 of yacc.c. */ +#line 1901 "UpgradeParser.tab.c" +#ifdef short +# undef short #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1594, 1595, 1603, 1604, 1614, 1614, 1614, 1614, 1614, 1614, - 1614, 1614, 1614, 1614, 1614, 1618, 1618, 1618, 1622, 1622, - 1622, 1622, 1622, 1622, 1626, 1626, 1627, 1627, 1628, 1628, - 1629, 1629, 1630, 1630, 1634, 1634, 1635, 1635, 1636, 1636, - 1637, 1637, 1638, 1638, 1639, 1639, 1640, 1640, 1641, 1642, - 1645, 1645, 1645, 1645, 1649, 1649, 1649, 1649, 1649, 1649, - 1649, 1650, 1650, 1650, 1650, 1650, 1650, 1656, 1656, 1656, - 1656, 1660, 1660, 1660, 1660, 1664, 1664, 1668, 1668, 1673, - 1676, 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1692, - 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1709, 1710, 1718, - 1719, 1727, 1736, 1737, 1744, 1745, 1749, 1753, 1769, 1770, - 1777, 1778, 1785, 1793, 1793, 1793, 1793, 1793, 1793, 1793, - 1794, 1794, 1794, 1794, 1794, 1799, 1803, 1807, 1812, 1821, - 1838, 1844, 1857, 1866, 1870, 1881, 1885, 1898, 1902, 1909, - 1910, 1916, 1923, 1935, 1965, 1978, 2001, 2029, 2051, 2062, - 2084, 2095, 2104, 2109, 2167, 2174, 2182, 2189, 2196, 2200, - 2204, 2213, 2228, 2241, 2250, 2278, 2291, 2300, 2306, 2312, - 2323, 2329, 2335, 2346, 2347, 2356, 2357, 2369, 2378, 2379, - 2380, 2381, 2382, 2398, 2418, 2420, 2422, 2426, 2429, 2433, - 2436, 2440, 2443, 2448, 2451, 2453, 2455, 2460, 2474, 2475, - 2479, 2482, 2490, 2494, 2501, 2505, 2509, 2513, 2521, 2521, - 2525, 2526, 2530, 2538, 2543, 2551, 2552, 2559, 2566, 2570, - 2746, 2746, 2750, 2760, 2760, 2764, 2769, 2770, 2771, 2775, - 2776, 2776, 2788, 2789, 2794, 2795, 2796, 2797, 2798, 2799, - 2800, 2801, 2802, 2823, 2826, 2841, 2842, 2847, 2847, 2855, - 2864, 2867, 2876, 2886, 2891, 2900, 2911, 2911, 2914, 2917, - 2920, 2924, 2930, 2945, 2951, 3007, 3010, 3016, 3026, 3039, - 3068, 3076, 3084, 3088, 3095, 3096, 3100, 3103, 3109, 3126, - 3142, 3156, 3168, 3180, 3191, 3209, 3218, 3227, 3234, 3255, - 3279, 3285, 3291, 3297, 3313, 3391, 3399, 3400, 3404, 3405, - 3409, 3415, 3421, 3427, 3433, 3440, 3452, 3477 -}; +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; #endif +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif -static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", -"EUINT64VAL","SINTVAL","UINTVAL","FPVAL","VOID","BOOL","SBYTE","UBYTE","SHORT", -"USHORT","INT","UINT","LONG","ULONG","FLOAT","DOUBLE","TYPE","LABEL","VAR_ID", -"LABELSTR","STRINGCONSTANT","IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK", -"BEGINTOK","ENDTOK","DECLARE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO", -"DOTDOTDOT","NULL_TOK","UNDEF","CONST","INTERNAL","LINKONCE","WEAK","APPENDING", -"DLLIMPORT","DLLEXPORT","EXTERN_WEAK","OPAQUE","NOT","EXTERNAL","TARGET","TRIPLE", -"ENDIAN","POINTERSIZE","LITTLE","BIG","ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK", -"MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","CSRETCC_TOK","FASTCC_TOK","COLDCC_TOK", -"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE", -"UNREACHABLE","UNWIND","EXCEPT","ADD","SUB","MUL","DIV","UDIV","SDIV","FDIV", -"REM","UREM","SREM","FREM","AND","OR","XOR","SHL","SHR","ASHR","LSHR","SETLE", -"SETGE","SETLT","SETGT","SETEQ","SETNE","ICMP","FCMP","MALLOC","ALLOCA","FREE", -"LOAD","STORE","GETELEMENTPTR","PHI_TOK","SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT", -"SHUFFLEVECTOR","VAARG_old","VANEXT_old","EQ","NE","SLT","SGT","SLE","SGE","ULT", -"UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD","UNO","UEQ","UNE", -"CAST","TRUNC","ZEXT","SEXT","FPTRUNC","FPEXT","FPTOUI","FPTOSI","UITOFP","SITOFP", -"PTRTOINT","INTTOPTR","BITCAST","'='","','","'\\\\'","'('","')'","'['","'x'", -"']'","'<'","'>'","'{'","'}'","'*'","'c'","INTVAL","EINT64VAL","ArithmeticOps", -"LogicalOps","SetCondOps","IPredicates","FPredicates","ShiftOps","CastOps","SIntType", -"UIntType","IntType","FPType","OptAssign","OptLinkage","OptCallingConv","OptAlign", -"OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", -"TypesV","UpRTypesV","Types","PrimType","UpRTypes","TypeListI","ArgTypeListI", -"ConstVal","ConstExpr","ConstVector","GlobalType","Module","FunctionList","ConstPool", -"@1","@2","@3","@4","AsmBlock","BigOrLittle","TargetDefinition","LibrariesDefinition", -"LibList","Name","OptName","ArgVal","ArgListH","ArgList","FunctionHeaderH","BEGIN", -"FunctionHeader","END","Function","FnDeclareLinkage","FunctionProto","@5","@6", -"OptSideEffect","ConstValueRef","SymbolicValueRef","ValueRef","ResolvedVal", -"BasicBlockList","BasicBlock","InstructionList","Unwind","BBTerminatorInst", -"JumpTable","Inst","PHIList","ValueRefList","ValueRefListE","OptTailCall","InstVal", -"IndexList","OptVolatile","MemoryInst", NULL -}; +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; #endif -static const short yyr1[] = { 0, - 166, 166, 167, 167, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 168, 168, 169, 169, 169, 170, 170, - 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, - 175, 176, 176, 176, 176, 177, 177, 178, 178, 179, - 179, 180, 180, 180, 180, 180, 180, 180, 180, 181, - 181, 181, 181, 181, 181, 181, 181, 182, 182, 183, - 183, 184, 185, 185, 186, 186, 187, 187, 188, 188, - 189, 189, 190, 191, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, - 192, 192, 192, 192, 192, 192, 192, 193, 193, 194, - 194, 194, 194, 195, 195, 195, 195, 195, 195, 195, - 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 197, 197, 198, 198, 199, 200, 200, - 200, 200, 200, 201, 201, 201, 202, 201, 203, 201, - 204, 201, 205, 201, 201, 201, 201, 206, 207, 207, - 208, 208, 208, 208, 209, 210, 210, 210, 211, 211, - 212, 212, 213, 214, 214, 215, 215, 215, 215, 216, - 217, 217, 218, 219, 219, 220, 221, 221, 221, 223, - 224, 222, 225, 225, 226, 226, 226, 226, 226, 226, - 226, 226, 226, 226, 226, 227, 227, 228, 228, 229, - 230, 230, 231, 232, 232, 232, 233, 233, 234, 234, - 234, 234, 234, 234, 234, 234, 234, 235, 235, 236, - 237, 237, 238, 238, 239, 239, 240, 240, 241, 241, - 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, - 241, 241, 241, 241, 241, 241, 242, 242, 243, 243, - 244, 244, 244, 244, 244, 244, 244, 244 -}; +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif -static const short yyr2[] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 2, 0, 2, 0, - 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, - 5, 5, 3, 2, 5, 4, 2, 1, 3, 1, - 3, 1, 0, 4, 3, 3, 4, 4, 3, 6, - 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 6, 5, 8, 6, 6, 6, 7, 7, 6, - 6, 8, 8, 3, 1, 1, 1, 1, 2, 2, - 4, 2, 1, 4, 2, 4, 0, 7, 0, 7, - 0, 7, 0, 7, 3, 4, 0, 1, 1, 1, - 3, 3, 3, 3, 3, 3, 1, 0, 1, 1, - 1, 0, 2, 3, 1, 1, 3, 1, 0, 8, - 1, 1, 3, 1, 1, 2, 0, 1, 1, 0, - 0, 5, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 5, 1, 1, 1, 1, 2, - 2, 2, 3, 2, 0, 1, 1, 1, 2, 2, - 3, 9, 9, 8, 13, 1, 1, 6, 5, 2, - 6, 7, 1, 3, 1, 0, 2, 1, 5, 5, - 5, 6, 6, 2, 4, 4, 6, 4, 4, 4, - 4, 6, 6, 2, 7, 1, 2, 0, 1, 0, - 3, 6, 3, 6, 2, 4, 6, 4 -}; +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif -static const short yydefact[] = { 197, - 89, 183, 182, 230, 82, 83, 84, 85, 86, 87, - 88, 0, 90, 255, 179, 180, 255, 209, 210, 0, - 0, 0, 89, 0, 185, 227, 0, 0, 91, 92, - 93, 94, 95, 96, 0, 0, 256, 252, 81, 224, - 225, 226, 251, 0, 0, 0, 0, 195, 0, 0, - 0, 0, 0, 0, 0, 80, 228, 229, 231, 198, - 181, 97, 1, 2, 110, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 127, 0, 0, - 0, 0, 246, 0, 0, 109, 126, 113, 247, 128, - 221, 222, 223, 300, 254, 0, 0, 0, 0, 208, - 196, 186, 184, 176, 177, 0, 0, 0, 0, 90, - 129, 0, 0, 0, 112, 134, 138, 0, 0, 143, - 137, 299, 0, 278, 0, 0, 0, 0, 90, 267, - 257, 258, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 51, 52, 53, 54, - 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 67, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 0, 0, 0, 0, 0, 266, 253, - 90, 270, 0, 296, 203, 200, 199, 201, 202, 204, - 207, 0, 191, 193, 189, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, - 187, 232, 0, 0, 0, 0, 0, 133, 219, 142, - 140, 0, 0, 284, 277, 260, 259, 0, 0, 71, - 75, 70, 74, 69, 73, 68, 72, 76, 77, 0, - 0, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 0, 49, 50, 45, 46, 47, 48, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 0, 100, - 100, 305, 0, 0, 294, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 205, 105, 105, 105, 159, 160, 3, 4, 157, - 158, 161, 156, 152, 153, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 155, 154, 105, 111, 111, 136, 0, 139, 218, - 212, 215, 216, 0, 0, 130, 235, 236, 237, 242, - 238, 239, 240, 241, 233, 0, 244, 249, 248, 250, - 0, 261, 0, 0, 0, 0, 0, 301, 0, 303, - 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 206, 0, - 192, 194, 190, 0, 0, 0, 0, 0, 0, 0, - 145, 175, 0, 0, 0, 149, 0, 146, 0, 0, - 0, 0, 0, 188, 131, 132, 135, 211, 213, 0, - 103, 141, 234, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 308, 0, 0, 0, 288, 291, - 0, 0, 289, 290, 0, 0, 0, 285, 286, 0, - 306, 0, 0, 0, 107, 105, 0, 0, 298, 0, - 0, 0, 0, 0, 144, 134, 113, 0, 147, 148, - 0, 0, 0, 0, 0, 217, 214, 104, 98, 0, - 243, 0, 0, 276, 0, 0, 100, 101, 100, 273, - 297, 0, 0, 0, 0, 0, 279, 280, 281, 276, - 0, 102, 108, 106, 0, 0, 0, 0, 0, 0, - 0, 174, 151, 0, 0, 0, 0, 0, 0, 0, - 220, 0, 0, 0, 275, 0, 282, 283, 0, 302, - 304, 0, 0, 0, 287, 292, 293, 0, 307, 0, - 0, 163, 0, 0, 0, 0, 150, 0, 0, 0, - 0, 0, 99, 245, 0, 0, 0, 274, 271, 0, - 295, 0, 0, 0, 171, 0, 0, 165, 166, 167, - 170, 162, 0, 264, 0, 0, 0, 272, 168, 169, - 0, 0, 0, 262, 0, 263, 0, 0, 164, 172, - 173, 0, 0, 0, 0, 0, 0, 269, 0, 0, - 268, 265, 0, 0, 0 -}; +#if ! defined yyoverflow || YYERROR_VERBOSE -static const short yydefgoto[] = { 83, - 310, 327, 328, 329, 262, 279, 330, 331, 217, 218, - 250, 219, 23, 13, 35, 521, 368, 455, 479, 391, - 456, 84, 85, 220, 87, 88, 118, 232, 402, 357, - 403, 106, 603, 1, 2, 334, 305, 303, 304, 61, - 198, 48, 101, 202, 89, 419, 342, 343, 344, 36, - 93, 14, 42, 15, 59, 16, 26, 110, 424, 358, - 90, 360, 490, 17, 38, 39, 189, 190, 576, 95, - 285, 525, 526, 191, 192, 435, 193, 194 +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 4 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1762 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 166 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 80 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 309 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 605 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 406 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 155, 156, 164, 2, 153, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 160, 152, 161, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 157, 154, 159, 2, 2, 2, 2, 2, 165, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 158, 2, 2, 162, 2, 163, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151 }; -static const short yypact[] = {-32768, - 58, 247,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -44, 181, 69,-32768,-32768, 10,-32768,-32768, 16, - -116, 34, 65, -38,-32768, 112, 118, 144,-32768,-32768, --32768,-32768,-32768,-32768, 1357, -19,-32768,-32768, 39,-32768, --32768,-32768,-32768, 6, 12, 20, 23,-32768, 55, 118, - 1357, 86, 86, 86, 86,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 36,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 210, 218, - 1, 171,-32768, 39, 73,-32768,-32768, -42,-32768,-32768, --32768,-32768,-32768, 1611,-32768, 215, 83, 236, 219, 233, --32768,-32768,-32768,-32768,-32768, 1418, 1418, 1418, 1459, 181, --32768, 84, 100, 737,-32768,-32768, -42, -99, 104, 803, --32768,-32768, 1418,-32768, 201, 1479, 14, 221, 181,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 77, 377, 1418, 1418, - 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 1418, 1418, 1418, 1418, 1418,-32768,-32768, - 181,-32768, 53,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -36,-32768,-32768,-32768, 140, 167, 257, 204, 262, - 206, 264, 214, 266, 265, 268, 217, 269, 270, 579, --32768,-32768, 1418, 1418, 115, -96, 1418,-32768, 1199,-32768, - 128, 126, 920,-32768,-32768, 36,-32768, 920, 920,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 920, - 1357,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 1418,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1418, 130, - 142,-32768, 920, 139, 151, 153, 154, 155, 157, 158, - 164, 165, 920, 920, 920, 166, 284, 1357, 1418, 1418, - 297,-32768, 169, 169, 169,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 77, 377, 168, 172, 174, - 175, 177, 1240, 1520, 757, 300, 180, 182, 183, 192, - 193,-32768,-32768, 169, -43, -71,-32768, 190, -42,-32768, - 39,-32768, 173, 202, 1260,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 273, 1459,-32768,-32768,-32768,-32768, - 209,-32768, 212, 920, 920, 920, -4,-32768, -2,-32768, - 213, 920, 211, 1418, 1418, 1418, 1418, 1418, 1418, 1418, - 216, 222, 223, 1418, 1418, 920, 920, 226,-32768, -20, --32768,-32768,-32768, 225, 227, 1459, 1459, 1459, 1459, 1459, --32768,-32768, -13, 778, -17,-32768, -69,-32768, 1459, 1459, - 1459, 1459, 1459,-32768,-32768,-32768,-32768,-32768,-32768, 1301, - 325,-32768,-32768, 346, -16, 350, 360, 228, 231, 234, - 920, 382, 920, 1418,-32768, 235, 920, 237,-32768,-32768, - 238, 239,-32768,-32768, 920, 920, 920,-32768,-32768, 240, --32768, 1418, 365, 389,-32768, 169, 1459, 1459, 213, 241, - 243, 245, 248, 1459,-32768, 242, -104, -67,-32768,-32768, - 249, 253, 263, 272, 364,-32768,-32768,-32768, 358, 274, --32768, 920, 920, 1418, 920, 920, 276,-32768, 276,-32768, - 279, 920, 280, 1418, 1418, 1418,-32768,-32768,-32768, 1418, - 920,-32768,-32768,-32768, 281, 282, 267, 1459, 1459, 1459, - 1459,-32768,-32768, 278, 1459, 1459, 1459, 1459, 1418, 422, --32768, 416, 288, 285, 279, 289,-32768,-32768, 390,-32768, --32768, 1418, 287, 920,-32768,-32768,-32768, 292,-32768, 1459, - 1459,-32768, 299, 298, 302, 303,-32768, 301, 306, 307, - 308, 310,-32768,-32768, 432, 15, 435,-32768,-32768, 309, --32768, 316, 319, 1459,-32768, 1459, 1459,-32768,-32768,-32768, --32768,-32768, 920,-32768, 1046, 64, 437,-32768,-32768,-32768, - 326, 329, 331,-32768, 328,-32768, 1046, 920,-32768,-32768, --32768, 467, 336, 148, 920, 469, 470,-32768, 920, 920, --32768,-32768, 493, 494,-32768 +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, + 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, + 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, + 159, 161, 164, 165, 167, 169, 171, 173, 175, 177, + 179, 180, 181, 183, 185, 187, 189, 191, 193, 196, + 197, 200, 201, 205, 208, 209, 211, 212, 216, 218, + 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, + 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, + 261, 264, 269, 275, 281, 285, 288, 294, 299, 302, + 304, 308, 310, 314, 316, 317, 322, 326, 330, 335, + 340, 344, 351, 357, 360, 363, 366, 369, 372, 375, + 378, 381, 384, 387, 394, 400, 409, 416, 423, 430, + 438, 446, 453, 460, 469, 478, 482, 484, 486, 488, + 490, 493, 496, 501, 504, 506, 511, 514, 519, 520, + 528, 529, 537, 538, 546, 547, 555, 559, 564, 565, + 567, 569, 571, 575, 579, 583, 587, 591, 595, 597, + 598, 600, 602, 604, 605, 608, 612, 614, 616, 620, + 622, 623, 632, 634, 636, 640, 642, 644, 647, 648, + 650, 652, 653, 654, 660, 661, 663, 665, 667, 669, + 671, 673, 675, 677, 679, 683, 685, 691, 693, 695, + 697, 699, 702, 705, 708, 712, 715, 716, 718, 720, + 722, 725, 728, 732, 742, 752, 761, 775, 777, 779, + 786, 792, 795, 802, 810, 812, 816, 818, 819, 822, + 824, 830, 836, 842, 849, 856, 859, 864, 869, 876, + 881, 886, 891, 896, 903, 910, 913, 921, 923, 926, + 927, 929, 930, 934, 941, 945, 952, 955, 960, 967 }; -static const short yypgoto[] = {-32768, --32768, 401, 402, 404, 200, 203, 405, 423, -126, -125, - -535,-32768, 479, 496, -109,-32768, -274, 102,-32768, -296, --32768, -45,-32768, -35,-32768, -58, 27,-32768, -97, 304, - -306, 101,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 471, --32768,-32768,-32768,-32768, 13,-32768, 106,-32768,-32768, 412, --32768,-32768,-32768,-32768,-32768, 525,-32768,-32768,-32768, -553, - -9, 114, -122,-32768, 511,-32768, -65,-32768,-32768,-32768, --32768, 96, 31,-32768,-32768, 74,-32768,-32768 +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 200, 0, -1, 5, -1, 6, -1, 3, -1, 4, + -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, + -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, + -1, 89, -1, 90, -1, 91, -1, 92, -1, 97, + -1, 98, -1, 99, -1, 100, -1, 101, -1, 102, + -1, 119, -1, 120, -1, 121, -1, 122, -1, 123, + -1, 124, -1, 125, -1, 126, -1, 127, -1, 128, + -1, 129, -1, 130, -1, 131, -1, 132, -1, 133, + -1, 134, -1, 135, -1, 136, -1, 137, -1, 138, + -1, 125, -1, 126, -1, 127, -1, 128, -1, 27, + -1, 28, -1, 93, -1, 94, -1, 95, -1, 96, + -1, 140, -1, 141, -1, 142, -1, 143, -1, 144, + -1, 145, -1, 146, -1, 147, -1, 148, -1, 149, + -1, 150, -1, 151, -1, 139, -1, 16, -1, 14, + -1, 12, -1, 10, -1, 17, -1, 15, -1, 13, + -1, 11, -1, 176, -1, 177, -1, 18, -1, 19, + -1, 212, 152, -1, -1, 41, -1, 42, -1, 43, + -1, 44, -1, 45, -1, 46, -1, 47, -1, -1, + -1, 65, -1, 66, -1, 67, -1, 68, -1, 69, + -1, 70, -1, 64, 4, -1, -1, 57, 4, -1, + -1, 153, 57, 4, -1, 34, 24, -1, -1, 185, + -1, -1, 153, 188, 187, -1, 185, -1, 57, 4, + -1, 191, -1, 8, -1, 193, -1, 8, -1, 193, + -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, + -1, 14, -1, 15, -1, 16, -1, 17, -1, 18, + -1, 19, -1, 21, -1, 192, -1, 48, -1, 228, + -1, 154, 4, -1, 190, 155, 195, 156, -1, 157, + 4, 158, 193, 159, -1, 160, 4, 158, 193, 161, + -1, 162, 194, 163, -1, 162, 163, -1, 160, 162, + 194, 163, 161, -1, 160, 162, 163, 161, -1, 193, + 164, -1, 193, -1, 194, 153, 193, -1, 194, -1, + 194, 153, 37, -1, 37, -1, -1, 191, 157, 198, + 159, -1, 191, 157, 159, -1, 191, 165, 24, -1, + 191, 160, 198, 161, -1, 191, 162, 198, 163, -1, + 191, 162, 163, -1, 191, 160, 162, 198, 163, 161, + -1, 191, 160, 162, 163, 161, -1, 191, 38, -1, + 191, 39, -1, 191, 228, -1, 191, 197, -1, 191, + 26, -1, 176, 168, -1, 177, 4, -1, 9, 27, + -1, 9, 28, -1, 179, 7, -1, 175, 155, 196, + 36, 191, 156, -1, 110, 155, 196, 243, 156, -1, + 112, 155, 196, 153, 196, 153, 196, 156, -1, 169, + 155, 196, 153, 196, 156, -1, 170, 155, 196, 153, + 196, 156, -1, 171, 155, 196, 153, 196, 156, -1, + 103, 172, 155, 196, 153, 196, 156, -1, 104, 173, + 155, 196, 153, 196, 156, -1, 174, 155, 196, 153, + 196, 156, -1, 114, 155, 196, 153, 196, 156, -1, + 115, 155, 196, 153, 196, 153, 196, 156, -1, 116, + 155, 196, 153, 196, 153, 196, 156, -1, 198, 153, + 196, -1, 196, -1, 32, -1, 33, -1, 201, -1, + 201, 221, -1, 201, 223, -1, 201, 62, 61, 207, + -1, 201, 25, -1, 202, -1, 202, 180, 20, 189, + -1, 202, 223, -1, 202, 62, 61, 207, -1, -1, + 202, 180, 181, 199, 196, 203, 187, -1, -1, 202, + 180, 50, 199, 191, 204, 187, -1, -1, 202, 180, + 45, 199, 191, 205, 187, -1, -1, 202, 180, 47, + 199, 191, 206, 187, -1, 202, 51, 209, -1, 202, + 58, 152, 210, -1, -1, 24, -1, 56, -1, 55, + -1, 53, 152, 208, -1, 54, 152, 4, -1, 52, + 152, 24, -1, 71, 152, 24, -1, 157, 211, 159, + -1, 211, 153, 24, -1, 24, -1, -1, 22, -1, + 24, -1, 212, -1, -1, 191, 213, -1, 215, 153, + 214, -1, 214, -1, 215, -1, 215, 153, 37, -1, + 37, -1, -1, 182, 189, 212, 155, 216, 156, 186, + 183, -1, 29, -1, 162, -1, 181, 217, 218, -1, + 30, -1, 163, -1, 231, 220, -1, -1, 45, -1, + 47, -1, -1, -1, 31, 224, 222, 225, 217, -1, + -1, 63, -1, 3, -1, 4, -1, 7, -1, 27, + -1, 28, -1, 38, -1, 39, -1, 26, -1, 160, + 198, 161, -1, 197, -1, 61, 226, 24, 153, 24, + -1, 167, -1, 212, -1, 228, -1, 227, -1, 191, + 229, -1, 231, 232, -1, 219, 232, -1, 233, 180, + 235, -1, 233, 237, -1, -1, 23, -1, 77, -1, + 78, -1, 72, 230, -1, 72, 8, -1, 73, 21, + 229, -1, 73, 9, 229, 153, 21, 229, 153, 21, + 229, -1, 74, 178, 229, 153, 21, 229, 157, 236, + 159, -1, 74, 178, 229, 153, 21, 229, 157, 159, + -1, 75, 182, 189, 229, 155, 240, 156, 36, 21, + 229, 234, 21, 229, -1, 234, -1, 76, -1, 236, + 178, 227, 153, 21, 229, -1, 178, 227, 153, 21, + 229, -1, 180, 242, -1, 191, 157, 229, 153, 229, + 159, -1, 238, 153, 157, 229, 153, 229, 159, -1, + 230, -1, 239, 153, 230, -1, 239, -1, -1, 60, + 59, -1, 59, -1, 169, 191, 229, 153, 229, -1, + 170, 191, 229, 153, 229, -1, 171, 191, 229, 153, + 229, -1, 103, 172, 191, 229, 153, 229, -1, 104, + 173, 191, 229, 153, 229, -1, 49, 230, -1, 174, + 230, 153, 230, -1, 175, 230, 36, 191, -1, 112, + 230, 153, 230, 153, 230, -1, 113, 230, 153, 191, + -1, 117, 230, 153, 191, -1, 118, 230, 153, 191, + -1, 114, 230, 153, 230, -1, 115, 230, 153, 230, + 153, 230, -1, 116, 230, 153, 230, 153, 230, -1, + 111, 238, -1, 241, 182, 189, 229, 155, 240, 156, + -1, 245, -1, 153, 239, -1, -1, 35, -1, -1, + 105, 191, 184, -1, 105, 191, 153, 15, 229, 184, + -1, 106, 191, 184, -1, 106, 191, 153, 15, 229, + 184, -1, 107, 230, -1, 244, 108, 191, 229, -1, + 244, 109, 230, 153, 191, 229, -1, 110, 191, 229, + 243, -1 }; +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 1594, 1594, 1595, 1603, 1604, 1614, 1614, 1614, 1614, + 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1618, 1618, 1618, + 1622, 1622, 1622, 1622, 1622, 1622, 1626, 1626, 1627, 1627, + 1628, 1628, 1629, 1629, 1630, 1630, 1634, 1634, 1635, 1635, + 1636, 1636, 1637, 1637, 1638, 1638, 1639, 1639, 1640, 1640, + 1641, 1642, 1645, 1645, 1645, 1645, 1649, 1649, 1649, 1649, + 1649, 1649, 1649, 1650, 1650, 1650, 1650, 1650, 1650, 1656, + 1656, 1656, 1656, 1660, 1660, 1660, 1660, 1664, 1664, 1668, + 1668, 1673, 1676, 1681, 1682, 1683, 1684, 1685, 1686, 1687, + 1688, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1709, + 1710, 1718, 1719, 1727, 1736, 1737, 1744, 1745, 1749, 1753, + 1769, 1770, 1777, 1778, 1785, 1793, 1793, 1793, 1793, 1793, + 1793, 1793, 1794, 1794, 1794, 1794, 1794, 1799, 1803, 1807, + 1812, 1821, 1838, 1844, 1857, 1866, 1870, 1881, 1885, 1898, + 1902, 1909, 1910, 1916, 1923, 1935, 1965, 1978, 2001, 2029, + 2051, 2062, 2084, 2095, 2104, 2109, 2167, 2174, 2182, 2189, + 2196, 2200, 2204, 2213, 2228, 2241, 2250, 2278, 2291, 2300, + 2306, 2312, 2323, 2329, 2335, 2346, 2347, 2356, 2357, 2369, + 2378, 2379, 2380, 2381, 2382, 2398, 2418, 2420, 2422, 2422, + 2429, 2429, 2436, 2436, 2443, 2443, 2451, 2453, 2455, 2460, + 2474, 2475, 2479, 2482, 2490, 2494, 2501, 2505, 2509, 2513, + 2521, 2521, 2525, 2526, 2530, 2538, 2543, 2551, 2552, 2559, + 2566, 2570, 2746, 2746, 2750, 2760, 2760, 2764, 2769, 2770, + 2771, 2775, 2776, 2775, 2788, 2789, 2794, 2795, 2796, 2797, + 2798, 2799, 2800, 2801, 2802, 2823, 2826, 2841, 2842, 2847, + 2847, 2855, 2864, 2867, 2876, 2886, 2891, 2900, 2911, 2911, + 2914, 2917, 2920, 2924, 2930, 2945, 2951, 3007, 3010, 3016, + 3026, 3039, 3068, 3076, 3084, 3088, 3095, 3096, 3100, 3103, + 3109, 3126, 3142, 3156, 3168, 3180, 3191, 3209, 3218, 3227, + 3234, 3255, 3279, 3285, 3291, 3297, 3313, 3391, 3399, 3400, + 3404, 3405, 3409, 3415, 3421, 3427, 3433, 3440, 3452, 3477 +}; +#endif -#define YYLAST 1762 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL", + "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", + "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", + "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", + "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", + "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", + "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", + "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", + "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK", + "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", + "RET", "BR", "SWITCH", "INVOKE", "UNREACHABLE", "UNWIND", "EXCEPT", + "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM", + "SREM", "FREM", "AND", "OR", "XOR", "SHL", "SHR", "ASHR", "LSHR", + "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "ICMP", "FCMP", + "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", + "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", + "VAARG_old", "VANEXT_old", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", + "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", + "UNO", "UEQ", "UNE", "CAST", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", + "FPTOUI", "FPTOSI", "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", + "BITCAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", + "'<'", "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", + "EINT64VAL", "ArithmeticOps", "LogicalOps", "SetCondOps", "IPredicates", + "FPredicates", "ShiftOps", "CastOps", "SIntType", "UIntType", "IntType", + "FPType", "OptAssign", "OptLinkage", "OptCallingConv", "OptAlign", + "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", + "GlobalVarAttribute", "TypesV", "UpRTypesV", "Types", "PrimType", + "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", "ConstExpr", + "ConstVector", "GlobalType", "Module", "FunctionList", "ConstPool", "@1", + "@2", "@3", "@4", "AsmBlock", "BigOrLittle", "TargetDefinition", + "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", + "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", + "END", "Function", "FnDeclareLinkage", "FunctionProto", "@5", "@6", + "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef", + "ResolvedVal", "BasicBlockList", "BasicBlock", "InstructionList", + "Unwind", "BBTerminatorInst", "JumpTable", "Inst", "PHIList", + "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal", "IndexList", + "OptVolatile", "MemoryInst", 0 +}; +#endif +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 61, 44, 92, 40, 41, 91, 120, 93, + 60, 62, 123, 125, 42, 99 +}; +# endif -static const short yytable[] = { 86, - 234, 248, 249, 237, 113, 103, 370, 392, 393, 91, - 431, 221, 433, 453, 24, 86, 27, 405, 407, 251, - 575, 585, 238, 117, 240, 241, 242, 243, 244, 245, - 246, 247, 37, 593, 239, 49, 454, 414, 282, 40, - 587, 286, 287, 288, 289, 290, 291, 292, -138, 425, - -111, 24, 432, 227, 432, 117, 227, -178, -138, 121, - 18, 117, 19, 228, 296, 297, 338, 44, 45, 46, - 203, 204, 205, 240, 241, 242, 243, 244, 245, 246, - 247, 298, 3, 464, 51, 464, 47, 233, 4, 416, - 233, 37, 121, 470, 50, 514, 119, 468, 5, 6, - 7, 8, 9, 10, 11, 5, 6, 7, 8, 52, - 10, 53, -111, 56, 54, 415, 301, 104, 105, 12, - 121, 121, 302, 280, 281, 233, 283, 284, 233, 233, - 233, 233, 233, 233, 233, 464, 464, 196, 197, 464, - 226, 60, 92, 469, 481, 465, 231, 62, 293, 294, - 295, 233, 233, 107, 108, 109, 57, 96, 58, 504, - 299, 300, 114, 97, 335, 336, 306, 307, 339, -71, - -71, 98, 41, 574, 99, 63, 64, 388, 115, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - -112, 77, 18, 341, 19, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 364, -70, -70, -69, -69, - 333, 100, 530, 111, 531, 86, -68, -68, 78, 308, - 309, 112, 586, 359, 131, 132, 365, 120, 359, 359, - 240, 241, 242, 243, 244, 245, 246, 247, 195, 199, - 359, 223, 200, 366, 28, 29, 30, 31, 32, 33, - 34, 438, 386, 440, 441, 442, 201, 224, 229, 235, - -75, 448, 86, 387, 233, -74, -81, -73, 18, -72, - 19, -78, 311, 359, -79, 337, 312, 4, -81, -81, - 345, 346, 367, 359, 359, 359, 339, -81, -81, -81, - -81, -81, -81, -81, 369, 372, -81, 20, 459, 460, - 461, 462, 463, 373, 21, 374, 375, 376, 22, 377, - 378, 471, 472, 473, 474, 475, 379, 380, 384, 385, - 389, 390, 396, 408, 79, 420, 397, 80, 398, 399, - 81, 400, 82, 116, 409, 423, 410, 411, 233, 439, - 233, 233, 233, 443, 444, 467, 412, 413, 233, 449, - 417, 361, 362, 418, 359, 359, 359, 421, 453, 505, - 506, 426, 359, 363, 427, 434, 512, 437, 445, 480, - 482, 535, 536, 537, 446, 447, 359, 359, 452, 457, - 483, 458, 484, 485, 341, 488, 486, 492, 502, 494, - 495, 496, 503, 508, 500, 509, 371, 510, 233, 519, - 511, 515, 513, 263, 264, 516, 381, 382, 383, 558, - 543, 544, 545, 546, 520, 517, 501, 548, 549, 550, - 551, 359, 542, 359, 518, 553, 522, 359, 529, 248, - 249, 532, 534, 540, 541, 359, 359, 359, 547, 554, - 555, 556, 562, 563, 557, 559, 432, 561, 233, 248, - 249, 564, 573, 565, 566, 567, 568, 588, 233, 233, - 233, 569, 570, 571, 233, 572, 581, 578, 582, 583, - 577, 579, 359, 359, 580, 359, 359, 428, 429, 430, - 592, 589, 359, 552, 590, 436, 591, 595, 596, 599, - 600, 359, 604, 605, 184, 185, 233, 186, 187, 450, - 451, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 394, 188, 94, 55, 395, - 102, 222, 478, 332, 359, 477, 25, 43, 597, 491, - 538, 0, 507, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 487, 0, 489, 0, 0, 0, - 493, 0, 0, 0, 0, 0, 0, 0, 497, 498, - 499, 0, 0, 359, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 359, 0, - 0, 0, 0, 63, 64, 359, 0, 0, 0, 359, - 359, 0, 0, 0, 0, 523, 524, 0, 527, 528, - 18, 0, 19, 0, 313, 533, 0, 0, 0, 0, - 0, 0, 0, 0, 539, 0, 314, 315, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 560, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 316, 317, 0, 0, 0, 584, 0, 318, 0, - 319, 0, 320, 321, 322, 0, 0, 0, 0, 0, - 0, 594, 0, 0, 0, 0, 0, 0, 598, 0, - 0, 0, 601, 602, 0, 0, 0, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 0, 0, 0, 0, 0, 323, 0, 0, 324, 0, - 325, 63, 64, 326, 115, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 0, 77, 18, 0, - 19, 63, 64, 0, 115, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 0, 77, 18, 0, - 19, 0, 63, 64, 78, 115, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 0, 77, 18, - 0, 19, 0, 0, 78, 0, 0, 63, 64, 0, - 115, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 0, 77, 18, 78, 19, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 79, 0, 0, 80, 0, 0, 81, 0, 82, 225, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 79, 0, 0, 80, 0, 0, 81, 0, 82, 406, - 0, 0, 347, 348, 63, 64, 349, 0, 0, 0, - 0, 79, 0, 0, 80, 0, 0, 81, 0, 82, - 466, 18, 0, 19, 0, 350, 351, 352, 0, 0, - 0, 0, 0, 0, 0, 0, 79, 353, 354, 80, - 0, 0, 81, 0, 82, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 316, 317, 0, 0, 0, 0, 0, 318, - 0, 319, 0, 320, 321, 322, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 347, 348, - 0, 0, 349, 0, 0, 0, 0, 0, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 350, 351, 352, 0, 0, 0, 0, 0, 356, - 0, 0, 0, 353, 354, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 316, 317, - 0, 0, 0, 0, 0, 318, 0, 319, 0, 320, - 321, 322, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 0, 0, 0, - 0, 0, 0, 63, 64, 356, 115, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 0, 77, - 18, 0, 19, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, - 0, 0, 0, 0, 63, 64, 78, 115, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 0, - 77, 18, 0, 19, 63, 64, 0, 115, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, - 77, 18, 0, 19, 0, 0, 0, 78, 0, 0, - 0, 0, 0, 0, 0, 0, 422, 0, 0, 0, - 0, 0, 0, 0, 0, 63, 64, 78, 115, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 0, 77, 18, 0, 19, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 476, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, - 0, 0, 79, 0, 0, 80, 0, 0, 81, 0, - 82, 63, 64, 0, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 0, 77, 18, 0, - 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 79, 0, 0, 80, 0, 401, 81, - 0, 82, 0, 0, 78, 0, 0, 0, 0, 0, - 0, 0, 0, 79, 0, 0, 80, 0, 0, 81, - 0, 82, 63, 64, 0, 115, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 0, 77, 18, - 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 79, 0, 0, 80, 0, 0, - 81, 0, 82, 63, 64, 78, 115, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 0, 77, - 18, 0, 19, 63, 64, 0, 236, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 0, 77, - 18, 0, 19, 0, 0, 0, 78, 0, 0, 0, - 79, 0, 0, 80, 0, 0, 81, 0, 82, 0, - 0, 0, 0, 0, 63, 64, 78, 115, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 0, - 77, 18, 0, 19, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, - 0, 79, 0, 0, 80, 0, 0, 81, 0, 82, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 79, 0, 0, 80, 0, 0, 81, 0, - 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 79, 0, 0, 80, 0, 0, 81, 0, - 82, 0, 0, 0, 0, 122, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, - 125, 0, 0, 79, 0, 0, 80, 0, 0, 81, - 0, 404, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 166, 167, 167, 168, 168, 169, 169, 169, 169, + 169, 169, 169, 169, 169, 169, 169, 170, 170, 170, + 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 174, 174, 174, 174, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, + 176, 176, 176, 177, 177, 177, 177, 178, 178, 179, + 179, 180, 180, 181, 181, 181, 181, 181, 181, 181, + 181, 182, 182, 182, 182, 182, 182, 182, 182, 183, + 183, 184, 184, 185, 186, 186, 187, 187, 188, 188, + 189, 189, 190, 190, 191, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, + 194, 195, 195, 195, 195, 196, 196, 196, 196, 196, + 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 198, 198, 199, 199, 200, + 201, 201, 201, 201, 201, 202, 202, 202, 203, 202, + 204, 202, 205, 202, 206, 202, 202, 202, 202, 207, + 208, 208, 209, 209, 209, 209, 210, 211, 211, 211, + 212, 212, 213, 213, 214, 215, 215, 216, 216, 216, + 216, 217, 218, 218, 219, 220, 220, 221, 222, 222, + 222, 224, 225, 223, 226, 226, 227, 227, 227, 227, + 227, 227, 227, 227, 227, 227, 227, 228, 228, 229, + 229, 230, 231, 231, 232, 233, 233, 233, 234, 234, + 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, + 236, 237, 238, 238, 239, 239, 240, 240, 241, 241, + 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, + 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, + 244, 244, 245, 245, 245, 245, 245, 245, 245, 245 }; -static const short yycheck[] = { 35, - 123, 128, 128, 126, 4, 51, 281, 304, 305, 29, - 15, 109, 15, 34, 2, 51, 61, 324, 325, 129, - 556, 575, 9, 82, 10, 11, 12, 13, 14, 15, - 16, 17, 23, 587, 21, 152, 57, 334, 161, 30, - 576, 164, 165, 166, 167, 168, 169, 170, 153, 356, - 155, 39, 57, 153, 57, 114, 153, 0, 163, 164, - 22, 120, 24, 163, 187, 188, 163, 52, 53, 54, - 106, 107, 108, 10, 11, 12, 13, 14, 15, 16, - 17, 191, 25, 153, 20, 153, 71, 123, 31, 161, - 126, 23, 164, 163, 61, 163, 84, 404, 41, 42, - 43, 44, 45, 46, 47, 41, 42, 43, 44, 45, - 46, 47, 155, 152, 50, 159, 153, 32, 33, 62, - 164, 164, 159, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 153, 153, 55, 56, 153, - 114, 24, 162, 161, 161, 159, 120, 4, 184, 185, - 186, 187, 188, 53, 54, 55, 45, 152, 47, 456, - 108, 109, 162, 152, 223, 224, 27, 28, 227, 3, - 4, 152, 163, 159, 152, 5, 6, 300, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 155, 21, 22, 229, 24, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 251, 3, 4, 3, 4, - 220, 157, 487, 4, 489, 251, 3, 4, 48, 3, - 4, 4, 159, 233, 77, 78, 262, 155, 238, 239, - 10, 11, 12, 13, 14, 15, 16, 17, 24, 4, - 250, 158, 24, 279, 64, 65, 66, 67, 68, 69, - 70, 374, 298, 376, 377, 378, 24, 158, 155, 59, - 4, 384, 298, 299, 300, 4, 20, 4, 22, 4, - 24, 7, 4, 283, 7, 161, 7, 31, 32, 33, - 153, 156, 153, 293, 294, 295, 345, 41, 42, 43, - 44, 45, 46, 47, 153, 157, 50, 51, 396, 397, - 398, 399, 400, 153, 58, 153, 153, 153, 62, 153, - 153, 409, 410, 411, 412, 413, 153, 153, 153, 36, - 24, 153, 155, 24, 154, 153, 155, 157, 155, 155, - 160, 155, 162, 163, 155, 63, 155, 155, 374, 375, - 376, 377, 378, 379, 380, 404, 155, 155, 384, 385, - 161, 238, 239, 341, 364, 365, 366, 156, 34, 457, - 458, 153, 372, 250, 153, 153, 464, 157, 153, 24, - 21, 494, 495, 496, 153, 153, 386, 387, 153, 155, - 21, 155, 155, 153, 420, 4, 153, 153, 24, 153, - 153, 153, 4, 153, 155, 153, 283, 153, 434, 36, - 153, 153, 161, 27, 28, 153, 293, 294, 295, 532, - 508, 509, 510, 511, 57, 153, 452, 515, 516, 517, - 518, 431, 156, 433, 153, 4, 153, 437, 153, 556, - 556, 153, 153, 153, 153, 445, 446, 447, 161, 24, - 153, 157, 540, 541, 156, 159, 57, 156, 484, 576, - 576, 153, 21, 156, 153, 153, 156, 21, 494, 495, - 496, 156, 156, 156, 500, 156, 564, 159, 566, 567, - 36, 156, 482, 483, 156, 485, 486, 364, 365, 366, - 153, 156, 492, 519, 156, 372, 156, 21, 153, 21, - 21, 501, 0, 0, 94, 94, 532, 94, 94, 386, - 387, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 316, 94, 39, 23, 317, - 50, 110, 421, 220, 534, 420, 2, 17, 594, 434, - 500, -1, 459, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 431, -1, 433, -1, -1, -1, - 437, -1, -1, -1, -1, -1, -1, -1, 445, 446, - 447, -1, -1, 573, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 588, -1, - -1, -1, -1, 5, 6, 595, -1, -1, -1, 599, - 600, -1, -1, -1, -1, 482, 483, -1, 485, 486, - 22, -1, 24, -1, 26, 492, -1, -1, -1, -1, - -1, -1, -1, -1, 501, -1, 38, 39, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 534, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, -1, -1, -1, 573, -1, 110, -1, - 112, -1, 114, 115, 116, -1, -1, -1, -1, -1, - -1, 588, -1, -1, -1, -1, -1, -1, 595, -1, - -1, -1, 599, 600, -1, -1, -1, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - -1, -1, -1, -1, -1, 157, -1, -1, 160, -1, - 162, 5, 6, 165, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, - 24, 5, 6, -1, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, - 24, -1, 5, 6, 48, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, - -1, 24, -1, -1, 48, -1, -1, 5, 6, -1, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, -1, 21, 22, 48, 24, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 154, -1, -1, 157, -1, -1, 160, -1, 162, 163, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 154, -1, -1, 157, -1, -1, 160, -1, 162, 163, - -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, - -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, - 163, 22, -1, 24, -1, 26, 27, 28, -1, -1, - -1, -1, -1, -1, -1, -1, 154, 38, 39, 157, - -1, -1, 160, -1, 162, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, -1, -1, -1, -1, -1, 110, - -1, 112, -1, 114, 115, 116, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, - -1, -1, 7, -1, -1, -1, -1, -1, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 26, 27, 28, -1, -1, -1, -1, -1, 160, - -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - -1, -1, -1, -1, -1, 110, -1, 112, -1, 114, - 115, 116, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, -1, -1, -1, - -1, -1, -1, 5, 6, 160, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, - 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, - -1, -1, -1, -1, 5, 6, 48, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, 5, 6, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, -1, -1, -1, 48, -1, -1, - -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, - -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, 21, 22, -1, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, - -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, - 162, 5, 6, -1, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, - 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 154, -1, -1, 157, -1, 159, 160, - -1, 162, -1, -1, 48, -1, -1, -1, -1, -1, - -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, 5, 6, -1, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, - -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 154, -1, -1, 157, -1, -1, - 160, -1, 162, 5, 6, 48, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, - 22, -1, 24, 5, 6, -1, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, - 22, -1, 24, -1, -1, -1, 48, -1, -1, -1, - 154, -1, -1, 157, -1, -1, 160, -1, 162, -1, - -1, -1, -1, -1, 5, 6, 48, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, - -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, - 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, - 162, -1, -1, -1, -1, 35, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, - 60, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, -1, -1, - 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, + 2, 0, 3, 2, 0, 1, 0, 3, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 4, 5, 5, 3, 2, 5, 4, 2, 1, + 3, 1, 3, 1, 0, 4, 3, 3, 4, 4, + 3, 6, 5, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 6, 5, 8, 6, 6, 6, 7, + 7, 6, 6, 8, 8, 3, 1, 1, 1, 1, + 2, 2, 4, 2, 1, 4, 2, 4, 0, 7, + 0, 7, 0, 7, 0, 7, 3, 4, 0, 1, + 1, 1, 3, 3, 3, 3, 3, 3, 1, 0, + 1, 1, 1, 0, 2, 3, 1, 1, 3, 1, + 0, 8, 1, 1, 3, 1, 1, 2, 0, 1, + 1, 0, 0, 5, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, + 1, 2, 2, 2, 3, 2, 0, 1, 1, 1, + 2, 2, 3, 9, 9, 8, 13, 1, 1, 6, + 5, 2, 6, 7, 1, 3, 1, 0, 2, 1, + 5, 5, 5, 6, 6, 2, 4, 4, 6, 4, + 4, 4, 4, 6, 6, 2, 7, 1, 2, 0, + 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 }; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison.simple" -/* This file comes from bison-1.28. */ -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 198, 0, 90, 184, 1, 183, 231, 83, 84, 85, + 86, 87, 88, 89, 0, 91, 256, 180, 181, 256, + 210, 211, 0, 0, 0, 90, 0, 186, 228, 0, + 0, 92, 93, 94, 95, 96, 97, 0, 0, 257, + 253, 82, 225, 226, 227, 252, 0, 0, 0, 0, + 196, 0, 0, 0, 0, 0, 0, 0, 81, 229, + 230, 232, 199, 182, 98, 2, 3, 111, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 128, 0, 0, 0, 0, 247, 0, 0, 110, 127, + 114, 248, 129, 222, 223, 224, 301, 255, 0, 0, + 0, 0, 209, 197, 187, 185, 177, 178, 0, 0, + 0, 0, 91, 130, 0, 0, 0, 113, 135, 139, + 0, 0, 144, 138, 300, 0, 279, 0, 0, 0, + 0, 91, 268, 258, 259, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 52, + 53, 54, 55, 20, 21, 22, 23, 24, 25, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, + 0, 267, 254, 91, 271, 0, 297, 204, 201, 200, + 202, 203, 205, 208, 0, 192, 194, 190, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, + 0, 0, 0, 188, 233, 0, 0, 0, 0, 0, + 134, 220, 143, 141, 0, 0, 285, 278, 261, 260, + 0, 0, 72, 76, 71, 75, 70, 74, 69, 73, + 77, 78, 0, 0, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 0, 50, 51, 46, 47, 48, + 49, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 0, 101, 101, 306, 0, 0, 295, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 206, 106, 106, 106, 160, 161, + 4, 5, 158, 159, 162, 157, 153, 154, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 156, 155, 106, 112, 112, 137, + 0, 140, 219, 213, 216, 217, 0, 0, 131, 236, + 237, 238, 243, 239, 240, 241, 242, 234, 0, 245, + 250, 249, 251, 0, 262, 0, 0, 0, 0, 0, + 302, 0, 304, 299, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 207, 0, 193, 195, 191, 0, 0, 0, 0, + 0, 0, 0, 146, 176, 0, 0, 0, 150, 0, + 147, 0, 0, 0, 0, 0, 189, 132, 133, 136, + 212, 214, 0, 104, 142, 235, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 309, 0, 0, + 0, 289, 292, 0, 0, 290, 291, 0, 0, 0, + 286, 287, 0, 307, 0, 0, 0, 108, 106, 0, + 0, 299, 0, 0, 0, 0, 0, 145, 135, 114, + 0, 148, 149, 0, 0, 0, 0, 0, 218, 215, + 105, 99, 0, 244, 0, 0, 277, 0, 0, 101, + 102, 101, 274, 298, 0, 0, 0, 0, 0, 280, + 281, 282, 277, 0, 103, 109, 107, 0, 0, 0, + 0, 0, 0, 0, 175, 152, 0, 0, 0, 0, + 0, 0, 0, 221, 0, 0, 0, 276, 0, 283, + 284, 0, 303, 305, 0, 0, 0, 288, 293, 294, + 0, 308, 0, 0, 164, 0, 0, 0, 0, 151, + 0, 0, 0, 0, 0, 100, 246, 0, 0, 0, + 275, 272, 0, 296, 0, 0, 0, 172, 0, 0, + 166, 167, 168, 171, 163, 0, 265, 0, 0, 0, + 273, 169, 170, 0, 0, 0, 263, 0, 264, 0, + 0, 165, 173, 174, 0, 0, 0, 0, 0, 0, + 270, 0, 0, 269, 266 +}; - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 85, 312, 329, 330, 331, 264, 281, 332, 333, + 219, 220, 252, 221, 25, 15, 37, 523, 370, 457, + 481, 393, 458, 86, 87, 222, 89, 90, 120, 234, + 404, 359, 405, 108, 1, 2, 3, 336, 307, 305, + 306, 63, 200, 50, 103, 204, 91, 421, 344, 345, + 346, 38, 95, 16, 44, 17, 61, 18, 28, 112, + 426, 360, 92, 362, 492, 19, 40, 41, 191, 192, + 578, 97, 287, 527, 528, 193, 194, 437, 195, 196 +}; - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -555 +static const yytype_int16 yypact[] = +{ + -555, 136, 58, 247, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, 96, 181, 141, -555, -555, -9, + -555, -555, 16, 7, 114, 65, 39, -555, 50, 188, + 210, -555, -555, -555, -555, -555, -555, 1357, -19, -555, + -555, 134, -555, -555, -555, -555, 68, 69, 70, 73, + -555, 60, 188, 1357, 4, 4, 4, 4, -555, -555, + -555, -555, -555, -555, -555, -555, -555, 63, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, 222, 224, 1, 171, -555, 134, 84, -555, -555, + -103, -555, -555, -555, -555, -555, 1611, -555, 216, 66, + 238, 219, 233, -555, -555, -555, -555, -555, 1418, 1418, + 1418, 1459, 181, -555, 100, 101, 737, -555, -555, -103, + -112, 105, 803, -555, -555, 1418, -555, 202, 1479, 13, + 221, 181, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, 77, + 377, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, + 1418, 1418, 1418, -555, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, 1418, 1418, 1418, 1418, + 1418, -555, -555, 181, -555, 33, -555, -555, -555, -555, + -555, -555, -555, -555, -15, -555, -555, -555, 36, 158, + 262, 164, 264, 167, 266, 169, 268, 269, 270, 204, + 271, 274, 579, -555, -555, 1418, 1418, 121, -67, 1418, + -555, 1199, -555, 120, 127, 920, -555, -555, 63, -555, + 920, 920, -555, -555, -555, -555, -555, -555, -555, -555, + -555, -555, 920, 1357, -555, -555, -555, -555, -555, -555, + -555, -555, -555, -555, 1418, -555, -555, -555, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, + -555, 1418, 142, 143, -555, 920, 147, 153, 154, 155, + 157, 165, 166, 168, 170, 920, 920, 920, 173, 275, + 1357, 1418, 1418, 293, -555, 174, 174, 174, -555, -555, + -555, -555, -555, -555, -555, -555, -555, -555, 77, 377, + 175, 177, 180, 182, 183, 1240, 1520, 757, 296, 192, + 193, 199, 203, 207, -555, -555, 174, -45, -71, -555, + 161, -103, -555, 134, -555, 176, 209, 1260, -555, -555, + -555, -555, -555, -555, -555, -555, -555, 261, 1459, -555, + -555, -555, -555, 206, -555, 213, 920, 920, 920, -2, + -555, 0, -555, 215, 920, 179, 1418, 1418, 1418, 1418, + 1418, 1418, 1418, 217, 218, 223, 1418, 1418, 920, 920, + 226, -555, -17, -555, -555, -555, 214, 220, 1459, 1459, + 1459, 1459, 1459, -555, -555, -13, 778, -94, -555, -40, + -555, 1459, 1459, 1459, 1459, 1459, -555, -555, -555, -555, + -555, -555, 1301, 346, -555, -555, 357, -69, 361, 362, + 229, 234, 235, 920, 382, 920, 1418, -555, 236, 920, + 237, -555, -555, 239, 240, -555, -555, 920, 920, 920, + -555, -555, 241, -555, 1418, 367, 390, -555, 174, 1459, + 1459, 215, 242, 245, 248, 249, 1459, -555, 254, -16, + -8, -555, -555, 250, 253, 263, 272, 364, -555, -555, + -555, 366, 273, -555, 920, 920, 1418, 920, 920, 276, + -555, 276, -555, 279, 920, 280, 1418, 1418, 1418, -555, + -555, -555, 1418, 920, -555, -555, -555, 281, 282, 283, + 1459, 1459, 1459, 1459, -555, -555, 284, 1459, 1459, 1459, + 1459, 1418, 423, -555, 416, 288, 285, 279, 290, -555, + -555, 391, -555, -555, 1418, 294, 920, -555, -555, -555, + 291, -555, 1459, 1459, -555, 299, 298, 302, 303, -555, + 301, 306, 307, 308, 310, -555, -555, 437, 15, 432, + -555, -555, 312, -555, 316, 319, 1459, -555, 1459, 1459, + -555, -555, -555, -555, -555, 920, -555, 1046, 64, 460, + -555, -555, -555, 326, 329, 331, -555, 335, -555, 1046, + 920, -555, -555, -555, 468, 337, 132, 920, 470, 472, + -555, 920, 920, -555, -555 +}; - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -555, -555, -555, 398, 399, 400, 198, 200, 402, 403, + -128, -127, -525, -555, 476, 493, -111, -555, -276, 97, + -555, -298, -555, -47, -555, -37, -555, -60, -62, -555, + -99, 300, -308, 61, -555, -555, -555, -555, -555, -555, + -555, 469, -555, -555, -555, -555, 8, -555, 102, -555, + -555, 411, -555, -555, -555, -555, -555, 523, -555, -555, + -555, -554, -11, 112, -124, -555, 508, -555, -68, -555, + -555, -555, -555, 93, 28, -555, -555, 71, -555, -555 +}; -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -180 +static const yytype_int16 yytable[] = +{ + 88, 236, 250, 251, 239, 115, 105, 372, 394, 395, + 93, 26, 223, 433, 39, 435, 88, 455, 407, 409, + 253, 42, 240, 587, 119, 242, 243, 244, 245, 246, + 247, 248, 249, 577, 241, 595, 106, 107, 416, 284, + 456, 229, 288, 289, 290, 291, 292, 293, 294, 26, + 427, 230, -112, 589, 228, 434, 119, 434, -179, 466, + 233, 123, 119, 308, 309, 298, 299, 471, 46, 47, + 48, 205, 206, 207, 242, 243, 244, 245, 246, 247, + 248, 249, 300, 5, 466, 53, 229, 49, 235, 6, + 418, 235, 483, 123, 121, 59, 340, 60, 470, 7, + 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, + 54, 12, 55, 466, 417, 56, 109, 110, 111, 123, + 14, 198, 199, 472, 282, 283, 235, 285, 286, 235, + 235, 235, 235, 235, 235, 235, 4, -139, 303, -112, + 466, 301, 302, 94, 304, 466, 467, -139, 123, 295, + 296, 297, 235, 235, 43, 516, 20, 29, 21, 51, + 506, -72, -72, 116, 39, 337, 338, -71, -71, 341, + -70, -70, -69, -69, 576, 52, 65, 66, 390, 117, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 58, 79, 20, 343, 21, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 366, 310, 311, 133, + 134, 335, 62, 532, 64, 533, 88, 102, -113, 80, + 98, 99, 100, 588, 361, 101, 113, 367, 114, 361, + 361, 242, 243, 244, 245, 246, 247, 248, 249, 122, + 197, 361, 201, 202, 368, 30, 31, 32, 33, 34, + 35, 36, 440, 388, 442, 443, 444, 203, 225, 226, + 231, 237, 450, 88, 389, 235, -76, -82, -75, 20, + -74, 21, -73, 347, 361, 313, -79, -80, 6, -82, + -82, 314, 339, 348, 361, 361, 361, 341, -82, -82, + -82, -82, -82, -82, -82, 369, 371, -82, 22, 461, + 462, 463, 464, 465, 374, 23, 375, 376, 377, 24, + 378, 387, 473, 474, 475, 476, 477, 391, 379, 380, + 410, 381, 419, 382, 425, 81, 386, 392, 82, 422, + 398, 83, 399, 84, 118, 400, 439, 401, 402, 235, + 441, 235, 235, 235, 445, 446, 469, 411, 412, 235, + 451, 420, 363, 364, 413, 361, 361, 361, 414, 428, + 507, 508, 415, 361, 365, 423, 429, 514, 436, 459, + 447, 448, 537, 538, 539, 460, 449, 361, 361, 454, + 455, 482, 484, 485, 486, 343, 490, 487, 488, 494, + 496, 504, 497, 498, 505, 510, 502, 373, 511, 235, + 521, 512, 513, 517, 265, 266, 518, 383, 384, 385, + 560, 545, 546, 547, 548, 515, 519, 503, 550, 551, + 552, 553, 361, 522, 361, 520, 524, 555, 361, 531, + 250, 251, 534, 536, 542, 543, 361, 361, 361, 544, + 556, 557, 558, 564, 565, 549, 559, 563, 434, 235, + 250, 251, 566, 561, 567, 568, 569, 570, 575, 235, + 235, 235, 571, 572, 573, 235, 574, 583, 579, 584, + 585, 580, 581, 361, 361, 582, 361, 361, 430, 431, + 432, 590, 591, 361, 554, 592, 438, 593, 594, 597, + 598, 601, 361, 602, 186, 187, 188, 235, 189, 190, + 452, 453, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 396, 96, 57, 397, + 480, 104, 334, 224, 479, 361, 27, 45, 599, 493, + 540, 0, 509, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 489, 0, 491, 0, 0, + 0, 495, 0, 0, 0, 0, 0, 0, 0, 499, + 500, 501, 0, 0, 361, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 361, + 0, 0, 0, 0, 65, 66, 361, 0, 0, 0, + 361, 361, 0, 0, 0, 0, 525, 526, 0, 529, + 530, 20, 0, 21, 0, 315, 535, 0, 0, 0, + 0, 0, 0, 0, 0, 541, 0, 316, 317, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 562, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 318, 319, 0, 0, 0, 586, 0, 320, + 0, 321, 0, 322, 323, 324, 0, 0, 0, 0, + 0, 0, 596, 0, 0, 0, 0, 0, 0, 600, + 0, 0, 0, 603, 604, 0, 0, 0, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 0, 0, 0, 0, 0, 325, 0, 0, 326, + 0, 327, 65, 66, 328, 117, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, + 0, 21, 65, 66, 0, 117, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 0, 79, 20, + 0, 21, 0, 65, 66, 80, 117, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 0, 79, + 20, 0, 21, 0, 0, 80, 0, 0, 65, 66, + 0, 117, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 0, 79, 20, 80, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, + 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, + 408, 0, 0, 349, 350, 65, 66, 351, 0, 0, + 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, + 84, 468, 20, 0, 21, 0, 352, 353, 354, 0, + 0, 0, 0, 0, 0, 0, 0, 81, 355, 356, + 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 357, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 318, 319, 0, 0, 0, 0, 0, + 320, 0, 321, 0, 322, 323, 324, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, + 350, 0, 0, 351, 0, 0, 0, 0, 0, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 352, 353, 354, 0, 0, 0, 0, 0, + 358, 0, 0, 0, 355, 356, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 357, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 318, + 319, 0, 0, 0, 0, 0, 320, 0, 321, 0, + 322, 323, 324, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 0, 0, + 0, 0, 0, 0, 65, 66, 358, 117, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, + 79, 20, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, + 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 0, 79, 20, 0, 21, 65, 66, 0, 117, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 0, 79, 20, 0, 21, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 0, 0, 424, 0, 0, + 0, 0, 0, 0, 0, 0, 65, 66, 80, 117, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 0, 79, 20, 0, 21, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, + 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, + 0, 84, 65, 66, 0, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 0, 0, 82, 0, 403, + 83, 0, 84, 0, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 81, 0, 0, 82, 0, 0, + 83, 0, 84, 65, 66, 0, 117, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 0, 79, + 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, + 0, 83, 0, 84, 65, 66, 80, 117, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 0, + 79, 20, 0, 21, 65, 66, 0, 238, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, + 79, 20, 0, 21, 0, 0, 0, 80, 0, 0, + 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, + 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 0, 79, 20, 0, 21, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, + 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, + 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, + 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, + 0, 84, 0, 0, 0, 0, 124, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 126, 127, 0, 0, 81, 0, 0, 82, 0, 0, + 83, 0, 406, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 0, + 0, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 +}; -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +static const yytype_int16 yycheck[] = +{ + 37, 125, 130, 130, 128, 4, 53, 283, 306, 307, + 29, 3, 111, 15, 23, 15, 53, 34, 326, 327, + 131, 30, 9, 577, 84, 10, 11, 12, 13, 14, + 15, 16, 17, 558, 21, 589, 32, 33, 336, 163, + 57, 153, 166, 167, 168, 169, 170, 171, 172, 41, + 358, 163, 155, 578, 116, 57, 116, 57, 0, 153, + 122, 164, 122, 27, 28, 189, 190, 161, 52, 53, + 54, 108, 109, 110, 10, 11, 12, 13, 14, 15, + 16, 17, 193, 25, 153, 20, 153, 71, 125, 31, + 161, 128, 161, 164, 86, 45, 163, 47, 406, 41, + 42, 43, 44, 45, 46, 47, 41, 42, 43, 44, + 45, 46, 47, 153, 159, 50, 55, 56, 57, 164, + 62, 55, 56, 163, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 0, 153, 153, 155, + 153, 108, 109, 162, 159, 153, 159, 163, 164, 186, + 187, 188, 189, 190, 163, 163, 22, 61, 24, 152, + 458, 3, 4, 162, 23, 225, 226, 3, 4, 229, + 3, 4, 3, 4, 159, 61, 5, 6, 302, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 152, 21, 22, 231, 24, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 253, 3, 4, 77, + 78, 222, 24, 489, 4, 491, 253, 157, 155, 48, + 152, 152, 152, 159, 235, 152, 4, 264, 4, 240, + 241, 10, 11, 12, 13, 14, 15, 16, 17, 155, + 24, 252, 4, 24, 281, 64, 65, 66, 67, 68, + 69, 70, 376, 300, 378, 379, 380, 24, 158, 158, + 155, 59, 386, 300, 301, 302, 4, 20, 4, 22, + 4, 24, 4, 153, 285, 4, 7, 7, 31, 32, + 33, 7, 161, 156, 295, 296, 297, 347, 41, 42, + 43, 44, 45, 46, 47, 153, 153, 50, 51, 398, + 399, 400, 401, 402, 157, 58, 153, 153, 153, 62, + 153, 36, 411, 412, 413, 414, 415, 24, 153, 153, + 24, 153, 161, 153, 63, 154, 153, 153, 157, 153, + 155, 160, 155, 162, 163, 155, 157, 155, 155, 376, + 377, 378, 379, 380, 381, 382, 406, 155, 155, 386, + 387, 343, 240, 241, 155, 366, 367, 368, 155, 153, + 459, 460, 155, 374, 252, 156, 153, 466, 153, 155, + 153, 153, 496, 497, 498, 155, 153, 388, 389, 153, + 34, 24, 21, 21, 155, 422, 4, 153, 153, 153, + 153, 24, 153, 153, 4, 153, 155, 285, 153, 436, + 36, 153, 153, 153, 27, 28, 153, 295, 296, 297, + 534, 510, 511, 512, 513, 161, 153, 454, 517, 518, + 519, 520, 433, 57, 435, 153, 153, 4, 439, 153, + 558, 558, 153, 153, 153, 153, 447, 448, 449, 156, + 24, 153, 157, 542, 543, 161, 156, 156, 57, 486, + 578, 578, 153, 159, 156, 153, 153, 156, 21, 496, + 497, 498, 156, 156, 156, 502, 156, 566, 36, 568, + 569, 159, 156, 484, 485, 156, 487, 488, 366, 367, + 368, 21, 156, 494, 521, 156, 374, 156, 153, 21, + 153, 21, 503, 21, 96, 96, 96, 534, 96, 96, + 388, 389, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 318, 41, 25, 319, + 423, 52, 222, 112, 422, 536, 3, 19, 596, 436, + 502, -1, 461, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 433, -1, 435, -1, -1, + -1, 439, -1, -1, -1, -1, -1, -1, -1, 447, + 448, 449, -1, -1, 575, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 590, + -1, -1, -1, -1, 5, 6, 597, -1, -1, -1, + 601, 602, -1, -1, -1, -1, 484, 485, -1, 487, + 488, 22, -1, 24, -1, 26, 494, -1, -1, -1, + -1, -1, -1, -1, -1, 503, -1, 38, 39, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 536, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, -1, -1, -1, 575, -1, 110, + -1, 112, -1, 114, 115, 116, -1, -1, -1, -1, + -1, -1, 590, -1, -1, -1, -1, -1, -1, 597, + -1, -1, -1, 601, 602, -1, -1, -1, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, -1, -1, -1, -1, -1, 157, -1, -1, 160, + -1, 162, 5, 6, 165, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + -1, 24, 5, 6, -1, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + -1, 24, -1, 5, 6, 48, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, + 22, -1, 24, -1, -1, 48, -1, -1, 5, 6, + -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, -1, 21, 22, 48, 24, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + 163, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + 163, -1, -1, 3, 4, 5, 6, 7, -1, -1, + -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, + 162, 163, 22, -1, 24, -1, 26, 27, 28, -1, + -1, -1, -1, -1, -1, -1, -1, 154, 38, 39, + 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, -1, -1, -1, -1, -1, + 110, -1, 112, -1, 114, 115, 116, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, + 4, -1, -1, 7, -1, -1, -1, -1, -1, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 26, 27, 28, -1, -1, -1, -1, -1, + 160, -1, -1, -1, 38, 39, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, -1, -1, -1, -1, -1, 110, -1, 112, -1, + 114, 115, 116, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, -1, -1, + -1, -1, -1, -1, 5, 6, 160, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, + -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, 21, 22, -1, 24, 5, 6, -1, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, 21, 22, -1, 24, -1, -1, -1, 48, -1, + -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, + -1, -1, -1, -1, -1, -1, 5, 6, 48, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, -1, 21, 22, -1, 24, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, + -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, 5, 6, -1, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 154, -1, -1, 157, -1, 159, + 160, -1, 162, -1, -1, 48, -1, -1, -1, -1, + -1, -1, -1, -1, 154, -1, -1, 157, -1, -1, + 160, -1, 162, 5, 6, -1, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, + 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, + -1, 160, -1, 162, 5, 6, 48, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, -1, -1, -1, 48, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, 21, 22, -1, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, + -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, + 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, -1, -1, -1, -1, 35, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 59, 60, -1, -1, 154, -1, -1, 157, -1, -1, + 160, -1, 162, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, -1, + -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151 +}; -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 200, 201, 202, 0, 25, 31, 41, 42, 43, + 44, 45, 46, 47, 62, 181, 219, 221, 223, 231, + 22, 24, 51, 58, 62, 180, 212, 223, 224, 61, + 64, 65, 66, 67, 68, 69, 70, 182, 217, 23, + 232, 233, 30, 163, 220, 232, 52, 53, 54, 71, + 209, 152, 61, 20, 45, 47, 50, 181, 152, 45, + 47, 222, 24, 207, 4, 5, 6, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, + 48, 154, 157, 160, 162, 167, 189, 190, 191, 192, + 193, 212, 228, 29, 162, 218, 180, 237, 152, 152, + 152, 152, 157, 210, 207, 189, 32, 33, 199, 199, + 199, 199, 225, 4, 4, 4, 162, 8, 163, 193, + 194, 212, 155, 164, 35, 49, 59, 60, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 169, 170, 171, 174, + 175, 234, 235, 241, 242, 244, 245, 24, 55, 56, + 208, 4, 24, 24, 211, 191, 191, 191, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 176, + 177, 179, 191, 196, 217, 158, 158, 163, 194, 153, + 163, 155, 37, 194, 195, 191, 230, 59, 8, 230, + 9, 21, 10, 11, 12, 13, 14, 15, 16, 17, + 176, 177, 178, 182, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 172, 27, 28, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 173, 191, 191, 230, 191, 191, 238, 230, 230, + 230, 230, 230, 230, 230, 191, 191, 191, 230, 230, + 182, 108, 109, 153, 159, 205, 206, 204, 27, 28, + 3, 4, 168, 4, 7, 26, 38, 39, 103, 104, + 110, 112, 114, 115, 116, 157, 160, 162, 165, 169, + 170, 171, 174, 175, 197, 228, 203, 193, 193, 161, + 163, 193, 37, 191, 214, 215, 216, 153, 156, 3, + 4, 7, 26, 27, 28, 38, 39, 61, 160, 197, + 227, 228, 229, 229, 229, 229, 189, 191, 191, 153, + 184, 153, 184, 229, 157, 153, 153, 153, 153, 153, + 153, 153, 153, 229, 229, 229, 153, 36, 189, 191, + 230, 24, 153, 187, 187, 187, 172, 173, 155, 155, + 155, 155, 155, 159, 196, 198, 162, 198, 163, 198, + 24, 155, 155, 155, 155, 155, 187, 159, 161, 161, + 212, 213, 153, 156, 37, 63, 226, 198, 153, 153, + 229, 229, 229, 15, 57, 15, 153, 243, 229, 157, + 230, 191, 230, 230, 230, 191, 191, 153, 153, 153, + 230, 191, 229, 229, 153, 34, 57, 185, 188, 155, + 155, 196, 196, 196, 196, 196, 153, 159, 163, 193, + 198, 161, 163, 196, 196, 196, 196, 196, 37, 214, + 185, 186, 24, 161, 21, 21, 155, 153, 153, 229, + 4, 229, 230, 239, 153, 229, 153, 153, 153, 229, + 229, 229, 155, 191, 24, 4, 187, 196, 196, 243, + 153, 153, 153, 153, 196, 161, 163, 153, 153, 153, + 153, 36, 57, 183, 153, 229, 229, 239, 240, 229, + 229, 153, 184, 184, 153, 229, 153, 230, 230, 230, + 240, 229, 153, 153, 156, 196, 196, 196, 196, 161, + 196, 196, 196, 196, 191, 4, 24, 153, 157, 156, + 230, 159, 229, 156, 196, 196, 153, 156, 153, 153, + 156, 156, 156, 156, 156, 21, 159, 178, 236, 36, + 159, 156, 156, 196, 196, 196, 229, 227, 159, 178, + 21, 156, 156, 156, 153, 227, 229, 21, 153, 234, + 229, 21, 21, 229, 229 +}; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ + +#define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -#ifndef YYPURE -#define YYLEX yylex() + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif -#else /* not YYLSP_NEEDED */ + + +/* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) +# define YYLEX yylex (YYLEX_PARAM) #else -#define YYLEX yylex(&yylval) +# define YYLEX yylex () #endif -#endif /* not YYLSP_NEEDED */ + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; #endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + -/* If nonreentrant, generate the variables here */ +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); -#ifndef YYPURE + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; #endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif { - register char *f = from; - register char *t = to; - register int i = count; + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; - while (i-- > 0) - *t++ = *f++; + return yyd - 1; } +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } -#else /* __cplusplus */ + if (! yyres) + return yystrlen (yystr); -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - register char *t = to; - register char *f = from; - register int i = count; + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; - while (i-- > 0) - *t++ = *f++; + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } } +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; #endif -#endif - -#line 217 "/usr/share/bison.simple" +{ + YYUSE (yyvaluep); -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ #ifdef YYPARSE_PARAM -int yyparse (void *); +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); #else -int yyparse (void); +int yyparse (); #endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); #endif +#endif /* ! YYPARSE_PARAM */ -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) #else -#define YYPOPSTACK (yyvsp--, yyssp--) +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; #endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; #endif #endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. - int yylen; + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; @@ -2799,718 +3722,741 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss - 1; + yyssp = yyss; yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: + goto yysetstate; - *++yyssp = yystate; +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif + yysetstate: + *yyssp = yystate; + if (yyss + yystacksize - 1 <= yyssp) + { /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif #endif /* no yyoverflow */ - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - if (yyssp >= yyss + yystacksize - 1) + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; - yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ +/*-----------. +| yybackup. | +`-----------*/ +yybackup: - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ + /* Not known => get a look-ahead token if don't already have one. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif + YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the token being shifted unless it is eof. */ + /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; + yystate = yyn; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - yystate = yyn; goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; + -/* Do a reduction. yyn is the number of a rule to reduce with. */ +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 3: +#line 1595 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" { - int i; + if ((yyvsp[(1) - (1)].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! + error("Value too large for type"); + (yyval.SIntVal) = (int32_t)(yyvsp[(1) - (1)].UIntVal); + ;} + break; - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + case 5: +#line 1604 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(1) - (1)].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! + error("Value too large for type"); + (yyval.SInt64Val) = (int64_t)(yyvsp[(1) - (1)].UInt64Val); + ;} + break; - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif + case 26: +#line 1626 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} + break; + case 27: +#line 1626 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_NE; ;} + break; - switch (yyn) { + case 28: +#line 1627 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} + break; -case 2: -#line 1595 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range! - error("Value too large for type"); - yyval.SIntVal = (int32_t)yyvsp[0].UIntVal; - ; - break;} -case 4: -#line 1604 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range! - error("Value too large for type"); - yyval.SInt64Val = (int64_t)yyvsp[0].UInt64Val; - ; - break;} -case 25: -#line 1626 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_EQ; ; - break;} -case 26: -#line 1626 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_NE; ; - break;} -case 27: -#line 1627 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_SLT; ; - break;} -case 28: -#line 1627 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_SGT; ; - break;} -case 29: -#line 1628 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_SLE; ; - break;} -case 30: -#line 1628 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_SGE; ; - break;} -case 31: -#line 1629 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_ULT; ; - break;} -case 32: -#line 1629 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_UGT; ; - break;} -case 33: -#line 1630 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_ULE; ; - break;} -case 34: -#line 1630 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.IPred = ICmpInst::ICMP_UGE; ; - break;} -case 35: -#line 1634 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_OEQ; ; - break;} -case 36: -#line 1634 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_ONE; ; - break;} -case 37: -#line 1635 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_OLT; ; - break;} -case 38: -#line 1635 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_OGT; ; - break;} -case 39: -#line 1636 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_OLE; ; - break;} -case 40: -#line 1636 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_OGE; ; - break;} -case 41: -#line 1637 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_ORD; ; - break;} -case 42: -#line 1637 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_UNO; ; - break;} -case 43: -#line 1638 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_UEQ; ; - break;} -case 44: -#line 1638 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_UNE; ; - break;} -case 45: -#line 1639 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_ULT; ; - break;} -case 46: -#line 1639 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_UGT; ; - break;} -case 47: -#line 1640 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_ULE; ; - break;} -case 48: -#line 1640 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_UGE; ; - break;} -case 49: -#line 1641 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_TRUE; ; - break;} -case 50: -#line 1642 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.FPred = FCmpInst::FCMP_FALSE; ; - break;} -case 80: -#line 1673 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; - ; - break;} -case 81: -#line 1676 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.StrVal = 0; - ; - break;} -case 82: -#line 1681 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 83: -#line 1682 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 84: -#line 1683 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 85: -#line 1684 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::AppendingLinkage; ; - break;} -case 86: -#line 1685 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 87: -#line 1686 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 88: -#line 1687 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 89: -#line 1688 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 90: -#line 1692 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = OldCallingConv::C; ; - break;} -case 91: -#line 1693 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = OldCallingConv::C; ; - break;} -case 92: -#line 1694 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = OldCallingConv::CSRet; ; - break;} -case 93: -#line 1695 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = OldCallingConv::Fast; ; - break;} -case 94: -#line 1696 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = OldCallingConv::Cold; ; - break;} -case 95: -#line 1697 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = OldCallingConv::X86_StdCall; ; - break;} -case 96: -#line 1698 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = OldCallingConv::X86_FastCall; ; - break;} -case 97: -#line 1699 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) + case 29: +#line 1627 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} + break; + + case 30: +#line 1628 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} + break; + + case 31: +#line 1628 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} + break; + + case 32: +#line 1629 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} + break; + + case 33: +#line 1629 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} + break; + + case 34: +#line 1630 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} + break; + + case 35: +#line 1630 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} + break; + + case 36: +#line 1634 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} + break; + + case 37: +#line 1634 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} + break; + + case 38: +#line 1635 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} + break; + + case 39: +#line 1635 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} + break; + + case 40: +#line 1636 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} + break; + + case 41: +#line 1636 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} + break; + + case 42: +#line 1637 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} + break; + + case 43: +#line 1637 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} + break; + + case 44: +#line 1638 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} + break; + + case 45: +#line 1638 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} + break; + + case 46: +#line 1639 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} + break; + + case 47: +#line 1639 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} + break; + + case 48: +#line 1640 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} + break; + + case 49: +#line 1640 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} + break; + + case 50: +#line 1641 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} + break; + + case 51: +#line 1642 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} + break; + + case 81: +#line 1673 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + ;} + break; + + case 82: +#line 1676 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.StrVal) = 0; + ;} + break; + + case 83: +#line 1681 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 84: +#line 1682 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 85: +#line 1683 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 86: +#line 1684 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} + break; + + case 87: +#line 1685 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 88: +#line 1686 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 89: +#line 1687 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 90: +#line 1688 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 91: +#line 1692 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::C; ;} + break; + + case 92: +#line 1693 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::C; ;} + break; + + case 93: +#line 1694 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::CSRet; ;} + break; + + case 94: +#line 1695 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::Fast; ;} + break; + + case 95: +#line 1696 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::Cold; ;} + break; + + case 96: +#line 1697 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} + break; + + case 97: +#line 1698 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} + break; + + case 98: +#line 1699 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) error("Calling conv too large"); - yyval.UIntVal = yyvsp[0].UInt64Val; - ; - break;} -case 98: -#line 1709 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 99: -#line 1710 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) + (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + ;} + break; + + case 99: +#line 1709 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 100: +#line 1710 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) error("Alignment must be a power of two"); - ; - break;} -case 100: -#line 1718 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 101: -#line 1719 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) + ;} + break; + + case 101: +#line 1718 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 102: +#line 1719 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) error("Alignment must be a power of two"); - ; - break;} -case 102: -#line 1727 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) - if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') + ;} + break; + + case 103: +#line 1727 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i) + if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\') error("Invalid character in section name"); - yyval.StrVal = yyvsp[0].StrVal; - ; - break;} -case 103: -#line 1736 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.StrVal = 0; ; - break;} -case 104: -#line 1737 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.StrVal = yyvsp[0].StrVal; ; - break;} -case 105: -#line 1744 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{; - break;} -case 106: -#line 1745 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{; - break;} -case 107: -#line 1749 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - CurGV->setSection(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 108: -#line 1753 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) + (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); + ;} + break; + + case 104: +#line 1736 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 105: +#line 1737 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} + break; + + case 106: +#line 1744 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + {;} + break; + + case 107: +#line 1745 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + {;} + break; + + case 108: +#line 1749 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + CurGV->setSection((yyvsp[(1) - (1)].StrVal)); + free((yyvsp[(1) - (1)].StrVal)); + ;} + break; + + case 109: +#line 1753 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) error("Alignment must be a power of two"); - CurGV->setAlignment(yyvsp[0].UInt64Val); + CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); - ; - break;} -case 110: -#line 1770 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TypeVal.PAT = new PATypeHolder(yyvsp[0].PrimType.T); - yyval.TypeVal.S = Signless; - ; - break;} -case 112: -#line 1778 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TypeVal.PAT = new PATypeHolder(yyvsp[0].PrimType.T); - yyval.TypeVal.S = Signless; - ; - break;} -case 113: -#line 1785 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + ;} + break; + + case 111: +#line 1770 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T); + (yyval.TypeVal).S = Signless; + ;} + break; + + case 113: +#line 1778 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T); + (yyval.TypeVal).S = Signless; + ;} + break; + + case 114: +#line 1785 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { if (!UpRefs.empty()) - error("Invalid upreference in type: " + (*yyvsp[0].TypeVal.PAT)->getDescription()); - yyval.TypeVal = yyvsp[0].TypeVal; - ; - break;} -case 126: -#line 1799 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TypeVal.PAT = new PATypeHolder(yyvsp[0].PrimType.T); - yyval.TypeVal.S = yyvsp[0].PrimType.S; - ; - break;} -case 127: -#line 1803 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TypeVal.PAT = new PATypeHolder(OpaqueType::get()); - yyval.TypeVal.S = Signless; - ; - break;} -case 128: -#line 1807 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Named types are also simple types... - const Type* tmp = getType(yyvsp[0].ValIDVal); - yyval.TypeVal.PAT = new PATypeHolder(tmp); - yyval.TypeVal.S = Signless; // FIXME: what if its signed? - ; - break;} -case 129: -#line 1812 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Type UpReference - if (yyvsp[0].UInt64Val > (uint64_t)~0U) + error("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal).PAT)->getDescription()); + (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); + ;} + break; + + case 127: +#line 1799 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T); + (yyval.TypeVal).S = (yyvsp[(1) - (1)].PrimType).S; + ;} + break; + + case 128: +#line 1803 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TypeVal).PAT = new PATypeHolder(OpaqueType::get()); + (yyval.TypeVal).S = Signless; + ;} + break; + + case 129: +#line 1807 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Named types are also simple types... + const Type* tmp = getType((yyvsp[(1) - (1)].ValIDVal)); + (yyval.TypeVal).PAT = new PATypeHolder(tmp); + (yyval.TypeVal).S = Signless; // FIXME: what if its signed? + ;} + break; + + case 130: +#line 1812 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Type UpReference + if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) error("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... - yyval.TypeVal.PAT = new PATypeHolder(OT); - yyval.TypeVal.S = Signless; + UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... + (yyval.TypeVal).PAT = new PATypeHolder(OT); + (yyval.TypeVal).S = Signless; UR_OUT("New Upreference!\n"); - ; - break;} -case 130: -#line 1821 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Function derived type? + ;} + break; + + case 131: +#line 1821 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Function derived type? std::vector Params; - for (std::list::iterator I = yyvsp[-1].TypeList->begin(), - E = yyvsp[-1].TypeList->end(); I != E; ++I) { + for (std::list::iterator I = (yyvsp[(3) - (4)].TypeList)->begin(), + E = (yyvsp[(3) - (4)].TypeList)->end(); I != E; ++I) { Params.push_back(I->PAT->get()); } FunctionType::ParamAttrsList ParamAttrs; bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - yyval.TypeVal.PAT = new PATypeHolder( - HandleUpRefs(FunctionType::get(yyvsp[-3].TypeVal.PAT->get(), Params, isVarArg, + (yyval.TypeVal).PAT = new PATypeHolder( + HandleUpRefs(FunctionType::get((yyvsp[(1) - (4)].TypeVal).PAT->get(), Params, isVarArg, ParamAttrs))); - yyval.TypeVal.S = yyvsp[-3].TypeVal.S; - delete yyvsp[-3].TypeVal.PAT; // Delete the return type handle - delete yyvsp[-1].TypeList; // Delete the argument list - ; - break;} -case 131: -#line 1838 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Sized array type? - yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(ArrayType::get(yyvsp[-1].TypeVal.PAT->get(), - (unsigned)yyvsp[-3].UInt64Val))); - yyval.TypeVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 132: -#line 1844 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Packed array type? - const llvm::Type* ElemTy = yyvsp[-1].TypeVal.PAT->get(); - if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) + (yyval.TypeVal).S = (yyvsp[(1) - (4)].TypeVal).S; + delete (yyvsp[(1) - (4)].TypeVal).PAT; // Delete the return type handle + delete (yyvsp[(3) - (4)].TypeList); // Delete the argument list + ;} + break; + + case 132: +#line 1838 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Sized array type? + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[(4) - (5)].TypeVal).PAT->get(), + (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + (yyval.TypeVal).S = (yyvsp[(4) - (5)].TypeVal).S; + delete (yyvsp[(4) - (5)].TypeVal).PAT; + ;} + break; + + case 133: +#line 1844 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Packed array type? + const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal).PAT->get(); + if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) error("Unsigned result not equal to signed result"); if (!(ElemTy->isInteger() || ElemTy->isFloatingPoint())) error("Elements of a PackedType must be integer or floating point"); - if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) + if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) error("PackedType length should be a power of 2"); - yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, - (unsigned)yyvsp[-3].UInt64Val))); - yyval.TypeVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 133: -#line 1857 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Structure type? + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, + (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + (yyval.TypeVal).S = (yyvsp[(4) - (5)].TypeVal).S; + delete (yyvsp[(4) - (5)].TypeVal).PAT; + ;} + break; + + case 134: +#line 1857 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Structure type? std::vector Elements; - for (std::list::iterator I = yyvsp[-1].TypeList->begin(), - E = yyvsp[-1].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), + E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) Elements.push_back(I->PAT->get()); - yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - yyval.TypeVal.S = Signless; - delete yyvsp[-1].TypeList; - ; - break;} -case 134: -#line 1866 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Empty structure type? - yyval.TypeVal.PAT = new PATypeHolder(StructType::get(std::vector())); - yyval.TypeVal.S = Signless; - ; - break;} -case 135: -#line 1870 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Packed Structure type? + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + (yyval.TypeVal).S = Signless; + delete (yyvsp[(2) - (3)].TypeList); + ;} + break; + + case 135: +#line 1866 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Empty structure type? + (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector())); + (yyval.TypeVal).S = Signless; + ;} + break; + + case 136: +#line 1870 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Packed Structure type? std::vector Elements; - for (std::list::iterator I = yyvsp[-2].TypeList->begin(), - E = yyvsp[-2].TypeList->end(); I != E; ++I) { + for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), + E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) { Elements.push_back(I->PAT->get()); delete I->PAT; } - yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - yyval.TypeVal.S = Signless; - delete yyvsp[-2].TypeList; - ; - break;} -case 136: -#line 1881 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Empty packed structure type? - yyval.TypeVal.PAT = new PATypeHolder(StructType::get(std::vector(),true)); - yyval.TypeVal.S = Signless; - ; - break;} -case 137: -#line 1885 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Pointer type? - if (yyvsp[-1].TypeVal.PAT->get() == Type::LabelTy) + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + (yyval.TypeVal).S = Signless; + delete (yyvsp[(3) - (5)].TypeList); + ;} + break; + + case 137: +#line 1881 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Empty packed structure type? + (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector(),true)); + (yyval.TypeVal).S = Signless; + ;} + break; + + case 138: +#line 1885 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Pointer type? + if ((yyvsp[(1) - (2)].TypeVal).PAT->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); - yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(PointerType::get(yyvsp[-1].TypeVal.PAT->get()))); - yyval.TypeVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 138: -#line 1898 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TypeList = new std::list(); - yyval.TypeList->push_back(yyvsp[0].TypeVal); - ; - break;} -case 139: -#line 1902 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(yyvsp[0].TypeVal); - ; - break;} -case 141: -#line 1910 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(PointerType::get((yyvsp[(1) - (2)].TypeVal).PAT->get()))); + (yyval.TypeVal).S = (yyvsp[(1) - (2)].TypeVal).S; + delete (yyvsp[(1) - (2)].TypeVal).PAT; + ;} + break; + + case 139: +#line 1898 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TypeList) = new std::list(); + (yyval.TypeList)->push_back((yyvsp[(1) - (1)].TypeVal)); + ;} + break; + + case 140: +#line 1902 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back((yyvsp[(3) - (3)].TypeVal)); + ;} + break; + + case 142: +#line 1910 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(VoidTI); - ; - break;} -case 142: -#line 1916 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TypeList = new std::list(); + ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(VoidTI); + ;} + break; + + case 143: +#line 1916 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TypeList) = new std::list(); PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - yyval.TypeList->push_back(VoidTI); - ; - break;} -case 143: -#line 1923 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TypeList = new std::list(); - ; - break;} -case 144: -#line 1935 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Nonempty unsized arr - const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal.PAT->get()); + (yyval.TypeList)->push_back(VoidTI); + ;} + break; + + case 144: +#line 1923 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TypeList) = new std::list(); + ;} + break; + + case 145: +#line 1935 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal).PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - yyvsp[-3].TypeVal.PAT->get()->getDescription() + "'"); + (yyvsp[(1) - (4)].TypeVal).PAT->get()->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) error("Type mismatch: constant sized array initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! std::vector Elems; - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - Constant *C = (*yyvsp[-1].ConstVector)[i].C; + for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { + Constant *C = (*(yyvsp[(3) - (4)].ConstVector))[i].C; const Type* ValTy = C->getType(); if (ETy != ValTy) error("Element #" + utostr(i) + " is not of type '" + @@ -3518,72 +4464,75 @@ ValTy->getDescription() + "'"); Elems.push_back(C); } - yyval.ConstVal.C = ConstantArray::get(ATy, Elems); - yyval.ConstVal.S = yyvsp[-3].TypeVal.S; - delete yyvsp[-3].TypeVal.PAT; - delete yyvsp[-1].ConstVector; - ; - break;} -case 145: -#line 1965 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal.PAT->get()); + (yyval.ConstVal).C = ConstantArray::get(ATy, Elems); + (yyval.ConstVal).S = (yyvsp[(1) - (4)].TypeVal).S; + delete (yyvsp[(1) - (4)].TypeVal).PAT; + delete (yyvsp[(3) - (4)].ConstVector); + ;} + break; + + case 146: +#line 1965 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal).PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - yyvsp[-2].TypeVal.PAT->get()->getDescription() + "'"); + (yyvsp[(1) - (3)].TypeVal).PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) error("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - yyval.ConstVal.C = ConstantArray::get(ATy, std::vector()); - yyval.ConstVal.S = yyvsp[-2].TypeVal.S; - delete yyvsp[-2].TypeVal.PAT; - ; - break;} -case 146: -#line 1978 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal.PAT->get()); + (yyval.ConstVal).C = ConstantArray::get(ATy, std::vector()); + (yyval.ConstVal).S = (yyvsp[(1) - (3)].TypeVal).S; + delete (yyvsp[(1) - (3)].TypeVal).PAT; + ;} + break; + + case 147: +#line 1978 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal).PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - yyvsp[-2].TypeVal.PAT->get()->getDescription() + "'"); + (yyvsp[(1) - (3)].TypeVal).PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = dyn_cast(ATy->getElementType()); if (!ETy || cast(ETy)->getBitWidth() != 8) error("String arrays require type i8, not '" + ETy->getDescription() + "'"); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) + char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); + if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) error("Can't build string constant of size " + - itostr((int)(EndStr-yyvsp[0].StrVal)) + " when array has size " + + itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; - for (char *C = (char *)yyvsp[0].StrVal; C != (char *)EndStr; ++C) + for (char *C = (char *)(yyvsp[(3) - (3)].StrVal); C != (char *)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); - free(yyvsp[0].StrVal); - yyval.ConstVal.C = ConstantArray::get(ATy, Vals); - yyval.ConstVal.S = yyvsp[-2].TypeVal.S; - delete yyvsp[-2].TypeVal.PAT; - ; - break;} -case 147: -#line 2001 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Nonempty unsized arr - const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal.PAT->get()); + free((yyvsp[(3) - (3)].StrVal)); + (yyval.ConstVal).C = ConstantArray::get(ATy, Vals); + (yyval.ConstVal).S = (yyvsp[(1) - (3)].TypeVal).S; + delete (yyvsp[(1) - (3)].TypeVal).PAT; + ;} + break; + + case 148: +#line 2001 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized arr + const PackedType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal).PAT->get()); if (PTy == 0) error("Cannot make packed constant with type: '" + - yyvsp[-3].TypeVal.PAT->get()->getDescription() + "'"); + (yyvsp[(1) - (4)].TypeVal).PAT->get()->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) error("Type mismatch: constant sized packed initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! std::vector Elems; - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - Constant *C = (*yyvsp[-1].ConstVector)[i].C; + for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { + Constant *C = (*(yyvsp[(3) - (4)].ConstVector))[i].C; const Type* ValTy = C->getType(); if (ETy != ValTy) error("Element #" + utostr(i) + " is not of type '" + @@ -3591,117 +4540,124 @@ ValTy->getDescription() + "'"); Elems.push_back(C); } - yyval.ConstVal.C = ConstantPacked::get(PTy, Elems); - yyval.ConstVal.S = yyvsp[-3].TypeVal.S; - delete yyvsp[-3].TypeVal.PAT; - delete yyvsp[-1].ConstVector; - ; - break;} -case 148: -#line 2029 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-3].TypeVal.PAT->get()); + (yyval.ConstVal).C = ConstantPacked::get(PTy, Elems); + (yyval.ConstVal).S = (yyvsp[(1) - (4)].TypeVal).S; + delete (yyvsp[(1) - (4)].TypeVal).PAT; + delete (yyvsp[(3) - (4)].ConstVector); + ;} + break; + + case 149: +#line 2029 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal).PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - yyvsp[-3].TypeVal.PAT->get()->getDescription() + "'"); - if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) + (yyvsp[(1) - (4)].TypeVal).PAT->get()->getDescription() + "'"); + if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! std::vector Fields; - for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) { - Constant *C = (*yyvsp[-1].ConstVector)[i].C; + for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) { + Constant *C = (*(yyvsp[(3) - (4)].ConstVector))[i].C; if (C->getType() != STy->getElementType(i)) error("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer"); Fields.push_back(C); } - yyval.ConstVal.C = ConstantStruct::get(STy, Fields); - yyval.ConstVal.S = yyvsp[-3].TypeVal.S; - delete yyvsp[-3].TypeVal.PAT; - delete yyvsp[-1].ConstVector; - ; - break;} -case 149: -#line 2051 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-2].TypeVal.PAT->get()); + (yyval.ConstVal).C = ConstantStruct::get(STy, Fields); + (yyval.ConstVal).S = (yyvsp[(1) - (4)].TypeVal).S; + delete (yyvsp[(1) - (4)].TypeVal).PAT; + delete (yyvsp[(3) - (4)].ConstVector); + ;} + break; + + case 150: +#line 2051 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal).PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - yyvsp[-2].TypeVal.PAT->get()->getDescription() + "'"); + (yyvsp[(1) - (3)].TypeVal).PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for structure type"); - yyval.ConstVal.C = ConstantStruct::get(STy, std::vector()); - yyval.ConstVal.S = yyvsp[-2].TypeVal.S; - delete yyvsp[-2].TypeVal.PAT; - ; - break;} -case 150: -#line 2062 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-5].TypeVal.PAT->get()); + (yyval.ConstVal).C = ConstantStruct::get(STy, std::vector()); + (yyval.ConstVal).S = (yyvsp[(1) - (3)].TypeVal).S; + delete (yyvsp[(1) - (3)].TypeVal).PAT; + ;} + break; + + case 151: +#line 2062 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal).PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - yyvsp[-5].TypeVal.PAT->get()->getDescription() + "'"); - if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) + (yyvsp[(1) - (6)].TypeVal).PAT->get()->getDescription() + "'"); + if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for packed structure type"); // Check to ensure that constants are compatible with the type initializer! std::vector Fields; - for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) { - Constant *C = (*yyvsp[-2].ConstVector)[i].C; + for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) { + Constant *C = (*(yyvsp[(4) - (6)].ConstVector))[i].C; if (C->getType() != STy->getElementType(i)) error("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of packed struct initializer"); Fields.push_back(C); } - yyval.ConstVal.C = ConstantStruct::get(STy, Fields); - yyval.ConstVal.S = yyvsp[-5].TypeVal.S; - delete yyvsp[-5].TypeVal.PAT; - delete yyvsp[-2].ConstVector; - ; - break;} -case 151: -#line 2084 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-4].TypeVal.PAT->get()); + (yyval.ConstVal).C = ConstantStruct::get(STy, Fields); + (yyval.ConstVal).S = (yyvsp[(1) - (6)].TypeVal).S; + delete (yyvsp[(1) - (6)].TypeVal).PAT; + delete (yyvsp[(4) - (6)].ConstVector); + ;} + break; + + case 152: +#line 2084 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal).PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - yyvsp[-4].TypeVal.PAT->get()->getDescription() + "'"); + (yyvsp[(1) - (5)].TypeVal).PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for packed structure type"); - yyval.ConstVal.C = ConstantStruct::get(STy, std::vector()); - yyval.ConstVal.S = yyvsp[-4].TypeVal.S; - delete yyvsp[-4].TypeVal.PAT; - ; - break;} -case 152: -#line 2095 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal.PAT->get()); + (yyval.ConstVal).C = ConstantStruct::get(STy, std::vector()); + (yyval.ConstVal).S = (yyvsp[(1) - (5)].TypeVal).S; + delete (yyvsp[(1) - (5)].TypeVal).PAT; + ;} + break; + + case 153: +#line 2095 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal).PAT->get()); if (PTy == 0) error("Cannot make null pointer constant with type: '" + - yyvsp[-1].TypeVal.PAT->get()->getDescription() + "'"); - yyval.ConstVal.C = ConstantPointerNull::get(PTy); - yyval.ConstVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 153: -#line 2104 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ConstVal.C = UndefValue::get(yyvsp[-1].TypeVal.PAT->get()); - yyval.ConstVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 154: -#line 2109 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal.PAT->get()); + (yyvsp[(1) - (2)].TypeVal).PAT->get()->getDescription() + "'"); + (yyval.ConstVal).C = ConstantPointerNull::get(PTy); + (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; + delete (yyvsp[(1) - (2)].TypeVal).PAT; + ;} + break; + + case 154: +#line 2104 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ConstVal).C = UndefValue::get((yyvsp[(1) - (2)].TypeVal).PAT->get()); + (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; + delete (yyvsp[(1) - (2)].TypeVal).PAT; + ;} + break; + + case 155: +#line 2109 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal).PAT->get()); if (Ty == 0) error("Global const reference must be a pointer type, not" + - yyvsp[-1].TypeVal.PAT->get()->getDescription()); + (yyvsp[(1) - (2)].TypeVal).PAT->get()->getDescription()); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -3712,7 +4668,7 @@ // Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingValue(Ty, yyvsp[0].ValIDVal); + Value *V = getExistingValue(Ty, (yyvsp[(2) - (2)].ValIDVal)); CurFun.CurrentFunction = SavedCurFn; // If this is an initializer for a constant pointer, which is referencing a @@ -3725,14 +4681,14 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); + CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - yyvsp[0].ValIDVal.destroy(); + (yyvsp[(2) - (2)].ValIDVal).destroy(); } else { std::string Name; - if (yyvsp[0].ValIDVal.Type == ValID::NameVal) Name = yyvsp[0].ValIDVal.Name; + if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::NameVal) Name = (yyvsp[(2) - (2)].ValIDVal).Name; // Create the forward referenced global. GlobalValue *GV; @@ -3747,141 +4703,152 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); V = GV; } } - yyval.ConstVal.C = cast(V); - yyval.ConstVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; // Free the type handle - ; - break;} -case 155: -#line 2167 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[-1].TypeVal.PAT->get() != yyvsp[0].ConstVal.C->getType()) + (yyval.ConstVal).C = cast(V); + (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; + delete (yyvsp[(1) - (2)].TypeVal).PAT; // Free the type handle + ;} + break; + + case 156: +#line 2167 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(1) - (2)].TypeVal).PAT->get() != (yyvsp[(2) - (2)].ConstVal).C->getType()) error("Mismatched types for constant expression"); - yyval.ConstVal = yyvsp[0].ConstVal; - yyval.ConstVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 156: -#line 2174 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); + (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); + (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; + delete (yyvsp[(1) - (2)].TypeVal).PAT; + ;} + break; + + case 157: +#line 2174 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(1) - (2)].TypeVal).PAT->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) error("Cannot create a null initialized value of this type"); - yyval.ConstVal.C = Constant::getNullValue(Ty); - yyval.ConstVal.S = yyvsp[-1].TypeVal.S; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 157: -#line 2182 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // integral constants - const Type *Ty = yyvsp[-1].PrimType.T; - if (!ConstantInt::isValueValidForType(Ty, yyvsp[0].SInt64Val)) + (yyval.ConstVal).C = Constant::getNullValue(Ty); + (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; + delete (yyvsp[(1) - (2)].TypeVal).PAT; + ;} + break; + + case 158: +#line 2182 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + const Type *Ty = (yyvsp[(1) - (2)].PrimType).T; + if (!ConstantInt::isValueValidForType(Ty, (yyvsp[(2) - (2)].SInt64Val))) error("Constant value doesn't fit in type"); - yyval.ConstVal.C = ConstantInt::get(Ty, yyvsp[0].SInt64Val); - yyval.ConstVal.S = Signed; - ; - break;} -case 158: -#line 2189 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // integral constants - const Type *Ty = yyvsp[-1].PrimType.T; - if (!ConstantInt::isValueValidForType(Ty, yyvsp[0].UInt64Val)) + (yyval.ConstVal).C = ConstantInt::get(Ty, (yyvsp[(2) - (2)].SInt64Val)); + (yyval.ConstVal).S = Signed; + ;} + break; + + case 159: +#line 2189 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // integral constants + const Type *Ty = (yyvsp[(1) - (2)].PrimType).T; + if (!ConstantInt::isValueValidForType(Ty, (yyvsp[(2) - (2)].UInt64Val))) error("Constant value doesn't fit in type"); - yyval.ConstVal.C = ConstantInt::get(Ty, yyvsp[0].UInt64Val); - yyval.ConstVal.S = Unsigned; - ; - break;} -case 159: -#line 2196 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Boolean constants - yyval.ConstVal.C = ConstantInt::get(Type::Int1Ty, true); - yyval.ConstVal.S = Unsigned; - ; - break;} -case 160: -#line 2200 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Boolean constants - yyval.ConstVal.C = ConstantInt::get(Type::Int1Ty, false); - yyval.ConstVal.S = Unsigned; - ; - break;} -case 161: -#line 2204 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Float & Double constants - if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType.T, yyvsp[0].FPVal)) + (yyval.ConstVal).C = ConstantInt::get(Ty, (yyvsp[(2) - (2)].UInt64Val)); + (yyval.ConstVal).S = Unsigned; + ;} + break; + + case 160: +#line 2196 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); + (yyval.ConstVal).S = Unsigned; + ;} + break; + + case 161: +#line 2200 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Boolean constants + (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); + (yyval.ConstVal).S = Unsigned; + ;} + break; + + case 162: +#line 2204 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Float & Double constants + if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType).T, (yyvsp[(2) - (2)].FPVal))) error("Floating point constant invalid for type"); - yyval.ConstVal.C = ConstantFP::get(yyvsp[-1].PrimType.T, yyvsp[0].FPVal); - yyval.ConstVal.S = Signless; - ; - break;} -case 162: -#line 2213 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* SrcTy = yyvsp[-3].ConstVal.C->getType(); - const Type* DstTy = yyvsp[-1].TypeVal.PAT->get(); - Signedness SrcSign = yyvsp[-3].ConstVal.S; - Signedness DstSign = yyvsp[-1].TypeVal.S; + (yyval.ConstVal).C = ConstantFP::get((yyvsp[(1) - (2)].PrimType).T, (yyvsp[(2) - (2)].FPVal)); + (yyval.ConstVal).S = Signless; + ;} + break; + + case 163: +#line 2213 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* SrcTy = (yyvsp[(3) - (6)].ConstVal).C->getType(); + const Type* DstTy = (yyvsp[(5) - (6)].TypeVal).PAT->get(); + Signedness SrcSign = (yyvsp[(3) - (6)].ConstVal).S; + Signedness DstSign = (yyvsp[(5) - (6)].TypeVal).S; if (!SrcTy->isFirstClassType()) error("cast constant expression from a non-primitive type: '" + SrcTy->getDescription() + "'"); if (!DstTy->isFirstClassType()) error("cast constant expression to a non-primitive type: '" + DstTy->getDescription() + "'"); - yyval.ConstVal.C = cast(getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal.C, SrcSign, DstTy, DstSign)); - yyval.ConstVal.S = DstSign; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 163: -#line 2228 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-2].ConstVal.C->getType(); + (yyval.ConstVal).C = cast(getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal).C, SrcSign, DstTy, DstSign)); + (yyval.ConstVal).S = DstSign; + delete (yyvsp[(5) - (6)].TypeVal).PAT; + ;} + break; + + case 164: +#line 2228 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(3) - (5)].ConstVal).C->getType(); if (!isa(Ty)) error("GetElementPtr requires a pointer operand"); std::vector VIndices; std::vector CIndices; - upgradeGEPIndices(yyvsp[-2].ConstVal.C->getType(), yyvsp[-1].ValueList, VIndices, &CIndices); + upgradeGEPIndices((yyvsp[(3) - (5)].ConstVal).C->getType(), (yyvsp[(4) - (5)].ValueList), VIndices, &CIndices); - delete yyvsp[-1].ValueList; - yyval.ConstVal.C = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal.C, CIndices); - yyval.ConstVal.S = Signless; - ; - break;} -case 164: -#line 2241 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!yyvsp[-5].ConstVal.C->getType()->isInteger() || - cast(yyvsp[-5].ConstVal.C->getType())->getBitWidth() != 1) + delete (yyvsp[(4) - (5)].ValueList); + (yyval.ConstVal).C = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal).C, CIndices); + (yyval.ConstVal).S = Signless; + ;} + break; + + case 165: +#line 2241 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[(3) - (8)].ConstVal).C->getType()->isInteger() || + cast((yyvsp[(3) - (8)].ConstVal).C->getType())->getBitWidth() != 1) error("Select condition must be bool type"); - if (yyvsp[-3].ConstVal.C->getType() != yyvsp[-1].ConstVal.C->getType()) + if ((yyvsp[(5) - (8)].ConstVal).C->getType() != (yyvsp[(7) - (8)].ConstVal).C->getType()) error("Select operand types must match"); - yyval.ConstVal.C = ConstantExpr::getSelect(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = Unsigned; - ; - break;} -case 165: -#line 2250 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-3].ConstVal.C->getType(); - if (Ty != yyvsp[-1].ConstVal.C->getType()) + (yyval.ConstVal).C = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C); + (yyval.ConstVal).S = Unsigned; + ;} + break; + + case 166: +#line 2250 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); + if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType()) error("Binary operator types must match"); // First, make sure we're dealing with the right opcode by upgrading from // obsolete versions. - Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-5].BinaryOpVal, Ty, yyvsp[-3].ConstVal.S); + Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (6)].BinaryOpVal), Ty, (yyvsp[(3) - (6)].ConstVal).S); // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the // broken case. See PR424 for more information. if (!isa(Ty)) { - yyval.ConstVal.C = ConstantExpr::get(Opcode, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + (yyval.ConstVal).C = ConstantExpr::get(Opcode, (yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { @@ -3889,147 +4856,165 @@ case Module::Pointer64: IntPtrTy = Type::Int64Ty; break; default: error("invalid pointer binary constant expr"); } - yyval.ConstVal.C = ConstantExpr::get(Opcode, - ConstantExpr::getCast(Instruction::PtrToInt, yyvsp[-3].ConstVal.C, IntPtrTy), - ConstantExpr::getCast(Instruction::PtrToInt, yyvsp[-1].ConstVal.C, IntPtrTy)); - yyval.ConstVal.C = ConstantExpr::getCast(Instruction::IntToPtr, yyval.ConstVal.C, Ty); - } - yyval.ConstVal.S = yyvsp[-3].ConstVal.S; - ; - break;} -case 166: -#line 2278 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* Ty = yyvsp[-3].ConstVal.C->getType(); - if (Ty != yyvsp[-1].ConstVal.C->getType()) + (yyval.ConstVal).C = ConstantExpr::get(Opcode, + ConstantExpr::getCast(Instruction::PtrToInt, (yyvsp[(3) - (6)].ConstVal).C, IntPtrTy), + ConstantExpr::getCast(Instruction::PtrToInt, (yyvsp[(5) - (6)].ConstVal).C, IntPtrTy)); + (yyval.ConstVal).C = ConstantExpr::getCast(Instruction::IntToPtr, (yyval.ConstVal).C, Ty); + } + (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; + ;} + break; + + case 167: +#line 2278 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); + if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType()) error("Logical operator types must match"); if (!Ty->isInteger()) { if (!isa(Ty) || !cast(Ty)->getElementType()->isInteger()) error("Logical operator requires integer operands"); } - Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-5].BinaryOpVal, Ty, yyvsp[-3].ConstVal.S); - yyval.ConstVal.C = ConstantExpr::get(Opcode, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = yyvsp[-3].ConstVal.S; - ; - break;} -case 167: -#line 2291 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* Ty = yyvsp[-3].ConstVal.C->getType(); - if (Ty != yyvsp[-1].ConstVal.C->getType()) + Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (6)].BinaryOpVal), Ty, (yyvsp[(3) - (6)].ConstVal).S); + (yyval.ConstVal).C = ConstantExpr::get(Opcode, (yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); + (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; + ;} + break; + + case 168: +#line 2291 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); + if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType()) error("setcc operand types must match"); unsigned short pred; - Instruction::OtherOps Opcode = getCompareOp(yyvsp[-5].BinaryOpVal, pred, Ty, yyvsp[-3].ConstVal.S); - yyval.ConstVal.C = ConstantExpr::getCompare(Opcode, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = Unsigned; - ; - break;} -case 168: -#line 2300 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[-3].ConstVal.C->getType() != yyvsp[-1].ConstVal.C->getType()) + Instruction::OtherOps Opcode = getCompareOp((yyvsp[(1) - (6)].BinaryOpVal), pred, Ty, (yyvsp[(3) - (6)].ConstVal).S); + (yyval.ConstVal).C = ConstantExpr::getCompare(Opcode, (yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); + (yyval.ConstVal).S = Unsigned; + ;} + break; + + case 169: +#line 2300 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal).C->getType() != (yyvsp[(6) - (7)].ConstVal).C->getType()) error("icmp operand types must match"); - yyval.ConstVal.C = ConstantExpr::getCompare(yyvsp[-5].IPred, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = Unsigned; - ; - break;} -case 169: -#line 2306 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[-3].ConstVal.C->getType() != yyvsp[-1].ConstVal.C->getType()) + (yyval.ConstVal).C = ConstantExpr::getCompare((yyvsp[(2) - (7)].IPred), (yyvsp[(4) - (7)].ConstVal).C, (yyvsp[(6) - (7)].ConstVal).C); + (yyval.ConstVal).S = Unsigned; + ;} + break; + + case 170: +#line 2306 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal).C->getType() != (yyvsp[(6) - (7)].ConstVal).C->getType()) error("fcmp operand types must match"); - yyval.ConstVal.C = ConstantExpr::getCompare(yyvsp[-5].FPred, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = Unsigned; - ; - break;} -case 170: -#line 2312 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!yyvsp[-1].ConstVal.C->getType()->isInteger() || - cast(yyvsp[-1].ConstVal.C->getType())->getBitWidth() != 8) + (yyval.ConstVal).C = ConstantExpr::getCompare((yyvsp[(2) - (7)].FPred), (yyvsp[(4) - (7)].ConstVal).C, (yyvsp[(6) - (7)].ConstVal).C); + (yyval.ConstVal).S = Unsigned; + ;} + break; + + case 171: +#line 2312 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[(5) - (6)].ConstVal).C->getType()->isInteger() || + cast((yyvsp[(5) - (6)].ConstVal).C->getType())->getBitWidth() != 8) error("Shift count for shift constant must be unsigned byte"); - const Type* Ty = yyvsp[-3].ConstVal.C->getType(); - if (!yyvsp[-3].ConstVal.C->getType()->isInteger()) + const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); + if (!(yyvsp[(3) - (6)].ConstVal).C->getType()->isInteger()) error("Shift constant expression requires integer operand"); - Constant *ShiftAmt = ConstantExpr::getZExt(yyvsp[-1].ConstVal.C, Ty); - yyval.ConstVal.C = ConstantExpr::get(getBinaryOp(yyvsp[-5].BinaryOpVal, Ty, yyvsp[-3].ConstVal.S), yyvsp[-3].ConstVal.C, ShiftAmt); - yyval.ConstVal.S = yyvsp[-3].ConstVal.S; - ; - break;} -case 171: -#line 2323 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C)) + Constant *ShiftAmt = ConstantExpr::getZExt((yyvsp[(5) - (6)].ConstVal).C, Ty); + (yyval.ConstVal).C = ConstantExpr::get(getBinaryOp((yyvsp[(1) - (6)].BinaryOpVal), Ty, (yyvsp[(3) - (6)].ConstVal).S), (yyvsp[(3) - (6)].ConstVal).C, ShiftAmt); + (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; + ;} + break; + + case 172: +#line 2323 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C)) error("Invalid extractelement operands"); - yyval.ConstVal.C = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = yyvsp[-3].ConstVal.S; - ; - break;} -case 172: -#line 2329 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C)) + (yyval.ConstVal).C = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); + (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; + ;} + break; + + case 173: +#line 2329 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C)) error("Invalid insertelement operands"); - yyval.ConstVal.C = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = yyvsp[-5].ConstVal.S; - ; - break;} -case 173: -#line 2335 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C)) + (yyval.ConstVal).C = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C); + (yyval.ConstVal).S = (yyvsp[(3) - (8)].ConstVal).S; + ;} + break; + + case 174: +#line 2335 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C)) error("Invalid shufflevector operands"); - yyval.ConstVal.C = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); - yyval.ConstVal.S = yyvsp[-5].ConstVal.S; - ; - break;} -case 174: -#line 2346 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); ; - break;} -case 175: -#line 2347 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ConstVector = new std::vector(); - yyval.ConstVector->push_back(yyvsp[0].ConstVal); - ; - break;} -case 176: -#line 2356 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.BoolVal = false; ; - break;} -case 177: -#line 2357 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.BoolVal = true; ; - break;} -case 178: -#line 2369 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ModuleVal = ParserResult = yyvsp[0].ModuleVal; + (yyval.ConstVal).C = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C); + (yyval.ConstVal).S = (yyvsp[(3) - (8)].ConstVal).S; + ;} + break; + + case 175: +#line 2346 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); ;} + break; + + case 176: +#line 2347 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ConstVector) = new std::vector(); + (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); + ;} + break; + + case 177: +#line 2356 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 178: +#line 2357 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 179: +#line 2369 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ModuleVal) = ParserResult = (yyvsp[(1) - (1)].ModuleVal); CurModule.ModuleDone(); - ; - break;} -case 179: -#line 2378 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ModuleVal = yyvsp[-1].ModuleVal; CurFun.FunctionDone(); ; - break;} -case 180: -#line 2379 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ModuleVal = yyvsp[-1].ModuleVal; ; - break;} -case 181: -#line 2380 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ModuleVal = yyvsp[-3].ModuleVal; ; - break;} -case 182: -#line 2381 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ModuleVal = yyvsp[-1].ModuleVal; ; - break;} -case 183: -#line 2382 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ModuleVal = CurModule.CurrentModule; + ;} + break; + + case 180: +#line 2378 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); CurFun.FunctionDone(); ;} + break; + + case 181: +#line 2379 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); ;} + break; + + case 182: +#line 2380 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ModuleVal) = (yyvsp[(1) - (4)].ModuleVal); ;} + break; + + case 183: +#line 2381 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); ;} + break; + + case 184: +#line 2382 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; @@ -4039,11 +5024,12 @@ error("Reference to an undefined type: #" + itostr(DID.Num)); } } - ; - break;} -case 184: -#line 2398 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + ;} + break; + + case 185: +#line 2398 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -4053,234 +5039,266 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - const Type* Ty = yyvsp[0].TypeVal.PAT->get(); - ResolveTypeTo(yyvsp[-2].StrVal, Ty); + const Type* Ty = (yyvsp[(4) - (4)].TypeVal).PAT->get(); + ResolveTypeTo((yyvsp[(2) - (4)].StrVal), Ty); - if (!setTypeName(Ty, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName(Ty, (yyvsp[(2) - (4)].StrVal)) && !(yyvsp[(2) - (4)].StrVal)) { // If this is a named type that is not a redefinition, add it to the slot // table. CurModule.Types.push_back(Ty); } - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 185: -#line 2418 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Function prototypes can be in const pool - ; - break;} -case 186: -#line 2420 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Asm blocks can be in the const pool - ; - break;} -case 187: -#line 2422 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[0].ConstVal.C == 0) + delete (yyvsp[(4) - (4)].TypeVal).PAT; + ;} + break; + + case 186: +#line 2418 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Function prototypes can be in const pool + ;} + break; + + case 187: +#line 2420 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Asm blocks can be in the const pool + ;} + break; + + case 188: +#line 2422 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(5) - (5)].ConstVal).C == 0) error("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, yyvsp[-2].Linkage, yyvsp[-1].BoolVal, yyvsp[0].ConstVal.C->getType(), yyvsp[0].ConstVal.C); - ; - break;} -case 188: -#line 2426 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), (yyvsp[(3) - (5)].Linkage), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal).C->getType(), (yyvsp[(5) - (5)].ConstVal).C); + ;} + break; + + case 189: +#line 2426 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { CurGV = 0; - ; - break;} -case 189: -#line 2429 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[0].TypeVal.PAT->get(); - CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, yyvsp[-1].BoolVal, Ty, 0); - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 190: -#line 2433 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + ;} + break; + + case 190: +#line 2429 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get(); + CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::ExternalLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0); + delete (yyvsp[(5) - (5)].TypeVal).PAT; + ;} + break; + + case 191: +#line 2433 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { CurGV = 0; - ; - break;} -case 191: -#line 2436 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[0].TypeVal.PAT->get(); - CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::DLLImportLinkage, yyvsp[-1].BoolVal, Ty, 0); - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 192: -#line 2440 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + ;} + break; + + case 192: +#line 2436 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get(); + CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0); + delete (yyvsp[(5) - (5)].TypeVal).PAT; + ;} + break; + + case 193: +#line 2440 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { CurGV = 0; - ; - break;} -case 193: -#line 2443 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[0].TypeVal.PAT->get(); + ;} + break; + + case 194: +#line 2443 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get(); CurGV = - ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalWeakLinkage, yyvsp[-1].BoolVal, Ty, 0); - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 194: -#line 2448 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0); + delete (yyvsp[(5) - (5)].TypeVal).PAT; + ;} + break; + + case 195: +#line 2448 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { CurGV = 0; - ; - break;} -case 195: -#line 2451 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - ; - break;} -case 196: -#line 2453 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - ; - break;} -case 197: -#line 2455 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - ; - break;} -case 198: -#line 2460 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + ;} + break; + + case 196: +#line 2451 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 197: +#line 2453 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 198: +#line 2455 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + ;} + break; + + case 199: +#line 2460 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - std::string NewAsm(yyvsp[0].StrVal, EndStr); - free(yyvsp[0].StrVal); + char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); + std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); + free((yyvsp[(1) - (1)].StrVal)); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); - ; - break;} -case 199: -#line 2474 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Endianness = Module::BigEndian; ; - break;} -case 200: -#line 2475 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Endianness = Module::LittleEndian; ; - break;} -case 201: -#line 2479 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - CurModule.setEndianness(yyvsp[0].Endianness); - ; - break;} -case 202: -#line 2482 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[0].UInt64Val == 32) + ;} + break; + + case 200: +#line 2474 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Endianness) = Module::BigEndian; ;} + break; + + case 201: +#line 2475 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Endianness) = Module::LittleEndian; ;} + break; + + case 202: +#line 2479 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + CurModule.setEndianness((yyvsp[(3) - (3)].Endianness)); + ;} + break; + + case 203: +#line 2482 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(3) - (3)].UInt64Val) == 32) CurModule.setPointerSize(Module::Pointer32); - else if (yyvsp[0].UInt64Val == 64) + else if ((yyvsp[(3) - (3)].UInt64Val) == 64) CurModule.setPointerSize(Module::Pointer64); else - error("Invalid pointer size: '" + utostr(yyvsp[0].UInt64Val) + "'"); - ; - break;} -case 203: -#line 2490 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 204: -#line 2494 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 206: -#line 2505 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 207: -#line 2509 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 208: -#line 2513 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ ; - break;} -case 212: -#line 2526 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.StrVal = 0; ; - break;} -case 213: -#line 2530 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[-1].TypeVal.PAT->get() == Type::VoidTy) + error("Invalid pointer size: '" + utostr((yyvsp[(3) - (3)].UInt64Val)) + "'"); + ;} + break; + + case 204: +#line 2490 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); + ;} + break; + + case 205: +#line 2494 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); + ;} + break; + + case 207: +#line 2505 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); + ;} + break; + + case 208: +#line 2509 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); + free((yyvsp[(1) - (1)].StrVal)); + ;} + break; + + case 209: +#line 2513 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { ;} + break; + + case 213: +#line 2526 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 214: +#line 2530 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(1) - (2)].TypeVal).PAT->get() == Type::VoidTy) error("void typed arguments are invalid"); - yyval.ArgVal = new std::pair(yyvsp[-1].TypeVal, yyvsp[0].StrVal); - ; - break;} -case 214: -#line 2538 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; - yyval.ArgList->push_back(*yyvsp[0].ArgVal); - delete yyvsp[0].ArgVal; - ; - break;} -case 215: -#line 2543 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ArgList = new std::vector >(); - yyval.ArgList->push_back(*yyvsp[0].ArgVal); - delete yyvsp[0].ArgVal; - ; - break;} -case 216: -#line 2551 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ArgList = yyvsp[0].ArgList; ; - break;} -case 217: -#line 2552 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; + (yyval.ArgVal) = new std::pair((yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].StrVal)); + ;} + break; + + case 215: +#line 2538 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); + (yyval.ArgList)->push_back(*(yyvsp[(3) - (3)].ArgVal)); + delete (yyvsp[(3) - (3)].ArgVal); + ;} + break; + + case 216: +#line 2543 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ArgList) = new std::vector >(); + (yyval.ArgList)->push_back(*(yyvsp[(1) - (1)].ArgVal)); + delete (yyvsp[(1) - (1)].ArgVal); + ;} + break; + + case 217: +#line 2551 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); ;} + break; + + case 218: +#line 2552 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - yyval.ArgList->push_back(std::pair(VoidTI, 0)); - ; - break;} -case 218: -#line 2559 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ArgList = new std::vector >(); + (yyval.ArgList)->push_back(std::pair(VoidTI, 0)); + ;} + break; + + case 219: +#line 2559 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ArgList) = new std::vector >(); PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - yyval.ArgList->push_back(std::pair(VoidTI, 0)); - ; - break;} -case 219: -#line 2566 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ArgList = 0; ; - break;} -case 220: -#line 2570 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - UnEscapeLexed(yyvsp[-5].StrVal); - std::string FunctionName(yyvsp[-5].StrVal); - free(yyvsp[-5].StrVal); // Free strdup'd memory! + (yyval.ArgList)->push_back(std::pair(VoidTI, 0)); + ;} + break; + + case 220: +#line 2566 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ArgList) = 0; ;} + break; + + case 221: +#line 2570 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + UnEscapeLexed((yyvsp[(3) - (8)].StrVal)); + std::string FunctionName((yyvsp[(3) - (8)].StrVal)); + free((yyvsp[(3) - (8)].StrVal)); // Free strdup'd memory! - const Type* RetTy = yyvsp[-6].TypeVal.PAT->get(); + const Type* RetTy = (yyvsp[(2) - (8)].TypeVal).PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("LLVM functions cannot return aggregate types"); @@ -4295,9 +5313,9 @@ } else if (FunctionName == "llvm.va_copy") { ParamTyList.push_back(PointerType::get(Type::Int8Ty)); ParamTyList.push_back(PointerType::get(Type::Int8Ty)); - } else if (yyvsp[-3].ArgList) { // If there are arguments... + } else if ((yyvsp[(5) - (8)].ArgList)) { // If there are arguments... for (std::vector >::iterator - I = yyvsp[-3].ArgList->begin(), E = yyvsp[-3].ArgList->end(); I != E; ++I) { + I = (yyvsp[(5) - (8)].ArgList)->begin(), E = (yyvsp[(5) - (8)].ArgList)->end(); I != E; ++I) { const Type *Ty = I->first.PAT->get(); ParamTyList.push_back(Ty); } @@ -4310,7 +5328,7 @@ // Convert the CSRet calling convention into the corresponding parameter // attribute. FunctionType::ParamAttrsList ParamAttrs; - if (yyvsp[-7].UIntVal == OldCallingConv::CSRet) { + if ((yyvsp[(1) - (8)].UIntVal) == OldCallingConv::CSRet) { ParamAttrs.push_back(FunctionType::NoAttributeSet); // result ParamAttrs.push_back(FunctionType::StructRetAttribute); // first arg } @@ -4318,7 +5336,7 @@ const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete yyvsp[-6].TypeVal.PAT; + delete (yyvsp[(2) - (8)].TypeVal).PAT; ValID ID; if (!FunctionName.empty()) { @@ -4421,131 +5439,150 @@ // argument to another function. Fn->setLinkage(CurFun.Linkage); } - Fn->setCallingConv(upgradeCallingConv(yyvsp[-7].UIntVal)); - Fn->setAlignment(yyvsp[0].UIntVal); - if (yyvsp[-1].StrVal) { - Fn->setSection(yyvsp[-1].StrVal); - free(yyvsp[-1].StrVal); + Fn->setCallingConv(upgradeCallingConv((yyvsp[(1) - (8)].UIntVal))); + Fn->setAlignment((yyvsp[(8) - (8)].UIntVal)); + if ((yyvsp[(7) - (8)].StrVal)) { + Fn->setSection((yyvsp[(7) - (8)].StrVal)); + free((yyvsp[(7) - (8)].StrVal)); } // Add all of the arguments we parsed to the function... - if (yyvsp[-3].ArgList) { // Is null if empty... + if ((yyvsp[(5) - (8)].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert(yyvsp[-3].ArgList->back().first.PAT->get() == Type::VoidTy && - yyvsp[-3].ArgList->back().second == 0 && "Not a varargs marker"); - delete yyvsp[-3].ArgList->back().first.PAT; - yyvsp[-3].ArgList->pop_back(); // Delete the last entry + assert((yyvsp[(5) - (8)].ArgList)->back().first.PAT->get() == Type::VoidTy && + (yyvsp[(5) - (8)].ArgList)->back().second == 0 && "Not a varargs marker"); + delete (yyvsp[(5) - (8)].ArgList)->back().first.PAT; + (yyvsp[(5) - (8)].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); - std::vector >::iterator I = yyvsp[-3].ArgList->begin(); - std::vector >::iterator E = yyvsp[-3].ArgList->end(); + std::vector >::iterator I = (yyvsp[(5) - (8)].ArgList)->begin(); + std::vector >::iterator E = (yyvsp[(5) - (8)].ArgList)->end(); for ( ; I != E && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->first.PAT; // Delete the typeholder... setValueName(ArgIt, I->second); // Insert arg into symtab... InsertValue(ArgIt); } - delete yyvsp[-3].ArgList; // We're now done with the argument list + delete (yyvsp[(5) - (8)].ArgList); // We're now done with the argument list } - ; - break;} -case 223: -#line 2750 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.FunctionVal = CurFun.CurrentFunction; + ;} + break; + + case 224: +#line 2750 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.FunctionVal) = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - yyval.FunctionVal->setLinkage(yyvsp[-2].Linkage); - ; - break;} -case 226: -#line 2764 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; - ; - break;} -case 227: -#line 2769 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 228: -#line 2770 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 229: -#line 2771 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 230: -#line 2775 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ CurFun.isDeclare = true; ; - break;} -case 231: -#line 2776 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ CurFun.Linkage = yyvsp[0].Linkage; ; - break;} -case 232: -#line 2776 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.FunctionVal = CurFun.CurrentFunction; + (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (3)].Linkage)); + ;} + break; + + case 227: +#line 2764 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + ;} + break; + + case 228: +#line 2769 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 229: +#line 2770 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 230: +#line 2771 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 231: +#line 2775 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { CurFun.isDeclare = true; ;} + break; + + case 232: +#line 2776 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { CurFun.Linkage = (yyvsp[(3) - (3)].Linkage); ;} + break; + + case 233: +#line 2776 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); - ; - break;} -case 233: -#line 2788 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.BoolVal = false; ; - break;} -case 234: -#line 2789 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.BoolVal = true; ; - break;} -case 235: -#line 2794 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); ; - break;} -case 236: -#line 2795 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); ; - break;} -case 237: -#line 2796 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); ; - break;} -case 238: -#line 2797 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ; - break;} -case 239: -#line 2798 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ; - break;} -case 240: -#line 2799 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::createNull(); ; - break;} -case 241: -#line 2800 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::createUndef(); ; - break;} -case 242: -#line 2801 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::createZeroInit(); ; - break;} -case 243: -#line 2802 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Nonempty unsized packed vector - const Type *ETy = (*yyvsp[-1].ConstVector)[0].C->getType(); - int NumElements = yyvsp[-1].ConstVector->size(); + ;} + break; + + case 234: +#line 2788 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 235: +#line 2789 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 236: +#line 2794 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); ;} + break; + + case 237: +#line 2795 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); ;} + break; + + case 238: +#line 2796 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); ;} + break; + + case 239: +#line 2797 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ;} + break; + + case 240: +#line 2798 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ;} + break; + + case 241: +#line 2799 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::createNull(); ;} + break; + + case 242: +#line 2800 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::createUndef(); ;} + break; + + case 243: +#line 2801 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::createZeroInit(); ;} + break; + + case 244: +#line 2802 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Nonempty unsized packed vector + const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0].C->getType(); + int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( HandleUpRefs(PackedType::get(ETy, NumElements))); // Verify all elements are correct type! std::vector Elems; - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - Constant *C = (*yyvsp[-1].ConstVector)[i].C; + for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { + Constant *C = (*(yyvsp[(2) - (3)].ConstVector))[i].C; const Type *CTy = C->getType(); if (ETy != CTy) error("Element #" + utostr(i) + " is not of type '" + @@ -4553,193 +5590,211 @@ CTy->getDescription() + "'"); Elems.push_back(C); } - yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, Elems)); - delete PTy; delete yyvsp[-1].ConstVector; - ; - break;} -case 244: -#line 2823 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal.C); - ; - break;} -case 245: -#line 2826 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); - std::string AsmStr = std::string(yyvsp[-2].StrVal, End); - End = UnEscapeLexed(yyvsp[0].StrVal, true); - std::string Constraints = std::string(yyvsp[0].StrVal, End); - yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); - free(yyvsp[-2].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 246: -#line 2841 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::create(yyvsp[0].SIntVal); ; - break;} -case 247: -#line 2842 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValIDVal = ValID::create(yyvsp[0].StrVal); ; - break;} -case 250: -#line 2855 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); - yyval.ValueVal.S = yyvsp[-1].TypeVal.S; - yyval.ValueVal.V = getVal(Ty, yyvsp[0].ValIDVal); - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 251: -#line 2864 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; - ; - break;} -case 252: -#line 2867 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Do not allow functions with 0 basic blocks - yyval.FunctionVal = yyvsp[-1].FunctionVal; - ; - break;} -case 253: -#line 2876 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); - InsertValue(yyvsp[0].TermInstVal); - yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); - InsertValue(yyvsp[-2].BasicBlockVal); - yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; - ; - break;} -case 254: -#line 2886 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (yyvsp[0].InstVal.I) - yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal.I); - yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; - ; - break;} -case 255: -#line 2891 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.BasicBlockVal = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); + (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, Elems)); + delete PTy; delete (yyvsp[(2) - (3)].ConstVector); + ;} + break; + + case 245: +#line 2823 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal).C); + ;} + break; + + case 246: +#line 2826 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); + std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); + End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); + std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); + (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); + free((yyvsp[(3) - (5)].StrVal)); + free((yyvsp[(5) - (5)].StrVal)); + ;} + break; + + case 247: +#line 2841 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SIntVal)); ;} + break; + + case 248: +#line 2842 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].StrVal)); ;} + break; + + case 251: +#line 2855 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(1) - (2)].TypeVal).PAT->get(); + (yyval.ValueVal).S = (yyvsp[(1) - (2)].TypeVal).S; + (yyval.ValueVal).V = getVal(Ty, (yyvsp[(2) - (2)].ValIDVal)); + delete (yyvsp[(1) - (2)].TypeVal).PAT; + ;} + break; + + case 252: +#line 2864 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + ;} + break; + + case 253: +#line 2867 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Do not allow functions with 0 basic blocks + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + ;} + break; + + case 254: +#line 2876 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); + InsertValue((yyvsp[(3) - (3)].TermInstVal)); + (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); + InsertValue((yyvsp[(1) - (3)].BasicBlockVal)); + (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); + ;} + break; + + case 255: +#line 2886 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if ((yyvsp[(2) - (2)].InstVal).I) + (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal).I); + (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); + ;} + break; + + case 256: +#line 2891 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); // Make sure to move the basic block to the correct location in the // function, instead of leaving it inserted wherever it was first // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); - ; - break;} -case 256: -#line 2900 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.BasicBlockVal = CurBB = getBBVal(ValID::create(yyvsp[0].StrVal), true); + BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); + ;} + break; + + case 257: +#line 2900 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[(1) - (1)].StrVal)), true); // Make sure to move the basic block to the correct location in the // function, instead of leaving it inserted wherever it was first // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); - ; - break;} -case 259: -#line 2914 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Return with a result... - yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal.V); - ; - break;} -case 260: -#line 2917 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Return with no result... - yyval.TermInstVal = new ReturnInst(); - ; - break;} -case 261: -#line 2920 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Unconditional Branch... - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); - yyval.TermInstVal = new BranchInst(tmpBB); - ; - break;} -case 262: -#line 2924 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); - BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); - Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); - yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ; - break;} -case 263: -#line 2930 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - Value* tmpVal = getVal(yyvsp[-7].PrimType.T, yyvsp[-6].ValIDVal); - BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); - yyval.TermInstVal = S; - std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), - E = yyvsp[-1].JumpTable->end(); + BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); + ;} + break; + + case 260: +#line 2914 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Return with a result... + (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal).V); + ;} + break; + + case 261: +#line 2917 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Return with no result... + (yyval.TermInstVal) = new ReturnInst(); + ;} + break; + + case 262: +#line 2920 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Unconditional Branch... + BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); + (yyval.TermInstVal) = new BranchInst(tmpBB); + ;} + break; + + case 263: +#line 2924 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); + Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); + (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ;} + break; + + case 264: +#line 2930 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType).T, (yyvsp[(3) - (9)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); + (yyval.TermInstVal) = S; + std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), + E = (yyvsp[(8) - (9)].JumpTable)->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else error("Switch case is constant, but not a simple integer"); } - delete yyvsp[-1].JumpTable; - ; - break;} -case 264: -#line 2945 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - Value* tmpVal = getVal(yyvsp[-6].PrimType.T, yyvsp[-5].ValIDVal); - BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); + delete (yyvsp[(8) - (9)].JumpTable); + ;} + break; + + case 265: +#line 2945 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType).T, (yyvsp[(3) - (8)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); - yyval.TermInstVal = S; - ; - break;} -case 265: -#line 2952 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + (yyval.TermInstVal) = S; + ;} + break; + + case 266: +#line 2952 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast(yyvsp[-10].TypeVal.PAT->get())) || + if (!(PFTy = dyn_cast((yyvsp[(3) - (13)].TypeVal).PAT->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - if (yyvsp[-7].ValueList) { - for (std::vector::iterator I = yyvsp[-7].ValueList->begin(), E = yyvsp[-7].ValueList->end(); + if ((yyvsp[(6) - (13)].ValueList)) { + for (std::vector::iterator I = (yyvsp[(6) - (13)].ValueList)->begin(), E = (yyvsp[(6) - (13)].ValueList)->end(); I != E; ++I) ParamTypes.push_back((*I).V->getType()); } FunctionType::ParamAttrsList ParamAttrs; - if (yyvsp[-11].UIntVal == OldCallingConv::CSRet) { + if ((yyvsp[(2) - (13)].UIntVal) == OldCallingConv::CSRet) { ParamAttrs.push_back(FunctionType::NoAttributeSet); ParamAttrs.push_back(FunctionType::StructRetAttribute); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - Ty = FunctionType::get(yyvsp[-10].TypeVal.PAT->get(), ParamTypes, isVarArg, ParamAttrs); + Ty = FunctionType::get((yyvsp[(3) - (13)].TypeVal).PAT->get(), ParamTypes, isVarArg, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, yyvsp[-9].ValIDVal); // Get the function we're calling... - BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); - BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); + Value *V = getVal(PFTy, (yyvsp[(4) - (13)].ValIDVal)); // Get the function we're calling... + BasicBlock *Normal = getBBVal((yyvsp[(10) - (13)].ValIDVal)); + BasicBlock *Except = getBBVal((yyvsp[(13) - (13)].ValIDVal)); // Create the call node... - if (!yyvsp[-7].ValueList) { // Has no arguments? - yyval.TermInstVal = new InvokeInst(V, Normal, Except, std::vector()); + if (!(yyvsp[(6) - (13)].ValueList)) { // Has no arguments? + (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, std::vector()); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified // correctly! // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = yyvsp[-7].ValueList->begin(), ArgE = yyvsp[-7].ValueList->end(); + std::vector::iterator ArgI = (yyvsp[(6) - (13)].ValueList)->begin(), ArgE = (yyvsp[(6) - (13)].ValueList)->end(); std::vector Args; for (; ArgI != ArgE && I != E; ++ArgI, ++I) { @@ -4752,59 +5807,64 @@ if (I != E || (ArgI != ArgE && !Ty->isVarArg())) error("Invalid number of parameters detected"); - yyval.TermInstVal = new InvokeInst(V, Normal, Except, Args); + (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, Args); } - cast(yyval.TermInstVal)->setCallingConv(upgradeCallingConv(yyvsp[-11].UIntVal)); - delete yyvsp[-10].TypeVal.PAT; - delete yyvsp[-7].ValueList; - ; - break;} -case 266: -#line 3007 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TermInstVal = new UnwindInst(); - ; - break;} -case 267: -#line 3010 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.TermInstVal = new UnreachableInst(); - ; - break;} -case 268: -#line 3016 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.JumpTable = yyvsp[-5].JumpTable; - Constant *V = cast(getExistingValue(yyvsp[-4].PrimType.T, yyvsp[-3].ValIDVal)); + cast((yyval.TermInstVal))->setCallingConv(upgradeCallingConv((yyvsp[(2) - (13)].UIntVal))); + delete (yyvsp[(3) - (13)].TypeVal).PAT; + delete (yyvsp[(6) - (13)].ValueList); + ;} + break; + + case 267: +#line 3007 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TermInstVal) = new UnwindInst(); + ;} + break; + + case 268: +#line 3010 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.TermInstVal) = new UnreachableInst(); + ;} + break; + + case 269: +#line 3016 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); + Constant *V = cast(getExistingValue((yyvsp[(2) - (6)].PrimType).T, (yyvsp[(3) - (6)].ValIDVal))); if (V == 0) error("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); - yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); - ; - break;} -case 269: -#line 3026 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.JumpTable = new std::vector >(); - Constant *V = cast(getExistingValue(yyvsp[-4].PrimType.T, yyvsp[-3].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 270: +#line 3026 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.JumpTable) = new std::vector >(); + Constant *V = cast(getExistingValue((yyvsp[(1) - (5)].PrimType).T, (yyvsp[(2) - (5)].ValIDVal))); if (V == 0) error("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); - yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); - ; - break;} -case 270: -#line 3039 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 271: +#line 3039 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { bool omit = false; - if (yyvsp[-1].StrVal) - if (BitCastInst *BCI = dyn_cast(yyvsp[0].InstVal.I)) + if ((yyvsp[(1) - (2)].StrVal)) + if (BitCastInst *BCI = dyn_cast((yyvsp[(2) - (2)].InstVal).I)) if (BCI->getSrcTy() == BCI->getDestTy() && - BCI->getOperand(0)->getName() == yyvsp[-1].StrVal) + BCI->getOperand(0)->getName() == (yyvsp[(1) - (2)].StrVal)) // This is a useless bit cast causing a name redefinition. It is // a bit cast from a type to the same type of an operand with the // same name as the name we would give this instruction. Since this @@ -4819,225 +5879,243 @@ // The bitcast is clearly useless so we omit it. omit = true; if (omit) { - yyval.InstVal.I = 0; - yyval.InstVal.S = Signless; + (yyval.InstVal).I = 0; + (yyval.InstVal).S = Signless; } else { - setValueName(yyvsp[0].InstVal.I, yyvsp[-1].StrVal); - InsertValue(yyvsp[0].InstVal.I); - yyval.InstVal = yyvsp[0].InstVal; - } - ; - break;} -case 271: -#line 3068 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Used for PHI nodes - yyval.PHIList.P = new std::list >(); - yyval.PHIList.S = yyvsp[-5].TypeVal.S; - Value* tmpVal = getVal(yyvsp[-5].TypeVal.PAT->get(), yyvsp[-3].ValIDVal); - BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); - yyval.PHIList.P->push_back(std::make_pair(tmpVal, tmpBB)); - delete yyvsp[-5].TypeVal.PAT; - ; - break;} -case 272: -#line 3076 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.PHIList = yyvsp[-6].PHIList; - Value* tmpVal = getVal(yyvsp[-6].PHIList.P->front().first->getType(), yyvsp[-3].ValIDVal); - BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); - yyvsp[-6].PHIList.P->push_back(std::make_pair(tmpVal, tmpBB)); - ; - break;} -case 273: -#line 3084 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ // Used for call statements, and memory insts... - yyval.ValueList = new std::vector(); - yyval.ValueList->push_back(yyvsp[0].ValueVal); - ; - break;} -case 274: -#line 3088 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.ValueList = yyvsp[-2].ValueList; - yyvsp[-2].ValueList->push_back(yyvsp[0].ValueVal); - ; - break;} -case 276: -#line 3096 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValueList = 0; ; - break;} -case 277: -#line 3100 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.BoolVal = true; - ; - break;} -case 278: -#line 3103 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.BoolVal = false; - ; - break;} -case 279: -#line 3109 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* Ty = yyvsp[-3].TypeVal.PAT->get(); + setValueName((yyvsp[(2) - (2)].InstVal).I, (yyvsp[(1) - (2)].StrVal)); + InsertValue((yyvsp[(2) - (2)].InstVal).I); + (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); + } + ;} + break; + + case 272: +#line 3068 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Used for PHI nodes + (yyval.PHIList).P = new std::list >(); + (yyval.PHIList).S = (yyvsp[(1) - (6)].TypeVal).S; + Value* tmpVal = getVal((yyvsp[(1) - (6)].TypeVal).PAT->get(), (yyvsp[(3) - (6)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); + (yyval.PHIList).P->push_back(std::make_pair(tmpVal, tmpBB)); + delete (yyvsp[(1) - (6)].TypeVal).PAT; + ;} + break; + + case 273: +#line 3076 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); + Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList).P->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); + (yyvsp[(1) - (7)].PHIList).P->push_back(std::make_pair(tmpVal, tmpBB)); + ;} + break; + + case 274: +#line 3084 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Used for call statements, and memory insts... + (yyval.ValueList) = new std::vector(); + (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); + ;} + break; + + case 275: +#line 3088 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); + (yyvsp[(1) - (3)].ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); + ;} + break; + + case 277: +#line 3096 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValueList) = 0; ;} + break; + + case 278: +#line 3100 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.BoolVal) = true; + ;} + break; + + case 279: +#line 3103 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.BoolVal) = false; + ;} + break; + + case 280: +#line 3109 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* Ty = (yyvsp[(2) - (5)].TypeVal).PAT->get(); if (!Ty->isInteger() && !Ty->isFloatingPoint() && !isa(Ty)) error("Arithmetic operator requires integer, FP, or packed operands"); if (isa(Ty) && - (yyvsp[-4].BinaryOpVal == URemOp || yyvsp[-4].BinaryOpVal == SRemOp || yyvsp[-4].BinaryOpVal == FRemOp || yyvsp[-4].BinaryOpVal == RemOp)) + ((yyvsp[(1) - (5)].BinaryOpVal) == URemOp || (yyvsp[(1) - (5)].BinaryOpVal) == SRemOp || (yyvsp[(1) - (5)].BinaryOpVal) == FRemOp || (yyvsp[(1) - (5)].BinaryOpVal) == RemOp)) error("Remainder not supported on packed types"); // Upgrade the opcode from obsolete versions before we do anything with it. - Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-4].BinaryOpVal, Ty, yyvsp[-3].TypeVal.S); - Value* val1 = getVal(Ty, yyvsp[-2].ValIDVal); - Value* val2 = getVal(Ty, yyvsp[0].ValIDVal); - yyval.InstVal.I = BinaryOperator::create(Opcode, val1, val2); - if (yyval.InstVal.I == 0) + Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (5)].BinaryOpVal), Ty, (yyvsp[(2) - (5)].TypeVal).S); + Value* val1 = getVal(Ty, (yyvsp[(3) - (5)].ValIDVal)); + Value* val2 = getVal(Ty, (yyvsp[(5) - (5)].ValIDVal)); + (yyval.InstVal).I = BinaryOperator::create(Opcode, val1, val2); + if ((yyval.InstVal).I == 0) error("binary operator returned null"); - yyval.InstVal.S = yyvsp[-3].TypeVal.S; - delete yyvsp[-3].TypeVal.PAT; - ; - break;} -case 280: -#line 3126 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-3].TypeVal.PAT->get(); + (yyval.InstVal).S = (yyvsp[(2) - (5)].TypeVal).S; + delete (yyvsp[(2) - (5)].TypeVal).PAT; + ;} + break; + + case 281: +#line 3126 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(2) - (5)].TypeVal).PAT->get(); if (!Ty->isInteger()) { if (!isa(Ty) || !cast(Ty)->getElementType()->isInteger()) error("Logical operator requires integral operands"); } - Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-4].BinaryOpVal, Ty, yyvsp[-3].TypeVal.S); - Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); - Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); - yyval.InstVal.I = BinaryOperator::create(Opcode, tmpVal1, tmpVal2); - if (yyval.InstVal.I == 0) + Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (5)].BinaryOpVal), Ty, (yyvsp[(2) - (5)].TypeVal).S); + Value* tmpVal1 = getVal(Ty, (yyvsp[(3) - (5)].ValIDVal)); + Value* tmpVal2 = getVal(Ty, (yyvsp[(5) - (5)].ValIDVal)); + (yyval.InstVal).I = BinaryOperator::create(Opcode, tmpVal1, tmpVal2); + if ((yyval.InstVal).I == 0) error("binary operator returned null"); - yyval.InstVal.S = yyvsp[-3].TypeVal.S; - delete yyvsp[-3].TypeVal.PAT; - ; - break;} -case 281: -#line 3142 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* Ty = yyvsp[-3].TypeVal.PAT->get(); + (yyval.InstVal).S = (yyvsp[(2) - (5)].TypeVal).S; + delete (yyvsp[(2) - (5)].TypeVal).PAT; + ;} + break; + + case 282: +#line 3142 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* Ty = (yyvsp[(2) - (5)].TypeVal).PAT->get(); if(isa(Ty)) error("PackedTypes currently not supported in setcc instructions"); unsigned short pred; - Instruction::OtherOps Opcode = getCompareOp(yyvsp[-4].BinaryOpVal, pred, Ty, yyvsp[-3].TypeVal.S); - Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); - Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); - yyval.InstVal.I = CmpInst::create(Opcode, pred, tmpVal1, tmpVal2); - if (yyval.InstVal.I == 0) + Instruction::OtherOps Opcode = getCompareOp((yyvsp[(1) - (5)].BinaryOpVal), pred, Ty, (yyvsp[(2) - (5)].TypeVal).S); + Value* tmpVal1 = getVal(Ty, (yyvsp[(3) - (5)].ValIDVal)); + Value* tmpVal2 = getVal(Ty, (yyvsp[(5) - (5)].ValIDVal)); + (yyval.InstVal).I = CmpInst::create(Opcode, pred, tmpVal1, tmpVal2); + if ((yyval.InstVal).I == 0) error("binary operator returned null"); - yyval.InstVal.S = Unsigned; - delete yyvsp[-3].TypeVal.PAT; - ; - break;} -case 282: -#line 3156 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-3].TypeVal.PAT->get(); + (yyval.InstVal).S = Unsigned; + delete (yyvsp[(2) - (5)].TypeVal).PAT; + ;} + break; + + case 283: +#line 3156 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(3) - (6)].TypeVal).PAT->get(); if (isa(Ty)) error("PackedTypes currently not supported in icmp instructions"); else if (!Ty->isInteger() && !isa(Ty)) error("icmp requires integer or pointer typed operands"); - Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); - Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); - yyval.InstVal.I = new ICmpInst(yyvsp[-4].IPred, tmpVal1, tmpVal2); - yyval.InstVal.S = Unsigned; - delete yyvsp[-3].TypeVal.PAT; - ; - break;} -case 283: -#line 3168 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-3].TypeVal.PAT->get(); + Value* tmpVal1 = getVal(Ty, (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(Ty, (yyvsp[(6) - (6)].ValIDVal)); + (yyval.InstVal).I = new ICmpInst((yyvsp[(2) - (6)].IPred), tmpVal1, tmpVal2); + (yyval.InstVal).S = Unsigned; + delete (yyvsp[(3) - (6)].TypeVal).PAT; + ;} + break; + + case 284: +#line 3168 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(3) - (6)].TypeVal).PAT->get(); if (isa(Ty)) error("PackedTypes currently not supported in fcmp instructions"); else if (!Ty->isFloatingPoint()) error("fcmp instruction requires floating point operands"); - Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); - Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); - yyval.InstVal.I = new FCmpInst(yyvsp[-4].FPred, tmpVal1, tmpVal2); - yyval.InstVal.S = Unsigned; - delete yyvsp[-3].TypeVal.PAT; - ; - break;} -case 284: -#line 3180 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + Value* tmpVal1 = getVal(Ty, (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(Ty, (yyvsp[(6) - (6)].ValIDVal)); + (yyval.InstVal).I = new FCmpInst((yyvsp[(2) - (6)].FPred), tmpVal1, tmpVal2); + (yyval.InstVal).S = Unsigned; + delete (yyvsp[(3) - (6)].TypeVal).PAT; + ;} + break; + + case 285: +#line 3180 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { warning("Use of obsolete 'not' instruction: Replacing with 'xor"); - const Type *Ty = yyvsp[0].ValueVal.V->getType(); + const Type *Ty = (yyvsp[(2) - (2)].ValueVal).V->getType(); Value *Ones = ConstantInt::getAllOnesValue(Ty); if (Ones == 0) error("Expected integral type for not instruction"); - yyval.InstVal.I = BinaryOperator::create(Instruction::Xor, yyvsp[0].ValueVal.V, Ones); - if (yyval.InstVal.I == 0) + (yyval.InstVal).I = BinaryOperator::create(Instruction::Xor, (yyvsp[(2) - (2)].ValueVal).V, Ones); + if ((yyval.InstVal).I == 0) error("Could not create a xor instruction"); - yyval.InstVal.S = yyvsp[0].ValueVal.S - ; - break;} -case 285: -#line 3191 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!yyvsp[0].ValueVal.V->getType()->isInteger() || - cast(yyvsp[0].ValueVal.V->getType())->getBitWidth() != 8) + (yyval.InstVal).S = (yyvsp[(2) - (2)].ValueVal).S + ;} + break; + + case 286: +#line 3191 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[(4) - (4)].ValueVal).V->getType()->isInteger() || + cast((yyvsp[(4) - (4)].ValueVal).V->getType())->getBitWidth() != 8) error("Shift amount must be int8"); - const Type* Ty = yyvsp[-2].ValueVal.V->getType(); + const Type* Ty = (yyvsp[(2) - (4)].ValueVal).V->getType(); if (!Ty->isInteger()) error("Shift constant expression requires integer operand"); Value* ShiftAmt = 0; if (cast(Ty)->getBitWidth() > Type::Int8Ty->getBitWidth()) - if (Constant *C = dyn_cast(yyvsp[0].ValueVal.V)) + if (Constant *C = dyn_cast((yyvsp[(4) - (4)].ValueVal).V)) ShiftAmt = ConstantExpr::getZExt(C, Ty); else - ShiftAmt = new ZExtInst(yyvsp[0].ValueVal.V, Ty, makeNameUnique("shift"), CurBB); + ShiftAmt = new ZExtInst((yyvsp[(4) - (4)].ValueVal).V, Ty, makeNameUnique("shift"), CurBB); else - ShiftAmt = yyvsp[0].ValueVal.V; - yyval.InstVal.I = BinaryOperator::create(getBinaryOp(yyvsp[-3].BinaryOpVal, Ty, yyvsp[-2].ValueVal.S), yyvsp[-2].ValueVal.V, ShiftAmt); - yyval.InstVal.S = yyvsp[-2].ValueVal.S; - ; - break;} -case 286: -#line 3209 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *DstTy = yyvsp[0].TypeVal.PAT->get(); + ShiftAmt = (yyvsp[(4) - (4)].ValueVal).V; + (yyval.InstVal).I = BinaryOperator::create(getBinaryOp((yyvsp[(1) - (4)].BinaryOpVal), Ty, (yyvsp[(2) - (4)].ValueVal).S), (yyvsp[(2) - (4)].ValueVal).V, ShiftAmt); + (yyval.InstVal).S = (yyvsp[(2) - (4)].ValueVal).S; + ;} + break; + + case 287: +#line 3209 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get(); if (!DstTy->isFirstClassType()) error("cast instruction to a non-primitive type: '" + DstTy->getDescription() + "'"); - yyval.InstVal.I = cast(getCast(yyvsp[-3].CastOpVal, yyvsp[-2].ValueVal.V, yyvsp[-2].ValueVal.S, DstTy, yyvsp[0].TypeVal.S, true)); - yyval.InstVal.S = yyvsp[0].TypeVal.S; - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 287: -#line 3218 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!yyvsp[-4].ValueVal.V->getType()->isInteger() || - cast(yyvsp[-4].ValueVal.V->getType())->getBitWidth() != 1) + (yyval.InstVal).I = cast(getCast((yyvsp[(1) - (4)].CastOpVal), (yyvsp[(2) - (4)].ValueVal).V, (yyvsp[(2) - (4)].ValueVal).S, DstTy, (yyvsp[(4) - (4)].TypeVal).S, true)); + (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; + delete (yyvsp[(4) - (4)].TypeVal).PAT; + ;} + break; + + case 288: +#line 3218 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!(yyvsp[(2) - (6)].ValueVal).V->getType()->isInteger() || + cast((yyvsp[(2) - (6)].ValueVal).V->getType())->getBitWidth() != 1) error("select condition must be bool"); - if (yyvsp[-2].ValueVal.V->getType() != yyvsp[0].ValueVal.V->getType()) + if ((yyvsp[(4) - (6)].ValueVal).V->getType() != (yyvsp[(6) - (6)].ValueVal).V->getType()) error("select value types should match"); - yyval.InstVal.I = new SelectInst(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); - yyval.InstVal.S = yyvsp[-4].ValueVal.S; - ; - break;} -case 288: -#line 3227 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[0].TypeVal.PAT->get(); + (yyval.InstVal).I = new SelectInst((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V); + (yyval.InstVal).S = (yyvsp[(2) - (6)].ValueVal).S; + ;} + break; + + case 289: +#line 3227 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(4) - (4)].TypeVal).PAT->get(); NewVarArgs = true; - yyval.InstVal.I = new VAArgInst(yyvsp[-2].ValueVal.V, Ty); - yyval.InstVal.S = yyvsp[0].TypeVal.S; - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 289: -#line 3234 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* ArgTy = yyvsp[-2].ValueVal.V->getType(); - const Type* DstTy = yyvsp[0].TypeVal.PAT->get(); + (yyval.InstVal).I = new VAArgInst((yyvsp[(2) - (4)].ValueVal).V, Ty); + (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; + delete (yyvsp[(4) - (4)].TypeVal).PAT; + ;} + break; + + case 290: +#line 3234 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* ArgTy = (yyvsp[(2) - (4)].ValueVal).V->getType(); + const Type* DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get(); ObsoleteVarArgs = true; Function* NF = cast(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -5049,19 +6127,20 @@ //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal.V); + CallInst* bar = new CallInst(NF, (yyvsp[(2) - (4)].ValueVal).V); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - yyval.InstVal.I = new VAArgInst(foo, DstTy); - yyval.InstVal.S = yyvsp[0].TypeVal.S; - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 290: -#line 3255 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* ArgTy = yyvsp[-2].ValueVal.V->getType(); - const Type* DstTy = yyvsp[0].TypeVal.PAT->get(); + (yyval.InstVal).I = new VAArgInst(foo, DstTy); + (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; + delete (yyvsp[(4) - (4)].TypeVal).PAT; + ;} + break; + + case 291: +#line 3255 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* ArgTy = (yyvsp[(2) - (4)].ValueVal).V->getType(); + const Type* DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get(); ObsoleteVarArgs = true; Function* NF = cast(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -5074,88 +6153,93 @@ //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal.V); + CallInst* bar = new CallInst(NF, (yyvsp[(2) - (4)].ValueVal).V); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); Instruction* tmp = new VAArgInst(foo, DstTy); CurBB->getInstList().push_back(tmp); - yyval.InstVal.I = new LoadInst(foo); - yyval.InstVal.S = yyvsp[0].TypeVal.S; - delete yyvsp[0].TypeVal.PAT; - ; - break;} -case 291: -#line 3279 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V)) + (yyval.InstVal).I = new LoadInst(foo); + (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; + delete (yyvsp[(4) - (4)].TypeVal).PAT; + ;} + break; + + case 292: +#line 3279 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal).V, (yyvsp[(4) - (4)].ValueVal).V)) error("Invalid extractelement operands"); - yyval.InstVal.I = new ExtractElementInst(yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); - yyval.InstVal.S = yyvsp[-2].ValueVal.S; - ; - break;} -case 292: -#line 3285 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V)) + (yyval.InstVal).I = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal).V, (yyvsp[(4) - (4)].ValueVal).V); + (yyval.InstVal).S = (yyvsp[(2) - (4)].ValueVal).S; + ;} + break; + + case 293: +#line 3285 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V)) error("Invalid insertelement operands"); - yyval.InstVal.I = new InsertElementInst(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); - yyval.InstVal.S = yyvsp[-4].ValueVal.S; - ; - break;} -case 293: -#line 3291 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V)) + (yyval.InstVal).I = new InsertElementInst((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V); + (yyval.InstVal).S = (yyvsp[(2) - (6)].ValueVal).S; + ;} + break; + + case 294: +#line 3291 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V)) error("Invalid shufflevector operands"); - yyval.InstVal.I = new ShuffleVectorInst(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); - yyval.InstVal.S = yyvsp[-4].ValueVal.S; - ; - break;} -case 294: -#line 3297 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[0].PHIList.P->front().first->getType(); + (yyval.InstVal).I = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V); + (yyval.InstVal).S = (yyvsp[(2) - (6)].ValueVal).S; + ;} + break; + + case 295: +#line 3297 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(2) - (2)].PHIList).P->front().first->getType(); if (!Ty->isFirstClassType()) error("PHI node operands must be of first class type"); PHINode *PHI = new PHINode(Ty); - PHI->reserveOperandSpace(yyvsp[0].PHIList.P->size()); - while (yyvsp[0].PHIList.P->begin() != yyvsp[0].PHIList.P->end()) { - if (yyvsp[0].PHIList.P->front().first->getType() != Ty) + PHI->reserveOperandSpace((yyvsp[(2) - (2)].PHIList).P->size()); + while ((yyvsp[(2) - (2)].PHIList).P->begin() != (yyvsp[(2) - (2)].PHIList).P->end()) { + if ((yyvsp[(2) - (2)].PHIList).P->front().first->getType() != Ty) error("All elements of a PHI node must be of the same type"); - PHI->addIncoming(yyvsp[0].PHIList.P->front().first, yyvsp[0].PHIList.P->front().second); - yyvsp[0].PHIList.P->pop_front(); + PHI->addIncoming((yyvsp[(2) - (2)].PHIList).P->front().first, (yyvsp[(2) - (2)].PHIList).P->front().second); + (yyvsp[(2) - (2)].PHIList).P->pop_front(); } - yyval.InstVal.I = PHI; - yyval.InstVal.S = yyvsp[0].PHIList.S; - delete yyvsp[0].PHIList.P; // Free the list... - ; - break;} -case 295: -#line 3313 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ + (yyval.InstVal).I = PHI; + (yyval.InstVal).S = (yyvsp[(2) - (2)].PHIList).S; + delete (yyvsp[(2) - (2)].PHIList).P; // Free the list... + ;} + break; + + case 296: +#line 3313 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { // Handle the short call syntax const PointerType *PFTy; const FunctionType *FTy; - if (!(PFTy = dyn_cast(yyvsp[-4].TypeVal.PAT->get())) || + if (!(PFTy = dyn_cast((yyvsp[(3) - (7)].TypeVal).PAT->get())) || !(FTy = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - if (yyvsp[-1].ValueList) { - for (std::vector::iterator I = yyvsp[-1].ValueList->begin(), E = yyvsp[-1].ValueList->end(); + if ((yyvsp[(6) - (7)].ValueList)) { + for (std::vector::iterator I = (yyvsp[(6) - (7)].ValueList)->begin(), E = (yyvsp[(6) - (7)].ValueList)->end(); I != E; ++I) ParamTypes.push_back((*I).V->getType()); } FunctionType::ParamAttrsList ParamAttrs; - if (yyvsp[-5].UIntVal == OldCallingConv::CSRet) { + if ((yyvsp[(2) - (7)].UIntVal) == OldCallingConv::CSRet) { ParamAttrs.push_back(FunctionType::NoAttributeSet); ParamAttrs.push_back(FunctionType::StructRetAttribute); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - const Type *RetTy = yyvsp[-4].TypeVal.PAT->get(); + const Type *RetTy = (yyvsp[(3) - (7)].TypeVal).PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("Functions cannot return aggregate types"); @@ -5165,21 +6249,21 @@ // First upgrade any intrinsic calls. std::vector Args; - if (yyvsp[-1].ValueList) - for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i < e; ++i) - Args.push_back((*yyvsp[-1].ValueList)[i].V); - Instruction *Inst = upgradeIntrinsicCall(FTy, yyvsp[-3].ValIDVal, Args); + if ((yyvsp[(6) - (7)].ValueList)) + for (unsigned i = 0, e = (yyvsp[(6) - (7)].ValueList)->size(); i < e; ++i) + Args.push_back((*(yyvsp[(6) - (7)].ValueList))[i].V); + Instruction *Inst = upgradeIntrinsicCall(FTy, (yyvsp[(4) - (7)].ValIDVal), Args); // If we got an upgraded intrinsic if (Inst) { - yyval.InstVal.I = Inst; - yyval.InstVal.S = Signless; + (yyval.InstVal).I = Inst; + (yyval.InstVal).S = Signless; } else { // Get the function we're calling - Value *V = getVal(PFTy, yyvsp[-3].ValIDVal); + Value *V = getVal(PFTy, (yyvsp[(4) - (7)].ValIDVal)); // Check the argument values match - if (!yyvsp[-1].ValueList) { // Has no arguments? + if (!(yyvsp[(6) - (7)].ValueList)) { // Has no arguments? // Make sure no arguments is a good thing! if (FTy->getNumParams() != 0) error("No arguments passed to a function that expects arguments"); @@ -5189,7 +6273,7 @@ // FunctionType::param_iterator I = FTy->param_begin(); FunctionType::param_iterator E = FTy->param_end(); - std::vector::iterator ArgI = yyvsp[-1].ValueList->begin(), ArgE = yyvsp[-1].ValueList->end(); + std::vector::iterator ArgI = (yyvsp[(6) - (7)].ValueList)->begin(), ArgE = (yyvsp[(6) - (7)].ValueList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI).V->getType() != *I) @@ -5202,112 +6286,124 @@ // Create the call instruction CallInst *CI = new CallInst(V, Args); - CI->setTailCall(yyvsp[-6].BoolVal); - CI->setCallingConv(upgradeCallingConv(yyvsp[-5].UIntVal)); - yyval.InstVal.I = CI; - yyval.InstVal.S = yyvsp[-4].TypeVal.S; - } - delete yyvsp[-4].TypeVal.PAT; - delete yyvsp[-1].ValueList; - ; - break;} -case 296: -#line 3391 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - yyval.InstVal = yyvsp[0].InstVal; - ; - break;} -case 297: -#line 3399 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValueList = yyvsp[0].ValueList; ; - break;} -case 298: -#line 3400 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.ValueList = new std::vector(); ; - break;} -case 299: -#line 3404 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.BoolVal = true; ; - break;} -case 300: -#line 3405 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ yyval.BoolVal = false; ; - break;} -case 301: -#line 3409 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); - yyval.InstVal.S = yyvsp[-1].TypeVal.S; - yyval.InstVal.I = new MallocInst(Ty, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 302: -#line 3415 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-4].TypeVal.PAT->get(); - yyval.InstVal.S = yyvsp[-4].TypeVal.S; - yyval.InstVal.I = new MallocInst(Ty, getVal(yyvsp[-2].PrimType.T, yyvsp[-1].ValIDVal), yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal.PAT; - ; - break;} -case 303: -#line 3421 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); - yyval.InstVal.S = yyvsp[-1].TypeVal.S; - yyval.InstVal.I = new AllocaInst(Ty, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 304: -#line 3427 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *Ty = yyvsp[-4].TypeVal.PAT->get(); - yyval.InstVal.S = yyvsp[-4].TypeVal.S; - yyval.InstVal.I = new AllocaInst(Ty, getVal(yyvsp[-2].PrimType.T, yyvsp[-1].ValIDVal), yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal.PAT; - ; - break;} -case 305: -#line 3433 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type *PTy = yyvsp[0].ValueVal.V->getType(); + CI->setTailCall((yyvsp[(1) - (7)].BoolVal)); + CI->setCallingConv(upgradeCallingConv((yyvsp[(2) - (7)].UIntVal))); + (yyval.InstVal).I = CI; + (yyval.InstVal).S = (yyvsp[(3) - (7)].TypeVal).S; + } + delete (yyvsp[(3) - (7)].TypeVal).PAT; + delete (yyvsp[(6) - (7)].ValueList); + ;} + break; + + case 297: +#line 3391 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); + ;} + break; + + case 298: +#line 3399 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValueList) = (yyvsp[(2) - (2)].ValueList); ;} + break; + + case 299: +#line 3400 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.ValueList) = new std::vector(); ;} + break; + + case 300: +#line 3404 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 301: +#line 3405 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 302: +#line 3409 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(2) - (3)].TypeVal).PAT->get(); + (yyval.InstVal).S = (yyvsp[(2) - (3)].TypeVal).S; + (yyval.InstVal).I = new MallocInst(Ty, 0, (yyvsp[(3) - (3)].UIntVal)); + delete (yyvsp[(2) - (3)].TypeVal).PAT; + ;} + break; + + case 303: +#line 3415 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(2) - (6)].TypeVal).PAT->get(); + (yyval.InstVal).S = (yyvsp[(2) - (6)].TypeVal).S; + (yyval.InstVal).I = new MallocInst(Ty, getVal((yyvsp[(4) - (6)].PrimType).T, (yyvsp[(5) - (6)].ValIDVal)), (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal).PAT; + ;} + break; + + case 304: +#line 3421 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(2) - (3)].TypeVal).PAT->get(); + (yyval.InstVal).S = (yyvsp[(2) - (3)].TypeVal).S; + (yyval.InstVal).I = new AllocaInst(Ty, 0, (yyvsp[(3) - (3)].UIntVal)); + delete (yyvsp[(2) - (3)].TypeVal).PAT; + ;} + break; + + case 305: +#line 3427 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *Ty = (yyvsp[(2) - (6)].TypeVal).PAT->get(); + (yyval.InstVal).S = (yyvsp[(2) - (6)].TypeVal).S; + (yyval.InstVal).I = new AllocaInst(Ty, getVal((yyvsp[(4) - (6)].PrimType).T, (yyvsp[(5) - (6)].ValIDVal)), (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal).PAT; + ;} + break; + + case 306: +#line 3433 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type *PTy = (yyvsp[(2) - (2)].ValueVal).V->getType(); if (!isa(PTy)) error("Trying to free nonpointer type '" + PTy->getDescription() + "'"); - yyval.InstVal.I = new FreeInst(yyvsp[0].ValueVal.V); - yyval.InstVal.S = Signless; - ; - break;} -case 306: -#line 3440 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* Ty = yyvsp[-1].TypeVal.PAT->get(); - yyval.InstVal.S = yyvsp[-1].TypeVal.S; + (yyval.InstVal).I = new FreeInst((yyvsp[(2) - (2)].ValueVal).V); + (yyval.InstVal).S = Signless; + ;} + break; + + case 307: +#line 3440 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* Ty = (yyvsp[(3) - (4)].TypeVal).PAT->get(); + (yyval.InstVal).S = (yyvsp[(3) - (4)].TypeVal).S; if (!isa(Ty)) error("Can't load from nonpointer type: " + Ty->getDescription()); if (!cast(Ty)->getElementType()->isFirstClassType()) error("Can't load from pointer of non-first-class type: " + Ty->getDescription()); - Value* tmpVal = getVal(Ty, yyvsp[0].ValIDVal); - yyval.InstVal.I = new LoadInst(tmpVal, "", yyvsp[-3].BoolVal); - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 307: -#line 3452 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal.PAT->get()); + Value* tmpVal = getVal(Ty, (yyvsp[(4) - (4)].ValIDVal)); + (yyval.InstVal).I = new LoadInst(tmpVal, "", (yyvsp[(1) - (4)].BoolVal)); + delete (yyvsp[(3) - (4)].TypeVal).PAT; + ;} + break; + + case 308: +#line 3452 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const PointerType *PTy = dyn_cast((yyvsp[(5) - (6)].TypeVal).PAT->get()); if (!PTy) error("Can't store to a nonpointer type: " + - yyvsp[-1].TypeVal.PAT->get()->getDescription()); + (yyvsp[(5) - (6)].TypeVal).PAT->get()->getDescription()); const Type *ElTy = PTy->getElementType(); - Value *StoreVal = yyvsp[-3].ValueVal.V; - Value* tmpVal = getVal(PTy, yyvsp[0].ValIDVal); - if (ElTy != yyvsp[-3].ValueVal.V->getType()) { - StoreVal = handleSRetFuncTypeMerge(yyvsp[-3].ValueVal.V, ElTy); + Value *StoreVal = (yyvsp[(3) - (6)].ValueVal).V; + Value* tmpVal = getVal(PTy, (yyvsp[(6) - (6)].ValIDVal)); + if (ElTy != (yyvsp[(3) - (6)].ValueVal).V->getType()) { + StoreVal = handleSRetFuncTypeMerge((yyvsp[(3) - (6)].ValueVal).V, ElTy); if (!StoreVal) - error("Can't store '" + yyvsp[-3].ValueVal.V->getType()->getDescription() + + error("Can't store '" + (yyvsp[(3) - (6)].ValueVal).V->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); else { PTy = PointerType::get(StoreVal->getType()); @@ -5317,251 +6413,247 @@ tmpVal = new BitCastInst(tmpVal, PTy, "upgrd.cast", CurBB); } } - yyval.InstVal.I = new StoreInst(StoreVal, tmpVal, yyvsp[-5].BoolVal); - yyval.InstVal.S = Signless; - delete yyvsp[-1].TypeVal.PAT; - ; - break;} -case 308: -#line 3477 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ - const Type* Ty = yyvsp[-2].TypeVal.PAT->get(); + (yyval.InstVal).I = new StoreInst(StoreVal, tmpVal, (yyvsp[(1) - (6)].BoolVal)); + (yyval.InstVal).S = Signless; + delete (yyvsp[(5) - (6)].TypeVal).PAT; + ;} + break; + + case 309: +#line 3477 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" + { + const Type* Ty = (yyvsp[(2) - (4)].TypeVal).PAT->get(); if (!isa(Ty)) error("getelementptr insn requires pointer operand"); std::vector VIndices; - upgradeGEPIndices(Ty, yyvsp[0].ValueList, VIndices); + upgradeGEPIndices(Ty, (yyvsp[(4) - (4)].ValueList), VIndices); - Value* tmpVal = getVal(Ty, yyvsp[-1].ValIDVal); - yyval.InstVal.I = new GetElementPtrInst(tmpVal, VIndices); - yyval.InstVal.S = Signless; - delete yyvsp[-2].TypeVal.PAT; - delete yyvsp[0].ValueList; - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/share/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif + Value* tmpVal = getVal(Ty, (yyvsp[(3) - (4)].ValIDVal)); + (yyval.InstVal).I = new GetElementPtrInst(tmpVal, &VIndices[0], VIndices.size()); + (yyval.InstVal).S = Signless; + delete (yyvsp[(2) - (4)].TypeVal).PAT; + delete (yyvsp[(4) - (4)].ValueList); + ;} + break; -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif + +/* Line 1267 of yacc.c. */ +#line 6443 "UpgradeParser.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTBASE]; + yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; -yyerrlab: /* here on detecting error */ - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ + if (yyerrstatus == 3) { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; -yyerrdefault: /* current state does not do anything special for the error token. */ -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -yyerrpop: /* pop the current state because it cannot handle the error token */ - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ -#if YYDEBUG != 0 - if (yydebug) + for (;;) { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } - else if (yyn == 0) - goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); #endif - } - return 1; + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 3493 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" + + +#line 3493 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { @@ -5594,3 +6686,4 @@ yyerror(ErrorMsg.c_str()); } + Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.44 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.45 --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.44 Sun Feb 11 15:39:05 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Mon Feb 12 16:58:38 2007 @@ -1,4 +1,353 @@ -typedef union { +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + DLLIMPORT = 300, + DLLEXPORT = 301, + EXTERN_WEAK = 302, + OPAQUE = 303, + NOT = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ENDIAN = 308, + POINTERSIZE = 309, + LITTLE = 310, + BIG = 311, + ALIGN = 312, + DEPLIBS = 313, + CALL = 314, + TAIL = 315, + ASM_TOK = 316, + MODULE = 317, + SIDEEFFECT = 318, + CC_TOK = 319, + CCC_TOK = 320, + CSRETCC_TOK = 321, + FASTCC_TOK = 322, + COLDCC_TOK = 323, + X86_STDCALLCC_TOK = 324, + X86_FASTCALLCC_TOK = 325, + DATALAYOUT = 326, + RET = 327, + BR = 328, + SWITCH = 329, + INVOKE = 330, + UNREACHABLE = 331, + UNWIND = 332, + EXCEPT = 333, + ADD = 334, + SUB = 335, + MUL = 336, + DIV = 337, + UDIV = 338, + SDIV = 339, + FDIV = 340, + REM = 341, + UREM = 342, + SREM = 343, + FREM = 344, + AND = 345, + OR = 346, + XOR = 347, + SHL = 348, + SHR = 349, + ASHR = 350, + LSHR = 351, + SETLE = 352, + SETGE = 353, + SETLT = 354, + SETGT = 355, + SETEQ = 356, + SETNE = 357, + ICMP = 358, + FCMP = 359, + MALLOC = 360, + ALLOCA = 361, + FREE = 362, + LOAD = 363, + STORE = 364, + GETELEMENTPTR = 365, + PHI_TOK = 366, + SELECT = 367, + VAARG = 368, + EXTRACTELEMENT = 369, + INSERTELEMENT = 370, + SHUFFLEVECTOR = 371, + VAARG_old = 372, + VANEXT_old = 373, + EQ = 374, + NE = 375, + SLT = 376, + SGT = 377, + SLE = 378, + SGE = 379, + ULT = 380, + UGT = 381, + ULE = 382, + UGE = 383, + OEQ = 384, + ONE = 385, + OLT = 386, + OGT = 387, + OLE = 388, + OGE = 389, + ORD = 390, + UNO = 391, + UEQ = 392, + UNE = 393, + CAST = 394, + TRUNC = 395, + ZEXT = 396, + SEXT = 397, + FPTRUNC = 398, + FPEXT = 399, + FPTOUI = 400, + FPTOSI = 401, + UITOFP = 402, + SITOFP = 403, + PTRTOINT = 404, + INTTOPTR = 405, + BITCAST = 406 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define SINTVAL 260 +#define UINTVAL 261 +#define FPVAL 262 +#define VOID 263 +#define BOOL 264 +#define SBYTE 265 +#define UBYTE 266 +#define SHORT 267 +#define USHORT 268 +#define INT 269 +#define UINT 270 +#define LONG 271 +#define ULONG 272 +#define FLOAT 273 +#define DOUBLE 274 +#define TYPE 275 +#define LABEL 276 +#define VAR_ID 277 +#define LABELSTR 278 +#define STRINGCONSTANT 279 +#define IMPLEMENTATION 280 +#define ZEROINITIALIZER 281 +#define TRUETOK 282 +#define FALSETOK 283 +#define BEGINTOK 284 +#define ENDTOK 285 +#define DECLARE 286 +#define GLOBAL 287 +#define CONSTANT 288 +#define SECTION 289 +#define VOLATILE 290 +#define TO 291 +#define DOTDOTDOT 292 +#define NULL_TOK 293 +#define UNDEF 294 +#define CONST 295 +#define INTERNAL 296 +#define LINKONCE 297 +#define WEAK 298 +#define APPENDING 299 +#define DLLIMPORT 300 +#define DLLEXPORT 301 +#define EXTERN_WEAK 302 +#define OPAQUE 303 +#define NOT 304 +#define EXTERNAL 305 +#define TARGET 306 +#define TRIPLE 307 +#define ENDIAN 308 +#define POINTERSIZE 309 +#define LITTLE 310 +#define BIG 311 +#define ALIGN 312 +#define DEPLIBS 313 +#define CALL 314 +#define TAIL 315 +#define ASM_TOK 316 +#define MODULE 317 +#define SIDEEFFECT 318 +#define CC_TOK 319 +#define CCC_TOK 320 +#define CSRETCC_TOK 321 +#define FASTCC_TOK 322 +#define COLDCC_TOK 323 +#define X86_STDCALLCC_TOK 324 +#define X86_FASTCALLCC_TOK 325 +#define DATALAYOUT 326 +#define RET 327 +#define BR 328 +#define SWITCH 329 +#define INVOKE 330 +#define UNREACHABLE 331 +#define UNWIND 332 +#define EXCEPT 333 +#define ADD 334 +#define SUB 335 +#define MUL 336 +#define DIV 337 +#define UDIV 338 +#define SDIV 339 +#define FDIV 340 +#define REM 341 +#define UREM 342 +#define SREM 343 +#define FREM 344 +#define AND 345 +#define OR 346 +#define XOR 347 +#define SHL 348 +#define SHR 349 +#define ASHR 350 +#define LSHR 351 +#define SETLE 352 +#define SETGE 353 +#define SETLT 354 +#define SETGT 355 +#define SETEQ 356 +#define SETNE 357 +#define ICMP 358 +#define FCMP 359 +#define MALLOC 360 +#define ALLOCA 361 +#define FREE 362 +#define LOAD 363 +#define STORE 364 +#define GETELEMENTPTR 365 +#define PHI_TOK 366 +#define SELECT 367 +#define VAARG 368 +#define EXTRACTELEMENT 369 +#define INSERTELEMENT 370 +#define SHUFFLEVECTOR 371 +#define VAARG_old 372 +#define VANEXT_old 373 +#define EQ 374 +#define NE 375 +#define SLT 376 +#define SGT 377 +#define SLE 378 +#define SGE 379 +#define ULT 380 +#define UGT 381 +#define ULE 382 +#define UGE 383 +#define OEQ 384 +#define ONE 385 +#define OLT 386 +#define OGT 387 +#define OLE 388 +#define OGE 389 +#define ORD 390 +#define UNO 391 +#define UEQ 392 +#define UNE 393 +#define CAST 394 +#define TRUNC 395 +#define ZEXT 396 +#define SEXT 397 +#define FPTRUNC 398 +#define FPEXT 399 +#define FPTOUI 400 +#define FPTOSI 401 +#define UITOFP 402 +#define SITOFP 403 +#define PTRTOINT 404 +#define INTTOPTR 405 +#define BITCAST 406 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 1454 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -38,156 +387,14 @@ llvm::ICmpInst::Predicate IPred; llvm::FCmpInst::Predicate FPred; llvm::Module::Endianness Endianness; -} YYSTYPE; -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define SINTVAL 259 -#define UINTVAL 260 -#define FPVAL 261 -#define VOID 262 -#define BOOL 263 -#define SBYTE 264 -#define UBYTE 265 -#define SHORT 266 -#define USHORT 267 -#define INT 268 -#define UINT 269 -#define LONG 270 -#define ULONG 271 -#define FLOAT 272 -#define DOUBLE 273 -#define TYPE 274 -#define LABEL 275 -#define VAR_ID 276 -#define LABELSTR 277 -#define STRINGCONSTANT 278 -#define IMPLEMENTATION 279 -#define ZEROINITIALIZER 280 -#define TRUETOK 281 -#define FALSETOK 282 -#define BEGINTOK 283 -#define ENDTOK 284 -#define DECLARE 285 -#define GLOBAL 286 -#define CONSTANT 287 -#define SECTION 288 -#define VOLATILE 289 -#define TO 290 -#define DOTDOTDOT 291 -#define NULL_TOK 292 -#define UNDEF 293 -#define CONST 294 -#define INTERNAL 295 -#define LINKONCE 296 -#define WEAK 297 -#define APPENDING 298 -#define DLLIMPORT 299 -#define DLLEXPORT 300 -#define EXTERN_WEAK 301 -#define OPAQUE 302 -#define NOT 303 -#define EXTERNAL 304 -#define TARGET 305 -#define TRIPLE 306 -#define ENDIAN 307 -#define POINTERSIZE 308 -#define LITTLE 309 -#define BIG 310 -#define ALIGN 311 -#define DEPLIBS 312 -#define CALL 313 -#define TAIL 314 -#define ASM_TOK 315 -#define MODULE 316 -#define SIDEEFFECT 317 -#define CC_TOK 318 -#define CCC_TOK 319 -#define CSRETCC_TOK 320 -#define FASTCC_TOK 321 -#define COLDCC_TOK 322 -#define X86_STDCALLCC_TOK 323 -#define X86_FASTCALLCC_TOK 324 -#define DATALAYOUT 325 -#define RET 326 -#define BR 327 -#define SWITCH 328 -#define INVOKE 329 -#define UNREACHABLE 330 -#define UNWIND 331 -#define EXCEPT 332 -#define ADD 333 -#define SUB 334 -#define MUL 335 -#define DIV 336 -#define UDIV 337 -#define SDIV 338 -#define FDIV 339 -#define REM 340 -#define UREM 341 -#define SREM 342 -#define FREM 343 -#define AND 344 -#define OR 345 -#define XOR 346 -#define SHL 347 -#define SHR 348 -#define ASHR 349 -#define LSHR 350 -#define SETLE 351 -#define SETGE 352 -#define SETLT 353 -#define SETGT 354 -#define SETEQ 355 -#define SETNE 356 -#define ICMP 357 -#define FCMP 358 -#define MALLOC 359 -#define ALLOCA 360 -#define FREE 361 -#define LOAD 362 -#define STORE 363 -#define GETELEMENTPTR 364 -#define PHI_TOK 365 -#define SELECT 366 -#define VAARG 367 -#define EXTRACTELEMENT 368 -#define INSERTELEMENT 369 -#define SHUFFLEVECTOR 370 -#define VAARG_old 371 -#define VANEXT_old 372 -#define EQ 373 -#define NE 374 -#define SLT 375 -#define SGT 376 -#define SLE 377 -#define SGE 378 -#define ULT 379 -#define UGT 380 -#define ULE 381 -#define UGE 382 -#define OEQ 383 -#define ONE 384 -#define OLT 385 -#define OGT 386 -#define OLE 387 -#define OGE 388 -#define ORD 389 -#define UNO 390 -#define UEQ 391 -#define UNE 392 -#define CAST 393 -#define TRUNC 394 -#define ZEXT 395 -#define SEXT 396 -#define FPTRUNC 397 -#define FPEXT 398 -#define FPTOUI 399 -#define FPTOSI 400 -#define UITOFP 401 -#define SITOFP 402 -#define PTRTOINT 403 -#define INTTOPTR 404 -#define BITCAST 405 - +} +/* Line 1529 of yacc.c. */ +#line 393 "UpgradeParser.tab.h" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif extern YYSTYPE Upgradelval; + Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.63 llvm/tools/llvm-upgrade/UpgradeParser.y:1.64 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.63 Sun Feb 11 15:38:38 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Mon Feb 12 16:58:38 2007 @@ -1287,7 +1287,7 @@ } const Type *IdxTy = - GetElementPtrInst::getIndexedType(PTy, VIndices, true); + GetElementPtrInst::getIndexedType(PTy, &VIndices[0], VIndices.size(), true); if (!IdxTy) error("Index list invalid for constant getelementptr"); return IdxTy; @@ -3483,7 +3483,7 @@ upgradeGEPIndices(Ty, $4, VIndices); Value* tmpVal = getVal(Ty, $3); - $$.I = new GetElementPtrInst(tmpVal, VIndices); + $$.I = new GetElementPtrInst(tmpVal, &VIndices[0], VIndices.size()); $$.S = Signless; delete $2.PAT; delete $4; Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.59 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.60 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.59 Sun Feb 11 15:39:05 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Mon Feb 12 16:58:38 2007 @@ -1287,7 +1287,7 @@ } const Type *IdxTy = - GetElementPtrInst::getIndexedType(PTy, VIndices, true); + GetElementPtrInst::getIndexedType(PTy, &VIndices[0], VIndices.size(), true); if (!IdxTy) error("Index list invalid for constant getelementptr"); return IdxTy; @@ -3483,7 +3483,7 @@ upgradeGEPIndices(Ty, $4, VIndices); Value* tmpVal = getVal(Ty, $3); - $$.I = new GetElementPtrInst(tmpVal, VIndices); + $$.I = new GetElementPtrInst(tmpVal, &VIndices[0], VIndices.size()); $$.S = Signless; delete $2.PAT; delete $4; From reid at x10sys.com Mon Feb 12 17:17:51 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 17:17:51 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/part_select.c part_select.reference_output Message-ID: <200702122317.l1CNHpTg032266@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: part_select.c updated: 1.2 -> 1.3 part_select.reference_output updated: 1.1 -> 1.2 --- Log message: Update the part_select test case to avoid sign extension. --- Diffs of the changes: (+61 -10) part_select.c | 23 +++++++++++--------- part_select.reference_output | 48 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 10 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/part_select.c diff -u llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.2 llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.3 --- llvm-test/SingleSource/UnitTests/Integer/part_select.c:1.2 Mon Feb 12 14:57:48 2007 +++ llvm-test/SingleSource/UnitTests/Integer/part_select.c Mon Feb 12 17:17:34 2007 @@ -12,15 +12,16 @@ #include #include +#include #ifdef ENABLE_LARGE_INTEGERS -typedef int __attribute__((bitwidth(256))) BitType; -const BitType X = 0xAAAAAAAAULL; -int numbits = 256; +typedef unsigned __attribute__((bitwidth(256))) BitType; +const BitType X = 0xFEDCBA9876543210ULL; +unsigned numbits = 256; #else -typedef int __attribute__((bitwidth(47))) BitType; -const BitType X = 0xAAAAAAAAULL; -int numbits = 47; +typedef unsigned __attribute__((bitwidth(47))) BitType; +const BitType X = 0xFEDCBA9876543210ULL; +unsigned numbits = 47; #endif int main(int argc, char** argv) @@ -34,19 +35,21 @@ srand(0); - int i, j; + unsigned i, j; - for (i = 1; i <= numbits; ++i) { + for (i = 0; i < numbits; ++i) { BitType left = rand() % numbits; BitType right = i; + printf("part_select(Y, %3u, %3u) = ", (unsigned)left, (unsigned)right); BitType Z = __builtin_bit_part_select(Y, left, right); - printf("part_select(Y, %3d, %3d) = ", (int)left, (int)right); for (j = numbits; j > 0; --j) { - if (__builtin_bit_select(Z, j)) + if (__builtin_bit_select(Z, j-1)) printf("1"); else printf("0"); } + uint64_t val = Z; + printf(" (%lx)", val); printf("\n"); } Index: llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output:1.1 Mon Feb 12 11:52:59 2007 +++ llvm-test/SingleSource/UnitTests/Integer/part_select.reference_output Mon Feb 12 17:17:34 2007 @@ -0,0 +1,48 @@ +part_select(Y, 38, 0) = 00000000001100001110110010101000011001000010000 (76543210) +part_select(Y, 4, 1) = 00000000000000000000000000000000000000000001000 (8) +part_select(Y, 18, 2) = 00000000000000000000000000000010000110010000100 (10c84) +part_select(Y, 23, 3) = 00000000000000000000000000010101000011001000010 (a8642) +part_select(Y, 17, 4) = 00000000000000000000000000000000000001100100001 (321) +part_select(Y, 26, 5) = 00000000000000000000000001100101010000110010000 (32a190) +part_select(Y, 16, 6) = 00000000000000000000000000000000000000011001000 (c8) +part_select(Y, 3, 7) = 00000000000000000000000000000000000000000001000 (8) +part_select(Y, 28, 8) = 00000000000000000000000000101100101010000110010 (165432) +part_select(Y, 28, 9) = 00000000000000000000000000010110010101000011001 (b2a19) +part_select(Y, 10, 10) = 00000000000000000000000000000000000000000000000 (0) +part_select(Y, 17, 11) = 00000000000000000000000000000000000000000000110 (6) +part_select(Y, 44, 12) = 00000000000000110101001100001110110010101000011 (a9876543) +part_select(Y, 28, 13) = 00000000000000000000000000000001011001010100001 (b2a1) +part_select(Y, 2, 14) = 00000000000000000000000000000000000010000100110 (426) +part_select(Y, 20, 15) = 00000000000000000000000000000000000000000101000 (28) +part_select(Y, 22, 16) = 00000000000000000000000000000000000000001010100 (54) +part_select(Y, 21, 17) = 00000000000000000000000000000000000000000001010 (a) +part_select(Y, 18, 18) = 00000000000000000000000000000000000000000000001 (1) +part_select(Y, 36, 19) = 00000000000000000000000000000110000111011001010 (30eca) +part_select(Y, 34, 20) = 00000000000000000000000000000000000011101100101 (765) +part_select(Y, 37, 21) = 00000000000000000000000000000001100001110110010 (c3b2) +part_select(Y, 18, 22) = 00000000000000000000000000000000000000000010101 (15) +part_select(Y, 38, 23) = 00000000000000000000000000000000011000011101100 (30ec) +part_select(Y, 20, 24) = 00000000000000000000000000000000000000000010100 (14) +part_select(Y, 1, 25) = 00000000000000000000000001000010011000010101001 (2130a9) +part_select(Y, 31, 26) = 00000000000000000000000000000000000000000011101 (1d) +part_select(Y, 17, 27) = 00000000000000000000000000000000000001010100110 (2a6) +part_select(Y, 20, 28) = 00000000000000000000000000000000000000101001101 (14d) +part_select(Y, 6, 29) = 00000000000000000000000000100110000101010011011 (130a9b) +part_select(Y, 27, 30) = 00000000000000000000000000000000000000000000111 (7) +part_select(Y, 37, 31) = 00000000000000000000000000000000000000000110000 (30) +part_select(Y, 11, 32) = 00000000000000000000000000110000101010011011100 (1854dc) +part_select(Y, 24, 33) = 00000000000000000000000000000000000000110111000 (1b8) +part_select(Y, 39, 34) = 00000000000000000000000000000000000000000100110 (26) +part_select(Y, 7, 35) = 00000000000000000000100110000101010011011100001 (4c2a6e1) +part_select(Y, 3, 36) = 00000000000000100001001100001010100110111000011 (9854dc3) +part_select(Y, 9, 37) = 00000000000000000010011000010101001101110000110 (130a9b86) +part_select(Y, 36, 38) = 00000000000000000000000000000000000000000000100 (4) +part_select(Y, 31, 39) = 00000000000000000000000000000000000000000011001 (19) +part_select(Y, 16, 40) = 00000000000000000000000010101001101110000110010 (54dc32) +part_select(Y, 46, 41) = 00000000000000000000000000000000000000000011101 (1d) +part_select(Y, 27, 42) = 00000000000000000000000000000000111000011001010 (70ca) +part_select(Y, 13, 43) = 00000000000000001000010101001101110000110010101 (42a6e195) +part_select(Y, 6, 44) = 00000000000100110000101010011011100001100101011 (854dc32b) +part_select(Y, 9, 45) = 00000000001001100001010100110111000011001010111 (a9b8657) +part_select(Y, 13, 46) = 00000000000001000010101001101110000110010101110 (15370cae) +exit 0 From reid at x10sys.com Mon Feb 12 17:28:44 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 17:28:44 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output Message-ID: <200702122328.l1CNSiP8032445@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: general-test.reference_output updated: 1.2 -> 1.3 --- Log message: Update the reference output for this test to correct the values. --- Diffs of the changes: (+5 -5) general-test.reference_output | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output:1.3 --- llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output:1.2 Wed Jan 17 19:31:25 2007 +++ llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output Mon Feb 12 17:28:28 2007 @@ -1,18 +1,18 @@ rand = 1804289383 argc = 2 num = 31415926 -val = 6988767 +val = -1399841 sizeof(MyStruct) == 20 sizeof(My17BitInt) == 4 sizeof(j) == 2 -j = 446 -size sum is 26 +j = -66 +size sum is 167356064 that.i4Field = 9 that.i12Field = 2848 that.i17Field = 31527 -that.i37Field = 48921390 +that.i37Field = -9798866 next.i4Field = 15 next.i12Field = 992 next.i17Field = 41953 -next.i37Field = 6988770 +next.i37Field = -1399838 exit 0 From reid at x10sys.com Mon Feb 12 17:31:04 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 17:31:04 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/general-test.c general-test.reference_output Message-ID: <200702122331.l1CNV4Zh032499@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: general-test.c updated: 1.6 -> 1.7 general-test.reference_output updated: 1.3 -> 1.4 --- Log message: Fix a logic bug in this test. --- Diffs of the changes: (+2 -2) general-test.c | 2 +- general-test.reference_output | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/general-test.c diff -u llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.6 llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/general-test.c:1.6 Thu Jan 25 21:10:17 2007 +++ llvm-test/SingleSource/UnitTests/Integer/general-test.c Mon Feb 12 17:30:47 2007 @@ -52,7 +52,7 @@ Data2.next = &Data1; j = num * 2; printf("j = %d\n", j); - printf("size sum is %d\n", result); + printf("size sum is %d\n", (int)*result); return &Data2; } Index: llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output:1.3 llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output:1.4 --- llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output:1.3 Mon Feb 12 17:28:28 2007 +++ llvm-test/SingleSource/UnitTests/Integer/general-test.reference_output Mon Feb 12 17:30:47 2007 @@ -6,7 +6,7 @@ sizeof(My17BitInt) == 4 sizeof(j) == 2 j = -66 -size sum is 167356064 +size sum is 26 that.i4Field = 9 that.i12Field = 2848 that.i17Field = 31527 From alenhar2 at cs.uiuc.edu Mon Feb 12 18:38:06 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Mon, 12 Feb 2007 18:38:06 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/PatternMatch.h Message-ID: <200702130038.l1D0c68w001147@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: PatternMatch.h updated: 1.18 -> 1.19 --- Log message: I love non-deturminism. Returning objects with references to stack objects is a bad idea (TM). --- Diffs of the changes: (+7 -5) PatternMatch.h | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) Index: llvm/include/llvm/Support/PatternMatch.h diff -u llvm/include/llvm/Support/PatternMatch.h:1.18 llvm/include/llvm/Support/PatternMatch.h:1.19 --- llvm/include/llvm/Support/PatternMatch.h:1.18 Thu Feb 1 20:16:21 2007 +++ llvm/include/llvm/Support/PatternMatch.h Mon Feb 12 18:37:50 2007 @@ -223,19 +223,22 @@ template struct BinaryOpClass_match { - OpcType &Opcode; + OpcType *Opcode; LHS_t L; RHS_t R; BinaryOpClass_match(OpcType &Op, const LHS_t &LHS, const RHS_t &RHS) - : Opcode(Op), L(LHS), R(RHS) {} + : Opcode(&Op), L(LHS), R(RHS) {} + BinaryOpClass_match(const LHS_t &LHS, const RHS_t &RHS) + : Opcode(0), L(LHS), R(RHS) {} template bool match(OpTy *V) { if (Class *I = dyn_cast(V)) if (L.match(I->getOperand(0)) && R.match(I->getOperand(1))) { - Opcode = I->getOpcode(); + if (Opcode) + *Opcode = I->getOpcode(); return true; } #if 0 // Doesn't handle constantexprs yet! @@ -257,9 +260,8 @@ template inline BinaryOpClass_match m_Shift(const LHS &L, const RHS &R) { - Instruction::BinaryOps Op; return BinaryOpClass_match(Op, L, R); + BinaryOperator, Instruction::BinaryOps>(L, R); } //===----------------------------------------------------------------------===// From sabre at nondot.org Mon Feb 12 18:57:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 18:57:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200702130057.l1D0vuSK001685@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.321 -> 1.322 --- Log message: eliminate use of methods that take vectors as args --- Diffs of the changes: (+4 -3) llvmAsmParser.y | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.321 llvm/lib/AsmParser/llvmAsmParser.y:1.322 --- llvm/lib/AsmParser/llvmAsmParser.y:1.321 Sun Feb 11 15:39:35 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Feb 12 18:57:40 2007 @@ -1746,7 +1746,8 @@ GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType($3->getType(), *$4, true); + GetElementPtrInst::getIndexedType($3->getType(), &(*$4)[0], $4->size(), + true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); @@ -2859,12 +2860,12 @@ if (!isa($2->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*$2, *$4, true)) + if (!GetElementPtrInst::getIndexedType(*$2, &(*$4)[0], $4->size(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + (*$2)->getDescription()+ "'"); Value* tmpVal = getVal(*$2, $3); CHECK_FOR_ERROR - $$ = new GetElementPtrInst(tmpVal, *$4); + $$ = new GetElementPtrInst(tmpVal, &(*$4)[0], $4->size()); delete $2; delete $4; }; From sabre at nondot.org Mon Feb 12 18:58:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 18:58:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200702130058.l1D0wHHP001727@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.66 -> 1.67 llvmAsmParser.h.cvs updated: 1.52 -> 1.53 llvmAsmParser.y.cvs updated: 1.67 -> 1.68 --- Log message: regenerate --- Diffs of the changes: (+4465 -3210) llvmAsmParser.cpp.cvs | 7189 ++++++++++++++++++++++++++++---------------------- llvmAsmParser.h.cvs | 451 ++- llvmAsmParser.y.cvs | 7 3 files changed, 4465 insertions(+), 3182 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.66 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.67 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.66 Sun Feb 11 15:40:10 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Feb 12 18:58:01 2007 @@ -1,147 +1,346 @@ +/* A Bison parser, made by GNU Bison 2.3. */ -/* A Bison parser, made from /Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y - by GNU Bison version 1.28 */ +/* Skeleton implementation for Bison's Yacc-like parsers in C -#define YYBISON 1 /* Identify Bison output. */ + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define LOCALVAL_ID 259 -#define GLOBALVAL_ID 260 -#define FPVAL 261 -#define VOID 262 -#define INTTYPE 263 -#define FLOAT 264 -#define DOUBLE 265 -#define LABEL 266 -#define TYPE 267 -#define LOCALVAR 268 -#define GLOBALVAR 269 -#define LABELSTR 270 -#define STRINGCONSTANT 271 -#define ATSTRINGCONSTANT 272 -#define IMPLEMENTATION 273 -#define ZEROINITIALIZER 274 -#define TRUETOK 275 -#define FALSETOK 276 -#define BEGINTOK 277 -#define ENDTOK 278 -#define DECLARE 279 -#define DEFINE 280 -#define GLOBAL 281 -#define CONSTANT 282 -#define SECTION 283 -#define VOLATILE 284 -#define TO 285 -#define DOTDOTDOT 286 -#define NULL_TOK 287 -#define UNDEF 288 -#define INTERNAL 289 -#define LINKONCE 290 -#define WEAK 291 -#define APPENDING 292 -#define DLLIMPORT 293 -#define DLLEXPORT 294 -#define EXTERN_WEAK 295 -#define OPAQUE 296 -#define EXTERNAL 297 -#define TARGET 298 -#define TRIPLE 299 -#define ALIGN 300 -#define DEPLIBS 301 -#define CALL 302 -#define TAIL 303 -#define ASM_TOK 304 -#define MODULE 305 -#define SIDEEFFECT 306 -#define CC_TOK 307 -#define CCC_TOK 308 -#define FASTCC_TOK 309 -#define COLDCC_TOK 310 -#define X86_STDCALLCC_TOK 311 -#define X86_FASTCALLCC_TOK 312 -#define DATALAYOUT 313 -#define RET 314 -#define BR 315 -#define SWITCH 316 -#define INVOKE 317 -#define UNWIND 318 -#define UNREACHABLE 319 -#define ADD 320 -#define SUB 321 -#define MUL 322 -#define UDIV 323 -#define SDIV 324 -#define FDIV 325 -#define UREM 326 -#define SREM 327 -#define FREM 328 -#define AND 329 -#define OR 330 -#define XOR 331 -#define SHL 332 -#define LSHR 333 -#define ASHR 334 -#define ICMP 335 -#define FCMP 336 -#define EQ 337 -#define NE 338 -#define SLT 339 -#define SGT 340 -#define SLE 341 -#define SGE 342 -#define ULT 343 -#define UGT 344 -#define ULE 345 -#define UGE 346 -#define OEQ 347 -#define ONE 348 -#define OLT 349 -#define OGT 350 -#define OLE 351 -#define OGE 352 -#define ORD 353 -#define UNO 354 -#define UEQ 355 -#define UNE 356 -#define MALLOC 357 -#define ALLOCA 358 -#define FREE 359 -#define LOAD 360 -#define STORE 361 -#define GETELEMENTPTR 362 -#define TRUNC 363 -#define ZEXT 364 -#define SEXT 365 -#define FPTRUNC 366 -#define FPEXT 367 -#define BITCAST 368 -#define UITOFP 369 -#define SITOFP 370 -#define FPTOUI 371 -#define FPTOSI 372 -#define INTTOPTR 373 -#define PTRTOINT 374 -#define PHI_TOK 375 -#define SELECT 376 -#define VAARG 377 -#define EXTRACTELEMENT 378 -#define INSERTELEMENT 379 -#define SHUFFLEVECTOR 380 -#define NORETURN 381 -#define INREG 382 -#define SRET 383 -#define DEFAULT 384 -#define HIDDEN 385 -#line 14 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + LOCALVAL_ID = 260, + GLOBALVAL_ID = 261, + FPVAL = 262, + VOID = 263, + INTTYPE = 264, + FLOAT = 265, + DOUBLE = 266, + LABEL = 267, + TYPE = 268, + LOCALVAR = 269, + GLOBALVAR = 270, + LABELSTR = 271, + STRINGCONSTANT = 272, + ATSTRINGCONSTANT = 273, + IMPLEMENTATION = 274, + ZEROINITIALIZER = 275, + TRUETOK = 276, + FALSETOK = 277, + BEGINTOK = 278, + ENDTOK = 279, + DECLARE = 280, + DEFINE = 281, + GLOBAL = 282, + CONSTANT = 283, + SECTION = 284, + VOLATILE = 285, + TO = 286, + DOTDOTDOT = 287, + NULL_TOK = 288, + UNDEF = 289, + INTERNAL = 290, + LINKONCE = 291, + WEAK = 292, + APPENDING = 293, + DLLIMPORT = 294, + DLLEXPORT = 295, + EXTERN_WEAK = 296, + OPAQUE = 297, + EXTERNAL = 298, + TARGET = 299, + TRIPLE = 300, + ALIGN = 301, + DEPLIBS = 302, + CALL = 303, + TAIL = 304, + ASM_TOK = 305, + MODULE = 306, + SIDEEFFECT = 307, + CC_TOK = 308, + CCC_TOK = 309, + FASTCC_TOK = 310, + COLDCC_TOK = 311, + X86_STDCALLCC_TOK = 312, + X86_FASTCALLCC_TOK = 313, + DATALAYOUT = 314, + RET = 315, + BR = 316, + SWITCH = 317, + INVOKE = 318, + UNWIND = 319, + UNREACHABLE = 320, + ADD = 321, + SUB = 322, + MUL = 323, + UDIV = 324, + SDIV = 325, + FDIV = 326, + UREM = 327, + SREM = 328, + FREM = 329, + AND = 330, + OR = 331, + XOR = 332, + SHL = 333, + LSHR = 334, + ASHR = 335, + ICMP = 336, + FCMP = 337, + EQ = 338, + NE = 339, + SLT = 340, + SGT = 341, + SLE = 342, + SGE = 343, + ULT = 344, + UGT = 345, + ULE = 346, + UGE = 347, + OEQ = 348, + ONE = 349, + OLT = 350, + OGT = 351, + OLE = 352, + OGE = 353, + ORD = 354, + UNO = 355, + UEQ = 356, + UNE = 357, + MALLOC = 358, + ALLOCA = 359, + FREE = 360, + LOAD = 361, + STORE = 362, + GETELEMENTPTR = 363, + TRUNC = 364, + ZEXT = 365, + SEXT = 366, + FPTRUNC = 367, + FPEXT = 368, + BITCAST = 369, + UITOFP = 370, + SITOFP = 371, + FPTOUI = 372, + FPTOSI = 373, + INTTOPTR = 374, + PTRTOINT = 375, + PHI_TOK = 376, + SELECT = 377, + VAARG = 378, + EXTRACTELEMENT = 379, + INSERTELEMENT = 380, + SHUFFLEVECTOR = 381, + NORETURN = 382, + INREG = 383, + SRET = 384, + DEFAULT = 385, + HIDDEN = 386 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define LOCALVAL_ID 260 +#define GLOBALVAL_ID 261 +#define FPVAL 262 +#define VOID 263 +#define INTTYPE 264 +#define FLOAT 265 +#define DOUBLE 266 +#define LABEL 267 +#define TYPE 268 +#define LOCALVAR 269 +#define GLOBALVAR 270 +#define LABELSTR 271 +#define STRINGCONSTANT 272 +#define ATSTRINGCONSTANT 273 +#define IMPLEMENTATION 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define VOLATILE 285 +#define TO 286 +#define DOTDOTDOT 287 +#define NULL_TOK 288 +#define UNDEF 289 +#define INTERNAL 290 +#define LINKONCE 291 +#define WEAK 292 +#define APPENDING 293 +#define DLLIMPORT 294 +#define DLLEXPORT 295 +#define EXTERN_WEAK 296 +#define OPAQUE 297 +#define EXTERNAL 298 +#define TARGET 299 +#define TRIPLE 300 +#define ALIGN 301 +#define DEPLIBS 302 +#define CALL 303 +#define TAIL 304 +#define ASM_TOK 305 +#define MODULE 306 +#define SIDEEFFECT 307 +#define CC_TOK 308 +#define CCC_TOK 309 +#define FASTCC_TOK 310 +#define COLDCC_TOK 311 +#define X86_STDCALLCC_TOK 312 +#define X86_FASTCALLCC_TOK 313 +#define DATALAYOUT 314 +#define RET 315 +#define BR 316 +#define SWITCH 317 +#define INVOKE 318 +#define UNWIND 319 +#define UNREACHABLE 320 +#define ADD 321 +#define SUB 322 +#define MUL 323 +#define UDIV 324 +#define SDIV 325 +#define FDIV 326 +#define UREM 327 +#define SREM 328 +#define FREM 329 +#define AND 330 +#define OR 331 +#define XOR 332 +#define SHL 333 +#define LSHR 334 +#define ASHR 335 +#define ICMP 336 +#define FCMP 337 +#define EQ 338 +#define NE 339 +#define SLT 340 +#define SGT 341 +#define SLE 342 +#define SGE 343 +#define ULT 344 +#define UGT 345 +#define ULE 346 +#define UGE 347 +#define OEQ 348 +#define ONE 349 +#define OLT 350 +#define OGT 351 +#define OLE 352 +#define OGE 353 +#define ORD 354 +#define UNO 355 +#define UEQ 356 +#define UNE 357 +#define MALLOC 358 +#define ALLOCA 359 +#define FREE 360 +#define LOAD 361 +#define STORE 362 +#define GETELEMENTPTR 363 +#define TRUNC 364 +#define ZEXT 365 +#define SEXT 366 +#define FPTRUNC 367 +#define FPEXT 368 +#define BITCAST 369 +#define UITOFP 370 +#define SITOFP 371 +#define FPTOUI 372 +#define FPTOSI 373 +#define INTTOPTR 374 +#define PTRTOINT 375 +#define PHI_TOK 376 +#define SELECT 377 +#define VAARG 378 +#define EXTRACTELEMENT 379 +#define INSERTELEMENT 380 +#define SHUFFLEVECTOR 381 +#define NORETURN 382 +#define INREG 383 +#define SRET 384 +#define DEFAULT 385 +#define HIDDEN 386 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1028,8 +1227,29 @@ } -#line 901 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -typedef union { + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 901 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1073,1062 +1293,1734 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} YYSTYPE; -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif +} +/* Line 193 of yacc.c. */ +#line 1299 "llvmAsmParser.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -#define YYFINAL 557 -#define YYFLAG -32768 -#define YYNTBASE 146 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 385 ? yytranslate[x] : 223) - -static const short yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 136, - 137, 134, 2, 133, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, - 132, 142, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 138, 135, 140, 2, 2, 2, 2, 2, 145, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, - 2, 2, 143, 2, 144, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131 -}; +/* Copy the second part of user declarations. */ -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, - 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, - 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, - 119, 122, 123, 125, 127, 130, 131, 133, 135, 137, - 139, 141, 143, 145, 147, 148, 150, 151, 153, 155, - 156, 158, 160, 162, 164, 165, 167, 169, 171, 173, - 175, 178, 180, 182, 184, 186, 187, 190, 192, 194, - 195, 198, 199, 202, 203, 207, 210, 211, 213, 214, - 218, 220, 223, 225, 227, 229, 231, 233, 235, 238, - 240, 243, 249, 255, 261, 267, 271, 274, 280, 285, - 288, 290, 292, 294, 298, 300, 304, 306, 307, 309, - 313, 318, 322, 326, 331, 336, 340, 347, 353, 356, - 359, 362, 365, 368, 371, 374, 377, 380, 383, 390, - 396, 405, 412, 419, 427, 435, 442, 451, 460, 464, - 466, 468, 470, 472, 473, 475, 478, 479, 483, 484, - 488, 492, 494, 498, 502, 503, 510, 511, 519, 520, - 528, 531, 535, 537, 541, 545, 549, 553, 555, 556, - 562, 566, 568, 572, 574, 575, 585, 587, 589, 594, - 596, 598, 601, 605, 606, 608, 610, 612, 614, 616, - 618, 620, 622, 624, 628, 630, 636, 638, 640, 642, - 644, 646, 648, 651, 654, 657, 661, 664, 665, 667, - 670, 673, 677, 687, 697, 706, 721, 723, 725, 732, - 738, 741, 748, 756, 760, 766, 767, 768, 772, 775, - 777, 783, 789, 796, 803, 808, 815, 820, 825, 832, - 839, 842, 851, 853, 855, 856, 860, 867, 871, 878, - 881, 886, 893 -}; -static const short yyrhs[] = { 66, - 0, 67, 0, 68, 0, 69, 0, 70, 0, 71, - 0, 72, 0, 73, 0, 74, 0, 78, 0, 79, - 0, 80, 0, 75, 0, 76, 0, 77, 0, 109, - 0, 110, 0, 111, 0, 112, 0, 113, 0, 114, - 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, - 0, 120, 0, 83, 0, 84, 0, 85, 0, 86, - 0, 87, 0, 88, 0, 89, 0, 90, 0, 91, - 0, 92, 0, 93, 0, 94, 0, 95, 0, 96, - 0, 97, 0, 98, 0, 99, 0, 100, 0, 101, - 0, 102, 0, 89, 0, 90, 0, 91, 0, 92, - 0, 21, 0, 22, 0, 9, 0, 10, 0, 11, - 0, 14, 0, 17, 0, 153, 0, 0, 153, 132, - 0, 0, 15, 0, 18, 0, 156, 132, 0, 0, - 35, 0, 37, 0, 36, 0, 38, 0, 40, 0, - 39, 0, 41, 0, 43, 0, 0, 131, 0, 0, - 39, 0, 41, 0, 0, 35, 0, 36, 0, 37, - 0, 40, 0, 0, 54, 0, 55, 0, 56, 0, - 57, 0, 58, 0, 53, 4, 0, 110, 0, 111, - 0, 128, 0, 129, 0, 0, 165, 164, 0, 127, - 0, 164, 0, 0, 167, 166, 0, 0, 46, 4, - 0, 0, 133, 46, 4, 0, 29, 17, 0, 0, - 170, 0, 0, 133, 173, 172, 0, 170, 0, 46, - 4, 0, 9, 0, 10, 0, 11, 0, 12, 0, - 42, 0, 174, 0, 175, 134, 0, 207, 0, 135, - 4, 0, 175, 136, 179, 137, 167, 0, 8, 136, - 179, 137, 167, 0, 138, 4, 139, 175, 140, 0, - 141, 4, 139, 175, 142, 0, 143, 180, 144, 0, - 143, 144, 0, 141, 143, 180, 144, 142, 0, 141, - 143, 144, 142, 0, 175, 165, 0, 175, 0, 8, - 0, 176, 0, 178, 133, 176, 0, 178, 0, 178, - 133, 32, 0, 32, 0, 0, 175, 0, 180, 133, - 175, 0, 175, 138, 183, 140, 0, 175, 138, 140, - 0, 175, 145, 17, 0, 175, 141, 183, 142, 0, - 175, 143, 183, 144, 0, 175, 143, 144, 0, 175, - 141, 143, 183, 144, 142, 0, 175, 141, 143, 144, - 142, 0, 175, 33, 0, 175, 34, 0, 175, 207, - 0, 175, 182, 0, 175, 20, 0, 151, 3, 0, - 151, 4, 0, 9, 21, 0, 9, 22, 0, 152, - 7, 0, 148, 136, 181, 31, 175, 137, 0, 108, - 136, 181, 218, 137, 0, 122, 136, 181, 133, 181, - 133, 181, 137, 0, 146, 136, 181, 133, 181, 137, - 0, 147, 136, 181, 133, 181, 137, 0, 81, 149, - 136, 181, 133, 181, 137, 0, 82, 150, 136, 181, - 133, 181, 137, 0, 124, 136, 181, 133, 181, 137, - 0, 125, 136, 181, 133, 181, 133, 181, 137, 0, - 126, 136, 181, 133, 181, 133, 181, 137, 0, 183, - 133, 181, 0, 181, 0, 27, 0, 28, 0, 186, - 0, 0, 187, 0, 186, 187, 0, 0, 26, 188, - 203, 0, 0, 25, 189, 204, 0, 51, 50, 193, - 0, 19, 0, 155, 13, 175, 0, 155, 13, 8, - 0, 0, 157, 160, 184, 181, 190, 172, 0, 0, - 157, 158, 160, 184, 181, 191, 172, 0, 0, 157, - 159, 160, 184, 175, 192, 172, 0, 44, 194, 0, - 47, 132, 195, 0, 17, 0, 45, 132, 17, 0, - 59, 132, 17, 0, 138, 196, 140, 0, 196, 133, - 17, 0, 17, 0, 0, 197, 133, 175, 165, 154, - 0, 175, 165, 154, 0, 197, 0, 197, 133, 32, - 0, 32, 0, 0, 163, 177, 156, 136, 198, 137, - 167, 171, 168, 0, 23, 0, 143, 0, 162, 160, - 199, 200, 0, 24, 0, 144, 0, 210, 202, 0, - 161, 160, 199, 0, 0, 52, 0, 3, 0, 4, - 0, 7, 0, 21, 0, 22, 0, 33, 0, 34, - 0, 20, 0, 141, 183, 142, 0, 182, 0, 50, - 205, 17, 133, 17, 0, 5, 0, 6, 0, 153, - 0, 156, 0, 207, 0, 206, 0, 175, 208, 0, - 210, 211, 0, 201, 211, 0, 212, 155, 213, 0, - 212, 215, 0, 0, 16, 0, 60, 209, 0, 60, - 8, 0, 61, 12, 208, 0, 61, 9, 208, 133, - 12, 208, 133, 12, 208, 0, 62, 151, 208, 133, - 12, 208, 138, 214, 140, 0, 62, 151, 208, 133, - 12, 208, 138, 140, 0, 63, 163, 177, 208, 136, - 217, 137, 167, 31, 12, 208, 64, 12, 208, 0, - 64, 0, 65, 0, 214, 151, 206, 133, 12, 208, - 0, 151, 206, 133, 12, 208, 0, 155, 220, 0, - 175, 138, 208, 133, 208, 140, 0, 216, 133, 138, - 208, 133, 208, 140, 0, 175, 208, 165, 0, 217, - 133, 175, 208, 165, 0, 0, 0, 218, 133, 209, - 0, 49, 48, 0, 48, 0, 146, 175, 208, 133, - 208, 0, 147, 175, 208, 133, 208, 0, 81, 149, - 175, 208, 133, 208, 0, 82, 150, 175, 208, 133, - 208, 0, 148, 209, 31, 175, 0, 122, 209, 133, - 209, 133, 209, 0, 123, 209, 133, 175, 0, 124, - 209, 133, 209, 0, 125, 209, 133, 209, 133, 209, - 0, 126, 209, 133, 209, 133, 209, 0, 121, 216, - 0, 219, 163, 177, 208, 136, 217, 137, 167, 0, - 222, 0, 30, 0, 0, 103, 175, 169, 0, 103, - 175, 133, 9, 208, 169, 0, 104, 175, 169, 0, - 104, 175, 133, 9, 208, 169, 0, 105, 209, 0, - 221, 106, 175, 208, 0, 221, 107, 209, 133, 175, - 208, 0, 108, 175, 208, 218, 0 -}; +/* Line 216 of yacc.c. */ +#line 1312 "llvmAsmParser.tab.c" +#ifdef short +# undef short #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1049, - 1049, 1049, 1049, 1049, 1049, 1050, 1050, 1050, 1050, 1050, - 1050, 1050, 1051, 1051, 1051, 1051, 1051, 1054, 1054, 1055, - 1055, 1056, 1056, 1057, 1057, 1058, 1058, 1062, 1062, 1063, - 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, 1067, 1068, - 1068, 1069, 1070, 1075, 1076, 1076, 1078, 1078, 1079, 1079, - 1083, 1087, 1092, 1092, 1094, 1098, 1104, 1105, 1106, 1107, - 1108, 1112, 1113, 1114, 1118, 1119, 1123, 1124, 1125, 1129, - 1130, 1131, 1132, 1133, 1136, 1136, 1137, 1138, 1139, 1140, - 1141, 1149, 1150, 1151, 1152, 1155, 1156, 1161, 1162, 1165, - 1166, 1173, 1173, 1180, 1180, 1189, 1197, 1197, 1203, 1203, - 1205, 1210, 1223, 1223, 1223, 1223, 1226, 1230, 1234, 1241, - 1246, 1254, 1272, 1290, 1295, 1307, 1317, 1321, 1331, 1338, - 1345, 1352, 1357, 1362, 1369, 1370, 1377, 1384, 1392, 1397, - 1408, 1436, 1452, 1481, 1509, 1534, 1553, 1578, 1597, 1609, - 1616, 1682, 1692, 1702, 1708, 1714, 1719, 1724, 1732, 1744, - 1765, 1773, 1779, 1790, 1795, 1800, 1806, 1812, 1821, 1825, - 1833, 1833, 1844, 1849, 1857, 1858, 1862, 1862, 1866, 1866, - 1869, 1872, 1884, 1908, 1919, 1926, 1929, 1934, 1937, 1943, - 1947, 1950, 1956, 1969, 1973, 1978, 1980, 1985, 1990, 1999, - 2009, 2020, 2024, 2033, 2042, 2047, 2159, 2159, 2161, 2170, - 2170, 2172, 2177, 2189, 2193, 2198, 2202, 2206, 2210, 2214, - 2218, 2222, 2226, 2230, 2255, 2259, 2273, 2277, 2281, 2285, - 2291, 2291, 2297, 2306, 2310, 2319, 2329, 2338, 2350, 2363, - 2367, 2371, 2376, 2386, 2405, 2414, 2481, 2485, 2492, 2503, - 2516, 2526, 2537, 2547, 2555, 2563, 2566, 2567, 2574, 2578, - 2583, 2604, 2621, 2634, 2647, 2659, 2667, 2674, 2680, 2686, - 2692, 2707, 2771, 2776, 2780, 2787, 2794, 2802, 2809, 2817, - 2825, 2839, 2856 -}; +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; #endif +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif -static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", -"EUINT64VAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL","VOID","INTTYPE","FLOAT","DOUBLE", -"LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT", -"IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK", -"DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO","DOTDOTDOT", -"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", -"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","DEPLIBS","CALL", -"TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK", -"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE", -"UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV","SDIV","FDIV","UREM","SREM", -"FREM","AND","OR","XOR","SHL","LSHR","ASHR","ICMP","FCMP","EQ","NE","SLT","SGT", -"SLE","SGE","ULT","UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD", -"UNO","UEQ","UNE","MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","TRUNC", -"ZEXT","SEXT","FPTRUNC","FPEXT","BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI", -"INTTOPTR","PTRTOINT","PHI_TOK","SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT", -"SHUFFLEVECTOR","NORETURN","INREG","SRET","DEFAULT","HIDDEN","'='","','","'*'", -"'\\\\'","'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps", -"LogicalOps","CastOps","IPredicates","FPredicates","IntType","FPType","LocalName", -"OptLocalName","OptLocalAssign","GlobalName","OptGlobalAssign","GVInternalLinkage", -"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage", -"OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs","OptAlign", -"OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", -"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI", -"ConstVal","ConstExpr","ConstVector","GlobalType","Module","DefinitionList", -"Definition","@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", -"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", -"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", -"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", -"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", -"OptVolatile","MemoryInst", NULL -}; +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; #endif -static const short yyr1[] = { 0, - 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, - 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 150, 151, 152, 152, 153, 153, 154, 154, - 155, 155, 156, 156, 157, 157, 158, 158, 158, 158, - 158, 159, 159, 159, 160, 160, 161, 161, 161, 162, - 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, - 163, 164, 164, 164, 164, 165, 165, 166, 166, 167, - 167, 168, 168, 169, 169, 170, 171, 171, 172, 172, - 173, 173, 174, 174, 174, 174, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, - 177, 177, 178, 178, 179, 179, 179, 179, 180, 180, - 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, - 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, - 184, 184, 185, 185, 186, 186, 188, 187, 189, 187, - 187, 187, 187, 187, 190, 187, 191, 187, 192, 187, - 187, 187, 193, 194, 194, 195, 196, 196, 196, 197, - 197, 198, 198, 198, 198, 199, 200, 200, 201, 202, - 202, 203, 204, 205, 205, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, - 208, 208, 209, 210, 210, 211, 212, 212, 212, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, - 215, 216, 216, 217, 217, 217, 218, 218, 219, 219, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 221, 221, 222, 222, 222, 222, 222, - 222, 222, 222 -}; +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif -static const short yyr2[] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 0, 2, 1, 1, 0, - 2, 0, 2, 0, 3, 2, 0, 1, 0, 3, - 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, - 2, 5, 5, 5, 5, 3, 2, 5, 4, 2, - 1, 1, 1, 3, 1, 3, 1, 0, 1, 3, - 4, 3, 3, 4, 4, 3, 6, 5, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 6, 5, - 8, 6, 6, 7, 7, 6, 8, 8, 3, 1, - 1, 1, 1, 0, 1, 2, 0, 3, 0, 3, - 3, 1, 3, 3, 0, 6, 0, 7, 0, 7, - 2, 3, 1, 3, 3, 3, 3, 1, 0, 5, - 3, 1, 3, 1, 0, 9, 1, 1, 4, 1, - 1, 2, 3, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 5, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 3, 2, 0, 1, 2, - 2, 3, 9, 9, 8, 14, 1, 1, 6, 5, - 2, 6, 7, 3, 5, 0, 0, 3, 2, 1, - 5, 5, 6, 6, 4, 6, 4, 4, 6, 6, - 2, 8, 1, 1, 0, 3, 6, 3, 6, 2, - 4, 6, 4 -}; +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif -static const short yydefact[] = { 66, - 57, 63, 58, 64, 182, 179, 177, 0, 0, 0, - 0, 0, 0, 75, 66, 175, 77, 80, 0, 0, - 191, 0, 0, 61, 0, 65, 67, 69, 68, 70, - 72, 71, 73, 74, 76, 75, 75, 0, 176, 78, - 79, 75, 180, 81, 82, 83, 84, 75, 238, 178, - 238, 0, 0, 199, 192, 193, 181, 227, 228, 184, - 113, 114, 115, 116, 117, 0, 0, 0, 0, 229, - 230, 118, 183, 120, 0, 0, 171, 172, 0, 85, - 85, 239, 235, 62, 210, 211, 212, 234, 194, 195, - 198, 0, 138, 121, 0, 0, 0, 0, 127, 139, - 0, 119, 138, 0, 0, 113, 114, 115, 0, 0, - 0, 185, 0, 86, 87, 88, 89, 90, 0, 213, - 0, 275, 237, 0, 196, 137, 96, 133, 135, 0, - 0, 0, 0, 0, 0, 126, 0, 187, 189, 156, - 157, 154, 155, 158, 153, 149, 150, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 13, 14, 15, 10, - 11, 12, 0, 0, 0, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 152, 151, - 109, 91, 132, 131, 0, 207, 208, 209, 274, 260, - 0, 0, 0, 0, 85, 247, 248, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 236, 85, 251, 0, 273, 197, 130, 0, - 100, 0, 0, 129, 0, 140, 100, 109, 109, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 0, - 52, 53, 48, 49, 50, 51, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, - 0, 0, 142, 170, 0, 0, 0, 146, 0, 143, - 0, 0, 0, 0, 186, 0, 259, 241, 0, 240, - 0, 0, 54, 0, 0, 0, 0, 104, 104, 280, - 0, 0, 271, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 92, 93, 94, 95, 97, 136, - 134, 123, 124, 125, 128, 122, 188, 190, 0, 0, - 257, 0, 0, 0, 0, 0, 141, 127, 139, 0, - 144, 145, 0, 0, 0, 0, 0, 111, 109, 205, - 216, 217, 218, 223, 219, 220, 221, 222, 214, 0, - 225, 232, 231, 233, 0, 242, 0, 0, 0, 0, - 0, 276, 0, 278, 257, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, - 101, 0, 0, 0, 0, 0, 0, 0, 169, 148, - 0, 0, 0, 0, 106, 112, 110, 204, 96, 202, - 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 283, 0, 0, 0, 267, 268, 0, 0, - 0, 0, 265, 0, 281, 0, 0, 0, 0, 160, - 0, 0, 0, 0, 147, 0, 0, 0, 60, 0, - 100, 0, 224, 0, 0, 256, 0, 0, 104, 105, - 104, 0, 0, 0, 0, 0, 261, 262, 256, 0, - 0, 0, 258, 0, 166, 0, 0, 162, 163, 159, - 59, 201, 203, 96, 107, 0, 0, 0, 0, 0, - 263, 264, 0, 277, 279, 0, 0, 266, 269, 270, - 0, 282, 164, 165, 0, 0, 0, 60, 108, 102, - 226, 0, 0, 96, 0, 100, 252, 0, 100, 161, - 167, 168, 200, 0, 206, 0, 245, 0, 0, 254, - 0, 0, 253, 272, 103, 243, 0, 244, 0, 96, - 0, 0, 0, 255, 0, 0, 0, 0, 250, 0, - 0, 249, 0, 246, 0, 0, 0 -}; +#if ! defined yyoverflow || YYERROR_VERBOSE -static const short yydefgoto[] = { 186, - 187, 188, 250, 267, 109, 110, 70, 482, 12, 71, - 14, 36, 37, 38, 42, 48, 119, 319, 229, 391, - 322, 525, 372, 348, 510, 285, 349, 72, 111, 128, - 195, 129, 130, 101, 274, 361, 275, 79, 555, 15, - 16, 18, 17, 191, 238, 239, 57, 21, 55, 92, - 410, 411, 120, 198, 49, 87, 50, 43, 413, 362, - 74, 364, 290, 51, 83, 84, 223, 529, 123, 303, - 490, 394, 224, 225, 226, 227 +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 40 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1439 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 146 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 78 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 284 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 557 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 386 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 136, 137, 134, 2, 133, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 141, 132, 142, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 138, 135, 140, 2, 2, 2, 2, 2, 145, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 139, 2, 2, 143, 2, 144, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131 }; -static const short yypact[] = { 438, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 27, -119, -29, - -84, 43, -57, -6, 525,-32768, 195, 140, -38, -27, --32768, -39, 112,-32768, 828,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 32, 32, 227,-32768,-32768, --32768, 32,-32768,-32768,-32768,-32768,-32768, 32, 119,-32768, - -2, 188, 210, 213,-32768,-32768,-32768,-32768,-32768, 49, --32768,-32768,-32768,-32768,-32768, 214, 245, 5, 104,-32768, --32768,-32768, 110,-32768, 227, 227,-32768,-32768, 1043, 154, - 154,-32768,-32768, 109,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -89, 1085,-32768, 125, 139, 122, 49,-32768, 110, - -55,-32768, 1085, 1043, 1188, 46, 249, 272, 266, 273, - 589,-32768, 279,-32768,-32768,-32768,-32768,-32768, 1204,-32768, - 2, 1327,-32768, 268,-32768,-32768, 110,-32768, 153, 150, - 1188, 1188, 149, -53, 1188,-32768, 155,-32768, 110,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 494, 943, 157,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 158, 159, 163, - 164, 790, 1226, 495, 284, 166, 167, 169,-32768,-32768, - 173,-32768, 49, 110, 28,-32768,-32768,-32768,-32768,-32768, - 262, 1243, 142, 302, 154,-32768,-32768, 494, 943, 1188, - 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, - 1188, 1188,-32768, 154,-32768, 168,-32768,-32768, -58, 1124, --32768, 25, 16,-32768, 170, 110,-32768, 173, 173,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 177, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 181, 1043, 1043, 1043, - 1043, 1043,-32768,-32768, 20, 668, -40,-32768, -48,-32768, - 1043, 1043, 1043, 18,-32768, 182,-32768, 49, 747,-32768, - 872, 872,-32768, 872, 1204, 1188, 1188, 99, 117,-32768, - 747, 33, 186, 187, 191, 192, 198, 200, 747, 747, - 290, 1204, 1188, 1188,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -87,-32768,-32768,-32768, -87,-32768,-32768, 1043, 1043, --32768, 203, 204, 205, 209, 1043,-32768, 202, 589, -43, --32768,-32768, 216, 218, 312, 328, 342,-32768, 173, 1140, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 295, 1043, --32768,-32768,-32768,-32768, 219,-32768, 229, 872, 747, 747, - 8,-32768, 17,-32768,-32768, 872, 225, 1188, 1188, 1188, - 1188, 1188, 231, 232, 1188, 872, 747, 233,-32768,-32768, --32768, 234, 235, -33, 1043, 1043, 1043, 1043,-32768,-32768, - 230, 1043, 1043, 1188,-32768,-32768,-32768,-32768, 110, 238, - 236,-32768, 357, -36, 363, 364, 241, 246, 248, 872, - 374, 872, 251, 254, 872, 255, 110,-32768, 256, 258, - 872, 872, 110, 260,-32768, 1188, 1043, 1043, 1188,-32768, - 261, 263, 264, 270,-32768, 267, 276, 47, 130, 1159, --32768, 274,-32768, 872, 872, 1188, 872, 872, 281,-32768, - 281, 872, 283, 1188, 1188, 1188,-32768,-32768, 1188, 747, - 282, 285,-32768, 1043,-32768, 1043, 1043,-32768,-32768,-32768, --32768,-32768,-32768, 110, 45, 382, 287, 280, 747, -13, --32768,-32768, 355,-32768,-32768, 265, 872,-32768,-32768,-32768, - 29,-32768,-32768,-32768, 286, 291, 292, 130,-32768, 375, --32768, 412, 1,-32768, 1188,-32768,-32768, 293,-32768,-32768, --32768,-32768,-32768, 423,-32768, 872,-32768, 996, 9, -58, - 747, 212,-32768, -87,-32768,-32768, 297,-32768, 996,-32768, - 419, 422, 303, -58, 872, 872, 425, 371,-32768, 872, - 427,-32768, 872,-32768, 443, 444,-32768 +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, + 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 122, 125, 126, 128, 130, 133, 134, 136, + 138, 140, 142, 144, 146, 148, 150, 151, 153, 154, + 156, 158, 159, 161, 163, 165, 167, 168, 170, 172, + 174, 176, 178, 181, 183, 185, 187, 189, 190, 193, + 195, 197, 198, 201, 202, 205, 206, 210, 213, 214, + 216, 217, 221, 223, 226, 228, 230, 232, 234, 236, + 238, 241, 243, 246, 252, 258, 264, 270, 274, 277, + 283, 288, 291, 293, 295, 297, 301, 303, 307, 309, + 310, 312, 316, 321, 325, 329, 334, 339, 343, 350, + 356, 359, 362, 365, 368, 371, 374, 377, 380, 383, + 386, 393, 399, 408, 415, 422, 430, 438, 445, 454, + 463, 467, 469, 471, 473, 475, 476, 478, 481, 482, + 486, 487, 491, 495, 497, 501, 505, 506, 513, 514, + 522, 523, 531, 534, 538, 540, 544, 548, 552, 556, + 558, 559, 565, 569, 571, 575, 577, 578, 588, 590, + 592, 597, 599, 601, 604, 608, 609, 611, 613, 615, + 617, 619, 621, 623, 625, 627, 631, 633, 639, 641, + 643, 645, 647, 649, 651, 654, 657, 660, 664, 667, + 668, 670, 673, 676, 680, 690, 700, 709, 724, 726, + 728, 735, 741, 744, 751, 759, 763, 769, 770, 771, + 775, 778, 780, 786, 792, 799, 806, 811, 818, 823, + 828, 835, 842, 845, 854, 856, 858, 859, 863, 870, + 874, 881, 884, 889, 896 }; -static const short yypgoto[] = { 324, - 325, 326, 242, 252, -197,-32768, 0, -50, 376, 4, --32768,-32768,-32768, 40,-32768,-32768, -167, -306, -397,-32768, - -235,-32768, -291, -23,-32768, -211,-32768,-32768, -24, 237, - -229,-32768, 362, 369, -68, -108, -178, 201,-32768,-32768, - 453,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 391,-32768,-32768,-32768,-32768,-32768,-32768, -436, - -72, 101, -157,-32768, 424,-32768,-32768,-32768,-32768,-32768, - 7, 105,-32768,-32768,-32768,-32768 +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 186, 0, -1, 66, -1, 67, -1, 68, -1, 69, + -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, + -1, 78, -1, 79, -1, 80, -1, 75, -1, 76, + -1, 77, -1, 109, -1, 110, -1, 111, -1, 112, + -1, 113, -1, 114, -1, 115, -1, 116, -1, 117, + -1, 118, -1, 119, -1, 120, -1, 83, -1, 84, + -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, + -1, 90, -1, 91, -1, 92, -1, 93, -1, 94, + -1, 95, -1, 96, -1, 97, -1, 98, -1, 99, + -1, 100, -1, 101, -1, 102, -1, 89, -1, 90, + -1, 91, -1, 92, -1, 21, -1, 22, -1, 9, + -1, 10, -1, 11, -1, 14, -1, 17, -1, 154, + -1, -1, 154, 132, -1, -1, 15, -1, 18, -1, + 157, 132, -1, -1, 35, -1, 37, -1, 36, -1, + 38, -1, 40, -1, 39, -1, 41, -1, 43, -1, + -1, 131, -1, -1, 39, -1, 41, -1, -1, 35, + -1, 36, -1, 37, -1, 40, -1, -1, 54, -1, + 55, -1, 56, -1, 57, -1, 58, -1, 53, 4, + -1, 110, -1, 111, -1, 128, -1, 129, -1, -1, + 166, 165, -1, 127, -1, 165, -1, -1, 168, 167, + -1, -1, 46, 4, -1, -1, 133, 46, 4, -1, + 29, 17, -1, -1, 171, -1, -1, 133, 174, 173, + -1, 171, -1, 46, 4, -1, 9, -1, 10, -1, + 11, -1, 12, -1, 42, -1, 175, -1, 176, 134, + -1, 208, -1, 135, 4, -1, 176, 136, 180, 137, + 168, -1, 8, 136, 180, 137, 168, -1, 138, 4, + 139, 176, 140, -1, 141, 4, 139, 176, 142, -1, + 143, 181, 144, -1, 143, 144, -1, 141, 143, 181, + 144, 142, -1, 141, 143, 144, 142, -1, 176, 166, + -1, 176, -1, 8, -1, 177, -1, 179, 133, 177, + -1, 179, -1, 179, 133, 32, -1, 32, -1, -1, + 176, -1, 181, 133, 176, -1, 176, 138, 184, 140, + -1, 176, 138, 140, -1, 176, 145, 17, -1, 176, + 141, 184, 142, -1, 176, 143, 184, 144, -1, 176, + 143, 144, -1, 176, 141, 143, 184, 144, 142, -1, + 176, 141, 143, 144, 142, -1, 176, 33, -1, 176, + 34, -1, 176, 208, -1, 176, 183, -1, 176, 20, + -1, 152, 3, -1, 152, 4, -1, 9, 21, -1, + 9, 22, -1, 153, 7, -1, 149, 136, 182, 31, + 176, 137, -1, 108, 136, 182, 219, 137, -1, 122, + 136, 182, 133, 182, 133, 182, 137, -1, 147, 136, + 182, 133, 182, 137, -1, 148, 136, 182, 133, 182, + 137, -1, 81, 150, 136, 182, 133, 182, 137, -1, + 82, 151, 136, 182, 133, 182, 137, -1, 124, 136, + 182, 133, 182, 137, -1, 125, 136, 182, 133, 182, + 133, 182, 137, -1, 126, 136, 182, 133, 182, 133, + 182, 137, -1, 184, 133, 182, -1, 182, -1, 27, + -1, 28, -1, 187, -1, -1, 188, -1, 187, 188, + -1, -1, 26, 189, 204, -1, -1, 25, 190, 205, + -1, 51, 50, 194, -1, 19, -1, 156, 13, 176, + -1, 156, 13, 8, -1, -1, 158, 161, 185, 182, + 191, 173, -1, -1, 158, 159, 161, 185, 182, 192, + 173, -1, -1, 158, 160, 161, 185, 176, 193, 173, + -1, 44, 195, -1, 47, 132, 196, -1, 17, -1, + 45, 132, 17, -1, 59, 132, 17, -1, 138, 197, + 140, -1, 197, 133, 17, -1, 17, -1, -1, 198, + 133, 176, 166, 155, -1, 176, 166, 155, -1, 198, + -1, 198, 133, 32, -1, 32, -1, -1, 164, 178, + 157, 136, 199, 137, 168, 172, 169, -1, 23, -1, + 143, -1, 163, 161, 200, 201, -1, 24, -1, 144, + -1, 211, 203, -1, 162, 161, 200, -1, -1, 52, + -1, 3, -1, 4, -1, 7, -1, 21, -1, 22, + -1, 33, -1, 34, -1, 20, -1, 141, 184, 142, + -1, 183, -1, 50, 206, 17, 133, 17, -1, 5, + -1, 6, -1, 154, -1, 157, -1, 208, -1, 207, + -1, 176, 209, -1, 211, 212, -1, 202, 212, -1, + 213, 156, 214, -1, 213, 216, -1, -1, 16, -1, + 60, 210, -1, 60, 8, -1, 61, 12, 209, -1, + 61, 9, 209, 133, 12, 209, 133, 12, 209, -1, + 62, 152, 209, 133, 12, 209, 138, 215, 140, -1, + 62, 152, 209, 133, 12, 209, 138, 140, -1, 63, + 164, 178, 209, 136, 218, 137, 168, 31, 12, 209, + 64, 12, 209, -1, 64, -1, 65, -1, 215, 152, + 207, 133, 12, 209, -1, 152, 207, 133, 12, 209, + -1, 156, 221, -1, 176, 138, 209, 133, 209, 140, + -1, 217, 133, 138, 209, 133, 209, 140, -1, 176, + 209, 166, -1, 218, 133, 176, 209, 166, -1, -1, + -1, 219, 133, 210, -1, 49, 48, -1, 48, -1, + 147, 176, 209, 133, 209, -1, 148, 176, 209, 133, + 209, -1, 81, 150, 176, 209, 133, 209, -1, 82, + 151, 176, 209, 133, 209, -1, 149, 210, 31, 176, + -1, 122, 210, 133, 210, 133, 210, -1, 123, 210, + 133, 176, -1, 124, 210, 133, 210, -1, 125, 210, + 133, 210, 133, 210, -1, 126, 210, 133, 210, 133, + 210, -1, 121, 217, -1, 220, 164, 178, 209, 136, + 218, 137, 168, -1, 223, -1, 30, -1, -1, 103, + 176, 170, -1, 103, 176, 133, 9, 209, 170, -1, + 104, 176, 170, -1, 104, 176, 133, 9, 209, 170, + -1, 105, 210, -1, 222, 106, 176, 209, -1, 222, + 107, 210, 133, 176, 209, -1, 108, 176, 209, 219, + -1 }; +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1049, 1049, 1049, 1049, 1049, 1049, 1050, 1050, 1050, + 1050, 1050, 1050, 1051, 1051, 1051, 1051, 1051, 1051, 1054, + 1054, 1055, 1055, 1056, 1056, 1057, 1057, 1058, 1058, 1062, + 1062, 1063, 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, + 1067, 1068, 1068, 1069, 1070, 1075, 1076, 1076, 1078, 1078, + 1079, 1079, 1083, 1087, 1092, 1092, 1094, 1098, 1104, 1105, + 1106, 1107, 1108, 1112, 1113, 1114, 1118, 1119, 1123, 1124, + 1125, 1129, 1130, 1131, 1132, 1133, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1149, 1150, 1151, 1152, 1155, 1156, 1161, + 1162, 1165, 1166, 1173, 1174, 1180, 1181, 1189, 1197, 1198, + 1203, 1204, 1205, 1210, 1223, 1223, 1223, 1223, 1226, 1230, + 1234, 1241, 1246, 1254, 1272, 1290, 1295, 1307, 1317, 1321, + 1331, 1338, 1345, 1352, 1357, 1362, 1369, 1370, 1377, 1384, + 1392, 1397, 1408, 1436, 1452, 1481, 1509, 1534, 1553, 1578, + 1597, 1609, 1616, 1682, 1692, 1702, 1708, 1714, 1719, 1724, + 1732, 1744, 1766, 1774, 1780, 1791, 1796, 1801, 1807, 1813, + 1822, 1826, 1834, 1834, 1845, 1850, 1858, 1859, 1863, 1863, + 1867, 1867, 1870, 1873, 1885, 1909, 1920, 1920, 1930, 1930, + 1938, 1938, 1948, 1951, 1957, 1970, 1974, 1979, 1981, 1986, + 1991, 2000, 2010, 2021, 2025, 2034, 2043, 2048, 2160, 2160, + 2162, 2171, 2171, 2173, 2178, 2190, 2194, 2199, 2203, 2207, + 2211, 2215, 2219, 2223, 2227, 2231, 2256, 2260, 2274, 2278, + 2282, 2286, 2292, 2292, 2298, 2307, 2311, 2320, 2330, 2339, + 2351, 2364, 2368, 2372, 2377, 2387, 2406, 2415, 2482, 2486, + 2493, 2504, 2517, 2527, 2538, 2548, 2556, 2564, 2567, 2568, + 2575, 2579, 2584, 2605, 2622, 2635, 2648, 2660, 2668, 2675, + 2681, 2687, 2693, 2708, 2772, 2777, 2781, 2788, 2795, 2803, + 2810, 2818, 2826, 2840, 2857 +}; +#endif -#define YYLAST 1453 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", + "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", "FLOAT", + "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", + "STRINGCONSTANT", "ATSTRINGCONSTANT", "IMPLEMENTATION", + "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", + "DECLARE", "DEFINE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", + "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", + "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", + "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", + "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", + "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", + "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", + "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", + "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", + "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", + "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", + "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", + "INSERTELEMENT", "SHUFFLEVECTOR", "NORETURN", "INREG", "SRET", "DEFAULT", + "HIDDEN", "'='", "','", "'*'", "'\\\\'", "'('", "')'", "'['", "'x'", + "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", + "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", + "FPType", "LocalName", "OptLocalName", "OptLocalAssign", "GlobalName", + "OptGlobalAssign", "GVInternalLinkage", "GVExternalLinkage", + "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", + "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr", + "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", + "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", + "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "Module", + "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock", + "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH", + "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", + "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", + "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", + "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", + "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", + "OptVolatile", "MemoryInst", 0 +}; +#endif +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 61, 44, 42, 92, 40, 41, 91, 120, + 93, 60, 62, 123, 125, 99 +}; +# endif -static const short yytable[] = { 11, - 73, 326, 189, 13, 277, 279, 294, 374, 96, 293, - 112, 449, 22, 82, 11, 390, 420, 293, 13, 390, - 23, 85, 315, 316, 196, 422, 327, 328, 27, 28, - 29, 30, 31, 32, 33, 138, 34, 295, 190, 389, - 317, 318, 2, 124, 100, 4, 346, 24, -54, -54, - 125, 315, 316, 421, 300, 25, 312, 304, 305, 306, - 307, 308, 421, 347, 311, 368, 140, 141, 127, 317, - 318, 19, 100, 346, 26, 75, 76, 135, 127, 135, - 139, 80, 386, 11, 336, 20, 508, 81, 136, 336, - 235, 537, 336, 52, 194, 342, 336, 340, 54, 439, - 401, 341, 543, 440, 53, 453, 232, 233, 58, 59, - 236, 98, 61, 62, 63, 64, 530, 1, 2, 515, - 3, 4, 1, 516, 35, 3, 58, 59, 56, 98, - 61, 62, 63, 64, 82, 1, 2, 407, 3, 4, - 527, 86, 544, 1, 197, 65, 3, 97, 538, 102, - 291, 103, 336, 292, 315, 316, 388, 324, 102, 337, - 103, 515, 35, 65, 323, 519, 102, 494, 103, 495, - 376, 389, 317, 318, 44, 45, 46, 289, 390, 47, - 102, 414, 103, 480, 93, 298, 299, 289, 301, 302, - 289, 289, 289, 289, 289, 309, 310, 289, 286, 331, - 332, 333, 334, 335, 89, 127, 113, 114, 115, 116, - 117, 118, 343, 344, 345, 485, 363, 94, 363, 363, - 426, 363, 428, 429, 430, 390, 90, 390, 363, 91, - 189, 371, 102, 40, 103, 41, 363, 363, 66, 315, - 316, 67, 541, 102, 68, 103, 69, 99, 95, 373, - 102, 339, 103, 77, 78, -55, 66, 317, 318, 67, - 392, 393, 68, 131, 69, 133, 190, 399, 142, 143, - 194, 369, 370, 313, 314, 104, 105, 132, -56, 144, - 532, 473, 192, 534, 228, 230, 231, 194, 387, 289, - 234, 237, 268, 269, 270, 363, 363, 363, 271, 272, - 280, 281, 282, 363, 283, 284, 498, 499, 500, 287, - 293, 325, 329, 363, 363, 528, 330, 350, 377, 378, - 385, 315, 316, 379, 380, 409, 441, 442, 443, 444, - 381, 539, 382, 446, 447, 395, 396, 397, 389, 317, - 318, 398, 404, 400, 405, 406, 412, 363, 402, 363, - 403, 415, 363, 289, 427, 289, 289, 289, 363, 363, - 433, 416, 425, 431, 432, 436, 437, 438, 471, 472, - 450, 445, 451, 452, 454, 455, 456, 460, 457, 448, - 458, 363, 363, 439, 363, 363, 462, 464, 465, 363, - 466, 365, 366, 474, 367, 469, 476, 363, 511, 475, - 421, 375, 477, 478, 517, 505, 486, 506, 507, 383, - 384, 470, 479, 493, 289, 497, 363, 513, 503, 512, - 524, 504, 520, 526, 363, 484, 535, 521, 522, 542, - 545, 489, 533, 546, 551, 547, 550, -174, 553, 289, - 289, 289, 556, 557, 489, 220, 221, 222, 481, 296, - -62, 1, 2, 363, 3, 4, 5, 523, 363, 122, - 297, 509, 6, 7, 137, 134, 321, 39, 417, 418, - 419, 121, 363, 363, 88, 501, 424, 363, 0, 423, - 363, 8, 0, 0, 9, 0, 434, 435, 10, 0, - 531, 0, 0, 0, 0, 0, 0, 0, 0, 58, - 59, 0, 98, 106, 107, 108, 64, 481, 1, 2, - 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 461, 0, -173, 463, 0, 0, 0, 0, - 0, 467, 468, 0, 0, 0, 65, -62, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 6, - 7, 0, 0, 0, 487, 488, 0, 491, 492, 0, - 0, 0, 496, 0, 0, 0, 0, 0, 8, 0, - 502, 9, 0, 0, 0, 10, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 0, 0, 0, 514, - 0, 0, 0, 58, 59, 0, 0, 518, 0, 0, - 0, 0, 1, 2, 0, 3, 4, 0, 145, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 146, 147, 0, 0, 0, 536, 0, 0, 66, - 0, 540, 67, 0, 0, 68, 0, 69, 278, 0, - 0, 0, 0, 0, 0, 548, 549, 0, 0, 0, - 552, 0, 0, 554, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 0, 58, 59, 0, 98, 106, 107, 108, 64, - 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 65, - 178, 0, 179, 180, 181, 0, 0, 0, 0, 0, - 0, 0, 102, 0, 103, 0, 182, 0, 0, 183, - 0, 184, 0, 185, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 351, - 352, 58, 59, 353, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 3, 4, 0, 354, 355, 356, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 357, - 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 58, 59, 359, 98, 106, 107, - 108, 64, 66, 1, 2, 67, 3, 4, 68, 0, - 69, 338, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 0, - 0, 65, 58, 59, 0, 60, 61, 62, 63, 64, - 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 0, 178, 65, - 179, 180, 181, 0, 351, 352, 58, 59, 353, 0, - 102, 0, 103, 0, 0, 1, 2, 360, 3, 4, - 0, 354, 355, 356, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 357, 358, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 359, 0, 0, 66, 0, 0, 67, 0, 273, - 68, 0, 69, 0, 0, 0, 0, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 0, 0, 0, 0, 0, 0, - 0, 0, 66, 251, 252, 67, 0, 0, 68, 0, - 69, 0, 0, 0, 0, 0, 0, 0, 0, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 0, 178, 0, 179, 180, 181, 351, 352, - 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 360, 0, 0, 354, 355, 356, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 357, 358, - 0, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 359, 0, 58, 59, 0, - 98, 106, 107, 108, 64, 0, 1, 2, 0, 3, - 4, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 0, 0, - 0, 0, 0, 0, 65, 0, 0, 0, 0, 58, - 59, 0, 98, 61, 62, 63, 64, 0, 1, 2, - 0, 3, 4, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 126, 178, 0, 179, - 180, 181, 0, 0, 0, 0, 65, 0, 58, 59, - 0, 98, 61, 62, 63, 64, 360, 1, 2, 0, - 3, 4, 0, 0, 58, 59, 0, 98, 61, 62, - 63, 64, 0, 1, 2, 320, 3, 4, 0, 0, - 0, 0, 0, 58, 59, 65, 98, 61, 62, 63, - 64, 408, 1, 2, 0, 3, 4, 66, 0, 0, - 67, 65, 0, 68, 0, 69, 0, 0, 0, 0, - 483, 0, 58, 59, 0, 98, 61, 62, 63, 64, - 65, 1, 2, 0, 3, 4, 0, 0, 58, 59, - 0, 193, 61, 62, 63, 64, 0, 1, 2, 66, - 3, 4, 67, 0, 0, 68, 0, 69, 0, 65, - 58, 59, 0, 98, 106, 107, 108, 64, 0, 1, - 2, 0, 3, 4, 0, 65, 0, 58, 59, 0, - 288, 61, 62, 63, 64, 0, 1, 2, 66, 3, - 4, 67, 0, 0, 68, 0, 69, 65, 0, 0, - 0, 0, 0, 0, 66, 0, 0, 67, 0, 0, - 68, 0, 69, 0, 65, 0, 0, 0, 0, 0, - 0, 0, 0, 66, 0, 0, 67, 0, 0, 68, - 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 66, 0, 0, 67, 0, 0, 68, 0, - 69, 0, 0, 0, 0, 0, 0, 0, 66, 0, - 0, 67, 0, 0, 68, 0, 69, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, - 66, 0, 0, 67, 0, 0, 68, 0, 276, 0, - 0, 0, 0, 0, 200, 201, 0, 66, 0, 0, - 67, 0, 0, 68, 0, 69, 202, 203, 204, 205, - 206, 207, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 208, 209, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, - 211, 212, 0, 0, 213, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 214, 215, 216, - 217, 218, 219 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 146, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 148, 148, 148, 148, 148, 148, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 152, 153, 153, 154, 154, + 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, + 159, 159, 159, 160, 160, 160, 161, 161, 162, 162, + 162, 163, 163, 163, 163, 163, 164, 164, 164, 164, + 164, 164, 164, 165, 165, 165, 165, 166, 166, 167, + 167, 168, 168, 169, 169, 170, 170, 171, 172, 172, + 173, 173, 174, 174, 175, 175, 175, 175, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 177, 178, 178, 179, 179, 180, 180, 180, 180, + 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 184, 184, 185, 185, 186, 186, 187, 187, 189, 188, + 190, 188, 188, 188, 188, 188, 191, 188, 192, 188, + 193, 188, 188, 188, 194, 195, 195, 196, 197, 197, + 197, 198, 198, 199, 199, 199, 199, 200, 201, 201, + 202, 203, 203, 204, 205, 206, 206, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, + 208, 208, 209, 209, 210, 211, 211, 212, 213, 213, + 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 215, 215, 216, 217, 217, 218, 218, 218, 219, 219, + 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 222, 222, 223, 223, 223, + 223, 223, 223, 223, 223 }; -static const short yycheck[] = { 0, - 25, 237, 111, 0, 183, 184, 204, 299, 4, 9, - 79, 409, 132, 16, 15, 322, 9, 9, 15, 326, - 50, 24, 110, 111, 23, 9, 238, 239, 35, 36, - 37, 38, 39, 40, 41, 104, 43, 205, 111, 127, - 128, 129, 15, 133, 69, 18, 29, 132, 3, 4, - 140, 110, 111, 46, 212, 13, 224, 215, 216, 217, - 218, 219, 46, 46, 222, 295, 21, 22, 93, 128, - 129, 45, 97, 29, 132, 36, 37, 133, 103, 133, - 105, 42, 312, 84, 133, 59, 484, 48, 144, 133, - 144, 528, 133, 132, 119, 144, 133, 276, 138, 133, - 144, 142, 539, 137, 132, 142, 131, 132, 5, 6, - 135, 8, 9, 10, 11, 12, 514, 14, 15, 133, - 17, 18, 14, 137, 131, 17, 5, 6, 17, 8, - 9, 10, 11, 12, 16, 14, 15, 349, 17, 18, - 140, 144, 540, 14, 143, 42, 17, 143, 140, 134, - 9, 136, 133, 12, 110, 111, 314, 142, 134, 140, - 136, 133, 131, 42, 140, 137, 134, 459, 136, 461, - 138, 127, 128, 129, 35, 36, 37, 202, 485, 40, - 134, 360, 136, 137, 136, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 195, 268, - 269, 270, 271, 272, 17, 230, 53, 54, 55, 56, - 57, 58, 281, 282, 283, 451, 289, 4, 291, 292, - 378, 294, 380, 381, 382, 532, 17, 534, 301, 17, - 339, 133, 134, 39, 136, 41, 309, 310, 135, 110, - 111, 138, 31, 134, 141, 136, 143, 144, 4, 133, - 134, 276, 136, 27, 28, 7, 135, 128, 129, 138, - 329, 330, 141, 139, 143, 144, 339, 336, 3, 4, - 295, 296, 297, 106, 107, 75, 76, 139, 7, 7, - 516, 439, 4, 519, 17, 133, 137, 312, 313, 314, - 142, 137, 136, 136, 136, 368, 369, 370, 136, 136, - 17, 136, 136, 376, 136, 133, 464, 465, 466, 48, - 9, 142, 136, 386, 387, 513, 136, 136, 133, 133, - 31, 110, 111, 133, 133, 350, 395, 396, 397, 398, - 133, 529, 133, 402, 403, 133, 133, 133, 127, 128, - 129, 133, 31, 142, 17, 4, 52, 420, 133, 422, - 133, 133, 425, 378, 379, 380, 381, 382, 431, 432, - 385, 133, 138, 133, 133, 133, 133, 133, 437, 438, - 133, 142, 137, 17, 12, 12, 136, 4, 133, 404, - 133, 454, 455, 133, 457, 458, 133, 133, 133, 462, - 133, 291, 292, 133, 294, 136, 133, 470, 17, 137, - 46, 301, 133, 137, 140, 474, 133, 476, 477, 309, - 310, 436, 137, 133, 439, 133, 489, 138, 137, 133, - 46, 137, 137, 12, 497, 450, 4, 137, 137, 133, - 12, 456, 140, 12, 64, 133, 12, 0, 12, 464, - 465, 466, 0, 0, 469, 122, 122, 122, 449, 208, - 13, 14, 15, 526, 17, 18, 19, 508, 531, 84, - 209, 485, 25, 26, 103, 97, 230, 15, 368, 369, - 370, 81, 545, 546, 51, 469, 376, 550, -1, 375, - 553, 44, -1, -1, 47, -1, 386, 387, 51, -1, - 515, -1, -1, -1, -1, -1, -1, -1, -1, 5, - 6, -1, 8, 9, 10, 11, 12, 508, 14, 15, - -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, - 420, -1, 422, -1, 0, 425, -1, -1, -1, -1, - -1, 431, 432, -1, -1, -1, 42, 13, 14, 15, - -1, 17, 18, 19, -1, -1, -1, -1, -1, 25, - 26, -1, -1, -1, 454, 455, -1, 457, 458, -1, - -1, -1, 462, -1, -1, -1, -1, -1, 44, -1, - 470, 47, -1, -1, -1, 51, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, -1, -1, -1, 489, - -1, -1, -1, 5, 6, -1, -1, 497, -1, -1, - -1, -1, 14, 15, -1, 17, 18, -1, 20, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 33, 34, -1, -1, -1, 526, -1, -1, 135, - -1, 531, 138, -1, -1, 141, -1, 143, 144, -1, - -1, -1, -1, -1, -1, 545, 546, -1, -1, -1, - 550, -1, -1, 553, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, -1, 5, 6, -1, 8, 9, 10, 11, 12, - -1, 14, 15, -1, 17, 18, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 42, - 122, -1, 124, 125, 126, -1, -1, -1, -1, -1, - -1, -1, 134, -1, 136, -1, 138, -1, -1, 141, - -1, 143, -1, 145, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, - 4, 5, 6, 7, -1, -1, -1, -1, -1, -1, - 14, 15, -1, 17, 18, -1, 20, 21, 22, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, - 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 5, 6, 50, 8, 9, 10, - 11, 12, 135, 14, 15, 138, 17, 18, 141, -1, - 143, 144, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, - -1, 42, 5, 6, -1, 8, 9, 10, 11, 12, - -1, 14, 15, -1, 17, 18, -1, -1, -1, -1, - -1, -1, -1, -1, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, -1, 122, 42, - 124, 125, 126, -1, 3, 4, 5, 6, 7, -1, - 134, -1, 136, -1, -1, 14, 15, 141, 17, 18, - -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 33, 34, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 50, -1, -1, 135, -1, -1, 138, -1, 140, - 141, -1, 143, -1, -1, -1, -1, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, -1, -1, -1, -1, -1, -1, - -1, -1, 135, 21, 22, 138, -1, -1, 141, -1, - 143, -1, -1, -1, -1, -1, -1, -1, -1, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, -1, 122, -1, 124, 125, 126, 3, 4, - -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 141, -1, -1, 20, 21, 22, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, - -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 50, -1, 5, 6, -1, - 8, 9, 10, 11, 12, -1, 14, 15, -1, 17, - 18, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, - -1, -1, -1, -1, 42, -1, -1, -1, -1, 5, - 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, - -1, 17, 18, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 32, 122, -1, 124, - 125, 126, -1, -1, -1, -1, 42, -1, 5, 6, - -1, 8, 9, 10, 11, 12, 141, 14, 15, -1, - 17, 18, -1, -1, 5, 6, -1, 8, 9, 10, - 11, 12, -1, 14, 15, 32, 17, 18, -1, -1, - -1, -1, -1, 5, 6, 42, 8, 9, 10, 11, - 12, 32, 14, 15, -1, 17, 18, 135, -1, -1, - 138, 42, -1, 141, -1, 143, -1, -1, -1, -1, - 32, -1, 5, 6, -1, 8, 9, 10, 11, 12, - 42, 14, 15, -1, 17, 18, -1, -1, 5, 6, - -1, 8, 9, 10, 11, 12, -1, 14, 15, 135, - 17, 18, 138, -1, -1, 141, -1, 143, -1, 42, - 5, 6, -1, 8, 9, 10, 11, 12, -1, 14, - 15, -1, 17, 18, -1, 42, -1, 5, 6, -1, - 8, 9, 10, 11, 12, -1, 14, 15, 135, 17, - 18, 138, -1, -1, 141, -1, 143, 42, -1, -1, - -1, -1, -1, -1, 135, -1, -1, 138, -1, -1, - 141, -1, 143, -1, 42, -1, -1, -1, -1, -1, - -1, -1, -1, 135, -1, -1, 138, -1, -1, 141, - -1, 143, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 135, -1, -1, 138, -1, -1, 141, -1, - 143, -1, -1, -1, -1, -1, -1, -1, 135, -1, - -1, 138, -1, -1, 141, -1, 143, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, - 135, -1, -1, 138, -1, -1, 141, -1, 143, -1, - -1, -1, -1, -1, 48, 49, -1, 135, -1, -1, - 138, -1, -1, 141, -1, 143, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, - 104, 105, -1, -1, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 2, 0, 1, 1, 2, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 0, 2, 1, + 1, 0, 2, 0, 2, 0, 3, 2, 0, 1, + 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, + 2, 1, 2, 5, 5, 5, 5, 3, 2, 5, + 4, 2, 1, 1, 1, 3, 1, 3, 1, 0, + 1, 3, 4, 3, 3, 4, 4, 3, 6, 5, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 6, 5, 8, 6, 6, 7, 7, 6, 8, 8, + 3, 1, 1, 1, 1, 0, 1, 2, 0, 3, + 0, 3, 3, 1, 3, 3, 0, 6, 0, 7, + 0, 7, 2, 3, 1, 3, 3, 3, 3, 1, + 0, 5, 3, 1, 3, 1, 0, 9, 1, 1, + 4, 1, 1, 2, 3, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 3, 2, 0, + 1, 2, 2, 3, 9, 9, 8, 14, 1, 1, + 6, 5, 2, 6, 7, 3, 5, 0, 0, 3, + 2, 1, 5, 5, 6, 6, 4, 6, 4, 4, + 6, 6, 2, 8, 1, 1, 0, 3, 6, 3, + 6, 2, 4, 6, 4 }; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison.simple" -/* This file comes from bison-1.28. */ -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 67, 58, 64, 59, 65, 183, 180, 178, 0, 0, + 0, 0, 0, 0, 76, 0, 67, 176, 78, 81, + 0, 0, 192, 0, 0, 62, 0, 66, 68, 70, + 69, 71, 73, 72, 74, 75, 77, 76, 76, 0, + 1, 177, 79, 80, 76, 181, 82, 83, 84, 85, + 76, 239, 179, 239, 0, 0, 200, 193, 194, 182, + 228, 229, 185, 114, 115, 116, 117, 118, 0, 0, + 0, 0, 230, 231, 119, 184, 121, 0, 0, 172, + 173, 0, 86, 86, 240, 236, 63, 211, 212, 213, + 235, 195, 196, 199, 0, 139, 122, 0, 0, 0, + 0, 128, 140, 0, 120, 139, 0, 0, 114, 115, + 116, 0, 0, 0, 186, 0, 87, 88, 89, 90, + 91, 0, 214, 0, 276, 238, 0, 197, 138, 97, + 134, 136, 0, 0, 0, 0, 0, 0, 127, 0, + 188, 190, 157, 158, 155, 156, 159, 154, 150, 151, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, + 15, 16, 11, 12, 13, 0, 0, 0, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 153, 152, 110, 92, 133, 132, 0, 208, 209, + 210, 275, 261, 0, 0, 0, 0, 86, 248, 249, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 237, 86, 252, 0, 274, + 198, 131, 0, 101, 0, 0, 130, 0, 141, 101, + 110, 110, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 0, 53, 54, 49, 50, 51, 52, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, + 0, 0, 0, 0, 0, 143, 171, 0, 0, 0, + 147, 0, 144, 0, 0, 0, 0, 187, 0, 260, + 242, 0, 241, 0, 0, 55, 0, 0, 0, 0, + 105, 105, 281, 0, 0, 272, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 93, 94, 95, + 96, 98, 137, 135, 124, 125, 126, 129, 123, 189, + 191, 0, 0, 258, 0, 0, 0, 0, 0, 142, + 128, 140, 0, 145, 146, 0, 0, 0, 0, 0, + 112, 110, 206, 217, 218, 219, 224, 220, 221, 222, + 223, 215, 0, 226, 233, 232, 234, 0, 243, 0, + 0, 0, 0, 0, 277, 0, 279, 258, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 99, 100, 102, 0, 0, 0, 0, 0, 0, + 0, 170, 149, 0, 0, 0, 0, 107, 113, 111, + 205, 97, 203, 0, 216, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 284, 0, 0, 0, 268, + 269, 0, 0, 0, 0, 266, 0, 282, 0, 0, + 0, 0, 161, 0, 0, 0, 0, 148, 0, 0, + 0, 61, 0, 101, 0, 225, 0, 0, 257, 0, + 0, 105, 106, 105, 0, 0, 0, 0, 0, 262, + 263, 257, 0, 0, 0, 259, 0, 167, 0, 0, + 163, 164, 160, 60, 202, 204, 97, 108, 0, 0, + 0, 0, 0, 264, 265, 0, 278, 280, 0, 0, + 267, 270, 271, 0, 283, 165, 166, 0, 0, 0, + 61, 109, 103, 227, 0, 0, 97, 0, 101, 253, + 0, 101, 162, 168, 169, 201, 0, 207, 0, 246, + 0, 0, 255, 0, 0, 254, 273, 104, 244, 0, + 245, 0, 97, 0, 0, 0, 256, 0, 0, 0, + 0, 251, 0, 0, 250, 0, 247 +}; - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 188, 189, 190, 252, 269, 111, 112, 72, 484, + 12, 73, 14, 37, 38, 39, 44, 50, 121, 321, + 231, 393, 324, 527, 374, 350, 512, 287, 351, 74, + 113, 130, 197, 131, 132, 103, 276, 363, 277, 81, + 15, 16, 17, 19, 18, 193, 240, 241, 59, 22, + 57, 94, 412, 413, 122, 200, 51, 89, 52, 45, + 415, 364, 76, 366, 292, 53, 85, 86, 225, 531, + 125, 305, 492, 396, 226, 227, 228, 229 +}; - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -399 +static const yytype_int16 yypact[] = +{ + 406, -399, -399, -399, -399, -399, -399, -399, -26, -114, + -16, -53, 92, -11, 54, 136, 526, -399, 247, 173, + 43, 49, -399, 62, 194, -399, 814, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, 134, 134, 99, + -399, -399, -399, -399, 134, -399, -399, -399, -399, -399, + 134, 212, -399, -1, 219, 225, 253, -399, -399, -399, + -399, -399, 135, -399, -399, -399, -399, -399, 271, 275, + 3, 33, -399, -399, -399, 160, -399, 99, 99, -399, + -399, 1029, 287, 287, -399, -399, 220, -399, -399, -399, + -399, -399, -399, -399, 20, 1071, -399, 141, 148, 105, + 135, -399, 160, -75, -399, 1071, 1029, 1174, 32, 286, + 293, 151, 294, 590, -399, 298, -399, -399, -399, -399, + -399, 1190, -399, -13, 1313, -399, 289, -399, -399, 160, + -399, 170, 167, 1174, 1174, 165, -68, 1174, -399, 174, + -399, 160, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, 495, 591, 176, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + 177, 178, 182, 183, 776, 1212, 123, 305, 187, 188, + 189, -399, -399, 193, -399, 135, 160, 266, -399, -399, + -399, -399, -399, 284, 1229, 283, 325, 287, -399, -399, + 495, 591, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, + 1174, 1174, 1174, 1174, 1174, -399, 287, -399, 144, -399, + -399, -4, 1110, -399, -63, -110, -399, 204, 160, -399, + 193, 193, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, 211, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, 214, + 1029, 1029, 1029, 1029, 1029, -399, -399, 79, 494, -111, + -399, -66, -399, 1029, 1029, 1029, 39, -399, 216, -399, + 135, 733, -399, 858, 858, -399, 858, 1190, 1174, 1174, + 50, 111, -399, 733, 97, 215, 230, 231, 232, 233, + 234, 733, 733, 322, 1190, 1174, 1174, -399, -399, -399, + -399, -399, -399, -399, -27, -399, -399, -399, -27, -399, + -399, 1029, 1029, -399, 235, 236, 239, 240, 1029, -399, + 237, 590, 26, -399, -399, 241, 242, 345, 360, 374, + -399, 193, 1126, -399, -399, -399, -399, -399, -399, -399, + -399, 328, 1029, -399, -399, -399, -399, 249, -399, 252, + 858, 733, 733, 11, -399, 18, -399, -399, 858, 250, + 1174, 1174, 1174, 1174, 1174, 256, 257, 1174, 858, 733, + 259, -399, -399, -399, 262, 264, -34, 1029, 1029, 1029, + 1029, -399, -399, 258, 1029, 1029, 1174, -399, -399, -399, + -399, 160, 265, 267, -399, 384, -61, 390, 393, 272, + 281, 282, 858, 413, 858, 295, 296, 858, 297, 160, + -399, 301, 302, 858, 858, 160, 300, -399, 1174, 1029, + 1029, 1174, -399, 304, 285, 306, 307, -399, 308, 310, + 118, 38, 1145, -399, 311, -399, 858, 858, 1174, 858, + 858, 315, -399, 315, 858, 316, 1174, 1174, 1174, -399, + -399, 1174, 733, 317, 319, -399, 1029, -399, 1029, 1029, + -399, -399, -399, -399, -399, -399, 160, 149, 421, 326, + 314, 733, 19, -399, -399, 412, -399, -399, 321, 858, + -399, -399, -399, 36, -399, -399, -399, 327, 329, 330, + 38, -399, 416, -399, 451, 2, -399, 1174, -399, -399, + 333, -399, -399, -399, -399, -399, 461, -399, 858, -399, + 982, 5, -4, 733, 210, -399, -27, -399, -399, 335, + -399, 982, -399, 457, 464, 344, -4, 858, 858, 468, + 417, -399, 858, 471, -399, 858, -399 +}; - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -399, 361, 362, 363, 274, 279, -198, -399, 0, -19, + 407, 9, -399, -399, -399, 113, -399, -399, -177, -307, + -398, -399, -236, -399, -299, 7, -399, -212, -399, -399, + -25, 263, -210, -399, 391, 398, -69, -109, -180, 179, + -399, -399, 482, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, 418, -399, -399, -399, -399, -399, + -399, -369, -73, 100, -158, -399, 454, -399, -399, -399, + -399, -399, 42, 137, -399, -399, -399, -399 +}; -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -176 +static const yytype_int16 yytable[] = +{ + 11, 75, 376, 328, 191, 279, 281, 98, 296, 13, + 198, 295, 114, 451, 295, 84, 11, 392, 23, 20, + 422, 392, 338, 87, 104, 13, 105, 424, 329, 330, + 297, 343, 326, 21, 24, -55, -55, 140, 60, 61, + 192, 100, 63, 64, 65, 66, 102, 1, 2, 314, + 3, 4, 1, 142, 143, 3, 302, 423, 137, 306, + 307, 308, 309, 310, 423, 137, 313, 338, 348, 138, + 129, 104, 338, 105, 102, 67, 237, 325, 344, 25, + 129, 455, 141, 317, 318, 349, 11, 370, 510, 28, + 29, 30, 31, 32, 33, 34, 196, 35, 342, 441, + 391, 319, 320, 442, 388, 26, 317, 318, 234, 235, + 60, 61, 238, 100, 63, 64, 65, 66, 532, 1, + 2, 27, 3, 4, 319, 320, 79, 80, 60, 61, + 199, 100, 108, 109, 110, 66, 40, 1, 2, 409, + 3, 4, 529, 88, 546, 540, 99, 67, 317, 318, + 77, 78, 517, 126, 144, 145, 518, 82, 390, 338, + 127, 539, 496, 83, 497, 67, 319, 320, 68, 517, + 403, 69, 545, 521, 70, 54, 71, 101, 348, 291, + 392, 55, 416, 373, 104, 36, 105, 300, 301, 291, + 303, 304, 291, 291, 291, 291, 291, 311, 312, 291, + 56, 333, 334, 335, 336, 337, 288, 129, 46, 47, + 48, 58, 338, 49, 345, 346, 347, 487, 365, 339, + 365, 365, 428, 365, 430, 431, 432, 392, 84, 392, + 365, 104, 191, 105, 1, 378, 91, 3, 365, 365, + 68, 543, 92, 69, 375, 104, 70, 105, 71, 135, + 315, 316, 104, 341, 105, 482, 106, 107, 68, 317, + 318, 69, 394, 395, 70, 36, 71, 280, 192, 401, + 93, 95, 196, 371, 372, 96, 391, 319, 320, 97, + 133, 2, 534, 475, 4, 536, 42, 134, 43, 196, + 389, 291, 293, -56, 104, 294, 105, 365, 365, 365, + -57, 146, 194, 232, 233, 365, 230, 236, 500, 501, + 502, 239, 270, 271, 272, 365, 365, 530, 273, 274, + 317, 318, 282, 283, 284, 285, 286, 411, 443, 444, + 445, 446, 289, 541, 295, 448, 449, 391, 319, 320, + 115, 116, 117, 118, 119, 120, 327, 331, 379, 365, + 332, 365, 352, 387, 365, 291, 429, 291, 291, 291, + 365, 365, 435, 380, 381, 382, 383, 384, 397, 398, + 473, 474, 399, 400, 404, 405, 406, 407, 408, 402, + 414, 450, 417, 365, 365, 418, 365, 365, 427, 433, + 434, 365, 438, 367, 368, 439, 369, 440, 452, 365, + 447, 454, 456, 377, 453, 457, -175, 507, 458, 508, + 509, 385, 386, 472, 459, 460, 291, 462, 365, -63, + 1, 2, 477, 3, 4, 5, 365, 486, 441, 464, + 466, 6, 7, 491, 467, 468, 471, 476, 513, 478, + 479, 291, 291, 291, 488, 480, 491, 481, 495, 499, + 8, 483, 515, 9, 505, 365, 506, 10, 423, 514, + 365, 519, 526, 528, 522, 537, 523, 524, 544, 547, + 419, 420, 421, 535, 365, 365, 548, 549, 426, 365, + 552, 553, 365, 555, 298, 222, 223, 224, 436, 437, + 299, 525, 533, 124, 511, 323, 139, 136, 41, 60, + 61, 123, 100, 108, 109, 110, 66, 90, 1, 2, + 483, 3, 4, 503, 425, 0, 0, 0, 0, 0, + 0, 0, 461, 0, 463, 0, -174, 465, 0, 0, + 0, 0, 0, 469, 470, 0, 67, 0, 0, -63, + 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, + 0, 6, 7, 0, 0, 0, 489, 490, 0, 493, + 494, 0, 0, 0, 498, 0, 0, 0, 0, 0, + 8, 0, 504, 9, 0, 0, 0, 10, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 0, 0, + 0, 516, 0, 0, 0, 60, 61, 0, 0, 520, + 0, 0, 0, 0, 1, 2, 0, 3, 4, 0, + 147, 0, 253, 254, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 148, 149, 0, 0, 0, 538, 68, + 0, 0, 69, 542, 0, 70, 0, 71, 340, 0, + 0, 0, 0, 0, 0, 0, 0, 550, 551, 0, + 0, 0, 554, 0, 0, 556, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 0, 0, 0, 0, 0, 0, 0, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 0, 0, 0, 0, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 0, 180, 0, 181, 182, 183, 0, 0, 0, + 0, 0, 0, 0, 104, 0, 105, 0, 184, 0, + 0, 185, 0, 186, 0, 187, 353, 354, 60, 61, + 355, 0, 0, 0, 0, 0, 0, 1, 2, 0, + 3, 4, 0, 356, 357, 358, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 359, 360, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 60, 61, 361, 100, 108, 109, 110, 66, 0, + 1, 2, 0, 3, 4, 0, 0, 0, 0, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 0, 0, 67, 60, + 61, 0, 62, 63, 64, 65, 66, 0, 1, 2, + 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 0, 180, 67, 181, 182, 183, + 0, 353, 354, 60, 61, 355, 0, 104, 0, 105, + 0, 0, 1, 2, 362, 3, 4, 0, 356, 357, + 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 359, 360, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, + 0, 68, 0, 0, 69, 0, 275, 70, 0, 71, + 0, 0, 0, 0, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 69, 0, 0, 70, 0, 71, 0, 0, + 0, 0, 0, 0, 0, 0, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, + 180, 0, 181, 182, 183, 353, 354, 0, 0, 355, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 362, + 0, 0, 356, 357, 358, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 359, 360, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 361, 0, 60, 61, 0, 100, 108, 109, + 110, 66, 0, 1, 2, 0, 3, 4, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 0, 0, 0, 0, 0, + 0, 67, 0, 0, 0, 0, 60, 61, 0, 100, + 63, 64, 65, 66, 0, 1, 2, 0, 3, 4, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 128, 180, 0, 181, 182, 183, 0, + 0, 0, 0, 67, 0, 60, 61, 0, 100, 63, + 64, 65, 66, 362, 1, 2, 0, 3, 4, 0, + 0, 60, 61, 0, 100, 63, 64, 65, 66, 0, + 1, 2, 322, 3, 4, 0, 0, 0, 0, 0, + 60, 61, 67, 100, 63, 64, 65, 66, 410, 1, + 2, 0, 3, 4, 68, 0, 0, 69, 67, 0, + 70, 0, 71, 0, 0, 0, 0, 485, 0, 60, + 61, 0, 100, 63, 64, 65, 66, 67, 1, 2, + 0, 3, 4, 0, 0, 60, 61, 0, 195, 63, + 64, 65, 66, 0, 1, 2, 68, 3, 4, 69, + 0, 0, 70, 0, 71, 0, 67, 60, 61, 0, + 100, 108, 109, 110, 66, 0, 1, 2, 0, 3, + 4, 0, 67, 0, 60, 61, 0, 290, 63, 64, + 65, 66, 0, 1, 2, 68, 3, 4, 69, 0, + 0, 70, 0, 71, 67, 0, 0, 0, 0, 0, + 0, 68, 0, 0, 69, 0, 0, 70, 0, 71, + 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 0, 0, 69, 0, 0, 70, 0, 71, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, + 0, 0, 69, 0, 0, 70, 0, 71, 0, 0, + 0, 0, 0, 0, 0, 68, 0, 0, 69, 0, + 0, 70, 0, 71, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 201, 0, 0, 0, 68, 0, 0, + 69, 0, 0, 70, 0, 278, 0, 0, 0, 0, + 0, 202, 203, 0, 68, 0, 0, 69, 0, 0, + 70, 0, 71, 204, 205, 206, 207, 208, 209, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 210, 211, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 212, 213, 214, 0, + 0, 215, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 216, 217, 218, 219, 220, 221 +}; -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +static const yytype_int16 yycheck[] = +{ + 0, 26, 301, 239, 113, 185, 186, 4, 206, 0, + 23, 9, 81, 411, 9, 16, 16, 324, 132, 45, + 9, 328, 133, 24, 134, 16, 136, 9, 240, 241, + 207, 142, 142, 59, 50, 3, 4, 106, 5, 6, + 113, 8, 9, 10, 11, 12, 71, 14, 15, 226, + 17, 18, 14, 21, 22, 17, 214, 46, 133, 217, + 218, 219, 220, 221, 46, 133, 224, 133, 29, 144, + 95, 134, 133, 136, 99, 42, 144, 140, 144, 132, + 105, 142, 107, 110, 111, 46, 86, 297, 486, 35, + 36, 37, 38, 39, 40, 41, 121, 43, 278, 133, + 127, 128, 129, 137, 314, 13, 110, 111, 133, 134, + 5, 6, 137, 8, 9, 10, 11, 12, 516, 14, + 15, 132, 17, 18, 128, 129, 27, 28, 5, 6, + 143, 8, 9, 10, 11, 12, 0, 14, 15, 351, + 17, 18, 140, 144, 542, 140, 143, 42, 110, 111, + 37, 38, 133, 133, 3, 4, 137, 44, 316, 133, + 140, 530, 461, 50, 463, 42, 128, 129, 135, 133, + 144, 138, 541, 137, 141, 132, 143, 144, 29, 204, + 487, 132, 362, 133, 134, 131, 136, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 138, 270, 271, 272, 273, 274, 197, 232, 35, 36, + 37, 17, 133, 40, 283, 284, 285, 453, 291, 140, + 293, 294, 380, 296, 382, 383, 384, 534, 16, 536, + 303, 134, 341, 136, 14, 138, 17, 17, 311, 312, + 135, 31, 17, 138, 133, 134, 141, 136, 143, 144, + 106, 107, 134, 278, 136, 137, 77, 78, 135, 110, + 111, 138, 331, 332, 141, 131, 143, 144, 341, 338, + 17, 136, 297, 298, 299, 4, 127, 128, 129, 4, + 139, 15, 518, 441, 18, 521, 39, 139, 41, 314, + 315, 316, 9, 7, 134, 12, 136, 370, 371, 372, + 7, 7, 4, 133, 137, 378, 17, 142, 466, 467, + 468, 137, 136, 136, 136, 388, 389, 515, 136, 136, + 110, 111, 17, 136, 136, 136, 133, 352, 397, 398, + 399, 400, 48, 531, 9, 404, 405, 127, 128, 129, + 53, 54, 55, 56, 57, 58, 142, 136, 133, 422, + 136, 424, 136, 31, 427, 380, 381, 382, 383, 384, + 433, 434, 387, 133, 133, 133, 133, 133, 133, 133, + 439, 440, 133, 133, 133, 133, 31, 17, 4, 142, + 52, 406, 133, 456, 457, 133, 459, 460, 138, 133, + 133, 464, 133, 293, 294, 133, 296, 133, 133, 472, + 142, 17, 12, 303, 137, 12, 0, 476, 136, 478, + 479, 311, 312, 438, 133, 133, 441, 4, 491, 13, + 14, 15, 137, 17, 18, 19, 499, 452, 133, 133, + 133, 25, 26, 458, 133, 133, 136, 133, 17, 133, + 133, 466, 467, 468, 133, 137, 471, 137, 133, 133, + 44, 451, 138, 47, 137, 528, 137, 51, 46, 133, + 533, 140, 46, 12, 137, 4, 137, 137, 133, 12, + 370, 371, 372, 140, 547, 548, 12, 133, 378, 552, + 12, 64, 555, 12, 210, 124, 124, 124, 388, 389, + 211, 510, 517, 86, 487, 232, 105, 99, 16, 5, + 6, 83, 8, 9, 10, 11, 12, 53, 14, 15, + 510, 17, 18, 471, 377, -1, -1, -1, -1, -1, + -1, -1, 422, -1, 424, -1, 0, 427, -1, -1, + -1, -1, -1, 433, 434, -1, 42, -1, -1, 13, + 14, 15, -1, 17, 18, 19, -1, -1, -1, -1, + -1, 25, 26, -1, -1, -1, 456, 457, -1, 459, + 460, -1, -1, -1, 464, -1, -1, -1, -1, -1, + 44, -1, 472, 47, -1, -1, -1, 51, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, -1, + -1, 491, -1, -1, -1, 5, 6, -1, -1, 499, + -1, -1, -1, -1, 14, 15, -1, 17, 18, -1, + 20, -1, 21, 22, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 33, 34, -1, -1, -1, 528, 135, + -1, -1, 138, 533, -1, 141, -1, 143, 144, -1, + -1, -1, -1, -1, -1, -1, -1, 547, 548, -1, + -1, -1, 552, -1, -1, 555, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, -1, -1, -1, -1, -1, -1, -1, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, -1, -1, -1, -1, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, -1, 122, -1, 124, 125, 126, -1, -1, -1, + -1, -1, -1, -1, 134, -1, 136, -1, 138, -1, + -1, 141, -1, 143, -1, 145, 3, 4, 5, 6, + 7, -1, -1, -1, -1, -1, -1, 14, 15, -1, + 17, 18, -1, 20, 21, 22, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 33, 34, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 5, 6, 50, 8, 9, 10, 11, 12, -1, + 14, 15, -1, 17, 18, -1, -1, -1, -1, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, -1, -1, 42, 5, + 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, + -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, + -1, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, -1, 122, 42, 124, 125, 126, + -1, 3, 4, 5, 6, 7, -1, 134, -1, 136, + -1, -1, 14, 15, 141, 17, 18, -1, 20, 21, + 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, 34, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 50, -1, + -1, 135, -1, -1, 138, -1, 140, 141, -1, 143, + -1, -1, -1, -1, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, -1, -1, -1, -1, -1, -1, -1, -1, 135, + -1, -1, 138, -1, -1, 141, -1, 143, -1, -1, + -1, -1, -1, -1, -1, -1, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, -1, + 122, -1, 124, 125, 126, 3, 4, -1, -1, 7, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, + -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 33, 34, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 50, -1, 5, 6, -1, 8, 9, 10, + 11, 12, -1, 14, 15, -1, 17, 18, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, -1, -1, -1, -1, -1, + -1, 42, -1, -1, -1, -1, 5, 6, -1, 8, + 9, 10, 11, 12, -1, 14, 15, -1, 17, 18, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 32, 122, -1, 124, 125, 126, -1, + -1, -1, -1, 42, -1, 5, 6, -1, 8, 9, + 10, 11, 12, 141, 14, 15, -1, 17, 18, -1, + -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, + 14, 15, 32, 17, 18, -1, -1, -1, -1, -1, + 5, 6, 42, 8, 9, 10, 11, 12, 32, 14, + 15, -1, 17, 18, 135, -1, -1, 138, 42, -1, + 141, -1, 143, -1, -1, -1, -1, 32, -1, 5, + 6, -1, 8, 9, 10, 11, 12, 42, 14, 15, + -1, 17, 18, -1, -1, 5, 6, -1, 8, 9, + 10, 11, 12, -1, 14, 15, 135, 17, 18, 138, + -1, -1, 141, -1, 143, -1, 42, 5, 6, -1, + 8, 9, 10, 11, 12, -1, 14, 15, -1, 17, + 18, -1, 42, -1, 5, 6, -1, 8, 9, 10, + 11, 12, -1, 14, 15, 135, 17, 18, 138, -1, + -1, 141, -1, 143, 42, -1, -1, -1, -1, -1, + -1, 135, -1, -1, 138, -1, -1, 141, -1, 143, + -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, + 135, -1, -1, 138, -1, -1, 141, -1, 143, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, + -1, -1, 138, -1, -1, 141, -1, 143, -1, -1, + -1, -1, -1, -1, -1, 135, -1, -1, 138, -1, + -1, 141, -1, 143, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 30, -1, -1, -1, 135, -1, -1, + 138, -1, -1, 141, -1, 143, -1, -1, -1, -1, + -1, 48, 49, -1, 135, -1, -1, 138, -1, -1, + 141, -1, 143, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 103, 104, 105, -1, + -1, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126 +}; -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 14, 15, 17, 18, 19, 25, 26, 44, 47, + 51, 154, 156, 157, 158, 186, 187, 188, 190, 189, + 45, 59, 195, 132, 50, 132, 13, 132, 35, 36, + 37, 38, 39, 40, 41, 43, 131, 159, 160, 161, + 0, 188, 39, 41, 162, 205, 35, 36, 37, 40, + 163, 202, 204, 211, 132, 132, 138, 196, 17, 194, + 5, 6, 8, 9, 10, 11, 12, 42, 135, 138, + 141, 143, 154, 157, 175, 176, 208, 161, 161, 27, + 28, 185, 161, 161, 16, 212, 213, 24, 144, 203, + 212, 17, 17, 17, 197, 136, 4, 4, 4, 143, + 8, 144, 176, 181, 134, 136, 185, 185, 9, 10, + 11, 152, 153, 176, 182, 53, 54, 55, 56, 57, + 58, 164, 200, 200, 156, 216, 133, 140, 32, 176, + 177, 179, 180, 139, 139, 144, 181, 133, 144, 180, + 182, 176, 21, 22, 3, 4, 7, 20, 33, 34, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 122, 124, 125, 126, 138, 141, 143, 145, 147, 148, + 149, 183, 208, 191, 4, 8, 176, 178, 23, 143, + 201, 30, 48, 49, 60, 61, 62, 63, 64, 65, + 81, 82, 103, 104, 105, 108, 121, 122, 123, 124, + 125, 126, 147, 148, 149, 214, 220, 221, 222, 223, + 17, 166, 133, 137, 176, 176, 142, 144, 176, 137, + 192, 193, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 150, 21, 22, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 151, + 136, 136, 136, 136, 136, 140, 182, 184, 143, 184, + 144, 184, 17, 136, 136, 136, 133, 173, 157, 48, + 8, 176, 210, 9, 12, 9, 152, 164, 150, 151, + 176, 176, 210, 176, 176, 217, 210, 210, 210, 210, + 210, 176, 176, 210, 164, 106, 107, 110, 111, 128, + 129, 165, 32, 177, 168, 140, 142, 142, 168, 173, + 173, 136, 136, 182, 182, 182, 182, 182, 133, 140, + 144, 176, 184, 142, 144, 182, 182, 182, 29, 46, + 171, 174, 136, 3, 4, 7, 20, 21, 22, 33, + 34, 50, 141, 183, 207, 208, 209, 209, 209, 209, + 178, 176, 176, 133, 170, 133, 170, 209, 138, 133, + 133, 133, 133, 133, 133, 209, 209, 31, 178, 176, + 210, 127, 165, 167, 182, 182, 219, 133, 133, 133, + 133, 182, 142, 144, 133, 133, 31, 17, 4, 173, + 32, 176, 198, 199, 52, 206, 184, 133, 133, 209, + 209, 209, 9, 46, 9, 219, 209, 138, 210, 176, + 210, 210, 210, 133, 133, 176, 209, 209, 133, 133, + 133, 133, 137, 182, 182, 182, 182, 142, 182, 182, + 176, 166, 133, 137, 17, 142, 12, 12, 136, 133, + 133, 209, 4, 209, 133, 209, 133, 133, 133, 209, + 209, 136, 176, 182, 182, 210, 133, 137, 133, 133, + 137, 137, 137, 154, 155, 32, 176, 168, 133, 209, + 209, 176, 218, 209, 209, 133, 170, 170, 209, 133, + 210, 210, 210, 218, 209, 137, 137, 182, 182, 182, + 166, 171, 172, 17, 133, 138, 209, 133, 137, 140, + 209, 137, 137, 137, 137, 155, 46, 169, 12, 140, + 152, 215, 166, 176, 168, 140, 168, 4, 209, 207, + 140, 152, 209, 31, 133, 207, 166, 12, 12, 133, + 209, 209, 12, 64, 209, 12, 209 +}; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ + +#define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -#ifndef YYPURE -#define YYLEX yylex() + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif #endif -#else /* not YYLSP_NEEDED */ + + +/* YYLEX -- calling `yylex' with the right arguments. */ + #ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) +# define YYLEX yylex (YYLEX_PARAM) #else -#define YYLEX yylex(&yylval) +# define YYLEX yylex () #endif -#endif /* not YYLSP_NEEDED */ + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; #endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} -/* If nonreentrant, generate the variables here */ -#ifndef YYPURE +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; #endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; #endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + +/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif { - register char *f = from; - register char *t = to; - register int i = count; + char *yyd = yydest; + const char *yys = yysrc; - while (i-- > 0) - *t++ = *f++; + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; } +# endif +# endif -#else /* __cplusplus */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - register char *t = to; - register char *f = from; - register int i = count; + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; - while (i-- > 0) - *t++ = *f++; + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } } +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; #endif -#endif - -#line 217 "/usr/share/bison.simple" +{ + YYUSE (yyvaluep); -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ #ifdef YYPARSE_PARAM -int yyparse (void *); +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); #else -int yyparse (void); +int yyparse (); #endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); #endif +#endif /* ! YYPARSE_PARAM */ + -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) #else -#define YYPOPSTACK (yyvsp--, yyssp--) +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; #endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; #endif #endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. - int yylen; + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; @@ -2140,644 +3032,671 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss - 1; + yyssp = yyss; yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: + goto yysetstate; - *++yyssp = yystate; +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif + yysetstate: + *yyssp = yystate; + if (yyss + yystacksize - 1 <= yyssp) + { /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif #endif /* no yyoverflow */ - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - if (yyssp >= yyss + yystacksize - 1) + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; - yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ +/*-----------. +| yybackup. | +`-----------*/ +yybackup: - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ + /* Not known => get a look-ahead token if don't already have one. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif + YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the token being shifted unless it is eof. */ + /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; + yystate = yyn; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; + -/* Do a reduction. yyn is the number of a rule to reduce with. */ +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) { - int i; + case 29: +#line 1054 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} + break; - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 28: -#line 1054 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; - break;} -case 29: -#line 1054 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_NE; ; - break;} -case 30: -#line 1055 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; - break;} -case 31: -#line 1055 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; - break;} -case 32: -#line 1056 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; - break;} -case 33: -#line 1056 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; - break;} -case 34: -#line 1057 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; - break;} -case 35: -#line 1057 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; - break;} -case 36: -#line 1058 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; - break;} -case 37: -#line 1058 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; - break;} -case 38: -#line 1062 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; - break;} -case 39: -#line 1062 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; - break;} -case 40: -#line 1063 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; - break;} -case 41: -#line 1063 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; - break;} -case 42: -#line 1064 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; - break;} -case 43: -#line 1064 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; - break;} -case 44: -#line 1065 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; - break;} -case 45: -#line 1065 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; - break;} -case 46: -#line 1066 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; - break;} -case 47: -#line 1066 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; - break;} -case 48: -#line 1067 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; - break;} -case 49: -#line 1067 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; - break;} -case 50: -#line 1068 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; - break;} -case 51: -#line 1068 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; - break;} -case 52: -#line 1069 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; - break;} -case 53: -#line 1070 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; - break;} -case 60: -#line 1079 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 61: -#line 1083 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; + case 30: +#line 1054 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} + break; + + case 31: +#line 1055 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} + break; + + case 32: +#line 1055 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} + break; + + case 33: +#line 1056 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} + break; + + case 34: +#line 1056 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} + break; + + case 35: +#line 1057 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} + break; + + case 36: +#line 1057 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} + break; + + case 37: +#line 1058 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} + break; + + case 38: +#line 1058 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} + break; + + case 39: +#line 1062 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} + break; + + case 40: +#line 1062 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} + break; + + case 41: +#line 1063 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} + break; + + case 42: +#line 1063 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} + break; + + case 43: +#line 1064 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} + break; + + case 44: +#line 1064 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} + break; + + case 45: +#line 1065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} + break; + + case 46: +#line 1065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} + break; + + case 47: +#line 1066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} + break; + + case 48: +#line 1066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} + break; + + case 49: +#line 1067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} + break; + + case 50: +#line 1067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} + break; + + case 51: +#line 1068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} + break; + + case 52: +#line 1068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} + break; + + case 53: +#line 1069 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} + break; + + case 54: +#line 1070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} + break; + + case 61: +#line 1079 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 62: +#line 1083 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 62: -#line 1087 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; + ;} + break; + + case 63: +#line 1087 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; CHECK_FOR_ERROR - ; - break;} -case 65: -#line 1094 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; + ;} + break; + + case 66: +#line 1094 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 66: -#line 1098 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; + ;} + break; + + case 67: +#line 1098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; CHECK_FOR_ERROR - ; - break;} -case 67: -#line 1104 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 68: -#line 1105 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 69: -#line 1106 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 70: -#line 1107 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::AppendingLinkage; ; - break;} -case 71: -#line 1108 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 72: -#line 1112 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 73: -#line 1113 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 74: -#line 1114 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 75: -#line 1118 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::DefaultVisibility; ; - break;} -case 76: -#line 1119 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::HiddenVisibility; ; - break;} -case 77: -#line 1123 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 78: -#line 1124 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 79: -#line 1125 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 80: -#line 1129 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 81: -#line 1130 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 82: -#line 1131 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 83: -#line 1132 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 84: -#line 1133 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 85: -#line 1136 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 86: -#line 1137 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 87: -#line 1138 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Fast; ; - break;} -case 88: -#line 1139 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Cold; ; - break;} -case 89: -#line 1140 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_StdCall; ; - break;} -case 90: -#line 1141 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_FastCall; ; - break;} -case 91: -#line 1142 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) + ;} + break; + + case 68: +#line 1104 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 69: +#line 1105 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 70: +#line 1106 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 71: +#line 1107 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} + break; + + case 72: +#line 1108 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 73: +#line 1112 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 74: +#line 1113 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 75: +#line 1114 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 76: +#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} + break; + + case 77: +#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} + break; + + case 78: +#line 1123 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 79: +#line 1124 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 80: +#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 81: +#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 82: +#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 83: +#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 84: +#line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 85: +#line 1133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 86: +#line 1136 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 87: +#line 1137 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 88: +#line 1138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Fast; ;} + break; + + case 89: +#line 1139 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Cold; ;} + break; + + case 90: +#line 1140 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} + break; + + case 91: +#line 1141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} + break; + + case 92: +#line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) GEN_ERROR("Calling conv too large"); - yyval.UIntVal = yyvsp[0].UInt64Val; + (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); CHECK_FOR_ERROR - ; - break;} -case 92: -#line 1149 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::ZExtAttribute; ; - break;} -case 93: -#line 1150 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::SExtAttribute; ; - break;} -case 94: -#line 1151 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::InRegAttribute; ; - break;} -case 95: -#line 1152 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::StructRetAttribute; ; - break;} -case 96: -#line 1155 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::NoAttributeSet; ; - break;} -case 97: -#line 1156 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = FunctionType::ParameterAttributes(yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs); - ; - break;} -case 98: -#line 1161 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::NoReturnAttribute; ; - break;} -case 100: -#line 1165 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = FunctionType::NoAttributeSet; ; - break;} -case 101: -#line 1166 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = FunctionType::ParameterAttributes(yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs); - ; - break;} -case 102: -#line 1173 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 103: -#line 1174 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) + ;} + break; + + case 93: +#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = FunctionType::ZExtAttribute; ;} + break; + + case 94: +#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = FunctionType::SExtAttribute; ;} + break; + + case 95: +#line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = FunctionType::InRegAttribute; ;} + break; + + case 96: +#line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = FunctionType::StructRetAttribute; ;} + break; + + case 97: +#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} + break; + + case 98: +#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs)); + ;} + break; + + case 99: +#line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = FunctionType::NoReturnAttribute; ;} + break; + + case 101: +#line 1165 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} + break; + + case 102: +#line 1166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs)); + ;} + break; + + case 103: +#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 104: +#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -; - break;} -case 104: -#line 1180 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 105: -#line 1181 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) +;} + break; + + case 105: +#line 1180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 106: +#line 1181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); + if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -; - break;} -case 106: -#line 1189 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) - if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') +;} + break; + + case 107: +#line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i) + if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\') GEN_ERROR("Invalid character in section name"); - yyval.StrVal = yyvsp[0].StrVal; + (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); CHECK_FOR_ERROR -; - break;} -case 107: -#line 1197 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 108: -#line 1198 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = yyvsp[0].StrVal; ; - break;} -case 109: -#line 1203 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 110: -#line 1204 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 111: -#line 1205 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurGV->setSection(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); +;} + break; + + case 108: +#line 1197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 109: +#line 1198 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} + break; + + case 110: +#line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 111: +#line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 112: +#line 1205 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurGV->setSection((yyvsp[(1) - (1)].StrVal)); + free((yyvsp[(1) - (1)].StrVal)); CHECK_FOR_ERROR - ; - break;} -case 112: -#line 1210 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) + ;} + break; + + case 113: +#line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Alignment must be a power of two"); - CurGV->setAlignment(yyvsp[0].UInt64Val); + CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 117: -#line 1226 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(OpaqueType::get()); + ;} + break; + + case 118: +#line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ; - break;} -case 118: -#line 1230 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); + ;} + break; + + case 119: +#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR - ; - break;} -case 119: -#line 1234 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Pointer type? - if (*yyvsp[-1].TypeVal == Type::LabelTy) + ;} + break; + + case 120: +#line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Pointer type? + if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); - delete yyvsp[-1].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal)))); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 120: -#line 1241 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Named types are also simple types... - const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - yyval.TypeVal = new PATypeHolder(tmp); - ; - break;} -case 121: -#line 1246 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Type UpReference - if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range"); + ;} + break; + + case 121: +#line 1241 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Named types are also simple types... + const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); + CHECK_FOR_ERROR + (yyval.TypeVal) = new PATypeHolder(tmp); + ;} + break; + + case 122: +#line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Type UpReference + if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... - yyval.TypeVal = new PATypeHolder(OT); + UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... + (yyval.TypeVal) = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR - ; - break;} -case 122: -#line 1254 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 123: +#line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { std::vector Params; std::vector Attrs; - Attrs.push_back(yyvsp[0].ParamAttrs); - for (TypeWithAttrsList::iterator I=yyvsp[-2].TypeWithAttrsList->begin(), E=yyvsp[-2].TypeWithAttrsList->end(); I != E; ++I) { + Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs)); + for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -2785,20 +3704,21 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, Attrs); - delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list - delete yyvsp[-4].TypeVal; // Delete the return type handle - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ; - break;} -case 123: -#line 1272 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, Attrs); + delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list + delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ;} + break; + + case 124: +#line 1272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { std::vector Params; std::vector Attrs; - Attrs.push_back(yyvsp[0].ParamAttrs); - for (TypeWithAttrsList::iterator I=yyvsp[-2].TypeWithAttrsList->begin(), E=yyvsp[-2].TypeWithAttrsList->end(); I != E; ++I) { + Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs)); + for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -2806,282 +3726,303 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, Attrs); - delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ; - break;} -case 124: -#line 1290 "/Users/sabre/cvs/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; - CHECK_FOR_ERROR - ; - break;} -case 125: -#line 1295 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Packed array type? - const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); - if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) + FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, Attrs); + delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ;} + break; + + case 125: +#line 1290 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Sized array type? + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + delete (yyvsp[(4) - (5)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 126: +#line 1295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Packed array type? + const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); + if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a PackedType must be primitive"); - if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) + if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) GEN_ERROR("Vector length should be a power of 2"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PackedType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + delete (yyvsp[(4) - (5)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 126: -#line 1307 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Structure type? + ;} + break; + + case 127: +#line 1307 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Structure type? std::vector Elements; - for (std::list::iterator I = yyvsp[-1].TypeList->begin(), - E = yyvsp[-1].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), + E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) Elements.push_back(*I); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete yyvsp[-1].TypeList; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete (yyvsp[(2) - (3)].TypeList); CHECK_FOR_ERROR - ; - break;} -case 127: -#line 1317 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ; - break;} -case 128: -#line 1321 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 128: +#line 1317 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ;} + break; + + case 129: +#line 1321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { std::vector Elements; - for (std::list::iterator I = yyvsp[-2].TypeList->begin(), - E = yyvsp[-2].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), + E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) Elements.push_back(*I); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete yyvsp[-2].TypeList; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + delete (yyvsp[(3) - (5)].TypeList); CHECK_FOR_ERROR - ; - break;} -case 129: -#line 1331 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); - CHECK_FOR_ERROR - ; - break;} -case 130: -#line 1338 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; - yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs; - ; - break;} -case 131: -#line 1345 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 130: +#line 1331 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ;} + break; + + case 131: +#line 1338 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); + (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs); + ;} + break; + + case 132: +#line 1345 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - if (!(*yyvsp[0].TypeVal)->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); + if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types"); - yyval.TypeVal = yyvsp[0].TypeVal; - ; - break;} -case 132: -#line 1352 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(Type::VoidTy); - ; - break;} -case 133: -#line 1357 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); - yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); + (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); + ;} + break; + + case 133: +#line 1352 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); + ;} + break; + + case 134: +#line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 134: -#line 1362 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); + ;} + break; + + case 135: +#line 1362 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 136: -#line 1370 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; + ;} + break; + + case 137: +#line 1370 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 137: -#line 1377 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList; + ;} + break; + + case 138: +#line 1377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 138: -#line 1384 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); + ;} + break; + + case 139: +#line 1384 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR - ; - break;} -case 139: -#line 1392 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeList = new std::list(); - yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; + ;} + break; + + case 140: +#line 1392 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeList) = new std::list(); + (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); delete (yyvsp[(1) - (1)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 140: -#line 1397 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; + ;} + break; + + case 141: +#line 1397 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 141: -#line 1408 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + ;} + break; + + case 142: +#line 1408 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector)); + delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 142: -#line 1436 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 143: +#line 1436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - yyval.ConstVal = ConstantArray::get(ATy, std::vector()); - delete yyvsp[-2].TypeVal; + (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); + delete (yyvsp[(1) - (3)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 143: -#line 1452 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 144: +#line 1452 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) + char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); + if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-yyvsp[0].StrVal)) + + itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal; + for (unsigned char *C = (unsigned char *)(yyvsp[(3) - (3)].StrVal); C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free(yyvsp[0].StrVal); + free((yyvsp[(3) - (3)].StrVal)); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - free(yyvsp[0].StrVal); - yyval.ConstVal = ConstantArray::get(ATy, Vals); - delete yyvsp[-2].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 144: -#line 1481 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + free((yyvsp[(3) - (3)].StrVal)); + (yyval.ConstVal) = ConstantArray::get(ATy, Vals); + delete (yyvsp[(1) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 145: +#line 1481 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); + const PackedType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) + if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantPacked::get(PTy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); + delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 145: -#line 1509 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); + ;} + break; + + case 146: +#line 1509 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); - if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) + if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) - if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3091,20 +4032,21 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector)); + delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 146: -#line 1534 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 147: +#line 1534 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3113,25 +4055,26 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, std::vector()); - delete yyvsp[-2].TypeVal; + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + delete (yyvsp[(1) - (3)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 147: -#line 1553 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); + ;} + break; + + case 148: +#line 1553 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-5].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'"); - if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) + if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) - if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) + if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -3141,20 +4084,21 @@ if (!STy->isPacked()) GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector); - delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector; + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector)); + delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 148: -#line 1578 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 149: +#line 1578 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); - const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); + const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*yyvsp[-4].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -3163,42 +4107,45 @@ if (!STy->isPacked()) GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); - yyval.ConstVal = ConstantStruct::get(STy, std::vector()); - delete yyvsp[-4].TypeVal; + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + delete (yyvsp[(1) - (5)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 149: -#line 1597 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 150: +#line 1597 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*yyvsp[-1].TypeVal)->getDescription() + "'"); + (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'"); - yyval.ConstVal = ConstantPointerNull::get(PTy); - delete yyvsp[-1].TypeVal; + (yyval.ConstVal) = ConstantPointerNull::get(PTy); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 150: -#line 1609 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 151: +#line 1609 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 151: -#line 1616 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get()); + delete (yyvsp[(1) - (2)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 152: +#line 1616 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type"); @@ -3212,7 +4159,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getValNonImprovising(Ty, yyvsp[0].ValIDVal); + Value *V = getValNonImprovising(Ty, (yyvsp[(2) - (2)].ValIDVal)); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -3227,16 +4174,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); + CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - yyvsp[0].ValIDVal.destroy(); + (yyvsp[(2) - (2)].ValIDVal).destroy(); } else { std::string Name; - if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) - Name = yyvsp[0].ValIDVal.Name; - else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) + if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) + Name = (yyvsp[(2) - (2)].ValIDVal).Name; + else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -3252,270 +4199,300 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); V = GV; } } - yyval.ConstVal = cast(V); - delete yyvsp[-1].TypeVal; // Free the type handle + (yyval.ConstVal) = cast(V); + delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle CHECK_FOR_ERROR - ; - break;} -case 152: -#line 1682 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 153: +#line 1682 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription()); - yyval.ConstVal = yyvsp[0].ConstVal; - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 153: -#line 1692 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription()); + (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); + delete (yyvsp[(1) - (2)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 154: +#line 1692 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const Type *Ty = yyvsp[-1].TypeVal->get(); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type"); - yyval.ConstVal = Constant::getNullValue(Ty); - delete yyvsp[-1].TypeVal; + (yyval.ConstVal) = Constant::getNullValue(Ty); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 154: -#line 1702 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) + ;} + break; + + case 155: +#line 1702 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val); + (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 155: -#line 1708 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) + ;} + break; + + case 156: +#line 1708 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type"); - yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val); + (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 156: -#line 1714 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); - yyval.ConstVal = ConstantInt::getTrue(); - CHECK_FOR_ERROR - ; - break;} -case 157: -#line 1719 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); - yyval.ConstVal = ConstantInt::getFalse(); - CHECK_FOR_ERROR - ; - break;} -case 158: -#line 1724 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Float & Double constants - if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) + ;} + break; + + case 157: +#line 1714 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + (yyval.ConstVal) = ConstantInt::getTrue(); + CHECK_FOR_ERROR + ;} + break; + + case 158: +#line 1719 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + (yyval.ConstVal) = ConstantInt::getFalse(); + CHECK_FOR_ERROR + ;} + break; + + case 159: +#line 1724 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Float & Double constants + if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); - yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); + (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal)); CHECK_FOR_ERROR - ; - break;} -case 159: -#line 1732 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 160: +#line 1732 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - Constant *Val = yyvsp[-3].ConstVal; - const Type *DestTy = yyvsp[-1].TypeVal->get(); - if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); + Constant *Val = (yyvsp[(3) - (6)].ConstVal); + const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); - delete yyvsp[-1].TypeVal; - ; - break;} -case 160: -#line 1744 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[-2].ConstVal->getType())) + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); + delete (yyvsp[(5) - (6)].TypeVal); + ;} + break; + + case 161: +#line 1744 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), *yyvsp[-1].ValueList, true); + GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), &(*(yyvsp[(4) - (5)].ValueList))[0], (yyvsp[(4) - (5)].ValueList)->size(), + true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); SmallVector IdxVec; - for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i) - if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i])) + for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i) + if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants"); - delete yyvsp[-1].ValueList; + delete (yyvsp[(4) - (5)].ValueList); - yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); + (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR - ; - break;} -case 161: -#line 1765 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) + ;} + break; + + case 162: +#line 1766 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType()) GEN_ERROR("Select operand types must match"); - yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 162: -#line 1773 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 163: +#line 1774 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Binary operator types must match"); CHECK_FOR_ERROR; - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 163: -#line 1779 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + ;} + break; + + case 164: +#line 1780 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) GEN_ERROR("Logical operator types must match"); - if (!yyvsp[-3].ConstVal->getType()->isInteger()) { - if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa(yyvsp[-3].ConstVal->getType()) || - !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) + if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { + if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa((yyvsp[(3) - (6)].ConstVal)->getType()) || + !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 164: -#line 1790 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 165: +#line 1791 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("icmp operand types must match"); - yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 165: -#line 1795 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + ;} + break; + + case 166: +#line 1796 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) GEN_ERROR("fcmp operand types must match"); - yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 166: -#line 1800 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); + ;} + break; + + case 167: +#line 1801 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) GEN_ERROR("Invalid extractelement operands"); - yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 167: -#line 1806 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 168: +#line 1807 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid insertelement operands"); - yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 168: -#line 1812 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 169: +#line 1813 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) GEN_ERROR("Invalid shufflevector operands"); - yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 169: -#line 1821 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 170: +#line 1822 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 170: -#line 1825 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ConstVector = new std::vector(); - yyval.ConstVector->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 171: +#line 1826 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstVector) = new std::vector(); + (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 171: -#line 1833 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 172: -#line 1833 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 173: -#line 1844 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + ;} + break; + + case 172: +#line 1834 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 173: +#line 1834 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 174: +#line 1845 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 174: -#line 1849 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + ;} + break; + + case 175: +#line 1850 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 177: -#line 1862 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = false; ; - break;} -case 178: -#line 1862 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 178: +#line 1863 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = false; ;} + break; + + case 179: +#line 1863 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CurFun.FunctionDone(); CHECK_FOR_ERROR - ; - break;} -case 179: -#line 1866 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = true; ; - break;} -case 180: -#line 1866 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 180: +#line 1867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = true; ;} + break; + + case 181: +#line 1867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 181: -#line 1869 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 182: +#line 1870 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 182: -#line 1872 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 183: +#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; @@ -3526,13 +4503,14 @@ } } CHECK_FOR_ERROR - ; - break;} -case 183: -#line 1884 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 184: +#line 1885 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -3542,226 +4520,248 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal); + ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal)); - if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*yyvsp[0].TypeVal); + CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal)); } - delete yyvsp[0].TypeVal; + delete (yyvsp[(3) - (3)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 184: -#line 1908 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); + ;} + break; + + case 185: +#line 1909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); - if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(yyvsp[0].PrimType); + CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType)); } CHECK_FOR_ERROR - ; - break;} -case 185: -#line 1919 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 186: +#line 1920 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { /* "Externally Visible" Linkage */ - if (yyvsp[0].ConstVal == 0) + if ((yyvsp[(4) - (4)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, - yyvsp[-2].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); + CurGV = ParseGlobalVariable((yyvsp[(1) - (4)].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[(2) - (4)].Visibility), (yyvsp[(3) - (4)].BoolVal), (yyvsp[(4) - (4)].ConstVal)->getType(), (yyvsp[(4) - (4)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 186: -#line 1926 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 187: +#line 1927 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 187: -#line 1929 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].ConstVal == 0) + ;} + break; + + case 188: +#line 1930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(5) - (5)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, yyvsp[-3].Linkage, yyvsp[-2].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); + CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 188: -#line 1934 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 189: +#line 1935 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 189: -#line 1937 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 190: +#line 1938 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, yyvsp[-3].Linkage, yyvsp[-2].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (5)].TypeVal))->getDescription()); + CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), *(yyvsp[(5) - (5)].TypeVal), 0); CHECK_FOR_ERROR - delete yyvsp[0].TypeVal; - ; - break;} -case 190: -#line 1943 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(5) - (5)].TypeVal); + ;} + break; + + case 191: +#line 1944 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; CHECK_FOR_ERROR - ; - break;} -case 191: -#line 1947 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CHECK_FOR_ERROR - ; - break;} -case 192: -#line 1950 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 192: +#line 1948 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 193: -#line 1956 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 193: +#line 1951 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + CHECK_FOR_ERROR + ;} + break; + + case 194: +#line 1957 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - std::string NewAsm(yyvsp[0].StrVal, EndStr); - free(yyvsp[0].StrVal); + char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); + std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); + free((yyvsp[(1) - (1)].StrVal)); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); CHECK_FOR_ERROR -; - break;} -case 194: -#line 1969 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 195: -#line 1973 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 197: -#line 1980 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); +;} + break; + + case 195: +#line 1970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); + ;} + break; + + case 196: +#line 1974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); + ;} + break; + + case 198: +#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); + free((yyvsp[(3) - (3)].StrVal)); CHECK_FOR_ERROR - ; - break;} -case 198: -#line 1985 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); + ;} + break; + + case 199: +#line 1986 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); + free((yyvsp[(1) - (1)].StrVal)); CHECK_FOR_ERROR - ; - break;} -case 199: -#line 1990 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 200: +#line 1991 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 200: -#line 1999 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 201: +#line 2000 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (*yyvsp[-2].TypeVal == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; - yyval.ArgList = yyvsp[-4].ArgList; - yyvsp[-4].ArgList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 201: -#line 2009 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal); + (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList); + (yyvsp[(1) - (5)].ArgList)->push_back(E); + CHECK_FOR_ERROR + ;} + break; + + case 202: +#line 2010 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (*yyvsp[-2].TypeVal == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; - yyval.ArgList = new ArgListType; - yyval.ArgList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 202: -#line 2020 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[0].ArgList; + ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal); + (yyval.ArgList) = new ArgListType; + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 203: -#line 2024 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; + ;} + break; + + case 203: +#line 2021 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); + CHECK_FOR_ERROR + ;} + break; + + case 204: +#line 2025 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = FunctionType::NoAttributeSet; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 204: -#line 2033 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = new ArgListType; + ;} + break; + + case 205: +#line 2034 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = FunctionType::NoAttributeSet; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 205: -#line 2042 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = 0; + ;} + break; + + case 206: +#line 2043 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = 0; CHECK_FOR_ERROR - ; - break;} -case 206: -#line 2048 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - UnEscapeLexed(yyvsp[-6].StrVal); - std::string FunctionName(yyvsp[-6].StrVal); - free(yyvsp[-6].StrVal); // Free strdup'd memory! + ;} + break; + + case 207: +#line 2049 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + UnEscapeLexed((yyvsp[(3) - (9)].StrVal)); + std::string FunctionName((yyvsp[(3) - (9)].StrVal)); + free((yyvsp[(3) - (9)].StrVal)); // Free strdup'd memory! // Check the function result for abstractness if this is a define. We should // have no abstract types at this point - if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-7].TypeVal)) - GEN_ERROR("Reference to abstract result: "+ yyvsp[-7].TypeVal->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (9)].TypeVal))) + GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription()); std::vector ParamTypeList; std::vector ParamAttrs; - ParamAttrs.push_back(yyvsp[-2].ParamAttrs); - if (yyvsp[-4].ArgList) { // If there are arguments... - for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I) { + ParamAttrs.push_back((yyvsp[(7) - (9)].ParamAttrs)); + if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments... + for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -3774,10 +4774,10 @@ bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - FunctionType *FT = FunctionType::get(*yyvsp[-7].TypeVal, ParamTypeList, isVarArg, + FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete yyvsp[-7].TypeVal; + delete (yyvsp[(2) - (9)].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -3826,26 +4826,26 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv(yyvsp[-8].UIntVal); - Fn->setAlignment(yyvsp[0].UIntVal); - if (yyvsp[-1].StrVal) { - Fn->setSection(yyvsp[-1].StrVal); - free(yyvsp[-1].StrVal); + Fn->setCallingConv((yyvsp[(1) - (9)].UIntVal)); + Fn->setAlignment((yyvsp[(9) - (9)].UIntVal)); + if ((yyvsp[(8) - (9)].StrVal)) { + Fn->setSection((yyvsp[(8) - (9)].StrVal)); + free((yyvsp[(8) - (9)].StrVal)); } // Add all of the arguments we parsed to the function... - if (yyvsp[-4].ArgList) { // Is null if empty... + if ((yyvsp[(5) - (9)].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert(yyvsp[-4].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-4].ArgList->back().Name == 0 && + assert((yyvsp[(5) - (9)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (9)].ArgList)->back().Name == 0 && "Not a varargs marker!"); - delete yyvsp[-4].ArgList->back().Ty; - yyvsp[-4].ArgList->pop_back(); // Delete the last entry + delete (yyvsp[(5) - (9)].ArgList)->back().Ty; + (yyvsp[(5) - (9)].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); unsigned Idx = 1; - for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); - I != yyvsp[-4].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); + I != (yyvsp[(5) - (9)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -3853,114 +4853,128 @@ Idx++; } - delete yyvsp[-4].ArgList; // We're now done with the argument list + delete (yyvsp[(5) - (9)].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR -; - break;} -case 209: -#line 2161 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = CurFun.CurrentFunction; +;} + break; + + case 210: +#line 2162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage); - yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility); -; - break;} -case 212: -#line 2172 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; + (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage)); + (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility)); +;} + break; + + case 213: +#line 2173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR -; - break;} -case 213: -#line 2177 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); - CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); - yyval.FunctionVal = CurFun.CurrentFunction; +;} + break; + + case 214: +#line 2178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); + CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); + (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR - ; - break;} -case 214: -#line 2189 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 215: +#line 2190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; CHECK_FOR_ERROR - ; - break;} -case 215: -#line 2193 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 216: +#line 2194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 216: -#line 2198 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A reference to a direct constant - yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); - CHECK_FOR_ERROR - ; - break;} -case 217: -#line 2202 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); + ;} + break; + + case 217: +#line 2199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // A reference to a direct constant + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 218: -#line 2206 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Perhaps it's an FP constant? - yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); - CHECK_FOR_ERROR - ; - break;} -case 219: -#line 2210 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); + ;} + break; + + case 218: +#line 2203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 220: -#line 2214 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); + ;} + break; + + case 219: +#line 2207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Perhaps it's an FP constant? + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR - ; - break;} -case 221: -#line 2218 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createNull(); + ;} + break; + + case 220: +#line 2211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ; - break;} -case 222: -#line 2222 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createUndef(); + ;} + break; + + case 221: +#line 2215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); + CHECK_FOR_ERROR + ;} + break; + + case 222: +#line 2219 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createNull(); + CHECK_FOR_ERROR + ;} + break; + + case 223: +#line 2223 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createUndef(); + CHECK_FOR_ERROR + ;} + break; + + case 224: +#line 2227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // A vector zero constant. + (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR - ; - break;} -case 223: -#line 2226 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A vector zero constant. - yyval.ValIDVal = ValID::createZeroInit(); - CHECK_FOR_ERROR - ; - break;} -case 224: -#line 2230 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized packed vector - const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); - int NumElements = yyvsp[-1].ConstVector->size(); + ;} + break; + + case 225: +#line 2231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized packed vector + const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); + int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -3972,118 +4986,130 @@ ); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) + for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { + if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, *yyvsp[-1].ConstVector)); - delete PTy; delete yyvsp[-1].ConstVector; + (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[(2) - (3)].ConstVector))); + delete PTy; delete (yyvsp[(2) - (3)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 225: -#line 2255 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); + ;} + break; + + case 226: +#line 2256 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 226: -#line 2259 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); - std::string AsmStr = std::string(yyvsp[-2].StrVal, End); - End = UnEscapeLexed(yyvsp[0].StrVal, true); - std::string Constraints = std::string(yyvsp[0].StrVal, End); - yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); - free(yyvsp[-2].StrVal); - free(yyvsp[0].StrVal); - CHECK_FOR_ERROR - ; - break;} -case 227: -#line 2273 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it an integer reference...? - yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); - CHECK_FOR_ERROR - ; - break;} -case 228: -#line 2277 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); + ;} + break; + + case 227: +#line 2260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); + std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); + End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); + std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); + (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); + free((yyvsp[(3) - (5)].StrVal)); + free((yyvsp[(5) - (5)].StrVal)); CHECK_FOR_ERROR - ; - break;} -case 229: -#line 2281 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it a named reference...? - yyval.ValIDVal = ValID::createLocalName(yyvsp[0].StrVal); - CHECK_FOR_ERROR - ; - break;} -case 230: -#line 2285 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it a named reference...? - yyval.ValIDVal = ValID::createGlobalName(yyvsp[0].StrVal); - CHECK_FOR_ERROR - ; - break;} -case 233: -#line 2297 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 228: +#line 2274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it an integer reference...? + (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); + CHECK_FOR_ERROR + ;} + break; + + case 229: +#line 2278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); + CHECK_FOR_ERROR + ;} + break; + + case 230: +#line 2282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it a named reference...? + (yyval.ValIDVal) = ValID::createLocalName((yyvsp[(1) - (1)].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 231: +#line 2286 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it a named reference...? + (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[(1) - (1)].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 234: +#line 2298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 234: -#line 2306 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); + (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal)); + delete (yyvsp[(1) - (2)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 235: -#line 2310 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Do not allow functions with 0 basic blocks - yyval.FunctionVal = yyvsp[-1].FunctionVal; - CHECK_FOR_ERROR - ; - break;} -case 236: -#line 2319 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); + ;} + break; + + case 235: +#line 2307 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR - InsertValue(yyvsp[0].TermInstVal); - yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); - InsertValue(yyvsp[-2].BasicBlockVal); - yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; - CHECK_FOR_ERROR - ; - break;} -case 237: -#line 2329 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal)) + ;} + break; + + case 236: +#line 2311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Do not allow functions with 0 basic blocks + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + CHECK_FOR_ERROR + ;} + break; + + case 237: +#line 2320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); + CHECK_FOR_ERROR + InsertValue((yyvsp[(3) - (3)].TermInstVal)); + (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); + InsertValue((yyvsp[(1) - (3)].BasicBlockVal)); + (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); + CHECK_FOR_ERROR + ;} + break; + + case 238: +#line 2330 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) if (CI2->getParent() == 0) - yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2); - yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); - yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; - CHECK_FOR_ERROR - ; - break;} -case 238: -#line 2338 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BasicBlockVal = getBBVal(ValID::createLocalID(CurFun.NextBBNum++), true); + (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2); + (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal)); + (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); + CHECK_FOR_ERROR + ;} + break; + + case 239: +#line 2339 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BasicBlockVal) = getBBVal(ValID::createLocalID(CurFun.NextBBNum++), true); CHECK_FOR_ERROR // Make sure to move the basic block to the correct location in the @@ -4091,14 +5117,15 @@ // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); + BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); CHECK_FOR_ERROR - ; - break;} -case 239: -#line 2350 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BasicBlockVal = getBBVal(ValID::createLocalName(yyvsp[0].StrVal), true); + ;} + break; + + case 240: +#line 2351 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BasicBlockVal) = getBBVal(ValID::createLocalName((yyvsp[(1) - (1)].StrVal)), true); CHECK_FOR_ERROR // Make sure to move the basic block to the correct location in the @@ -4106,93 +5133,100 @@ // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); + BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); CHECK_FOR_ERROR - ; - break;} -case 240: -#line 2363 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with a result... - yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); - CHECK_FOR_ERROR - ; - break;} -case 241: -#line 2367 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with no result... - yyval.TermInstVal = new ReturnInst(); - CHECK_FOR_ERROR - ; - break;} -case 242: -#line 2371 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Unconditional Branch... - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - yyval.TermInstVal = new BranchInst(tmpBB); - ; - break;} -case 243: -#line 2376 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); - CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); - CHECK_FOR_ERROR - yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ; - break;} -case 244: -#line 2386 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); + ;} + break; + + case 241: +#line 2364 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Return with a result... + (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 242: +#line 2368 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Return with no result... + (yyval.TermInstVal) = new ReturnInst(); + CHECK_FOR_ERROR + ;} + break; + + case 243: +#line 2372 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Unconditional Branch... + BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); + CHECK_FOR_ERROR + (yyval.TermInstVal) = new BranchInst(tmpBB); + ;} + break; + + case 244: +#line 2377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + CHECK_FOR_ERROR + BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); + Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); - yyval.TermInstVal = S; + (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ;} + break; + + case 245: +#line 2387 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); + CHECK_FOR_ERROR + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + CHECK_FOR_ERROR + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); + (yyval.TermInstVal) = S; - std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), - E = yyvsp[-1].JumpTable->end(); + std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), + E = (yyvsp[(8) - (9)].JumpTable)->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer"); } - delete yyvsp[-1].JumpTable; + delete (yyvsp[(8) - (9)].JumpTable); CHECK_FOR_ERROR - ; - break;} -case 245: -#line 2405 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); + ;} + break; + + case 246: +#line 2406 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); CHECK_FOR_ERROR SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); - yyval.TermInstVal = S; + (yyval.TermInstVal) = S; CHECK_FOR_ERROR - ; - break;} -case 246: -#line 2415 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 247: +#line 2416 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast(yyvsp[-11].TypeVal->get())) || + if (!(PFTy = dyn_cast((yyvsp[(3) - (14)].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back(yyvsp[-6].ParamAttrs); - for (ValueRefList::iterator I = yyvsp[-8].ValueRefList->begin(), E = yyvsp[-8].ValueRefList->end(); I != E; ++I) { + ParamAttrs.push_back((yyvsp[(8) - (14)].ParamAttrs)); + for (ValueRefList::iterator I = (yyvsp[(6) - (14)].ValueRefList)->begin(), E = (yyvsp[(6) - (14)].ValueRefList)->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -4200,20 +5234,20 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); + BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); + BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal)); CHECK_FOR_ERROR // Check the arguments ValueList Args; - if (yyvsp[-8].ValueRefList->empty()) { // Has no arguments? + if ((yyvsp[(6) - (14)].ValueRefList)->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 " @@ -4223,7 +5257,7 @@ // 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(); + ValueRefList::iterator ArgI = (yyvsp[(6) - (14)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (14)].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -4242,314 +5276,340 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, Args); - II->setCallingConv(yyvsp[-12].UIntVal); - yyval.TermInstVal = II; - delete yyvsp[-8].ValueRefList; - CHECK_FOR_ERROR - ; - break;} -case 247: -#line 2481 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnwindInst(); + II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); + (yyval.TermInstVal) = II; + delete (yyvsp[(6) - (14)].ValueRefList); CHECK_FOR_ERROR - ; - break;} -case 248: -#line 2485 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnreachableInst(); + ;} + break; + + case 248: +#line 2482 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR - ; - break;} -case 249: -#line 2492 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = yyvsp[-5].JumpTable; - Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + ;} + break; + + case 249: +#line 2486 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnreachableInst(); + CHECK_FOR_ERROR + ;} + break; + + case 250: +#line 2493 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); + Constant *V = cast(getValNonImprovising((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); - ; - break;} -case 250: -#line 2503 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = new std::vector >(); - Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 251: +#line 2504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = new std::vector >(); + Constant *V = cast(getValNonImprovising((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); - ; - break;} -case 251: -#line 2516 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 252: +#line 2517 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is this definition named?? if so, assign the name... - setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); + setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); CHECK_FOR_ERROR - InsertValue(yyvsp[0].InstVal); - yyval.InstVal = yyvsp[0].InstVal; + InsertValue((yyvsp[(2) - (2)].InstVal)); + (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); CHECK_FOR_ERROR - ; - break;} -case 252: -#line 2526 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Used for PHI nodes + ;} + break; + + case 253: +#line 2527 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription()); - yyval.PHIList = new std::list >(); - Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal); - CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); - CHECK_FOR_ERROR - yyval.PHIList->push_back(std::make_pair(tmpVal, tmpBB)); - delete yyvsp[-5].TypeVal; - ; - break;} -case 253: -#line 2537 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.PHIList = yyvsp[-6].PHIList; - Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); + (yyval.PHIList) = new std::list >(); + Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal)); + CHECK_FOR_ERROR + BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); + CHECK_FOR_ERROR + (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); + delete (yyvsp[(1) - (6)].TypeVal); + ;} + break; + + case 254: +#line 2538 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); + Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); CHECK_FOR_ERROR - yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB)); - ; - break;} -case 254: -#line 2547 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); + ;} + break; + + case 255: +#line 2548 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].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); - ; - break;} -case 255: -#line 2555 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.ValueRefList) = new ValueRefList(); + ValueRefListEntry E; E.Attrs = (yyvsp[(3) - (3)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (3)].TypeVal)->get(), (yyvsp[(2) - (3)].ValIDVal)); + (yyval.ValueRefList)->push_back(E); + ;} + break; + + case 256: +#line 2556 "/Users/sabre/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); - CHECK_FOR_ERROR - ; - break;} -case 256: -#line 2563 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ValueRefList = new ValueRefList(); ; - break;} -case 257: -#line 2566 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ValueList = new std::vector(); ; - break;} -case 258: -#line 2567 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueList = yyvsp[-2].ValueList; - yyval.ValueList->push_back(yyvsp[0].ValueVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + (yyval.ValueRefList) = (yyvsp[(1) - (5)].ValueRefList); + ValueRefListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (5)].TypeVal)->get(), (yyvsp[(4) - (5)].ValIDVal)); + (yyval.ValueRefList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 259: -#line 2574 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 257: +#line 2564 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ValueRefList) = new ValueRefList(); ;} + break; + + case 258: +#line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ValueList) = new std::vector(); ;} + break; + + case 259: +#line 2568 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); + (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 260: -#line 2578 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 260: +#line 2575 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 261: -#line 2583 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 261: +#line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 262: +#line 2584 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && - !isa((*yyvsp[-3].TypeVal).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); + if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() && + !isa((*(yyvsp[(2) - (5)].TypeVal)).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands"); - if (isa((*yyvsp[-3].TypeVal).get()) && - (yyvsp[-4].BinaryOpVal == Instruction::URem || - yyvsp[-4].BinaryOpVal == Instruction::SRem || - yyvsp[-4].BinaryOpVal == Instruction::FRem)) + if (isa((*(yyvsp[(2) - (5)].TypeVal)).get()) && + ((yyvsp[(1) - (5)].BinaryOpVal) == Instruction::URem || + (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::SRem || + (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::FRem)) GEN_ERROR("Remainder not supported on packed types"); - Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); CHECK_FOR_ERROR - Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2); - if (yyval.InstVal == 0) + (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2); + if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 262: -#line 2604 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(2) - (5)].TypeVal); + ;} + break; + + case 263: +#line 2605 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (!(*yyvsp[-3].TypeVal)->isInteger()) { - if (Instruction::isShift(yyvsp[-4].BinaryOpVal) || !isa(yyvsp[-3].TypeVal->get()) || - !cast(yyvsp[-3].TypeVal->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); + if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { + if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa((yyvsp[(2) - (5)].TypeVal)->get()) || + !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2); - if (yyval.InstVal == 0) + (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) GEN_ERROR("binary operator returned null"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 263: -#line 2621 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(2) - (5)].TypeVal); + ;} + break; + + case 264: +#line 2622 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (isa((*yyvsp[-3].TypeVal).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) GEN_ERROR("Packed types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2); - if (yyval.InstVal == 0) + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) GEN_ERROR("icmp operator returned null"); - ; - break;} -case 264: -#line 2634 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 265: +#line 2635 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (isa((*yyvsp[-3].TypeVal).get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) GEN_ERROR("Packed types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); + Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); + Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2); - if (yyval.InstVal == 0) + (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); + if ((yyval.InstVal) == 0) GEN_ERROR("fcmp operator returned null"); - ; - break;} -case 265: -#line 2647 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 266: +#line 2648 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - Value* Val = yyvsp[-2].ValueVal; - const Type* DestTy = yyvsp[0].TypeVal->get(); - if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); + Value* Val = (yyvsp[(2) - (4)].ValueVal); + const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get(); + if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy); - delete yyvsp[0].TypeVal; - ; - break;} -case 266: -#line 2659 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty) + (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy); + delete (yyvsp[(4) - (4)].TypeVal); + ;} + break; + + case 267: +#line 2660 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); - if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) + if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType()) GEN_ERROR("select value types should match"); - yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 267: -#line 2667 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 268: +#line 2668 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 268: -#line 2674 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); + (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal)); + delete (yyvsp[(4) - (4)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 269: +#line 2675 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) GEN_ERROR("Invalid extractelement operands"); - yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 269: -#line 2680 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + ;} + break; + + case 270: +#line 2681 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid insertelement operands"); - yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 270: -#line 2686 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + ;} + break; + + case 271: +#line 2687 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) GEN_ERROR("Invalid shufflevector operands"); - yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); + (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 271: -#line 2692 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const Type *Ty = yyvsp[0].PHIList->front().first->getType(); + ;} + break; + + case 272: +#line 2693 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type"); - yyval.InstVal = new PHINode(Ty); - ((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size()); - while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) { - if (yyvsp[0].PHIList->front().first->getType() != Ty) + (yyval.InstVal) = new PHINode(Ty); + ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size()); + while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) { + if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type"); - cast(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second); - yyvsp[0].PHIList->pop_front(); + cast((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second); + (yyvsp[(2) - (2)].PHIList)->pop_front(); } - delete yyvsp[0].PHIList; // Free the list... + delete (yyvsp[(2) - (2)].PHIList); // Free the list... CHECK_FOR_ERROR - ; - break;} -case 272: -#line 2708 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 273: +#line 2709 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast(yyvsp[-5].TypeVal->get())) || + if (!(PFTy = dyn_cast((yyvsp[(3) - (8)].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back(yyvsp[0].ParamAttrs); - for (ValueRefList::iterator I = yyvsp[-2].ValueRefList->begin(), E = yyvsp[-2].ValueRefList->end(); I != E; ++I) { + ParamAttrs.push_back((yyvsp[(8) - (8)].ParamAttrs)); + for (ValueRefList::iterator I = (yyvsp[(6) - (8)].ValueRefList)->begin(), E = (yyvsp[(6) - (8)].ValueRefList)->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -4557,16 +5617,16 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling... CHECK_FOR_ERROR // Check the arguments ValueList Args; - if (yyvsp[-2].ValueRefList->empty()) { // Has no arguments? + if ((yyvsp[(6) - (8)].ValueRefList)->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 " @@ -4577,7 +5637,7 @@ // 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(); + ValueRefList::iterator ArgI = (yyvsp[(6) - (8)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (8)].ValueRefList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -4594,365 +5654,371 @@ } // Create the call node CallInst *CI = new CallInst(V, Args); - CI->setTailCall(yyvsp[-7].BoolVal); - CI->setCallingConv(yyvsp[-6].UIntVal); - yyval.InstVal = CI; - delete yyvsp[-2].ValueRefList; - delete yyvsp[-5].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 273: -#line 2771 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = yyvsp[0].InstVal; + CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); + CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); + (yyval.InstVal) = CI; + delete (yyvsp[(6) - (8)].ValueRefList); + delete (yyvsp[(3) - (8)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 274: -#line 2776 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 274: +#line 2772 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR - ; - break;} -case 275: -#line 2780 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 275: +#line 2777 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 276: -#line 2787 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 276: +#line 2781 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 277: +#line 2788 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 277: -#line 2794 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); + (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); + delete (yyvsp[(2) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 278: +#line 2795 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); - Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal; - ; - break;} -case 278: -#line 2802 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal); + ;} + break; + + case 279: +#line 2803 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 279: -#line 2809 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); + (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); + delete (yyvsp[(2) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 280: +#line 2810 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); - Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); + Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal; - ; - break;} -case 280: -#line 2817 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[0].ValueVal->getType())) + (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); + delete (yyvsp[(2) - (6)].TypeVal); + ;} + break; + + case 281: +#line 2818 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + - yyvsp[0].ValueVal->getType()->getDescription() + ""); - yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); + (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + ""); + (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 281: -#line 2825 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 282: +#line 2826 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - if (!isa(yyvsp[-1].TypeVal->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); + if (!isa((yyvsp[(3) - (4)].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*yyvsp[-1].TypeVal)->getDescription()); - if (!cast(yyvsp[-1].TypeVal->get())->getElementType()->isFirstClassType()) + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); + if (!cast((yyvsp[(3) - (4)].TypeVal)->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*yyvsp[-1].TypeVal)->getDescription()); - Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); + Value* tmpVal = getVal(*(yyvsp[(3) - (4)].TypeVal), (yyvsp[(4) - (4)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-3].BoolVal); - delete yyvsp[-1].TypeVal; - ; - break;} -case 282: -#line 2839 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (4)].BoolVal)); + delete (yyvsp[(3) - (4)].TypeVal); + ;} + break; + + case 283: +#line 2840 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - const PointerType *PT = dyn_cast(yyvsp[-1].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); + const PointerType *PT = dyn_cast((yyvsp[(5) - (6)].TypeVal)->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*yyvsp[-1].TypeVal)->getDescription()); + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != yyvsp[-3].ValueVal->getType()) - GEN_ERROR("Can't store '" + yyvsp[-3].ValueVal->getType()->getDescription() + + if (ElTy != (yyvsp[(3) - (6)].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[(3) - (6)].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); + Value* tmpVal = getVal(*(yyvsp[(5) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new StoreInst(yyvsp[-3].ValueVal, tmpVal, yyvsp[-5].BoolVal); - delete yyvsp[-1].TypeVal; - ; - break;} -case 283: -#line 2856 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new StoreInst((yyvsp[(3) - (6)].ValueVal), tmpVal, (yyvsp[(1) - (6)].BoolVal)); + delete (yyvsp[(5) - (6)].TypeVal); + ;} + break; + + case 284: +#line 2857 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - if (!isa(yyvsp[-2].TypeVal->get())) + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); + if (!isa((yyvsp[(2) - (4)].TypeVal)->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, *yyvsp[0].ValueList, true)) + if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*yyvsp[-2].TypeVal)->getDescription()+ "'"); - Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'"); + Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new GetElementPtrInst(tmpVal, *yyvsp[0].ValueList); - delete yyvsp[-2].TypeVal; - delete yyvsp[0].ValueList; - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/share/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif + (yyval.InstVal) = new GetElementPtrInst(tmpVal, &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size()); + delete (yyvsp[(2) - (4)].TypeVal); + delete (yyvsp[(4) - (4)].ValueList); + ;} + break; -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif + +/* Line 1267 of yacc.c. */ +#line 5808 "llvmAsmParser.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTBASE]; + yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; -yyerrlab: /* here on detecting error */ - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ + if (yyerrstatus == 3) { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; -yyerrdefault: /* current state does not do anything special for the error token. */ -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -yyerrpop: /* pop the current state because it cannot handle the error token */ - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ -#if YYDEBUG != 0 - if (yydebug) + for (;;) { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } - else if (yyn == 0) - goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); #endif - } - return 1; + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 2873 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" + + +#line 2874 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -5001,3 +6067,4 @@ GenerateError(errMsg); return 0; } + Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.52 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.53 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.52 Sun Feb 11 15:40:10 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Mon Feb 12 18:58:01 2007 @@ -1,4 +1,313 @@ -typedef union { +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + LOCALVAL_ID = 260, + GLOBALVAL_ID = 261, + FPVAL = 262, + VOID = 263, + INTTYPE = 264, + FLOAT = 265, + DOUBLE = 266, + LABEL = 267, + TYPE = 268, + LOCALVAR = 269, + GLOBALVAR = 270, + LABELSTR = 271, + STRINGCONSTANT = 272, + ATSTRINGCONSTANT = 273, + IMPLEMENTATION = 274, + ZEROINITIALIZER = 275, + TRUETOK = 276, + FALSETOK = 277, + BEGINTOK = 278, + ENDTOK = 279, + DECLARE = 280, + DEFINE = 281, + GLOBAL = 282, + CONSTANT = 283, + SECTION = 284, + VOLATILE = 285, + TO = 286, + DOTDOTDOT = 287, + NULL_TOK = 288, + UNDEF = 289, + INTERNAL = 290, + LINKONCE = 291, + WEAK = 292, + APPENDING = 293, + DLLIMPORT = 294, + DLLEXPORT = 295, + EXTERN_WEAK = 296, + OPAQUE = 297, + EXTERNAL = 298, + TARGET = 299, + TRIPLE = 300, + ALIGN = 301, + DEPLIBS = 302, + CALL = 303, + TAIL = 304, + ASM_TOK = 305, + MODULE = 306, + SIDEEFFECT = 307, + CC_TOK = 308, + CCC_TOK = 309, + FASTCC_TOK = 310, + COLDCC_TOK = 311, + X86_STDCALLCC_TOK = 312, + X86_FASTCALLCC_TOK = 313, + DATALAYOUT = 314, + RET = 315, + BR = 316, + SWITCH = 317, + INVOKE = 318, + UNWIND = 319, + UNREACHABLE = 320, + ADD = 321, + SUB = 322, + MUL = 323, + UDIV = 324, + SDIV = 325, + FDIV = 326, + UREM = 327, + SREM = 328, + FREM = 329, + AND = 330, + OR = 331, + XOR = 332, + SHL = 333, + LSHR = 334, + ASHR = 335, + ICMP = 336, + FCMP = 337, + EQ = 338, + NE = 339, + SLT = 340, + SGT = 341, + SLE = 342, + SGE = 343, + ULT = 344, + UGT = 345, + ULE = 346, + UGE = 347, + OEQ = 348, + ONE = 349, + OLT = 350, + OGT = 351, + OLE = 352, + OGE = 353, + ORD = 354, + UNO = 355, + UEQ = 356, + UNE = 357, + MALLOC = 358, + ALLOCA = 359, + FREE = 360, + LOAD = 361, + STORE = 362, + GETELEMENTPTR = 363, + TRUNC = 364, + ZEXT = 365, + SEXT = 366, + FPTRUNC = 367, + FPEXT = 368, + BITCAST = 369, + UITOFP = 370, + SITOFP = 371, + FPTOUI = 372, + FPTOSI = 373, + INTTOPTR = 374, + PTRTOINT = 375, + PHI_TOK = 376, + SELECT = 377, + VAARG = 378, + EXTRACTELEMENT = 379, + INSERTELEMENT = 380, + SHUFFLEVECTOR = 381, + NORETURN = 382, + INREG = 383, + SRET = 384, + DEFAULT = 385, + HIDDEN = 386 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define LOCALVAL_ID 260 +#define GLOBALVAL_ID 261 +#define FPVAL 262 +#define VOID 263 +#define INTTYPE 264 +#define FLOAT 265 +#define DOUBLE 266 +#define LABEL 267 +#define TYPE 268 +#define LOCALVAR 269 +#define GLOBALVAR 270 +#define LABELSTR 271 +#define STRINGCONSTANT 272 +#define ATSTRINGCONSTANT 273 +#define IMPLEMENTATION 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define VOLATILE 285 +#define TO 286 +#define DOTDOTDOT 287 +#define NULL_TOK 288 +#define UNDEF 289 +#define INTERNAL 290 +#define LINKONCE 291 +#define WEAK 292 +#define APPENDING 293 +#define DLLIMPORT 294 +#define DLLEXPORT 295 +#define EXTERN_WEAK 296 +#define OPAQUE 297 +#define EXTERNAL 298 +#define TARGET 299 +#define TRIPLE 300 +#define ALIGN 301 +#define DEPLIBS 302 +#define CALL 303 +#define TAIL 304 +#define ASM_TOK 305 +#define MODULE 306 +#define SIDEEFFECT 307 +#define CC_TOK 308 +#define CCC_TOK 309 +#define FASTCC_TOK 310 +#define COLDCC_TOK 311 +#define X86_STDCALLCC_TOK 312 +#define X86_FASTCALLCC_TOK 313 +#define DATALAYOUT 314 +#define RET 315 +#define BR 316 +#define SWITCH 317 +#define INVOKE 318 +#define UNWIND 319 +#define UNREACHABLE 320 +#define ADD 321 +#define SUB 322 +#define MUL 323 +#define UDIV 324 +#define SDIV 325 +#define FDIV 326 +#define UREM 327 +#define SREM 328 +#define FREM 329 +#define AND 330 +#define OR 331 +#define XOR 332 +#define SHL 333 +#define LSHR 334 +#define ASHR 335 +#define ICMP 336 +#define FCMP 337 +#define EQ 338 +#define NE 339 +#define SLT 340 +#define SGT 341 +#define SLE 342 +#define SGE 343 +#define ULT 344 +#define UGT 345 +#define ULE 346 +#define UGE 347 +#define OEQ 348 +#define ONE 349 +#define OLT 350 +#define OGT 351 +#define OLE 352 +#define OGE 353 +#define ORD 354 +#define UNO 355 +#define UEQ 356 +#define UNE 357 +#define MALLOC 358 +#define ALLOCA 359 +#define FREE 360 +#define LOAD 361 +#define STORE 362 +#define GETELEMENTPTR 363 +#define TRUNC 364 +#define ZEXT 365 +#define SEXT 366 +#define FPTRUNC 367 +#define FPEXT 368 +#define BITCAST 369 +#define UITOFP 370 +#define SITOFP 371 +#define FPTOUI 372 +#define FPTOSI 373 +#define INTTOPTR 374 +#define PTRTOINT 375 +#define PHI_TOK 376 +#define SELECT 377 +#define VAARG 378 +#define EXTRACTELEMENT 379 +#define INSERTELEMENT 380 +#define SHUFFLEVECTOR 381 +#define NORETURN 382 +#define INREG 383 +#define SRET 384 +#define DEFAULT 385 +#define HIDDEN 386 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 901 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -42,136 +351,14 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} YYSTYPE; -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define LOCALVAL_ID 259 -#define GLOBALVAL_ID 260 -#define FPVAL 261 -#define VOID 262 -#define INTTYPE 263 -#define FLOAT 264 -#define DOUBLE 265 -#define LABEL 266 -#define TYPE 267 -#define LOCALVAR 268 -#define GLOBALVAR 269 -#define LABELSTR 270 -#define STRINGCONSTANT 271 -#define ATSTRINGCONSTANT 272 -#define IMPLEMENTATION 273 -#define ZEROINITIALIZER 274 -#define TRUETOK 275 -#define FALSETOK 276 -#define BEGINTOK 277 -#define ENDTOK 278 -#define DECLARE 279 -#define DEFINE 280 -#define GLOBAL 281 -#define CONSTANT 282 -#define SECTION 283 -#define VOLATILE 284 -#define TO 285 -#define DOTDOTDOT 286 -#define NULL_TOK 287 -#define UNDEF 288 -#define INTERNAL 289 -#define LINKONCE 290 -#define WEAK 291 -#define APPENDING 292 -#define DLLIMPORT 293 -#define DLLEXPORT 294 -#define EXTERN_WEAK 295 -#define OPAQUE 296 -#define EXTERNAL 297 -#define TARGET 298 -#define TRIPLE 299 -#define ALIGN 300 -#define DEPLIBS 301 -#define CALL 302 -#define TAIL 303 -#define ASM_TOK 304 -#define MODULE 305 -#define SIDEEFFECT 306 -#define CC_TOK 307 -#define CCC_TOK 308 -#define FASTCC_TOK 309 -#define COLDCC_TOK 310 -#define X86_STDCALLCC_TOK 311 -#define X86_FASTCALLCC_TOK 312 -#define DATALAYOUT 313 -#define RET 314 -#define BR 315 -#define SWITCH 316 -#define INVOKE 317 -#define UNWIND 318 -#define UNREACHABLE 319 -#define ADD 320 -#define SUB 321 -#define MUL 322 -#define UDIV 323 -#define SDIV 324 -#define FDIV 325 -#define UREM 326 -#define SREM 327 -#define FREM 328 -#define AND 329 -#define OR 330 -#define XOR 331 -#define SHL 332 -#define LSHR 333 -#define ASHR 334 -#define ICMP 335 -#define FCMP 336 -#define EQ 337 -#define NE 338 -#define SLT 339 -#define SGT 340 -#define SLE 341 -#define SGE 342 -#define ULT 343 -#define UGT 344 -#define ULE 345 -#define UGE 346 -#define OEQ 347 -#define ONE 348 -#define OLT 349 -#define OGT 350 -#define OLE 351 -#define OGE 352 -#define ORD 353 -#define UNO 354 -#define UEQ 355 -#define UNE 356 -#define MALLOC 357 -#define ALLOCA 358 -#define FREE 359 -#define LOAD 360 -#define STORE 361 -#define GETELEMENTPTR 362 -#define TRUNC 363 -#define ZEXT 364 -#define SEXT 365 -#define FPTRUNC 366 -#define FPEXT 367 -#define BITCAST 368 -#define UITOFP 369 -#define SITOFP 370 -#define FPTOUI 371 -#define FPTOSI 372 -#define INTTOPTR 373 -#define PTRTOINT 374 -#define PHI_TOK 375 -#define SELECT 376 -#define VAARG 377 -#define EXTRACTELEMENT 378 -#define INSERTELEMENT 379 -#define SHUFFLEVECTOR 380 -#define NORETURN 381 -#define INREG 382 -#define SRET 383 -#define DEFAULT 384 -#define HIDDEN 385 - +} +/* Line 1529 of yacc.c. */ +#line 357 "llvmAsmParser.tab.h" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif extern YYSTYPE llvmAsmlval; + Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.67 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.68 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.67 Sun Feb 11 15:40:10 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Mon Feb 12 18:58:01 2007 @@ -1746,7 +1746,8 @@ GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType($3->getType(), *$4, true); + GetElementPtrInst::getIndexedType($3->getType(), &(*$4)[0], $4->size(), + true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); @@ -2859,12 +2860,12 @@ if (!isa($2->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*$2, *$4, true)) + if (!GetElementPtrInst::getIndexedType(*$2, &(*$4)[0], $4->size(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + (*$2)->getDescription()+ "'"); Value* tmpVal = getVal(*$2, $3); CHECK_FOR_ERROR - $$ = new GetElementPtrInst(tmpVal, *$4); + $$ = new GetElementPtrInst(tmpVal, &(*$4)[0], $4->size()); delete $2; delete $4; }; From sabre at nondot.org Mon Feb 12 18:59:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 18:59:03 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200702130059.l1D0x3As001781@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.54 -> 1.55 --- Log message: remove some dead methods. --- Diffs of the changes: (+1 -10) Instructions.h | 11 +---------- 1 files changed, 1 insertion(+), 10 deletions(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.54 llvm/include/llvm/Instructions.h:1.55 --- llvm/include/llvm/Instructions.h:1.54 Sun Feb 11 23:00:35 2007 +++ llvm/include/llvm/Instructions.h Mon Feb 12 18:58:44 2007 @@ -345,10 +345,6 @@ /// list of indices. The first ctor can optionally insert before an existing /// instruction, the second appends the new instruction to the specified /// BasicBlock. - GetElementPtrInst(Value *Ptr, const std::vector &Idx, - const std::string &Name = "", Instruction *InsertBefore =0); - GetElementPtrInst(Value *Ptr, const std::vector &Idx, - const std::string &Name, BasicBlock *InsertAtEnd); GetElementPtrInst(Value *Ptr, Value* const *Idx, unsigned NumIdx, const std::string &Name = "", Instruction *InsertBefore =0); GetElementPtrInst(Value *Ptr, Value* const *Idx, unsigned NumIdx, @@ -383,11 +379,6 @@ Value* const *Idx, unsigned NumIdx, bool AllowStructLeaf = false); - static const Type *getIndexedType(const Type *Ptr, - const std::vector &Indices, - bool AllowStructLeaf = false) { - return getIndexedType(Ptr, &Indices[0], Indices.size(), AllowStructLeaf); - } static const Type *getIndexedType(const Type *Ptr, Value *Idx0, Value *Idx1, bool AllowStructLeaf = false); static const Type *getIndexedType(const Type *Ptr, Value *Idx); @@ -698,7 +689,7 @@ /// class CallInst : public Instruction { CallInst(const CallInst &CI); - void init(Value *Func, const std::vector &Params); + void init(Value *Func, Value* const *Params, unsigned NumParams); void init(Value *Func, Value *Actual1, Value *Actual2); void init(Value *Func, Value *Actual); void init(Value *Func); From sabre at nondot.org Mon Feb 12 18:59:02 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 18:59:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200702130059.l1D0x24D001776@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.71 -> 1.72 --- Log message: remove some dead methods. --- Diffs of the changes: (+8 -25) Instructions.cpp | 33 ++++++++------------------------- 1 files changed, 8 insertions(+), 25 deletions(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.71 llvm/lib/VMCore/Instructions.cpp:1.72 --- llvm/lib/VMCore/Instructions.cpp:1.71 Thu Feb 1 20:16:22 2007 +++ llvm/lib/VMCore/Instructions.cpp Mon Feb 12 18:58:44 2007 @@ -196,19 +196,19 @@ delete [] OperandList; } -void CallInst::init(Value *Func, const std::vector &Params) { - NumOperands = Params.size()+1; - Use *OL = OperandList = new Use[Params.size()+1]; +void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) { + NumOperands = NumParams+1; + Use *OL = OperandList = new Use[NumParams+1]; OL[0].init(Func, this); const FunctionType *FTy = cast(cast(Func->getType())->getElementType()); FTy = FTy; // silence warning. - assert((Params.size() == FTy->getNumParams() || - (FTy->isVarArg() && Params.size() > FTy->getNumParams())) && + assert((NumParams == FTy->getNumParams() || + (FTy->isVarArg() && NumParams > FTy->getNumParams())) && "Calling a function with bad signature!"); - for (unsigned i = 0, e = Params.size(); i != e; ++i) { + for (unsigned i = 0; i != NumParams; ++i) { assert((i >= FTy->getNumParams() || FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad signature!"); @@ -273,7 +273,7 @@ : Instruction(cast(cast(Func->getType()) ->getElementType())->getReturnType(), Instruction::Call, 0, 0, Name, InsertBefore) { - init(Func, Params); + init(Func, &Params[0], Params.size()); } CallInst::CallInst(Value *Func, const std::vector &Params, @@ -281,7 +281,7 @@ : Instruction(cast(cast(Func->getType()) ->getElementType())->getReturnType(), Instruction::Call, 0, 0, Name, InsertAtEnd) { - init(Func, Params); + init(Func, &Params[0], Params.size()); } CallInst::CallInst(Value *Func, Value *Actual1, Value *Actual2, @@ -713,23 +713,6 @@ OL[1].init(Idx, this); } -GetElementPtrInst::GetElementPtrInst(Value *Ptr, const std::vector &Idx, - const std::string &Name, Instruction *InBe) - : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), - &Idx[0], Idx.size(), - true))), - GetElementPtr, 0, 0, Name, InBe) { - init(Ptr, &Idx[0], Idx.size()); -} - -GetElementPtrInst::GetElementPtrInst(Value *Ptr, const std::vector &Idx, - const std::string &Name, BasicBlock *IAE) - : Instruction(PointerType::get(checkType(getIndexedType(Ptr->getType(), - &Idx[0], Idx.size(), - true))), - GetElementPtr, 0, 0, Name, IAE) { - init(Ptr, &Idx[0], Idx.size()); -} GetElementPtrInst::GetElementPtrInst(Value *Ptr, Value* const *Idx, unsigned NumIdx, From sabre at nondot.org Mon Feb 12 19:04:22 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 19:04:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200702130104.l1D14MOF001934@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.72 -> 1.73 --- Log message: Add invokeinst and callinst ctors that don't take vectors. --- Diffs of the changes: (+47 -11) Instructions.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 47 insertions(+), 11 deletions(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.72 llvm/lib/VMCore/Instructions.cpp:1.73 --- llvm/lib/VMCore/Instructions.cpp:1.72 Mon Feb 12 18:58:44 2007 +++ llvm/lib/VMCore/Instructions.cpp Mon Feb 12 19:04:01 2007 @@ -276,14 +276,30 @@ init(Func, &Params[0], Params.size()); } -CallInst::CallInst(Value *Func, const std::vector &Params, +CallInst::CallInst(Value *Func, Value* const *Args, unsigned NumArgs, const std::string &Name, BasicBlock *InsertAtEnd) : Instruction(cast(cast(Func->getType()) ->getElementType())->getReturnType(), Instruction::Call, 0, 0, Name, InsertAtEnd) { + init(Func, Args, NumArgs); +} +CallInst::CallInst(Value *Func, Value* const *Args, unsigned NumArgs, + const std::string &Name, Instruction *InsertBefore) +: Instruction(cast(cast(Func->getType()) + ->getElementType())->getReturnType(), + Instruction::Call, 0, 0, Name, InsertBefore) { + init(Func, Args, NumArgs); +} + +CallInst::CallInst(Value *Func, const std::vector &Params, + const std::string &Name, BasicBlock *InsertAtEnd) +: Instruction(cast(cast(Func->getType()) + ->getElementType())->getReturnType(), + Instruction::Call, 0, 0, Name, InsertAtEnd) { init(Func, &Params[0], Params.size()); } + CallInst::CallInst(Value *Func, Value *Actual1, Value *Actual2, const std::string &Name, Instruction *InsertBefore) : Instruction(cast(cast(Func->getType()) @@ -352,9 +368,9 @@ } void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, - const std::vector &Params) { - NumOperands = 3+Params.size(); - Use *OL = OperandList = new Use[3+Params.size()]; + Value* const *Args, unsigned NumArgs) { + NumOperands = 3+NumArgs; + Use *OL = OperandList = new Use[3+NumArgs]; OL[0].init(Fn, this); OL[1].init(IfNormal, this); OL[2].init(IfException, this); @@ -362,27 +378,47 @@ cast(cast(Fn->getType())->getElementType()); FTy = FTy; // silence warning. - assert((Params.size() == FTy->getNumParams()) || - (FTy->isVarArg() && Params.size() > FTy->getNumParams()) && + assert((NumArgs == FTy->getNumParams()) || + (FTy->isVarArg() && NumArgs > FTy->getNumParams()) && "Calling a function with bad signature"); - for (unsigned i = 0, e = Params.size(); i != e; i++) { + for (unsigned i = 0, e = NumArgs; i != e; i++) { assert((i >= FTy->getNumParams() || - FTy->getParamType(i) == Params[i]->getType()) && + FTy->getParamType(i) == Args[i]->getType()) && "Invoking a function with a bad signature!"); - OL[i+3].init(Params[i], this); + OL[i+3].init(Args[i], this); } } InvokeInst::InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, + Value* const *Args, unsigned NumArgs, + const std::string &Name, Instruction *InsertBefore) + : TerminatorInst(cast(cast(Fn->getType()) + ->getElementType())->getReturnType(), + Instruction::Invoke, 0, 0, Name, InsertBefore) { + init(Fn, IfNormal, IfException, Args, NumArgs); +} + +InvokeInst::InvokeInst(Value *Fn, BasicBlock *IfNormal, + BasicBlock *IfException, + Value* const *Args, unsigned NumArgs, + const std::string &Name, BasicBlock *InsertAtEnd) + : TerminatorInst(cast(cast(Fn->getType()) + ->getElementType())->getReturnType(), + Instruction::Invoke, 0, 0, Name, InsertAtEnd) { + init(Fn, IfNormal, IfException, Args, NumArgs); +} + +InvokeInst::InvokeInst(Value *Fn, BasicBlock *IfNormal, + BasicBlock *IfException, const std::vector &Params, const std::string &Name, Instruction *InsertBefore) : TerminatorInst(cast(cast(Fn->getType()) ->getElementType())->getReturnType(), Instruction::Invoke, 0, 0, Name, InsertBefore) { - init(Fn, IfNormal, IfException, Params); + init(Fn, IfNormal, IfException, &Params[0], Params.size()); } InvokeInst::InvokeInst(Value *Fn, BasicBlock *IfNormal, @@ -392,7 +428,7 @@ : TerminatorInst(cast(cast(Fn->getType()) ->getElementType())->getReturnType(), Instruction::Invoke, 0, 0, Name, InsertAtEnd) { - init(Fn, IfNormal, IfException, Params); + init(Fn, IfNormal, IfException, &Params[0], Params.size()); } InvokeInst::InvokeInst(const InvokeInst &II) From sabre at nondot.org Mon Feb 12 19:04:22 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 19:04:22 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200702130104.l1D14M31001939@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.55 -> 1.56 --- Log message: Add invokeinst and callinst ctors that don't take vectors. --- Diffs of the changes: (+12 -1) Instructions.h | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.55 llvm/include/llvm/Instructions.h:1.56 --- llvm/include/llvm/Instructions.h:1.55 Mon Feb 12 18:58:44 2007 +++ llvm/include/llvm/Instructions.h Mon Feb 12 19:04:01 2007 @@ -695,6 +695,11 @@ void init(Value *Func); public: + CallInst(Value *F, Value* const *Args, unsigned NumArgs, + const std::string &Name = "", Instruction *InsertBefore = 0); + CallInst(Value *F, Value *const *Args, unsigned NumArgs, + const std::string &Name, BasicBlock *InsertAtEnd); + CallInst(Value *F, const std::vector &Par, const std::string &Name = "", Instruction *InsertBefore = 0); CallInst(Value *F, const std::vector &Par, @@ -1479,7 +1484,7 @@ class InvokeInst : public TerminatorInst { InvokeInst(const InvokeInst &BI); void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, - const std::vector &Params); + Value* const *Args, unsigned NumArgs); public: InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, const std::vector &Params, const std::string &Name = "", @@ -1487,6 +1492,12 @@ InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, const std::vector &Params, const std::string &Name, BasicBlock *InsertAtEnd); + InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, + Value* const* Args, unsigned NumArgs, const std::string &Name = "", + Instruction *InsertBefore = 0); + InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, + Value* const* Args, unsigned NumArgs, const std::string &Name, + BasicBlock *InsertAtEnd); ~InvokeInst(); virtual InvokeInst *clone() const; From sabre at nondot.org Mon Feb 12 19:05:26 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 19:05:26 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/switch-lower.ll Message-ID: <200702130105.l1D15QM4002051@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: switch-lower.ll added (r1.1) --- Log message: new testcase for PR1197: http://llvm.org/PR1197 --- Diffs of the changes: (+335 -0) switch-lower.ll | 335 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 335 insertions(+) Index: llvm/test/CodeGen/Generic/switch-lower.ll diff -c /dev/null llvm/test/CodeGen/Generic/switch-lower.ll:1.1 *** /dev/null Mon Feb 12 19:05:20 2007 --- llvm/test/CodeGen/Generic/switch-lower.ll Mon Feb 12 19:05:10 2007 *************** *** 0 **** --- 1,335 ---- + ; RUN: llvm-as < %s | llc + ; PR1197 + + implementation ; Functions: + + define void @exp_attr__expand_n_attribute_reference() { + entry: + br i1 false, label %cond_next954, label %cond_true924 + + cond_true924: ; preds = %entry + ret void + + cond_next954: ; preds = %entry + switch i8 0, label %cleanup7419 [ + i8 1, label %bb956 + i8 2, label %bb1069 + i8 4, label %bb7328 + i8 5, label %bb1267 + i8 8, label %bb1348 + i8 9, label %bb7328 + i8 11, label %bb1439 + i8 12, label %bb1484 + i8 13, label %bb1706 + i8 14, label %bb1783 + i8 17, label %bb1925 + i8 18, label %bb1929 + i8 19, label %bb2240 + i8 25, label %bb2447 + i8 27, label %bb2480 + i8 29, label %bb2590 + i8 30, label %bb2594 + i8 31, label %bb2621 + i8 32, label %bb2664 + i8 33, label %bb2697 + i8 34, label %bb2735 + i8 37, label %bb2786 + i8 38, label %bb2849 + i8 39, label %bb3269 + i8 41, label %bb3303 + i8 42, label %bb3346 + i8 43, label %bb3391 + i8 44, label %bb3395 + i8 50, label %bb3673 + i8 52, label %bb3677 + i8 53, label %bb3693 + i8 54, label %bb7328 + i8 56, label %bb3758 + i8 57, label %bb3787 + i8 64, label %bb5019 + i8 68, label %cond_true4235 + i8 69, label %bb4325 + i8 70, label %bb4526 + i8 72, label %bb4618 + i8 73, label %bb4991 + i8 80, label %bb5012 + i8 82, label %bb5019 + i8 84, label %bb5518 + i8 86, label %bb5752 + i8 87, label %bb5953 + i8 89, label %bb6040 + i8 90, label %bb6132 + i8 92, label %bb6186 + i8 93, label %bb6151 + i8 94, label %bb6155 + i8 97, label %bb6355 + i8 98, label %bb5019 + i8 99, label %bb6401 + i8 101, label %bb5019 + i8 102, label %bb1484 + i8 104, label %bb7064 + i8 105, label %bb7068 + i8 106, label %bb7072 + i8 108, label %bb1065 + i8 109, label %bb1702 + i8 110, label %bb2200 + i8 111, label %bb2731 + i8 112, label %bb2782 + i8 113, label %bb2845 + i8 114, label %bb2875 + i8 115, label %bb3669 + i8 116, label %bb7316 + i8 117, label %bb7316 + i8 118, label %bb3875 + i8 119, label %bb4359 + i8 120, label %bb4987 + i8 121, label %bb5008 + i8 122, label %bb5786 + i8 123, label %bb6147 + i8 124, label %bb6916 + i8 125, label %bb6920 + i8 126, label %bb6955 + i8 127, label %bb6990 + i8 -128, label %bb7027 + i8 -127, label %bb3879 + i8 -126, label %bb4700 + i8 -125, label %bb7076 + i8 -124, label %bb2366 + i8 -123, label %bb2366 + i8 -122, label %bb5490 + ] + + bb956: ; preds = %cond_next954 + ret void + + bb1065: ; preds = %cond_next954 + ret void + + bb1069: ; preds = %cond_next954 + ret void + + bb1267: ; preds = %cond_next954 + ret void + + bb1348: ; preds = %cond_next954 + ret void + + bb1439: ; preds = %cond_next954 + ret void + + bb1484: ; preds = %cond_next954, %cond_next954 + ret void + + bb1702: ; preds = %cond_next954 + ret void + + bb1706: ; preds = %cond_next954 + ret void + + bb1783: ; preds = %cond_next954 + ret void + + bb1925: ; preds = %cond_next954 + ret void + + bb1929: ; preds = %cond_next954 + ret void + + bb2200: ; preds = %cond_next954 + ret void + + bb2240: ; preds = %cond_next954 + ret void + + bb2366: ; preds = %cond_next954, %cond_next954 + ret void + + bb2447: ; preds = %cond_next954 + ret void + + bb2480: ; preds = %cond_next954 + ret void + + bb2590: ; preds = %cond_next954 + ret void + + bb2594: ; preds = %cond_next954 + ret void + + bb2621: ; preds = %cond_next954 + ret void + + bb2664: ; preds = %cond_next954 + ret void + + bb2697: ; preds = %cond_next954 + ret void + + bb2731: ; preds = %cond_next954 + ret void + + bb2735: ; preds = %cond_next954 + ret void + + bb2782: ; preds = %cond_next954 + ret void + + bb2786: ; preds = %cond_next954 + ret void + + bb2845: ; preds = %cond_next954 + ret void + + bb2849: ; preds = %cond_next954 + ret void + + bb2875: ; preds = %cond_next954 + ret void + + bb3269: ; preds = %cond_next954 + ret void + + bb3303: ; preds = %cond_next954 + ret void + + bb3346: ; preds = %cond_next954 + ret void + + bb3391: ; preds = %cond_next954 + ret void + + bb3395: ; preds = %cond_next954 + ret void + + bb3669: ; preds = %cond_next954 + ret void + + bb3673: ; preds = %cond_next954 + ret void + + bb3677: ; preds = %cond_next954 + ret void + + bb3693: ; preds = %cond_next954 + ret void + + bb3758: ; preds = %cond_next954 + ret void + + bb3787: ; preds = %cond_next954 + ret void + + bb3875: ; preds = %cond_next954 + ret void + + bb3879: ; preds = %cond_next954 + ret void + + cond_true4235: ; preds = %cond_next954 + ret void + + bb4325: ; preds = %cond_next954 + ret void + + bb4359: ; preds = %cond_next954 + ret void + + bb4526: ; preds = %cond_next954 + ret void + + bb4618: ; preds = %cond_next954 + ret void + + bb4700: ; preds = %cond_next954 + ret void + + bb4987: ; preds = %cond_next954 + ret void + + bb4991: ; preds = %cond_next954 + ret void + + bb5008: ; preds = %cond_next954 + ret void + + bb5012: ; preds = %cond_next954 + ret void + + bb5019: ; preds = %cond_next954, %cond_next954, %cond_next954, %cond_next954 + ret void + + bb5490: ; preds = %cond_next954 + ret void + + bb5518: ; preds = %cond_next954 + ret void + + bb5752: ; preds = %cond_next954 + ret void + + bb5786: ; preds = %cond_next954 + ret void + + bb5953: ; preds = %cond_next954 + ret void + + bb6040: ; preds = %cond_next954 + ret void + + bb6132: ; preds = %cond_next954 + ret void + + bb6147: ; preds = %cond_next954 + ret void + + bb6151: ; preds = %cond_next954 + ret void + + bb6155: ; preds = %cond_next954 + ret void + + bb6186: ; preds = %cond_next954 + ret void + + bb6355: ; preds = %cond_next954 + ret void + + bb6401: ; preds = %cond_next954 + ret void + + bb6916: ; preds = %cond_next954 + ret void + + bb6920: ; preds = %cond_next954 + ret void + + bb6955: ; preds = %cond_next954 + ret void + + bb6990: ; preds = %cond_next954 + ret void + + bb7027: ; preds = %cond_next954 + ret void + + bb7064: ; preds = %cond_next954 + ret void + + bb7068: ; preds = %cond_next954 + ret void + + bb7072: ; preds = %cond_next954 + ret void + + bb7076: ; preds = %cond_next954 + ret void + + bb7316: ; preds = %cond_next954, %cond_next954 + ret void + + bb7328: ; preds = %cond_next954, %cond_next954, %cond_next954 + ret void + + cleanup7419: ; preds = %cond_next954 + ret void + } From sabre at nondot.org Mon Feb 12 19:06:13 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 19:06:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702130106.l1D16DHG002077@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.360 -> 1.361 --- Log message: Fix switch lowering to order cases in zext order, which is how we emit the comparisons. This fixes an infinite loop on CodeGen/Generic/switch-lower.ll and PR1197: http://llvm.org/PR1197 --- Diffs of the changes: (+2 -2) SelectionDAGISel.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.360 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.361 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.360 Sat Feb 10 13:55:17 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Feb 12 19:05:56 2007 @@ -389,8 +389,8 @@ struct CaseCmp { bool operator () (const Case& C1, const Case& C2) { assert(isa(C1.first) && isa(C2.first)); - return cast(C1.first)->getSExtValue() < - cast(C2.first)->getSExtValue(); + return cast(C1.first)->getZExtValue() < + cast(C2.first)->getZExtValue(); } }; From evan.cheng at apple.com Mon Feb 12 19:31:12 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 12 Feb 2007 19:31:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp LiveVariables.cpp Message-ID: <200702130131.l1D1VCQT002905@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.204 -> 1.205 LiveVariables.cpp updated: 1.64 -> 1.65 --- Log message: Allow any MachineBasicBlock (not just the entry block) to have live-in physical registers. Make sure liveinterval analysis is correctly creating live ranges for them. --- Diffs of the changes: (+41 -47) LiveIntervalAnalysis.cpp | 72 +++++++++++++++++++++-------------------------- LiveVariables.cpp | 16 +++++----- 2 files changed, 41 insertions(+), 47 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.204 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.205 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.204 Tue Dec 19 16:41:21 2006 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Mon Feb 12 19:30:55 2007 @@ -88,28 +88,6 @@ allocatableRegs_ = mri_->getAllocatableSet(fn); r2rMap_.grow(mf_->getSSARegMap()->getLastVirtReg()); - // If this function has any live ins, insert a dummy instruction at the - // beginning of the function that we will pretend "defines" the values. This - // is to make the interval analysis simpler by providing a number. - if (fn.livein_begin() != fn.livein_end()) { - unsigned FirstLiveIn = fn.livein_begin()->first; - - // Find a reg class that contains this live in. - const TargetRegisterClass *RC = 0; - for (MRegisterInfo::regclass_iterator RCI = mri_->regclass_begin(), - E = mri_->regclass_end(); RCI != E; ++RCI) - if ((*RCI)->contains(FirstLiveIn)) { - RC = *RCI; - break; - } - - MachineInstr *OldFirstMI = fn.begin()->begin(); - mri_->copyRegToReg(*fn.begin(), fn.begin()->begin(), - FirstLiveIn, FirstLiveIn, RC); - assert(OldFirstMI != fn.begin()->begin() && - "copyRetToReg didn't insert anything!"); - } - // Number MachineInstrs and MachineBasicBlocks. // Initialize MBB indexes to a sentinal. MBB2IdxMap.resize(mf_->getNumBlockIDs(), ~0U); @@ -119,6 +97,28 @@ MBB != E; ++MBB) { // Set the MBB2IdxMap entry for this MBB. MBB2IdxMap[MBB->getNumber()] = MIIndex; + + // If this BB has any live ins, insert a dummy instruction at the + // beginning of the function that we will pretend "defines" the values. This + // is to make the interval analysis simpler by providing a number. + if (MBB->livein_begin() != MBB->livein_end()) { + unsigned FirstLiveIn = *MBB->livein_begin(); + + // Find a reg class that contains this live in. + const TargetRegisterClass *RC = 0; + for (MRegisterInfo::regclass_iterator RCI = mri_->regclass_begin(), + RCE = mri_->regclass_end(); RCI != RCE; ++RCI) + if ((*RCI)->contains(FirstLiveIn)) { + RC = *RCI; + break; + } + + MachineInstr *OldFirstMI = MBB->begin(); + mri_->copyRegToReg(*MBB, MBB->begin(), + FirstLiveIn, FirstLiveIn, RC); + assert(OldFirstMI != MBB->begin() && + "copyRetToReg didn't insert anything!"); + } for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { @@ -129,19 +129,6 @@ } } - // Note intervals due to live-in values. - if (fn.livein_begin() != fn.livein_end()) { - MachineBasicBlock *Entry = fn.begin(); - for (MachineFunction::livein_iterator I = fn.livein_begin(), - E = fn.livein_end(); I != E; ++I) { - handlePhysicalRegisterDef(Entry, Entry->begin(), 0, - getOrCreateInterval(I->first), 0); - for (const unsigned* AS = mri_->getAliasSet(I->first); *AS; ++AS) - handlePhysicalRegisterDef(Entry, Entry->begin(), 0, - getOrCreateInterval(*AS), 0); - } - } - computeIntervals(); numIntervals += getNumIntervals(); @@ -691,8 +678,6 @@ DOUT << "********** COMPUTING LIVE INTERVALS **********\n" << "********** Function: " << ((Value*)mf_->getFunction())->getName() << '\n'; - bool IgnoreFirstInstr = mf_->livein_begin() != mf_->livein_end(); - // Track the index of the current machine instr. unsigned MIIndex = 0; for (MachineFunction::iterator MBBI = mf_->begin(), E = mf_->end(); @@ -701,9 +686,18 @@ DOUT << ((Value*)MBB->getBasicBlock())->getName() << ":\n"; MachineBasicBlock::iterator MI = MBB->begin(), miEnd = MBB->end(); - if (IgnoreFirstInstr) { + + if (MBB->livein_begin() != MBB->livein_end()) { + // Process live-ins to this BB first. + for (MachineBasicBlock::livein_iterator LI = MBB->livein_begin(), + LE = MBB->livein_end(); LI != LE; ++LI) { + handlePhysicalRegisterDef(MBB, MBB->begin(), MIIndex, + getOrCreateInterval(*LI), 0); + for (const unsigned* AS = mri_->getAliasSet(*LI); *AS; ++AS) + handlePhysicalRegisterDef(MBB, MBB->begin(), MIIndex, + getOrCreateInterval(*AS), 0); + } ++MI; - IgnoreFirstInstr = false; MIIndex += InstrSlots::NUM; } Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.64 llvm/lib/CodeGen/LiveVariables.cpp:1.65 --- llvm/lib/CodeGen/LiveVariables.cpp:1.64 Thu Dec 7 14:28:15 2006 +++ llvm/lib/CodeGen/LiveVariables.cpp Mon Feb 12 19:30:55 2007 @@ -254,14 +254,6 @@ /// Get some space for a respectable number of registers... VirtRegInfo.resize(64); - // Mark live-in registers as live-in. - for (MachineFunction::livein_iterator I = MF.livein_begin(), - E = MF.livein_end(); I != E; ++I) { - assert(MRegisterInfo::isPhysicalRegister(I->first) && - "Cannot have a live-in virtual register!"); - HandlePhysRegDef(I->first, 0); - } - analyzePHINodes(MF); // Calculate live variable information in depth first order on the CFG of the @@ -275,6 +267,14 @@ E = df_ext_end(Entry, Visited); DFI != E; ++DFI) { MachineBasicBlock *MBB = *DFI; + // Mark live-in registers as live-in. + for (MachineBasicBlock::livein_iterator II = MBB->livein_begin(), + EE = MBB->livein_end(); II != EE; ++II) { + assert(MRegisterInfo::isPhysicalRegister(*II) && + "Cannot have a live-in virtual register!"); + HandlePhysRegDef(*II, 0); + } + // Loop over all of the instructions, processing them. for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E; ++I) { From sabre at nondot.org Mon Feb 12 19:54:11 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 19:54:11 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200702130154.l1D1sBZV003596@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.236 -> 1.237 --- Log message: stop passing vector into ctors --- Diffs of the changes: (+2 -2) Reader.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.236 llvm/lib/Bytecode/Reader/Reader.cpp:1.237 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.236 Mon Feb 12 12:53:43 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Feb 12 19:53:54 2007 @@ -702,7 +702,7 @@ Params.push_back(getValue(Oprnds[i], Oprnds[i+1])); } - Result = new CallInst(F, Params); + Result = new CallInst(F, &Params[0], Params.size()); if (isTailCall) cast(Result)->setTailCall(); if (CallingConv) cast(Result)->setCallingConv(CallingConv); break; @@ -756,7 +756,7 @@ Params.push_back(getValue(Oprnds[i], Oprnds[i+1])); } - Result = new InvokeInst(F, Normal, Except, Params); + Result = new InvokeInst(F, Normal, Except, &Params[0], Params.size()); if (CallingConv) cast(Result)->setCallingConv(CallingConv); break; } From sabre at nondot.org Mon Feb 12 20:11:16 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 20:11:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp Message-ID: <200702130211.l1D2BGnR003969@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation: ProfilingUtils.cpp updated: 1.14 -> 1.15 --- Log message: Eliminate use of ctors that take vectors. --- Diffs of the changes: (+2 -1) ProfilingUtils.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.14 llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.15 --- llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp:1.14 Sun Jan 7 01:22:20 2007 +++ llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp Mon Feb 12 20:10:56 2007 @@ -53,7 +53,8 @@ } Args[3] = ConstantInt::get(Type::Int32Ty, NumElements); - Instruction *InitCall = new CallInst(InitFn, Args, "newargc", InsertPos); + Instruction *InitCall = new CallInst(InitFn, &Args[0], Args.size(), + "newargc", InsertPos); // If argc or argv are not available in main, just pass null values in. Function::arg_iterator AI; From sabre at nondot.org Mon Feb 12 20:11:17 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 20:11:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp DeadArgumentElimination.cpp LowerSetJmp.cpp PruneEH.cpp Message-ID: <200702130211.l1D2BHTV003980@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: ArgumentPromotion.cpp updated: 1.37 -> 1.38 DeadArgumentElimination.cpp updated: 1.39 -> 1.40 LowerSetJmp.cpp updated: 1.39 -> 1.40 PruneEH.cpp updated: 1.30 -> 1.31 --- Log message: Eliminate use of ctors that take vectors. --- Diffs of the changes: (+27 -32) ArgumentPromotion.cpp | 11 ++++++----- DeadArgumentElimination.cpp | 8 ++++---- LowerSetJmp.cpp | 34 ++++++++++++++-------------------- PruneEH.cpp | 6 +++--- 4 files changed, 27 insertions(+), 32 deletions(-) Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.37 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.38 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.37 Mon Feb 12 16:56:41 2007 +++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp Mon Feb 12 20:10:56 2007 @@ -161,7 +161,8 @@ static bool AllCalleesPassInValidPointerForArgument(Argument *Arg) { Function *Callee = Arg->getParent(); - unsigned ArgNo = std::distance(Callee->arg_begin(), Function::arg_iterator(Arg)); + unsigned ArgNo = std::distance(Callee->arg_begin(), + Function::arg_iterator(Arg)); // Look at all call sites of the function. At this pointer we know we only // have direct callees. @@ -442,10 +443,10 @@ Instruction *New; if (InvokeInst *II = dyn_cast(Call)) { New = new InvokeInst(NF, II->getNormalDest(), II->getUnwindDest(), - Args, "", Call); + &Args[0], Args.size(), "", Call); cast(New)->setCallingConv(CS.getCallingConv()); } else { - New = new CallInst(NF, Args, "", Call); + New = new CallInst(NF, &Args[0], Args.size(), "", Call); cast(New)->setCallingConv(CS.getCallingConv()); if (cast(Call)->isTailCall()) cast(New)->setTailCall(); @@ -474,8 +475,8 @@ // Loop over the argument list, transfering uses of the old arguments over to // the new arguments, also transfering over the names as well. // - for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(), I2 = NF->arg_begin(); - I != E; ++I) + for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(), + I2 = NF->arg_begin(); I != E; ++I) if (!ArgsToPromote.count(I)) { // If this is an unmodified argument, move the name and users over to the // new version. Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.39 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.40 --- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.39 Sat Feb 10 19:08:35 2007 +++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp Mon Feb 12 20:10:56 2007 @@ -169,10 +169,10 @@ Instruction *New; if (InvokeInst *II = dyn_cast(Call)) { New = new InvokeInst(NF, II->getNormalDest(), II->getUnwindDest(), - Args, "", Call); + &Args[0], Args.size(), "", Call); cast(New)->setCallingConv(CS.getCallingConv()); } else { - New = new CallInst(NF, Args, "", Call); + New = new CallInst(NF, &Args[0], Args.size(), "", Call); cast(New)->setCallingConv(CS.getCallingConv()); if (cast(Call)->isTailCall()) cast(New)->setTailCall(); @@ -535,10 +535,10 @@ Instruction *New; if (InvokeInst *II = dyn_cast(Call)) { New = new InvokeInst(NF, II->getNormalDest(), II->getUnwindDest(), - Args, "", Call); + &Args[0], Args.size(), "", Call); cast(New)->setCallingConv(CS.getCallingConv()); } else { - New = new CallInst(NF, Args, "", Call); + New = new CallInst(NF, &Args[0], Args.size(), "", Call); cast(New)->setCallingConv(CS.getCallingConv()); if (cast(Call)->isTailCall()) cast(New)->setTailCall(); Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.39 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.40 --- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.39 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp Mon Feb 12 20:10:56 2007 @@ -259,8 +259,7 @@ // Inst's uses and doesn't get a name. CastInst* CI = new BitCastInst(Inst->getOperand(1), SBPTy, "LJBuf", Inst); - new CallInst(ThrowLongJmp, make_vector(CI, Inst->getOperand(2), 0), - "", Inst); + new CallInst(ThrowLongJmp, CI, Inst->getOperand(2), "", Inst); SwitchValuePair& SVP = SwitchValMap[Inst->getParent()->getParent()]; @@ -303,7 +302,7 @@ // Fill in the alloca and call to initialize the SJ map. const Type *SBPTy = PointerType::get(Type::Int8Ty); AllocaInst* Map = new AllocaInst(SBPTy, 0, "SJMap", Inst); - new CallInst(InitSJMap, make_vector(Map, 0), "", Inst); + new CallInst(InitSJMap, Map, "", Inst); return SJMap[Func] = Map; } @@ -340,8 +339,7 @@ PrelimBBMap[Func] = LongJmpPre; // Grab the exception. - CallInst* Cond = new - CallInst(IsLJException, std::vector(), "IsLJExcept"); + CallInst* Cond = new CallInst(IsLJException, "IsLJExcept"); LongJmpPreIL.push_back(Cond); // The "decision basic block" gets the number associated with the @@ -353,10 +351,9 @@ new BranchInst(DecisionBB, Rethrow, Cond, LongJmpPre); // Fill in the "decision" basic block. - CallInst* LJVal = new CallInst(GetLJValue, std::vector(), "LJVal"); + CallInst* LJVal = new CallInst(GetLJValue, "LJVal"); DecisionBBIL.push_back(LJVal); - CallInst* SJNum = new - CallInst(TryCatchLJ, make_vector(GetSetJmpMap(Func), 0), "SJNum"); + CallInst* SJNum = new CallInst(TryCatchLJ, GetSetJmpMap(Func), "SJNum"); DecisionBBIL.push_back(SJNum); SwitchInst* SI = new SwitchInst(SJNum, Rethrow, 0, DecisionBB); @@ -376,11 +373,11 @@ const Type* SBPTy = PointerType::get(Type::Int8Ty); CastInst* BufPtr = new BitCastInst(Inst->getOperand(1), SBPTy, "SBJmpBuf", Inst); - new CallInst(AddSJToMap, - make_vector(GetSetJmpMap(Func), BufPtr, - ConstantInt::get(Type::Int32Ty, - SetJmpIDMap[Func]++), 0), - "", Inst); + std::vector Args = + make_vector(GetSetJmpMap(Func), BufPtr, + ConstantInt::get(Type::Int32Ty, + SetJmpIDMap[Func]++), 0); + new CallInst(AddSJToMap, &Args[0], Args.size(), "", Inst); // We are guaranteed that there are no values live across basic blocks // (because we are "not in SSA form" yet), but there can still be values live @@ -470,7 +467,7 @@ std::vector Params(CI.op_begin() + 1, CI.op_end()); InvokeInst* II = new InvokeInst(CI.getCalledValue(), NewBB, PrelimBBMap[Func], - Params, CI.getName(), Term); + &Params[0], Params.size(), CI.getName(), Term); // Replace the old call inst with the invoke inst and remove the call. CI.replaceAllUsesWith(II); @@ -504,8 +501,7 @@ // If this is a longjmp exception, then branch to the preliminary BB of // the longjmp exception handling. Otherwise, go to the old exception. - CallInst* IsLJExcept = new - CallInst(IsLJException, std::vector(), "IsLJExcept"); + CallInst* IsLJExcept = new CallInst(IsLJException, "IsLJExcept"); InstList.push_back(IsLJExcept); new BranchInst(PrelimBBMap[Func], ExceptBB, IsLJExcept, NewExceptBB); @@ -518,16 +514,14 @@ // function. void LowerSetJmp::visitReturnInst(ReturnInst &RI) { Function* Func = RI.getParent()->getParent(); - new CallInst(DestroySJMap, make_vector(GetSetJmpMap(Func), 0), - "", &RI); + new CallInst(DestroySJMap, GetSetJmpMap(Func), "", &RI); } // visitUnwindInst - We want to destroy the setjmp map upon exit from the // function. void LowerSetJmp::visitUnwindInst(UnwindInst &UI) { Function* Func = UI.getParent()->getParent(); - new CallInst(DestroySJMap, make_vector(GetSetJmpMap(Func), 0), - "", &UI); + new CallInst(DestroySJMap, GetSetJmpMap(Func), "", &UI); } ModulePass *llvm::createLowerSetJmpPass() { Index: llvm/lib/Transforms/IPO/PruneEH.cpp diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.30 llvm/lib/Transforms/IPO/PruneEH.cpp:1.31 --- llvm/lib/Transforms/IPO/PruneEH.cpp:1.30 Sat Feb 10 19:08:35 2007 +++ llvm/lib/Transforms/IPO/PruneEH.cpp Mon Feb 12 20:10:56 2007 @@ -22,6 +22,7 @@ #include "llvm/Intrinsics.h" #include "llvm/Instructions.h" #include "llvm/Analysis/CallGraph.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/CFG.h" #include "llvm/Support/Compiler.h" @@ -144,11 +145,10 @@ if (InvokeInst *II = dyn_cast(BB->getTerminator())) if (Function *F = II->getCalledFunction()) if (DoesNotUnwind.count(CG[F])) { + SmallVector Args(II->op_begin()+3, II->op_end()); // Insert a call instruction before the invoke. CallInst *Call = new CallInst(II->getCalledValue(), - std::vector(II->op_begin()+3, - II->op_end()), - "", II); + &Args[0], Args.size(), "", II); Call->takeName(II); Call->setCallingConv(II->getCallingConv()); From sabre at nondot.org Mon Feb 12 20:11:20 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 20:11:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp InstructionCombining.cpp LowerGC.cpp Message-ID: <200702130211.l1D2BKWO003990@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: ADCE.cpp updated: 1.103 -> 1.104 InstructionCombining.cpp updated: 1.630 -> 1.631 LowerGC.cpp updated: 1.21 -> 1.22 --- Log message: Eliminate use of ctors that take vectors. --- Diffs of the changes: (+8 -7) ADCE.cpp | 5 +++-- InstructionCombining.cpp | 4 ++-- LowerGC.cpp | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/lib/Transforms/Scalar/ADCE.cpp diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.103 llvm/lib/Transforms/Scalar/ADCE.cpp:1.104 --- llvm/lib/Transforms/Scalar/ADCE.cpp:1.103 Sat Feb 10 19:23:03 2007 +++ llvm/lib/Transforms/Scalar/ADCE.cpp Mon Feb 12 20:10:56 2007 @@ -25,6 +25,7 @@ #include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h" #include "llvm/Support/Debug.h" #include "llvm/ADT/DepthFirstIterator.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Compiler.h" @@ -188,8 +189,8 @@ if (AA.onlyReadsMemory(F)) { // The function cannot unwind. Convert it to a call with a branch // after it to the normal destination. - std::vector Args(II->op_begin()+3, II->op_end()); - CallInst *NewCall = new CallInst(F, Args, "", II); + SmallVector Args(II->op_begin()+3, II->op_end()); + CallInst *NewCall = new CallInst(F, &Args[0], Args.size(), "", II); NewCall->takeName(II); NewCall->setCallingConv(II->getCallingConv()); II->replaceAllUsesWith(NewCall); Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.630 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.631 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.630 Mon Feb 12 16:56:41 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Feb 12 20:10:56 2007 @@ -7352,10 +7352,10 @@ Instruction *NC; if (InvokeInst *II = dyn_cast(Caller)) { NC = new InvokeInst(Callee, II->getNormalDest(), II->getUnwindDest(), - Args, Caller->getName(), Caller); + &Args[0], Args.size(), Caller->getName(), Caller); cast(II)->setCallingConv(II->getCallingConv()); } else { - NC = new CallInst(Callee, Args, Caller->getName(), Caller); + NC = new CallInst(Callee, &Args[0], Args.size(), Caller->getName(), Caller); if (cast(Caller)->isTailCall()) cast(NC)->setTailCall(); cast(NC)->setCallingConv(cast(Caller)->getCallingConv()); Index: llvm/lib/Transforms/Scalar/LowerGC.cpp diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.21 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.22 --- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.21 Mon Feb 5 15:19:13 2007 +++ llvm/lib/Transforms/Scalar/LowerGC.cpp Mon Feb 12 20:10:56 2007 @@ -314,10 +314,10 @@ NewBB->getInstList().remove(CI); // Create a new invoke instruction. + std::vector Args(CI->op_begin()+1, CI->op_end()); + Value *II = new InvokeInst(CI->getCalledValue(), NewBB, Cleanup, - std::vector(CI->op_begin()+1, - CI->op_end()), - CI->getName(), CBB); + &Args[0], Args.size(), CI->getName(), CBB); CI->replaceAllUsesWith(II); delete CI; } From sabre at nondot.org Mon Feb 12 20:11:21 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 20:11:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/CodeExtractor.cpp InlineFunction.cpp LowerInvoke.cpp SimplifyCFG.cpp Message-ID: <200702130211.l1D2BL43004001@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: CodeExtractor.cpp updated: 1.49 -> 1.50 InlineFunction.cpp updated: 1.52 -> 1.53 LowerInvoke.cpp updated: 1.53 -> 1.54 SimplifyCFG.cpp updated: 1.116 -> 1.117 --- Log message: Eliminate use of ctors that take vectors. --- Diffs of the changes: (+23 -19) CodeExtractor.cpp | 2 +- InlineFunction.cpp | 4 +++- LowerInvoke.cpp | 24 ++++++++++++------------ SimplifyCFG.cpp | 12 +++++++----- 4 files changed, 23 insertions(+), 19 deletions(-) Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp diff -u llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.49 llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.50 --- llvm/lib/Transforms/Utils/CodeExtractor.cpp:1.49 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Utils/CodeExtractor.cpp Mon Feb 12 20:10:56 2007 @@ -403,7 +403,7 @@ } // Emit the call to the function - CallInst *call = new CallInst(newFunction, params, + CallInst *call = new CallInst(newFunction, ¶ms[0], params.size(), NumExitBlocks > 1 ? "targetBlock" : ""); codeReplacer->getInstList().push_back(call); Index: llvm/lib/Transforms/Utils/InlineFunction.cpp diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.52 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.53 --- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.52 Fri Feb 2 18:08:31 2007 +++ llvm/lib/Transforms/Utils/InlineFunction.cpp Mon Feb 12 20:10:56 2007 @@ -19,6 +19,7 @@ #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" #include "llvm/Analysis/CallGraph.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/CallSite.h" using namespace llvm; @@ -80,9 +81,10 @@ // Next, create the new invoke instruction, inserting it at the end // of the old basic block. + SmallVector InvokeArgs(CI->op_begin()+1, CI->op_end()); InvokeInst *II = new InvokeInst(CI->getCalledValue(), Split, InvokeDest, - std::vector(CI->op_begin()+1, CI->op_end()), + &InvokeArgs[0], InvokeArgs.size(), CI->getName(), BB->getTerminator()); II->setCallingConv(CI->getCallingConv()); Index: llvm/lib/Transforms/Utils/LowerInvoke.cpp diff -u llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.53 llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.54 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp:1.53 Mon Feb 12 16:56:41 2007 +++ llvm/lib/Transforms/Utils/LowerInvoke.cpp Mon Feb 12 20:10:56 2007 @@ -189,21 +189,21 @@ createAbortMessage(IB->getParent()->getParent()->getParent()); // These are the arguments we WANT... - std::vector Args; - Args.push_back(ConstantInt::get(Type::Int32Ty, 2)); - Args.push_back(AbortMessage); - Args.push_back(ConstantInt::get(Type::Int32Ty, AbortMessageLength)); - (new CallInst(WriteFn, Args, "", IB))->setTailCall(); + Value* Args[3]; + Args[0] = ConstantInt::get(Type::Int32Ty, 2); + Args[1] = AbortMessage; + Args[2] = ConstantInt::get(Type::Int32Ty, AbortMessageLength); + (new CallInst(WriteFn, Args, 3, "", IB))->setTailCall(); } bool LowerInvoke::insertCheapEHSupport(Function &F) { bool Changed = false; for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) if (InvokeInst *II = dyn_cast(BB->getTerminator())) { + std::vector CallArgs(II->op_begin()+3, II->op_end()); // Insert a normal call instruction... CallInst *NewCall = new CallInst(II->getCalledValue(), - std::vector(II->op_begin()+3, - II->op_end()), "", II); + &CallArgs[0], CallArgs.size(), "", II); NewCall->takeName(II); NewCall->setCallingConv(II->getCallingConv()); II->replaceAllUsesWith(NewCall); @@ -223,7 +223,7 @@ writeAbortMessage(UI); // Insert a call to abort() - (new CallInst(AbortFn, std::vector(), "", UI))->setTailCall(); + (new CallInst(AbortFn, "", UI))->setTailCall(); // Insert a return instruction. This really should be a "barrier", as it // is unreachable. @@ -258,9 +258,9 @@ CatchSwitch->addCase(InvokeNoC, II->getUnwindDest()); // Insert a normal call instruction. + std::vector CallArgs(II->op_begin()+3, II->op_end()); CallInst *NewCall = new CallInst(II->getCalledValue(), - std::vector(II->op_begin()+3, - II->op_end()), "", + &CallArgs[0], CallArgs.size(), "", II); NewCall->takeName(II); NewCall->setCallingConv(II->getCallingConv()); @@ -533,7 +533,7 @@ Idx.push_back(ConstantInt::get(Type::Int32Ty, 0)); Idx[0] = new GetElementPtrInst(BufPtr, &Idx[0], 2, "JmpBuf", UnwindBlock); Idx[1] = ConstantInt::get(Type::Int32Ty, 1); - new CallInst(LongJmpFn, Idx, "", UnwindBlock); + new CallInst(LongJmpFn, &Idx[0], Idx.size(), "", UnwindBlock); new UnreachableInst(UnwindBlock); // Set up the term block ("throw without a catch"). @@ -543,7 +543,7 @@ writeAbortMessage(TermBlock->getTerminator()); // Insert a call to abort() - (new CallInst(AbortFn, std::vector(), "", + (new CallInst(AbortFn, "", TermBlock->getTerminator()))->setTailCall(); Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.116 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.117 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.116 Sat Feb 10 19:37:51 2007 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Mon Feb 12 20:10:56 2007 @@ -21,6 +21,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" +#include "llvm/ADT/SmallVector.h" #include #include #include @@ -1369,9 +1370,9 @@ Pred->getInstList().remove(II); // Take out of symbol table // Insert the call now... - std::vector Args(II->op_begin()+3, II->op_end()); - CallInst *CI = new CallInst(II->getCalledValue(), Args, - II->getName(), BI); + SmallVector Args(II->op_begin()+3, II->op_end()); + CallInst *CI = new CallInst(II->getCalledValue(), + &Args[0], Args.size(), II->getName(), BI); CI->setCallingConv(II->getCallingConv()); // If the invoke produced a value, the Call now does instead II->replaceAllUsesWith(CI); @@ -1741,8 +1742,9 @@ II->removeFromParent(); // Take out of symbol table // Insert the call now... - std::vector Args(II->op_begin()+3, II->op_end()); - CallInst *CI = new CallInst(II->getCalledValue(), Args, + SmallVector Args(II->op_begin()+3, II->op_end()); + CallInst *CI = new CallInst(II->getCalledValue(), + &Args[0], Args.size(), II->getName(), BI); CI->setCallingConv(II->getCallingConv()); // If the invoke produced a value, the Call does now instead. From rspencer at reidspencer.com Mon Feb 12 20:14:35 2007 From: rspencer at reidspencer.com (Reid Spencer) Date: Mon, 12 Feb 2007 18:14:35 -0800 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp In-Reply-To: <200702130154.l1D1sBZV003596@zion.cs.uiuc.edu> References: <200702130154.l1D1sBZV003596@zion.cs.uiuc.edu> Message-ID: <1171332875.3031.194.camel@bashful.x10sys.com> Chris, I have a question .. On Mon, 2007-02-12 at 19:54 -0600, Chris Lattner wrote: > > Changes in directory llvm/lib/Bytecode/Reader: > > Reader.cpp updated: 1.236 -> 1.237 > --- > Log message: > > stop passing vector into ctors > > > --- > Diffs of the changes: (+2 -2) > > Reader.cpp | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > > Index: llvm/lib/Bytecode/Reader/Reader.cpp > diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.236 llvm/lib/Bytecode/Reader/Reader.cpp:1.237 > --- llvm/lib/Bytecode/Reader/Reader.cpp:1.236 Mon Feb 12 12:53:43 2007 > +++ llvm/lib/Bytecode/Reader/Reader.cpp Mon Feb 12 19:53:54 2007 > @@ -702,7 +702,7 @@ > Params.push_back(getValue(Oprnds[i], Oprnds[i+1])); > } > > - Result = new CallInst(F, Params); > + Result = new CallInst(F, &Params[0], Params.size()); I don't see why this series of changes is better for performance. The Constructor is currently defined as: CallInst(Value *F, const std::vector &Par, const std::string &Name = "", Instruction *InsertBefore = 0); Because Par is a reference to a const std::vector there should be no copying of the vector when the argument is passed. It would just pass the pointer implied by the reference. Your change makes it pass two arguments, which can't be faster. Is there something I'm missing here? Reid. > if (isTailCall) cast(Result)->setTailCall(); > if (CallingConv) cast(Result)->setCallingConv(CallingConv); > break; > @@ -756,7 +756,7 @@ > Params.push_back(getValue(Oprnds[i], Oprnds[i+1])); > } > > - Result = new InvokeInst(F, Normal, Except, Params); > + Result = new InvokeInst(F, Normal, Except, &Params[0], Params.size()); > if (CallingConv) cast(Result)->setCallingConv(CallingConv); > break; > } > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Mon Feb 12 20:46:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Mon, 12 Feb 2007 20:46:13 -0600 Subject: [llvm-commits] CVS: llvm-stacker/lib/compiler/StackerCompiler.cpp Message-ID: <200702130246.l1D2kDxM004684@zion.cs.uiuc.edu> Changes in directory llvm-stacker/lib/compiler: StackerCompiler.cpp updated: 1.33 -> 1.34 --- Log message: Update for recent interface changes in GEP constructor. --- Diffs of the changes: (+12 -9) StackerCompiler.cpp | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) Index: llvm-stacker/lib/compiler/StackerCompiler.cpp diff -u llvm-stacker/lib/compiler/StackerCompiler.cpp:1.33 llvm-stacker/lib/compiler/StackerCompiler.cpp:1.34 --- llvm-stacker/lib/compiler/StackerCompiler.cpp:1.33 Mon Feb 5 15:20:45 2007 +++ llvm-stacker/lib/compiler/StackerCompiler.cpp Mon Feb 12 20:45:57 2007 @@ -427,7 +427,8 @@ } // Get the address of the indexed stack element - GetElementPtrInst* gep = new GetElementPtrInst( TheStack, indexVec ); + GetElementPtrInst* gep = new GetElementPtrInst(TheStack, &indexVec[0], + indexVec.size() ); bb->getInstList().push_back( gep ); // Put GEP in Block return gep; @@ -1518,7 +1519,8 @@ // Get address of op1'th element of the string std::vector indexVec; indexVec.push_back( chr_idx ); - GetElementPtrInst* gep = new GetElementPtrInst( ptr, indexVec ); + GetElementPtrInst* gep = new GetElementPtrInst( ptr, &indexVec[0], + indexVec.size() ); bb->getInstList().push_back( gep ); // Get the value and push it @@ -1550,7 +1552,8 @@ // Get address of op2'th element of the string std::vector indexVec; indexVec.push_back( chr_idx ); - GetElementPtrInst* gep = new GetElementPtrInst( ptr, indexVec ); + GetElementPtrInst* gep = new GetElementPtrInst( ptr, &indexVec[0], + indexVec.size()); bb->getInstList().push_back( gep ); // Cast the value and put it @@ -1600,7 +1603,7 @@ indexVec.push_back( Zero ); indexVec.push_back( Zero ); GetElementPtrInst* format_gep = - new GetElementPtrInst( ChrFormat, indexVec ); + new GetElementPtrInst( ChrFormat, &indexVec[0], indexVec.size() ); bb->getInstList().push_back( format_gep ); // Get the character to print (a tab) @@ -1622,7 +1625,7 @@ indexVec.push_back( Zero ); indexVec.push_back( Zero ); GetElementPtrInst* format_gep = - new GetElementPtrInst( ChrFormat, indexVec ); + new GetElementPtrInst( ChrFormat, &indexVec[0], indexVec.size() ); bb->getInstList().push_back( format_gep ); // Get the character to print (a space) @@ -1644,7 +1647,7 @@ indexVec.push_back( Zero ); indexVec.push_back( Zero ); GetElementPtrInst* format_gep = - new GetElementPtrInst( ChrFormat, indexVec ); + new GetElementPtrInst( ChrFormat, &indexVec[0], indexVec.size() ); bb->getInstList().push_back( format_gep ); // Get the character to print (a newline) @@ -1742,7 +1745,7 @@ indexVec.push_back( Zero ); indexVec.push_back( Zero ); GetElementPtrInst* format_gep = - new GetElementPtrInst( StrFormat, indexVec ); + new GetElementPtrInst( StrFormat, &indexVec[0], indexVec.size() ); bb->getInstList().push_back( format_gep ); // Build function call arguments std::vector args; @@ -1763,7 +1766,7 @@ indexVec.push_back( Zero ); indexVec.push_back( Zero ); GetElementPtrInst* format_gep = - new GetElementPtrInst( NumFormat, indexVec ); + new GetElementPtrInst( NumFormat, &indexVec[0], indexVec.size() ); bb->getInstList().push_back( format_gep ); // Build function call arguments @@ -1786,7 +1789,7 @@ indexVec.push_back( Zero ); indexVec.push_back( Zero ); GetElementPtrInst* format_gep = - new GetElementPtrInst( ChrFormat, indexVec ); + new GetElementPtrInst( ChrFormat, &indexVec[0], indexVec.size() ); bb->getInstList().push_back( format_gep ); // Build function call arguments From sabre at nondot.org Tue Feb 13 00:22:14 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 22:22:14 -0800 (PST) Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp In-Reply-To: <1171332875.3031.194.camel@bashful.x10sys.com> References: <200702130154.l1D1sBZV003596@zion.cs.uiuc.edu> <1171332875.3031.194.camel@bashful.x10sys.com> Message-ID: On Mon, 12 Feb 2007, Reid Spencer wrote: >> - Result = new CallInst(F, Params); >> + Result = new CallInst(F, &Params[0], Params.size()); > > I don't see why this series of changes is better for performance. It isn't. > Is there something I'm missing here? Nope, it's just an API cleanup. The perf improvements will happen when this change is complete. -Chris >> if (isTailCall) cast(Result)->setTailCall(); >> if (CallingConv) cast(Result)->setCallingConv(CallingConv); >> break; >> @@ -756,7 +756,7 @@ >> Params.push_back(getValue(Oprnds[i], Oprnds[i+1])); >> } >> >> - Result = new InvokeInst(F, Normal, Except, Params); >> + Result = new InvokeInst(F, Normal, Except, &Params[0], Params.size()); >> if (CallingConv) cast(Result)->setCallingConv(CallingConv); >> break; >> } >> >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -Chris -- http://nondot.org/sabre/ http://llvm.org/ From sabre at nondot.org Mon Feb 12 23:54:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 23:54:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200702130554.l1D5sCL8008673@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.67 -> 1.68 llvmAsmParser.h.cvs updated: 1.53 -> 1.54 llvmAsmParser.y updated: 1.322 -> 1.323 llvmAsmParser.y.cvs updated: 1.68 -> 1.69 --- Log message: eliminate use of vector ctors --- Diffs of the changes: (+3217 -4470) llvmAsmParser.cpp.cvs | 7228 +++++++++++++++++++++----------------------------- llvmAsmParser.h.cvs | 451 --- llvmAsmParser.y | 4 llvmAsmParser.y.cvs | 4 4 files changed, 3217 insertions(+), 4470 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.67 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.68 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.67 Mon Feb 12 18:58:01 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Mon Feb 12 23:53:56 2007 @@ -1,346 +1,147 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made from /Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y + by GNU Bison version 1.28 */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +#define YYBISON 1 /* Identify Bison output. */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define LOCALVAL_ID 259 +#define GLOBALVAL_ID 260 +#define FPVAL 261 +#define VOID 262 +#define INTTYPE 263 +#define FLOAT 264 +#define DOUBLE 265 +#define LABEL 266 +#define TYPE 267 +#define LOCALVAR 268 +#define GLOBALVAR 269 +#define LABELSTR 270 +#define STRINGCONSTANT 271 +#define ATSTRINGCONSTANT 272 +#define IMPLEMENTATION 273 +#define ZEROINITIALIZER 274 +#define TRUETOK 275 +#define FALSETOK 276 +#define BEGINTOK 277 +#define ENDTOK 278 +#define DECLARE 279 +#define DEFINE 280 +#define GLOBAL 281 +#define CONSTANT 282 +#define SECTION 283 +#define VOLATILE 284 +#define TO 285 +#define DOTDOTDOT 286 +#define NULL_TOK 287 +#define UNDEF 288 +#define INTERNAL 289 +#define LINKONCE 290 +#define WEAK 291 +#define APPENDING 292 +#define DLLIMPORT 293 +#define DLLEXPORT 294 +#define EXTERN_WEAK 295 +#define OPAQUE 296 +#define EXTERNAL 297 +#define TARGET 298 +#define TRIPLE 299 +#define ALIGN 300 +#define DEPLIBS 301 +#define CALL 302 +#define TAIL 303 +#define ASM_TOK 304 +#define MODULE 305 +#define SIDEEFFECT 306 +#define CC_TOK 307 +#define CCC_TOK 308 +#define FASTCC_TOK 309 +#define COLDCC_TOK 310 +#define X86_STDCALLCC_TOK 311 +#define X86_FASTCALLCC_TOK 312 +#define DATALAYOUT 313 +#define RET 314 +#define BR 315 +#define SWITCH 316 +#define INVOKE 317 +#define UNWIND 318 +#define UNREACHABLE 319 +#define ADD 320 +#define SUB 321 +#define MUL 322 +#define UDIV 323 +#define SDIV 324 +#define FDIV 325 +#define UREM 326 +#define SREM 327 +#define FREM 328 +#define AND 329 +#define OR 330 +#define XOR 331 +#define SHL 332 +#define LSHR 333 +#define ASHR 334 +#define ICMP 335 +#define FCMP 336 +#define EQ 337 +#define NE 338 +#define SLT 339 +#define SGT 340 +#define SLE 341 +#define SGE 342 +#define ULT 343 +#define UGT 344 +#define ULE 345 +#define UGE 346 +#define OEQ 347 +#define ONE 348 +#define OLT 349 +#define OGT 350 +#define OLE 351 +#define OGE 352 +#define ORD 353 +#define UNO 354 +#define UEQ 355 +#define UNE 356 +#define MALLOC 357 +#define ALLOCA 358 +#define FREE 359 +#define LOAD 360 +#define STORE 361 +#define GETELEMENTPTR 362 +#define TRUNC 363 +#define ZEXT 364 +#define SEXT 365 +#define FPTRUNC 366 +#define FPEXT 367 +#define BITCAST 368 +#define UITOFP 369 +#define SITOFP 370 +#define FPTOUI 371 +#define FPTOSI 372 +#define INTTOPTR 373 +#define PTRTOINT 374 +#define PHI_TOK 375 +#define SELECT 376 +#define VAARG 377 +#define EXTRACTELEMENT 378 +#define INSERTELEMENT 379 +#define SHUFFLEVECTOR 380 +#define NORETURN 381 +#define INREG 382 +#define SRET 383 +#define DEFAULT 384 +#define HIDDEN 385 - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - LOCALVAL_ID = 260, - GLOBALVAL_ID = 261, - FPVAL = 262, - VOID = 263, - INTTYPE = 264, - FLOAT = 265, - DOUBLE = 266, - LABEL = 267, - TYPE = 268, - LOCALVAR = 269, - GLOBALVAR = 270, - LABELSTR = 271, - STRINGCONSTANT = 272, - ATSTRINGCONSTANT = 273, - IMPLEMENTATION = 274, - ZEROINITIALIZER = 275, - TRUETOK = 276, - FALSETOK = 277, - BEGINTOK = 278, - ENDTOK = 279, - DECLARE = 280, - DEFINE = 281, - GLOBAL = 282, - CONSTANT = 283, - SECTION = 284, - VOLATILE = 285, - TO = 286, - DOTDOTDOT = 287, - NULL_TOK = 288, - UNDEF = 289, - INTERNAL = 290, - LINKONCE = 291, - WEAK = 292, - APPENDING = 293, - DLLIMPORT = 294, - DLLEXPORT = 295, - EXTERN_WEAK = 296, - OPAQUE = 297, - EXTERNAL = 298, - TARGET = 299, - TRIPLE = 300, - ALIGN = 301, - DEPLIBS = 302, - CALL = 303, - TAIL = 304, - ASM_TOK = 305, - MODULE = 306, - SIDEEFFECT = 307, - CC_TOK = 308, - CCC_TOK = 309, - FASTCC_TOK = 310, - COLDCC_TOK = 311, - X86_STDCALLCC_TOK = 312, - X86_FASTCALLCC_TOK = 313, - DATALAYOUT = 314, - RET = 315, - BR = 316, - SWITCH = 317, - INVOKE = 318, - UNWIND = 319, - UNREACHABLE = 320, - ADD = 321, - SUB = 322, - MUL = 323, - UDIV = 324, - SDIV = 325, - FDIV = 326, - UREM = 327, - SREM = 328, - FREM = 329, - AND = 330, - OR = 331, - XOR = 332, - SHL = 333, - LSHR = 334, - ASHR = 335, - ICMP = 336, - FCMP = 337, - EQ = 338, - NE = 339, - SLT = 340, - SGT = 341, - SLE = 342, - SGE = 343, - ULT = 344, - UGT = 345, - ULE = 346, - UGE = 347, - OEQ = 348, - ONE = 349, - OLT = 350, - OGT = 351, - OLE = 352, - OGE = 353, - ORD = 354, - UNO = 355, - UEQ = 356, - UNE = 357, - MALLOC = 358, - ALLOCA = 359, - FREE = 360, - LOAD = 361, - STORE = 362, - GETELEMENTPTR = 363, - TRUNC = 364, - ZEXT = 365, - SEXT = 366, - FPTRUNC = 367, - FPEXT = 368, - BITCAST = 369, - UITOFP = 370, - SITOFP = 371, - FPTOUI = 372, - FPTOSI = 373, - INTTOPTR = 374, - PTRTOINT = 375, - PHI_TOK = 376, - SELECT = 377, - VAARG = 378, - EXTRACTELEMENT = 379, - INSERTELEMENT = 380, - SHUFFLEVECTOR = 381, - NORETURN = 382, - INREG = 383, - SRET = 384, - DEFAULT = 385, - HIDDEN = 386 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define LOCALVAL_ID 260 -#define GLOBALVAL_ID 261 -#define FPVAL 262 -#define VOID 263 -#define INTTYPE 264 -#define FLOAT 265 -#define DOUBLE 266 -#define LABEL 267 -#define TYPE 268 -#define LOCALVAR 269 -#define GLOBALVAR 270 -#define LABELSTR 271 -#define STRINGCONSTANT 272 -#define ATSTRINGCONSTANT 273 -#define IMPLEMENTATION 274 -#define ZEROINITIALIZER 275 -#define TRUETOK 276 -#define FALSETOK 277 -#define BEGINTOK 278 -#define ENDTOK 279 -#define DECLARE 280 -#define DEFINE 281 -#define GLOBAL 282 -#define CONSTANT 283 -#define SECTION 284 -#define VOLATILE 285 -#define TO 286 -#define DOTDOTDOT 287 -#define NULL_TOK 288 -#define UNDEF 289 -#define INTERNAL 290 -#define LINKONCE 291 -#define WEAK 292 -#define APPENDING 293 -#define DLLIMPORT 294 -#define DLLEXPORT 295 -#define EXTERN_WEAK 296 -#define OPAQUE 297 -#define EXTERNAL 298 -#define TARGET 299 -#define TRIPLE 300 -#define ALIGN 301 -#define DEPLIBS 302 -#define CALL 303 -#define TAIL 304 -#define ASM_TOK 305 -#define MODULE 306 -#define SIDEEFFECT 307 -#define CC_TOK 308 -#define CCC_TOK 309 -#define FASTCC_TOK 310 -#define COLDCC_TOK 311 -#define X86_STDCALLCC_TOK 312 -#define X86_FASTCALLCC_TOK 313 -#define DATALAYOUT 314 -#define RET 315 -#define BR 316 -#define SWITCH 317 -#define INVOKE 318 -#define UNWIND 319 -#define UNREACHABLE 320 -#define ADD 321 -#define SUB 322 -#define MUL 323 -#define UDIV 324 -#define SDIV 325 -#define FDIV 326 -#define UREM 327 -#define SREM 328 -#define FREM 329 -#define AND 330 -#define OR 331 -#define XOR 332 -#define SHL 333 -#define LSHR 334 -#define ASHR 335 -#define ICMP 336 -#define FCMP 337 -#define EQ 338 -#define NE 339 -#define SLT 340 -#define SGT 341 -#define SLE 342 -#define SGE 343 -#define ULT 344 -#define UGT 345 -#define ULE 346 -#define UGE 347 -#define OEQ 348 -#define ONE 349 -#define OLT 350 -#define OGT 351 -#define OLE 352 -#define OGE 353 -#define ORD 354 -#define UNO 355 -#define UEQ 356 -#define UNE 357 -#define MALLOC 358 -#define ALLOCA 359 -#define FREE 360 -#define LOAD 361 -#define STORE 362 -#define GETELEMENTPTR 363 -#define TRUNC 364 -#define ZEXT 365 -#define SEXT 366 -#define FPTRUNC 367 -#define FPEXT 368 -#define BITCAST 369 -#define UITOFP 370 -#define SITOFP 371 -#define FPTOUI 372 -#define FPTOSI 373 -#define INTTOPTR 374 -#define PTRTOINT 375 -#define PHI_TOK 376 -#define SELECT 377 -#define VAARG 378 -#define EXTRACTELEMENT 379 -#define INSERTELEMENT 380 -#define SHUFFLEVECTOR 381 -#define NORETURN 382 -#define INREG 383 -#define SRET 384 -#define DEFAULT 385 -#define HIDDEN 386 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1227,29 +1028,8 @@ } - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 901 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" -{ +#line 901 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1293,1734 +1073,1062 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 193 of yacc.c. */ -#line 1299 "llvmAsmParser.tab.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - +} YYSTYPE; +#include +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif -/* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 1312 "llvmAsmParser.tab.c" +#define YYFINAL 557 +#define YYFLAG -32768 +#define YYNTBASE 146 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 385 ? yytranslate[x] : 223) + +static const short yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 136, + 137, 134, 2, 133, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, + 132, 142, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 138, 135, 140, 2, 2, 2, 2, 2, 145, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, + 2, 2, 143, 2, 144, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131 +}; -#ifdef short -# undef short -#endif +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, + 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, + 119, 122, 123, 125, 127, 130, 131, 133, 135, 137, + 139, 141, 143, 145, 147, 148, 150, 151, 153, 155, + 156, 158, 160, 162, 164, 165, 167, 169, 171, 173, + 175, 178, 180, 182, 184, 186, 187, 190, 192, 194, + 195, 198, 199, 202, 203, 207, 210, 211, 213, 214, + 218, 220, 223, 225, 227, 229, 231, 233, 235, 238, + 240, 243, 249, 255, 261, 267, 271, 274, 280, 285, + 288, 290, 292, 294, 298, 300, 304, 306, 307, 309, + 313, 318, 322, 326, 331, 336, 340, 347, 353, 356, + 359, 362, 365, 368, 371, 374, 377, 380, 383, 390, + 396, 405, 412, 419, 427, 435, 442, 451, 460, 464, + 466, 468, 470, 472, 473, 475, 478, 479, 483, 484, + 488, 492, 494, 498, 502, 503, 510, 511, 519, 520, + 528, 531, 535, 537, 541, 545, 549, 553, 555, 556, + 562, 566, 568, 572, 574, 575, 585, 587, 589, 594, + 596, 598, 601, 605, 606, 608, 610, 612, 614, 616, + 618, 620, 622, 624, 628, 630, 636, 638, 640, 642, + 644, 646, 648, 651, 654, 657, 661, 664, 665, 667, + 670, 673, 677, 687, 697, 706, 721, 723, 725, 732, + 738, 741, 748, 756, 760, 766, 767, 768, 772, 775, + 777, 783, 789, 796, 803, 808, 815, 820, 825, 832, + 839, 842, 851, 853, 855, 856, 860, 867, 871, 878, + 881, 886, 893 +}; -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif +static const short yyrhs[] = { 66, + 0, 67, 0, 68, 0, 69, 0, 70, 0, 71, + 0, 72, 0, 73, 0, 74, 0, 78, 0, 79, + 0, 80, 0, 75, 0, 76, 0, 77, 0, 109, + 0, 110, 0, 111, 0, 112, 0, 113, 0, 114, + 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, + 0, 120, 0, 83, 0, 84, 0, 85, 0, 86, + 0, 87, 0, 88, 0, 89, 0, 90, 0, 91, + 0, 92, 0, 93, 0, 94, 0, 95, 0, 96, + 0, 97, 0, 98, 0, 99, 0, 100, 0, 101, + 0, 102, 0, 89, 0, 90, 0, 91, 0, 92, + 0, 21, 0, 22, 0, 9, 0, 10, 0, 11, + 0, 14, 0, 17, 0, 153, 0, 0, 153, 132, + 0, 0, 15, 0, 18, 0, 156, 132, 0, 0, + 35, 0, 37, 0, 36, 0, 38, 0, 40, 0, + 39, 0, 41, 0, 43, 0, 0, 131, 0, 0, + 39, 0, 41, 0, 0, 35, 0, 36, 0, 37, + 0, 40, 0, 0, 54, 0, 55, 0, 56, 0, + 57, 0, 58, 0, 53, 4, 0, 110, 0, 111, + 0, 128, 0, 129, 0, 0, 165, 164, 0, 127, + 0, 164, 0, 0, 167, 166, 0, 0, 46, 4, + 0, 0, 133, 46, 4, 0, 29, 17, 0, 0, + 170, 0, 0, 133, 173, 172, 0, 170, 0, 46, + 4, 0, 9, 0, 10, 0, 11, 0, 12, 0, + 42, 0, 174, 0, 175, 134, 0, 207, 0, 135, + 4, 0, 175, 136, 179, 137, 167, 0, 8, 136, + 179, 137, 167, 0, 138, 4, 139, 175, 140, 0, + 141, 4, 139, 175, 142, 0, 143, 180, 144, 0, + 143, 144, 0, 141, 143, 180, 144, 142, 0, 141, + 143, 144, 142, 0, 175, 165, 0, 175, 0, 8, + 0, 176, 0, 178, 133, 176, 0, 178, 0, 178, + 133, 32, 0, 32, 0, 0, 175, 0, 180, 133, + 175, 0, 175, 138, 183, 140, 0, 175, 138, 140, + 0, 175, 145, 17, 0, 175, 141, 183, 142, 0, + 175, 143, 183, 144, 0, 175, 143, 144, 0, 175, + 141, 143, 183, 144, 142, 0, 175, 141, 143, 144, + 142, 0, 175, 33, 0, 175, 34, 0, 175, 207, + 0, 175, 182, 0, 175, 20, 0, 151, 3, 0, + 151, 4, 0, 9, 21, 0, 9, 22, 0, 152, + 7, 0, 148, 136, 181, 31, 175, 137, 0, 108, + 136, 181, 218, 137, 0, 122, 136, 181, 133, 181, + 133, 181, 137, 0, 146, 136, 181, 133, 181, 137, + 0, 147, 136, 181, 133, 181, 137, 0, 81, 149, + 136, 181, 133, 181, 137, 0, 82, 150, 136, 181, + 133, 181, 137, 0, 124, 136, 181, 133, 181, 137, + 0, 125, 136, 181, 133, 181, 133, 181, 137, 0, + 126, 136, 181, 133, 181, 133, 181, 137, 0, 183, + 133, 181, 0, 181, 0, 27, 0, 28, 0, 186, + 0, 0, 187, 0, 186, 187, 0, 0, 26, 188, + 203, 0, 0, 25, 189, 204, 0, 51, 50, 193, + 0, 19, 0, 155, 13, 175, 0, 155, 13, 8, + 0, 0, 157, 160, 184, 181, 190, 172, 0, 0, + 157, 158, 160, 184, 181, 191, 172, 0, 0, 157, + 159, 160, 184, 175, 192, 172, 0, 44, 194, 0, + 47, 132, 195, 0, 17, 0, 45, 132, 17, 0, + 59, 132, 17, 0, 138, 196, 140, 0, 196, 133, + 17, 0, 17, 0, 0, 197, 133, 175, 165, 154, + 0, 175, 165, 154, 0, 197, 0, 197, 133, 32, + 0, 32, 0, 0, 163, 177, 156, 136, 198, 137, + 167, 171, 168, 0, 23, 0, 143, 0, 162, 160, + 199, 200, 0, 24, 0, 144, 0, 210, 202, 0, + 161, 160, 199, 0, 0, 52, 0, 3, 0, 4, + 0, 7, 0, 21, 0, 22, 0, 33, 0, 34, + 0, 20, 0, 141, 183, 142, 0, 182, 0, 50, + 205, 17, 133, 17, 0, 5, 0, 6, 0, 153, + 0, 156, 0, 207, 0, 206, 0, 175, 208, 0, + 210, 211, 0, 201, 211, 0, 212, 155, 213, 0, + 212, 215, 0, 0, 16, 0, 60, 209, 0, 60, + 8, 0, 61, 12, 208, 0, 61, 9, 208, 133, + 12, 208, 133, 12, 208, 0, 62, 151, 208, 133, + 12, 208, 138, 214, 140, 0, 62, 151, 208, 133, + 12, 208, 138, 140, 0, 63, 163, 177, 208, 136, + 217, 137, 167, 31, 12, 208, 64, 12, 208, 0, + 64, 0, 65, 0, 214, 151, 206, 133, 12, 208, + 0, 151, 206, 133, 12, 208, 0, 155, 220, 0, + 175, 138, 208, 133, 208, 140, 0, 216, 133, 138, + 208, 133, 208, 140, 0, 175, 208, 165, 0, 217, + 133, 175, 208, 165, 0, 0, 0, 218, 133, 209, + 0, 49, 48, 0, 48, 0, 146, 175, 208, 133, + 208, 0, 147, 175, 208, 133, 208, 0, 81, 149, + 175, 208, 133, 208, 0, 82, 150, 175, 208, 133, + 208, 0, 148, 209, 31, 175, 0, 122, 209, 133, + 209, 133, 209, 0, 123, 209, 133, 175, 0, 124, + 209, 133, 209, 0, 125, 209, 133, 209, 133, 209, + 0, 126, 209, 133, 209, 133, 209, 0, 121, 216, + 0, 219, 163, 177, 208, 136, 217, 137, 167, 0, + 222, 0, 30, 0, 0, 103, 175, 169, 0, 103, + 175, 133, 9, 208, 169, 0, 104, 175, 169, 0, + 104, 175, 133, 9, 208, 169, 0, 105, 209, 0, + 221, 106, 175, 208, 0, 221, 107, 209, 133, 175, + 208, 0, 108, 175, 208, 218, 0 +}; -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1049, + 1049, 1049, 1049, 1049, 1049, 1050, 1050, 1050, 1050, 1050, + 1050, 1050, 1051, 1051, 1051, 1051, 1051, 1054, 1054, 1055, + 1055, 1056, 1056, 1057, 1057, 1058, 1058, 1062, 1062, 1063, + 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, 1067, 1068, + 1068, 1069, 1070, 1075, 1076, 1076, 1078, 1078, 1079, 1079, + 1083, 1087, 1092, 1092, 1094, 1098, 1104, 1105, 1106, 1107, + 1108, 1112, 1113, 1114, 1118, 1119, 1123, 1124, 1125, 1129, + 1130, 1131, 1132, 1133, 1136, 1136, 1137, 1138, 1139, 1140, + 1141, 1149, 1150, 1151, 1152, 1155, 1156, 1161, 1162, 1165, + 1166, 1173, 1173, 1180, 1180, 1189, 1197, 1197, 1203, 1203, + 1205, 1210, 1223, 1223, 1223, 1223, 1226, 1230, 1234, 1241, + 1246, 1254, 1272, 1290, 1295, 1307, 1317, 1321, 1331, 1338, + 1345, 1352, 1357, 1362, 1369, 1370, 1377, 1384, 1392, 1397, + 1408, 1436, 1452, 1481, 1509, 1534, 1553, 1578, 1597, 1609, + 1616, 1682, 1692, 1702, 1708, 1714, 1719, 1724, 1732, 1744, + 1766, 1774, 1780, 1791, 1796, 1801, 1807, 1813, 1822, 1826, + 1834, 1834, 1845, 1850, 1858, 1859, 1863, 1863, 1867, 1867, + 1870, 1873, 1885, 1909, 1920, 1927, 1930, 1935, 1938, 1944, + 1948, 1951, 1957, 1970, 1974, 1979, 1981, 1986, 1991, 2000, + 2010, 2021, 2025, 2034, 2043, 2048, 2160, 2160, 2162, 2171, + 2171, 2173, 2178, 2190, 2194, 2199, 2203, 2207, 2211, 2215, + 2219, 2223, 2227, 2231, 2256, 2260, 2274, 2278, 2282, 2286, + 2292, 2292, 2298, 2307, 2311, 2320, 2330, 2339, 2351, 2364, + 2368, 2372, 2377, 2387, 2406, 2415, 2482, 2486, 2493, 2504, + 2517, 2527, 2538, 2548, 2556, 2564, 2567, 2568, 2575, 2579, + 2584, 2605, 2622, 2635, 2648, 2660, 2668, 2675, 2681, 2687, + 2693, 2708, 2772, 2777, 2781, 2788, 2795, 2803, 2810, 2818, + 2826, 2840, 2857 +}; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} +static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", +"EUINT64VAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL","VOID","INTTYPE","FLOAT","DOUBLE", +"LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT", +"IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK", +"DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO","DOTDOTDOT", +"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", +"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","DEPLIBS","CALL", +"TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK", +"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE", +"UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV","SDIV","FDIV","UREM","SREM", +"FREM","AND","OR","XOR","SHL","LSHR","ASHR","ICMP","FCMP","EQ","NE","SLT","SGT", +"SLE","SGE","ULT","UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD", +"UNO","UEQ","UNE","MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","TRUNC", +"ZEXT","SEXT","FPTRUNC","FPEXT","BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI", +"INTTOPTR","PTRTOINT","PHI_TOK","SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT", +"SHUFFLEVECTOR","NORETURN","INREG","SRET","DEFAULT","HIDDEN","'='","','","'*'", +"'\\\\'","'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps", +"LogicalOps","CastOps","IPredicates","FPredicates","IntType","FPType","LocalName", +"OptLocalName","OptLocalAssign","GlobalName","OptGlobalAssign","GVInternalLinkage", +"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage", +"OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs","OptAlign", +"OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", +"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI", +"ConstVal","ConstExpr","ConstVector","GlobalType","Module","DefinitionList", +"Definition","@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", +"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", +"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", +"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", +"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", +"OptVolatile","MemoryInst", NULL +}; #endif -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 40 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1439 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 146 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 78 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 284 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 557 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 386 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 136, 137, 134, 2, 133, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 141, 132, 142, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 138, 135, 140, 2, 2, 2, 2, 2, 145, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 139, 2, 2, 143, 2, 144, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131 +static const short yyr1[] = { 0, + 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, + 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 151, 152, 152, 153, 153, 154, 154, + 155, 155, 156, 156, 157, 157, 158, 158, 158, 158, + 158, 159, 159, 159, 160, 160, 161, 161, 161, 162, + 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, + 163, 164, 164, 164, 164, 165, 165, 166, 166, 167, + 167, 168, 168, 169, 169, 170, 171, 171, 172, 172, + 173, 173, 174, 174, 174, 174, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, + 177, 177, 178, 178, 179, 179, 179, 179, 180, 180, + 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, + 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, + 184, 184, 185, 185, 186, 186, 188, 187, 189, 187, + 187, 187, 187, 187, 190, 187, 191, 187, 192, 187, + 187, 187, 193, 194, 194, 195, 196, 196, 196, 197, + 197, 198, 198, 198, 198, 199, 200, 200, 201, 202, + 202, 203, 204, 205, 205, 206, 206, 206, 206, 206, + 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, + 208, 208, 209, 210, 210, 211, 212, 212, 212, 213, + 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, + 215, 216, 216, 217, 217, 217, 218, 218, 219, 219, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 221, 221, 222, 222, 222, 222, 222, + 222, 222, 222 }; -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, - 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, - 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, - 119, 121, 122, 125, 126, 128, 130, 133, 134, 136, - 138, 140, 142, 144, 146, 148, 150, 151, 153, 154, - 156, 158, 159, 161, 163, 165, 167, 168, 170, 172, - 174, 176, 178, 181, 183, 185, 187, 189, 190, 193, - 195, 197, 198, 201, 202, 205, 206, 210, 213, 214, - 216, 217, 221, 223, 226, 228, 230, 232, 234, 236, - 238, 241, 243, 246, 252, 258, 264, 270, 274, 277, - 283, 288, 291, 293, 295, 297, 301, 303, 307, 309, - 310, 312, 316, 321, 325, 329, 334, 339, 343, 350, - 356, 359, 362, 365, 368, 371, 374, 377, 380, 383, - 386, 393, 399, 408, 415, 422, 430, 438, 445, 454, - 463, 467, 469, 471, 473, 475, 476, 478, 481, 482, - 486, 487, 491, 495, 497, 501, 505, 506, 513, 514, - 522, 523, 531, 534, 538, 540, 544, 548, 552, 556, - 558, 559, 565, 569, 571, 575, 577, 578, 588, 590, - 592, 597, 599, 601, 604, 608, 609, 611, 613, 615, - 617, 619, 621, 623, 625, 627, 631, 633, 639, 641, - 643, 645, 647, 649, 651, 654, 657, 660, 664, 667, - 668, 670, 673, 676, 680, 690, 700, 709, 724, 726, - 728, 735, 741, 744, 751, 759, 763, 769, 770, 771, - 775, 778, 780, 786, 792, 799, 806, 811, 818, 823, - 828, 835, 842, 845, 854, 856, 858, 859, 863, 870, - 874, 881, 884, 889, 896 +static const short yyr2[] = { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 0, 2, 1, 1, 0, + 2, 0, 2, 0, 3, 2, 0, 1, 0, 3, + 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, + 2, 5, 5, 5, 5, 3, 2, 5, 4, 2, + 1, 1, 1, 3, 1, 3, 1, 0, 1, 3, + 4, 3, 3, 4, 4, 3, 6, 5, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 6, 5, + 8, 6, 6, 7, 7, 6, 8, 8, 3, 1, + 1, 1, 1, 0, 1, 2, 0, 3, 0, 3, + 3, 1, 3, 3, 0, 6, 0, 7, 0, 7, + 2, 3, 1, 3, 3, 3, 3, 1, 0, 5, + 3, 1, 3, 1, 0, 9, 1, 1, 4, 1, + 1, 2, 3, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 1, 5, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 3, 2, 0, 1, 2, + 2, 3, 9, 9, 8, 14, 1, 1, 6, 5, + 2, 6, 7, 3, 5, 0, 0, 3, 2, 1, + 5, 5, 6, 6, 4, 6, 4, 4, 6, 6, + 2, 8, 1, 1, 0, 3, 6, 3, 6, 2, + 4, 6, 4 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 186, 0, -1, 66, -1, 67, -1, 68, -1, 69, - -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, - -1, 78, -1, 79, -1, 80, -1, 75, -1, 76, - -1, 77, -1, 109, -1, 110, -1, 111, -1, 112, - -1, 113, -1, 114, -1, 115, -1, 116, -1, 117, - -1, 118, -1, 119, -1, 120, -1, 83, -1, 84, - -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, - -1, 90, -1, 91, -1, 92, -1, 93, -1, 94, - -1, 95, -1, 96, -1, 97, -1, 98, -1, 99, - -1, 100, -1, 101, -1, 102, -1, 89, -1, 90, - -1, 91, -1, 92, -1, 21, -1, 22, -1, 9, - -1, 10, -1, 11, -1, 14, -1, 17, -1, 154, - -1, -1, 154, 132, -1, -1, 15, -1, 18, -1, - 157, 132, -1, -1, 35, -1, 37, -1, 36, -1, - 38, -1, 40, -1, 39, -1, 41, -1, 43, -1, - -1, 131, -1, -1, 39, -1, 41, -1, -1, 35, - -1, 36, -1, 37, -1, 40, -1, -1, 54, -1, - 55, -1, 56, -1, 57, -1, 58, -1, 53, 4, - -1, 110, -1, 111, -1, 128, -1, 129, -1, -1, - 166, 165, -1, 127, -1, 165, -1, -1, 168, 167, - -1, -1, 46, 4, -1, -1, 133, 46, 4, -1, - 29, 17, -1, -1, 171, -1, -1, 133, 174, 173, - -1, 171, -1, 46, 4, -1, 9, -1, 10, -1, - 11, -1, 12, -1, 42, -1, 175, -1, 176, 134, - -1, 208, -1, 135, 4, -1, 176, 136, 180, 137, - 168, -1, 8, 136, 180, 137, 168, -1, 138, 4, - 139, 176, 140, -1, 141, 4, 139, 176, 142, -1, - 143, 181, 144, -1, 143, 144, -1, 141, 143, 181, - 144, 142, -1, 141, 143, 144, 142, -1, 176, 166, - -1, 176, -1, 8, -1, 177, -1, 179, 133, 177, - -1, 179, -1, 179, 133, 32, -1, 32, -1, -1, - 176, -1, 181, 133, 176, -1, 176, 138, 184, 140, - -1, 176, 138, 140, -1, 176, 145, 17, -1, 176, - 141, 184, 142, -1, 176, 143, 184, 144, -1, 176, - 143, 144, -1, 176, 141, 143, 184, 144, 142, -1, - 176, 141, 143, 144, 142, -1, 176, 33, -1, 176, - 34, -1, 176, 208, -1, 176, 183, -1, 176, 20, - -1, 152, 3, -1, 152, 4, -1, 9, 21, -1, - 9, 22, -1, 153, 7, -1, 149, 136, 182, 31, - 176, 137, -1, 108, 136, 182, 219, 137, -1, 122, - 136, 182, 133, 182, 133, 182, 137, -1, 147, 136, - 182, 133, 182, 137, -1, 148, 136, 182, 133, 182, - 137, -1, 81, 150, 136, 182, 133, 182, 137, -1, - 82, 151, 136, 182, 133, 182, 137, -1, 124, 136, - 182, 133, 182, 137, -1, 125, 136, 182, 133, 182, - 133, 182, 137, -1, 126, 136, 182, 133, 182, 133, - 182, 137, -1, 184, 133, 182, -1, 182, -1, 27, - -1, 28, -1, 187, -1, -1, 188, -1, 187, 188, - -1, -1, 26, 189, 204, -1, -1, 25, 190, 205, - -1, 51, 50, 194, -1, 19, -1, 156, 13, 176, - -1, 156, 13, 8, -1, -1, 158, 161, 185, 182, - 191, 173, -1, -1, 158, 159, 161, 185, 182, 192, - 173, -1, -1, 158, 160, 161, 185, 176, 193, 173, - -1, 44, 195, -1, 47, 132, 196, -1, 17, -1, - 45, 132, 17, -1, 59, 132, 17, -1, 138, 197, - 140, -1, 197, 133, 17, -1, 17, -1, -1, 198, - 133, 176, 166, 155, -1, 176, 166, 155, -1, 198, - -1, 198, 133, 32, -1, 32, -1, -1, 164, 178, - 157, 136, 199, 137, 168, 172, 169, -1, 23, -1, - 143, -1, 163, 161, 200, 201, -1, 24, -1, 144, - -1, 211, 203, -1, 162, 161, 200, -1, -1, 52, - -1, 3, -1, 4, -1, 7, -1, 21, -1, 22, - -1, 33, -1, 34, -1, 20, -1, 141, 184, 142, - -1, 183, -1, 50, 206, 17, 133, 17, -1, 5, - -1, 6, -1, 154, -1, 157, -1, 208, -1, 207, - -1, 176, 209, -1, 211, 212, -1, 202, 212, -1, - 213, 156, 214, -1, 213, 216, -1, -1, 16, -1, - 60, 210, -1, 60, 8, -1, 61, 12, 209, -1, - 61, 9, 209, 133, 12, 209, 133, 12, 209, -1, - 62, 152, 209, 133, 12, 209, 138, 215, 140, -1, - 62, 152, 209, 133, 12, 209, 138, 140, -1, 63, - 164, 178, 209, 136, 218, 137, 168, 31, 12, 209, - 64, 12, 209, -1, 64, -1, 65, -1, 215, 152, - 207, 133, 12, 209, -1, 152, 207, 133, 12, 209, - -1, 156, 221, -1, 176, 138, 209, 133, 209, 140, - -1, 217, 133, 138, 209, 133, 209, 140, -1, 176, - 209, 166, -1, 218, 133, 176, 209, 166, -1, -1, - -1, 219, 133, 210, -1, 49, 48, -1, 48, -1, - 147, 176, 209, 133, 209, -1, 148, 176, 209, 133, - 209, -1, 81, 150, 176, 209, 133, 209, -1, 82, - 151, 176, 209, 133, 209, -1, 149, 210, 31, 176, - -1, 122, 210, 133, 210, 133, 210, -1, 123, 210, - 133, 176, -1, 124, 210, 133, 210, -1, 125, 210, - 133, 210, 133, 210, -1, 126, 210, 133, 210, 133, - 210, -1, 121, 217, -1, 220, 164, 178, 209, 136, - 218, 137, 168, -1, 223, -1, 30, -1, -1, 103, - 176, 170, -1, 103, 176, 133, 9, 209, 170, -1, - 104, 176, 170, -1, 104, 176, 133, 9, 209, 170, - -1, 105, 210, -1, 222, 106, 176, 209, -1, 222, - 107, 210, 133, 176, 209, -1, 108, 176, 209, 219, - -1 +static const short yydefact[] = { 66, + 57, 63, 58, 64, 182, 179, 177, 0, 0, 0, + 0, 0, 0, 75, 66, 175, 77, 80, 0, 0, + 191, 0, 0, 61, 0, 65, 67, 69, 68, 70, + 72, 71, 73, 74, 76, 75, 75, 0, 176, 78, + 79, 75, 180, 81, 82, 83, 84, 75, 238, 178, + 238, 0, 0, 199, 192, 193, 181, 227, 228, 184, + 113, 114, 115, 116, 117, 0, 0, 0, 0, 229, + 230, 118, 183, 120, 0, 0, 171, 172, 0, 85, + 85, 239, 235, 62, 210, 211, 212, 234, 194, 195, + 198, 0, 138, 121, 0, 0, 0, 0, 127, 139, + 0, 119, 138, 0, 0, 113, 114, 115, 0, 0, + 0, 185, 0, 86, 87, 88, 89, 90, 0, 213, + 0, 275, 237, 0, 196, 137, 96, 133, 135, 0, + 0, 0, 0, 0, 0, 126, 0, 187, 189, 156, + 157, 154, 155, 158, 153, 149, 150, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 13, 14, 15, 10, + 11, 12, 0, 0, 0, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 152, 151, + 109, 91, 132, 131, 0, 207, 208, 209, 274, 260, + 0, 0, 0, 0, 85, 247, 248, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 236, 85, 251, 0, 273, 197, 130, 0, + 100, 0, 0, 129, 0, 140, 100, 109, 109, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 0, + 52, 53, 48, 49, 50, 51, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, + 0, 0, 142, 170, 0, 0, 0, 146, 0, 143, + 0, 0, 0, 0, 186, 0, 259, 241, 0, 240, + 0, 0, 54, 0, 0, 0, 0, 104, 104, 280, + 0, 0, 271, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 92, 93, 94, 95, 97, 136, + 134, 123, 124, 125, 128, 122, 188, 190, 0, 0, + 257, 0, 0, 0, 0, 0, 141, 127, 139, 0, + 144, 145, 0, 0, 0, 0, 0, 111, 109, 205, + 216, 217, 218, 223, 219, 220, 221, 222, 214, 0, + 225, 232, 231, 233, 0, 242, 0, 0, 0, 0, + 0, 276, 0, 278, 257, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, + 101, 0, 0, 0, 0, 0, 0, 0, 169, 148, + 0, 0, 0, 0, 106, 112, 110, 204, 96, 202, + 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 283, 0, 0, 0, 267, 268, 0, 0, + 0, 0, 265, 0, 281, 0, 0, 0, 0, 160, + 0, 0, 0, 0, 147, 0, 0, 0, 60, 0, + 100, 0, 224, 0, 0, 256, 0, 0, 104, 105, + 104, 0, 0, 0, 0, 0, 261, 262, 256, 0, + 0, 0, 258, 0, 166, 0, 0, 162, 163, 159, + 59, 201, 203, 96, 107, 0, 0, 0, 0, 0, + 263, 264, 0, 277, 279, 0, 0, 266, 269, 270, + 0, 282, 164, 165, 0, 0, 0, 60, 108, 102, + 226, 0, 0, 96, 0, 100, 252, 0, 100, 161, + 167, 168, 200, 0, 206, 0, 245, 0, 0, 254, + 0, 0, 253, 272, 103, 243, 0, 244, 0, 96, + 0, 0, 0, 255, 0, 0, 0, 0, 250, 0, + 0, 249, 0, 246, 0, 0, 0 }; -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, - 1048, 1049, 1049, 1049, 1049, 1049, 1049, 1050, 1050, 1050, - 1050, 1050, 1050, 1051, 1051, 1051, 1051, 1051, 1051, 1054, - 1054, 1055, 1055, 1056, 1056, 1057, 1057, 1058, 1058, 1062, - 1062, 1063, 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, - 1067, 1068, 1068, 1069, 1070, 1075, 1076, 1076, 1078, 1078, - 1079, 1079, 1083, 1087, 1092, 1092, 1094, 1098, 1104, 1105, - 1106, 1107, 1108, 1112, 1113, 1114, 1118, 1119, 1123, 1124, - 1125, 1129, 1130, 1131, 1132, 1133, 1136, 1137, 1138, 1139, - 1140, 1141, 1142, 1149, 1150, 1151, 1152, 1155, 1156, 1161, - 1162, 1165, 1166, 1173, 1174, 1180, 1181, 1189, 1197, 1198, - 1203, 1204, 1205, 1210, 1223, 1223, 1223, 1223, 1226, 1230, - 1234, 1241, 1246, 1254, 1272, 1290, 1295, 1307, 1317, 1321, - 1331, 1338, 1345, 1352, 1357, 1362, 1369, 1370, 1377, 1384, - 1392, 1397, 1408, 1436, 1452, 1481, 1509, 1534, 1553, 1578, - 1597, 1609, 1616, 1682, 1692, 1702, 1708, 1714, 1719, 1724, - 1732, 1744, 1766, 1774, 1780, 1791, 1796, 1801, 1807, 1813, - 1822, 1826, 1834, 1834, 1845, 1850, 1858, 1859, 1863, 1863, - 1867, 1867, 1870, 1873, 1885, 1909, 1920, 1920, 1930, 1930, - 1938, 1938, 1948, 1951, 1957, 1970, 1974, 1979, 1981, 1986, - 1991, 2000, 2010, 2021, 2025, 2034, 2043, 2048, 2160, 2160, - 2162, 2171, 2171, 2173, 2178, 2190, 2194, 2199, 2203, 2207, - 2211, 2215, 2219, 2223, 2227, 2231, 2256, 2260, 2274, 2278, - 2282, 2286, 2292, 2292, 2298, 2307, 2311, 2320, 2330, 2339, - 2351, 2364, 2368, 2372, 2377, 2387, 2406, 2415, 2482, 2486, - 2493, 2504, 2517, 2527, 2538, 2548, 2556, 2564, 2567, 2568, - 2575, 2579, 2584, 2605, 2622, 2635, 2648, 2660, 2668, 2675, - 2681, 2687, 2693, 2708, 2772, 2777, 2781, 2788, 2795, 2803, - 2810, 2818, 2826, 2840, 2857 +static const short yydefgoto[] = { 186, + 187, 188, 250, 267, 109, 110, 70, 482, 12, 71, + 14, 36, 37, 38, 42, 48, 119, 319, 229, 391, + 322, 525, 372, 348, 510, 285, 349, 72, 111, 128, + 195, 129, 130, 101, 274, 361, 275, 79, 555, 15, + 16, 18, 17, 191, 238, 239, 57, 21, 55, 92, + 410, 411, 120, 198, 49, 87, 50, 43, 413, 362, + 74, 364, 290, 51, 83, 84, 223, 529, 123, 303, + 490, 394, 224, 225, 226, 227 }; -#endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", - "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", "FLOAT", - "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", - "STRINGCONSTANT", "ATSTRINGCONSTANT", "IMPLEMENTATION", - "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", - "DECLARE", "DEFINE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", - "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", - "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", - "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", - "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", - "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", - "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", - "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", - "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", - "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", - "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", - "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", - "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", - "INSERTELEMENT", "SHUFFLEVECTOR", "NORETURN", "INREG", "SRET", "DEFAULT", - "HIDDEN", "'='", "','", "'*'", "'\\\\'", "'('", "')'", "'['", "'x'", - "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", - "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", - "FPType", "LocalName", "OptLocalName", "OptLocalAssign", "GlobalName", - "OptGlobalAssign", "GVInternalLinkage", "GVExternalLinkage", - "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", - "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr", - "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", "OptSection", - "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", - "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", - "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "Module", - "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock", - "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH", - "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", - "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", - "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", - "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", - "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", - "OptVolatile", "MemoryInst", 0 +static const short yypact[] = { 438, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, 27, -119, -29, + -84, 43, -57, -6, 525,-32768, 195, 140, -38, -27, +-32768, -39, 112,-32768, 828,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 32, 32, 227,-32768,-32768, +-32768, 32,-32768,-32768,-32768,-32768,-32768, 32, 119,-32768, + -2, 188, 210, 213,-32768,-32768,-32768,-32768,-32768, 49, +-32768,-32768,-32768,-32768,-32768, 214, 245, 5, 104,-32768, +-32768,-32768, 110,-32768, 227, 227,-32768,-32768, 1043, 154, + 154,-32768,-32768, 109,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, -89, 1085,-32768, 125, 139, 122, 49,-32768, 110, + -55,-32768, 1085, 1043, 1188, 46, 249, 272, 266, 273, + 589,-32768, 279,-32768,-32768,-32768,-32768,-32768, 1204,-32768, + 2, 1327,-32768, 268,-32768,-32768, 110,-32768, 153, 150, + 1188, 1188, 149, -53, 1188,-32768, 155,-32768, 110,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 494, 943, 157,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, 158, 159, 163, + 164, 790, 1226, 495, 284, 166, 167, 169,-32768,-32768, + 173,-32768, 49, 110, 28,-32768,-32768,-32768,-32768,-32768, + 262, 1243, 142, 302, 154,-32768,-32768, 494, 943, 1188, + 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, + 1188, 1188,-32768, 154,-32768, 168,-32768,-32768, -58, 1124, +-32768, 25, 16,-32768, 170, 110,-32768, 173, 173,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 177, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 181, 1043, 1043, 1043, + 1043, 1043,-32768,-32768, 20, 668, -40,-32768, -48,-32768, + 1043, 1043, 1043, 18,-32768, 182,-32768, 49, 747,-32768, + 872, 872,-32768, 872, 1204, 1188, 1188, 99, 117,-32768, + 747, 33, 186, 187, 191, 192, 198, 200, 747, 747, + 290, 1204, 1188, 1188,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, -87,-32768,-32768,-32768, -87,-32768,-32768, 1043, 1043, +-32768, 203, 204, 205, 209, 1043,-32768, 202, 589, -43, +-32768,-32768, 216, 218, 312, 328, 342,-32768, 173, 1140, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 295, 1043, +-32768,-32768,-32768,-32768, 219,-32768, 229, 872, 747, 747, + 8,-32768, 17,-32768,-32768, 872, 225, 1188, 1188, 1188, + 1188, 1188, 231, 232, 1188, 872, 747, 233,-32768,-32768, +-32768, 234, 235, -33, 1043, 1043, 1043, 1043,-32768,-32768, + 230, 1043, 1043, 1188,-32768,-32768,-32768,-32768, 110, 238, + 236,-32768, 357, -36, 363, 364, 241, 246, 248, 872, + 374, 872, 251, 254, 872, 255, 110,-32768, 256, 258, + 872, 872, 110, 260,-32768, 1188, 1043, 1043, 1188,-32768, + 261, 263, 264, 270,-32768, 267, 276, 47, 130, 1159, +-32768, 274,-32768, 872, 872, 1188, 872, 872, 281,-32768, + 281, 872, 283, 1188, 1188, 1188,-32768,-32768, 1188, 747, + 282, 285,-32768, 1043,-32768, 1043, 1043,-32768,-32768,-32768, +-32768,-32768,-32768, 110, 45, 382, 287, 280, 747, -13, +-32768,-32768, 355,-32768,-32768, 265, 872,-32768,-32768,-32768, + 29,-32768,-32768,-32768, 286, 291, 292, 130,-32768, 375, +-32768, 412, 1,-32768, 1188,-32768,-32768, 293,-32768,-32768, +-32768,-32768,-32768, 423,-32768, 872,-32768, 996, 9, -58, + 747, 212,-32768, -87,-32768,-32768, 297,-32768, 996,-32768, + 419, 422, 303, -58, 872, 872, 425, 371,-32768, 872, + 427,-32768, 872,-32768, 443, 444,-32768 }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 61, 44, 42, 92, 40, 41, 91, 120, - 93, 60, 62, 123, 125, 99 +static const short yypgoto[] = { 324, + 325, 326, 242, 252, -197,-32768, 0, -50, 376, 4, +-32768,-32768,-32768, 40,-32768,-32768, -167, -306, -397,-32768, + -235,-32768, -291, -23,-32768, -211,-32768,-32768, -24, 237, + -229,-32768, 362, 369, -68, -108, -178, 201,-32768,-32768, + 453,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 391,-32768,-32768,-32768,-32768,-32768,-32768, -436, + -72, 101, -157,-32768, 424,-32768,-32768,-32768,-32768,-32768, + 7, 105,-32768,-32768,-32768,-32768 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 146, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 148, 148, 148, 148, 148, 148, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, - 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, - 151, 151, 151, 151, 151, 152, 153, 153, 154, 154, - 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, - 159, 159, 159, 160, 160, 160, 161, 161, 162, 162, - 162, 163, 163, 163, 163, 163, 164, 164, 164, 164, - 164, 164, 164, 165, 165, 165, 165, 166, 166, 167, - 167, 168, 168, 169, 169, 170, 170, 171, 172, 172, - 173, 173, 174, 174, 175, 175, 175, 175, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 177, 178, 178, 179, 179, 180, 180, 180, 180, - 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 184, 184, 185, 185, 186, 186, 187, 187, 189, 188, - 190, 188, 188, 188, 188, 188, 191, 188, 192, 188, - 193, 188, 188, 188, 194, 195, 195, 196, 197, 197, - 197, 198, 198, 199, 199, 199, 199, 200, 201, 201, - 202, 203, 203, 204, 205, 206, 206, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, - 208, 208, 209, 209, 210, 211, 211, 212, 213, 213, - 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 215, 215, 216, 217, 217, 218, 218, 218, 219, 219, - 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, - 221, 221, 221, 221, 221, 222, 222, 223, 223, 223, - 223, 223, 223, 223, 223 -}; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 2, 0, 1, 1, 2, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, - 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 0, 2, 1, - 1, 0, 2, 0, 2, 0, 3, 2, 0, 1, - 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, - 2, 1, 2, 5, 5, 5, 5, 3, 2, 5, - 4, 2, 1, 1, 1, 3, 1, 3, 1, 0, - 1, 3, 4, 3, 3, 4, 4, 3, 6, 5, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 6, 5, 8, 6, 6, 7, 7, 6, 8, 8, - 3, 1, 1, 1, 1, 0, 1, 2, 0, 3, - 0, 3, 3, 1, 3, 3, 0, 6, 0, 7, - 0, 7, 2, 3, 1, 3, 3, 3, 3, 1, - 0, 5, 3, 1, 3, 1, 0, 9, 1, 1, - 4, 1, 1, 2, 3, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 3, 2, 0, - 1, 2, 2, 3, 9, 9, 8, 14, 1, 1, - 6, 5, 2, 6, 7, 3, 5, 0, 0, 3, - 2, 1, 5, 5, 6, 6, 4, 6, 4, 4, - 6, 6, 2, 8, 1, 1, 0, 3, 6, 3, - 6, 2, 4, 6, 4 -}; +#define YYLAST 1453 -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 67, 58, 64, 59, 65, 183, 180, 178, 0, 0, - 0, 0, 0, 0, 76, 0, 67, 176, 78, 81, - 0, 0, 192, 0, 0, 62, 0, 66, 68, 70, - 69, 71, 73, 72, 74, 75, 77, 76, 76, 0, - 1, 177, 79, 80, 76, 181, 82, 83, 84, 85, - 76, 239, 179, 239, 0, 0, 200, 193, 194, 182, - 228, 229, 185, 114, 115, 116, 117, 118, 0, 0, - 0, 0, 230, 231, 119, 184, 121, 0, 0, 172, - 173, 0, 86, 86, 240, 236, 63, 211, 212, 213, - 235, 195, 196, 199, 0, 139, 122, 0, 0, 0, - 0, 128, 140, 0, 120, 139, 0, 0, 114, 115, - 116, 0, 0, 0, 186, 0, 87, 88, 89, 90, - 91, 0, 214, 0, 276, 238, 0, 197, 138, 97, - 134, 136, 0, 0, 0, 0, 0, 0, 127, 0, - 188, 190, 157, 158, 155, 156, 159, 154, 150, 151, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, - 15, 16, 11, 12, 13, 0, 0, 0, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 153, 152, 110, 92, 133, 132, 0, 208, 209, - 210, 275, 261, 0, 0, 0, 0, 86, 248, 249, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 237, 86, 252, 0, 274, - 198, 131, 0, 101, 0, 0, 130, 0, 141, 101, - 110, 110, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 0, 53, 54, 49, 50, 51, 52, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, - 0, 0, 0, 0, 0, 143, 171, 0, 0, 0, - 147, 0, 144, 0, 0, 0, 0, 187, 0, 260, - 242, 0, 241, 0, 0, 55, 0, 0, 0, 0, - 105, 105, 281, 0, 0, 272, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 93, 94, 95, - 96, 98, 137, 135, 124, 125, 126, 129, 123, 189, - 191, 0, 0, 258, 0, 0, 0, 0, 0, 142, - 128, 140, 0, 145, 146, 0, 0, 0, 0, 0, - 112, 110, 206, 217, 218, 219, 224, 220, 221, 222, - 223, 215, 0, 226, 233, 232, 234, 0, 243, 0, - 0, 0, 0, 0, 277, 0, 279, 258, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 99, 100, 102, 0, 0, 0, 0, 0, 0, - 0, 170, 149, 0, 0, 0, 0, 107, 113, 111, - 205, 97, 203, 0, 216, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 284, 0, 0, 0, 268, - 269, 0, 0, 0, 0, 266, 0, 282, 0, 0, - 0, 0, 161, 0, 0, 0, 0, 148, 0, 0, - 0, 61, 0, 101, 0, 225, 0, 0, 257, 0, - 0, 105, 106, 105, 0, 0, 0, 0, 0, 262, - 263, 257, 0, 0, 0, 259, 0, 167, 0, 0, - 163, 164, 160, 60, 202, 204, 97, 108, 0, 0, - 0, 0, 0, 264, 265, 0, 278, 280, 0, 0, - 267, 270, 271, 0, 283, 165, 166, 0, 0, 0, - 61, 109, 103, 227, 0, 0, 97, 0, 101, 253, - 0, 101, 162, 168, 169, 201, 0, 207, 0, 246, - 0, 0, 255, 0, 0, 254, 273, 104, 244, 0, - 245, 0, 97, 0, 0, 0, 256, 0, 0, 0, - 0, 251, 0, 0, 250, 0, 247 -}; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 188, 189, 190, 252, 269, 111, 112, 72, 484, - 12, 73, 14, 37, 38, 39, 44, 50, 121, 321, - 231, 393, 324, 527, 374, 350, 512, 287, 351, 74, - 113, 130, 197, 131, 132, 103, 276, 363, 277, 81, - 15, 16, 17, 19, 18, 193, 240, 241, 59, 22, - 57, 94, 412, 413, 122, 200, 51, 89, 52, 45, - 415, 364, 76, 366, 292, 53, 85, 86, 225, 531, - 125, 305, 492, 396, 226, 227, 228, 229 +static const short yytable[] = { 11, + 73, 326, 189, 13, 277, 279, 294, 374, 96, 293, + 112, 449, 22, 82, 11, 390, 420, 293, 13, 390, + 23, 85, 315, 316, 196, 422, 327, 328, 27, 28, + 29, 30, 31, 32, 33, 138, 34, 295, 190, 389, + 317, 318, 2, 124, 100, 4, 346, 24, -54, -54, + 125, 315, 316, 421, 300, 25, 312, 304, 305, 306, + 307, 308, 421, 347, 311, 368, 140, 141, 127, 317, + 318, 19, 100, 346, 26, 75, 76, 135, 127, 135, + 139, 80, 386, 11, 336, 20, 508, 81, 136, 336, + 235, 537, 336, 52, 194, 342, 336, 340, 54, 439, + 401, 341, 543, 440, 53, 453, 232, 233, 58, 59, + 236, 98, 61, 62, 63, 64, 530, 1, 2, 515, + 3, 4, 1, 516, 35, 3, 58, 59, 56, 98, + 61, 62, 63, 64, 82, 1, 2, 407, 3, 4, + 527, 86, 544, 1, 197, 65, 3, 97, 538, 102, + 291, 103, 336, 292, 315, 316, 388, 324, 102, 337, + 103, 515, 35, 65, 323, 519, 102, 494, 103, 495, + 376, 389, 317, 318, 44, 45, 46, 289, 390, 47, + 102, 414, 103, 480, 93, 298, 299, 289, 301, 302, + 289, 289, 289, 289, 289, 309, 310, 289, 286, 331, + 332, 333, 334, 335, 89, 127, 113, 114, 115, 116, + 117, 118, 343, 344, 345, 485, 363, 94, 363, 363, + 426, 363, 428, 429, 430, 390, 90, 390, 363, 91, + 189, 371, 102, 40, 103, 41, 363, 363, 66, 315, + 316, 67, 541, 102, 68, 103, 69, 99, 95, 373, + 102, 339, 103, 77, 78, -55, 66, 317, 318, 67, + 392, 393, 68, 131, 69, 133, 190, 399, 142, 143, + 194, 369, 370, 313, 314, 104, 105, 132, -56, 144, + 532, 473, 192, 534, 228, 230, 231, 194, 387, 289, + 234, 237, 268, 269, 270, 363, 363, 363, 271, 272, + 280, 281, 282, 363, 283, 284, 498, 499, 500, 287, + 293, 325, 329, 363, 363, 528, 330, 350, 377, 378, + 385, 315, 316, 379, 380, 409, 441, 442, 443, 444, + 381, 539, 382, 446, 447, 395, 396, 397, 389, 317, + 318, 398, 404, 400, 405, 406, 412, 363, 402, 363, + 403, 415, 363, 289, 427, 289, 289, 289, 363, 363, + 433, 416, 425, 431, 432, 436, 437, 438, 471, 472, + 450, 445, 451, 452, 454, 455, 456, 460, 457, 448, + 458, 363, 363, 439, 363, 363, 462, 464, 465, 363, + 466, 365, 366, 474, 367, 469, 476, 363, 511, 475, + 421, 375, 477, 478, 517, 505, 486, 506, 507, 383, + 384, 470, 479, 493, 289, 497, 363, 513, 503, 512, + 524, 504, 520, 526, 363, 484, 535, 521, 522, 542, + 545, 489, 533, 546, 551, 547, 550, -174, 553, 289, + 289, 289, 556, 557, 489, 220, 221, 222, 481, 296, + -62, 1, 2, 363, 3, 4, 5, 523, 363, 122, + 297, 509, 6, 7, 137, 134, 321, 39, 417, 418, + 419, 121, 363, 363, 88, 501, 424, 363, 0, 423, + 363, 8, 0, 0, 9, 0, 434, 435, 10, 0, + 531, 0, 0, 0, 0, 0, 0, 0, 0, 58, + 59, 0, 98, 106, 107, 108, 64, 481, 1, 2, + 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, + 459, 0, 461, 0, -173, 463, 0, 0, 0, 0, + 0, 467, 468, 0, 0, 0, 65, -62, 1, 2, + 0, 3, 4, 5, 0, 0, 0, 0, 0, 6, + 7, 0, 0, 0, 487, 488, 0, 491, 492, 0, + 0, 0, 496, 0, 0, 0, 0, 0, 8, 0, + 502, 9, 0, 0, 0, 10, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 0, 0, 0, 514, + 0, 0, 0, 58, 59, 0, 0, 518, 0, 0, + 0, 0, 1, 2, 0, 3, 4, 0, 145, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 146, 147, 0, 0, 0, 536, 0, 0, 66, + 0, 540, 67, 0, 0, 68, 0, 69, 278, 0, + 0, 0, 0, 0, 0, 548, 549, 0, 0, 0, + 552, 0, 0, 554, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 0, 58, 59, 0, 98, 106, 107, 108, 64, + 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 65, + 178, 0, 179, 180, 181, 0, 0, 0, 0, 0, + 0, 0, 102, 0, 103, 0, 182, 0, 0, 183, + 0, 184, 0, 185, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 351, + 352, 58, 59, 353, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 3, 4, 0, 354, 355, 356, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 357, + 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 58, 59, 359, 98, 106, 107, + 108, 64, 66, 1, 2, 67, 3, 4, 68, 0, + 69, 338, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 0, + 0, 65, 58, 59, 0, 60, 61, 62, 63, 64, + 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 0, 178, 65, + 179, 180, 181, 0, 351, 352, 58, 59, 353, 0, + 102, 0, 103, 0, 0, 1, 2, 360, 3, 4, + 0, 354, 355, 356, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 357, 358, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 359, 0, 0, 66, 0, 0, 67, 0, 273, + 68, 0, 69, 0, 0, 0, 0, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 0, 0, 0, 0, 0, 0, + 0, 0, 66, 251, 252, 67, 0, 0, 68, 0, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 0, 178, 0, 179, 180, 181, 351, 352, + 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 360, 0, 0, 354, 355, 356, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 357, 358, + 0, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 359, 0, 58, 59, 0, + 98, 106, 107, 108, 64, 0, 1, 2, 0, 3, + 4, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 0, 0, + 0, 0, 0, 0, 65, 0, 0, 0, 0, 58, + 59, 0, 98, 61, 62, 63, 64, 0, 1, 2, + 0, 3, 4, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 126, 178, 0, 179, + 180, 181, 0, 0, 0, 0, 65, 0, 58, 59, + 0, 98, 61, 62, 63, 64, 360, 1, 2, 0, + 3, 4, 0, 0, 58, 59, 0, 98, 61, 62, + 63, 64, 0, 1, 2, 320, 3, 4, 0, 0, + 0, 0, 0, 58, 59, 65, 98, 61, 62, 63, + 64, 408, 1, 2, 0, 3, 4, 66, 0, 0, + 67, 65, 0, 68, 0, 69, 0, 0, 0, 0, + 483, 0, 58, 59, 0, 98, 61, 62, 63, 64, + 65, 1, 2, 0, 3, 4, 0, 0, 58, 59, + 0, 193, 61, 62, 63, 64, 0, 1, 2, 66, + 3, 4, 67, 0, 0, 68, 0, 69, 0, 65, + 58, 59, 0, 98, 106, 107, 108, 64, 0, 1, + 2, 0, 3, 4, 0, 65, 0, 58, 59, 0, + 288, 61, 62, 63, 64, 0, 1, 2, 66, 3, + 4, 67, 0, 0, 68, 0, 69, 65, 0, 0, + 0, 0, 0, 0, 66, 0, 0, 67, 0, 0, + 68, 0, 69, 0, 65, 0, 0, 0, 0, 0, + 0, 0, 0, 66, 0, 0, 67, 0, 0, 68, + 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 66, 0, 0, 67, 0, 0, 68, 0, + 69, 0, 0, 0, 0, 0, 0, 0, 66, 0, + 0, 67, 0, 0, 68, 0, 69, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 199, 0, 0, 0, + 66, 0, 0, 67, 0, 0, 68, 0, 276, 0, + 0, 0, 0, 0, 200, 201, 0, 66, 0, 0, + 67, 0, 0, 68, 0, 69, 202, 203, 204, 205, + 206, 207, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 208, 209, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, + 211, 212, 0, 0, 213, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 214, 215, 216, + 217, 218, 219 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -399 -static const yytype_int16 yypact[] = -{ - 406, -399, -399, -399, -399, -399, -399, -399, -26, -114, - -16, -53, 92, -11, 54, 136, 526, -399, 247, 173, - 43, 49, -399, 62, 194, -399, 814, -399, -399, -399, - -399, -399, -399, -399, -399, -399, -399, 134, 134, 99, - -399, -399, -399, -399, 134, -399, -399, -399, -399, -399, - 134, 212, -399, -1, 219, 225, 253, -399, -399, -399, - -399, -399, 135, -399, -399, -399, -399, -399, 271, 275, - 3, 33, -399, -399, -399, 160, -399, 99, 99, -399, - -399, 1029, 287, 287, -399, -399, 220, -399, -399, -399, - -399, -399, -399, -399, 20, 1071, -399, 141, 148, 105, - 135, -399, 160, -75, -399, 1071, 1029, 1174, 32, 286, - 293, 151, 294, 590, -399, 298, -399, -399, -399, -399, - -399, 1190, -399, -13, 1313, -399, 289, -399, -399, 160, - -399, 170, 167, 1174, 1174, 165, -68, 1174, -399, 174, - -399, 160, -399, -399, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, -399, 495, 591, 176, -399, -399, - -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, - 177, 178, 182, 183, 776, 1212, 123, 305, 187, 188, - 189, -399, -399, 193, -399, 135, 160, 266, -399, -399, - -399, -399, -399, 284, 1229, 283, 325, 287, -399, -399, - 495, 591, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, - 1174, 1174, 1174, 1174, 1174, -399, 287, -399, 144, -399, - -399, -4, 1110, -399, -63, -110, -399, 204, 160, -399, - 193, 193, -399, -399, -399, -399, -399, -399, -399, -399, - -399, -399, 211, -399, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, -399, -399, -399, -399, -399, 214, - 1029, 1029, 1029, 1029, 1029, -399, -399, 79, 494, -111, - -399, -66, -399, 1029, 1029, 1029, 39, -399, 216, -399, - 135, 733, -399, 858, 858, -399, 858, 1190, 1174, 1174, - 50, 111, -399, 733, 97, 215, 230, 231, 232, 233, - 234, 733, 733, 322, 1190, 1174, 1174, -399, -399, -399, - -399, -399, -399, -399, -27, -399, -399, -399, -27, -399, - -399, 1029, 1029, -399, 235, 236, 239, 240, 1029, -399, - 237, 590, 26, -399, -399, 241, 242, 345, 360, 374, - -399, 193, 1126, -399, -399, -399, -399, -399, -399, -399, - -399, 328, 1029, -399, -399, -399, -399, 249, -399, 252, - 858, 733, 733, 11, -399, 18, -399, -399, 858, 250, - 1174, 1174, 1174, 1174, 1174, 256, 257, 1174, 858, 733, - 259, -399, -399, -399, 262, 264, -34, 1029, 1029, 1029, - 1029, -399, -399, 258, 1029, 1029, 1174, -399, -399, -399, - -399, 160, 265, 267, -399, 384, -61, 390, 393, 272, - 281, 282, 858, 413, 858, 295, 296, 858, 297, 160, - -399, 301, 302, 858, 858, 160, 300, -399, 1174, 1029, - 1029, 1174, -399, 304, 285, 306, 307, -399, 308, 310, - 118, 38, 1145, -399, 311, -399, 858, 858, 1174, 858, - 858, 315, -399, 315, 858, 316, 1174, 1174, 1174, -399, - -399, 1174, 733, 317, 319, -399, 1029, -399, 1029, 1029, - -399, -399, -399, -399, -399, -399, 160, 149, 421, 326, - 314, 733, 19, -399, -399, 412, -399, -399, 321, 858, - -399, -399, -399, 36, -399, -399, -399, 327, 329, 330, - 38, -399, 416, -399, 451, 2, -399, 1174, -399, -399, - 333, -399, -399, -399, -399, -399, 461, -399, 858, -399, - 982, 5, -4, 733, 210, -399, -27, -399, -399, 335, - -399, 982, -399, 457, 464, 344, -4, 858, 858, 468, - 417, -399, 858, 471, -399, 858, -399 +static const short yycheck[] = { 0, + 25, 237, 111, 0, 183, 184, 204, 299, 4, 9, + 79, 409, 132, 16, 15, 322, 9, 9, 15, 326, + 50, 24, 110, 111, 23, 9, 238, 239, 35, 36, + 37, 38, 39, 40, 41, 104, 43, 205, 111, 127, + 128, 129, 15, 133, 69, 18, 29, 132, 3, 4, + 140, 110, 111, 46, 212, 13, 224, 215, 216, 217, + 218, 219, 46, 46, 222, 295, 21, 22, 93, 128, + 129, 45, 97, 29, 132, 36, 37, 133, 103, 133, + 105, 42, 312, 84, 133, 59, 484, 48, 144, 133, + 144, 528, 133, 132, 119, 144, 133, 276, 138, 133, + 144, 142, 539, 137, 132, 142, 131, 132, 5, 6, + 135, 8, 9, 10, 11, 12, 514, 14, 15, 133, + 17, 18, 14, 137, 131, 17, 5, 6, 17, 8, + 9, 10, 11, 12, 16, 14, 15, 349, 17, 18, + 140, 144, 540, 14, 143, 42, 17, 143, 140, 134, + 9, 136, 133, 12, 110, 111, 314, 142, 134, 140, + 136, 133, 131, 42, 140, 137, 134, 459, 136, 461, + 138, 127, 128, 129, 35, 36, 37, 202, 485, 40, + 134, 360, 136, 137, 136, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 195, 268, + 269, 270, 271, 272, 17, 230, 53, 54, 55, 56, + 57, 58, 281, 282, 283, 451, 289, 4, 291, 292, + 378, 294, 380, 381, 382, 532, 17, 534, 301, 17, + 339, 133, 134, 39, 136, 41, 309, 310, 135, 110, + 111, 138, 31, 134, 141, 136, 143, 144, 4, 133, + 134, 276, 136, 27, 28, 7, 135, 128, 129, 138, + 329, 330, 141, 139, 143, 144, 339, 336, 3, 4, + 295, 296, 297, 106, 107, 75, 76, 139, 7, 7, + 516, 439, 4, 519, 17, 133, 137, 312, 313, 314, + 142, 137, 136, 136, 136, 368, 369, 370, 136, 136, + 17, 136, 136, 376, 136, 133, 464, 465, 466, 48, + 9, 142, 136, 386, 387, 513, 136, 136, 133, 133, + 31, 110, 111, 133, 133, 350, 395, 396, 397, 398, + 133, 529, 133, 402, 403, 133, 133, 133, 127, 128, + 129, 133, 31, 142, 17, 4, 52, 420, 133, 422, + 133, 133, 425, 378, 379, 380, 381, 382, 431, 432, + 385, 133, 138, 133, 133, 133, 133, 133, 437, 438, + 133, 142, 137, 17, 12, 12, 136, 4, 133, 404, + 133, 454, 455, 133, 457, 458, 133, 133, 133, 462, + 133, 291, 292, 133, 294, 136, 133, 470, 17, 137, + 46, 301, 133, 137, 140, 474, 133, 476, 477, 309, + 310, 436, 137, 133, 439, 133, 489, 138, 137, 133, + 46, 137, 137, 12, 497, 450, 4, 137, 137, 133, + 12, 456, 140, 12, 64, 133, 12, 0, 12, 464, + 465, 466, 0, 0, 469, 122, 122, 122, 449, 208, + 13, 14, 15, 526, 17, 18, 19, 508, 531, 84, + 209, 485, 25, 26, 103, 97, 230, 15, 368, 369, + 370, 81, 545, 546, 51, 469, 376, 550, -1, 375, + 553, 44, -1, -1, 47, -1, 386, 387, 51, -1, + 515, -1, -1, -1, -1, -1, -1, -1, -1, 5, + 6, -1, 8, 9, 10, 11, 12, 508, 14, 15, + -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, + 420, -1, 422, -1, 0, 425, -1, -1, -1, -1, + -1, 431, 432, -1, -1, -1, 42, 13, 14, 15, + -1, 17, 18, 19, -1, -1, -1, -1, -1, 25, + 26, -1, -1, -1, 454, 455, -1, 457, 458, -1, + -1, -1, 462, -1, -1, -1, -1, -1, 44, -1, + 470, 47, -1, -1, -1, 51, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, -1, -1, 489, + -1, -1, -1, 5, 6, -1, -1, 497, -1, -1, + -1, -1, 14, 15, -1, 17, 18, -1, 20, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 33, 34, -1, -1, -1, 526, -1, -1, 135, + -1, 531, 138, -1, -1, 141, -1, 143, 144, -1, + -1, -1, -1, -1, -1, 545, 546, -1, -1, -1, + 550, -1, -1, 553, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, -1, 5, 6, -1, 8, 9, 10, 11, 12, + -1, 14, 15, -1, 17, 18, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 42, + 122, -1, 124, 125, 126, -1, -1, -1, -1, -1, + -1, -1, 134, -1, 136, -1, 138, -1, -1, 141, + -1, 143, -1, 145, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, + 4, 5, 6, 7, -1, -1, -1, -1, -1, -1, + 14, 15, -1, 17, 18, -1, 20, 21, 22, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 33, + 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 5, 6, 50, 8, 9, 10, + 11, 12, 135, 14, 15, 138, 17, 18, 141, -1, + 143, 144, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, + -1, 42, 5, 6, -1, 8, 9, 10, 11, 12, + -1, 14, 15, -1, 17, 18, -1, -1, -1, -1, + -1, -1, -1, -1, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, -1, 122, 42, + 124, 125, 126, -1, 3, 4, 5, 6, 7, -1, + 134, -1, 136, -1, -1, 14, 15, 141, 17, 18, + -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 33, 34, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 50, -1, -1, 135, -1, -1, 138, -1, 140, + 141, -1, 143, -1, -1, -1, -1, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, -1, -1, -1, -1, -1, -1, + -1, -1, 135, 21, 22, 138, -1, -1, 141, -1, + 143, -1, -1, -1, -1, -1, -1, -1, -1, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, -1, 122, -1, 124, 125, 126, 3, 4, + -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 141, -1, -1, 20, 21, 22, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, + -1, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 50, -1, 5, 6, -1, + 8, 9, 10, 11, 12, -1, 14, 15, -1, 17, + 18, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, -1, -1, + -1, -1, -1, -1, 42, -1, -1, -1, -1, 5, + 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, + -1, 17, 18, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 32, 122, -1, 124, + 125, 126, -1, -1, -1, -1, 42, -1, 5, 6, + -1, 8, 9, 10, 11, 12, 141, 14, 15, -1, + 17, 18, -1, -1, 5, 6, -1, 8, 9, 10, + 11, 12, -1, 14, 15, 32, 17, 18, -1, -1, + -1, -1, -1, 5, 6, 42, 8, 9, 10, 11, + 12, 32, 14, 15, -1, 17, 18, 135, -1, -1, + 138, 42, -1, 141, -1, 143, -1, -1, -1, -1, + 32, -1, 5, 6, -1, 8, 9, 10, 11, 12, + 42, 14, 15, -1, 17, 18, -1, -1, 5, 6, + -1, 8, 9, 10, 11, 12, -1, 14, 15, 135, + 17, 18, 138, -1, -1, 141, -1, 143, -1, 42, + 5, 6, -1, 8, 9, 10, 11, 12, -1, 14, + 15, -1, 17, 18, -1, 42, -1, 5, 6, -1, + 8, 9, 10, 11, 12, -1, 14, 15, 135, 17, + 18, 138, -1, -1, 141, -1, 143, 42, -1, -1, + -1, -1, -1, -1, 135, -1, -1, 138, -1, -1, + 141, -1, 143, -1, 42, -1, -1, -1, -1, -1, + -1, -1, -1, 135, -1, -1, 138, -1, -1, 141, + -1, 143, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 135, -1, -1, 138, -1, -1, 141, -1, + 143, -1, -1, -1, -1, -1, -1, -1, 135, -1, + -1, 138, -1, -1, 141, -1, 143, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 30, -1, -1, -1, + 135, -1, -1, 138, -1, -1, 141, -1, 143, -1, + -1, -1, -1, -1, 48, 49, -1, 135, -1, -1, + 138, -1, -1, 141, -1, 143, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 103, + 104, 105, -1, -1, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126 }; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -399, 361, 362, 363, 274, 279, -198, -399, 0, -19, - 407, 9, -399, -399, -399, 113, -399, -399, -177, -307, - -398, -399, -236, -399, -299, 7, -399, -212, -399, -399, - -25, 263, -210, -399, 391, 398, -69, -109, -180, 179, - -399, -399, 482, -399, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, 418, -399, -399, -399, -399, -399, - -399, -369, -73, 100, -158, -399, 454, -399, -399, -399, - -399, -399, 42, 137, -399, -399, -399, -399 -}; +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -176 -static const yytype_int16 yytable[] = -{ - 11, 75, 376, 328, 191, 279, 281, 98, 296, 13, - 198, 295, 114, 451, 295, 84, 11, 392, 23, 20, - 422, 392, 338, 87, 104, 13, 105, 424, 329, 330, - 297, 343, 326, 21, 24, -55, -55, 140, 60, 61, - 192, 100, 63, 64, 65, 66, 102, 1, 2, 314, - 3, 4, 1, 142, 143, 3, 302, 423, 137, 306, - 307, 308, 309, 310, 423, 137, 313, 338, 348, 138, - 129, 104, 338, 105, 102, 67, 237, 325, 344, 25, - 129, 455, 141, 317, 318, 349, 11, 370, 510, 28, - 29, 30, 31, 32, 33, 34, 196, 35, 342, 441, - 391, 319, 320, 442, 388, 26, 317, 318, 234, 235, - 60, 61, 238, 100, 63, 64, 65, 66, 532, 1, - 2, 27, 3, 4, 319, 320, 79, 80, 60, 61, - 199, 100, 108, 109, 110, 66, 40, 1, 2, 409, - 3, 4, 529, 88, 546, 540, 99, 67, 317, 318, - 77, 78, 517, 126, 144, 145, 518, 82, 390, 338, - 127, 539, 496, 83, 497, 67, 319, 320, 68, 517, - 403, 69, 545, 521, 70, 54, 71, 101, 348, 291, - 392, 55, 416, 373, 104, 36, 105, 300, 301, 291, - 303, 304, 291, 291, 291, 291, 291, 311, 312, 291, - 56, 333, 334, 335, 336, 337, 288, 129, 46, 47, - 48, 58, 338, 49, 345, 346, 347, 487, 365, 339, - 365, 365, 428, 365, 430, 431, 432, 392, 84, 392, - 365, 104, 191, 105, 1, 378, 91, 3, 365, 365, - 68, 543, 92, 69, 375, 104, 70, 105, 71, 135, - 315, 316, 104, 341, 105, 482, 106, 107, 68, 317, - 318, 69, 394, 395, 70, 36, 71, 280, 192, 401, - 93, 95, 196, 371, 372, 96, 391, 319, 320, 97, - 133, 2, 534, 475, 4, 536, 42, 134, 43, 196, - 389, 291, 293, -56, 104, 294, 105, 365, 365, 365, - -57, 146, 194, 232, 233, 365, 230, 236, 500, 501, - 502, 239, 270, 271, 272, 365, 365, 530, 273, 274, - 317, 318, 282, 283, 284, 285, 286, 411, 443, 444, - 445, 446, 289, 541, 295, 448, 449, 391, 319, 320, - 115, 116, 117, 118, 119, 120, 327, 331, 379, 365, - 332, 365, 352, 387, 365, 291, 429, 291, 291, 291, - 365, 365, 435, 380, 381, 382, 383, 384, 397, 398, - 473, 474, 399, 400, 404, 405, 406, 407, 408, 402, - 414, 450, 417, 365, 365, 418, 365, 365, 427, 433, - 434, 365, 438, 367, 368, 439, 369, 440, 452, 365, - 447, 454, 456, 377, 453, 457, -175, 507, 458, 508, - 509, 385, 386, 472, 459, 460, 291, 462, 365, -63, - 1, 2, 477, 3, 4, 5, 365, 486, 441, 464, - 466, 6, 7, 491, 467, 468, 471, 476, 513, 478, - 479, 291, 291, 291, 488, 480, 491, 481, 495, 499, - 8, 483, 515, 9, 505, 365, 506, 10, 423, 514, - 365, 519, 526, 528, 522, 537, 523, 524, 544, 547, - 419, 420, 421, 535, 365, 365, 548, 549, 426, 365, - 552, 553, 365, 555, 298, 222, 223, 224, 436, 437, - 299, 525, 533, 124, 511, 323, 139, 136, 41, 60, - 61, 123, 100, 108, 109, 110, 66, 90, 1, 2, - 483, 3, 4, 503, 425, 0, 0, 0, 0, 0, - 0, 0, 461, 0, 463, 0, -174, 465, 0, 0, - 0, 0, 0, 469, 470, 0, 67, 0, 0, -63, - 1, 2, 0, 3, 4, 5, 0, 0, 0, 0, - 0, 6, 7, 0, 0, 0, 489, 490, 0, 493, - 494, 0, 0, 0, 498, 0, 0, 0, 0, 0, - 8, 0, 504, 9, 0, 0, 0, 10, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 0, 0, - 0, 516, 0, 0, 0, 60, 61, 0, 0, 520, - 0, 0, 0, 0, 1, 2, 0, 3, 4, 0, - 147, 0, 253, 254, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 148, 149, 0, 0, 0, 538, 68, - 0, 0, 69, 542, 0, 70, 0, 71, 340, 0, - 0, 0, 0, 0, 0, 0, 0, 550, 551, 0, - 0, 0, 554, 0, 0, 556, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 0, 0, 0, 0, 0, 0, 0, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 0, 0, 0, 0, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 0, 180, 0, 181, 182, 183, 0, 0, 0, - 0, 0, 0, 0, 104, 0, 105, 0, 184, 0, - 0, 185, 0, 186, 0, 187, 353, 354, 60, 61, - 355, 0, 0, 0, 0, 0, 0, 1, 2, 0, - 3, 4, 0, 356, 357, 358, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 359, 360, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 60, 61, 361, 100, 108, 109, 110, 66, 0, - 1, 2, 0, 3, 4, 0, 0, 0, 0, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 0, 0, 67, 60, - 61, 0, 62, 63, 64, 65, 66, 0, 1, 2, - 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 0, 180, 67, 181, 182, 183, - 0, 353, 354, 60, 61, 355, 0, 104, 0, 105, - 0, 0, 1, 2, 362, 3, 4, 0, 356, 357, - 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 359, 360, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 361, 0, - 0, 68, 0, 0, 69, 0, 275, 70, 0, 71, - 0, 0, 0, 0, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 0, 0, 0, 0, 0, 0, 0, 0, 68, - 0, 0, 69, 0, 0, 70, 0, 71, 0, 0, - 0, 0, 0, 0, 0, 0, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 0, - 180, 0, 181, 182, 183, 353, 354, 0, 0, 355, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 362, - 0, 0, 356, 357, 358, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 359, 360, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 361, 0, 60, 61, 0, 100, 108, 109, - 110, 66, 0, 1, 2, 0, 3, 4, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 0, 0, 0, 0, 0, - 0, 67, 0, 0, 0, 0, 60, 61, 0, 100, - 63, 64, 65, 66, 0, 1, 2, 0, 3, 4, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 128, 180, 0, 181, 182, 183, 0, - 0, 0, 0, 67, 0, 60, 61, 0, 100, 63, - 64, 65, 66, 362, 1, 2, 0, 3, 4, 0, - 0, 60, 61, 0, 100, 63, 64, 65, 66, 0, - 1, 2, 322, 3, 4, 0, 0, 0, 0, 0, - 60, 61, 67, 100, 63, 64, 65, 66, 410, 1, - 2, 0, 3, 4, 68, 0, 0, 69, 67, 0, - 70, 0, 71, 0, 0, 0, 0, 485, 0, 60, - 61, 0, 100, 63, 64, 65, 66, 67, 1, 2, - 0, 3, 4, 0, 0, 60, 61, 0, 195, 63, - 64, 65, 66, 0, 1, 2, 68, 3, 4, 69, - 0, 0, 70, 0, 71, 0, 67, 60, 61, 0, - 100, 108, 109, 110, 66, 0, 1, 2, 0, 3, - 4, 0, 67, 0, 60, 61, 0, 290, 63, 64, - 65, 66, 0, 1, 2, 68, 3, 4, 69, 0, - 0, 70, 0, 71, 67, 0, 0, 0, 0, 0, - 0, 68, 0, 0, 69, 0, 0, 70, 0, 71, - 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 0, 0, 69, 0, 0, 70, 0, 71, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, - 0, 0, 69, 0, 0, 70, 0, 71, 0, 0, - 0, 0, 0, 0, 0, 68, 0, 0, 69, 0, - 0, 70, 0, 71, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 201, 0, 0, 0, 68, 0, 0, - 69, 0, 0, 70, 0, 278, 0, 0, 0, 0, - 0, 202, 203, 0, 68, 0, 0, 69, 0, 0, - 70, 0, 71, 204, 205, 206, 207, 208, 209, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 210, 211, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 212, 213, 214, 0, - 0, 215, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 216, 217, 218, 219, 220, 221 -}; + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -static const yytype_int16 yycheck[] = -{ - 0, 26, 301, 239, 113, 185, 186, 4, 206, 0, - 23, 9, 81, 411, 9, 16, 16, 324, 132, 45, - 9, 328, 133, 24, 134, 16, 136, 9, 240, 241, - 207, 142, 142, 59, 50, 3, 4, 106, 5, 6, - 113, 8, 9, 10, 11, 12, 71, 14, 15, 226, - 17, 18, 14, 21, 22, 17, 214, 46, 133, 217, - 218, 219, 220, 221, 46, 133, 224, 133, 29, 144, - 95, 134, 133, 136, 99, 42, 144, 140, 144, 132, - 105, 142, 107, 110, 111, 46, 86, 297, 486, 35, - 36, 37, 38, 39, 40, 41, 121, 43, 278, 133, - 127, 128, 129, 137, 314, 13, 110, 111, 133, 134, - 5, 6, 137, 8, 9, 10, 11, 12, 516, 14, - 15, 132, 17, 18, 128, 129, 27, 28, 5, 6, - 143, 8, 9, 10, 11, 12, 0, 14, 15, 351, - 17, 18, 140, 144, 542, 140, 143, 42, 110, 111, - 37, 38, 133, 133, 3, 4, 137, 44, 316, 133, - 140, 530, 461, 50, 463, 42, 128, 129, 135, 133, - 144, 138, 541, 137, 141, 132, 143, 144, 29, 204, - 487, 132, 362, 133, 134, 131, 136, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 138, 270, 271, 272, 273, 274, 197, 232, 35, 36, - 37, 17, 133, 40, 283, 284, 285, 453, 291, 140, - 293, 294, 380, 296, 382, 383, 384, 534, 16, 536, - 303, 134, 341, 136, 14, 138, 17, 17, 311, 312, - 135, 31, 17, 138, 133, 134, 141, 136, 143, 144, - 106, 107, 134, 278, 136, 137, 77, 78, 135, 110, - 111, 138, 331, 332, 141, 131, 143, 144, 341, 338, - 17, 136, 297, 298, 299, 4, 127, 128, 129, 4, - 139, 15, 518, 441, 18, 521, 39, 139, 41, 314, - 315, 316, 9, 7, 134, 12, 136, 370, 371, 372, - 7, 7, 4, 133, 137, 378, 17, 142, 466, 467, - 468, 137, 136, 136, 136, 388, 389, 515, 136, 136, - 110, 111, 17, 136, 136, 136, 133, 352, 397, 398, - 399, 400, 48, 531, 9, 404, 405, 127, 128, 129, - 53, 54, 55, 56, 57, 58, 142, 136, 133, 422, - 136, 424, 136, 31, 427, 380, 381, 382, 383, 384, - 433, 434, 387, 133, 133, 133, 133, 133, 133, 133, - 439, 440, 133, 133, 133, 133, 31, 17, 4, 142, - 52, 406, 133, 456, 457, 133, 459, 460, 138, 133, - 133, 464, 133, 293, 294, 133, 296, 133, 133, 472, - 142, 17, 12, 303, 137, 12, 0, 476, 136, 478, - 479, 311, 312, 438, 133, 133, 441, 4, 491, 13, - 14, 15, 137, 17, 18, 19, 499, 452, 133, 133, - 133, 25, 26, 458, 133, 133, 136, 133, 17, 133, - 133, 466, 467, 468, 133, 137, 471, 137, 133, 133, - 44, 451, 138, 47, 137, 528, 137, 51, 46, 133, - 533, 140, 46, 12, 137, 4, 137, 137, 133, 12, - 370, 371, 372, 140, 547, 548, 12, 133, 378, 552, - 12, 64, 555, 12, 210, 124, 124, 124, 388, 389, - 211, 510, 517, 86, 487, 232, 105, 99, 16, 5, - 6, 83, 8, 9, 10, 11, 12, 53, 14, 15, - 510, 17, 18, 471, 377, -1, -1, -1, -1, -1, - -1, -1, 422, -1, 424, -1, 0, 427, -1, -1, - -1, -1, -1, 433, 434, -1, 42, -1, -1, 13, - 14, 15, -1, 17, 18, 19, -1, -1, -1, -1, - -1, 25, 26, -1, -1, -1, 456, 457, -1, 459, - 460, -1, -1, -1, 464, -1, -1, -1, -1, -1, - 44, -1, 472, 47, -1, -1, -1, 51, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, -1, -1, - -1, 491, -1, -1, -1, 5, 6, -1, -1, 499, - -1, -1, -1, -1, 14, 15, -1, 17, 18, -1, - 20, -1, 21, 22, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 33, 34, -1, -1, -1, 528, 135, - -1, -1, 138, 533, -1, 141, -1, 143, 144, -1, - -1, -1, -1, -1, -1, -1, -1, 547, 548, -1, - -1, -1, 552, -1, -1, 555, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, -1, -1, -1, -1, -1, -1, -1, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, -1, -1, -1, -1, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, -1, 122, -1, 124, 125, 126, -1, -1, -1, - -1, -1, -1, -1, 134, -1, 136, -1, 138, -1, - -1, 141, -1, 143, -1, 145, 3, 4, 5, 6, - 7, -1, -1, -1, -1, -1, -1, 14, 15, -1, - 17, 18, -1, 20, 21, 22, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 33, 34, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 5, 6, 50, 8, 9, 10, 11, 12, -1, - 14, 15, -1, 17, 18, -1, -1, -1, -1, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, -1, -1, 42, 5, - 6, -1, 8, 9, 10, 11, 12, -1, 14, 15, - -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, - -1, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, -1, 122, 42, 124, 125, 126, - -1, 3, 4, 5, 6, 7, -1, 134, -1, 136, - -1, -1, 14, 15, 141, 17, 18, -1, 20, 21, - 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 33, 34, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 50, -1, - -1, 135, -1, -1, 138, -1, 140, 141, -1, 143, - -1, -1, -1, -1, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, -1, -1, -1, -1, -1, -1, -1, -1, 135, - -1, -1, 138, -1, -1, 141, -1, 143, -1, -1, - -1, -1, -1, -1, -1, -1, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, -1, - 122, -1, 124, 125, 126, 3, 4, -1, -1, 7, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 141, - -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 33, 34, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 50, -1, 5, 6, -1, 8, 9, 10, - 11, 12, -1, 14, 15, -1, 17, 18, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, -1, -1, -1, -1, -1, - -1, 42, -1, -1, -1, -1, 5, 6, -1, 8, - 9, 10, 11, 12, -1, 14, 15, -1, 17, 18, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 32, 122, -1, 124, 125, 126, -1, - -1, -1, -1, 42, -1, 5, 6, -1, 8, 9, - 10, 11, 12, 141, 14, 15, -1, 17, 18, -1, - -1, 5, 6, -1, 8, 9, 10, 11, 12, -1, - 14, 15, 32, 17, 18, -1, -1, -1, -1, -1, - 5, 6, 42, 8, 9, 10, 11, 12, 32, 14, - 15, -1, 17, 18, 135, -1, -1, 138, 42, -1, - 141, -1, 143, -1, -1, -1, -1, 32, -1, 5, - 6, -1, 8, 9, 10, 11, 12, 42, 14, 15, - -1, 17, 18, -1, -1, 5, 6, -1, 8, 9, - 10, 11, 12, -1, 14, 15, 135, 17, 18, 138, - -1, -1, 141, -1, 143, -1, 42, 5, 6, -1, - 8, 9, 10, 11, 12, -1, 14, 15, -1, 17, - 18, -1, 42, -1, 5, 6, -1, 8, 9, 10, - 11, 12, -1, 14, 15, 135, 17, 18, 138, -1, - -1, 141, -1, 143, 42, -1, -1, -1, -1, -1, - -1, 135, -1, -1, 138, -1, -1, 141, -1, 143, - -1, 42, -1, -1, -1, -1, -1, -1, -1, -1, - 135, -1, -1, 138, -1, -1, 141, -1, 143, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, - -1, -1, 138, -1, -1, 141, -1, 143, -1, -1, - -1, -1, -1, -1, -1, 135, -1, -1, 138, -1, - -1, 141, -1, 143, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 30, -1, -1, -1, 135, -1, -1, - 138, -1, -1, 141, -1, 143, -1, -1, -1, -1, - -1, 48, 49, -1, 135, -1, -1, 138, -1, -1, - 141, -1, 143, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 103, 104, 105, -1, - -1, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126 -}; + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 14, 15, 17, 18, 19, 25, 26, 44, 47, - 51, 154, 156, 157, 158, 186, 187, 188, 190, 189, - 45, 59, 195, 132, 50, 132, 13, 132, 35, 36, - 37, 38, 39, 40, 41, 43, 131, 159, 160, 161, - 0, 188, 39, 41, 162, 205, 35, 36, 37, 40, - 163, 202, 204, 211, 132, 132, 138, 196, 17, 194, - 5, 6, 8, 9, 10, 11, 12, 42, 135, 138, - 141, 143, 154, 157, 175, 176, 208, 161, 161, 27, - 28, 185, 161, 161, 16, 212, 213, 24, 144, 203, - 212, 17, 17, 17, 197, 136, 4, 4, 4, 143, - 8, 144, 176, 181, 134, 136, 185, 185, 9, 10, - 11, 152, 153, 176, 182, 53, 54, 55, 56, 57, - 58, 164, 200, 200, 156, 216, 133, 140, 32, 176, - 177, 179, 180, 139, 139, 144, 181, 133, 144, 180, - 182, 176, 21, 22, 3, 4, 7, 20, 33, 34, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 122, 124, 125, 126, 138, 141, 143, 145, 147, 148, - 149, 183, 208, 191, 4, 8, 176, 178, 23, 143, - 201, 30, 48, 49, 60, 61, 62, 63, 64, 65, - 81, 82, 103, 104, 105, 108, 121, 122, 123, 124, - 125, 126, 147, 148, 149, 214, 220, 221, 222, 223, - 17, 166, 133, 137, 176, 176, 142, 144, 176, 137, - 192, 193, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 150, 21, 22, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 151, - 136, 136, 136, 136, 136, 140, 182, 184, 143, 184, - 144, 184, 17, 136, 136, 136, 133, 173, 157, 48, - 8, 176, 210, 9, 12, 9, 152, 164, 150, 151, - 176, 176, 210, 176, 176, 217, 210, 210, 210, 210, - 210, 176, 176, 210, 164, 106, 107, 110, 111, 128, - 129, 165, 32, 177, 168, 140, 142, 142, 168, 173, - 173, 136, 136, 182, 182, 182, 182, 182, 133, 140, - 144, 176, 184, 142, 144, 182, 182, 182, 29, 46, - 171, 174, 136, 3, 4, 7, 20, 21, 22, 33, - 34, 50, 141, 183, 207, 208, 209, 209, 209, 209, - 178, 176, 176, 133, 170, 133, 170, 209, 138, 133, - 133, 133, 133, 133, 133, 209, 209, 31, 178, 176, - 210, 127, 165, 167, 182, 182, 219, 133, 133, 133, - 133, 182, 142, 144, 133, 133, 31, 17, 4, 173, - 32, 176, 198, 199, 52, 206, 184, 133, 133, 209, - 209, 209, 9, 46, 9, 219, 209, 138, 210, 176, - 210, 210, 210, 133, 133, 176, 209, 209, 133, 133, - 133, 133, 137, 182, 182, 182, 182, 142, 182, 182, - 176, 166, 133, 137, 17, 142, 12, 12, 136, 133, - 133, 209, 4, 209, 133, 209, 133, 133, 133, 209, - 209, 136, 176, 182, 182, 210, 133, 137, 133, 133, - 137, 137, 137, 154, 155, 32, 176, 168, 133, 209, - 209, 176, 218, 209, 209, 133, 170, 170, 209, 133, - 210, 210, 210, 218, 209, 137, 137, 182, 182, 182, - 166, 171, 172, 17, 133, 138, 209, 133, 137, 140, - 209, 137, 137, 137, 137, 155, 46, 169, 12, 140, - 152, 215, 166, 176, 168, 140, 168, 4, 209, 207, - 140, 152, 209, 31, 133, 207, 166, 12, 12, 133, - 209, 209, 12, 64, 209, 12, 209 -}; + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define YYEMPTY -2 #define YYEOF 0 - #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ +#define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) #define YYTERROR 1 #define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +#ifndef YYPURE +#define YYLEX yylex() #endif - -/* YYLEX -- calling `yylex' with the right arguments. */ - +#ifdef YYPURE +#ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else -# define YYLEX yylex () +#define YYLEX yylex(&yylval, &yylloc) #endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) #else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; +#define YYLEX yylex(&yylval) #endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; +#endif /* not YYLSP_NEEDED */ #endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ +/* If nonreentrant, generate the variables here */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} +#ifndef YYPURE -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ #endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#define YYINITDEPTH 200 #endif -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; { - char *yyd = yydest; - const char *yys = yysrc; + register char *f = from; + register char *t = to; + register int i = count; - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; + while (i-- > 0) + *t++ = *f++; } -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif +#else /* __cplusplus */ -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) { - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; + register char *t = to; + register char *f = from; + register int i = count; - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } + while (i-- > 0) + *t++ = *f++; } -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; #endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} +#endif +#line 217 "/usr/share/bison.simple" -/* Prevent warnings from -Wmissing-prototypes. */ +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); #else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (void); -#else -int yyparse (); #endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ +#endif -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int -yyparse (void *YYPARSE_PARAM) +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; +#define YYPOPSTACK (yyvsp--, yyssp--) #endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; #endif #endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + int yylen; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -3032,671 +2140,644 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; + yyssp = yyss - 1; yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: - yysetstate: - *yyssp = yystate; + *++yyssp = yystate; - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + int size = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif - yyss = yyss1; - yyvs = yyvs1; - } + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) + if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif goto yybackup; + yybackup: -/*-----------. -| yybackup. | -`-----------*/ -yybackup: +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to lookahead token. */ - /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yyn == YYFLAG) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif yychar = YYLEX; } - if (yychar <= YYEOF) + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } + yychar1 = YYTRANSLATE(yychar); - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* Shift the lookahead token. */ - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif - /* Discard the shifted token unless it is eof. */ + /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; - yystate = yyn; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif - goto yynewstate; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + yystate = yyn; + goto yynewstate; -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ +/* Do the default action for the current state. */ yydefault: + yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) +#if YYDEBUG != 0 + if (yydebug) { - case 29: -#line 1054 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} - break; - - case 30: -#line 1054 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} - break; - - case 31: -#line 1055 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} - break; - - case 32: -#line 1055 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} - break; - - case 33: -#line 1056 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} - break; - - case 34: -#line 1056 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} - break; - - case 35: -#line 1057 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} - break; - - case 36: -#line 1057 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} - break; - - case 37: -#line 1058 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} - break; - - case 38: -#line 1058 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} - break; - - case 39: -#line 1062 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} - break; + int i; - case 40: -#line 1062 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} - break; - - case 41: -#line 1063 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} - break; - - case 42: -#line 1063 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} - break; - - case 43: -#line 1064 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} - break; - - case 44: -#line 1064 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} - break; - - case 45: -#line 1065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} - break; - - case 46: -#line 1065 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} - break; - - case 47: -#line 1066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} - break; - - case 48: -#line 1066 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} - break; - - case 49: -#line 1067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} - break; - - case 50: -#line 1067 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} - break; - - case 51: -#line 1068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} - break; - - case 52: -#line 1068 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} - break; - - case 53: -#line 1069 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} - break; - - case 54: -#line 1070 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} - break; - - case 61: -#line 1079 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 62: -#line 1083 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 28: +#line 1054 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; + break;} +case 29: +#line 1054 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_NE; ; + break;} +case 30: +#line 1055 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; + break;} +case 31: +#line 1055 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; + break;} +case 32: +#line 1056 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; + break;} +case 33: +#line 1056 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; + break;} +case 34: +#line 1057 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; + break;} +case 35: +#line 1057 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; + break;} +case 36: +#line 1058 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; + break;} +case 37: +#line 1058 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; + break;} +case 38: +#line 1062 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; + break;} +case 39: +#line 1062 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; + break;} +case 40: +#line 1063 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; + break;} +case 41: +#line 1063 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; + break;} +case 42: +#line 1064 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; + break;} +case 43: +#line 1064 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; + break;} +case 44: +#line 1065 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; + break;} +case 45: +#line 1065 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; + break;} +case 46: +#line 1066 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; + break;} +case 47: +#line 1066 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; + break;} +case 48: +#line 1067 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; + break;} +case 49: +#line 1067 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; + break;} +case 50: +#line 1068 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; + break;} +case 51: +#line 1068 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; + break;} +case 52: +#line 1069 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; + break;} +case 53: +#line 1070 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; + break;} +case 60: +#line 1079 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 61: +#line 1083 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 63: -#line 1087 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 62: +#line 1087 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 66: -#line 1094 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + ; + break;} +case 65: +#line 1094 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 67: -#line 1098 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 66: +#line 1098 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 68: -#line 1104 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 69: -#line 1105 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 70: -#line 1106 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 71: -#line 1107 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} - break; - - case 72: -#line 1108 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 73: -#line 1112 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 74: -#line 1113 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 75: -#line 1114 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 76: -#line 1118 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} - break; - - case 77: -#line 1119 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} - break; - - case 78: -#line 1123 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 79: -#line 1124 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 80: -#line 1125 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 81: -#line 1129 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 82: -#line 1130 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 83: -#line 1131 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 84: -#line 1132 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 85: -#line 1133 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 86: -#line 1136 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 87: -#line 1137 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 88: -#line 1138 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Fast; ;} - break; - - case 89: -#line 1139 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Cold; ;} - break; - - case 90: -#line 1140 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} - break; - - case 91: -#line 1141 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} - break; - - case 92: -#line 1142 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) + ; + break;} +case 67: +#line 1104 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 68: +#line 1105 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 69: +#line 1106 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 70: +#line 1107 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 71: +#line 1108 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 72: +#line 1112 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 73: +#line 1113 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 74: +#line 1114 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 75: +#line 1118 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::DefaultVisibility; ; + break;} +case 76: +#line 1119 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::HiddenVisibility; ; + break;} +case 77: +#line 1123 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 78: +#line 1124 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 79: +#line 1125 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 80: +#line 1129 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 81: +#line 1130 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 82: +#line 1131 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 83: +#line 1132 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 84: +#line 1133 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 85: +#line 1136 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 86: +#line 1137 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 87: +#line 1138 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Fast; ; + break;} +case 88: +#line 1139 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Cold; ; + break;} +case 89: +#line 1140 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_StdCall; ; + break;} +case 90: +#line 1141 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_FastCall; ; + break;} +case 91: +#line 1142 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) GEN_ERROR("Calling conv too large"); - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); + yyval.UIntVal = yyvsp[0].UInt64Val; CHECK_FOR_ERROR - ;} - break; - - case 93: -#line 1149 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::ZExtAttribute; ;} - break; - - case 94: -#line 1150 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::SExtAttribute; ;} - break; - - case 95: -#line 1151 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::InRegAttribute; ;} - break; - - case 96: -#line 1152 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::StructRetAttribute; ;} - break; - - case 97: -#line 1155 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} - break; - - case 98: -#line 1156 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs)); - ;} - break; - - case 99: -#line 1161 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoReturnAttribute; ;} - break; - - case 101: -#line 1165 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = FunctionType::NoAttributeSet; ;} - break; - - case 102: -#line 1166 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = FunctionType::ParameterAttributes((yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs)); - ;} - break; - - case 103: -#line 1173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 104: -#line 1174 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + ; + break;} +case 92: +#line 1149 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::ZExtAttribute; ; + break;} +case 93: +#line 1150 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::SExtAttribute; ; + break;} +case 94: +#line 1151 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::InRegAttribute; ; + break;} +case 95: +#line 1152 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::StructRetAttribute; ; + break;} +case 96: +#line 1155 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::NoAttributeSet; ; + break;} +case 97: +#line 1156 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = FunctionType::ParameterAttributes(yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs); + ; + break;} +case 98: +#line 1161 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::NoReturnAttribute; ; + break;} +case 100: +#line 1165 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = FunctionType::NoAttributeSet; ; + break;} +case 101: +#line 1166 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = FunctionType::ParameterAttributes(yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs); + ; + break;} +case 102: +#line 1173 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 103: +#line 1174 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -;} - break; - - case 105: -#line 1180 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 106: -#line 1181 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) +; + break;} +case 104: +#line 1180 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 105: +#line 1181 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two"); CHECK_FOR_ERROR -;} - break; - - case 107: -#line 1189 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i) - if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\') +; + break;} +case 106: +#line 1189 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) + if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') GEN_ERROR("Invalid character in section name"); - (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); + yyval.StrVal = yyvsp[0].StrVal; CHECK_FOR_ERROR -;} - break; - - case 108: -#line 1197 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 109: -#line 1198 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} - break; - - case 110: -#line 1203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 111: -#line 1204 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 112: -#line 1205 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - CurGV->setSection((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); +; + break;} +case 107: +#line 1197 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 108: +#line 1198 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = yyvsp[0].StrVal; ; + break;} +case 109: +#line 1203 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 110: +#line 1204 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 111: +#line 1205 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurGV->setSection(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 113: -#line 1210 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) + ; + break;} +case 112: +#line 1210 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) GEN_ERROR("Alignment must be a power of two"); - CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); + CurGV->setAlignment(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 118: -#line 1226 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); + ; + break;} +case 117: +#line 1226 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ;} - break; - - case 119: -#line 1230 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); + ; + break;} +case 118: +#line 1230 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); CHECK_FOR_ERROR - ;} - break; - - case 120: -#line 1234 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Pointer type? - if (*(yyvsp[(1) - (2)].TypeVal) == Type::LabelTy) + ; + break;} +case 119: +#line 1234 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Pointer type? + if (*yyvsp[-1].TypeVal == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (2)].TypeVal)))); - delete (yyvsp[(1) - (2)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 121: -#line 1241 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Named types are also simple types... - const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - (yyval.TypeVal) = new PATypeHolder(tmp); - ;} - break; - - case 122: -#line 1246 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Type UpReference - if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); + ; + break;} +case 120: +#line 1241 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Named types are also simple types... + const Type* tmp = getTypeVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TypeVal = new PATypeHolder(tmp); + ; + break;} +case 121: +#line 1246 "/Users/sabre/cvs/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 - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... - (yyval.TypeVal) = new PATypeHolder(OT); + UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... + yyval.TypeVal = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); CHECK_FOR_ERROR - ;} - break; - - case 123: -#line 1254 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 122: +#line 1254 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; std::vector Attrs; - Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) { + Attrs.push_back(yyvsp[0].ParamAttrs); + for (TypeWithAttrsList::iterator I=yyvsp[-2].TypeWithAttrsList->begin(), E=yyvsp[-2].TypeWithAttrsList->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -3704,21 +2785,20 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[(1) - (5)].TypeVal), Params, isVarArg, Attrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list - delete (yyvsp[(1) - (5)].TypeVal); // Delete the return type handle - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 124: -#line 1272 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + FunctionType *FT = FunctionType::get(*yyvsp[-4].TypeVal, Params, isVarArg, Attrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + delete yyvsp[-4].TypeVal; // Delete the return type handle + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 123: +#line 1272 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Params; std::vector Attrs; - Attrs.push_back((yyvsp[(5) - (5)].ParamAttrs)); - for (TypeWithAttrsList::iterator I=(yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E=(yyvsp[(3) - (5)].TypeWithAttrsList)->end(); I != E; ++I) { + Attrs.push_back(yyvsp[0].ParamAttrs); + for (TypeWithAttrsList::iterator I=yyvsp[-2].TypeWithAttrsList->begin(), E=yyvsp[-2].TypeWithAttrsList->end(); I != E; ++I) { Params.push_back(I->Ty->get()); if (I->Ty->get() != Type::VoidTy) Attrs.push_back(I->Attrs); @@ -3726,303 +2806,282 @@ bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg, Attrs); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 125: -#line 1290 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Sized array type? - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(ArrayType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 126: -#line 1295 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Packed array type? - const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal)->get(); - if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) + FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg, Attrs); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 124: +#line 1290 "/Users/sabre/cvs/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; + CHECK_FOR_ERROR + ; + break;} +case 125: +#line 1295 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Packed array type? + const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); + if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a PackedType must be primitive"); - if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) + if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) GEN_ERROR("Vector length should be a power of 2"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PackedType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 127: -#line 1307 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Structure type? + ; + break;} +case 126: +#line 1307 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), - E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-1].TypeList->begin(), + E = yyvsp[-1].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - delete (yyvsp[(2) - (3)].TypeList); - CHECK_FOR_ERROR - ;} - break; - - case 128: -#line 1317 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete yyvsp[-1].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 129: -#line 1321 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 127: +#line 1317 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ; + break;} +case 128: +#line 1321 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::vector Elements; - for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), - E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-2].TypeList->begin(), + E = yyvsp[-2].TypeList->end(); I != E; ++I) Elements.push_back(*I); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - delete (yyvsp[(3) - (5)].TypeList); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + delete yyvsp[-2].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 130: -#line 1331 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); - CHECK_FOR_ERROR - ;} - break; - - case 131: -#line 1338 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); - (yyval.TypeWithAttrs).Attrs = (yyvsp[(2) - (2)].ParamAttrs); - ;} - break; - - case 132: -#line 1345 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 129: +#line 1331 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ; + break;} +case 130: +#line 1338 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; + yyval.TypeWithAttrs.Attrs = yyvsp[0].ParamAttrs; + ; + break;} +case 131: +#line 1345 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription()); - if (!(*(yyvsp[(1) - (1)].TypeVal))->isFirstClassType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + if (!(*yyvsp[0].TypeVal)->isFirstClassType()) GEN_ERROR("LLVM functions cannot return aggregate types"); - (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); - ;} - break; - - case 133: -#line 1352 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); - ;} - break; - - case 134: -#line 1357 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); + yyval.TypeVal = yyvsp[0].TypeVal; + ; + break;} +case 132: +#line 1352 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(Type::VoidTy); + ; + break;} +case 133: +#line 1357 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); + yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 135: -#line 1362 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); + ; + break;} +case 134: +#line 1362 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 137: -#line 1370 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); + ; + break;} +case 136: +#line 1370 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 138: -#line 1377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList; + ; + break;} +case 137: +#line 1377 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = FunctionType::NoAttributeSet; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 139: -#line 1384 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + ; + break;} +case 138: +#line 1384 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); CHECK_FOR_ERROR - ;} - break; - - case 140: -#line 1392 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); delete (yyvsp[(1) - (1)].TypeVal); + ; + break;} +case 139: +#line 1392 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeList = new std::list(); + yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 141: -#line 1397 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); delete (yyvsp[(3) - (3)].TypeVal); + ; + break;} +case 140: +#line 1397 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 142: -#line 1408 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + ; + break;} +case 141: +#line 1408 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized array initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 143: -#line 1436 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 142: +#line 1436 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + yyval.ConstVal = ConstantArray::get(ATy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 144: -#line 1452 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 143: +#line 1452 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); if (ATy == 0) GEN_ERROR("Cannot make array constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) GEN_ERROR("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + + itostr((int)(EndStr-yyvsp[0].StrVal)) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned char *C = (unsigned char *)(yyvsp[(3) - (3)].StrVal); + for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal; C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); } else { - free((yyvsp[(3) - (3)].StrVal)); + free(yyvsp[0].StrVal); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - free((yyvsp[(3) - (3)].StrVal)); - (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[(1) - (3)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 145: -#line 1481 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + free(yyvsp[0].StrVal); + yyval.ConstVal = ConstantArray::get(ATy, Vals); + delete yyvsp[-2].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 144: +#line 1481 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const PackedType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make packed constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) GEN_ERROR("Type mismatch: constant sized packed initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ - (*(yyvsp[(3) - (4)].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + yyval.ConstVal = ConstantPacked::get(PTy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 146: -#line 1509 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + ; + break;} +case 145: +#line 1509 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (4)].TypeVal))->getDescription() + "'"); + (*yyvsp[-3].TypeVal)->getDescription() + "'"); - if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(3) - (4)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4032,21 +3091,20 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 147: -#line 1534 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 146: +#line 1534 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (3)].TypeVal))->getDescription() + "'"); + (*yyvsp[-2].TypeVal)->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -4055,26 +3113,25 @@ if (STy->isPacked()) GEN_ERROR("Unpacked Initializer to packed type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (3)].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 148: -#line 1553 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); + ; + break;} +case 147: +#line 1553 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (6)].TypeVal))->getDescription() + "'"); + (*yyvsp[-5].TypeVal)->getDescription() + "'"); - if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) + if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) GEN_ERROR("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! - for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) - if ((*(yyvsp[(4) - (6)].ConstVector))[i]->getType() != STy->getElementType(i)) + for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) + if ((*yyvsp[-2].ConstVector)[i]->getType() != STy->getElementType(i)) GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + @@ -4084,21 +3141,20 @@ if (!STy->isPacked()) GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[(4) - (6)].ConstVector)); - delete (yyvsp[(1) - (6)].TypeVal); delete (yyvsp[(4) - (6)].ConstVector); + yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-2].ConstVector); + delete yyvsp[-5].TypeVal; delete yyvsp[-2].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 149: -#line 1578 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 148: +#line 1578 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (5)].TypeVal))->getDescription()); - const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + const StructType *STy = dyn_cast(yyvsp[-4].TypeVal->get()); if (STy == 0) GEN_ERROR("Cannot make struct constant with type: '" + - (*(yyvsp[(1) - (5)].TypeVal))->getDescription() + "'"); + (*yyvsp[-4].TypeVal)->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) GEN_ERROR("Illegal number of initializers for structure type"); @@ -4107,45 +3163,42 @@ if (!STy->isPacked()) GEN_ERROR("Packed Initializer to unpacked type '" + STy->getDescription() + "'"); - (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); - delete (yyvsp[(1) - (5)].TypeVal); + yyval.ConstVal = ConstantStruct::get(STy, std::vector()); + delete yyvsp[-4].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 150: -#line 1597 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 149: +#line 1597 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); if (PTy == 0) GEN_ERROR("Cannot make null pointer constant with type: '" + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + "'"); + (*yyvsp[-1].TypeVal)->getDescription() + "'"); - (yyval.ConstVal) = ConstantPointerNull::get(PTy); - delete (yyvsp[(1) - (2)].TypeVal); + yyval.ConstVal = ConstantPointerNull::get(PTy); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 151: -#line 1609 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 150: +#line 1609 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ConstVal) = UndefValue::get((yyvsp[(1) - (2)].TypeVal)->get()); - delete (yyvsp[(1) - (2)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 152: -#line 1616 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 151: +#line 1616 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); if (Ty == 0) GEN_ERROR("Global const reference must be a pointer type"); @@ -4159,7 +3212,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getValNonImprovising(Ty, (yyvsp[(2) - (2)].ValIDVal)); + Value *V = getValNonImprovising(Ty, yyvsp[0].ValIDVal); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -4174,16 +3227,16 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); + CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - (yyvsp[(2) - (2)].ValIDVal).destroy(); + yyvsp[0].ValIDVal.destroy(); } else { std::string Name; - if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) - Name = (yyvsp[(2) - (2)].ValIDVal).Name; - else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) + if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) + Name = yyvsp[0].ValIDVal.Name; + else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -4199,300 +3252,271 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); V = GV; } } - (yyval.ConstVal) = cast(V); - delete (yyvsp[(1) - (2)].TypeVal); // Free the type handle + yyval.ConstVal = cast(V); + delete yyvsp[-1].TypeVal; // Free the type handle CHECK_FOR_ERROR - ;} - break; - - case 153: -#line 1682 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 152: +#line 1682 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - if ((yyvsp[(1) - (2)].TypeVal)->get() != (yyvsp[(2) - (2)].ConstVal)->getType()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) GEN_ERROR("Mismatched types for constant expression: " + - (*(yyvsp[(1) - (2)].TypeVal))->getDescription() + " and " + (yyvsp[(2) - (2)].ConstVal)->getType()->getDescription()); - (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); - delete (yyvsp[(1) - (2)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 154: -#line 1692 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + (*yyvsp[-1].TypeVal)->getDescription() + " and " + yyvsp[0].ConstVal->getType()->getDescription()); + yyval.ConstVal = yyvsp[0].ConstVal; + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 153: +#line 1692 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - const Type *Ty = (yyvsp[(1) - (2)].TypeVal)->get(); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const Type *Ty = yyvsp[-1].TypeVal->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) GEN_ERROR("Cannot create a null initialized value of this type"); - (yyval.ConstVal) = Constant::getNullValue(Ty); - delete (yyvsp[(1) - (2)].TypeVal); + yyval.ConstVal = Constant::getNullValue(Ty); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 155: -#line 1702 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) + ; + break;} +case 154: +#line 1702 "/Users/sabre/cvs/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"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val)); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 156: -#line 1708 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) + ; + break;} +case 155: +#line 1708 "/Users/sabre/cvs/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"); - (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val)); - CHECK_FOR_ERROR - ;} - break; - - case 157: -#line 1714 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getTrue(); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 158: -#line 1719 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Boolean constants - assert(cast((yyvsp[(1) - (2)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - (yyval.ConstVal) = ConstantInt::getFalse(); - CHECK_FOR_ERROR - ;} - break; - - case 159: -#line 1724 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal))) + ; + break;} +case 156: +#line 1714 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getTrue(); + CHECK_FOR_ERROR + ; + break;} +case 157: +#line 1719 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Boolean constants + assert(cast(yyvsp[-1].PrimType)->getBitWidth() == 1 && "Not Bool?"); + yyval.ConstVal = ConstantInt::getFalse(); + CHECK_FOR_ERROR + ; + break;} +case 158: +#line 1724 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Float & Double constants + if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) GEN_ERROR("Floating point constant invalid for type"); - (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].FPVal)); + yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); CHECK_FOR_ERROR - ;} - break; - - case 160: -#line 1732 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 159: +#line 1732 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); - Constant *Val = (yyvsp[(3) - (6)].ConstVal); - const Type *DestTy = (yyvsp[(5) - (6)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + Constant *Val = yyvsp[-3].ConstVal; + const Type *DestTy = yyvsp[-1].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); - delete (yyvsp[(5) - (6)].TypeVal); - ;} - break; - - case 161: -#line 1744 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[(3) - (5)].ConstVal)->getType())) + yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); + delete yyvsp[-1].TypeVal; + ; + break;} +case 160: +#line 1744 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[-2].ConstVal->getType())) GEN_ERROR("GetElementPtr requires a pointer operand"); const Type *IdxTy = - GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), &(*(yyvsp[(4) - (5)].ValueList))[0], (yyvsp[(4) - (5)].ValueList)->size(), + GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), &(*yyvsp[-1].ValueList)[0], yyvsp[-1].ValueList->size(), true); if (!IdxTy) GEN_ERROR("Index list invalid for constant getelementptr"); SmallVector IdxVec; - for (unsigned i = 0, e = (yyvsp[(4) - (5)].ValueList)->size(); i != e; ++i) - if (Constant *C = dyn_cast((*(yyvsp[(4) - (5)].ValueList))[i])) + for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e; ++i) + if (Constant *C = dyn_cast((*yyvsp[-1].ValueList)[i])) IdxVec.push_back(C); else GEN_ERROR("Indices to constant getelementptr must be constants"); - delete (yyvsp[(4) - (5)].ValueList); - - (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size()); - CHECK_FOR_ERROR - ;} - break; + delete yyvsp[-1].ValueList; - case 162: -#line 1766 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) + yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); + CHECK_FOR_ERROR + ; + break;} +case 161: +#line 1766 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) GEN_ERROR("Select condition must be of boolean type"); - if ((yyvsp[(5) - (8)].ConstVal)->getType() != (yyvsp[(7) - (8)].ConstVal)->getType()) + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Select operand types must match"); - (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 163: -#line 1774 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + ; + break;} +case 162: +#line 1774 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Binary operator types must match"); CHECK_FOR_ERROR; - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); - ;} - break; - - case 164: -#line 1780 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 163: +#line 1780 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Logical operator types must match"); - if (!(yyvsp[(3) - (6)].ConstVal)->getType()->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (6)].BinaryOpVal)) || !isa((yyvsp[(3) - (6)].ConstVal)->getType()) || - !cast((yyvsp[(3) - (6)].ConstVal)->getType())->getElementType()->isInteger()) + if (!yyvsp[-3].ConstVal->getType()->isInteger()) { + if (Instruction::isShift(yyvsp[-5].BinaryOpVal) || !isa(yyvsp[-3].ConstVal->getType()) || + !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - (yyval.ConstVal) = ConstantExpr::get((yyvsp[(1) - (6)].BinaryOpVal), (yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 165: -#line 1791 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + ; + break;} +case 164: +#line 1791 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("icmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getICmp((yyvsp[(2) - (7)].IPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); - ;} - break; - - case 166: -#line 1796 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + yyval.ConstVal = ConstantExpr::getICmp(yyvsp[-5].IPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 165: +#line 1796 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("fcmp operand types must match"); - (yyval.ConstVal) = ConstantExpr::getFCmp((yyvsp[(2) - (7)].FPredicate), (yyvsp[(4) - (7)].ConstVal), (yyvsp[(6) - (7)].ConstVal)); - ;} - break; - - case 167: -#line 1801 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal))) + yyval.ConstVal = ConstantExpr::getFCmp(yyvsp[-5].FPredicate, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + ; + break;} +case 166: +#line 1801 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid extractelement operands"); - (yyval.ConstVal) = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal), (yyvsp[(5) - (6)].ConstVal)); + yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 168: -#line 1807 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + ; + break;} +case 167: +#line 1807 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid insertelement operands"); - (yyval.ConstVal) = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 169: -#line 1813 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + ; + break;} +case 168: +#line 1813 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) GEN_ERROR("Invalid shufflevector operands"); - (yyval.ConstVal) = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal)); + yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 170: -#line 1822 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); + ; + break;} +case 169: +#line 1822 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 171: -#line 1826 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); + ; + break;} +case 170: +#line 1826 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ConstVector = new std::vector(); + yyval.ConstVector->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 172: -#line 1834 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 173: -#line 1834 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 174: -#line 1845 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 171: +#line 1834 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 172: +#line 1834 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 173: +#line 1845 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 175: -#line 1850 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 174: +#line 1850 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 178: -#line 1863 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = false; ;} - break; - - case 179: -#line 1863 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 177: +#line 1863 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = false; ; + break;} +case 178: +#line 1863 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 180: -#line 1867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = true; ;} - break; - - case 181: -#line 1867 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 179: +#line 1867 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = true; ; + break;} +case 180: +#line 1867 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 182: -#line 1870 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 181: +#line 1870 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 183: -#line 1873 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 182: +#line 1873 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; @@ -4503,14 +3527,13 @@ } } CHECK_FOR_ERROR - ;} - break; - - case 184: -#line 1885 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 183: +#line 1885 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (3)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -4520,248 +3543,226 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), *(yyvsp[(3) - (3)].TypeVal)); + ResolveTypeTo(yyvsp[-2].StrVal, *yyvsp[0].TypeVal); - if (!setTypeName(*(yyvsp[(3) - (3)].TypeVal), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*(yyvsp[(3) - (3)].TypeVal)); + CurModule.Types.push_back(*yyvsp[0].TypeVal); } - delete (yyvsp[(3) - (3)].TypeVal); + delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 185: -#line 1909 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); + ; + break;} +case 184: +#line 1909 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); - if (!setTypeName((yyvsp[(3) - (3)].PrimType), (yyvsp[(1) - (3)].StrVal)) && !(yyvsp[(1) - (3)].StrVal)) { + if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { CHECK_FOR_ERROR // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back((yyvsp[(3) - (3)].PrimType)); + CurModule.Types.push_back(yyvsp[0].PrimType); } CHECK_FOR_ERROR - ;} - break; - - case 186: -#line 1920 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 185: +#line 1920 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ /* "Externally Visible" Linkage */ - if ((yyvsp[(4) - (4)].ConstVal) == 0) + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (4)].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[(2) - (4)].Visibility), (yyvsp[(3) - (4)].BoolVal), (yyvsp[(4) - (4)].ConstVal)->getType(), (yyvsp[(4) - (4)].ConstVal)); + CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, + yyvsp[-2].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 187: -#line 1927 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 186: +#line 1927 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 188: -#line 1930 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(5) - (5)].ConstVal) == 0) + ; + break;} +case 187: +#line 1930 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal)->getType(), (yyvsp[(5) - (5)].ConstVal)); + CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, yyvsp[-3].Linkage, yyvsp[-2].Visibility, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 189: -#line 1935 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 188: +#line 1935 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 190: -#line 1938 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 189: +#line 1938 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (5)].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[(1) - (5)].StrVal), (yyvsp[(2) - (5)].Linkage), (yyvsp[(3) - (5)].Visibility), (yyvsp[(4) - (5)].BoolVal), *(yyvsp[(5) - (5)].TypeVal), 0); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + CurGV = ParseGlobalVariable(yyvsp[-4].StrVal, yyvsp[-3].Linkage, yyvsp[-2].Visibility, yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0); CHECK_FOR_ERROR - delete (yyvsp[(5) - (5)].TypeVal); - ;} - break; - - case 191: -#line 1944 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[0].TypeVal; + ; + break;} +case 190: +#line 1944 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; CHECK_FOR_ERROR - ;} - break; - - case 192: -#line 1948 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - CHECK_FOR_ERROR - ;} - break; - - case 193: -#line 1951 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 191: +#line 1948 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CHECK_FOR_ERROR + ; + break;} +case 192: +#line 1951 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 194: -#line 1957 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 193: +#line 1957 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); - std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); - free((yyvsp[(1) - (1)].StrVal)); + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string NewAsm(yyvsp[0].StrVal, EndStr); + free(yyvsp[0].StrVal); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); CHECK_FOR_ERROR -;} - break; - - case 195: -#line 1970 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); - ;} - break; - - case 196: -#line 1974 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); - ;} - break; - - case 198: -#line 1981 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); +; + break;} +case 194: +#line 1970 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 195: +#line 1974 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 197: +#line 1981 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 199: -#line 1986 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); + ; + break;} +case 198: +#line 1986 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 200: -#line 1991 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 199: +#line 1991 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 201: -#line 2000 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 200: +#line 2000 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (*(yyvsp[(3) - (5)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[(4) - (5)].ParamAttrs); E.Ty = (yyvsp[(3) - (5)].TypeVal); E.Name = (yyvsp[(5) - (5)].StrVal); - (yyval.ArgList) = (yyvsp[(1) - (5)].ArgList); - (yyvsp[(1) - (5)].ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 202: -#line 2010 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = yyvsp[-4].ArgList; + yyvsp[-4].ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 201: +#line 2010 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); - if (*(yyvsp[(1) - (3)].TypeVal) == Type::VoidTy) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (*yyvsp[-2].TypeVal == Type::VoidTy) GEN_ERROR("void typed arguments are invalid"); - ArgListEntry E; E.Attrs = (yyvsp[(2) - (3)].ParamAttrs); E.Ty = (yyvsp[(1) - (3)].TypeVal); E.Name = (yyvsp[(3) - (3)].StrVal); - (yyval.ArgList) = new ArgListType; - (yyval.ArgList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 203: -#line 2021 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); + ArgListEntry E; E.Attrs = yyvsp[-1].ParamAttrs; E.Ty = yyvsp[-2].TypeVal; E.Name = yyvsp[0].StrVal; + yyval.ArgList = new ArgListType; + yyval.ArgList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 202: +#line 2021 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[0].ArgList; CHECK_FOR_ERROR - ;} - break; - - case 204: -#line 2025 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); + ; + break;} +case 203: +#line 2025 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[-2].ArgList; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = FunctionType::NoAttributeSet; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 205: -#line 2034 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = new ArgListType; + ; + break;} +case 204: +#line 2034 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = FunctionType::NoAttributeSet; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 206: -#line 2043 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = 0; + ; + break;} +case 205: +#line 2043 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = 0; CHECK_FOR_ERROR - ;} - break; - - case 207: -#line 2049 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - UnEscapeLexed((yyvsp[(3) - (9)].StrVal)); - std::string FunctionName((yyvsp[(3) - (9)].StrVal)); - free((yyvsp[(3) - (9)].StrVal)); // Free strdup'd memory! + ; + break;} +case 206: +#line 2049 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + UnEscapeLexed(yyvsp[-6].StrVal); + std::string FunctionName(yyvsp[-6].StrVal); + free(yyvsp[-6].StrVal); // Free strdup'd memory! // Check the function result for abstractness if this is a define. We should // have no abstract types at this point - if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (9)].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (9)].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-7].TypeVal)) + GEN_ERROR("Reference to abstract result: "+ yyvsp[-7].TypeVal->get()->getDescription()); std::vector ParamTypeList; std::vector ParamAttrs; - ParamAttrs.push_back((yyvsp[(7) - (9)].ParamAttrs)); - if ((yyvsp[(5) - (9)].ArgList)) { // If there are arguments... - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); I != (yyvsp[(5) - (9)].ArgList)->end(); ++I) { + ParamAttrs.push_back(yyvsp[-2].ParamAttrs); + if (yyvsp[-4].ArgList) { // If there are arguments... + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); I != yyvsp[-4].ArgList->end(); ++I) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -4774,10 +3775,10 @@ bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (9)].TypeVal), ParamTypeList, isVarArg, + FunctionType *FT = FunctionType::get(*yyvsp[-7].TypeVal, ParamTypeList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[(2) - (9)].TypeVal); + delete yyvsp[-7].TypeVal; ValID ID; if (!FunctionName.empty()) { @@ -4826,26 +3827,26 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[(1) - (9)].UIntVal)); - Fn->setAlignment((yyvsp[(9) - (9)].UIntVal)); - if ((yyvsp[(8) - (9)].StrVal)) { - Fn->setSection((yyvsp[(8) - (9)].StrVal)); - free((yyvsp[(8) - (9)].StrVal)); + Fn->setCallingConv(yyvsp[-8].UIntVal); + Fn->setAlignment(yyvsp[0].UIntVal); + if (yyvsp[-1].StrVal) { + Fn->setSection(yyvsp[-1].StrVal); + free(yyvsp[-1].StrVal); } // Add all of the arguments we parsed to the function... - if ((yyvsp[(5) - (9)].ArgList)) { // Is null if empty... + if (yyvsp[-4].ArgList) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[(5) - (9)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (9)].ArgList)->back().Name == 0 && + assert(yyvsp[-4].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-4].ArgList->back().Name == 0 && "Not a varargs marker!"); - delete (yyvsp[(5) - (9)].ArgList)->back().Ty; - (yyvsp[(5) - (9)].ArgList)->pop_back(); // Delete the last entry + delete yyvsp[-4].ArgList->back().Ty; + yyvsp[-4].ArgList->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); unsigned Idx = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (9)].ArgList)->begin(); - I != (yyvsp[(5) - (9)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = yyvsp[-4].ArgList->begin(); + I != yyvsp[-4].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4853,128 +3854,114 @@ Idx++; } - delete (yyvsp[(5) - (9)].ArgList); // We're now done with the argument list + delete yyvsp[-4].ArgList; // We're now done with the argument list } CHECK_FOR_ERROR -;} - break; - - case 210: -#line 2162 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 209: +#line 2162 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (4)].Linkage)); - (yyval.FunctionVal)->setVisibility((yyvsp[(2) - (4)].Visibility)); -;} - break; - - case 213: -#line 2173 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage); + yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility); +; + break;} +case 212: +#line 2173 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR -;} - break; - - case 214: -#line 2178 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 213: +#line 2178 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); + CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); + yyval.FunctionVal = CurFun.CurrentFunction; CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 215: -#line 2190 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; - CHECK_FOR_ERROR - ;} - break; - - case 216: -#line 2194 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; - CHECK_FOR_ERROR - ;} - break; - - case 217: -#line 2199 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); - CHECK_FOR_ERROR - ;} - break; - - case 218: -#line 2203 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); + ; + break;} +case 214: +#line 2190 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 219: -#line 2207 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); + ; + break;} +case 215: +#line 2194 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 220: -#line 2211 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); + ; + break;} +case 216: +#line 2199 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A reference to a direct constant + yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); + CHECK_FOR_ERROR + ; + break;} +case 217: +#line 2203 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 221: -#line 2215 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); + ; + break;} +case 218: +#line 2207 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Perhaps it's an FP constant? + yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); + CHECK_FOR_ERROR + ; + break;} +case 219: +#line 2211 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ;} - break; - - case 222: -#line 2219 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createNull(); + ; + break;} +case 220: +#line 2215 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR - ;} - break; - - case 223: -#line 2223 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createUndef(); + ; + break;} +case 221: +#line 2219 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createNull(); CHECK_FOR_ERROR - ;} - break; - - case 224: -#line 2227 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // A vector zero constant. - (yyval.ValIDVal) = ValID::createZeroInit(); + ; + break;} +case 222: +#line 2223 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createUndef(); CHECK_FOR_ERROR - ;} - break; - - case 225: -#line 2231 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); - int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); + ; + break;} +case 223: +#line 2227 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A vector zero constant. + yyval.ValIDVal = ValID::createZeroInit(); + CHECK_FOR_ERROR + ; + break;} +case 224: +#line 2231 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized packed vector + const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); + int NumElements = yyvsp[-1].ConstVector->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -4986,130 +3973,118 @@ ); // Verify all elements are correct type! - for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { - if (ETy != (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()) + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + - (*(yyvsp[(2) - (3)].ConstVector))[i]->getType()->getDescription() + "'."); + (*yyvsp[-1].ConstVector)[i]->getType()->getDescription() + "'."); } - (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[(2) - (3)].ConstVector))); - delete PTy; delete (yyvsp[(2) - (3)].ConstVector); - CHECK_FOR_ERROR - ;} - break; - - case 226: -#line 2256 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); - CHECK_FOR_ERROR - ;} - break; - - case 227: -#line 2260 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); - std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); - End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); - std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); - free((yyvsp[(3) - (5)].StrVal)); - free((yyvsp[(5) - (5)].StrVal)); - CHECK_FOR_ERROR - ;} - break; - - case 228: -#line 2274 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); + yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, *yyvsp[-1].ConstVector)); + delete PTy; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 229: -#line 2278 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 230: -#line 2282 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName((yyvsp[(1) - (1)].StrVal)); + ; + break;} +case 225: +#line 2256 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 231: -#line 2286 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName((yyvsp[(1) - (1)].StrVal)); + ; + break;} +case 226: +#line 2260 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); + std::string AsmStr = std::string(yyvsp[-2].StrVal, End); + End = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string Constraints = std::string(yyvsp[0].StrVal, End); + yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); + free(yyvsp[-2].StrVal); + free(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 227: +#line 2274 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it an integer reference...? + yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); + CHECK_FOR_ERROR + ; + break;} +case 228: +#line 2278 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); CHECK_FOR_ERROR - ;} - break; - - case 234: -#line 2298 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 229: +#line 2282 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createLocalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 230: +#line 2286 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createGlobalName(yyvsp[0].StrVal); + CHECK_FOR_ERROR + ; + break;} +case 233: +#line 2298 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (2)].TypeVal))->getDescription()); - (yyval.ValueVal) = getVal(*(yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].ValIDVal)); - delete (yyvsp[(1) - (2)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 235: -#line 2307 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 236: -#line 2311 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 237: -#line 2320 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); - CHECK_FOR_ERROR - InsertValue((yyvsp[(3) - (3)].TermInstVal)); - (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); - InsertValue((yyvsp[(1) - (3)].BasicBlockVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 234: +#line 2307 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR - ;} - break; - - case 238: -#line 2330 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (CastInst *CI1 = dyn_cast((yyvsp[(2) - (2)].InstVal))) + ; + break;} +case 235: +#line 2311 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Do not allow functions with 0 basic blocks + yyval.FunctionVal = yyvsp[-1].FunctionVal; + CHECK_FOR_ERROR + ; + break;} +case 236: +#line 2320 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); + CHECK_FOR_ERROR + InsertValue(yyvsp[0].TermInstVal); + yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); + InsertValue(yyvsp[-2].BasicBlockVal); + yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 237: +#line 2330 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (CastInst *CI1 = dyn_cast(yyvsp[0].InstVal)) if (CastInst *CI2 = dyn_cast(CI1->getOperand(0))) if (CI2->getParent() == 0) - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back(CI2); - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); - CHECK_FOR_ERROR - ;} - break; - - case 239: -#line 2339 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BasicBlockVal) = getBBVal(ValID::createLocalID(CurFun.NextBBNum++), true); + yyvsp[-1].BasicBlockVal->getInstList().push_back(CI2); + yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); + yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 238: +#line 2339 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BasicBlockVal = getBBVal(ValID::createLocalID(CurFun.NextBBNum++), true); CHECK_FOR_ERROR // Make sure to move the basic block to the correct location in the @@ -5117,15 +4092,14 @@ // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); + BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); CHECK_FOR_ERROR - ;} - break; - - case 240: -#line 2351 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BasicBlockVal) = getBBVal(ValID::createLocalName((yyvsp[(1) - (1)].StrVal)), true); + ; + break;} +case 239: +#line 2351 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BasicBlockVal = getBBVal(ValID::createLocalName(yyvsp[0].StrVal), true); CHECK_FOR_ERROR // Make sure to move the basic block to the correct location in the @@ -5133,100 +4107,93 @@ // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); - CHECK_FOR_ERROR - ;} - break; - - case 241: -#line 2364 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); - CHECK_FOR_ERROR - ;} - break; - - case 242: -#line 2368 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Return with no result... - (yyval.TermInstVal) = new ReturnInst(); - CHECK_FOR_ERROR - ;} - break; - - case 243: -#line 2372 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); - CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBB); - ;} - break; - - case 244: -#line 2377 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); - CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); + BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); - CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ;} - break; - - case 245: -#line 2387 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); + ; + break;} +case 240: +#line 2364 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with a result... + yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); + CHECK_FOR_ERROR + ; + break;} +case 241: +#line 2368 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with no result... + yyval.TermInstVal = new ReturnInst(); + CHECK_FOR_ERROR + ; + break;} +case 242: +#line 2372 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Unconditional Branch... + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBB); + ; + break;} +case 243: +#line 2377 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + assert(cast(yyvsp[-7].PrimType)->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ; + break;} +case 244: +#line 2387 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); - (yyval.TermInstVal) = S; + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); + yyval.TermInstVal = S; - std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), - E = (yyvsp[(8) - (9)].JumpTable)->end(); + std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), + E = yyvsp[-1].JumpTable->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else GEN_ERROR("Switch case is constant, but not a simple integer"); } - delete (yyvsp[(8) - (9)].JumpTable); + delete yyvsp[-1].JumpTable; CHECK_FOR_ERROR - ;} - break; - - case 246: -#line 2406 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); + ; + break;} +case 245: +#line 2406 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); CHECK_FOR_ERROR SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); - (yyval.TermInstVal) = S; + yyval.TermInstVal = S; CHECK_FOR_ERROR - ;} - break; - - case 247: -#line 2416 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 246: +#line 2416 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (14)].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-11].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[(8) - (14)].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[(6) - (14)].ValueRefList)->begin(), E = (yyvsp[(6) - (14)].ValueRefList)->end(); I != E; ++I) { + ParamAttrs.push_back(yyvsp[-6].ParamAttrs); + for (ValueRefList::iterator I = yyvsp[-8].ValueRefList->begin(), E = yyvsp[-8].ValueRefList->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -5234,20 +4201,20 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[(4) - (14)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-10].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR - BasicBlock *Normal = getBBVal((yyvsp[(11) - (14)].ValIDVal)); + BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock *Except = getBBVal((yyvsp[(14) - (14)].ValIDVal)); + BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[(6) - (14)].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-8].ValueRefList->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 " @@ -5257,7 +4224,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (14)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (14)].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-8].ValueRefList->begin(), ArgE = yyvsp[-8].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5275,341 +4242,315 @@ } // Create the InvokeInst - InvokeInst *II = new InvokeInst(V, Normal, Except, Args); - II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); - (yyval.TermInstVal) = II; - delete (yyvsp[(6) - (14)].ValueRefList); - CHECK_FOR_ERROR - ;} - break; - - case 248: -#line 2482 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnwindInst(); + InvokeInst *II = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); + II->setCallingConv(yyvsp[-12].UIntVal); + yyval.TermInstVal = II; + delete yyvsp[-8].ValueRefList; + CHECK_FOR_ERROR + ; + break;} +case 247: +#line 2482 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnwindInst(); CHECK_FOR_ERROR - ;} - break; - - case 249: -#line 2486 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnreachableInst(); + ; + break;} +case 248: +#line 2486 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnreachableInst(); CHECK_FOR_ERROR - ;} - break; - - case 250: -#line 2493 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); - Constant *V = cast(getValNonImprovising((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); + ; + break;} +case 249: +#line 2493 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = yyvsp[-5].JumpTable; + Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 251: -#line 2504 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getValNonImprovising((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 250: +#line 2504 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = new std::vector >(); + Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); CHECK_FOR_ERROR if (V == 0) GEN_ERROR("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 252: -#line 2517 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 251: +#line 2517 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is this definition named?? if so, assign the name... - setValueName((yyvsp[(2) - (2)].InstVal), (yyvsp[(1) - (2)].StrVal)); + setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - InsertValue((yyvsp[(2) - (2)].InstVal)); - (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); + InsertValue(yyvsp[0].InstVal); + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 253: -#line 2527 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { // Used for PHI nodes + ; + break;} +case 252: +#line 2527 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Used for PHI nodes if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (6)].TypeVal))->getDescription()); - (yyval.PHIList) = new std::list >(); - Value* tmpVal = getVal(*(yyvsp[(1) - (6)].TypeVal), (yyvsp[(3) - (6)].ValIDVal)); - CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); - CHECK_FOR_ERROR - (yyval.PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[(1) - (6)].TypeVal); - ;} - break; - - case 254: -#line 2538 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); - Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList)->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-5].TypeVal)->getDescription()); + yyval.PHIList = new std::list >(); + Value* tmpVal = getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal); + CHECK_FOR_ERROR + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + CHECK_FOR_ERROR + yyval.PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + delete yyvsp[-5].TypeVal; + ; + break;} +case 253: +#line 2538 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.PHIList = yyvsp[-6].PHIList; + Value* tmpVal = getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); - ;} - break; - - case 255: -#line 2548 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + ; + break;} +case 254: +#line 2548 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (3)].TypeVal))->getDescription()); + 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[(3) - (3)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (3)].TypeVal)->get(), (yyvsp[(2) - (3)].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - ;} - break; - - case 256: -#line 2556 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + 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); + ; + break;} +case 255: +#line 2556 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - (yyval.ValueRefList) = (yyvsp[(1) - (5)].ValueRefList); - ValueRefListEntry E; E.Attrs = (yyvsp[(5) - (5)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (5)].TypeVal)->get(), (yyvsp[(4) - (5)].ValIDVal)); - (yyval.ValueRefList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 257: -#line 2564 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueRefList) = new ValueRefList(); ;} - break; - - case 258: -#line 2567 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueList) = new std::vector(); ;} - break; - - case 259: -#line 2568 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); - (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); + 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); + CHECK_FOR_ERROR + ; + break;} +case 256: +#line 2564 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueRefList = new ValueRefList(); ; + break;} +case 257: +#line 2567 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = new std::vector(); ; + break;} +case 258: +#line 2568 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValueList = yyvsp[-2].ValueList; + yyval.ValueList->push_back(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 260: -#line 2575 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 259: +#line 2575 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 261: -#line 2579 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 260: +#line 2579 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 262: -#line 2584 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 261: +#line 2584 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger() && !(*(yyvsp[(2) - (5)].TypeVal))->isFloatingPoint() && - !isa((*(yyvsp[(2) - (5)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && + !isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands"); - if (isa((*(yyvsp[(2) - (5)].TypeVal)).get()) && - ((yyvsp[(1) - (5)].BinaryOpVal) == Instruction::URem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::SRem || - (yyvsp[(1) - (5)].BinaryOpVal) == Instruction::FRem)) + if (isa((*yyvsp[-3].TypeVal).get()) && + (yyvsp[-4].BinaryOpVal == Instruction::URem || + yyvsp[-4].BinaryOpVal == Instruction::SRem || + yyvsp[-4].BinaryOpVal == Instruction::FRem)) GEN_ERROR("Remainder not supported on packed types"); - Value* val1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* val1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* val2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* val2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), val1, val2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, val1, val2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[(2) - (5)].TypeVal); - ;} - break; - - case 263: -#line 2605 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 262: +#line 2605 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (5)].TypeVal))->getDescription()); - if (!(*(yyvsp[(2) - (5)].TypeVal))->isInteger()) { - if (Instruction::isShift((yyvsp[(1) - (5)].BinaryOpVal)) || !isa((yyvsp[(2) - (5)].TypeVal)->get()) || - !cast((yyvsp[(2) - (5)].TypeVal)->get())->getElementType()->isInteger()) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (!(*yyvsp[-3].TypeVal)->isInteger()) { + if (Instruction::isShift(yyvsp[-4].BinaryOpVal) || !isa(yyvsp[-3].TypeVal->get()) || + !cast(yyvsp[-3].TypeVal->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands"); } - Value* tmpVal1 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(3) - (5)].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(2) - (5)].TypeVal), (yyvsp[(5) - (5)].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = BinaryOperator::create((yyvsp[(1) - (5)].BinaryOpVal), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("binary operator returned null"); - delete (yyvsp[(2) - (5)].TypeVal); - ;} - break; - - case 264: -#line 2622 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 263: +#line 2622 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); - if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Packed types not supported by icmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].IPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].IPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("icmp operator returned null"); - ;} - break; - - case 265: -#line 2635 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 264: +#line 2635 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); - if (isa((*(yyvsp[(3) - (6)].TypeVal)).get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + if (isa((*yyvsp[-3].TypeVal).get())) GEN_ERROR("Packed types not supported by fcmp instruction"); - Value* tmpVal1 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(4) - (6)].ValIDVal)); + Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); CHECK_FOR_ERROR - Value* tmpVal2 = getVal(*(yyvsp[(3) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal2 = getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = CmpInst::create((yyvsp[(1) - (6)].OtherOpVal), (yyvsp[(2) - (6)].FPredicate), tmpVal1, tmpVal2); - if ((yyval.InstVal) == 0) + yyval.InstVal = CmpInst::create(yyvsp[-5].OtherOpVal, yyvsp[-4].FPredicate, tmpVal1, tmpVal2); + if (yyval.InstVal == 0) GEN_ERROR("fcmp operator returned null"); - ;} - break; - - case 266: -#line 2648 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 265: +#line 2648 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - Value* Val = (yyvsp[(2) - (4)].ValueVal); - const Type* DestTy = (yyvsp[(4) - (4)].TypeVal)->get(); - if (!CastInst::castIsValid((yyvsp[(1) - (4)].CastOpVal), Val, DestTy)) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + Value* Val = yyvsp[-2].ValueVal; + const Type* DestTy = yyvsp[0].TypeVal->get(); + if (!CastInst::castIsValid(yyvsp[-3].CastOpVal, Val, DestTy)) GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - (yyval.InstVal) = CastInst::create((yyvsp[(1) - (4)].CastOpVal), Val, DestTy); - delete (yyvsp[(4) - (4)].TypeVal); - ;} - break; - - case 267: -#line 2660 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(2) - (6)].ValueVal)->getType() != Type::Int1Ty) + yyval.InstVal = CastInst::create(yyvsp[-3].CastOpVal, Val, DestTy); + delete yyvsp[0].TypeVal; + ; + break;} +case 266: +#line 2660 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-4].ValueVal->getType() != Type::Int1Ty) GEN_ERROR("select condition must be boolean"); - if ((yyvsp[(4) - (6)].ValueVal)->getType() != (yyvsp[(6) - (6)].ValueVal)->getType()) + if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) GEN_ERROR("select value types should match"); - (yyval.InstVal) = new SelectInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 268: -#line 2668 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 267: +#line 2668 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(4) - (4)].TypeVal))->getDescription()); - (yyval.InstVal) = new VAArgInst((yyvsp[(2) - (4)].ValueVal), *(yyvsp[(4) - (4)].TypeVal)); - delete (yyvsp[(4) - (4)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 269: -#line 2675 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal))) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 268: +#line 2675 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid extractelement operands"); - (yyval.InstVal) = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal), (yyvsp[(4) - (4)].ValueVal)); + yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 270: -#line 2681 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + ; + break;} +case 269: +#line 2681 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid insertelement operands"); - (yyval.InstVal) = new InsertElementInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 271: -#line 2687 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + ; + break;} +case 270: +#line 2687 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) GEN_ERROR("Invalid shufflevector operands"); - (yyval.InstVal) = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal)); + yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 272: -#line 2693 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); + ; + break;} +case 271: +#line 2693 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const Type *Ty = yyvsp[0].PHIList->front().first->getType(); if (!Ty->isFirstClassType()) GEN_ERROR("PHI node operands must be of first class type"); - (yyval.InstVal) = new PHINode(Ty); - ((PHINode*)(yyval.InstVal))->reserveOperandSpace((yyvsp[(2) - (2)].PHIList)->size()); - while ((yyvsp[(2) - (2)].PHIList)->begin() != (yyvsp[(2) - (2)].PHIList)->end()) { - if ((yyvsp[(2) - (2)].PHIList)->front().first->getType() != Ty) + yyval.InstVal = new PHINode(Ty); + ((PHINode*)yyval.InstVal)->reserveOperandSpace(yyvsp[0].PHIList->size()); + while (yyvsp[0].PHIList->begin() != yyvsp[0].PHIList->end()) { + if (yyvsp[0].PHIList->front().first->getType() != Ty) GEN_ERROR("All elements of a PHI node must be of the same type"); - cast((yyval.InstVal))->addIncoming((yyvsp[(2) - (2)].PHIList)->front().first, (yyvsp[(2) - (2)].PHIList)->front().second); - (yyvsp[(2) - (2)].PHIList)->pop_front(); + cast(yyval.InstVal)->addIncoming(yyvsp[0].PHIList->front().first, yyvsp[0].PHIList->front().second); + yyvsp[0].PHIList->pop_front(); } - delete (yyvsp[(2) - (2)].PHIList); // Free the list... + delete yyvsp[0].PHIList; // Free the list... CHECK_FOR_ERROR - ;} - break; - - case 273: -#line 2709 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 272: +#line 2709 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Handle the short syntax const PointerType *PFTy = 0; const FunctionType *Ty = 0; - if (!(PFTy = dyn_cast((yyvsp[(3) - (8)].TypeVal)->get())) || + if (!(PFTy = dyn_cast(yyvsp[-5].TypeVal->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; FunctionType::ParamAttrsList ParamAttrs; - ParamAttrs.push_back((yyvsp[(8) - (8)].ParamAttrs)); - for (ValueRefList::iterator I = (yyvsp[(6) - (8)].ValueRefList)->begin(), E = (yyvsp[(6) - (8)].ValueRefList)->end(); I != E; ++I) { + ParamAttrs.push_back(yyvsp[0].ParamAttrs); + for (ValueRefList::iterator I = yyvsp[-2].ValueRefList->begin(), E = yyvsp[-2].ValueRefList->end(); I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); @@ -5617,16 +4558,16 @@ ParamAttrs.push_back(I->Attrs); } - Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false, ParamAttrs); + Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[(4) - (8)].ValIDVal)); // Get the function we're calling... + Value *V = getVal(PFTy, yyvsp[-4].ValIDVal); // Get the function we're calling... CHECK_FOR_ERROR // Check the arguments ValueList Args; - if ((yyvsp[(6) - (8)].ValueRefList)->empty()) { // Has no arguments? + if (yyvsp[-2].ValueRefList->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 " @@ -5637,7 +4578,7 @@ // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ValueRefList::iterator ArgI = (yyvsp[(6) - (8)].ValueRefList)->begin(), ArgE = (yyvsp[(6) - (8)].ValueRefList)->end(); + ValueRefList::iterator ArgI = yyvsp[-2].ValueRefList->begin(), ArgE = yyvsp[-2].ValueRefList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) { if (ArgI->Val->getType() != *I) @@ -5653,372 +4594,366 @@ GEN_ERROR("Invalid number of parameters detected"); } // Create the call node - CallInst *CI = new CallInst(V, Args); - CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); - CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); - (yyval.InstVal) = CI; - delete (yyvsp[(6) - (8)].ValueRefList); - delete (yyvsp[(3) - (8)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 274: -#line 2772 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); + CallInst *CI = new CallInst(V, &Args[0], Args.size()); + CI->setTailCall(yyvsp[-7].BoolVal); + CI->setCallingConv(yyvsp[-6].UIntVal); + yyval.InstVal = CI; + delete yyvsp[-2].ValueRefList; + delete yyvsp[-5].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 273: +#line 2772 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 275: -#line 2777 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 274: +#line 2777 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 276: -#line 2781 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 275: +#line 2781 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 277: -#line 2788 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 276: +#line 2788 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 278: -#line 2795 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 277: +#line 2795 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new MallocInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); - ;} - break; - - case 279: -#line 2803 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 278: +#line 2803 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (3)].TypeVal))->getDescription()); - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (3)].TypeVal), 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 280: -#line 2810 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 279: +#line 2810 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (6)].TypeVal))->getDescription()); - Value* tmpVal = getVal((yyvsp[(4) - (6)].PrimType), (yyvsp[(5) - (6)].ValIDVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-4].TypeVal)->getDescription()); + Value* tmpVal = getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new AllocaInst(*(yyvsp[(2) - (6)].TypeVal), tmpVal, (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal); - ;} - break; - - case 281: -#line 2818 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { - if (!isa((yyvsp[(2) - (2)].ValueVal)->getType())) + yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 280: +#line 2818 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (!isa(yyvsp[0].ValueVal->getType())) GEN_ERROR("Trying to free nonpointer type " + - (yyvsp[(2) - (2)].ValueVal)->getType()->getDescription() + ""); - (yyval.InstVal) = new FreeInst((yyvsp[(2) - (2)].ValueVal)); + yyvsp[0].ValueVal->getType()->getDescription() + ""); + yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 282: -#line 2826 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 281: +#line 2826 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - if (!isa((yyvsp[(3) - (4)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + if (!isa(yyvsp[-1].TypeVal->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - if (!cast((yyvsp[(3) - (4)].TypeVal)->get())->getElementType()->isFirstClassType()) + (*yyvsp[-1].TypeVal)->getDescription()); + if (!cast(yyvsp[-1].TypeVal->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[(3) - (4)].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[(3) - (4)].TypeVal), (yyvsp[(4) - (4)].ValIDVal)); + (*yyvsp[-1].TypeVal)->getDescription()); + Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (4)].BoolVal)); - delete (yyvsp[(3) - (4)].TypeVal); - ;} - break; - - case 283: -#line 2840 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-3].BoolVal); + delete yyvsp[-1].TypeVal; + ; + break;} +case 282: +#line 2840 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[(5) - (6)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + const PointerType *PT = dyn_cast(yyvsp[-1].TypeVal->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[(5) - (6)].TypeVal))->getDescription()); + (*yyvsp[-1].TypeVal)->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[(3) - (6)].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[(3) - (6)].ValueVal)->getType()->getDescription() + + if (ElTy != yyvsp[-3].ValueVal->getType()) + GEN_ERROR("Can't store '" + yyvsp[-3].ValueVal->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*(yyvsp[(5) - (6)].TypeVal), (yyvsp[(6) - (6)].ValIDVal)); + Value* tmpVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[(3) - (6)].ValueVal), tmpVal, (yyvsp[(1) - (6)].BoolVal)); - delete (yyvsp[(5) - (6)].TypeVal); - ;} - break; - - case 284: -#line 2857 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new StoreInst(yyvsp[-3].ValueVal, tmpVal, yyvsp[-5].BoolVal); + delete yyvsp[-1].TypeVal; + ; + break;} +case 283: +#line 2857 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(2) - (4)].TypeVal))->getDescription()); - if (!isa((yyvsp[(2) - (4)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-2].TypeVal->get())) GEN_ERROR("getelementptr insn requires pointer operand"); - if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size(), true)) + if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, &(*yyvsp[0].ValueList)[0], yyvsp[0].ValueList->size(), true)) GEN_ERROR("Invalid getelementptr indices for type '" + - (*(yyvsp[(2) - (4)].TypeVal))->getDescription()+ "'"); - Value* tmpVal = getVal(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(3) - (4)].ValIDVal)); + (*yyvsp[-2].TypeVal)->getDescription()+ "'"); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new GetElementPtrInst(tmpVal, &(*(yyvsp[(4) - (4)].ValueList))[0], (yyvsp[(4) - (4)].ValueList)->size()); - delete (yyvsp[(2) - (4)].TypeVal); - delete (yyvsp[(4) - (4)].ValueList); - ;} - break; - + yyval.InstVal = new GetElementPtrInst(tmpVal, &(*yyvsp[0].ValueList)[0], yyvsp[0].ValueList->size()); + delete yyvsp[-2].TypeVal; + delete yyvsp[0].ValueList; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif -/* Line 1267 of yacc.c. */ -#line 5808 "llvmAsmParser.tab.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif *++yyvsp = yyval; +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTOKENS]; + yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; +yyerrlab: /* here on detecting error */ -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) + if (yyn > YYFLAG && yyn < YYLAST) { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); } - /* Else will try to reuse look-ahead token after shifting the error - token. */ goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + goto yyerrhandle; -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ +yyerrdefault: /* current state does not do anything special for the error token. */ - for (;;) +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; - *++yyvsp = yylval; - +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif yystate = yyn; goto yynewstate; + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + } + return 1; } - - -#line 2874 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2874 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -6067,4 +5002,3 @@ GenerateError(errMsg); return 0; } - Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.53 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.54 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.53 Mon Feb 12 18:58:01 2007 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Mon Feb 12 23:53:56 2007 @@ -1,313 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - LOCALVAL_ID = 260, - GLOBALVAL_ID = 261, - FPVAL = 262, - VOID = 263, - INTTYPE = 264, - FLOAT = 265, - DOUBLE = 266, - LABEL = 267, - TYPE = 268, - LOCALVAR = 269, - GLOBALVAR = 270, - LABELSTR = 271, - STRINGCONSTANT = 272, - ATSTRINGCONSTANT = 273, - IMPLEMENTATION = 274, - ZEROINITIALIZER = 275, - TRUETOK = 276, - FALSETOK = 277, - BEGINTOK = 278, - ENDTOK = 279, - DECLARE = 280, - DEFINE = 281, - GLOBAL = 282, - CONSTANT = 283, - SECTION = 284, - VOLATILE = 285, - TO = 286, - DOTDOTDOT = 287, - NULL_TOK = 288, - UNDEF = 289, - INTERNAL = 290, - LINKONCE = 291, - WEAK = 292, - APPENDING = 293, - DLLIMPORT = 294, - DLLEXPORT = 295, - EXTERN_WEAK = 296, - OPAQUE = 297, - EXTERNAL = 298, - TARGET = 299, - TRIPLE = 300, - ALIGN = 301, - DEPLIBS = 302, - CALL = 303, - TAIL = 304, - ASM_TOK = 305, - MODULE = 306, - SIDEEFFECT = 307, - CC_TOK = 308, - CCC_TOK = 309, - FASTCC_TOK = 310, - COLDCC_TOK = 311, - X86_STDCALLCC_TOK = 312, - X86_FASTCALLCC_TOK = 313, - DATALAYOUT = 314, - RET = 315, - BR = 316, - SWITCH = 317, - INVOKE = 318, - UNWIND = 319, - UNREACHABLE = 320, - ADD = 321, - SUB = 322, - MUL = 323, - UDIV = 324, - SDIV = 325, - FDIV = 326, - UREM = 327, - SREM = 328, - FREM = 329, - AND = 330, - OR = 331, - XOR = 332, - SHL = 333, - LSHR = 334, - ASHR = 335, - ICMP = 336, - FCMP = 337, - EQ = 338, - NE = 339, - SLT = 340, - SGT = 341, - SLE = 342, - SGE = 343, - ULT = 344, - UGT = 345, - ULE = 346, - UGE = 347, - OEQ = 348, - ONE = 349, - OLT = 350, - OGT = 351, - OLE = 352, - OGE = 353, - ORD = 354, - UNO = 355, - UEQ = 356, - UNE = 357, - MALLOC = 358, - ALLOCA = 359, - FREE = 360, - LOAD = 361, - STORE = 362, - GETELEMENTPTR = 363, - TRUNC = 364, - ZEXT = 365, - SEXT = 366, - FPTRUNC = 367, - FPEXT = 368, - BITCAST = 369, - UITOFP = 370, - SITOFP = 371, - FPTOUI = 372, - FPTOSI = 373, - INTTOPTR = 374, - PTRTOINT = 375, - PHI_TOK = 376, - SELECT = 377, - VAARG = 378, - EXTRACTELEMENT = 379, - INSERTELEMENT = 380, - SHUFFLEVECTOR = 381, - NORETURN = 382, - INREG = 383, - SRET = 384, - DEFAULT = 385, - HIDDEN = 386 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define LOCALVAL_ID 260 -#define GLOBALVAL_ID 261 -#define FPVAL 262 -#define VOID 263 -#define INTTYPE 264 -#define FLOAT 265 -#define DOUBLE 266 -#define LABEL 267 -#define TYPE 268 -#define LOCALVAR 269 -#define GLOBALVAR 270 -#define LABELSTR 271 -#define STRINGCONSTANT 272 -#define ATSTRINGCONSTANT 273 -#define IMPLEMENTATION 274 -#define ZEROINITIALIZER 275 -#define TRUETOK 276 -#define FALSETOK 277 -#define BEGINTOK 278 -#define ENDTOK 279 -#define DECLARE 280 -#define DEFINE 281 -#define GLOBAL 282 -#define CONSTANT 283 -#define SECTION 284 -#define VOLATILE 285 -#define TO 286 -#define DOTDOTDOT 287 -#define NULL_TOK 288 -#define UNDEF 289 -#define INTERNAL 290 -#define LINKONCE 291 -#define WEAK 292 -#define APPENDING 293 -#define DLLIMPORT 294 -#define DLLEXPORT 295 -#define EXTERN_WEAK 296 -#define OPAQUE 297 -#define EXTERNAL 298 -#define TARGET 299 -#define TRIPLE 300 -#define ALIGN 301 -#define DEPLIBS 302 -#define CALL 303 -#define TAIL 304 -#define ASM_TOK 305 -#define MODULE 306 -#define SIDEEFFECT 307 -#define CC_TOK 308 -#define CCC_TOK 309 -#define FASTCC_TOK 310 -#define COLDCC_TOK 311 -#define X86_STDCALLCC_TOK 312 -#define X86_FASTCALLCC_TOK 313 -#define DATALAYOUT 314 -#define RET 315 -#define BR 316 -#define SWITCH 317 -#define INVOKE 318 -#define UNWIND 319 -#define UNREACHABLE 320 -#define ADD 321 -#define SUB 322 -#define MUL 323 -#define UDIV 324 -#define SDIV 325 -#define FDIV 326 -#define UREM 327 -#define SREM 328 -#define FREM 329 -#define AND 330 -#define OR 331 -#define XOR 332 -#define SHL 333 -#define LSHR 334 -#define ASHR 335 -#define ICMP 336 -#define FCMP 337 -#define EQ 338 -#define NE 339 -#define SLT 340 -#define SGT 341 -#define SLE 342 -#define SGE 343 -#define ULT 344 -#define UGT 345 -#define ULE 346 -#define UGE 347 -#define OEQ 348 -#define ONE 349 -#define OLT 350 -#define OGT 351 -#define OLE 352 -#define OGE 353 -#define ORD 354 -#define UNO 355 -#define UEQ 356 -#define UNE 357 -#define MALLOC 358 -#define ALLOCA 359 -#define FREE 360 -#define LOAD 361 -#define STORE 362 -#define GETELEMENTPTR 363 -#define TRUNC 364 -#define ZEXT 365 -#define SEXT 366 -#define FPTRUNC 367 -#define FPEXT 368 -#define BITCAST 369 -#define UITOFP 370 -#define SITOFP 371 -#define FPTOUI 372 -#define FPTOSI 373 -#define INTTOPTR 374 -#define PTRTOINT 375 -#define PHI_TOK 376 -#define SELECT 377 -#define VAARG 378 -#define EXTRACTELEMENT 379 -#define INSERTELEMENT 380 -#define SHUFFLEVECTOR 381 -#define NORETURN 382 -#define INREG 383 -#define SRET 384 -#define DEFAULT 385 -#define HIDDEN 386 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 901 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" -{ +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -351,14 +42,136 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 1529 of yacc.c. */ -#line 357 "llvmAsmParser.tab.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif +} YYSTYPE; +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define LOCALVAL_ID 259 +#define GLOBALVAL_ID 260 +#define FPVAL 261 +#define VOID 262 +#define INTTYPE 263 +#define FLOAT 264 +#define DOUBLE 265 +#define LABEL 266 +#define TYPE 267 +#define LOCALVAR 268 +#define GLOBALVAR 269 +#define LABELSTR 270 +#define STRINGCONSTANT 271 +#define ATSTRINGCONSTANT 272 +#define IMPLEMENTATION 273 +#define ZEROINITIALIZER 274 +#define TRUETOK 275 +#define FALSETOK 276 +#define BEGINTOK 277 +#define ENDTOK 278 +#define DECLARE 279 +#define DEFINE 280 +#define GLOBAL 281 +#define CONSTANT 282 +#define SECTION 283 +#define VOLATILE 284 +#define TO 285 +#define DOTDOTDOT 286 +#define NULL_TOK 287 +#define UNDEF 288 +#define INTERNAL 289 +#define LINKONCE 290 +#define WEAK 291 +#define APPENDING 292 +#define DLLIMPORT 293 +#define DLLEXPORT 294 +#define EXTERN_WEAK 295 +#define OPAQUE 296 +#define EXTERNAL 297 +#define TARGET 298 +#define TRIPLE 299 +#define ALIGN 300 +#define DEPLIBS 301 +#define CALL 302 +#define TAIL 303 +#define ASM_TOK 304 +#define MODULE 305 +#define SIDEEFFECT 306 +#define CC_TOK 307 +#define CCC_TOK 308 +#define FASTCC_TOK 309 +#define COLDCC_TOK 310 +#define X86_STDCALLCC_TOK 311 +#define X86_FASTCALLCC_TOK 312 +#define DATALAYOUT 313 +#define RET 314 +#define BR 315 +#define SWITCH 316 +#define INVOKE 317 +#define UNWIND 318 +#define UNREACHABLE 319 +#define ADD 320 +#define SUB 321 +#define MUL 322 +#define UDIV 323 +#define SDIV 324 +#define FDIV 325 +#define UREM 326 +#define SREM 327 +#define FREM 328 +#define AND 329 +#define OR 330 +#define XOR 331 +#define SHL 332 +#define LSHR 333 +#define ASHR 334 +#define ICMP 335 +#define FCMP 336 +#define EQ 337 +#define NE 338 +#define SLT 339 +#define SGT 340 +#define SLE 341 +#define SGE 342 +#define ULT 343 +#define UGT 344 +#define ULE 345 +#define UGE 346 +#define OEQ 347 +#define ONE 348 +#define OLT 349 +#define OGT 350 +#define OLE 351 +#define OGE 352 +#define ORD 353 +#define UNO 354 +#define UEQ 355 +#define UNE 356 +#define MALLOC 357 +#define ALLOCA 358 +#define FREE 359 +#define LOAD 360 +#define STORE 361 +#define GETELEMENTPTR 362 +#define TRUNC 363 +#define ZEXT 364 +#define SEXT 365 +#define FPTRUNC 366 +#define FPEXT 367 +#define BITCAST 368 +#define UITOFP 369 +#define SITOFP 370 +#define FPTOUI 371 +#define FPTOSI 372 +#define INTTOPTR 373 +#define PTRTOINT 374 +#define PHI_TOK 375 +#define SELECT 376 +#define VAARG 377 +#define EXTRACTELEMENT 378 +#define INSERTELEMENT 379 +#define SHUFFLEVECTOR 380 +#define NORETURN 381 +#define INREG 382 +#define SRET 383 +#define DEFAULT 384 +#define HIDDEN 385 -extern YYSTYPE llvmAsmlval; +extern YYSTYPE llvmAsmlval; Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.322 llvm/lib/AsmParser/llvmAsmParser.y:1.323 --- llvm/lib/AsmParser/llvmAsmParser.y:1.322 Mon Feb 12 18:57:40 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y Mon Feb 12 23:53:56 2007 @@ -2473,7 +2473,7 @@ } // Create the InvokeInst - InvokeInst *II = new InvokeInst(V, Normal, Except, Args); + InvokeInst *II = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); II->setCallingConv($2); $$ = II; delete $6; @@ -2761,7 +2761,7 @@ GEN_ERROR("Invalid number of parameters detected"); } // Create the call node - CallInst *CI = new CallInst(V, Args); + CallInst *CI = new CallInst(V, &Args[0], Args.size()); CI->setTailCall($1); CI->setCallingConv($2); $$ = CI; Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.68 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.69 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.68 Mon Feb 12 18:58:01 2007 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Mon Feb 12 23:53:56 2007 @@ -2473,7 +2473,7 @@ } // Create the InvokeInst - InvokeInst *II = new InvokeInst(V, Normal, Except, Args); + InvokeInst *II = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); II->setCallingConv($2); $$ = II; delete $6; @@ -2761,7 +2761,7 @@ GEN_ERROR("Invalid number of parameters detected"); } // Create the call node - CallInst *CI = new CallInst(V, Args); + CallInst *CI = new CallInst(V, &Args[0], Args.size()); CI->setTailCall($1); CI->setCallingConv($2); $$ = CI; From sabre at nondot.org Mon Feb 12 23:59:09 2007 From: sabre at nondot.org (Chris Lattner) Date: Mon, 12 Feb 2007 23:59:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Message-ID: <200702130559.l1D5x9XT008766@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/IPO: SimplifyLibCalls.cpp updated: 1.92 -> 1.93 --- Log message: eliminate a bunch of vector-related heap traffic --- Diffs of the changes: (+53 -47) SimplifyLibCalls.cpp | 100 +++++++++++++++++++++++++++------------------------ 1 files changed, 53 insertions(+), 47 deletions(-) Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.92 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.93 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.92 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Mon Feb 12 23:58:53 2007 @@ -512,12 +512,12 @@ // We have enough information to now generate the memcpy call to // do the concatenation for us. - std::vector vals; - vals.push_back(gep); // destination - vals.push_back(ci->getOperand(2)); // source - vals.push_back(ConstantInt::get(SLC.getIntPtrType(),len)); // length - vals.push_back(ConstantInt::get(Type::Int32Ty,1)); // alignment - new CallInst(SLC.get_memcpy(), vals, "", ci); + Value *vals[4]; + vals[0] = gep; // destination + vals[1] = ci->getOperand(2); // source + vals[2] = ConstantInt::get(SLC.getIntPtrType(),len); // length + vals[3] = ConstantInt::get(Type::Int32Ty,1); // alignment + new CallInst(SLC.get_memcpy(), vals, 4, "", ci); // Finally, substitute the first operand of the strcat call for the // strcat call itself since strcat returns its first operand; and, @@ -565,11 +565,12 @@ // The second operand is not constant, or not signed. Just lower this to // memchr since we know the length of the string since it is constant. Constant *f = SLC.get_memchr(); - std::vector args; - args.push_back(ci->getOperand(1)); - args.push_back(ci->getOperand(2)); - args.push_back(ConstantInt::get(SLC.getIntPtrType(), len)); - ci->replaceAllUsesWith(new CallInst(f, args, ci->getName(), ci)); + Value* args[3] = { + ci->getOperand(1), + ci->getOperand(2), + ConstantInt::get(SLC.getIntPtrType(), len) + }; + ci->replaceAllUsesWith(new CallInst(f, args, 3, ci->getName(), ci)); ci->eraseFromParent(); return true; } @@ -841,12 +842,12 @@ // We have enough information to now generate the memcpy call to // do the concatenation for us. - std::vector vals; - vals.push_back(dest); // destination - vals.push_back(src); // source - vals.push_back(ConstantInt::get(SLC.getIntPtrType(),len)); // length - vals.push_back(ConstantInt::get(Type::Int32Ty,1)); // alignment - new CallInst(SLC.get_memcpy(), vals, "", ci); + Value *vals[4] = { + dest, src, + ConstantInt::get(SLC.getIntPtrType(),len), // length + ConstantInt::get(Type::Int32Ty, 1) // alignment + }; + new CallInst(SLC.get_memcpy(), vals, 4, "", ci); // Finally, substitute the first operand of the strcat call for the // strcat call itself since strcat returns its first operand; and, @@ -1423,12 +1424,13 @@ if (ci->getOperand(2)->getType() != PointerType::get(Type::Int8Ty)) return false; - std::vector args; - args.push_back(ci->getOperand(2)); - args.push_back(ConstantInt::get(SLC.getIntPtrType(),len)); - args.push_back(ConstantInt::get(SLC.getIntPtrType(),1)); - args.push_back(ci->getOperand(1)); - new CallInst(SLC.get_fwrite(FILEptr_type), args, ci->getName(), ci); + Value* args[4] = { + ci->getOperand(2), + ConstantInt::get(SLC.getIntPtrType(),len), + ConstantInt::get(SLC.getIntPtrType(),1), + ci->getOperand(1) + }; + new CallInst(SLC.get_fwrite(FILEptr_type), args, 4, ci->getName(), ci); ci->replaceAllUsesWith(ConstantInt::get(Type::Int32Ty,len)); ci->eraseFromParent(); return true; @@ -1454,12 +1456,13 @@ if (getConstantStringLength(ci->getOperand(3), len, &CA)) { // fprintf(file,"%s",str) -> fwrite(str,strlen(str),1,file) const Type* FILEptr_type = ci->getOperand(1)->getType(); - std::vector args; - args.push_back(CastToCStr(ci->getOperand(3), *ci)); - args.push_back(ConstantInt::get(SLC.getIntPtrType(), len)); - args.push_back(ConstantInt::get(SLC.getIntPtrType(), 1)); - args.push_back(ci->getOperand(1)); - new CallInst(SLC.get_fwrite(FILEptr_type), args, ci->getName(), ci); + Value* args[4] = { + CastToCStr(ci->getOperand(3), *ci), + ConstantInt::get(SLC.getIntPtrType(), len), + ConstantInt::get(SLC.getIntPtrType(), 1), + ci->getOperand(1) + }; + new CallInst(SLC.get_fwrite(FILEptr_type), args, 4,ci->getName(), ci); ci->replaceAllUsesWith(ConstantInt::get(Type::Int32Ty, len)); } else { // fprintf(file,"%s",str) -> fputs(str,file) @@ -1542,12 +1545,13 @@ len++; // sprintf(str,fmt) -> llvm.memcpy(str,fmt,strlen(fmt),1) - std::vector args; - args.push_back(ci->getOperand(1)); - args.push_back(ci->getOperand(2)); - args.push_back(ConstantInt::get(SLC.getIntPtrType(),len)); - args.push_back(ConstantInt::get(Type::Int32Ty,1)); - new CallInst(SLC.get_memcpy(), args, "", ci); + Value *args[4] = { + ci->getOperand(1), + ci->getOperand(2), + ConstantInt::get(SLC.getIntPtrType(),len), + ConstantInt::get(Type::Int32Ty, 1) + }; + new CallInst(SLC.get_memcpy(), args, 4, "", ci); ci->replaceAllUsesWith(ConstantInt::get(Type::Int32Ty,len)); ci->eraseFromParent(); return true; @@ -1577,12 +1581,13 @@ if (Len1->getType() != SLC.getIntPtrType()) Len1 = CastInst::createIntegerCast(Len1, SLC.getIntPtrType(), false, Len1->getName(), ci); - std::vector args; - args.push_back(CastToCStr(ci->getOperand(1), *ci)); - args.push_back(CastToCStr(ci->getOperand(3), *ci)); - args.push_back(Len1); - args.push_back(ConstantInt::get(Type::Int32Ty,1)); - new CallInst(SLC.get_memcpy(), args, "", ci); + Value *args[4] = { + CastToCStr(ci->getOperand(1), *ci), + CastToCStr(ci->getOperand(3), *ci), + Len1, + ConstantInt::get(Type::Int32Ty,1) + }; + new CallInst(SLC.get_memcpy(), args, 4, "", ci); // The strlen result is the unincremented number of bytes in the string. if (!ci->use_empty()) { @@ -1660,12 +1665,13 @@ { // fputs(s,F) -> fwrite(s,1,len,F) (if s is constant and strlen(s) > 1) const Type* FILEptr_type = ci->getOperand(2)->getType(); - std::vector parms; - parms.push_back(ci->getOperand(1)); - parms.push_back(ConstantInt::get(SLC.getIntPtrType(),len)); - parms.push_back(ConstantInt::get(SLC.getIntPtrType(),1)); - parms.push_back(ci->getOperand(2)); - new CallInst(SLC.get_fwrite(FILEptr_type), parms, "", ci); + Value *parms[4] = { + ci->getOperand(1), + ConstantInt::get(SLC.getIntPtrType(),len), + ConstantInt::get(SLC.getIntPtrType(),1), + ci->getOperand(2) + }; + new CallInst(SLC.get_fwrite(FILEptr_type), parms, 4, "", ci); break; } } From sabre at nondot.org Tue Feb 13 00:01:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:01:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp Message-ID: <200702130601.l1D61cS5008873@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.66 -> 1.67 --- Log message: eliminate vector-related allocations --- Diffs of the changes: (+4 -2) IntrinsicLowering.cpp | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.66 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.67 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.66 Tue Feb 6 13:06:38 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Tue Feb 13 00:01:22 2007 @@ -19,6 +19,7 @@ #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/Support/Streams.h" #include "llvm/Target/TargetData.h" +#include "llvm/ADT/SmallVector.h" using namespace llvm; template @@ -52,8 +53,9 @@ FunctionType::get(RetTy, ParamTys, false)); } - std::vector Operands(ArgBegin, ArgEnd); - CallInst *NewCI = new CallInst(FCache, Operands, CI->getName(), CI); + SmallVector Operands(ArgBegin, ArgEnd); + CallInst *NewCI = new CallInst(FCache, &Operands[0], Operands.size(), + CI->getName(), CI); if (!CI->use_empty()) CI->replaceAllUsesWith(NewCI); return NewCI; From sabre at nondot.org Tue Feb 13 00:01:40 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:01:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp Message-ID: <200702130601.l1D61ehg008879@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JIT.cpp updated: 1.91 -> 1.92 --- Log message: eliminate vector-related allocations --- Diffs of the changes: (+2 -2) JIT.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.91 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.92 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.91 Tue Jan 30 14:08:37 2007 +++ llvm/lib/ExecutionEngine/JIT/JIT.cpp Tue Feb 13 00:01:22 2007 @@ -187,7 +187,7 @@ // Convert all of the GenericValue arguments over to constants. Note that we // currently don't support varargs. - std::vector Args; + SmallVector Args; for (unsigned i = 0, e = ArgValues.size(); i != e; ++i) { Constant *C = 0; const Type *ArgTy = FTy->getParamType(i); @@ -225,7 +225,7 @@ Args.push_back(C); } - CallInst *TheCall = new CallInst(F, Args, "", StubBB); + CallInst *TheCall = new CallInst(F, &Args[0], Args.size(), "", StubBB); TheCall->setTailCall(); if (TheCall->getType() != Type::VoidTy) new ReturnInst(TheCall, StubBB); // Return result of the call. From sabre at nondot.org Tue Feb 13 00:04:04 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:04:04 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y Message-ID: <200702130604.l1D644bD008940@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.y updated: 1.64 -> 1.65 --- Log message: remove use of vector-related ctors --- Diffs of the changes: (+5 -5) UpgradeParser.y | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.64 llvm/tools/llvm-upgrade/UpgradeParser.y:1.65 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.64 Mon Feb 12 16:58:38 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Tue Feb 13 00:03:48 2007 @@ -1222,7 +1222,7 @@ const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB); - return new CallInst(Func, Args); + return new CallInst(Func, &Args[0], Args.size()); } else if (Name == "llvm.va_copy") { if (Args.size() != 2) error("Invalid prototype for " + Name + " prototype"); @@ -1235,7 +1235,7 @@ std::string InstName1(makeNameUnique("va1")); Args[0] = new BitCastInst(Args[0], PtrTy, InstName0, CurBB); Args[1] = new BitCastInst(Args[1], PtrTy, InstName1, CurBB); - return new CallInst(Func, Args); + return new CallInst(Func, &Args[0], Args.size()); } } return 0; @@ -2978,7 +2978,7 @@ // Create the call node... if (!$6) { // Has no arguments? - $$ = new InvokeInst(V, Normal, Except, std::vector()); + $$ = new InvokeInst(V, Normal, Except, 0, 0); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified // correctly! @@ -2998,7 +2998,7 @@ if (I != E || (ArgI != ArgE && !Ty->isVarArg())) error("Invalid number of parameters detected"); - $$ = new InvokeInst(V, Normal, Except, Args); + $$ = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); } cast($$)->setCallingConv(upgradeCallingConv($2)); delete $3.PAT; @@ -3379,7 +3379,7 @@ } // Create the call instruction - CallInst *CI = new CallInst(V, Args); + CallInst *CI = new CallInst(V, &Args[0], Args.size()); CI->setTailCall($1); CI->setCallingConv(upgradeCallingConv($2)); $$.I = CI; From sabre at nondot.org Tue Feb 13 00:04:34 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:04:34 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs UpgradeParser.h.cvs UpgradeParser.y.cvs Message-ID: <200702130604.l1D64YRL008980@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-upgrade: UpgradeParser.cpp.cvs updated: 1.61 -> 1.62 UpgradeParser.h.cvs updated: 1.45 -> 1.46 UpgradeParser.y.cvs updated: 1.60 -> 1.61 --- Log message: regenerate --- Diffs of the changes: (+3330 -4630) UpgradeParser.cpp.cvs | 7439 +++++++++++++++++++++----------------------------- UpgradeParser.h.cvs | 511 +-- UpgradeParser.y.cvs | 10 3 files changed, 3330 insertions(+), 4630 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.61 llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.62 --- llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs:1.61 Mon Feb 12 16:58:37 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs Tue Feb 13 00:04:17 2007 @@ -1,386 +1,167 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made from /Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y + by GNU Bison version 1.28 */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. +#define YYBISON 1 /* Identify Bison output. */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.3" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ #define yyparse Upgradeparse -#define yylex Upgradelex +#define yylex Upgradelex #define yyerror Upgradeerror -#define yylval Upgradelval -#define yychar Upgradechar +#define yylval Upgradelval +#define yychar Upgradechar #define yydebug Upgradedebug #define yynerrs Upgradenerrs +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define SINTVAL 259 +#define UINTVAL 260 +#define FPVAL 261 +#define VOID 262 +#define BOOL 263 +#define SBYTE 264 +#define UBYTE 265 +#define SHORT 266 +#define USHORT 267 +#define INT 268 +#define UINT 269 +#define LONG 270 +#define ULONG 271 +#define FLOAT 272 +#define DOUBLE 273 +#define TYPE 274 +#define LABEL 275 +#define VAR_ID 276 +#define LABELSTR 277 +#define STRINGCONSTANT 278 +#define IMPLEMENTATION 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define GLOBAL 286 +#define CONSTANT 287 +#define SECTION 288 +#define VOLATILE 289 +#define TO 290 +#define DOTDOTDOT 291 +#define NULL_TOK 292 +#define UNDEF 293 +#define CONST 294 +#define INTERNAL 295 +#define LINKONCE 296 +#define WEAK 297 +#define APPENDING 298 +#define DLLIMPORT 299 +#define DLLEXPORT 300 +#define EXTERN_WEAK 301 +#define OPAQUE 302 +#define NOT 303 +#define EXTERNAL 304 +#define TARGET 305 +#define TRIPLE 306 +#define ENDIAN 307 +#define POINTERSIZE 308 +#define LITTLE 309 +#define BIG 310 +#define ALIGN 311 +#define DEPLIBS 312 +#define CALL 313 +#define TAIL 314 +#define ASM_TOK 315 +#define MODULE 316 +#define SIDEEFFECT 317 +#define CC_TOK 318 +#define CCC_TOK 319 +#define CSRETCC_TOK 320 +#define FASTCC_TOK 321 +#define COLDCC_TOK 322 +#define X86_STDCALLCC_TOK 323 +#define X86_FASTCALLCC_TOK 324 +#define DATALAYOUT 325 +#define RET 326 +#define BR 327 +#define SWITCH 328 +#define INVOKE 329 +#define UNREACHABLE 330 +#define UNWIND 331 +#define EXCEPT 332 +#define ADD 333 +#define SUB 334 +#define MUL 335 +#define DIV 336 +#define UDIV 337 +#define SDIV 338 +#define FDIV 339 +#define REM 340 +#define UREM 341 +#define SREM 342 +#define FREM 343 +#define AND 344 +#define OR 345 +#define XOR 346 +#define SHL 347 +#define SHR 348 +#define ASHR 349 +#define LSHR 350 +#define SETLE 351 +#define SETGE 352 +#define SETLT 353 +#define SETGT 354 +#define SETEQ 355 +#define SETNE 356 +#define ICMP 357 +#define FCMP 358 +#define MALLOC 359 +#define ALLOCA 360 +#define FREE 361 +#define LOAD 362 +#define STORE 363 +#define GETELEMENTPTR 364 +#define PHI_TOK 365 +#define SELECT 366 +#define VAARG 367 +#define EXTRACTELEMENT 368 +#define INSERTELEMENT 369 +#define SHUFFLEVECTOR 370 +#define VAARG_old 371 +#define VANEXT_old 372 +#define EQ 373 +#define NE 374 +#define SLT 375 +#define SGT 376 +#define SLE 377 +#define SGE 378 +#define ULT 379 +#define UGT 380 +#define ULE 381 +#define UGE 382 +#define OEQ 383 +#define ONE 384 +#define OLT 385 +#define OGT 386 +#define OLE 387 +#define OGE 388 +#define ORD 389 +#define UNO 390 +#define UEQ 391 +#define UNE 392 +#define CAST 393 +#define TRUNC 394 +#define ZEXT 395 +#define SEXT 396 +#define FPTRUNC 397 +#define FPEXT 398 +#define FPTOUI 399 +#define FPTOSI 400 +#define UITOFP 401 +#define SITOFP 402 +#define PTRTOINT 403 +#define INTTOPTR 404 +#define BITCAST 405 - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - SINTVAL = 260, - UINTVAL = 261, - FPVAL = 262, - VOID = 263, - BOOL = 264, - SBYTE = 265, - UBYTE = 266, - SHORT = 267, - USHORT = 268, - INT = 269, - UINT = 270, - LONG = 271, - ULONG = 272, - FLOAT = 273, - DOUBLE = 274, - TYPE = 275, - LABEL = 276, - VAR_ID = 277, - LABELSTR = 278, - STRINGCONSTANT = 279, - IMPLEMENTATION = 280, - ZEROINITIALIZER = 281, - TRUETOK = 282, - FALSETOK = 283, - BEGINTOK = 284, - ENDTOK = 285, - DECLARE = 286, - GLOBAL = 287, - CONSTANT = 288, - SECTION = 289, - VOLATILE = 290, - TO = 291, - DOTDOTDOT = 292, - NULL_TOK = 293, - UNDEF = 294, - CONST = 295, - INTERNAL = 296, - LINKONCE = 297, - WEAK = 298, - APPENDING = 299, - DLLIMPORT = 300, - DLLEXPORT = 301, - EXTERN_WEAK = 302, - OPAQUE = 303, - NOT = 304, - EXTERNAL = 305, - TARGET = 306, - TRIPLE = 307, - ENDIAN = 308, - POINTERSIZE = 309, - LITTLE = 310, - BIG = 311, - ALIGN = 312, - DEPLIBS = 313, - CALL = 314, - TAIL = 315, - ASM_TOK = 316, - MODULE = 317, - SIDEEFFECT = 318, - CC_TOK = 319, - CCC_TOK = 320, - CSRETCC_TOK = 321, - FASTCC_TOK = 322, - COLDCC_TOK = 323, - X86_STDCALLCC_TOK = 324, - X86_FASTCALLCC_TOK = 325, - DATALAYOUT = 326, - RET = 327, - BR = 328, - SWITCH = 329, - INVOKE = 330, - UNREACHABLE = 331, - UNWIND = 332, - EXCEPT = 333, - ADD = 334, - SUB = 335, - MUL = 336, - DIV = 337, - UDIV = 338, - SDIV = 339, - FDIV = 340, - REM = 341, - UREM = 342, - SREM = 343, - FREM = 344, - AND = 345, - OR = 346, - XOR = 347, - SHL = 348, - SHR = 349, - ASHR = 350, - LSHR = 351, - SETLE = 352, - SETGE = 353, - SETLT = 354, - SETGT = 355, - SETEQ = 356, - SETNE = 357, - ICMP = 358, - FCMP = 359, - MALLOC = 360, - ALLOCA = 361, - FREE = 362, - LOAD = 363, - STORE = 364, - GETELEMENTPTR = 365, - PHI_TOK = 366, - SELECT = 367, - VAARG = 368, - EXTRACTELEMENT = 369, - INSERTELEMENT = 370, - SHUFFLEVECTOR = 371, - VAARG_old = 372, - VANEXT_old = 373, - EQ = 374, - NE = 375, - SLT = 376, - SGT = 377, - SLE = 378, - SGE = 379, - ULT = 380, - UGT = 381, - ULE = 382, - UGE = 383, - OEQ = 384, - ONE = 385, - OLT = 386, - OGT = 387, - OLE = 388, - OGE = 389, - ORD = 390, - UNO = 391, - UEQ = 392, - UNE = 393, - CAST = 394, - TRUNC = 395, - ZEXT = 396, - SEXT = 397, - FPTRUNC = 398, - FPEXT = 399, - FPTOUI = 400, - FPTOSI = 401, - UITOFP = 402, - SITOFP = 403, - PTRTOINT = 404, - INTTOPTR = 405, - BITCAST = 406 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define SINTVAL 260 -#define UINTVAL 261 -#define FPVAL 262 -#define VOID 263 -#define BOOL 264 -#define SBYTE 265 -#define UBYTE 266 -#define SHORT 267 -#define USHORT 268 -#define INT 269 -#define UINT 270 -#define LONG 271 -#define ULONG 272 -#define FLOAT 273 -#define DOUBLE 274 -#define TYPE 275 -#define LABEL 276 -#define VAR_ID 277 -#define LABELSTR 278 -#define STRINGCONSTANT 279 -#define IMPLEMENTATION 280 -#define ZEROINITIALIZER 281 -#define TRUETOK 282 -#define FALSETOK 283 -#define BEGINTOK 284 -#define ENDTOK 285 -#define DECLARE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define SECTION 289 -#define VOLATILE 290 -#define TO 291 -#define DOTDOTDOT 292 -#define NULL_TOK 293 -#define UNDEF 294 -#define CONST 295 -#define INTERNAL 296 -#define LINKONCE 297 -#define WEAK 298 -#define APPENDING 299 -#define DLLIMPORT 300 -#define DLLEXPORT 301 -#define EXTERN_WEAK 302 -#define OPAQUE 303 -#define NOT 304 -#define EXTERNAL 305 -#define TARGET 306 -#define TRIPLE 307 -#define ENDIAN 308 -#define POINTERSIZE 309 -#define LITTLE 310 -#define BIG 311 -#define ALIGN 312 -#define DEPLIBS 313 -#define CALL 314 -#define TAIL 315 -#define ASM_TOK 316 -#define MODULE 317 -#define SIDEEFFECT 318 -#define CC_TOK 319 -#define CCC_TOK 320 -#define CSRETCC_TOK 321 -#define FASTCC_TOK 322 -#define COLDCC_TOK 323 -#define X86_STDCALLCC_TOK 324 -#define X86_FASTCALLCC_TOK 325 -#define DATALAYOUT 326 -#define RET 327 -#define BR 328 -#define SWITCH 329 -#define INVOKE 330 -#define UNREACHABLE 331 -#define UNWIND 332 -#define EXCEPT 333 -#define ADD 334 -#define SUB 335 -#define MUL 336 -#define DIV 337 -#define UDIV 338 -#define SDIV 339 -#define FDIV 340 -#define REM 341 -#define UREM 342 -#define SREM 343 -#define FREM 344 -#define AND 345 -#define OR 346 -#define XOR 347 -#define SHL 348 -#define SHR 349 -#define ASHR 350 -#define LSHR 351 -#define SETLE 352 -#define SETGE 353 -#define SETLT 354 -#define SETGT 355 -#define SETEQ 356 -#define SETNE 357 -#define ICMP 358 -#define FCMP 359 -#define MALLOC 360 -#define ALLOCA 361 -#define FREE 362 -#define LOAD 363 -#define STORE 364 -#define GETELEMENTPTR 365 -#define PHI_TOK 366 -#define SELECT 367 -#define VAARG 368 -#define EXTRACTELEMENT 369 -#define INSERTELEMENT 370 -#define SHUFFLEVECTOR 371 -#define VAARG_old 372 -#define VANEXT_old 373 -#define EQ 374 -#define NE 375 -#define SLT 376 -#define SGT 377 -#define SLE 378 -#define SGE 379 -#define ULT 380 -#define UGT 381 -#define ULE 382 -#define UGE 383 -#define OEQ 384 -#define ONE 385 -#define OLT 386 -#define OGT 387 -#define OLE 388 -#define OGE 389 -#define ORD 390 -#define UNO 391 -#define UEQ 392 -#define UNE 393 -#define CAST 394 -#define TRUNC 395 -#define ZEXT 396 -#define SEXT 397 -#define FPTRUNC 398 -#define FPEXT 399 -#define FPTOUI 400 -#define FPTOSI 401 -#define UITOFP 402 -#define SITOFP 403 -#define PTRTOINT 404 -#define INTTOPTR 405 -#define BITCAST 406 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" +#line 14 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" #include "UpgradeInternals.h" #include "llvm/CallingConv.h" @@ -1592,7 +1373,7 @@ const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB); - return new CallInst(Func, Args); + return new CallInst(Func, &Args[0], Args.size()); } else if (Name == "llvm.va_copy") { if (Args.size() != 2) error("Invalid prototype for " + Name + " prototype"); @@ -1605,7 +1386,7 @@ std::string InstName1(makeNameUnique("va1")); Args[0] = new BitCastInst(Args[0], PtrTy, InstName0, CurBB); Args[1] = new BitCastInst(Args[1], PtrTy, InstName1, CurBB); - return new CallInst(Func, Args); + return new CallInst(Func, &Args[0], Args.size()); } } return 0; @@ -1820,29 +1601,8 @@ using namespace llvm; - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 1454 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ +#line 1454 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -1882,1835 +1642,1152 @@ llvm::ICmpInst::Predicate IPred; llvm::FCmpInst::Predicate FPred; llvm::Module::Endianness Endianness; -} -/* Line 193 of yacc.c. */ -#line 1888 "UpgradeParser.tab.c" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - +} YYSTYPE; +#include +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif -/* Copy the second part of user declarations. */ -/* Line 216 of yacc.c. */ -#line 1901 "UpgradeParser.tab.c" +#define YYFINAL 605 +#define YYFLAG -32768 +#define YYNTBASE 166 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 405 ? yytranslate[x] : 245) + +static const short yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 155, + 156, 164, 2, 153, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 160, + 152, 161, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 157, 154, 159, 2, 2, 2, 2, 2, 165, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 158, + 2, 2, 162, 2, 163, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151 +}; -#ifdef short -# undef short -#endif +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, + 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, + 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, + 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, + 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, + 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, + 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, + 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, + 161, 162, 164, 166, 168, 170, 172, 174, 176, 177, + 178, 180, 182, 184, 186, 188, 190, 193, 194, 197, + 198, 202, 205, 206, 208, 209, 213, 215, 218, 220, + 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, + 242, 244, 246, 248, 250, 252, 254, 256, 258, 261, + 266, 272, 278, 282, 285, 291, 296, 299, 301, 305, + 307, 311, 313, 314, 319, 323, 327, 332, 337, 341, + 348, 354, 357, 360, 363, 366, 369, 372, 375, 378, + 381, 384, 391, 397, 406, 413, 420, 427, 435, 443, + 450, 457, 466, 475, 479, 481, 483, 485, 487, 490, + 493, 498, 501, 503, 508, 511, 516, 517, 525, 526, + 534, 535, 543, 544, 552, 556, 561, 562, 564, 566, + 568, 572, 576, 580, 584, 588, 592, 594, 595, 597, + 599, 601, 602, 605, 609, 611, 613, 617, 619, 620, + 629, 631, 633, 637, 639, 641, 644, 645, 647, 649, + 650, 651, 657, 658, 660, 662, 664, 666, 668, 670, + 672, 674, 676, 680, 682, 688, 690, 692, 694, 696, + 699, 702, 705, 709, 712, 713, 715, 717, 719, 722, + 725, 729, 739, 749, 758, 772, 774, 776, 783, 789, + 792, 799, 807, 809, 813, 815, 816, 819, 821, 827, + 833, 839, 846, 853, 856, 861, 866, 873, 878, 883, + 888, 893, 900, 907, 910, 918, 920, 923, 924, 926, + 927, 931, 938, 942, 949, 952, 957, 964 +}; -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif +static const short yyrhs[] = { 5, + 0, 6, 0, 3, 0, 4, 0, 79, 0, 80, + 0, 81, 0, 82, 0, 83, 0, 84, 0, 85, + 0, 86, 0, 87, 0, 88, 0, 89, 0, 90, + 0, 91, 0, 92, 0, 97, 0, 98, 0, 99, + 0, 100, 0, 101, 0, 102, 0, 119, 0, 120, + 0, 121, 0, 122, 0, 123, 0, 124, 0, 125, + 0, 126, 0, 127, 0, 128, 0, 129, 0, 130, + 0, 131, 0, 132, 0, 133, 0, 134, 0, 135, + 0, 136, 0, 137, 0, 138, 0, 125, 0, 126, + 0, 127, 0, 128, 0, 27, 0, 28, 0, 93, + 0, 94, 0, 95, 0, 96, 0, 140, 0, 141, + 0, 142, 0, 143, 0, 144, 0, 145, 0, 146, + 0, 147, 0, 148, 0, 149, 0, 150, 0, 151, + 0, 139, 0, 16, 0, 14, 0, 12, 0, 10, + 0, 17, 0, 15, 0, 13, 0, 11, 0, 175, + 0, 176, 0, 18, 0, 19, 0, 211, 152, 0, + 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, + 0, 46, 0, 47, 0, 0, 0, 65, 0, 66, + 0, 67, 0, 68, 0, 69, 0, 70, 0, 64, + 4, 0, 0, 57, 4, 0, 0, 153, 57, 4, + 0, 34, 24, 0, 0, 184, 0, 0, 153, 187, + 186, 0, 184, 0, 57, 4, 0, 190, 0, 8, + 0, 192, 0, 8, 0, 192, 0, 9, 0, 10, + 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, + 0, 16, 0, 17, 0, 18, 0, 19, 0, 21, + 0, 191, 0, 48, 0, 227, 0, 154, 4, 0, + 189, 155, 194, 156, 0, 157, 4, 158, 192, 159, + 0, 160, 4, 158, 192, 161, 0, 162, 193, 163, + 0, 162, 163, 0, 160, 162, 193, 163, 161, 0, + 160, 162, 163, 161, 0, 192, 164, 0, 192, 0, + 193, 153, 192, 0, 193, 0, 193, 153, 37, 0, + 37, 0, 0, 190, 157, 197, 159, 0, 190, 157, + 159, 0, 190, 165, 24, 0, 190, 160, 197, 161, + 0, 190, 162, 197, 163, 0, 190, 162, 163, 0, + 190, 160, 162, 197, 163, 161, 0, 190, 160, 162, + 163, 161, 0, 190, 38, 0, 190, 39, 0, 190, + 227, 0, 190, 196, 0, 190, 26, 0, 175, 167, + 0, 176, 4, 0, 9, 27, 0, 9, 28, 0, + 178, 7, 0, 174, 155, 195, 36, 190, 156, 0, + 110, 155, 195, 242, 156, 0, 112, 155, 195, 153, + 195, 153, 195, 156, 0, 168, 155, 195, 153, 195, + 156, 0, 169, 155, 195, 153, 195, 156, 0, 170, + 155, 195, 153, 195, 156, 0, 103, 171, 155, 195, + 153, 195, 156, 0, 104, 172, 155, 195, 153, 195, + 156, 0, 173, 155, 195, 153, 195, 156, 0, 114, + 155, 195, 153, 195, 156, 0, 115, 155, 195, 153, + 195, 153, 195, 156, 0, 116, 155, 195, 153, 195, + 153, 195, 156, 0, 197, 153, 195, 0, 195, 0, + 32, 0, 33, 0, 200, 0, 200, 220, 0, 200, + 222, 0, 200, 62, 61, 206, 0, 200, 25, 0, + 201, 0, 201, 179, 20, 188, 0, 201, 222, 0, + 201, 62, 61, 206, 0, 0, 201, 179, 180, 198, + 195, 202, 186, 0, 0, 201, 179, 50, 198, 190, + 203, 186, 0, 0, 201, 179, 45, 198, 190, 204, + 186, 0, 0, 201, 179, 47, 198, 190, 205, 186, + 0, 201, 51, 208, 0, 201, 58, 152, 209, 0, + 0, 24, 0, 56, 0, 55, 0, 53, 152, 207, + 0, 54, 152, 4, 0, 52, 152, 24, 0, 71, + 152, 24, 0, 157, 210, 159, 0, 210, 153, 24, + 0, 24, 0, 0, 22, 0, 24, 0, 211, 0, + 0, 190, 212, 0, 214, 153, 213, 0, 213, 0, + 214, 0, 214, 153, 37, 0, 37, 0, 0, 181, + 188, 211, 155, 215, 156, 185, 182, 0, 29, 0, + 162, 0, 180, 216, 217, 0, 30, 0, 163, 0, + 230, 219, 0, 0, 45, 0, 47, 0, 0, 0, + 31, 223, 221, 224, 216, 0, 0, 63, 0, 3, + 0, 4, 0, 7, 0, 27, 0, 28, 0, 38, + 0, 39, 0, 26, 0, 160, 197, 161, 0, 196, + 0, 61, 225, 24, 153, 24, 0, 166, 0, 211, + 0, 227, 0, 226, 0, 190, 228, 0, 230, 231, + 0, 218, 231, 0, 232, 179, 234, 0, 232, 236, + 0, 0, 23, 0, 77, 0, 78, 0, 72, 229, + 0, 72, 8, 0, 73, 21, 228, 0, 73, 9, + 228, 153, 21, 228, 153, 21, 228, 0, 74, 177, + 228, 153, 21, 228, 157, 235, 159, 0, 74, 177, + 228, 153, 21, 228, 157, 159, 0, 75, 181, 188, + 228, 155, 239, 156, 36, 21, 228, 233, 21, 228, + 0, 233, 0, 76, 0, 235, 177, 226, 153, 21, + 228, 0, 177, 226, 153, 21, 228, 0, 179, 241, + 0, 190, 157, 228, 153, 228, 159, 0, 237, 153, + 157, 228, 153, 228, 159, 0, 229, 0, 238, 153, + 229, 0, 238, 0, 0, 60, 59, 0, 59, 0, + 168, 190, 228, 153, 228, 0, 169, 190, 228, 153, + 228, 0, 170, 190, 228, 153, 228, 0, 103, 171, + 190, 228, 153, 228, 0, 104, 172, 190, 228, 153, + 228, 0, 49, 229, 0, 173, 229, 153, 229, 0, + 174, 229, 36, 190, 0, 112, 229, 153, 229, 153, + 229, 0, 113, 229, 153, 190, 0, 117, 229, 153, + 190, 0, 118, 229, 153, 190, 0, 114, 229, 153, + 229, 0, 115, 229, 153, 229, 153, 229, 0, 116, + 229, 153, 229, 153, 229, 0, 111, 237, 0, 240, + 181, 188, 228, 155, 239, 156, 0, 244, 0, 153, + 238, 0, 0, 35, 0, 0, 105, 190, 183, 0, + 105, 190, 153, 15, 228, 183, 0, 106, 190, 183, + 0, 106, 190, 153, 15, 228, 183, 0, 107, 229, + 0, 243, 108, 190, 228, 0, 243, 109, 229, 153, + 190, 228, 0, 110, 190, 228, 242, 0 +}; -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; #endif -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 1594, 1595, 1603, 1604, 1614, 1614, 1614, 1614, 1614, 1614, + 1614, 1614, 1614, 1614, 1614, 1618, 1618, 1618, 1622, 1622, + 1622, 1622, 1622, 1622, 1626, 1626, 1627, 1627, 1628, 1628, + 1629, 1629, 1630, 1630, 1634, 1634, 1635, 1635, 1636, 1636, + 1637, 1637, 1638, 1638, 1639, 1639, 1640, 1640, 1641, 1642, + 1645, 1645, 1645, 1645, 1649, 1649, 1649, 1649, 1649, 1649, + 1649, 1650, 1650, 1650, 1650, 1650, 1650, 1656, 1656, 1656, + 1656, 1660, 1660, 1660, 1660, 1664, 1664, 1668, 1668, 1673, + 1676, 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1692, + 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1709, 1710, 1718, + 1719, 1727, 1736, 1737, 1744, 1745, 1749, 1753, 1769, 1770, + 1777, 1778, 1785, 1793, 1793, 1793, 1793, 1793, 1793, 1793, + 1794, 1794, 1794, 1794, 1794, 1799, 1803, 1807, 1812, 1821, + 1838, 1844, 1857, 1866, 1870, 1881, 1885, 1898, 1902, 1909, + 1910, 1916, 1923, 1935, 1965, 1978, 2001, 2029, 2051, 2062, + 2084, 2095, 2104, 2109, 2167, 2174, 2182, 2189, 2196, 2200, + 2204, 2213, 2228, 2241, 2250, 2278, 2291, 2300, 2306, 2312, + 2323, 2329, 2335, 2346, 2347, 2356, 2357, 2369, 2378, 2379, + 2380, 2381, 2382, 2398, 2418, 2420, 2422, 2426, 2429, 2433, + 2436, 2440, 2443, 2448, 2451, 2453, 2455, 2460, 2474, 2475, + 2479, 2482, 2490, 2494, 2501, 2505, 2509, 2513, 2521, 2521, + 2525, 2526, 2530, 2538, 2543, 2551, 2552, 2559, 2566, 2570, + 2746, 2746, 2750, 2760, 2760, 2764, 2769, 2770, 2771, 2775, + 2776, 2776, 2788, 2789, 2794, 2795, 2796, 2797, 2798, 2799, + 2800, 2801, 2802, 2823, 2826, 2841, 2842, 2847, 2847, 2855, + 2864, 2867, 2876, 2886, 2891, 2900, 2911, 2911, 2914, 2917, + 2920, 2924, 2930, 2945, 2951, 3007, 3010, 3016, 3026, 3039, + 3068, 3076, 3084, 3088, 3095, 3096, 3100, 3103, 3109, 3126, + 3142, 3156, 3168, 3180, 3191, 3209, 3218, 3227, 3234, 3255, + 3279, 3285, 3291, 3297, 3313, 3391, 3399, 3400, 3404, 3405, + 3409, 3415, 3421, 3427, 3433, 3440, 3452, 3477 +}; #endif -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int i) -#else -static int -YYID (i) - int i; -#endif -{ - return i; -} +static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", +"EUINT64VAL","SINTVAL","UINTVAL","FPVAL","VOID","BOOL","SBYTE","UBYTE","SHORT", +"USHORT","INT","UINT","LONG","ULONG","FLOAT","DOUBLE","TYPE","LABEL","VAR_ID", +"LABELSTR","STRINGCONSTANT","IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK", +"BEGINTOK","ENDTOK","DECLARE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO", +"DOTDOTDOT","NULL_TOK","UNDEF","CONST","INTERNAL","LINKONCE","WEAK","APPENDING", +"DLLIMPORT","DLLEXPORT","EXTERN_WEAK","OPAQUE","NOT","EXTERNAL","TARGET","TRIPLE", +"ENDIAN","POINTERSIZE","LITTLE","BIG","ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK", +"MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","CSRETCC_TOK","FASTCC_TOK","COLDCC_TOK", +"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE", +"UNREACHABLE","UNWIND","EXCEPT","ADD","SUB","MUL","DIV","UDIV","SDIV","FDIV", +"REM","UREM","SREM","FREM","AND","OR","XOR","SHL","SHR","ASHR","LSHR","SETLE", +"SETGE","SETLT","SETGT","SETEQ","SETNE","ICMP","FCMP","MALLOC","ALLOCA","FREE", +"LOAD","STORE","GETELEMENTPTR","PHI_TOK","SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT", +"SHUFFLEVECTOR","VAARG_old","VANEXT_old","EQ","NE","SLT","SGT","SLE","SGE","ULT", +"UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD","UNO","UEQ","UNE", +"CAST","TRUNC","ZEXT","SEXT","FPTRUNC","FPEXT","FPTOUI","FPTOSI","UITOFP","SITOFP", +"PTRTOINT","INTTOPTR","BITCAST","'='","','","'\\\\'","'('","')'","'['","'x'", +"']'","'<'","'>'","'{'","'}'","'*'","'c'","INTVAL","EINT64VAL","ArithmeticOps", +"LogicalOps","SetCondOps","IPredicates","FPredicates","ShiftOps","CastOps","SIntType", +"UIntType","IntType","FPType","OptAssign","OptLinkage","OptCallingConv","OptAlign", +"OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", +"TypesV","UpRTypesV","Types","PrimType","UpRTypes","TypeListI","ArgTypeListI", +"ConstVal","ConstExpr","ConstVector","GlobalType","Module","FunctionList","ConstPool", +"@1","@2","@3","@4","AsmBlock","BigOrLittle","TargetDefinition","LibrariesDefinition", +"LibList","Name","OptName","ArgVal","ArgListH","ArgList","FunctionHeaderH","BEGIN", +"FunctionHeader","END","Function","FnDeclareLinkage","FunctionProto","@5","@6", +"OptSideEffect","ConstValueRef","SymbolicValueRef","ValueRef","ResolvedVal", +"BasicBlockList","BasicBlock","InstructionList","Unwind","BBTerminatorInst", +"JumpTable","Inst","PHIList","ValueRefList","ValueRefListE","OptTailCall","InstVal", +"IndexList","OptVolatile","MemoryInst", NULL +}; #endif -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss; - YYSTYPE yyvs; - }; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 4 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1762 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 166 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 80 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 309 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 605 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 406 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 155, 156, 164, 2, 153, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 160, 152, 161, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 157, 154, 159, 2, 2, 2, 2, 2, 165, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 158, 2, 2, 162, 2, 163, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151 +static const short yyr1[] = { 0, + 166, 166, 167, 167, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 169, 169, 169, 170, 170, + 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, + 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, + 175, 176, 176, 176, 176, 177, 177, 178, 178, 179, + 179, 180, 180, 180, 180, 180, 180, 180, 180, 181, + 181, 181, 181, 181, 181, 181, 181, 182, 182, 183, + 183, 184, 185, 185, 186, 186, 187, 187, 188, 188, + 189, 189, 190, 191, 191, 191, 191, 191, 191, 191, + 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, + 192, 192, 192, 192, 192, 192, 192, 193, 193, 194, + 194, 194, 194, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, + 196, 196, 196, 197, 197, 198, 198, 199, 200, 200, + 200, 200, 200, 201, 201, 201, 202, 201, 203, 201, + 204, 201, 205, 201, 201, 201, 201, 206, 207, 207, + 208, 208, 208, 208, 209, 210, 210, 210, 211, 211, + 212, 212, 213, 214, 214, 215, 215, 215, 215, 216, + 217, 217, 218, 219, 219, 220, 221, 221, 221, 223, + 224, 222, 225, 225, 226, 226, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 227, 227, 228, 228, 229, + 230, 230, 231, 232, 232, 232, 233, 233, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 235, 235, 236, + 237, 237, 238, 238, 239, 239, 240, 240, 241, 241, + 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, + 241, 241, 241, 241, 241, 241, 242, 242, 243, 243, + 244, 244, 244, 244, 244, 244, 244, 244 }; -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, - 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, - 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, - 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, - 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, - 159, 161, 164, 165, 167, 169, 171, 173, 175, 177, - 179, 180, 181, 183, 185, 187, 189, 191, 193, 196, - 197, 200, 201, 205, 208, 209, 211, 212, 216, 218, - 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, - 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, - 261, 264, 269, 275, 281, 285, 288, 294, 299, 302, - 304, 308, 310, 314, 316, 317, 322, 326, 330, 335, - 340, 344, 351, 357, 360, 363, 366, 369, 372, 375, - 378, 381, 384, 387, 394, 400, 409, 416, 423, 430, - 438, 446, 453, 460, 469, 478, 482, 484, 486, 488, - 490, 493, 496, 501, 504, 506, 511, 514, 519, 520, - 528, 529, 537, 538, 546, 547, 555, 559, 564, 565, - 567, 569, 571, 575, 579, 583, 587, 591, 595, 597, - 598, 600, 602, 604, 605, 608, 612, 614, 616, 620, - 622, 623, 632, 634, 636, 640, 642, 644, 647, 648, - 650, 652, 653, 654, 660, 661, 663, 665, 667, 669, - 671, 673, 675, 677, 679, 683, 685, 691, 693, 695, - 697, 699, 702, 705, 708, 712, 715, 716, 718, 720, - 722, 725, 728, 732, 742, 752, 761, 775, 777, 779, - 786, 792, 795, 802, 810, 812, 816, 818, 819, 822, - 824, 830, 836, 842, 849, 856, 859, 864, 869, 876, - 881, 886, 891, 896, 903, 910, 913, 921, 923, 926, - 927, 929, 930, 934, 941, 945, 952, 955, 960, 967 +static const short yyr2[] = { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 2, 0, 2, 0, + 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, + 5, 5, 3, 2, 5, 4, 2, 1, 3, 1, + 3, 1, 0, 4, 3, 3, 4, 4, 3, 6, + 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 6, 5, 8, 6, 6, 6, 7, 7, 6, + 6, 8, 8, 3, 1, 1, 1, 1, 2, 2, + 4, 2, 1, 4, 2, 4, 0, 7, 0, 7, + 0, 7, 0, 7, 3, 4, 0, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 1, 0, 1, 1, + 1, 0, 2, 3, 1, 1, 3, 1, 0, 8, + 1, 1, 3, 1, 1, 2, 0, 1, 1, 0, + 0, 5, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 1, 5, 1, 1, 1, 1, 2, + 2, 2, 3, 2, 0, 1, 1, 1, 2, 2, + 3, 9, 9, 8, 13, 1, 1, 6, 5, 2, + 6, 7, 1, 3, 1, 0, 2, 1, 5, 5, + 5, 6, 6, 2, 4, 4, 6, 4, 4, 4, + 4, 6, 6, 2, 7, 1, 2, 0, 1, 0, + 3, 6, 3, 6, 2, 4, 6, 4 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 200, 0, -1, 5, -1, 6, -1, 3, -1, 4, - -1, 79, -1, 80, -1, 81, -1, 82, -1, 83, - -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, - -1, 89, -1, 90, -1, 91, -1, 92, -1, 97, - -1, 98, -1, 99, -1, 100, -1, 101, -1, 102, - -1, 119, -1, 120, -1, 121, -1, 122, -1, 123, - -1, 124, -1, 125, -1, 126, -1, 127, -1, 128, - -1, 129, -1, 130, -1, 131, -1, 132, -1, 133, - -1, 134, -1, 135, -1, 136, -1, 137, -1, 138, - -1, 125, -1, 126, -1, 127, -1, 128, -1, 27, - -1, 28, -1, 93, -1, 94, -1, 95, -1, 96, - -1, 140, -1, 141, -1, 142, -1, 143, -1, 144, - -1, 145, -1, 146, -1, 147, -1, 148, -1, 149, - -1, 150, -1, 151, -1, 139, -1, 16, -1, 14, - -1, 12, -1, 10, -1, 17, -1, 15, -1, 13, - -1, 11, -1, 176, -1, 177, -1, 18, -1, 19, - -1, 212, 152, -1, -1, 41, -1, 42, -1, 43, - -1, 44, -1, 45, -1, 46, -1, 47, -1, -1, - -1, 65, -1, 66, -1, 67, -1, 68, -1, 69, - -1, 70, -1, 64, 4, -1, -1, 57, 4, -1, - -1, 153, 57, 4, -1, 34, 24, -1, -1, 185, - -1, -1, 153, 188, 187, -1, 185, -1, 57, 4, - -1, 191, -1, 8, -1, 193, -1, 8, -1, 193, - -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, - -1, 14, -1, 15, -1, 16, -1, 17, -1, 18, - -1, 19, -1, 21, -1, 192, -1, 48, -1, 228, - -1, 154, 4, -1, 190, 155, 195, 156, -1, 157, - 4, 158, 193, 159, -1, 160, 4, 158, 193, 161, - -1, 162, 194, 163, -1, 162, 163, -1, 160, 162, - 194, 163, 161, -1, 160, 162, 163, 161, -1, 193, - 164, -1, 193, -1, 194, 153, 193, -1, 194, -1, - 194, 153, 37, -1, 37, -1, -1, 191, 157, 198, - 159, -1, 191, 157, 159, -1, 191, 165, 24, -1, - 191, 160, 198, 161, -1, 191, 162, 198, 163, -1, - 191, 162, 163, -1, 191, 160, 162, 198, 163, 161, - -1, 191, 160, 162, 163, 161, -1, 191, 38, -1, - 191, 39, -1, 191, 228, -1, 191, 197, -1, 191, - 26, -1, 176, 168, -1, 177, 4, -1, 9, 27, - -1, 9, 28, -1, 179, 7, -1, 175, 155, 196, - 36, 191, 156, -1, 110, 155, 196, 243, 156, -1, - 112, 155, 196, 153, 196, 153, 196, 156, -1, 169, - 155, 196, 153, 196, 156, -1, 170, 155, 196, 153, - 196, 156, -1, 171, 155, 196, 153, 196, 156, -1, - 103, 172, 155, 196, 153, 196, 156, -1, 104, 173, - 155, 196, 153, 196, 156, -1, 174, 155, 196, 153, - 196, 156, -1, 114, 155, 196, 153, 196, 156, -1, - 115, 155, 196, 153, 196, 153, 196, 156, -1, 116, - 155, 196, 153, 196, 153, 196, 156, -1, 198, 153, - 196, -1, 196, -1, 32, -1, 33, -1, 201, -1, - 201, 221, -1, 201, 223, -1, 201, 62, 61, 207, - -1, 201, 25, -1, 202, -1, 202, 180, 20, 189, - -1, 202, 223, -1, 202, 62, 61, 207, -1, -1, - 202, 180, 181, 199, 196, 203, 187, -1, -1, 202, - 180, 50, 199, 191, 204, 187, -1, -1, 202, 180, - 45, 199, 191, 205, 187, -1, -1, 202, 180, 47, - 199, 191, 206, 187, -1, 202, 51, 209, -1, 202, - 58, 152, 210, -1, -1, 24, -1, 56, -1, 55, - -1, 53, 152, 208, -1, 54, 152, 4, -1, 52, - 152, 24, -1, 71, 152, 24, -1, 157, 211, 159, - -1, 211, 153, 24, -1, 24, -1, -1, 22, -1, - 24, -1, 212, -1, -1, 191, 213, -1, 215, 153, - 214, -1, 214, -1, 215, -1, 215, 153, 37, -1, - 37, -1, -1, 182, 189, 212, 155, 216, 156, 186, - 183, -1, 29, -1, 162, -1, 181, 217, 218, -1, - 30, -1, 163, -1, 231, 220, -1, -1, 45, -1, - 47, -1, -1, -1, 31, 224, 222, 225, 217, -1, - -1, 63, -1, 3, -1, 4, -1, 7, -1, 27, - -1, 28, -1, 38, -1, 39, -1, 26, -1, 160, - 198, 161, -1, 197, -1, 61, 226, 24, 153, 24, - -1, 167, -1, 212, -1, 228, -1, 227, -1, 191, - 229, -1, 231, 232, -1, 219, 232, -1, 233, 180, - 235, -1, 233, 237, -1, -1, 23, -1, 77, -1, - 78, -1, 72, 230, -1, 72, 8, -1, 73, 21, - 229, -1, 73, 9, 229, 153, 21, 229, 153, 21, - 229, -1, 74, 178, 229, 153, 21, 229, 157, 236, - 159, -1, 74, 178, 229, 153, 21, 229, 157, 159, - -1, 75, 182, 189, 229, 155, 240, 156, 36, 21, - 229, 234, 21, 229, -1, 234, -1, 76, -1, 236, - 178, 227, 153, 21, 229, -1, 178, 227, 153, 21, - 229, -1, 180, 242, -1, 191, 157, 229, 153, 229, - 159, -1, 238, 153, 157, 229, 153, 229, 159, -1, - 230, -1, 239, 153, 230, -1, 239, -1, -1, 60, - 59, -1, 59, -1, 169, 191, 229, 153, 229, -1, - 170, 191, 229, 153, 229, -1, 171, 191, 229, 153, - 229, -1, 103, 172, 191, 229, 153, 229, -1, 104, - 173, 191, 229, 153, 229, -1, 49, 230, -1, 174, - 230, 153, 230, -1, 175, 230, 36, 191, -1, 112, - 230, 153, 230, 153, 230, -1, 113, 230, 153, 191, - -1, 117, 230, 153, 191, -1, 118, 230, 153, 191, - -1, 114, 230, 153, 230, -1, 115, 230, 153, 230, - 153, 230, -1, 116, 230, 153, 230, 153, 230, -1, - 111, 238, -1, 241, 182, 189, 229, 155, 240, 156, - -1, 245, -1, 153, 239, -1, -1, 35, -1, -1, - 105, 191, 184, -1, 105, 191, 153, 15, 229, 184, - -1, 106, 191, 184, -1, 106, 191, 153, 15, 229, - 184, -1, 107, 230, -1, 244, 108, 191, 229, -1, - 244, 109, 230, 153, 191, 229, -1, 110, 191, 229, - 243, -1 +static const short yydefact[] = { 197, + 89, 183, 182, 230, 82, 83, 84, 85, 86, 87, + 88, 0, 90, 255, 179, 180, 255, 209, 210, 0, + 0, 0, 89, 0, 185, 227, 0, 0, 91, 92, + 93, 94, 95, 96, 0, 0, 256, 252, 81, 224, + 225, 226, 251, 0, 0, 0, 0, 195, 0, 0, + 0, 0, 0, 0, 0, 80, 228, 229, 231, 198, + 181, 97, 1, 2, 110, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 127, 0, 0, + 0, 0, 246, 0, 0, 109, 126, 113, 247, 128, + 221, 222, 223, 300, 254, 0, 0, 0, 0, 208, + 196, 186, 184, 176, 177, 0, 0, 0, 0, 90, + 129, 0, 0, 0, 112, 134, 138, 0, 0, 143, + 137, 299, 0, 278, 0, 0, 0, 0, 90, 267, + 257, 258, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 51, 52, 53, 54, + 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 67, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 0, 0, 0, 0, 0, 266, 253, + 90, 270, 0, 296, 203, 200, 199, 201, 202, 204, + 207, 0, 191, 193, 189, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 0, 0, 0, 0, + 187, 232, 0, 0, 0, 0, 0, 133, 219, 142, + 140, 0, 0, 284, 277, 260, 259, 0, 0, 71, + 75, 70, 74, 69, 73, 68, 72, 76, 77, 0, + 0, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 0, 49, 50, 45, 46, 47, 48, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 0, 100, + 100, 305, 0, 0, 294, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 205, 105, 105, 105, 159, 160, 3, 4, 157, + 158, 161, 156, 152, 153, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 155, 154, 105, 111, 111, 136, 0, 139, 218, + 212, 215, 216, 0, 0, 130, 235, 236, 237, 242, + 238, 239, 240, 241, 233, 0, 244, 249, 248, 250, + 0, 261, 0, 0, 0, 0, 0, 301, 0, 303, + 298, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 206, 0, + 192, 194, 190, 0, 0, 0, 0, 0, 0, 0, + 145, 175, 0, 0, 0, 149, 0, 146, 0, 0, + 0, 0, 0, 188, 131, 132, 135, 211, 213, 0, + 103, 141, 234, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 308, 0, 0, 0, 288, 291, + 0, 0, 289, 290, 0, 0, 0, 285, 286, 0, + 306, 0, 0, 0, 107, 105, 0, 0, 298, 0, + 0, 0, 0, 0, 144, 134, 113, 0, 147, 148, + 0, 0, 0, 0, 0, 217, 214, 104, 98, 0, + 243, 0, 0, 276, 0, 0, 100, 101, 100, 273, + 297, 0, 0, 0, 0, 0, 279, 280, 281, 276, + 0, 102, 108, 106, 0, 0, 0, 0, 0, 0, + 0, 174, 151, 0, 0, 0, 0, 0, 0, 0, + 220, 0, 0, 0, 275, 0, 282, 283, 0, 302, + 304, 0, 0, 0, 287, 292, 293, 0, 307, 0, + 0, 163, 0, 0, 0, 0, 150, 0, 0, 0, + 0, 0, 99, 245, 0, 0, 0, 274, 271, 0, + 295, 0, 0, 0, 171, 0, 0, 165, 166, 167, + 170, 162, 0, 264, 0, 0, 0, 272, 168, 169, + 0, 0, 0, 262, 0, 263, 0, 0, 164, 172, + 173, 0, 0, 0, 0, 0, 0, 269, 0, 0, + 268, 265, 0, 0, 0 }; -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 1594, 1594, 1595, 1603, 1604, 1614, 1614, 1614, 1614, - 1614, 1614, 1614, 1614, 1614, 1614, 1614, 1618, 1618, 1618, - 1622, 1622, 1622, 1622, 1622, 1622, 1626, 1626, 1627, 1627, - 1628, 1628, 1629, 1629, 1630, 1630, 1634, 1634, 1635, 1635, - 1636, 1636, 1637, 1637, 1638, 1638, 1639, 1639, 1640, 1640, - 1641, 1642, 1645, 1645, 1645, 1645, 1649, 1649, 1649, 1649, - 1649, 1649, 1649, 1650, 1650, 1650, 1650, 1650, 1650, 1656, - 1656, 1656, 1656, 1660, 1660, 1660, 1660, 1664, 1664, 1668, - 1668, 1673, 1676, 1681, 1682, 1683, 1684, 1685, 1686, 1687, - 1688, 1692, 1693, 1694, 1695, 1696, 1697, 1698, 1699, 1709, - 1710, 1718, 1719, 1727, 1736, 1737, 1744, 1745, 1749, 1753, - 1769, 1770, 1777, 1778, 1785, 1793, 1793, 1793, 1793, 1793, - 1793, 1793, 1794, 1794, 1794, 1794, 1794, 1799, 1803, 1807, - 1812, 1821, 1838, 1844, 1857, 1866, 1870, 1881, 1885, 1898, - 1902, 1909, 1910, 1916, 1923, 1935, 1965, 1978, 2001, 2029, - 2051, 2062, 2084, 2095, 2104, 2109, 2167, 2174, 2182, 2189, - 2196, 2200, 2204, 2213, 2228, 2241, 2250, 2278, 2291, 2300, - 2306, 2312, 2323, 2329, 2335, 2346, 2347, 2356, 2357, 2369, - 2378, 2379, 2380, 2381, 2382, 2398, 2418, 2420, 2422, 2422, - 2429, 2429, 2436, 2436, 2443, 2443, 2451, 2453, 2455, 2460, - 2474, 2475, 2479, 2482, 2490, 2494, 2501, 2505, 2509, 2513, - 2521, 2521, 2525, 2526, 2530, 2538, 2543, 2551, 2552, 2559, - 2566, 2570, 2746, 2746, 2750, 2760, 2760, 2764, 2769, 2770, - 2771, 2775, 2776, 2775, 2788, 2789, 2794, 2795, 2796, 2797, - 2798, 2799, 2800, 2801, 2802, 2823, 2826, 2841, 2842, 2847, - 2847, 2855, 2864, 2867, 2876, 2886, 2891, 2900, 2911, 2911, - 2914, 2917, 2920, 2924, 2930, 2945, 2951, 3007, 3010, 3016, - 3026, 3039, 3068, 3076, 3084, 3088, 3095, 3096, 3100, 3103, - 3109, 3126, 3142, 3156, 3168, 3180, 3191, 3209, 3218, 3227, - 3234, 3255, 3279, 3285, 3291, 3297, 3313, 3391, 3399, 3400, - 3404, 3405, 3409, 3415, 3421, 3427, 3433, 3440, 3452, 3477 +static const short yydefgoto[] = { 83, + 310, 327, 328, 329, 262, 279, 330, 331, 217, 218, + 250, 219, 23, 13, 35, 521, 368, 455, 479, 391, + 456, 84, 85, 220, 87, 88, 118, 232, 402, 357, + 403, 106, 603, 1, 2, 334, 305, 303, 304, 61, + 198, 48, 101, 202, 89, 419, 342, 343, 344, 36, + 93, 14, 42, 15, 59, 16, 26, 110, 424, 358, + 90, 360, 490, 17, 38, 39, 189, 190, 576, 95, + 285, 525, 526, 191, 192, 435, 193, 194 }; -#endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL", - "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", - "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", - "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", - "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", - "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", - "WEAK", "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", - "NOT", "EXTERNAL", "TARGET", "TRIPLE", "ENDIAN", "POINTERSIZE", "LITTLE", - "BIG", "ALIGN", "DEPLIBS", "CALL", "TAIL", "ASM_TOK", "MODULE", - "SIDEEFFECT", "CC_TOK", "CCC_TOK", "CSRETCC_TOK", "FASTCC_TOK", - "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", - "RET", "BR", "SWITCH", "INVOKE", "UNREACHABLE", "UNWIND", "EXCEPT", - "ADD", "SUB", "MUL", "DIV", "UDIV", "SDIV", "FDIV", "REM", "UREM", - "SREM", "FREM", "AND", "OR", "XOR", "SHL", "SHR", "ASHR", "LSHR", - "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", "ICMP", "FCMP", - "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", - "SELECT", "VAARG", "EXTRACTELEMENT", "INSERTELEMENT", "SHUFFLEVECTOR", - "VAARG_old", "VANEXT_old", "EQ", "NE", "SLT", "SGT", "SLE", "SGE", "ULT", - "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", "OLE", "OGE", "ORD", - "UNO", "UEQ", "UNE", "CAST", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", "FPEXT", - "FPTOUI", "FPTOSI", "UITOFP", "SITOFP", "PTRTOINT", "INTTOPTR", - "BITCAST", "'='", "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", - "'<'", "'>'", "'{'", "'}'", "'*'", "'c'", "$accept", "INTVAL", - "EINT64VAL", "ArithmeticOps", "LogicalOps", "SetCondOps", "IPredicates", - "FPredicates", "ShiftOps", "CastOps", "SIntType", "UIntType", "IntType", - "FPType", "OptAssign", "OptLinkage", "OptCallingConv", "OptAlign", - "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", - "GlobalVarAttribute", "TypesV", "UpRTypesV", "Types", "PrimType", - "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", "ConstExpr", - "ConstVector", "GlobalType", "Module", "FunctionList", "ConstPool", "@1", - "@2", "@3", "@4", "AsmBlock", "BigOrLittle", "TargetDefinition", - "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", - "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", - "END", "Function", "FnDeclareLinkage", "FunctionProto", "@5", "@6", - "OptSideEffect", "ConstValueRef", "SymbolicValueRef", "ValueRef", - "ResolvedVal", "BasicBlockList", "BasicBlock", "InstructionList", - "Unwind", "BBTerminatorInst", "JumpTable", "Inst", "PHIList", - "ValueRefList", "ValueRefListE", "OptTailCall", "InstVal", "IndexList", - "OptVolatile", "MemoryInst", 0 +static const short yypact[] = {-32768, + 58, 247,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, -44, 181, 69,-32768,-32768, 10,-32768,-32768, 16, + -116, 34, 65, -38,-32768, 112, 118, 144,-32768,-32768, +-32768,-32768,-32768,-32768, 1357, -19,-32768,-32768, 39,-32768, +-32768,-32768,-32768, 6, 12, 20, 23,-32768, 55, 118, + 1357, 86, 86, 86, 86,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 36,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 210, 218, + 1, 171,-32768, 39, 73,-32768,-32768, -42,-32768,-32768, +-32768,-32768,-32768, 1611,-32768, 215, 83, 236, 219, 233, +-32768,-32768,-32768,-32768,-32768, 1418, 1418, 1418, 1459, 181, +-32768, 84, 100, 737,-32768,-32768, -42, -99, 104, 803, +-32768,-32768, 1418,-32768, 201, 1479, 14, 221, 181,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 77, 377, 1418, 1418, + 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 1418, 1418, 1418, 1418, 1418,-32768,-32768, + 181,-32768, 53,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, -36,-32768,-32768,-32768, 140, 167, 257, 204, 262, + 206, 264, 214, 266, 265, 268, 217, 269, 270, 579, +-32768,-32768, 1418, 1418, 115, -96, 1418,-32768, 1199,-32768, + 128, 126, 920,-32768,-32768, 36,-32768, 920, 920,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 920, + 1357,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 1418,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1418, 130, + 142,-32768, 920, 139, 151, 153, 154, 155, 157, 158, + 164, 165, 920, 920, 920, 166, 284, 1357, 1418, 1418, + 297,-32768, 169, 169, 169,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 77, 377, 168, 172, 174, + 175, 177, 1240, 1520, 757, 300, 180, 182, 183, 192, + 193,-32768,-32768, 169, -43, -71,-32768, 190, -42,-32768, + 39,-32768, 173, 202, 1260,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 273, 1459,-32768,-32768,-32768,-32768, + 209,-32768, 212, 920, 920, 920, -4,-32768, -2,-32768, + 213, 920, 211, 1418, 1418, 1418, 1418, 1418, 1418, 1418, + 216, 222, 223, 1418, 1418, 920, 920, 226,-32768, -20, +-32768,-32768,-32768, 225, 227, 1459, 1459, 1459, 1459, 1459, +-32768,-32768, -13, 778, -17,-32768, -69,-32768, 1459, 1459, + 1459, 1459, 1459,-32768,-32768,-32768,-32768,-32768,-32768, 1301, + 325,-32768,-32768, 346, -16, 350, 360, 228, 231, 234, + 920, 382, 920, 1418,-32768, 235, 920, 237,-32768,-32768, + 238, 239,-32768,-32768, 920, 920, 920,-32768,-32768, 240, +-32768, 1418, 365, 389,-32768, 169, 1459, 1459, 213, 241, + 243, 245, 248, 1459,-32768, 242, -104, -67,-32768,-32768, + 249, 253, 263, 272, 364,-32768,-32768,-32768, 358, 274, +-32768, 920, 920, 1418, 920, 920, 276,-32768, 276,-32768, + 279, 920, 280, 1418, 1418, 1418,-32768,-32768,-32768, 1418, + 920,-32768,-32768,-32768, 281, 282, 267, 1459, 1459, 1459, + 1459,-32768,-32768, 278, 1459, 1459, 1459, 1459, 1418, 422, +-32768, 416, 288, 285, 279, 289,-32768,-32768, 390,-32768, +-32768, 1418, 287, 920,-32768,-32768,-32768, 292,-32768, 1459, + 1459,-32768, 299, 298, 302, 303,-32768, 301, 306, 307, + 308, 310,-32768,-32768, 432, 15, 435,-32768,-32768, 309, +-32768, 316, 319, 1459,-32768, 1459, 1459,-32768,-32768,-32768, +-32768,-32768, 920,-32768, 1046, 64, 437,-32768,-32768,-32768, + 326, 329, 331,-32768, 328,-32768, 1046, 920,-32768,-32768, +-32768, 467, 336, 148, 920, 469, 470,-32768, 920, 920, +-32768,-32768, 493, 494,-32768 }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 61, 44, 92, 40, 41, 91, 120, 93, - 60, 62, 123, 125, 42, 99 +static const short yypgoto[] = {-32768, +-32768, 401, 402, 404, 200, 203, 405, 423, -126, -125, + -535,-32768, 479, 496, -109,-32768, -274, 102,-32768, -296, +-32768, -45,-32768, -35,-32768, -58, 27,-32768, -97, 304, + -306, 101,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 471, +-32768,-32768,-32768,-32768, 13,-32768, 106,-32768,-32768, 412, +-32768,-32768,-32768,-32768,-32768, 525,-32768,-32768,-32768, -553, + -9, 114, -122,-32768, 511,-32768, -65,-32768,-32768,-32768, +-32768, 96, 31,-32768,-32768, 74,-32768,-32768 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 166, 167, 167, 168, 168, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 169, 169, 170, 170, 170, - 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 174, 174, 174, 174, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, - 176, 176, 176, 177, 177, 177, 177, 178, 178, 179, - 179, 180, 180, 181, 181, 181, 181, 181, 181, 181, - 181, 182, 182, 182, 182, 182, 182, 182, 182, 183, - 183, 184, 184, 185, 186, 186, 187, 187, 188, 188, - 189, 189, 190, 190, 191, 192, 192, 192, 192, 192, - 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, - 194, 195, 195, 195, 195, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 198, 198, 199, 199, 200, - 201, 201, 201, 201, 201, 202, 202, 202, 203, 202, - 204, 202, 205, 202, 206, 202, 202, 202, 202, 207, - 208, 208, 209, 209, 209, 209, 210, 211, 211, 211, - 212, 212, 213, 213, 214, 215, 215, 216, 216, 216, - 216, 217, 218, 218, 219, 220, 220, 221, 222, 222, - 222, 224, 225, 223, 226, 226, 227, 227, 227, 227, - 227, 227, 227, 227, 227, 227, 227, 228, 228, 229, - 229, 230, 231, 231, 232, 233, 233, 233, 234, 234, - 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, - 236, 237, 238, 238, 239, 239, 240, 240, 241, 241, - 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, - 244, 244, 245, 245, 245, 245, 245, 245, 245, 245 -}; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, - 2, 0, 3, 2, 0, 1, 0, 3, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 4, 5, 5, 3, 2, 5, 4, 2, 1, - 3, 1, 3, 1, 0, 4, 3, 3, 4, 4, - 3, 6, 5, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 6, 5, 8, 6, 6, 6, 7, - 7, 6, 6, 8, 8, 3, 1, 1, 1, 1, - 2, 2, 4, 2, 1, 4, 2, 4, 0, 7, - 0, 7, 0, 7, 0, 7, 3, 4, 0, 1, - 1, 1, 3, 3, 3, 3, 3, 3, 1, 0, - 1, 1, 1, 0, 2, 3, 1, 1, 3, 1, - 0, 8, 1, 1, 3, 1, 1, 2, 0, 1, - 1, 0, 0, 5, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, - 1, 2, 2, 2, 3, 2, 0, 1, 1, 1, - 2, 2, 3, 9, 9, 8, 13, 1, 1, 6, - 5, 2, 6, 7, 1, 3, 1, 0, 2, 1, - 5, 5, 5, 6, 6, 2, 4, 4, 6, 4, - 4, 4, 4, 6, 6, 2, 7, 1, 2, 0, - 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 -}; +#define YYLAST 1762 -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 198, 0, 90, 184, 1, 183, 231, 83, 84, 85, - 86, 87, 88, 89, 0, 91, 256, 180, 181, 256, - 210, 211, 0, 0, 0, 90, 0, 186, 228, 0, - 0, 92, 93, 94, 95, 96, 97, 0, 0, 257, - 253, 82, 225, 226, 227, 252, 0, 0, 0, 0, - 196, 0, 0, 0, 0, 0, 0, 0, 81, 229, - 230, 232, 199, 182, 98, 2, 3, 111, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 128, 0, 0, 0, 0, 247, 0, 0, 110, 127, - 114, 248, 129, 222, 223, 224, 301, 255, 0, 0, - 0, 0, 209, 197, 187, 185, 177, 178, 0, 0, - 0, 0, 91, 130, 0, 0, 0, 113, 135, 139, - 0, 0, 144, 138, 300, 0, 279, 0, 0, 0, - 0, 91, 268, 258, 259, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 52, - 53, 54, 55, 20, 21, 22, 23, 24, 25, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 68, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, - 0, 267, 254, 91, 271, 0, 297, 204, 201, 200, - 202, 203, 205, 208, 0, 192, 194, 190, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 0, - 0, 0, 0, 188, 233, 0, 0, 0, 0, 0, - 134, 220, 143, 141, 0, 0, 285, 278, 261, 260, - 0, 0, 72, 76, 71, 75, 70, 74, 69, 73, - 77, 78, 0, 0, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 0, 50, 51, 46, 47, 48, - 49, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 0, 101, 101, 306, 0, 0, 295, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 206, 106, 106, 106, 160, 161, - 4, 5, 158, 159, 162, 157, 153, 154, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 156, 155, 106, 112, 112, 137, - 0, 140, 219, 213, 216, 217, 0, 0, 131, 236, - 237, 238, 243, 239, 240, 241, 242, 234, 0, 245, - 250, 249, 251, 0, 262, 0, 0, 0, 0, 0, - 302, 0, 304, 299, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 207, 0, 193, 195, 191, 0, 0, 0, 0, - 0, 0, 0, 146, 176, 0, 0, 0, 150, 0, - 147, 0, 0, 0, 0, 0, 189, 132, 133, 136, - 212, 214, 0, 104, 142, 235, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 309, 0, 0, - 0, 289, 292, 0, 0, 290, 291, 0, 0, 0, - 286, 287, 0, 307, 0, 0, 0, 108, 106, 0, - 0, 299, 0, 0, 0, 0, 0, 145, 135, 114, - 0, 148, 149, 0, 0, 0, 0, 0, 218, 215, - 105, 99, 0, 244, 0, 0, 277, 0, 0, 101, - 102, 101, 274, 298, 0, 0, 0, 0, 0, 280, - 281, 282, 277, 0, 103, 109, 107, 0, 0, 0, - 0, 0, 0, 0, 175, 152, 0, 0, 0, 0, - 0, 0, 0, 221, 0, 0, 0, 276, 0, 283, - 284, 0, 303, 305, 0, 0, 0, 288, 293, 294, - 0, 308, 0, 0, 164, 0, 0, 0, 0, 151, - 0, 0, 0, 0, 0, 100, 246, 0, 0, 0, - 275, 272, 0, 296, 0, 0, 0, 172, 0, 0, - 166, 167, 168, 171, 163, 0, 265, 0, 0, 0, - 273, 169, 170, 0, 0, 0, 263, 0, 264, 0, - 0, 165, 173, 174, 0, 0, 0, 0, 0, 0, - 270, 0, 0, 269, 266 -}; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 85, 312, 329, 330, 331, 264, 281, 332, 333, - 219, 220, 252, 221, 25, 15, 37, 523, 370, 457, - 481, 393, 458, 86, 87, 222, 89, 90, 120, 234, - 404, 359, 405, 108, 1, 2, 3, 336, 307, 305, - 306, 63, 200, 50, 103, 204, 91, 421, 344, 345, - 346, 38, 95, 16, 44, 17, 61, 18, 28, 112, - 426, 360, 92, 362, 492, 19, 40, 41, 191, 192, - 578, 97, 287, 527, 528, 193, 194, 437, 195, 196 +static const short yytable[] = { 86, + 234, 248, 249, 237, 113, 103, 370, 392, 393, 91, + 431, 221, 433, 453, 24, 86, 27, 405, 407, 251, + 575, 585, 238, 117, 240, 241, 242, 243, 244, 245, + 246, 247, 37, 593, 239, 49, 454, 414, 282, 40, + 587, 286, 287, 288, 289, 290, 291, 292, -138, 425, + -111, 24, 432, 227, 432, 117, 227, -178, -138, 121, + 18, 117, 19, 228, 296, 297, 338, 44, 45, 46, + 203, 204, 205, 240, 241, 242, 243, 244, 245, 246, + 247, 298, 3, 464, 51, 464, 47, 233, 4, 416, + 233, 37, 121, 470, 50, 514, 119, 468, 5, 6, + 7, 8, 9, 10, 11, 5, 6, 7, 8, 52, + 10, 53, -111, 56, 54, 415, 301, 104, 105, 12, + 121, 121, 302, 280, 281, 233, 283, 284, 233, 233, + 233, 233, 233, 233, 233, 464, 464, 196, 197, 464, + 226, 60, 92, 469, 481, 465, 231, 62, 293, 294, + 295, 233, 233, 107, 108, 109, 57, 96, 58, 504, + 299, 300, 114, 97, 335, 336, 306, 307, 339, -71, + -71, 98, 41, 574, 99, 63, 64, 388, 115, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + -112, 77, 18, 341, 19, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 364, -70, -70, -69, -69, + 333, 100, 530, 111, 531, 86, -68, -68, 78, 308, + 309, 112, 586, 359, 131, 132, 365, 120, 359, 359, + 240, 241, 242, 243, 244, 245, 246, 247, 195, 199, + 359, 223, 200, 366, 28, 29, 30, 31, 32, 33, + 34, 438, 386, 440, 441, 442, 201, 224, 229, 235, + -75, 448, 86, 387, 233, -74, -81, -73, 18, -72, + 19, -78, 311, 359, -79, 337, 312, 4, -81, -81, + 345, 346, 367, 359, 359, 359, 339, -81, -81, -81, + -81, -81, -81, -81, 369, 372, -81, 20, 459, 460, + 461, 462, 463, 373, 21, 374, 375, 376, 22, 377, + 378, 471, 472, 473, 474, 475, 379, 380, 384, 385, + 389, 390, 396, 408, 79, 420, 397, 80, 398, 399, + 81, 400, 82, 116, 409, 423, 410, 411, 233, 439, + 233, 233, 233, 443, 444, 467, 412, 413, 233, 449, + 417, 361, 362, 418, 359, 359, 359, 421, 453, 505, + 506, 426, 359, 363, 427, 434, 512, 437, 445, 480, + 482, 535, 536, 537, 446, 447, 359, 359, 452, 457, + 483, 458, 484, 485, 341, 488, 486, 492, 502, 494, + 495, 496, 503, 508, 500, 509, 371, 510, 233, 519, + 511, 515, 513, 263, 264, 516, 381, 382, 383, 558, + 543, 544, 545, 546, 520, 517, 501, 548, 549, 550, + 551, 359, 542, 359, 518, 553, 522, 359, 529, 248, + 249, 532, 534, 540, 541, 359, 359, 359, 547, 554, + 555, 556, 562, 563, 557, 559, 432, 561, 233, 248, + 249, 564, 573, 565, 566, 567, 568, 588, 233, 233, + 233, 569, 570, 571, 233, 572, 581, 578, 582, 583, + 577, 579, 359, 359, 580, 359, 359, 428, 429, 430, + 592, 589, 359, 552, 590, 436, 591, 595, 596, 599, + 600, 359, 604, 605, 184, 185, 233, 186, 187, 450, + 451, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 394, 188, 94, 55, 395, + 102, 222, 478, 332, 359, 477, 25, 43, 597, 491, + 538, 0, 507, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 487, 0, 489, 0, 0, 0, + 493, 0, 0, 0, 0, 0, 0, 0, 497, 498, + 499, 0, 0, 359, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 359, 0, + 0, 0, 0, 63, 64, 359, 0, 0, 0, 359, + 359, 0, 0, 0, 0, 523, 524, 0, 527, 528, + 18, 0, 19, 0, 313, 533, 0, 0, 0, 0, + 0, 0, 0, 0, 539, 0, 314, 315, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 560, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 316, 317, 0, 0, 0, 584, 0, 318, 0, + 319, 0, 320, 321, 322, 0, 0, 0, 0, 0, + 0, 594, 0, 0, 0, 0, 0, 0, 598, 0, + 0, 0, 601, 602, 0, 0, 0, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 0, 0, 0, 0, 0, 323, 0, 0, 324, 0, + 325, 63, 64, 326, 115, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 0, 77, 18, 0, + 19, 63, 64, 0, 115, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 0, 77, 18, 0, + 19, 0, 63, 64, 78, 115, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 0, 77, 18, + 0, 19, 0, 0, 78, 0, 0, 63, 64, 0, + 115, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 0, 77, 18, 78, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 0, 0, 80, 0, 0, 81, 0, 82, 225, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 0, 0, 80, 0, 0, 81, 0, 82, 406, + 0, 0, 347, 348, 63, 64, 349, 0, 0, 0, + 0, 79, 0, 0, 80, 0, 0, 81, 0, 82, + 466, 18, 0, 19, 0, 350, 351, 352, 0, 0, + 0, 0, 0, 0, 0, 0, 79, 353, 354, 80, + 0, 0, 81, 0, 82, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 316, 317, 0, 0, 0, 0, 0, 318, + 0, 319, 0, 320, 321, 322, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 347, 348, + 0, 0, 349, 0, 0, 0, 0, 0, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 350, 351, 352, 0, 0, 0, 0, 0, 356, + 0, 0, 0, 353, 354, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 355, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 316, 317, + 0, 0, 0, 0, 0, 318, 0, 319, 0, 320, + 321, 322, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 0, 0, 0, + 0, 0, 0, 63, 64, 356, 115, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 0, 77, + 18, 0, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 340, 0, 0, 0, 0, + 0, 0, 0, 0, 63, 64, 78, 115, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 0, + 77, 18, 0, 19, 63, 64, 0, 115, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, + 77, 18, 0, 19, 0, 0, 0, 78, 0, 0, + 0, 0, 0, 0, 0, 0, 422, 0, 0, 0, + 0, 0, 0, 0, 0, 63, 64, 78, 115, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 0, 77, 18, 0, 19, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 476, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, + 0, 0, 79, 0, 0, 80, 0, 0, 81, 0, + 82, 63, 64, 0, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 0, 77, 18, 0, + 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 79, 0, 0, 80, 0, 401, 81, + 0, 82, 0, 0, 78, 0, 0, 0, 0, 0, + 0, 0, 0, 79, 0, 0, 80, 0, 0, 81, + 0, 82, 63, 64, 0, 115, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 0, 77, 18, + 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 79, 0, 0, 80, 0, 0, + 81, 0, 82, 63, 64, 78, 115, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 0, 77, + 18, 0, 19, 63, 64, 0, 236, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 0, 77, + 18, 0, 19, 0, 0, 0, 78, 0, 0, 0, + 79, 0, 0, 80, 0, 0, 81, 0, 82, 0, + 0, 0, 0, 0, 63, 64, 78, 115, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 0, + 77, 18, 0, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, + 0, 79, 0, 0, 80, 0, 0, 81, 0, 82, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 79, 0, 0, 80, 0, 0, 81, 0, + 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 79, 0, 0, 80, 0, 0, 81, 0, + 82, 0, 0, 0, 0, 122, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 123, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, + 125, 0, 0, 79, 0, 0, 80, 0, 0, 81, + 0, 404, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -555 -static const yytype_int16 yypact[] = -{ - -555, 136, 58, 247, -555, -555, -555, -555, -555, -555, - -555, -555, -555, -555, 96, 181, 141, -555, -555, -9, - -555, -555, 16, 7, 114, 65, 39, -555, 50, 188, - 210, -555, -555, -555, -555, -555, -555, 1357, -19, -555, - -555, 134, -555, -555, -555, -555, 68, 69, 70, 73, - -555, 60, 188, 1357, 4, 4, 4, 4, -555, -555, - -555, -555, -555, -555, -555, -555, -555, 63, -555, -555, - -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, - -555, 222, 224, 1, 171, -555, 134, 84, -555, -555, - -103, -555, -555, -555, -555, -555, 1611, -555, 216, 66, - 238, 219, 233, -555, -555, -555, -555, -555, 1418, 1418, - 1418, 1459, 181, -555, 100, 101, 737, -555, -555, -103, - -112, 105, 803, -555, -555, 1418, -555, 202, 1479, 13, - 221, 181, -555, -555, -555, -555, -555, -555, -555, -555, - -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, - -555, -555, -555, -555, -555, -555, -555, -555, -555, 77, - 377, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, - 1418, 1418, 1418, -555, -555, -555, -555, -555, -555, -555, - -555, -555, -555, -555, -555, -555, 1418, 1418, 1418, 1418, - 1418, -555, -555, 181, -555, 33, -555, -555, -555, -555, - -555, -555, -555, -555, -15, -555, -555, -555, 36, 158, - 262, 164, 264, 167, 266, 169, 268, 269, 270, 204, - 271, 274, 579, -555, -555, 1418, 1418, 121, -67, 1418, - -555, 1199, -555, 120, 127, 920, -555, -555, 63, -555, - 920, 920, -555, -555, -555, -555, -555, -555, -555, -555, - -555, -555, 920, 1357, -555, -555, -555, -555, -555, -555, - -555, -555, -555, -555, 1418, -555, -555, -555, -555, -555, - -555, -555, -555, -555, -555, -555, -555, -555, -555, -555, - -555, 1418, 142, 143, -555, 920, 147, 153, 154, 155, - 157, 165, 166, 168, 170, 920, 920, 920, 173, 275, - 1357, 1418, 1418, 293, -555, 174, 174, 174, -555, -555, - -555, -555, -555, -555, -555, -555, -555, -555, 77, 377, - 175, 177, 180, 182, 183, 1240, 1520, 757, 296, 192, - 193, 199, 203, 207, -555, -555, 174, -45, -71, -555, - 161, -103, -555, 134, -555, 176, 209, 1260, -555, -555, - -555, -555, -555, -555, -555, -555, -555, 261, 1459, -555, - -555, -555, -555, 206, -555, 213, 920, 920, 920, -2, - -555, 0, -555, 215, 920, 179, 1418, 1418, 1418, 1418, - 1418, 1418, 1418, 217, 218, 223, 1418, 1418, 920, 920, - 226, -555, -17, -555, -555, -555, 214, 220, 1459, 1459, - 1459, 1459, 1459, -555, -555, -13, 778, -94, -555, -40, - -555, 1459, 1459, 1459, 1459, 1459, -555, -555, -555, -555, - -555, -555, 1301, 346, -555, -555, 357, -69, 361, 362, - 229, 234, 235, 920, 382, 920, 1418, -555, 236, 920, - 237, -555, -555, 239, 240, -555, -555, 920, 920, 920, - -555, -555, 241, -555, 1418, 367, 390, -555, 174, 1459, - 1459, 215, 242, 245, 248, 249, 1459, -555, 254, -16, - -8, -555, -555, 250, 253, 263, 272, 364, -555, -555, - -555, 366, 273, -555, 920, 920, 1418, 920, 920, 276, - -555, 276, -555, 279, 920, 280, 1418, 1418, 1418, -555, - -555, -555, 1418, 920, -555, -555, -555, 281, 282, 283, - 1459, 1459, 1459, 1459, -555, -555, 284, 1459, 1459, 1459, - 1459, 1418, 423, -555, 416, 288, 285, 279, 290, -555, - -555, 391, -555, -555, 1418, 294, 920, -555, -555, -555, - 291, -555, 1459, 1459, -555, 299, 298, 302, 303, -555, - 301, 306, 307, 308, 310, -555, -555, 437, 15, 432, - -555, -555, 312, -555, 316, 319, 1459, -555, 1459, 1459, - -555, -555, -555, -555, -555, 920, -555, 1046, 64, 460, - -555, -555, -555, 326, 329, 331, -555, 335, -555, 1046, - 920, -555, -555, -555, 468, 337, 132, 920, 470, 472, - -555, 920, 920, -555, -555 +static const short yycheck[] = { 35, + 123, 128, 128, 126, 4, 51, 281, 304, 305, 29, + 15, 109, 15, 34, 2, 51, 61, 324, 325, 129, + 556, 575, 9, 82, 10, 11, 12, 13, 14, 15, + 16, 17, 23, 587, 21, 152, 57, 334, 161, 30, + 576, 164, 165, 166, 167, 168, 169, 170, 153, 356, + 155, 39, 57, 153, 57, 114, 153, 0, 163, 164, + 22, 120, 24, 163, 187, 188, 163, 52, 53, 54, + 106, 107, 108, 10, 11, 12, 13, 14, 15, 16, + 17, 191, 25, 153, 20, 153, 71, 123, 31, 161, + 126, 23, 164, 163, 61, 163, 84, 404, 41, 42, + 43, 44, 45, 46, 47, 41, 42, 43, 44, 45, + 46, 47, 155, 152, 50, 159, 153, 32, 33, 62, + 164, 164, 159, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 153, 153, 55, 56, 153, + 114, 24, 162, 161, 161, 159, 120, 4, 184, 185, + 186, 187, 188, 53, 54, 55, 45, 152, 47, 456, + 108, 109, 162, 152, 223, 224, 27, 28, 227, 3, + 4, 152, 163, 159, 152, 5, 6, 300, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 155, 21, 22, 229, 24, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 251, 3, 4, 3, 4, + 220, 157, 487, 4, 489, 251, 3, 4, 48, 3, + 4, 4, 159, 233, 77, 78, 262, 155, 238, 239, + 10, 11, 12, 13, 14, 15, 16, 17, 24, 4, + 250, 158, 24, 279, 64, 65, 66, 67, 68, 69, + 70, 374, 298, 376, 377, 378, 24, 158, 155, 59, + 4, 384, 298, 299, 300, 4, 20, 4, 22, 4, + 24, 7, 4, 283, 7, 161, 7, 31, 32, 33, + 153, 156, 153, 293, 294, 295, 345, 41, 42, 43, + 44, 45, 46, 47, 153, 157, 50, 51, 396, 397, + 398, 399, 400, 153, 58, 153, 153, 153, 62, 153, + 153, 409, 410, 411, 412, 413, 153, 153, 153, 36, + 24, 153, 155, 24, 154, 153, 155, 157, 155, 155, + 160, 155, 162, 163, 155, 63, 155, 155, 374, 375, + 376, 377, 378, 379, 380, 404, 155, 155, 384, 385, + 161, 238, 239, 341, 364, 365, 366, 156, 34, 457, + 458, 153, 372, 250, 153, 153, 464, 157, 153, 24, + 21, 494, 495, 496, 153, 153, 386, 387, 153, 155, + 21, 155, 155, 153, 420, 4, 153, 153, 24, 153, + 153, 153, 4, 153, 155, 153, 283, 153, 434, 36, + 153, 153, 161, 27, 28, 153, 293, 294, 295, 532, + 508, 509, 510, 511, 57, 153, 452, 515, 516, 517, + 518, 431, 156, 433, 153, 4, 153, 437, 153, 556, + 556, 153, 153, 153, 153, 445, 446, 447, 161, 24, + 153, 157, 540, 541, 156, 159, 57, 156, 484, 576, + 576, 153, 21, 156, 153, 153, 156, 21, 494, 495, + 496, 156, 156, 156, 500, 156, 564, 159, 566, 567, + 36, 156, 482, 483, 156, 485, 486, 364, 365, 366, + 153, 156, 492, 519, 156, 372, 156, 21, 153, 21, + 21, 501, 0, 0, 94, 94, 532, 94, 94, 386, + 387, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 316, 94, 39, 23, 317, + 50, 110, 421, 220, 534, 420, 2, 17, 594, 434, + 500, -1, 459, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 431, -1, 433, -1, -1, -1, + 437, -1, -1, -1, -1, -1, -1, -1, 445, 446, + 447, -1, -1, 573, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 588, -1, + -1, -1, -1, 5, 6, 595, -1, -1, -1, 599, + 600, -1, -1, -1, -1, 482, 483, -1, 485, 486, + 22, -1, 24, -1, 26, 492, -1, -1, -1, -1, + -1, -1, -1, -1, 501, -1, 38, 39, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 534, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, -1, -1, -1, 573, -1, 110, -1, + 112, -1, 114, 115, 116, -1, -1, -1, -1, -1, + -1, 588, -1, -1, -1, -1, -1, -1, 595, -1, + -1, -1, 599, 600, -1, -1, -1, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + -1, -1, -1, -1, -1, 157, -1, -1, 160, -1, + 162, 5, 6, 165, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, + 24, 5, 6, -1, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, + 24, -1, 5, 6, 48, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + -1, 24, -1, -1, 48, -1, -1, 5, 6, -1, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, -1, 21, 22, 48, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 37, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 154, -1, -1, 157, -1, -1, 160, -1, 162, 163, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 154, -1, -1, 157, -1, -1, 160, -1, 162, 163, + -1, -1, 3, 4, 5, 6, 7, -1, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + 163, 22, -1, 24, -1, 26, 27, 28, -1, -1, + -1, -1, -1, -1, -1, -1, 154, 38, 39, 157, + -1, -1, 160, -1, 162, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, -1, -1, -1, -1, -1, 110, + -1, 112, -1, 114, 115, 116, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, + -1, -1, 7, -1, -1, -1, -1, -1, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 26, 27, 28, -1, -1, -1, -1, -1, 160, + -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 61, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + -1, -1, -1, -1, -1, 110, -1, 112, -1, 114, + 115, 116, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, -1, -1, -1, + -1, -1, -1, 5, 6, 160, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, + 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, + -1, -1, -1, -1, 5, 6, 48, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, 5, 6, -1, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, -1, -1, -1, 48, -1, -1, + -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, + -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + -1, 21, 22, -1, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, + -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, + 162, 5, 6, -1, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, -1, 21, 22, -1, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 154, -1, -1, 157, -1, 159, 160, + -1, 162, -1, -1, 48, -1, -1, -1, -1, -1, + -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, 5, 6, -1, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, + -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 154, -1, -1, 157, -1, -1, + 160, -1, 162, 5, 6, 48, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, + 22, -1, 24, 5, 6, -1, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, + 22, -1, 24, -1, -1, -1, 48, -1, -1, -1, + 154, -1, -1, 157, -1, -1, 160, -1, 162, -1, + -1, -1, -1, -1, 5, 6, 48, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, + 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 48, -1, -1, + -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, + 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, + 162, -1, -1, -1, -1, 35, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, + 60, -1, -1, 154, -1, -1, 157, -1, -1, 160, + -1, 162, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, -1, -1, + 110, 111, 112, 113, 114, 115, 116, 117, 118, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 }; +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -555, -555, -555, 398, 399, 400, 198, 200, 402, 403, - -128, -127, -525, -555, 476, 493, -111, -555, -276, 97, - -555, -298, -555, -47, -555, -37, -555, -60, -62, -555, - -99, 300, -308, 61, -555, -555, -555, -555, -555, -555, - -555, 469, -555, -555, -555, -555, 8, -555, 102, -555, - -555, 411, -555, -555, -555, -555, -555, 523, -555, -555, - -555, -554, -11, 112, -124, -555, 508, -555, -68, -555, - -555, -555, -555, 93, 28, -555, -555, 71, -555, -555 -}; +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -180 -static const yytype_int16 yytable[] = -{ - 88, 236, 250, 251, 239, 115, 105, 372, 394, 395, - 93, 26, 223, 433, 39, 435, 88, 455, 407, 409, - 253, 42, 240, 587, 119, 242, 243, 244, 245, 246, - 247, 248, 249, 577, 241, 595, 106, 107, 416, 284, - 456, 229, 288, 289, 290, 291, 292, 293, 294, 26, - 427, 230, -112, 589, 228, 434, 119, 434, -179, 466, - 233, 123, 119, 308, 309, 298, 299, 471, 46, 47, - 48, 205, 206, 207, 242, 243, 244, 245, 246, 247, - 248, 249, 300, 5, 466, 53, 229, 49, 235, 6, - 418, 235, 483, 123, 121, 59, 340, 60, 470, 7, - 8, 9, 10, 11, 12, 13, 7, 8, 9, 10, - 54, 12, 55, 466, 417, 56, 109, 110, 111, 123, - 14, 198, 199, 472, 282, 283, 235, 285, 286, 235, - 235, 235, 235, 235, 235, 235, 4, -139, 303, -112, - 466, 301, 302, 94, 304, 466, 467, -139, 123, 295, - 296, 297, 235, 235, 43, 516, 20, 29, 21, 51, - 506, -72, -72, 116, 39, 337, 338, -71, -71, 341, - -70, -70, -69, -69, 576, 52, 65, 66, 390, 117, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 58, 79, 20, 343, 21, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 366, 310, 311, 133, - 134, 335, 62, 532, 64, 533, 88, 102, -113, 80, - 98, 99, 100, 588, 361, 101, 113, 367, 114, 361, - 361, 242, 243, 244, 245, 246, 247, 248, 249, 122, - 197, 361, 201, 202, 368, 30, 31, 32, 33, 34, - 35, 36, 440, 388, 442, 443, 444, 203, 225, 226, - 231, 237, 450, 88, 389, 235, -76, -82, -75, 20, - -74, 21, -73, 347, 361, 313, -79, -80, 6, -82, - -82, 314, 339, 348, 361, 361, 361, 341, -82, -82, - -82, -82, -82, -82, -82, 369, 371, -82, 22, 461, - 462, 463, 464, 465, 374, 23, 375, 376, 377, 24, - 378, 387, 473, 474, 475, 476, 477, 391, 379, 380, - 410, 381, 419, 382, 425, 81, 386, 392, 82, 422, - 398, 83, 399, 84, 118, 400, 439, 401, 402, 235, - 441, 235, 235, 235, 445, 446, 469, 411, 412, 235, - 451, 420, 363, 364, 413, 361, 361, 361, 414, 428, - 507, 508, 415, 361, 365, 423, 429, 514, 436, 459, - 447, 448, 537, 538, 539, 460, 449, 361, 361, 454, - 455, 482, 484, 485, 486, 343, 490, 487, 488, 494, - 496, 504, 497, 498, 505, 510, 502, 373, 511, 235, - 521, 512, 513, 517, 265, 266, 518, 383, 384, 385, - 560, 545, 546, 547, 548, 515, 519, 503, 550, 551, - 552, 553, 361, 522, 361, 520, 524, 555, 361, 531, - 250, 251, 534, 536, 542, 543, 361, 361, 361, 544, - 556, 557, 558, 564, 565, 549, 559, 563, 434, 235, - 250, 251, 566, 561, 567, 568, 569, 570, 575, 235, - 235, 235, 571, 572, 573, 235, 574, 583, 579, 584, - 585, 580, 581, 361, 361, 582, 361, 361, 430, 431, - 432, 590, 591, 361, 554, 592, 438, 593, 594, 597, - 598, 601, 361, 602, 186, 187, 188, 235, 189, 190, - 452, 453, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 396, 96, 57, 397, - 480, 104, 334, 224, 479, 361, 27, 45, 599, 493, - 540, 0, 509, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 489, 0, 491, 0, 0, - 0, 495, 0, 0, 0, 0, 0, 0, 0, 499, - 500, 501, 0, 0, 361, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 361, - 0, 0, 0, 0, 65, 66, 361, 0, 0, 0, - 361, 361, 0, 0, 0, 0, 525, 526, 0, 529, - 530, 20, 0, 21, 0, 315, 535, 0, 0, 0, - 0, 0, 0, 0, 0, 541, 0, 316, 317, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 562, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 318, 319, 0, 0, 0, 586, 0, 320, - 0, 321, 0, 322, 323, 324, 0, 0, 0, 0, - 0, 0, 596, 0, 0, 0, 0, 0, 0, 600, - 0, 0, 0, 603, 604, 0, 0, 0, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 0, 0, 0, 0, 0, 325, 0, 0, 326, - 0, 327, 65, 66, 328, 117, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, - 0, 21, 65, 66, 0, 117, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 0, 79, 20, - 0, 21, 0, 65, 66, 80, 117, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 0, 79, - 20, 0, 21, 0, 0, 80, 0, 0, 65, 66, - 0, 117, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 0, 79, 20, 80, 21, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, - 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, - 408, 0, 0, 349, 350, 65, 66, 351, 0, 0, - 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, - 84, 468, 20, 0, 21, 0, 352, 353, 354, 0, - 0, 0, 0, 0, 0, 0, 0, 81, 355, 356, - 82, 0, 0, 83, 0, 84, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 357, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 318, 319, 0, 0, 0, 0, 0, - 320, 0, 321, 0, 322, 323, 324, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, - 350, 0, 0, 351, 0, 0, 0, 0, 0, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 352, 353, 354, 0, 0, 0, 0, 0, - 358, 0, 0, 0, 355, 356, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 357, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 318, - 319, 0, 0, 0, 0, 0, 320, 0, 321, 0, - 322, 323, 324, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 0, 0, - 0, 0, 0, 0, 65, 66, 358, 117, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, - 79, 20, 0, 21, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 342, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 0, 79, 20, 0, 21, 65, 66, 0, 117, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 0, 79, 20, 0, 21, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, 0, 424, 0, 0, - 0, 0, 0, 0, 0, 0, 65, 66, 80, 117, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 0, 79, 20, 0, 21, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 478, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, - 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, - 0, 84, 65, 66, 0, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 0, 79, 20, - 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 81, 0, 0, 82, 0, 403, - 83, 0, 84, 0, 0, 80, 0, 0, 0, 0, - 0, 0, 0, 0, 81, 0, 0, 82, 0, 0, - 83, 0, 84, 65, 66, 0, 117, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 0, 79, - 20, 0, 21, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 81, 0, 0, 82, 0, - 0, 83, 0, 84, 65, 66, 80, 117, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 0, - 79, 20, 0, 21, 65, 66, 0, 238, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, - 79, 20, 0, 21, 0, 0, 0, 80, 0, 0, - 0, 81, 0, 0, 82, 0, 0, 83, 0, 84, - 0, 0, 0, 0, 0, 65, 66, 80, 117, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 0, 79, 20, 0, 21, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 80, 0, - 0, 0, 81, 0, 0, 82, 0, 0, 83, 0, - 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, - 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 81, 0, 0, 82, 0, 0, 83, - 0, 84, 0, 0, 0, 0, 124, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 126, 127, 0, 0, 81, 0, 0, 82, 0, 0, - 83, 0, 406, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 0, - 0, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 -}; + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -static const yytype_int16 yycheck[] = -{ - 37, 125, 130, 130, 128, 4, 53, 283, 306, 307, - 29, 3, 111, 15, 23, 15, 53, 34, 326, 327, - 131, 30, 9, 577, 84, 10, 11, 12, 13, 14, - 15, 16, 17, 558, 21, 589, 32, 33, 336, 163, - 57, 153, 166, 167, 168, 169, 170, 171, 172, 41, - 358, 163, 155, 578, 116, 57, 116, 57, 0, 153, - 122, 164, 122, 27, 28, 189, 190, 161, 52, 53, - 54, 108, 109, 110, 10, 11, 12, 13, 14, 15, - 16, 17, 193, 25, 153, 20, 153, 71, 125, 31, - 161, 128, 161, 164, 86, 45, 163, 47, 406, 41, - 42, 43, 44, 45, 46, 47, 41, 42, 43, 44, - 45, 46, 47, 153, 159, 50, 55, 56, 57, 164, - 62, 55, 56, 163, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 0, 153, 153, 155, - 153, 108, 109, 162, 159, 153, 159, 163, 164, 186, - 187, 188, 189, 190, 163, 163, 22, 61, 24, 152, - 458, 3, 4, 162, 23, 225, 226, 3, 4, 229, - 3, 4, 3, 4, 159, 61, 5, 6, 302, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 152, 21, 22, 231, 24, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 253, 3, 4, 77, - 78, 222, 24, 489, 4, 491, 253, 157, 155, 48, - 152, 152, 152, 159, 235, 152, 4, 264, 4, 240, - 241, 10, 11, 12, 13, 14, 15, 16, 17, 155, - 24, 252, 4, 24, 281, 64, 65, 66, 67, 68, - 69, 70, 376, 300, 378, 379, 380, 24, 158, 158, - 155, 59, 386, 300, 301, 302, 4, 20, 4, 22, - 4, 24, 4, 153, 285, 4, 7, 7, 31, 32, - 33, 7, 161, 156, 295, 296, 297, 347, 41, 42, - 43, 44, 45, 46, 47, 153, 153, 50, 51, 398, - 399, 400, 401, 402, 157, 58, 153, 153, 153, 62, - 153, 36, 411, 412, 413, 414, 415, 24, 153, 153, - 24, 153, 161, 153, 63, 154, 153, 153, 157, 153, - 155, 160, 155, 162, 163, 155, 157, 155, 155, 376, - 377, 378, 379, 380, 381, 382, 406, 155, 155, 386, - 387, 343, 240, 241, 155, 366, 367, 368, 155, 153, - 459, 460, 155, 374, 252, 156, 153, 466, 153, 155, - 153, 153, 496, 497, 498, 155, 153, 388, 389, 153, - 34, 24, 21, 21, 155, 422, 4, 153, 153, 153, - 153, 24, 153, 153, 4, 153, 155, 285, 153, 436, - 36, 153, 153, 153, 27, 28, 153, 295, 296, 297, - 534, 510, 511, 512, 513, 161, 153, 454, 517, 518, - 519, 520, 433, 57, 435, 153, 153, 4, 439, 153, - 558, 558, 153, 153, 153, 153, 447, 448, 449, 156, - 24, 153, 157, 542, 543, 161, 156, 156, 57, 486, - 578, 578, 153, 159, 156, 153, 153, 156, 21, 496, - 497, 498, 156, 156, 156, 502, 156, 566, 36, 568, - 569, 159, 156, 484, 485, 156, 487, 488, 366, 367, - 368, 21, 156, 494, 521, 156, 374, 156, 153, 21, - 153, 21, 503, 21, 96, 96, 96, 534, 96, 96, - 388, 389, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 318, 41, 25, 319, - 423, 52, 222, 112, 422, 536, 3, 19, 596, 436, - 502, -1, 461, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 433, -1, 435, -1, -1, - -1, 439, -1, -1, -1, -1, -1, -1, -1, 447, - 448, 449, -1, -1, 575, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 590, - -1, -1, -1, -1, 5, 6, 597, -1, -1, -1, - 601, 602, -1, -1, -1, -1, 484, 485, -1, 487, - 488, 22, -1, 24, -1, 26, 494, -1, -1, -1, - -1, -1, -1, -1, -1, 503, -1, 38, 39, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 536, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, -1, -1, -1, 575, -1, 110, - -1, 112, -1, 114, 115, 116, -1, -1, -1, -1, - -1, -1, 590, -1, -1, -1, -1, -1, -1, 597, - -1, -1, -1, 601, 602, -1, -1, -1, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, -1, -1, -1, -1, -1, 157, -1, -1, 160, - -1, 162, 5, 6, 165, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, - -1, 24, 5, 6, -1, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, - -1, 24, -1, 5, 6, 48, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, - 22, -1, 24, -1, -1, 48, -1, -1, 5, 6, - -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, -1, 21, 22, 48, 24, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 48, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, - 163, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, - 163, -1, -1, 3, 4, 5, 6, 7, -1, -1, - -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, - 162, 163, 22, -1, 24, -1, 26, 27, 28, -1, - -1, -1, -1, -1, -1, -1, -1, 154, 38, 39, - 157, -1, -1, 160, -1, 162, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 61, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, -1, -1, -1, -1, -1, - 110, -1, 112, -1, 114, 115, 116, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, - 4, -1, -1, 7, -1, -1, -1, -1, -1, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 26, 27, 28, -1, -1, -1, -1, -1, - 160, -1, -1, -1, 38, 39, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 61, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, -1, -1, -1, -1, -1, 110, -1, 112, -1, - 114, 115, 116, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, -1, -1, - -1, -1, -1, -1, 5, 6, 160, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, - -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, 21, 22, -1, 24, 5, 6, -1, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, 21, 22, -1, 24, -1, -1, -1, 48, -1, - -1, -1, -1, -1, -1, -1, -1, 37, -1, -1, - -1, -1, -1, -1, -1, -1, 5, 6, 48, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, -1, 21, 22, -1, 24, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 37, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 48, - -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, 5, 6, -1, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, 21, 22, - -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 154, -1, -1, 157, -1, 159, - 160, -1, 162, -1, -1, 48, -1, -1, -1, -1, - -1, -1, -1, -1, 154, -1, -1, 157, -1, -1, - 160, -1, 162, 5, 6, -1, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, -1, 21, - 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 154, -1, -1, 157, -1, - -1, 160, -1, 162, 5, 6, 48, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, 5, 6, -1, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - 21, 22, -1, 24, -1, -1, -1, 48, -1, -1, - -1, 154, -1, -1, 157, -1, -1, 160, -1, 162, - -1, -1, -1, -1, -1, 5, 6, 48, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, 21, 22, -1, 24, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 48, -1, - -1, -1, 154, -1, -1, 157, -1, -1, 160, -1, - 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 154, -1, -1, 157, -1, -1, 160, - -1, 162, -1, -1, -1, -1, 35, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, 60, -1, -1, 154, -1, -1, 157, -1, -1, - 160, -1, 162, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, -1, - -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151 -}; + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 200, 201, 202, 0, 25, 31, 41, 42, 43, - 44, 45, 46, 47, 62, 181, 219, 221, 223, 231, - 22, 24, 51, 58, 62, 180, 212, 223, 224, 61, - 64, 65, 66, 67, 68, 69, 70, 182, 217, 23, - 232, 233, 30, 163, 220, 232, 52, 53, 54, 71, - 209, 152, 61, 20, 45, 47, 50, 181, 152, 45, - 47, 222, 24, 207, 4, 5, 6, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, - 48, 154, 157, 160, 162, 167, 189, 190, 191, 192, - 193, 212, 228, 29, 162, 218, 180, 237, 152, 152, - 152, 152, 157, 210, 207, 189, 32, 33, 199, 199, - 199, 199, 225, 4, 4, 4, 162, 8, 163, 193, - 194, 212, 155, 164, 35, 49, 59, 60, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 169, 170, 171, 174, - 175, 234, 235, 241, 242, 244, 245, 24, 55, 56, - 208, 4, 24, 24, 211, 191, 191, 191, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 176, - 177, 179, 191, 196, 217, 158, 158, 163, 194, 153, - 163, 155, 37, 194, 195, 191, 230, 59, 8, 230, - 9, 21, 10, 11, 12, 13, 14, 15, 16, 17, - 176, 177, 178, 182, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 172, 27, 28, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 173, 191, 191, 230, 191, 191, 238, 230, 230, - 230, 230, 230, 230, 230, 191, 191, 191, 230, 230, - 182, 108, 109, 153, 159, 205, 206, 204, 27, 28, - 3, 4, 168, 4, 7, 26, 38, 39, 103, 104, - 110, 112, 114, 115, 116, 157, 160, 162, 165, 169, - 170, 171, 174, 175, 197, 228, 203, 193, 193, 161, - 163, 193, 37, 191, 214, 215, 216, 153, 156, 3, - 4, 7, 26, 27, 28, 38, 39, 61, 160, 197, - 227, 228, 229, 229, 229, 229, 189, 191, 191, 153, - 184, 153, 184, 229, 157, 153, 153, 153, 153, 153, - 153, 153, 153, 229, 229, 229, 153, 36, 189, 191, - 230, 24, 153, 187, 187, 187, 172, 173, 155, 155, - 155, 155, 155, 159, 196, 198, 162, 198, 163, 198, - 24, 155, 155, 155, 155, 155, 187, 159, 161, 161, - 212, 213, 153, 156, 37, 63, 226, 198, 153, 153, - 229, 229, 229, 15, 57, 15, 153, 243, 229, 157, - 230, 191, 230, 230, 230, 191, 191, 153, 153, 153, - 230, 191, 229, 229, 153, 34, 57, 185, 188, 155, - 155, 196, 196, 196, 196, 196, 153, 159, 163, 193, - 198, 161, 163, 196, 196, 196, 196, 196, 37, 214, - 185, 186, 24, 161, 21, 21, 155, 153, 153, 229, - 4, 229, 230, 239, 153, 229, 153, 153, 153, 229, - 229, 229, 155, 191, 24, 4, 187, 196, 196, 243, - 153, 153, 153, 153, 196, 161, 163, 153, 153, 153, - 153, 36, 57, 183, 153, 229, 229, 239, 240, 229, - 229, 153, 184, 184, 153, 229, 153, 230, 230, 230, - 240, 229, 153, 153, 156, 196, 196, 196, 196, 161, - 196, 196, 196, 196, 191, 4, 24, 153, 157, 156, - 230, 159, 229, 156, 196, 196, 153, 156, 153, 153, - 156, 156, 156, 156, 156, 21, 159, 178, 236, 36, - 159, 156, 156, 196, 196, 196, 229, 227, 159, 178, - 21, 156, 156, 156, 153, 227, 229, 21, 153, 234, - 229, 21, 21, 229, 229 -}; + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible at ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define YYEMPTY -2 #define YYEOF 0 - #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ +#define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) #define YYTERROR 1 #define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +#ifndef YYPURE +#define YYLEX yylex() #endif - -/* YYLEX -- calling `yylex' with the right arguments. */ - +#ifdef YYPURE +#ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else -# define YYLEX yylex () +#define YYLEX yylex(&yylval, &yylloc) #endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) #else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; +#define YYLEX yylex(&yylval) #endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; +#endif /* not YYLSP_NEEDED */ #endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ +/* If nonreentrant, generate the variables here */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) -#else -static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} +#ifndef YYPURE -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ #endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - fprintf (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - fprintf (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +/* YYINITDEPTH indicates the initial size of the parser's stacks */ -/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#define YYINITDEPTH 200 #endif -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; { - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; + register char *f = from; + register char *t = to; + register int i = count; - return yyd - 1; + while (i-- > 0) + *t++ = *f++; } -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - return yystpcpy (yyres, yystr) - yyres; -} -# endif +#else /* __cplusplus */ -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *to, char *from, unsigned int count) { - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; + register char *t = to; + register char *f = from; + register int i = count; - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } + while (i-- > 0) + *t++ = *f++; } -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; #endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} +#endif +#line 217 "/usr/share/bison.simple" + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ -/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ #ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); +int yyparse (void *); #else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus int yyparse (void); -#else -int yyparse (); #endif -#endif /* ! YYPARSE_PARAM */ - - - -/* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; - - - -/*----------. -| yyparse. | -`----------*/ +#endif -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int -yyparse (void *YYPARSE_PARAM) +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL +{ + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; +#define YYPOPSTACK (yyvsp--, yyssp--) #endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; #endif #endif -{ - - int yystate; - int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + int yylen; - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -3722,741 +2799,718 @@ so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; + yyssp = yyss - 1; yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: - yysetstate: - *yyssp = yystate; + *++yyssp = yystate; - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + int size = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - - &yystacksize); + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif - yyss = yyss1; - yyvs = yyvs1; - } + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) + if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif goto yybackup; + yybackup: -/*-----------. -| yybackup. | -`-----------*/ -yybackup: +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ - /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to lookahead token. */ - /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yyn == YYFLAG) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif yychar = YYLEX; } - if (yychar <= YYEOF) + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif } - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; + yyn = yytable[yyn]; - if (yyn <= 0) + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* Shift the lookahead token. */ - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif - /* Discard the shifted token unless it is eof. */ + /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; - yystate = yyn; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif - goto yynewstate; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + yystate = yyn; + goto yynewstate; -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ +/* Do the default action for the current state. */ yydefault: + yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 3: -#line 1595 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" +#if YYDEBUG != 0 + if (yydebug) { - if ((yyvsp[(1) - (1)].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! - error("Value too large for type"); - (yyval.SIntVal) = (int32_t)(yyvsp[(1) - (1)].UIntVal); - ;} - break; - - case 5: -#line 1604 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(1) - (1)].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! - error("Value too large for type"); - (yyval.SInt64Val) = (int64_t)(yyvsp[(1) - (1)].UInt64Val); - ;} - break; - - case 26: -#line 1626 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_EQ; ;} - break; - - case 27: -#line 1626 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_NE; ;} - break; - - case 28: -#line 1627 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_SLT; ;} - break; - - case 29: -#line 1627 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_SGT; ;} - break; - - case 30: -#line 1628 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_SLE; ;} - break; - - case 31: -#line 1628 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_SGE; ;} - break; + int i; - case 32: -#line 1629 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_ULT; ;} - break; - - case 33: -#line 1629 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_UGT; ;} - break; - - case 34: -#line 1630 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_ULE; ;} - break; - - case 35: -#line 1630 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.IPred) = ICmpInst::ICMP_UGE; ;} - break; - - case 36: -#line 1634 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_OEQ; ;} - break; - - case 37: -#line 1634 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_ONE; ;} - break; - - case 38: -#line 1635 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_OLT; ;} - break; - - case 39: -#line 1635 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_OGT; ;} - break; - - case 40: -#line 1636 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_OLE; ;} - break; - - case 41: -#line 1636 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_OGE; ;} - break; - - case 42: -#line 1637 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_ORD; ;} - break; - - case 43: -#line 1637 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_UNO; ;} - break; - - case 44: -#line 1638 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_UEQ; ;} - break; - - case 45: -#line 1638 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_UNE; ;} - break; - - case 46: -#line 1639 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_ULT; ;} - break; - - case 47: -#line 1639 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_UGT; ;} - break; - - case 48: -#line 1640 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_ULE; ;} - break; + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); - case 49: -#line 1640 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_UGE; ;} - break; - - case 50: -#line 1641 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_TRUE; ;} - break; - - case 51: -#line 1642 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.FPred) = FCmpInst::FCMP_FALSE; ;} - break; - - case 81: -#line 1673 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); - ;} - break; - - case 82: -#line 1676 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.StrVal) = 0; - ;} - break; - - case 83: -#line 1681 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 84: -#line 1682 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 85: -#line 1683 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 86: -#line 1684 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} - break; - - case 87: -#line 1685 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 88: -#line 1686 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 89: -#line 1687 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 90: -#line 1688 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 91: -#line 1692 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::C; ;} - break; - - case 92: -#line 1693 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::C; ;} - break; - - case 93: -#line 1694 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::CSRet; ;} - break; - - case 94: -#line 1695 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::Fast; ;} - break; - - case 95: -#line 1696 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::Cold; ;} - break; + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif - case 96: -#line 1697 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::X86_StdCall; ;} - break; - case 97: -#line 1698 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = OldCallingConv::X86_FastCall; ;} - break; + switch (yyn) { - case 98: -#line 1699 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) +case 2: +#line 1595 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range! + error("Value too large for type"); + yyval.SIntVal = (int32_t)yyvsp[0].UIntVal; + ; + break;} +case 4: +#line 1604 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range! + error("Value too large for type"); + yyval.SInt64Val = (int64_t)yyvsp[0].UInt64Val; + ; + break;} +case 25: +#line 1626 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_EQ; ; + break;} +case 26: +#line 1626 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_NE; ; + break;} +case 27: +#line 1627 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_SLT; ; + break;} +case 28: +#line 1627 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_SGT; ; + break;} +case 29: +#line 1628 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_SLE; ; + break;} +case 30: +#line 1628 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_SGE; ; + break;} +case 31: +#line 1629 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_ULT; ; + break;} +case 32: +#line 1629 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_UGT; ; + break;} +case 33: +#line 1630 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_ULE; ; + break;} +case 34: +#line 1630 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.IPred = ICmpInst::ICMP_UGE; ; + break;} +case 35: +#line 1634 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_OEQ; ; + break;} +case 36: +#line 1634 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_ONE; ; + break;} +case 37: +#line 1635 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_OLT; ; + break;} +case 38: +#line 1635 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_OGT; ; + break;} +case 39: +#line 1636 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_OLE; ; + break;} +case 40: +#line 1636 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_OGE; ; + break;} +case 41: +#line 1637 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_ORD; ; + break;} +case 42: +#line 1637 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_UNO; ; + break;} +case 43: +#line 1638 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_UEQ; ; + break;} +case 44: +#line 1638 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_UNE; ; + break;} +case 45: +#line 1639 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_ULT; ; + break;} +case 46: +#line 1639 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_UGT; ; + break;} +case 47: +#line 1640 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_ULE; ; + break;} +case 48: +#line 1640 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_UGE; ; + break;} +case 49: +#line 1641 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_TRUE; ; + break;} +case 50: +#line 1642 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.FPred = FCmpInst::FCMP_FALSE; ; + break;} +case 80: +#line 1673 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; + ; + break;} +case 81: +#line 1676 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.StrVal = 0; + ; + break;} +case 82: +#line 1681 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 83: +#line 1682 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 84: +#line 1683 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 85: +#line 1684 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 86: +#line 1685 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 87: +#line 1686 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 88: +#line 1687 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 89: +#line 1688 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 90: +#line 1692 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = OldCallingConv::C; ; + break;} +case 91: +#line 1693 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = OldCallingConv::C; ; + break;} +case 92: +#line 1694 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = OldCallingConv::CSRet; ; + break;} +case 93: +#line 1695 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = OldCallingConv::Fast; ; + break;} +case 94: +#line 1696 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = OldCallingConv::Cold; ; + break;} +case 95: +#line 1697 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = OldCallingConv::X86_StdCall; ; + break;} +case 96: +#line 1698 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = OldCallingConv::X86_FastCall; ; + break;} +case 97: +#line 1699 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) error("Calling conv too large"); - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); - ;} - break; - - case 99: -#line 1709 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 100: -#line 1710 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + yyval.UIntVal = yyvsp[0].UInt64Val; + ; + break;} +case 98: +#line 1709 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 99: +#line 1710 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) error("Alignment must be a power of two"); - ;} - break; - - case 101: -#line 1718 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 102: -#line 1719 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + ; + break;} +case 100: +#line 1718 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 101: +#line 1719 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) error("Alignment must be a power of two"); - ;} - break; - - case 103: -#line 1727 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i) - if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\') + ; + break;} +case 102: +#line 1727 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) + if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') error("Invalid character in section name"); - (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); - ;} - break; - - case 104: -#line 1736 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 105: -#line 1737 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} - break; - - case 106: -#line 1744 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - {;} - break; - - case 107: -#line 1745 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - {;} - break; - - case 108: -#line 1749 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - CurGV->setSection((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); - ;} - break; - - case 109: -#line 1753 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) + yyval.StrVal = yyvsp[0].StrVal; + ; + break;} +case 103: +#line 1736 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.StrVal = 0; ; + break;} +case 104: +#line 1737 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.StrVal = yyvsp[0].StrVal; ; + break;} +case 105: +#line 1744 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{; + break;} +case 106: +#line 1745 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{; + break;} +case 107: +#line 1749 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + CurGV->setSection(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 108: +#line 1753 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) error("Alignment must be a power of two"); - CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val)); + CurGV->setAlignment(yyvsp[0].UInt64Val); - ;} - break; - - case 111: -#line 1770 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T); - (yyval.TypeVal).S = Signless; - ;} - break; - - case 113: -#line 1778 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T); - (yyval.TypeVal).S = Signless; - ;} - break; - - case 114: -#line 1785 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + ; + break;} +case 110: +#line 1770 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TypeVal.PAT = new PATypeHolder(yyvsp[0].PrimType.T); + yyval.TypeVal.S = Signless; + ; + break;} +case 112: +#line 1778 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TypeVal.PAT = new PATypeHolder(yyvsp[0].PrimType.T); + yyval.TypeVal.S = Signless; + ; + break;} +case 113: +#line 1785 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ if (!UpRefs.empty()) - error("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal).PAT)->getDescription()); - (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); - ;} - break; - - case 127: -#line 1799 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TypeVal).PAT = new PATypeHolder((yyvsp[(1) - (1)].PrimType).T); - (yyval.TypeVal).S = (yyvsp[(1) - (1)].PrimType).S; - ;} - break; - - case 128: -#line 1803 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TypeVal).PAT = new PATypeHolder(OpaqueType::get()); - (yyval.TypeVal).S = Signless; - ;} - break; - - case 129: -#line 1807 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Named types are also simple types... - const Type* tmp = getType((yyvsp[(1) - (1)].ValIDVal)); - (yyval.TypeVal).PAT = new PATypeHolder(tmp); - (yyval.TypeVal).S = Signless; // FIXME: what if its signed? - ;} - break; - - case 130: -#line 1812 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Type UpReference - if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) + error("Invalid upreference in type: " + (*yyvsp[0].TypeVal.PAT)->getDescription()); + yyval.TypeVal = yyvsp[0].TypeVal; + ; + break;} +case 126: +#line 1799 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TypeVal.PAT = new PATypeHolder(yyvsp[0].PrimType.T); + yyval.TypeVal.S = yyvsp[0].PrimType.S; + ; + break;} +case 127: +#line 1803 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TypeVal.PAT = new PATypeHolder(OpaqueType::get()); + yyval.TypeVal.S = Signless; + ; + break;} +case 128: +#line 1807 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Named types are also simple types... + const Type* tmp = getType(yyvsp[0].ValIDVal); + yyval.TypeVal.PAT = new PATypeHolder(tmp); + yyval.TypeVal.S = Signless; // FIXME: what if its signed? + ; + break;} +case 129: +#line 1812 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Type UpReference + if (yyvsp[0].UInt64Val > (uint64_t)~0U) error("Value out of range"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector... - (yyval.TypeVal).PAT = new PATypeHolder(OT); - (yyval.TypeVal).S = Signless; + UpRefs.push_back(UpRefRecord((unsigned)yyvsp[0].UInt64Val, OT)); // Add to vector... + yyval.TypeVal.PAT = new PATypeHolder(OT); + yyval.TypeVal.S = Signless; UR_OUT("New Upreference!\n"); - ;} - break; - - case 131: -#line 1821 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Function derived type? + ; + break;} +case 130: +#line 1821 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Function derived type? std::vector Params; - for (std::list::iterator I = (yyvsp[(3) - (4)].TypeList)->begin(), - E = (yyvsp[(3) - (4)].TypeList)->end(); I != E; ++I) { + for (std::list::iterator I = yyvsp[-1].TypeList->begin(), + E = yyvsp[-1].TypeList->end(); I != E; ++I) { Params.push_back(I->PAT->get()); } FunctionType::ParamAttrsList ParamAttrs; bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - (yyval.TypeVal).PAT = new PATypeHolder( - HandleUpRefs(FunctionType::get((yyvsp[(1) - (4)].TypeVal).PAT->get(), Params, isVarArg, + yyval.TypeVal.PAT = new PATypeHolder( + HandleUpRefs(FunctionType::get(yyvsp[-3].TypeVal.PAT->get(), Params, isVarArg, ParamAttrs))); - (yyval.TypeVal).S = (yyvsp[(1) - (4)].TypeVal).S; - delete (yyvsp[(1) - (4)].TypeVal).PAT; // Delete the return type handle - delete (yyvsp[(3) - (4)].TypeList); // Delete the argument list - ;} - break; - - case 132: -#line 1838 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Sized array type? - (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(ArrayType::get((yyvsp[(4) - (5)].TypeVal).PAT->get(), - (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - (yyval.TypeVal).S = (yyvsp[(4) - (5)].TypeVal).S; - delete (yyvsp[(4) - (5)].TypeVal).PAT; - ;} - break; - - case 133: -#line 1844 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Packed array type? - const llvm::Type* ElemTy = (yyvsp[(4) - (5)].TypeVal).PAT->get(); - if ((unsigned)(yyvsp[(2) - (5)].UInt64Val) != (yyvsp[(2) - (5)].UInt64Val)) + yyval.TypeVal.S = yyvsp[-3].TypeVal.S; + delete yyvsp[-3].TypeVal.PAT; // Delete the return type handle + delete yyvsp[-1].TypeList; // Delete the argument list + ; + break;} +case 131: +#line 1838 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Sized array type? + yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(ArrayType::get(yyvsp[-1].TypeVal.PAT->get(), + (unsigned)yyvsp[-3].UInt64Val))); + yyval.TypeVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 132: +#line 1844 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Packed array type? + const llvm::Type* ElemTy = yyvsp[-1].TypeVal.PAT->get(); + if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) error("Unsigned result not equal to signed result"); if (!(ElemTy->isInteger() || ElemTy->isFloatingPoint())) error("Elements of a PackedType must be integer or floating point"); - if (!isPowerOf2_32((yyvsp[(2) - (5)].UInt64Val))) + if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) error("PackedType length should be a power of 2"); - (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, - (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - (yyval.TypeVal).S = (yyvsp[(4) - (5)].TypeVal).S; - delete (yyvsp[(4) - (5)].TypeVal).PAT; - ;} - break; - - case 134: -#line 1857 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Structure type? + yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(PackedType::get(ElemTy, + (unsigned)yyvsp[-3].UInt64Val))); + yyval.TypeVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 133: +#line 1857 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[(2) - (3)].TypeList)->begin(), - E = (yyvsp[(2) - (3)].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-1].TypeList->begin(), + E = yyvsp[-1].TypeList->end(); I != E; ++I) Elements.push_back(I->PAT->get()); - (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); - (yyval.TypeVal).S = Signless; - delete (yyvsp[(2) - (3)].TypeList); - ;} - break; - - case 135: -#line 1866 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Empty structure type? - (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector())); - (yyval.TypeVal).S = Signless; - ;} - break; - - case 136: -#line 1870 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Packed Structure type? + yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + yyval.TypeVal.S = Signless; + delete yyvsp[-1].TypeList; + ; + break;} +case 134: +#line 1866 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Empty structure type? + yyval.TypeVal.PAT = new PATypeHolder(StructType::get(std::vector())); + yyval.TypeVal.S = Signless; + ; + break;} +case 135: +#line 1870 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Packed Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[(3) - (5)].TypeList)->begin(), - E = (yyvsp[(3) - (5)].TypeList)->end(); I != E; ++I) { + for (std::list::iterator I = yyvsp[-2].TypeList->begin(), + E = yyvsp[-2].TypeList->end(); I != E; ++I) { Elements.push_back(I->PAT->get()); delete I->PAT; } - (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); - (yyval.TypeVal).S = Signless; - delete (yyvsp[(3) - (5)].TypeList); - ;} - break; - - case 137: -#line 1881 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Empty packed structure type? - (yyval.TypeVal).PAT = new PATypeHolder(StructType::get(std::vector(),true)); - (yyval.TypeVal).S = Signless; - ;} - break; - - case 138: -#line 1885 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Pointer type? - if ((yyvsp[(1) - (2)].TypeVal).PAT->get() == Type::LabelTy) + yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(StructType::get(Elements, true))); + yyval.TypeVal.S = Signless; + delete yyvsp[-2].TypeList; + ; + break;} +case 136: +#line 1881 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Empty packed structure type? + yyval.TypeVal.PAT = new PATypeHolder(StructType::get(std::vector(),true)); + yyval.TypeVal.S = Signless; + ; + break;} +case 137: +#line 1885 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Pointer type? + if (yyvsp[-1].TypeVal.PAT->get() == Type::LabelTy) error("Cannot form a pointer to a basic block"); - (yyval.TypeVal).PAT = new PATypeHolder(HandleUpRefs(PointerType::get((yyvsp[(1) - (2)].TypeVal).PAT->get()))); - (yyval.TypeVal).S = (yyvsp[(1) - (2)].TypeVal).S; - delete (yyvsp[(1) - (2)].TypeVal).PAT; - ;} - break; - - case 139: -#line 1898 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back((yyvsp[(1) - (1)].TypeVal)); - ;} - break; - - case 140: -#line 1902 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back((yyvsp[(3) - (3)].TypeVal)); - ;} - break; - - case 142: -#line 1910 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + yyval.TypeVal.PAT = new PATypeHolder(HandleUpRefs(PointerType::get(yyvsp[-1].TypeVal.PAT->get()))); + yyval.TypeVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 138: +#line 1898 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TypeList = new std::list(); + yyval.TypeList->push_back(yyvsp[0].TypeVal); + ; + break;} +case 139: +#line 1902 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(yyvsp[0].TypeVal); + ; + break;} +case 141: +#line 1910 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(VoidTI); - ;} - break; - - case 143: -#line 1916 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TypeList) = new std::list(); + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(VoidTI); + ; + break;} +case 142: +#line 1916 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TypeList = new std::list(); PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - (yyval.TypeList)->push_back(VoidTI); - ;} - break; - - case 144: -#line 1923 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TypeList) = new std::list(); - ;} - break; - - case 145: -#line 1935 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Nonempty unsized arr - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (4)].TypeVal).PAT->get()); + yyval.TypeList->push_back(VoidTI); + ; + break;} +case 143: +#line 1923 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TypeList = new std::list(); + ; + break;} +case 144: +#line 1935 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Nonempty unsized arr + const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal.PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - (yyvsp[(1) - (4)].TypeVal).PAT->get()->getDescription() + "'"); + yyvsp[-3].TypeVal.PAT->get()->getDescription() + "'"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) error("Type mismatch: constant sized array initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! std::vector Elems; - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - Constant *C = (*(yyvsp[(3) - (4)].ConstVector))[i].C; + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + Constant *C = (*yyvsp[-1].ConstVector)[i].C; const Type* ValTy = C->getType(); if (ETy != ValTy) error("Element #" + utostr(i) + " is not of type '" + @@ -4464,75 +3518,72 @@ ValTy->getDescription() + "'"); Elems.push_back(C); } - (yyval.ConstVal).C = ConstantArray::get(ATy, Elems); - (yyval.ConstVal).S = (yyvsp[(1) - (4)].TypeVal).S; - delete (yyvsp[(1) - (4)].TypeVal).PAT; - delete (yyvsp[(3) - (4)].ConstVector); - ;} - break; - - case 146: -#line 1965 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal).PAT->get()); + yyval.ConstVal.C = ConstantArray::get(ATy, Elems); + yyval.ConstVal.S = yyvsp[-3].TypeVal.S; + delete yyvsp[-3].TypeVal.PAT; + delete yyvsp[-1].ConstVector; + ; + break;} +case 145: +#line 1965 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal.PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - (yyvsp[(1) - (3)].TypeVal).PAT->get()->getDescription() + "'"); + yyvsp[-2].TypeVal.PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) error("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +""); - (yyval.ConstVal).C = ConstantArray::get(ATy, std::vector()); - (yyval.ConstVal).S = (yyvsp[(1) - (3)].TypeVal).S; - delete (yyvsp[(1) - (3)].TypeVal).PAT; - ;} - break; - - case 147: -#line 1978 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const ArrayType *ATy = dyn_cast((yyvsp[(1) - (3)].TypeVal).PAT->get()); + yyval.ConstVal.C = ConstantArray::get(ATy, std::vector()); + yyval.ConstVal.S = yyvsp[-2].TypeVal.S; + delete yyvsp[-2].TypeVal.PAT; + ; + break;} +case 146: +#line 1978 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal.PAT->get()); if (ATy == 0) error("Cannot make array constant with type: '" + - (yyvsp[(1) - (3)].TypeVal).PAT->get()->getDescription() + "'"); + yyvsp[-2].TypeVal.PAT->get()->getDescription() + "'"); int NumElements = ATy->getNumElements(); const Type *ETy = dyn_cast(ATy->getElementType()); if (!ETy || cast(ETy)->getBitWidth() != 8) error("String arrays require type i8, not '" + ETy->getDescription() + "'"); - char *EndStr = UnEscapeLexed((yyvsp[(3) - (3)].StrVal), true); - if (NumElements != -1 && NumElements != (EndStr-(yyvsp[(3) - (3)].StrVal))) + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) error("Can't build string constant of size " + - itostr((int)(EndStr-(yyvsp[(3) - (3)].StrVal))) + " when array has size " + + itostr((int)(EndStr-yyvsp[0].StrVal)) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; - for (char *C = (char *)(yyvsp[(3) - (3)].StrVal); C != (char *)EndStr; ++C) + for (char *C = (char *)yyvsp[0].StrVal; C != (char *)EndStr; ++C) Vals.push_back(ConstantInt::get(ETy, *C)); - free((yyvsp[(3) - (3)].StrVal)); - (yyval.ConstVal).C = ConstantArray::get(ATy, Vals); - (yyval.ConstVal).S = (yyvsp[(1) - (3)].TypeVal).S; - delete (yyvsp[(1) - (3)].TypeVal).PAT; - ;} - break; - - case 148: -#line 2001 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Nonempty unsized arr - const PackedType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal).PAT->get()); + free(yyvsp[0].StrVal); + yyval.ConstVal.C = ConstantArray::get(ATy, Vals); + yyval.ConstVal.S = yyvsp[-2].TypeVal.S; + delete yyvsp[-2].TypeVal.PAT; + ; + break;} +case 147: +#line 2001 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Nonempty unsized arr + const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal.PAT->get()); if (PTy == 0) error("Cannot make packed constant with type: '" + - (yyvsp[(1) - (4)].TypeVal).PAT->get()->getDescription() + "'"); + yyvsp[-3].TypeVal.PAT->get()->getDescription() + "'"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... - if (NumElements != -1 && NumElements != (int)(yyvsp[(3) - (4)].ConstVector)->size()) + if (NumElements != -1 && NumElements != (int)yyvsp[-1].ConstVector->size()) error("Type mismatch: constant sized packed initialized with " + - utostr((yyvsp[(3) - (4)].ConstVector)->size()) + " arguments, but has size of " + + utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + itostr(NumElements) + ""); // Verify all elements are correct type! std::vector Elems; - for (unsigned i = 0; i < (yyvsp[(3) - (4)].ConstVector)->size(); i++) { - Constant *C = (*(yyvsp[(3) - (4)].ConstVector))[i].C; + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + Constant *C = (*yyvsp[-1].ConstVector)[i].C; const Type* ValTy = C->getType(); if (ETy != ValTy) error("Element #" + utostr(i) + " is not of type '" + @@ -4540,124 +3591,117 @@ ValTy->getDescription() + "'"); Elems.push_back(C); } - (yyval.ConstVal).C = ConstantPacked::get(PTy, Elems); - (yyval.ConstVal).S = (yyvsp[(1) - (4)].TypeVal).S; - delete (yyvsp[(1) - (4)].TypeVal).PAT; - delete (yyvsp[(3) - (4)].ConstVector); - ;} - break; - - case 149: -#line 2029 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal).PAT->get()); + yyval.ConstVal.C = ConstantPacked::get(PTy, Elems); + yyval.ConstVal.S = yyvsp[-3].TypeVal.S; + delete yyvsp[-3].TypeVal.PAT; + delete yyvsp[-1].ConstVector; + ; + break;} +case 148: +#line 2029 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-3].TypeVal.PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - (yyvsp[(1) - (4)].TypeVal).PAT->get()->getDescription() + "'"); - if ((yyvsp[(3) - (4)].ConstVector)->size() != STy->getNumContainedTypes()) + yyvsp[-3].TypeVal.PAT->get()->getDescription() + "'"); + if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for structure type"); // Check to ensure that constants are compatible with the type initializer! std::vector Fields; - for (unsigned i = 0, e = (yyvsp[(3) - (4)].ConstVector)->size(); i != e; ++i) { - Constant *C = (*(yyvsp[(3) - (4)].ConstVector))[i].C; + for (unsigned i = 0, e = yyvsp[-1].ConstVector->size(); i != e; ++i) { + Constant *C = (*yyvsp[-1].ConstVector)[i].C; if (C->getType() != STy->getElementType(i)) error("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer"); Fields.push_back(C); } - (yyval.ConstVal).C = ConstantStruct::get(STy, Fields); - (yyval.ConstVal).S = (yyvsp[(1) - (4)].TypeVal).S; - delete (yyvsp[(1) - (4)].TypeVal).PAT; - delete (yyvsp[(3) - (4)].ConstVector); - ;} - break; - - case 150: -#line 2051 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (3)].TypeVal).PAT->get()); + yyval.ConstVal.C = ConstantStruct::get(STy, Fields); + yyval.ConstVal.S = yyvsp[-3].TypeVal.S; + delete yyvsp[-3].TypeVal.PAT; + delete yyvsp[-1].ConstVector; + ; + break;} +case 149: +#line 2051 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-2].TypeVal.PAT->get()); if (STy == 0) error("Cannot make struct constant with type: '" + - (yyvsp[(1) - (3)].TypeVal).PAT->get()->getDescription() + "'"); + yyvsp[-2].TypeVal.PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for structure type"); - (yyval.ConstVal).C = ConstantStruct::get(STy, std::vector()); - (yyval.ConstVal).S = (yyvsp[(1) - (3)].TypeVal).S; - delete (yyvsp[(1) - (3)].TypeVal).PAT; - ;} - break; - - case 151: -#line 2062 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal).PAT->get()); + yyval.ConstVal.C = ConstantStruct::get(STy, std::vector()); + yyval.ConstVal.S = yyvsp[-2].TypeVal.S; + delete yyvsp[-2].TypeVal.PAT; + ; + break;} +case 150: +#line 2062 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-5].TypeVal.PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - (yyvsp[(1) - (6)].TypeVal).PAT->get()->getDescription() + "'"); - if ((yyvsp[(4) - (6)].ConstVector)->size() != STy->getNumContainedTypes()) + yyvsp[-5].TypeVal.PAT->get()->getDescription() + "'"); + if (yyvsp[-2].ConstVector->size() != STy->getNumContainedTypes()) error("Illegal number of initializers for packed structure type"); // Check to ensure that constants are compatible with the type initializer! std::vector Fields; - for (unsigned i = 0, e = (yyvsp[(4) - (6)].ConstVector)->size(); i != e; ++i) { - Constant *C = (*(yyvsp[(4) - (6)].ConstVector))[i].C; + for (unsigned i = 0, e = yyvsp[-2].ConstVector->size(); i != e; ++i) { + Constant *C = (*yyvsp[-2].ConstVector)[i].C; if (C->getType() != STy->getElementType(i)) error("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of packed struct initializer"); Fields.push_back(C); } - (yyval.ConstVal).C = ConstantStruct::get(STy, Fields); - (yyval.ConstVal).S = (yyvsp[(1) - (6)].TypeVal).S; - delete (yyvsp[(1) - (6)].TypeVal).PAT; - delete (yyvsp[(4) - (6)].ConstVector); - ;} - break; - - case 152: -#line 2084 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (5)].TypeVal).PAT->get()); + yyval.ConstVal.C = ConstantStruct::get(STy, Fields); + yyval.ConstVal.S = yyvsp[-5].TypeVal.S; + delete yyvsp[-5].TypeVal.PAT; + delete yyvsp[-2].ConstVector; + ; + break;} +case 151: +#line 2084 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const StructType *STy = dyn_cast(yyvsp[-4].TypeVal.PAT->get()); if (STy == 0) error("Cannot make packed struct constant with type: '" + - (yyvsp[(1) - (5)].TypeVal).PAT->get()->getDescription() + "'"); + yyvsp[-4].TypeVal.PAT->get()->getDescription() + "'"); if (STy->getNumContainedTypes() != 0) error("Illegal number of initializers for packed structure type"); - (yyval.ConstVal).C = ConstantStruct::get(STy, std::vector()); - (yyval.ConstVal).S = (yyvsp[(1) - (5)].TypeVal).S; - delete (yyvsp[(1) - (5)].TypeVal).PAT; - ;} - break; - - case 153: -#line 2095 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const PointerType *PTy = dyn_cast((yyvsp[(1) - (2)].TypeVal).PAT->get()); + yyval.ConstVal.C = ConstantStruct::get(STy, std::vector()); + yyval.ConstVal.S = yyvsp[-4].TypeVal.S; + delete yyvsp[-4].TypeVal.PAT; + ; + break;} +case 152: +#line 2095 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal.PAT->get()); if (PTy == 0) error("Cannot make null pointer constant with type: '" + - (yyvsp[(1) - (2)].TypeVal).PAT->get()->getDescription() + "'"); - (yyval.ConstVal).C = ConstantPointerNull::get(PTy); - (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; - delete (yyvsp[(1) - (2)].TypeVal).PAT; - ;} - break; - - case 154: -#line 2104 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ConstVal).C = UndefValue::get((yyvsp[(1) - (2)].TypeVal).PAT->get()); - (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; - delete (yyvsp[(1) - (2)].TypeVal).PAT; - ;} - break; - - case 155: -#line 2109 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const PointerType *Ty = dyn_cast((yyvsp[(1) - (2)].TypeVal).PAT->get()); + yyvsp[-1].TypeVal.PAT->get()->getDescription() + "'"); + yyval.ConstVal.C = ConstantPointerNull::get(PTy); + yyval.ConstVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 153: +#line 2104 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ConstVal.C = UndefValue::get(yyvsp[-1].TypeVal.PAT->get()); + yyval.ConstVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 154: +#line 2109 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal.PAT->get()); if (Ty == 0) error("Global const reference must be a pointer type, not" + - (yyvsp[(1) - (2)].TypeVal).PAT->get()->getDescription()); + yyvsp[-1].TypeVal.PAT->get()->getDescription()); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -4668,7 +3712,7 @@ // Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingValue(Ty, (yyvsp[(2) - (2)].ValIDVal)); + Value *V = getExistingValue(Ty, yyvsp[0].ValIDVal); CurFun.CurrentFunction = SavedCurFn; // If this is an initializer for a constant pointer, which is referencing a @@ -4681,14 +3725,14 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal))); + CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - (yyvsp[(2) - (2)].ValIDVal).destroy(); + yyvsp[0].ValIDVal.destroy(); } else { std::string Name; - if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::NameVal) Name = (yyvsp[(2) - (2)].ValIDVal).Name; + if (yyvsp[0].ValIDVal.Type == ValID::NameVal) Name = yyvsp[0].ValIDVal.Name; // Create the forward referenced global. GlobalValue *GV; @@ -4703,152 +3747,141 @@ } // Keep track of the fact that we have a forward ref to recycle it - CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, (yyvsp[(2) - (2)].ValIDVal)), GV)); + CurModule.GlobalRefs.insert(std::make_pair(std::make_pair(PT, yyvsp[0].ValIDVal), GV)); V = GV; } } - (yyval.ConstVal).C = cast(V); - (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; - delete (yyvsp[(1) - (2)].TypeVal).PAT; // Free the type handle - ;} - break; - - case 156: -#line 2167 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(1) - (2)].TypeVal).PAT->get() != (yyvsp[(2) - (2)].ConstVal).C->getType()) + yyval.ConstVal.C = cast(V); + yyval.ConstVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; // Free the type handle + ; + break;} +case 155: +#line 2167 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[-1].TypeVal.PAT->get() != yyvsp[0].ConstVal.C->getType()) error("Mismatched types for constant expression"); - (yyval.ConstVal) = (yyvsp[(2) - (2)].ConstVal); - (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; - delete (yyvsp[(1) - (2)].TypeVal).PAT; - ;} - break; - - case 157: -#line 2174 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(1) - (2)].TypeVal).PAT->get(); + yyval.ConstVal = yyvsp[0].ConstVal; + yyval.ConstVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 156: +#line 2174 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) error("Cannot create a null initialized value of this type"); - (yyval.ConstVal).C = Constant::getNullValue(Ty); - (yyval.ConstVal).S = (yyvsp[(1) - (2)].TypeVal).S; - delete (yyvsp[(1) - (2)].TypeVal).PAT; - ;} - break; - - case 158: -#line 2182 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // integral constants - const Type *Ty = (yyvsp[(1) - (2)].PrimType).T; - if (!ConstantInt::isValueValidForType(Ty, (yyvsp[(2) - (2)].SInt64Val))) + yyval.ConstVal.C = Constant::getNullValue(Ty); + yyval.ConstVal.S = yyvsp[-1].TypeVal.S; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 157: +#line 2182 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // integral constants + const Type *Ty = yyvsp[-1].PrimType.T; + if (!ConstantInt::isValueValidForType(Ty, yyvsp[0].SInt64Val)) error("Constant value doesn't fit in type"); - (yyval.ConstVal).C = ConstantInt::get(Ty, (yyvsp[(2) - (2)].SInt64Val)); - (yyval.ConstVal).S = Signed; - ;} - break; - - case 159: -#line 2189 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // integral constants - const Type *Ty = (yyvsp[(1) - (2)].PrimType).T; - if (!ConstantInt::isValueValidForType(Ty, (yyvsp[(2) - (2)].UInt64Val))) + yyval.ConstVal.C = ConstantInt::get(Ty, yyvsp[0].SInt64Val); + yyval.ConstVal.S = Signed; + ; + break;} +case 158: +#line 2189 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // integral constants + const Type *Ty = yyvsp[-1].PrimType.T; + if (!ConstantInt::isValueValidForType(Ty, yyvsp[0].UInt64Val)) error("Constant value doesn't fit in type"); - (yyval.ConstVal).C = ConstantInt::get(Ty, (yyvsp[(2) - (2)].UInt64Val)); - (yyval.ConstVal).S = Unsigned; - ;} - break; - - case 160: -#line 2196 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Boolean constants - (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, true); - (yyval.ConstVal).S = Unsigned; - ;} - break; - - case 161: -#line 2200 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Boolean constants - (yyval.ConstVal).C = ConstantInt::get(Type::Int1Ty, false); - (yyval.ConstVal).S = Unsigned; - ;} - break; - - case 162: -#line 2204 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Float & Double constants - if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType).T, (yyvsp[(2) - (2)].FPVal))) + yyval.ConstVal.C = ConstantInt::get(Ty, yyvsp[0].UInt64Val); + yyval.ConstVal.S = Unsigned; + ; + break;} +case 159: +#line 2196 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Boolean constants + yyval.ConstVal.C = ConstantInt::get(Type::Int1Ty, true); + yyval.ConstVal.S = Unsigned; + ; + break;} +case 160: +#line 2200 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Boolean constants + yyval.ConstVal.C = ConstantInt::get(Type::Int1Ty, false); + yyval.ConstVal.S = Unsigned; + ; + break;} +case 161: +#line 2204 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Float & Double constants + if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType.T, yyvsp[0].FPVal)) error("Floating point constant invalid for type"); - (yyval.ConstVal).C = ConstantFP::get((yyvsp[(1) - (2)].PrimType).T, (yyvsp[(2) - (2)].FPVal)); - (yyval.ConstVal).S = Signless; - ;} - break; - - case 163: -#line 2213 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* SrcTy = (yyvsp[(3) - (6)].ConstVal).C->getType(); - const Type* DstTy = (yyvsp[(5) - (6)].TypeVal).PAT->get(); - Signedness SrcSign = (yyvsp[(3) - (6)].ConstVal).S; - Signedness DstSign = (yyvsp[(5) - (6)].TypeVal).S; + yyval.ConstVal.C = ConstantFP::get(yyvsp[-1].PrimType.T, yyvsp[0].FPVal); + yyval.ConstVal.S = Signless; + ; + break;} +case 162: +#line 2213 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* SrcTy = yyvsp[-3].ConstVal.C->getType(); + const Type* DstTy = yyvsp[-1].TypeVal.PAT->get(); + Signedness SrcSign = yyvsp[-3].ConstVal.S; + Signedness DstSign = yyvsp[-1].TypeVal.S; if (!SrcTy->isFirstClassType()) error("cast constant expression from a non-primitive type: '" + SrcTy->getDescription() + "'"); if (!DstTy->isFirstClassType()) error("cast constant expression to a non-primitive type: '" + DstTy->getDescription() + "'"); - (yyval.ConstVal).C = cast(getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal).C, SrcSign, DstTy, DstSign)); - (yyval.ConstVal).S = DstSign; - delete (yyvsp[(5) - (6)].TypeVal).PAT; - ;} - break; - - case 164: -#line 2228 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(3) - (5)].ConstVal).C->getType(); + yyval.ConstVal.C = cast(getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal.C, SrcSign, DstTy, DstSign)); + yyval.ConstVal.S = DstSign; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 163: +#line 2228 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-2].ConstVal.C->getType(); if (!isa(Ty)) error("GetElementPtr requires a pointer operand"); std::vector VIndices; std::vector CIndices; - upgradeGEPIndices((yyvsp[(3) - (5)].ConstVal).C->getType(), (yyvsp[(4) - (5)].ValueList), VIndices, &CIndices); - - delete (yyvsp[(4) - (5)].ValueList); - (yyval.ConstVal).C = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal).C, CIndices); - (yyval.ConstVal).S = Signless; - ;} - break; + upgradeGEPIndices(yyvsp[-2].ConstVal.C->getType(), yyvsp[-1].ValueList, VIndices, &CIndices); - case 165: -#line 2241 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[(3) - (8)].ConstVal).C->getType()->isInteger() || - cast((yyvsp[(3) - (8)].ConstVal).C->getType())->getBitWidth() != 1) + delete yyvsp[-1].ValueList; + yyval.ConstVal.C = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal.C, CIndices); + yyval.ConstVal.S = Signless; + ; + break;} +case 164: +#line 2241 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!yyvsp[-5].ConstVal.C->getType()->isInteger() || + cast(yyvsp[-5].ConstVal.C->getType())->getBitWidth() != 1) error("Select condition must be bool type"); - if ((yyvsp[(5) - (8)].ConstVal).C->getType() != (yyvsp[(7) - (8)].ConstVal).C->getType()) + if (yyvsp[-3].ConstVal.C->getType() != yyvsp[-1].ConstVal.C->getType()) error("Select operand types must match"); - (yyval.ConstVal).C = ConstantExpr::getSelect((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C); - (yyval.ConstVal).S = Unsigned; - ;} - break; - - case 166: -#line 2250 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); - if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType()) + yyval.ConstVal.C = ConstantExpr::getSelect(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = Unsigned; + ; + break;} +case 165: +#line 2250 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-3].ConstVal.C->getType(); + if (Ty != yyvsp[-1].ConstVal.C->getType()) error("Binary operator types must match"); // First, make sure we're dealing with the right opcode by upgrading from // obsolete versions. - Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (6)].BinaryOpVal), Ty, (yyvsp[(3) - (6)].ConstVal).S); + Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-5].BinaryOpVal, Ty, yyvsp[-3].ConstVal.S); // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the // broken case. See PR424 for more information. if (!isa(Ty)) { - (yyval.ConstVal).C = ConstantExpr::get(Opcode, (yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); + yyval.ConstVal.C = ConstantExpr::get(Opcode, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { @@ -4856,165 +3889,147 @@ case Module::Pointer64: IntPtrTy = Type::Int64Ty; break; default: error("invalid pointer binary constant expr"); } - (yyval.ConstVal).C = ConstantExpr::get(Opcode, - ConstantExpr::getCast(Instruction::PtrToInt, (yyvsp[(3) - (6)].ConstVal).C, IntPtrTy), - ConstantExpr::getCast(Instruction::PtrToInt, (yyvsp[(5) - (6)].ConstVal).C, IntPtrTy)); - (yyval.ConstVal).C = ConstantExpr::getCast(Instruction::IntToPtr, (yyval.ConstVal).C, Ty); - } - (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; - ;} - break; - - case 167: -#line 2278 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); - if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType()) + yyval.ConstVal.C = ConstantExpr::get(Opcode, + ConstantExpr::getCast(Instruction::PtrToInt, yyvsp[-3].ConstVal.C, IntPtrTy), + ConstantExpr::getCast(Instruction::PtrToInt, yyvsp[-1].ConstVal.C, IntPtrTy)); + yyval.ConstVal.C = ConstantExpr::getCast(Instruction::IntToPtr, yyval.ConstVal.C, Ty); + } + yyval.ConstVal.S = yyvsp[-3].ConstVal.S; + ; + break;} +case 166: +#line 2278 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* Ty = yyvsp[-3].ConstVal.C->getType(); + if (Ty != yyvsp[-1].ConstVal.C->getType()) error("Logical operator types must match"); if (!Ty->isInteger()) { if (!isa(Ty) || !cast(Ty)->getElementType()->isInteger()) error("Logical operator requires integer operands"); } - Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (6)].BinaryOpVal), Ty, (yyvsp[(3) - (6)].ConstVal).S); - (yyval.ConstVal).C = ConstantExpr::get(Opcode, (yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); - (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; - ;} - break; - - case 168: -#line 2291 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); - if (Ty != (yyvsp[(5) - (6)].ConstVal).C->getType()) + Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-5].BinaryOpVal, Ty, yyvsp[-3].ConstVal.S); + yyval.ConstVal.C = ConstantExpr::get(Opcode, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = yyvsp[-3].ConstVal.S; + ; + break;} +case 167: +#line 2291 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* Ty = yyvsp[-3].ConstVal.C->getType(); + if (Ty != yyvsp[-1].ConstVal.C->getType()) error("setcc operand types must match"); unsigned short pred; - Instruction::OtherOps Opcode = getCompareOp((yyvsp[(1) - (6)].BinaryOpVal), pred, Ty, (yyvsp[(3) - (6)].ConstVal).S); - (yyval.ConstVal).C = ConstantExpr::getCompare(Opcode, (yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); - (yyval.ConstVal).S = Unsigned; - ;} - break; - - case 169: -#line 2300 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(4) - (7)].ConstVal).C->getType() != (yyvsp[(6) - (7)].ConstVal).C->getType()) + Instruction::OtherOps Opcode = getCompareOp(yyvsp[-5].BinaryOpVal, pred, Ty, yyvsp[-3].ConstVal.S); + yyval.ConstVal.C = ConstantExpr::getCompare(Opcode, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = Unsigned; + ; + break;} +case 168: +#line 2300 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[-3].ConstVal.C->getType() != yyvsp[-1].ConstVal.C->getType()) error("icmp operand types must match"); - (yyval.ConstVal).C = ConstantExpr::getCompare((yyvsp[(2) - (7)].IPred), (yyvsp[(4) - (7)].ConstVal).C, (yyvsp[(6) - (7)].ConstVal).C); - (yyval.ConstVal).S = Unsigned; - ;} - break; - - case 170: -#line 2306 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(4) - (7)].ConstVal).C->getType() != (yyvsp[(6) - (7)].ConstVal).C->getType()) + yyval.ConstVal.C = ConstantExpr::getCompare(yyvsp[-5].IPred, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = Unsigned; + ; + break;} +case 169: +#line 2306 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[-3].ConstVal.C->getType() != yyvsp[-1].ConstVal.C->getType()) error("fcmp operand types must match"); - (yyval.ConstVal).C = ConstantExpr::getCompare((yyvsp[(2) - (7)].FPred), (yyvsp[(4) - (7)].ConstVal).C, (yyvsp[(6) - (7)].ConstVal).C); - (yyval.ConstVal).S = Unsigned; - ;} - break; - - case 171: -#line 2312 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[(5) - (6)].ConstVal).C->getType()->isInteger() || - cast((yyvsp[(5) - (6)].ConstVal).C->getType())->getBitWidth() != 8) + yyval.ConstVal.C = ConstantExpr::getCompare(yyvsp[-5].FPred, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = Unsigned; + ; + break;} +case 170: +#line 2312 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!yyvsp[-1].ConstVal.C->getType()->isInteger() || + cast(yyvsp[-1].ConstVal.C->getType())->getBitWidth() != 8) error("Shift count for shift constant must be unsigned byte"); - const Type* Ty = (yyvsp[(3) - (6)].ConstVal).C->getType(); - if (!(yyvsp[(3) - (6)].ConstVal).C->getType()->isInteger()) + const Type* Ty = yyvsp[-3].ConstVal.C->getType(); + if (!yyvsp[-3].ConstVal.C->getType()->isInteger()) error("Shift constant expression requires integer operand"); - Constant *ShiftAmt = ConstantExpr::getZExt((yyvsp[(5) - (6)].ConstVal).C, Ty); - (yyval.ConstVal).C = ConstantExpr::get(getBinaryOp((yyvsp[(1) - (6)].BinaryOpVal), Ty, (yyvsp[(3) - (6)].ConstVal).S), (yyvsp[(3) - (6)].ConstVal).C, ShiftAmt); - (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; - ;} - break; - - case 172: -#line 2323 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C)) + Constant *ShiftAmt = ConstantExpr::getZExt(yyvsp[-1].ConstVal.C, Ty); + yyval.ConstVal.C = ConstantExpr::get(getBinaryOp(yyvsp[-5].BinaryOpVal, Ty, yyvsp[-3].ConstVal.S), yyvsp[-3].ConstVal.C, ShiftAmt); + yyval.ConstVal.S = yyvsp[-3].ConstVal.S; + ; + break;} +case 171: +#line 2323 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C)) error("Invalid extractelement operands"); - (yyval.ConstVal).C = ConstantExpr::getExtractElement((yyvsp[(3) - (6)].ConstVal).C, (yyvsp[(5) - (6)].ConstVal).C); - (yyval.ConstVal).S = (yyvsp[(3) - (6)].ConstVal).S; - ;} - break; - - case 173: -#line 2329 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C)) + yyval.ConstVal.C = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = yyvsp[-3].ConstVal.S; + ; + break;} +case 172: +#line 2329 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C)) error("Invalid insertelement operands"); - (yyval.ConstVal).C = ConstantExpr::getInsertElement((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C); - (yyval.ConstVal).S = (yyvsp[(3) - (8)].ConstVal).S; - ;} - break; - - case 174: -#line 2335 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C)) + yyval.ConstVal.C = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = yyvsp[-5].ConstVal.S; + ; + break;} +case 173: +#line 2335 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C)) error("Invalid shufflevector operands"); - (yyval.ConstVal).C = ConstantExpr::getShuffleVector((yyvsp[(3) - (8)].ConstVal).C, (yyvsp[(5) - (8)].ConstVal).C, (yyvsp[(7) - (8)].ConstVal).C); - (yyval.ConstVal).S = (yyvsp[(3) - (8)].ConstVal).S; - ;} - break; - - case 175: -#line 2346 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); ;} - break; - - case 176: -#line 2347 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); - ;} - break; - - case 177: -#line 2356 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 178: -#line 2357 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 179: -#line 2369 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ModuleVal) = ParserResult = (yyvsp[(1) - (1)].ModuleVal); + yyval.ConstVal.C = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal.C, yyvsp[-3].ConstVal.C, yyvsp[-1].ConstVal.C); + yyval.ConstVal.S = yyvsp[-5].ConstVal.S; + ; + break;} +case 174: +#line 2346 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); ; + break;} +case 175: +#line 2347 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ConstVector = new std::vector(); + yyval.ConstVector->push_back(yyvsp[0].ConstVal); + ; + break;} +case 176: +#line 2356 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.BoolVal = false; ; + break;} +case 177: +#line 2357 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.BoolVal = true; ; + break;} +case 178: +#line 2369 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ModuleVal = ParserResult = yyvsp[0].ModuleVal; CurModule.ModuleDone(); - ;} - break; - - case 180: -#line 2378 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); CurFun.FunctionDone(); ;} - break; - - case 181: -#line 2379 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); ;} - break; - - case 182: -#line 2380 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ModuleVal) = (yyvsp[(1) - (4)].ModuleVal); ;} - break; - - case 183: -#line 2381 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ModuleVal) = (yyvsp[(1) - (2)].ModuleVal); ;} - break; - - case 184: -#line 2382 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ModuleVal) = CurModule.CurrentModule; + ; + break;} +case 179: +#line 2378 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ModuleVal = yyvsp[-1].ModuleVal; CurFun.FunctionDone(); ; + break;} +case 180: +#line 2379 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ModuleVal = yyvsp[-1].ModuleVal; ; + break;} +case 181: +#line 2380 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ModuleVal = yyvsp[-3].ModuleVal; ; + break;} +case 182: +#line 2381 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ModuleVal = yyvsp[-1].ModuleVal; ; + break;} +case 183: +#line 2382 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ModuleVal = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; @@ -5024,12 +4039,11 @@ error("Reference to an undefined type: #" + itostr(DID.Num)); } } - ;} - break; - - case 185: -#line 2398 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + ; + break;} +case 184: +#line 2398 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -5039,266 +4053,234 @@ // If types are not resolved eagerly, then the two types will not be // determined to be the same type! // - const Type* Ty = (yyvsp[(4) - (4)].TypeVal).PAT->get(); - ResolveTypeTo((yyvsp[(2) - (4)].StrVal), Ty); + const Type* Ty = yyvsp[0].TypeVal.PAT->get(); + ResolveTypeTo(yyvsp[-2].StrVal, Ty); - if (!setTypeName(Ty, (yyvsp[(2) - (4)].StrVal)) && !(yyvsp[(2) - (4)].StrVal)) { + if (!setTypeName(Ty, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { // If this is a named type that is not a redefinition, add it to the slot // table. CurModule.Types.push_back(Ty); } - delete (yyvsp[(4) - (4)].TypeVal).PAT; - ;} - break; - - case 186: -#line 2418 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Function prototypes can be in const pool - ;} - break; - - case 187: -#line 2420 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Asm blocks can be in the const pool - ;} - break; - - case 188: -#line 2422 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(5) - (5)].ConstVal).C == 0) + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 185: +#line 2418 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Function prototypes can be in const pool + ; + break;} +case 186: +#line 2420 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Asm blocks can be in the const pool + ; + break;} +case 187: +#line 2422 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[0].ConstVal.C == 0) error("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), (yyvsp[(3) - (5)].Linkage), (yyvsp[(4) - (5)].BoolVal), (yyvsp[(5) - (5)].ConstVal).C->getType(), (yyvsp[(5) - (5)].ConstVal).C); - ;} - break; - - case 189: -#line 2426 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, yyvsp[-2].Linkage, yyvsp[-1].BoolVal, yyvsp[0].ConstVal.C->getType(), yyvsp[0].ConstVal.C); + ; + break;} +case 188: +#line 2426 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ CurGV = 0; - ;} - break; - - case 190: -#line 2429 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get(); - CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::ExternalLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0); - delete (yyvsp[(5) - (5)].TypeVal).PAT; - ;} - break; - - case 191: -#line 2433 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + ; + break;} +case 189: +#line 2429 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[0].TypeVal.PAT->get(); + CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, yyvsp[-1].BoolVal, Ty, 0); + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 190: +#line 2433 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ CurGV = 0; - ;} - break; - - case 192: -#line 2436 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get(); - CurGV = ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::DLLImportLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0); - delete (yyvsp[(5) - (5)].TypeVal).PAT; - ;} - break; - - case 193: -#line 2440 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + ; + break;} +case 191: +#line 2436 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[0].TypeVal.PAT->get(); + CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::DLLImportLinkage, yyvsp[-1].BoolVal, Ty, 0); + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 192: +#line 2440 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ CurGV = 0; - ;} - break; - - case 194: -#line 2443 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(5) - (5)].TypeVal).PAT->get(); + ; + break;} +case 193: +#line 2443 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[0].TypeVal.PAT->get(); CurGV = - ParseGlobalVariable((yyvsp[(2) - (5)].StrVal), GlobalValue::ExternalWeakLinkage, (yyvsp[(4) - (5)].BoolVal), Ty, 0); - delete (yyvsp[(5) - (5)].TypeVal).PAT; - ;} - break; - - case 195: -#line 2448 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalWeakLinkage, yyvsp[-1].BoolVal, Ty, 0); + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 194: +#line 2448 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ CurGV = 0; - ;} - break; - - case 196: -#line 2451 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - ;} - break; - - case 197: -#line 2453 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - ;} - break; - - case 198: -#line 2455 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - ;} - break; - - case 199: -#line 2460 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + ; + break;} +case 195: +#line 2451 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + ; + break;} +case 196: +#line 2453 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + ; + break;} +case 197: +#line 2455 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + ; + break;} +case 198: +#line 2460 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed((yyvsp[(1) - (1)].StrVal), true); - std::string NewAsm((yyvsp[(1) - (1)].StrVal), EndStr); - free((yyvsp[(1) - (1)].StrVal)); + char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string NewAsm(yyvsp[0].StrVal, EndStr); + free(yyvsp[0].StrVal); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); - ;} - break; - - case 200: -#line 2474 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Endianness) = Module::BigEndian; ;} - break; - - case 201: -#line 2475 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Endianness) = Module::LittleEndian; ;} - break; - - case 202: -#line 2479 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - CurModule.setEndianness((yyvsp[(3) - (3)].Endianness)); - ;} - break; - - case 203: -#line 2482 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(3) - (3)].UInt64Val) == 32) + ; + break;} +case 199: +#line 2474 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Endianness = Module::BigEndian; ; + break;} +case 200: +#line 2475 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Endianness = Module::LittleEndian; ; + break;} +case 201: +#line 2479 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + CurModule.setEndianness(yyvsp[0].Endianness); + ; + break;} +case 202: +#line 2482 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[0].UInt64Val == 32) CurModule.setPointerSize(Module::Pointer32); - else if ((yyvsp[(3) - (3)].UInt64Val) == 64) + else if (yyvsp[0].UInt64Val == 64) CurModule.setPointerSize(Module::Pointer64); else - error("Invalid pointer size: '" + utostr((yyvsp[(3) - (3)].UInt64Val)) + "'"); - ;} - break; - - case 204: -#line 2490 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - CurModule.CurrentModule->setTargetTriple((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); - ;} - break; - - case 205: -#line 2494 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - CurModule.CurrentModule->setDataLayout((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); - ;} - break; - - case 207: -#line 2505 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[(3) - (3)].StrVal)); - free((yyvsp[(3) - (3)].StrVal)); - ;} - break; - - case 208: -#line 2509 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - CurModule.CurrentModule->addLibrary((yyvsp[(1) - (1)].StrVal)); - free((yyvsp[(1) - (1)].StrVal)); - ;} - break; - - case 209: -#line 2513 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { ;} - break; - - case 213: -#line 2526 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 214: -#line 2530 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(1) - (2)].TypeVal).PAT->get() == Type::VoidTy) + error("Invalid pointer size: '" + utostr(yyvsp[0].UInt64Val) + "'"); + ; + break;} +case 203: +#line 2490 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 204: +#line 2494 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + CurModule.CurrentModule->setDataLayout(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 206: +#line 2505 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 207: +#line 2509 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 208: +#line 2513 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ ; + break;} +case 212: +#line 2526 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.StrVal = 0; ; + break;} +case 213: +#line 2530 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[-1].TypeVal.PAT->get() == Type::VoidTy) error("void typed arguments are invalid"); - (yyval.ArgVal) = new std::pair((yyvsp[(1) - (2)].TypeVal), (yyvsp[(2) - (2)].StrVal)); - ;} - break; - - case 215: -#line 2538 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); - (yyval.ArgList)->push_back(*(yyvsp[(3) - (3)].ArgVal)); - delete (yyvsp[(3) - (3)].ArgVal); - ;} - break; - - case 216: -#line 2543 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ArgList) = new std::vector >(); - (yyval.ArgList)->push_back(*(yyvsp[(1) - (1)].ArgVal)); - delete (yyvsp[(1) - (1)].ArgVal); - ;} - break; - - case 217: -#line 2551 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); ;} - break; - - case 218: -#line 2552 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); + yyval.ArgVal = new std::pair(yyvsp[-1].TypeVal, yyvsp[0].StrVal); + ; + break;} +case 214: +#line 2538 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ArgList = yyvsp[-2].ArgList; + yyval.ArgList->push_back(*yyvsp[0].ArgVal); + delete yyvsp[0].ArgVal; + ; + break;} +case 215: +#line 2543 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ArgList = new std::vector >(); + yyval.ArgList->push_back(*yyvsp[0].ArgVal); + delete yyvsp[0].ArgVal; + ; + break;} +case 216: +#line 2551 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ArgList = yyvsp[0].ArgList; ; + break;} +case 217: +#line 2552 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ArgList = yyvsp[-2].ArgList; PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - (yyval.ArgList)->push_back(std::pair(VoidTI, 0)); - ;} - break; - - case 219: -#line 2559 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ArgList) = new std::vector >(); + yyval.ArgList->push_back(std::pair(VoidTI, 0)); + ; + break;} +case 218: +#line 2559 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ArgList = new std::vector >(); PATypeInfo VoidTI; VoidTI.PAT = new PATypeHolder(Type::VoidTy); VoidTI.S = Signless; - (yyval.ArgList)->push_back(std::pair(VoidTI, 0)); - ;} - break; - - case 220: -#line 2566 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ArgList) = 0; ;} - break; - - case 221: -#line 2570 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - UnEscapeLexed((yyvsp[(3) - (8)].StrVal)); - std::string FunctionName((yyvsp[(3) - (8)].StrVal)); - free((yyvsp[(3) - (8)].StrVal)); // Free strdup'd memory! + yyval.ArgList->push_back(std::pair(VoidTI, 0)); + ; + break;} +case 219: +#line 2566 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ArgList = 0; ; + break;} +case 220: +#line 2570 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + UnEscapeLexed(yyvsp[-5].StrVal); + std::string FunctionName(yyvsp[-5].StrVal); + free(yyvsp[-5].StrVal); // Free strdup'd memory! - const Type* RetTy = (yyvsp[(2) - (8)].TypeVal).PAT->get(); + const Type* RetTy = yyvsp[-6].TypeVal.PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("LLVM functions cannot return aggregate types"); @@ -5313,9 +4295,9 @@ } else if (FunctionName == "llvm.va_copy") { ParamTyList.push_back(PointerType::get(Type::Int8Ty)); ParamTyList.push_back(PointerType::get(Type::Int8Ty)); - } else if ((yyvsp[(5) - (8)].ArgList)) { // If there are arguments... + } else if (yyvsp[-3].ArgList) { // If there are arguments... for (std::vector >::iterator - I = (yyvsp[(5) - (8)].ArgList)->begin(), E = (yyvsp[(5) - (8)].ArgList)->end(); I != E; ++I) { + I = yyvsp[-3].ArgList->begin(), E = yyvsp[-3].ArgList->end(); I != E; ++I) { const Type *Ty = I->first.PAT->get(); ParamTyList.push_back(Ty); } @@ -5328,7 +4310,7 @@ // Convert the CSRet calling convention into the corresponding parameter // attribute. FunctionType::ParamAttrsList ParamAttrs; - if ((yyvsp[(1) - (8)].UIntVal) == OldCallingConv::CSRet) { + if (yyvsp[-7].UIntVal == OldCallingConv::CSRet) { ParamAttrs.push_back(FunctionType::NoAttributeSet); // result ParamAttrs.push_back(FunctionType::StructRetAttribute); // first arg } @@ -5336,7 +4318,7 @@ const FunctionType *FT = FunctionType::get(RetTy, ParamTyList, isVarArg, ParamAttrs); const PointerType *PFT = PointerType::get(FT); - delete (yyvsp[(2) - (8)].TypeVal).PAT; + delete yyvsp[-6].TypeVal.PAT; ValID ID; if (!FunctionName.empty()) { @@ -5439,150 +4421,131 @@ // argument to another function. Fn->setLinkage(CurFun.Linkage); } - Fn->setCallingConv(upgradeCallingConv((yyvsp[(1) - (8)].UIntVal))); - Fn->setAlignment((yyvsp[(8) - (8)].UIntVal)); - if ((yyvsp[(7) - (8)].StrVal)) { - Fn->setSection((yyvsp[(7) - (8)].StrVal)); - free((yyvsp[(7) - (8)].StrVal)); + Fn->setCallingConv(upgradeCallingConv(yyvsp[-7].UIntVal)); + Fn->setAlignment(yyvsp[0].UIntVal); + if (yyvsp[-1].StrVal) { + Fn->setSection(yyvsp[-1].StrVal); + free(yyvsp[-1].StrVal); } // Add all of the arguments we parsed to the function... - if ((yyvsp[(5) - (8)].ArgList)) { // Is null if empty... + if (yyvsp[-3].ArgList) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[(5) - (8)].ArgList)->back().first.PAT->get() == Type::VoidTy && - (yyvsp[(5) - (8)].ArgList)->back().second == 0 && "Not a varargs marker"); - delete (yyvsp[(5) - (8)].ArgList)->back().first.PAT; - (yyvsp[(5) - (8)].ArgList)->pop_back(); // Delete the last entry + assert(yyvsp[-3].ArgList->back().first.PAT->get() == Type::VoidTy && + yyvsp[-3].ArgList->back().second == 0 && "Not a varargs marker"); + delete yyvsp[-3].ArgList->back().first.PAT; + yyvsp[-3].ArgList->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); Function::arg_iterator ArgEnd = Fn->arg_end(); - std::vector >::iterator I = (yyvsp[(5) - (8)].ArgList)->begin(); - std::vector >::iterator E = (yyvsp[(5) - (8)].ArgList)->end(); + std::vector >::iterator I = yyvsp[-3].ArgList->begin(); + std::vector >::iterator E = yyvsp[-3].ArgList->end(); for ( ; I != E && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->first.PAT; // Delete the typeholder... setValueName(ArgIt, I->second); // Insert arg into symtab... InsertValue(ArgIt); } - delete (yyvsp[(5) - (8)].ArgList); // We're now done with the argument list + delete yyvsp[-3].ArgList; // We're now done with the argument list } - ;} - break; - - case 224: -#line 2750 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.FunctionVal) = CurFun.CurrentFunction; + ; + break;} +case 223: +#line 2750 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.FunctionVal = CurFun.CurrentFunction; // Make sure that we keep track of the linkage type even if there was a // previous "declare". - (yyval.FunctionVal)->setLinkage((yyvsp[(1) - (3)].Linkage)); - ;} - break; - - case 227: -#line 2764 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - ;} - break; - - case 228: -#line 2769 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 229: -#line 2770 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 230: -#line 2771 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 231: -#line 2775 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.isDeclare = true; ;} - break; - - case 232: -#line 2776 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { CurFun.Linkage = (yyvsp[(3) - (3)].Linkage); ;} - break; - - case 233: -#line 2776 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.FunctionVal) = CurFun.CurrentFunction; + yyval.FunctionVal->setLinkage(yyvsp[-2].Linkage); + ; + break;} +case 226: +#line 2764 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; + ; + break;} +case 227: +#line 2769 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 228: +#line 2770 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 229: +#line 2771 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 230: +#line 2775 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ CurFun.isDeclare = true; ; + break;} +case 231: +#line 2776 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ CurFun.Linkage = yyvsp[0].Linkage; ; + break;} +case 232: +#line 2776 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.FunctionVal = CurFun.CurrentFunction; CurFun.FunctionDone(); - ;} - break; - - case 234: -#line 2788 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 235: -#line 2789 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 236: -#line 2794 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); ;} - break; - - case 237: -#line 2795 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); ;} - break; - - case 238: -#line 2796 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); ;} - break; - - case 239: -#line 2797 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ;} - break; - - case 240: -#line 2798 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ;} - break; - - case 241: -#line 2799 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::createNull(); ;} - break; - - case 242: -#line 2800 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::createUndef(); ;} - break; - - case 243: -#line 2801 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::createZeroInit(); ;} - break; - - case 244: -#line 2802 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Nonempty unsized packed vector - const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0].C->getType(); - int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); + ; + break;} +case 233: +#line 2788 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.BoolVal = false; ; + break;} +case 234: +#line 2789 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.BoolVal = true; ; + break;} +case 235: +#line 2794 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); ; + break;} +case 236: +#line 2795 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); ; + break;} +case 237: +#line 2796 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); ; + break;} +case 238: +#line 2797 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::create(ConstantInt::get(Type::Int1Ty, true)); ; + break;} +case 239: +#line 2798 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::create(ConstantInt::get(Type::Int1Ty, false)); ; + break;} +case 240: +#line 2799 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::createNull(); ; + break;} +case 241: +#line 2800 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::createUndef(); ; + break;} +case 242: +#line 2801 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::createZeroInit(); ; + break;} +case 243: +#line 2802 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Nonempty unsized packed vector + const Type *ETy = (*yyvsp[-1].ConstVector)[0].C->getType(); + int NumElements = yyvsp[-1].ConstVector->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( HandleUpRefs(PackedType::get(ETy, NumElements))); // Verify all elements are correct type! std::vector Elems; - for (unsigned i = 0; i < (yyvsp[(2) - (3)].ConstVector)->size(); i++) { - Constant *C = (*(yyvsp[(2) - (3)].ConstVector))[i].C; + for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { + Constant *C = (*yyvsp[-1].ConstVector)[i].C; const Type *CTy = C->getType(); if (ETy != CTy) error("Element #" + utostr(i) + " is not of type '" + @@ -5590,211 +4553,193 @@ CTy->getDescription() + "'"); Elems.push_back(C); } - (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, Elems)); - delete PTy; delete (yyvsp[(2) - (3)].ConstVector); - ;} - break; - - case 245: -#line 2823 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal).C); - ;} - break; - - case 246: -#line 2826 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - char *End = UnEscapeLexed((yyvsp[(3) - (5)].StrVal), true); - std::string AsmStr = std::string((yyvsp[(3) - (5)].StrVal), End); - End = UnEscapeLexed((yyvsp[(5) - (5)].StrVal), true); - std::string Constraints = std::string((yyvsp[(5) - (5)].StrVal), End); - (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[(2) - (5)].BoolVal)); - free((yyvsp[(3) - (5)].StrVal)); - free((yyvsp[(5) - (5)].StrVal)); - ;} - break; - - case 247: -#line 2841 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SIntVal)); ;} - break; - - case 248: -#line 2842 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].StrVal)); ;} - break; - - case 251: -#line 2855 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(1) - (2)].TypeVal).PAT->get(); - (yyval.ValueVal).S = (yyvsp[(1) - (2)].TypeVal).S; - (yyval.ValueVal).V = getVal(Ty, (yyvsp[(2) - (2)].ValIDVal)); - delete (yyvsp[(1) - (2)].TypeVal).PAT; - ;} - break; - - case 252: -#line 2864 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - ;} - break; - - case 253: -#line 2867 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - ;} - break; - - case 254: -#line 2876 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - setValueName((yyvsp[(3) - (3)].TermInstVal), (yyvsp[(2) - (3)].StrVal)); - InsertValue((yyvsp[(3) - (3)].TermInstVal)); - (yyvsp[(1) - (3)].BasicBlockVal)->getInstList().push_back((yyvsp[(3) - (3)].TermInstVal)); - InsertValue((yyvsp[(1) - (3)].BasicBlockVal)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); - ;} - break; - - case 255: -#line 2886 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if ((yyvsp[(2) - (2)].InstVal).I) - (yyvsp[(1) - (2)].BasicBlockVal)->getInstList().push_back((yyvsp[(2) - (2)].InstVal).I); - (yyval.BasicBlockVal) = (yyvsp[(1) - (2)].BasicBlockVal); - ;} - break; - - case 256: -#line 2891 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); + yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, Elems)); + delete PTy; delete yyvsp[-1].ConstVector; + ; + break;} +case 244: +#line 2823 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal.C); + ; + break;} +case 245: +#line 2826 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); + std::string AsmStr = std::string(yyvsp[-2].StrVal, End); + End = UnEscapeLexed(yyvsp[0].StrVal, true); + std::string Constraints = std::string(yyvsp[0].StrVal, End); + yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); + free(yyvsp[-2].StrVal); + free(yyvsp[0].StrVal); + ; + break;} +case 246: +#line 2841 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::create(yyvsp[0].SIntVal); ; + break;} +case 247: +#line 2842 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValIDVal = ValID::create(yyvsp[0].StrVal); ; + break;} +case 250: +#line 2855 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); + yyval.ValueVal.S = yyvsp[-1].TypeVal.S; + yyval.ValueVal.V = getVal(Ty, yyvsp[0].ValIDVal); + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 251: +#line 2864 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; + ; + break;} +case 252: +#line 2867 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Do not allow functions with 0 basic blocks + yyval.FunctionVal = yyvsp[-1].FunctionVal; + ; + break;} +case 253: +#line 2876 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); + InsertValue(yyvsp[0].TermInstVal); + yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); + InsertValue(yyvsp[-2].BasicBlockVal); + yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; + ; + break;} +case 254: +#line 2886 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (yyvsp[0].InstVal.I) + yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal.I); + yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; + ; + break;} +case 255: +#line 2891 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.BasicBlockVal = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); // Make sure to move the basic block to the correct location in the // function, instead of leaving it inserted wherever it was first // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); - ;} - break; - - case 257: -#line 2900 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[(1) - (1)].StrVal)), true); + BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); + ; + break;} +case 256: +#line 2900 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.BasicBlockVal = CurBB = getBBVal(ValID::create(yyvsp[0].StrVal), true); // Make sure to move the basic block to the correct location in the // function, instead of leaving it inserted wherever it was first // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); - ;} - break; - - case 260: -#line 2914 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal).V); - ;} - break; - - case 261: -#line 2917 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Return with no result... - (yyval.TermInstVal) = new ReturnInst(); - ;} - break; - - case 262: -#line 2920 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); - (yyval.TermInstVal) = new BranchInst(tmpBB); - ;} - break; - - case 263: -#line 2924 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); - BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); - (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ;} - break; - - case 264: -#line 2930 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType).T, (yyvsp[(3) - (9)].ValIDVal)); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, (yyvsp[(8) - (9)].JumpTable)->size()); - (yyval.TermInstVal) = S; - std::vector >::iterator I = (yyvsp[(8) - (9)].JumpTable)->begin(), - E = (yyvsp[(8) - (9)].JumpTable)->end(); + BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); + ; + break;} +case 259: +#line 2914 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Return with a result... + yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal.V); + ; + break;} +case 260: +#line 2917 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Return with no result... + yyval.TermInstVal = new ReturnInst(); + ; + break;} +case 261: +#line 2920 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Unconditional Branch... + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + yyval.TermInstVal = new BranchInst(tmpBB); + ; + break;} +case 262: +#line 2924 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + BasicBlock* tmpBBA = getBBVal(yyvsp[-3].ValIDVal); + BasicBlock* tmpBBB = getBBVal(yyvsp[0].ValIDVal); + Value* tmpVal = getVal(Type::Int1Ty, yyvsp[-6].ValIDVal); + yyval.TermInstVal = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ; + break;} +case 263: +#line 2930 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + Value* tmpVal = getVal(yyvsp[-7].PrimType.T, yyvsp[-6].ValIDVal); + BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); + SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); + yyval.TermInstVal = S; + std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), + E = yyvsp[-1].JumpTable->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else error("Switch case is constant, but not a simple integer"); } - delete (yyvsp[(8) - (9)].JumpTable); - ;} - break; - - case 265: -#line 2945 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType).T, (yyvsp[(3) - (8)].ValIDVal)); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (8)].ValIDVal)); + delete yyvsp[-1].JumpTable; + ; + break;} +case 264: +#line 2945 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + Value* tmpVal = getVal(yyvsp[-6].PrimType.T, yyvsp[-5].ValIDVal); + BasicBlock* tmpBB = getBBVal(yyvsp[-2].ValIDVal); SwitchInst *S = new SwitchInst(tmpVal, tmpBB, 0); - (yyval.TermInstVal) = S; - ;} - break; - - case 266: -#line 2952 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + yyval.TermInstVal = S; + ; + break;} +case 265: +#line 2952 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast((yyvsp[(3) - (13)].TypeVal).PAT->get())) || + if (!(PFTy = dyn_cast(yyvsp[-10].TypeVal.PAT->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - if ((yyvsp[(6) - (13)].ValueList)) { - for (std::vector::iterator I = (yyvsp[(6) - (13)].ValueList)->begin(), E = (yyvsp[(6) - (13)].ValueList)->end(); + if (yyvsp[-7].ValueList) { + for (std::vector::iterator I = yyvsp[-7].ValueList->begin(), E = yyvsp[-7].ValueList->end(); I != E; ++I) ParamTypes.push_back((*I).V->getType()); } FunctionType::ParamAttrsList ParamAttrs; - if ((yyvsp[(2) - (13)].UIntVal) == OldCallingConv::CSRet) { + if (yyvsp[-11].UIntVal == OldCallingConv::CSRet) { ParamAttrs.push_back(FunctionType::NoAttributeSet); ParamAttrs.push_back(FunctionType::StructRetAttribute); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - Ty = FunctionType::get((yyvsp[(3) - (13)].TypeVal).PAT->get(), ParamTypes, isVarArg, ParamAttrs); + Ty = FunctionType::get(yyvsp[-10].TypeVal.PAT->get(), ParamTypes, isVarArg, ParamAttrs); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, (yyvsp[(4) - (13)].ValIDVal)); // Get the function we're calling... - BasicBlock *Normal = getBBVal((yyvsp[(10) - (13)].ValIDVal)); - BasicBlock *Except = getBBVal((yyvsp[(13) - (13)].ValIDVal)); + Value *V = getVal(PFTy, yyvsp[-9].ValIDVal); // Get the function we're calling... + BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); + BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); // Create the call node... - if (!(yyvsp[(6) - (13)].ValueList)) { // Has no arguments? - (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, std::vector()); + if (!yyvsp[-7].ValueList) { // Has no arguments? + yyval.TermInstVal = new InvokeInst(V, Normal, Except, 0, 0); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified // correctly! // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = (yyvsp[(6) - (13)].ValueList)->begin(), ArgE = (yyvsp[(6) - (13)].ValueList)->end(); + std::vector::iterator ArgI = yyvsp[-7].ValueList->begin(), ArgE = yyvsp[-7].ValueList->end(); std::vector Args; for (; ArgI != ArgE && I != E; ++ArgI, ++I) { @@ -5807,64 +4752,59 @@ if (I != E || (ArgI != ArgE && !Ty->isVarArg())) error("Invalid number of parameters detected"); - (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, Args); + yyval.TermInstVal = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); } - cast((yyval.TermInstVal))->setCallingConv(upgradeCallingConv((yyvsp[(2) - (13)].UIntVal))); - delete (yyvsp[(3) - (13)].TypeVal).PAT; - delete (yyvsp[(6) - (13)].ValueList); - ;} - break; - - case 267: -#line 3007 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TermInstVal) = new UnwindInst(); - ;} - break; - - case 268: -#line 3010 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.TermInstVal) = new UnreachableInst(); - ;} - break; - - case 269: -#line 3016 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); - Constant *V = cast(getExistingValue((yyvsp[(2) - (6)].PrimType).T, (yyvsp[(3) - (6)].ValIDVal))); + cast(yyval.TermInstVal)->setCallingConv(upgradeCallingConv(yyvsp[-11].UIntVal)); + delete yyvsp[-10].TypeVal.PAT; + delete yyvsp[-7].ValueList; + ; + break;} +case 266: +#line 3007 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TermInstVal = new UnwindInst(); + ; + break;} +case 267: +#line 3010 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.TermInstVal = new UnreachableInst(); + ; + break;} +case 268: +#line 3016 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.JumpTable = yyvsp[-5].JumpTable; + Constant *V = cast(getExistingValue(yyvsp[-4].PrimType.T, yyvsp[-3].ValIDVal)); if (V == 0) error("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (6)].ValIDVal)); - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 270: -#line 3026 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getExistingValue((yyvsp[(1) - (5)].PrimType).T, (yyvsp[(2) - (5)].ValIDVal))); + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 269: +#line 3026 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.JumpTable = new std::vector >(); + Constant *V = cast(getExistingValue(yyvsp[-4].PrimType.T, yyvsp[-3].ValIDVal)); if (V == 0) error("May only switch on a constant pool value"); - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (5)].ValIDVal)); - (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); - ;} - break; - - case 271: -#line 3039 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 270: +#line 3039 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ bool omit = false; - if ((yyvsp[(1) - (2)].StrVal)) - if (BitCastInst *BCI = dyn_cast((yyvsp[(2) - (2)].InstVal).I)) + if (yyvsp[-1].StrVal) + if (BitCastInst *BCI = dyn_cast(yyvsp[0].InstVal.I)) if (BCI->getSrcTy() == BCI->getDestTy() && - BCI->getOperand(0)->getName() == (yyvsp[(1) - (2)].StrVal)) + BCI->getOperand(0)->getName() == yyvsp[-1].StrVal) // This is a useless bit cast causing a name redefinition. It is // a bit cast from a type to the same type of an operand with the // same name as the name we would give this instruction. Since this @@ -5879,243 +4819,225 @@ // The bitcast is clearly useless so we omit it. omit = true; if (omit) { - (yyval.InstVal).I = 0; - (yyval.InstVal).S = Signless; + yyval.InstVal.I = 0; + yyval.InstVal.S = Signless; } else { - setValueName((yyvsp[(2) - (2)].InstVal).I, (yyvsp[(1) - (2)].StrVal)); - InsertValue((yyvsp[(2) - (2)].InstVal).I); - (yyval.InstVal) = (yyvsp[(2) - (2)].InstVal); - } - ;} - break; - - case 272: -#line 3068 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Used for PHI nodes - (yyval.PHIList).P = new std::list >(); - (yyval.PHIList).S = (yyvsp[(1) - (6)].TypeVal).S; - Value* tmpVal = getVal((yyvsp[(1) - (6)].TypeVal).PAT->get(), (yyvsp[(3) - (6)].ValIDVal)); - BasicBlock* tmpBB = getBBVal((yyvsp[(5) - (6)].ValIDVal)); - (yyval.PHIList).P->push_back(std::make_pair(tmpVal, tmpBB)); - delete (yyvsp[(1) - (6)].TypeVal).PAT; - ;} - break; - - case 273: -#line 3076 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.PHIList) = (yyvsp[(1) - (7)].PHIList); - Value* tmpVal = getVal((yyvsp[(1) - (7)].PHIList).P->front().first->getType(), (yyvsp[(4) - (7)].ValIDVal)); - BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (7)].ValIDVal)); - (yyvsp[(1) - (7)].PHIList).P->push_back(std::make_pair(tmpVal, tmpBB)); - ;} - break; - - case 274: -#line 3084 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { // Used for call statements, and memory insts... - (yyval.ValueList) = new std::vector(); - (yyval.ValueList)->push_back((yyvsp[(1) - (1)].ValueVal)); - ;} - break; - - case 275: -#line 3088 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); - (yyvsp[(1) - (3)].ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); - ;} - break; - - case 277: -#line 3096 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValueList) = 0; ;} - break; - - case 278: -#line 3100 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.BoolVal) = true; - ;} - break; - - case 279: -#line 3103 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.BoolVal) = false; - ;} - break; - - case 280: -#line 3109 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* Ty = (yyvsp[(2) - (5)].TypeVal).PAT->get(); + setValueName(yyvsp[0].InstVal.I, yyvsp[-1].StrVal); + InsertValue(yyvsp[0].InstVal.I); + yyval.InstVal = yyvsp[0].InstVal; + } + ; + break;} +case 271: +#line 3068 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Used for PHI nodes + yyval.PHIList.P = new std::list >(); + yyval.PHIList.S = yyvsp[-5].TypeVal.S; + Value* tmpVal = getVal(yyvsp[-5].TypeVal.PAT->get(), yyvsp[-3].ValIDVal); + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + yyval.PHIList.P->push_back(std::make_pair(tmpVal, tmpBB)); + delete yyvsp[-5].TypeVal.PAT; + ; + break;} +case 272: +#line 3076 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.PHIList = yyvsp[-6].PHIList; + Value* tmpVal = getVal(yyvsp[-6].PHIList.P->front().first->getType(), yyvsp[-3].ValIDVal); + BasicBlock* tmpBB = getBBVal(yyvsp[-1].ValIDVal); + yyvsp[-6].PHIList.P->push_back(std::make_pair(tmpVal, tmpBB)); + ; + break;} +case 273: +#line 3084 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Used for call statements, and memory insts... + yyval.ValueList = new std::vector(); + yyval.ValueList->push_back(yyvsp[0].ValueVal); + ; + break;} +case 274: +#line 3088 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.ValueList = yyvsp[-2].ValueList; + yyvsp[-2].ValueList->push_back(yyvsp[0].ValueVal); + ; + break;} +case 276: +#line 3096 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValueList = 0; ; + break;} +case 277: +#line 3100 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.BoolVal = true; + ; + break;} +case 278: +#line 3103 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.BoolVal = false; + ; + break;} +case 279: +#line 3109 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* Ty = yyvsp[-3].TypeVal.PAT->get(); if (!Ty->isInteger() && !Ty->isFloatingPoint() && !isa(Ty)) error("Arithmetic operator requires integer, FP, or packed operands"); if (isa(Ty) && - ((yyvsp[(1) - (5)].BinaryOpVal) == URemOp || (yyvsp[(1) - (5)].BinaryOpVal) == SRemOp || (yyvsp[(1) - (5)].BinaryOpVal) == FRemOp || (yyvsp[(1) - (5)].BinaryOpVal) == RemOp)) + (yyvsp[-4].BinaryOpVal == URemOp || yyvsp[-4].BinaryOpVal == SRemOp || yyvsp[-4].BinaryOpVal == FRemOp || yyvsp[-4].BinaryOpVal == RemOp)) error("Remainder not supported on packed types"); // Upgrade the opcode from obsolete versions before we do anything with it. - Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (5)].BinaryOpVal), Ty, (yyvsp[(2) - (5)].TypeVal).S); - Value* val1 = getVal(Ty, (yyvsp[(3) - (5)].ValIDVal)); - Value* val2 = getVal(Ty, (yyvsp[(5) - (5)].ValIDVal)); - (yyval.InstVal).I = BinaryOperator::create(Opcode, val1, val2); - if ((yyval.InstVal).I == 0) + Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-4].BinaryOpVal, Ty, yyvsp[-3].TypeVal.S); + Value* val1 = getVal(Ty, yyvsp[-2].ValIDVal); + Value* val2 = getVal(Ty, yyvsp[0].ValIDVal); + yyval.InstVal.I = BinaryOperator::create(Opcode, val1, val2); + if (yyval.InstVal.I == 0) error("binary operator returned null"); - (yyval.InstVal).S = (yyvsp[(2) - (5)].TypeVal).S; - delete (yyvsp[(2) - (5)].TypeVal).PAT; - ;} - break; - - case 281: -#line 3126 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(2) - (5)].TypeVal).PAT->get(); + yyval.InstVal.S = yyvsp[-3].TypeVal.S; + delete yyvsp[-3].TypeVal.PAT; + ; + break;} +case 280: +#line 3126 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-3].TypeVal.PAT->get(); if (!Ty->isInteger()) { if (!isa(Ty) || !cast(Ty)->getElementType()->isInteger()) error("Logical operator requires integral operands"); } - Instruction::BinaryOps Opcode = getBinaryOp((yyvsp[(1) - (5)].BinaryOpVal), Ty, (yyvsp[(2) - (5)].TypeVal).S); - Value* tmpVal1 = getVal(Ty, (yyvsp[(3) - (5)].ValIDVal)); - Value* tmpVal2 = getVal(Ty, (yyvsp[(5) - (5)].ValIDVal)); - (yyval.InstVal).I = BinaryOperator::create(Opcode, tmpVal1, tmpVal2); - if ((yyval.InstVal).I == 0) + Instruction::BinaryOps Opcode = getBinaryOp(yyvsp[-4].BinaryOpVal, Ty, yyvsp[-3].TypeVal.S); + Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); + Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); + yyval.InstVal.I = BinaryOperator::create(Opcode, tmpVal1, tmpVal2); + if (yyval.InstVal.I == 0) error("binary operator returned null"); - (yyval.InstVal).S = (yyvsp[(2) - (5)].TypeVal).S; - delete (yyvsp[(2) - (5)].TypeVal).PAT; - ;} - break; - - case 282: -#line 3142 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* Ty = (yyvsp[(2) - (5)].TypeVal).PAT->get(); + yyval.InstVal.S = yyvsp[-3].TypeVal.S; + delete yyvsp[-3].TypeVal.PAT; + ; + break;} +case 281: +#line 3142 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* Ty = yyvsp[-3].TypeVal.PAT->get(); if(isa(Ty)) error("PackedTypes currently not supported in setcc instructions"); unsigned short pred; - Instruction::OtherOps Opcode = getCompareOp((yyvsp[(1) - (5)].BinaryOpVal), pred, Ty, (yyvsp[(2) - (5)].TypeVal).S); - Value* tmpVal1 = getVal(Ty, (yyvsp[(3) - (5)].ValIDVal)); - Value* tmpVal2 = getVal(Ty, (yyvsp[(5) - (5)].ValIDVal)); - (yyval.InstVal).I = CmpInst::create(Opcode, pred, tmpVal1, tmpVal2); - if ((yyval.InstVal).I == 0) + Instruction::OtherOps Opcode = getCompareOp(yyvsp[-4].BinaryOpVal, pred, Ty, yyvsp[-3].TypeVal.S); + Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); + Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); + yyval.InstVal.I = CmpInst::create(Opcode, pred, tmpVal1, tmpVal2); + if (yyval.InstVal.I == 0) error("binary operator returned null"); - (yyval.InstVal).S = Unsigned; - delete (yyvsp[(2) - (5)].TypeVal).PAT; - ;} - break; - - case 283: -#line 3156 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(3) - (6)].TypeVal).PAT->get(); + yyval.InstVal.S = Unsigned; + delete yyvsp[-3].TypeVal.PAT; + ; + break;} +case 282: +#line 3156 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-3].TypeVal.PAT->get(); if (isa(Ty)) error("PackedTypes currently not supported in icmp instructions"); else if (!Ty->isInteger() && !isa(Ty)) error("icmp requires integer or pointer typed operands"); - Value* tmpVal1 = getVal(Ty, (yyvsp[(4) - (6)].ValIDVal)); - Value* tmpVal2 = getVal(Ty, (yyvsp[(6) - (6)].ValIDVal)); - (yyval.InstVal).I = new ICmpInst((yyvsp[(2) - (6)].IPred), tmpVal1, tmpVal2); - (yyval.InstVal).S = Unsigned; - delete (yyvsp[(3) - (6)].TypeVal).PAT; - ;} - break; - - case 284: -#line 3168 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(3) - (6)].TypeVal).PAT->get(); + Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); + Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); + yyval.InstVal.I = new ICmpInst(yyvsp[-4].IPred, tmpVal1, tmpVal2); + yyval.InstVal.S = Unsigned; + delete yyvsp[-3].TypeVal.PAT; + ; + break;} +case 283: +#line 3168 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-3].TypeVal.PAT->get(); if (isa(Ty)) error("PackedTypes currently not supported in fcmp instructions"); else if (!Ty->isFloatingPoint()) error("fcmp instruction requires floating point operands"); - Value* tmpVal1 = getVal(Ty, (yyvsp[(4) - (6)].ValIDVal)); - Value* tmpVal2 = getVal(Ty, (yyvsp[(6) - (6)].ValIDVal)); - (yyval.InstVal).I = new FCmpInst((yyvsp[(2) - (6)].FPred), tmpVal1, tmpVal2); - (yyval.InstVal).S = Unsigned; - delete (yyvsp[(3) - (6)].TypeVal).PAT; - ;} - break; - - case 285: -#line 3180 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + Value* tmpVal1 = getVal(Ty, yyvsp[-2].ValIDVal); + Value* tmpVal2 = getVal(Ty, yyvsp[0].ValIDVal); + yyval.InstVal.I = new FCmpInst(yyvsp[-4].FPred, tmpVal1, tmpVal2); + yyval.InstVal.S = Unsigned; + delete yyvsp[-3].TypeVal.PAT; + ; + break;} +case 284: +#line 3180 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ warning("Use of obsolete 'not' instruction: Replacing with 'xor"); - const Type *Ty = (yyvsp[(2) - (2)].ValueVal).V->getType(); + const Type *Ty = yyvsp[0].ValueVal.V->getType(); Value *Ones = ConstantInt::getAllOnesValue(Ty); if (Ones == 0) error("Expected integral type for not instruction"); - (yyval.InstVal).I = BinaryOperator::create(Instruction::Xor, (yyvsp[(2) - (2)].ValueVal).V, Ones); - if ((yyval.InstVal).I == 0) + yyval.InstVal.I = BinaryOperator::create(Instruction::Xor, yyvsp[0].ValueVal.V, Ones); + if (yyval.InstVal.I == 0) error("Could not create a xor instruction"); - (yyval.InstVal).S = (yyvsp[(2) - (2)].ValueVal).S - ;} - break; - - case 286: -#line 3191 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[(4) - (4)].ValueVal).V->getType()->isInteger() || - cast((yyvsp[(4) - (4)].ValueVal).V->getType())->getBitWidth() != 8) + yyval.InstVal.S = yyvsp[0].ValueVal.S + ; + break;} +case 285: +#line 3191 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!yyvsp[0].ValueVal.V->getType()->isInteger() || + cast(yyvsp[0].ValueVal.V->getType())->getBitWidth() != 8) error("Shift amount must be int8"); - const Type* Ty = (yyvsp[(2) - (4)].ValueVal).V->getType(); + const Type* Ty = yyvsp[-2].ValueVal.V->getType(); if (!Ty->isInteger()) error("Shift constant expression requires integer operand"); Value* ShiftAmt = 0; if (cast(Ty)->getBitWidth() > Type::Int8Ty->getBitWidth()) - if (Constant *C = dyn_cast((yyvsp[(4) - (4)].ValueVal).V)) + if (Constant *C = dyn_cast(yyvsp[0].ValueVal.V)) ShiftAmt = ConstantExpr::getZExt(C, Ty); else - ShiftAmt = new ZExtInst((yyvsp[(4) - (4)].ValueVal).V, Ty, makeNameUnique("shift"), CurBB); + ShiftAmt = new ZExtInst(yyvsp[0].ValueVal.V, Ty, makeNameUnique("shift"), CurBB); else - ShiftAmt = (yyvsp[(4) - (4)].ValueVal).V; - (yyval.InstVal).I = BinaryOperator::create(getBinaryOp((yyvsp[(1) - (4)].BinaryOpVal), Ty, (yyvsp[(2) - (4)].ValueVal).S), (yyvsp[(2) - (4)].ValueVal).V, ShiftAmt); - (yyval.InstVal).S = (yyvsp[(2) - (4)].ValueVal).S; - ;} - break; - - case 287: -#line 3209 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get(); + ShiftAmt = yyvsp[0].ValueVal.V; + yyval.InstVal.I = BinaryOperator::create(getBinaryOp(yyvsp[-3].BinaryOpVal, Ty, yyvsp[-2].ValueVal.S), yyvsp[-2].ValueVal.V, ShiftAmt); + yyval.InstVal.S = yyvsp[-2].ValueVal.S; + ; + break;} +case 286: +#line 3209 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *DstTy = yyvsp[0].TypeVal.PAT->get(); if (!DstTy->isFirstClassType()) error("cast instruction to a non-primitive type: '" + DstTy->getDescription() + "'"); - (yyval.InstVal).I = cast(getCast((yyvsp[(1) - (4)].CastOpVal), (yyvsp[(2) - (4)].ValueVal).V, (yyvsp[(2) - (4)].ValueVal).S, DstTy, (yyvsp[(4) - (4)].TypeVal).S, true)); - (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; - delete (yyvsp[(4) - (4)].TypeVal).PAT; - ;} - break; - - case 288: -#line 3218 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!(yyvsp[(2) - (6)].ValueVal).V->getType()->isInteger() || - cast((yyvsp[(2) - (6)].ValueVal).V->getType())->getBitWidth() != 1) + yyval.InstVal.I = cast(getCast(yyvsp[-3].CastOpVal, yyvsp[-2].ValueVal.V, yyvsp[-2].ValueVal.S, DstTy, yyvsp[0].TypeVal.S, true)); + yyval.InstVal.S = yyvsp[0].TypeVal.S; + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 287: +#line 3218 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!yyvsp[-4].ValueVal.V->getType()->isInteger() || + cast(yyvsp[-4].ValueVal.V->getType())->getBitWidth() != 1) error("select condition must be bool"); - if ((yyvsp[(4) - (6)].ValueVal).V->getType() != (yyvsp[(6) - (6)].ValueVal).V->getType()) + if (yyvsp[-2].ValueVal.V->getType() != yyvsp[0].ValueVal.V->getType()) error("select value types should match"); - (yyval.InstVal).I = new SelectInst((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V); - (yyval.InstVal).S = (yyvsp[(2) - (6)].ValueVal).S; - ;} - break; - - case 289: -#line 3227 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(4) - (4)].TypeVal).PAT->get(); + yyval.InstVal.I = new SelectInst(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); + yyval.InstVal.S = yyvsp[-4].ValueVal.S; + ; + break;} +case 288: +#line 3227 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[0].TypeVal.PAT->get(); NewVarArgs = true; - (yyval.InstVal).I = new VAArgInst((yyvsp[(2) - (4)].ValueVal).V, Ty); - (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; - delete (yyvsp[(4) - (4)].TypeVal).PAT; - ;} - break; - - case 290: -#line 3234 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* ArgTy = (yyvsp[(2) - (4)].ValueVal).V->getType(); - const Type* DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get(); + yyval.InstVal.I = new VAArgInst(yyvsp[-2].ValueVal.V, Ty); + yyval.InstVal.S = yyvsp[0].TypeVal.S; + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 289: +#line 3234 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* ArgTy = yyvsp[-2].ValueVal.V->getType(); + const Type* DstTy = yyvsp[0].TypeVal.PAT->get(); ObsoleteVarArgs = true; Function* NF = cast(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -6127,20 +5049,19 @@ //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, (yyvsp[(2) - (4)].ValueVal).V); + CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal.V); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - (yyval.InstVal).I = new VAArgInst(foo, DstTy); - (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; - delete (yyvsp[(4) - (4)].TypeVal).PAT; - ;} - break; - - case 291: -#line 3255 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* ArgTy = (yyvsp[(2) - (4)].ValueVal).V->getType(); - const Type* DstTy = (yyvsp[(4) - (4)].TypeVal).PAT->get(); + yyval.InstVal.I = new VAArgInst(foo, DstTy); + yyval.InstVal.S = yyvsp[0].TypeVal.S; + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 290: +#line 3255 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* ArgTy = yyvsp[-2].ValueVal.V->getType(); + const Type* DstTy = yyvsp[0].TypeVal.PAT->get(); ObsoleteVarArgs = true; Function* NF = cast(CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0)); @@ -6153,93 +5074,88 @@ //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, (yyvsp[(2) - (4)].ValueVal).V); + CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal.V); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); Instruction* tmp = new VAArgInst(foo, DstTy); CurBB->getInstList().push_back(tmp); - (yyval.InstVal).I = new LoadInst(foo); - (yyval.InstVal).S = (yyvsp[(4) - (4)].TypeVal).S; - delete (yyvsp[(4) - (4)].TypeVal).PAT; - ;} - break; - - case 292: -#line 3279 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!ExtractElementInst::isValidOperands((yyvsp[(2) - (4)].ValueVal).V, (yyvsp[(4) - (4)].ValueVal).V)) + yyval.InstVal.I = new LoadInst(foo); + yyval.InstVal.S = yyvsp[0].TypeVal.S; + delete yyvsp[0].TypeVal.PAT; + ; + break;} +case 291: +#line 3279 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V)) error("Invalid extractelement operands"); - (yyval.InstVal).I = new ExtractElementInst((yyvsp[(2) - (4)].ValueVal).V, (yyvsp[(4) - (4)].ValueVal).V); - (yyval.InstVal).S = (yyvsp[(2) - (4)].ValueVal).S; - ;} - break; - - case 293: -#line 3285 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V)) + yyval.InstVal.I = new ExtractElementInst(yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); + yyval.InstVal.S = yyvsp[-2].ValueVal.S; + ; + break;} +case 292: +#line 3285 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V)) error("Invalid insertelement operands"); - (yyval.InstVal).I = new InsertElementInst((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V); - (yyval.InstVal).S = (yyvsp[(2) - (6)].ValueVal).S; - ;} - break; - - case 294: -#line 3291 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V)) + yyval.InstVal.I = new InsertElementInst(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); + yyval.InstVal.S = yyvsp[-4].ValueVal.S; + ; + break;} +case 293: +#line 3291 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V)) error("Invalid shufflevector operands"); - (yyval.InstVal).I = new ShuffleVectorInst((yyvsp[(2) - (6)].ValueVal).V, (yyvsp[(4) - (6)].ValueVal).V, (yyvsp[(6) - (6)].ValueVal).V); - (yyval.InstVal).S = (yyvsp[(2) - (6)].ValueVal).S; - ;} - break; - - case 295: -#line 3297 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(2) - (2)].PHIList).P->front().first->getType(); + yyval.InstVal.I = new ShuffleVectorInst(yyvsp[-4].ValueVal.V, yyvsp[-2].ValueVal.V, yyvsp[0].ValueVal.V); + yyval.InstVal.S = yyvsp[-4].ValueVal.S; + ; + break;} +case 294: +#line 3297 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[0].PHIList.P->front().first->getType(); if (!Ty->isFirstClassType()) error("PHI node operands must be of first class type"); PHINode *PHI = new PHINode(Ty); - PHI->reserveOperandSpace((yyvsp[(2) - (2)].PHIList).P->size()); - while ((yyvsp[(2) - (2)].PHIList).P->begin() != (yyvsp[(2) - (2)].PHIList).P->end()) { - if ((yyvsp[(2) - (2)].PHIList).P->front().first->getType() != Ty) + PHI->reserveOperandSpace(yyvsp[0].PHIList.P->size()); + while (yyvsp[0].PHIList.P->begin() != yyvsp[0].PHIList.P->end()) { + if (yyvsp[0].PHIList.P->front().first->getType() != Ty) error("All elements of a PHI node must be of the same type"); - PHI->addIncoming((yyvsp[(2) - (2)].PHIList).P->front().first, (yyvsp[(2) - (2)].PHIList).P->front().second); - (yyvsp[(2) - (2)].PHIList).P->pop_front(); + PHI->addIncoming(yyvsp[0].PHIList.P->front().first, yyvsp[0].PHIList.P->front().second); + yyvsp[0].PHIList.P->pop_front(); } - (yyval.InstVal).I = PHI; - (yyval.InstVal).S = (yyvsp[(2) - (2)].PHIList).S; - delete (yyvsp[(2) - (2)].PHIList).P; // Free the list... - ;} - break; - - case 296: -#line 3313 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { + yyval.InstVal.I = PHI; + yyval.InstVal.S = yyvsp[0].PHIList.S; + delete yyvsp[0].PHIList.P; // Free the list... + ; + break;} +case 295: +#line 3313 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ // Handle the short call syntax const PointerType *PFTy; const FunctionType *FTy; - if (!(PFTy = dyn_cast((yyvsp[(3) - (7)].TypeVal).PAT->get())) || + if (!(PFTy = dyn_cast(yyvsp[-4].TypeVal.PAT->get())) || !(FTy = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - if ((yyvsp[(6) - (7)].ValueList)) { - for (std::vector::iterator I = (yyvsp[(6) - (7)].ValueList)->begin(), E = (yyvsp[(6) - (7)].ValueList)->end(); + if (yyvsp[-1].ValueList) { + for (std::vector::iterator I = yyvsp[-1].ValueList->begin(), E = yyvsp[-1].ValueList->end(); I != E; ++I) ParamTypes.push_back((*I).V->getType()); } FunctionType::ParamAttrsList ParamAttrs; - if ((yyvsp[(2) - (7)].UIntVal) == OldCallingConv::CSRet) { + if (yyvsp[-5].UIntVal == OldCallingConv::CSRet) { ParamAttrs.push_back(FunctionType::NoAttributeSet); ParamAttrs.push_back(FunctionType::StructRetAttribute); } bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - const Type *RetTy = (yyvsp[(3) - (7)].TypeVal).PAT->get(); + const Type *RetTy = yyvsp[-4].TypeVal.PAT->get(); if (!RetTy->isFirstClassType() && RetTy != Type::VoidTy) error("Functions cannot return aggregate types"); @@ -6249,21 +5165,21 @@ // First upgrade any intrinsic calls. std::vector Args; - if ((yyvsp[(6) - (7)].ValueList)) - for (unsigned i = 0, e = (yyvsp[(6) - (7)].ValueList)->size(); i < e; ++i) - Args.push_back((*(yyvsp[(6) - (7)].ValueList))[i].V); - Instruction *Inst = upgradeIntrinsicCall(FTy, (yyvsp[(4) - (7)].ValIDVal), Args); + if (yyvsp[-1].ValueList) + for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i < e; ++i) + Args.push_back((*yyvsp[-1].ValueList)[i].V); + Instruction *Inst = upgradeIntrinsicCall(FTy, yyvsp[-3].ValIDVal, Args); // If we got an upgraded intrinsic if (Inst) { - (yyval.InstVal).I = Inst; - (yyval.InstVal).S = Signless; + yyval.InstVal.I = Inst; + yyval.InstVal.S = Signless; } else { // Get the function we're calling - Value *V = getVal(PFTy, (yyvsp[(4) - (7)].ValIDVal)); + Value *V = getVal(PFTy, yyvsp[-3].ValIDVal); // Check the argument values match - if (!(yyvsp[(6) - (7)].ValueList)) { // Has no arguments? + if (!yyvsp[-1].ValueList) { // Has no arguments? // Make sure no arguments is a good thing! if (FTy->getNumParams() != 0) error("No arguments passed to a function that expects arguments"); @@ -6273,7 +5189,7 @@ // FunctionType::param_iterator I = FTy->param_begin(); FunctionType::param_iterator E = FTy->param_end(); - std::vector::iterator ArgI = (yyvsp[(6) - (7)].ValueList)->begin(), ArgE = (yyvsp[(6) - (7)].ValueList)->end(); + std::vector::iterator ArgI = yyvsp[-1].ValueList->begin(), ArgE = yyvsp[-1].ValueList->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI).V->getType() != *I) @@ -6285,125 +5201,113 @@ } // Create the call instruction - CallInst *CI = new CallInst(V, Args); - CI->setTailCall((yyvsp[(1) - (7)].BoolVal)); - CI->setCallingConv(upgradeCallingConv((yyvsp[(2) - (7)].UIntVal))); - (yyval.InstVal).I = CI; - (yyval.InstVal).S = (yyvsp[(3) - (7)].TypeVal).S; - } - delete (yyvsp[(3) - (7)].TypeVal).PAT; - delete (yyvsp[(6) - (7)].ValueList); - ;} - break; - - case 297: -#line 3391 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); - ;} - break; - - case 298: -#line 3399 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValueList) = (yyvsp[(2) - (2)].ValueList); ;} - break; - - case 299: -#line 3400 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.ValueList) = new std::vector(); ;} - break; - - case 300: -#line 3404 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 301: -#line 3405 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 302: -#line 3409 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(2) - (3)].TypeVal).PAT->get(); - (yyval.InstVal).S = (yyvsp[(2) - (3)].TypeVal).S; - (yyval.InstVal).I = new MallocInst(Ty, 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal).PAT; - ;} - break; - - case 303: -#line 3415 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(2) - (6)].TypeVal).PAT->get(); - (yyval.InstVal).S = (yyvsp[(2) - (6)].TypeVal).S; - (yyval.InstVal).I = new MallocInst(Ty, getVal((yyvsp[(4) - (6)].PrimType).T, (yyvsp[(5) - (6)].ValIDVal)), (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal).PAT; - ;} - break; - - case 304: -#line 3421 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(2) - (3)].TypeVal).PAT->get(); - (yyval.InstVal).S = (yyvsp[(2) - (3)].TypeVal).S; - (yyval.InstVal).I = new AllocaInst(Ty, 0, (yyvsp[(3) - (3)].UIntVal)); - delete (yyvsp[(2) - (3)].TypeVal).PAT; - ;} - break; - - case 305: -#line 3427 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *Ty = (yyvsp[(2) - (6)].TypeVal).PAT->get(); - (yyval.InstVal).S = (yyvsp[(2) - (6)].TypeVal).S; - (yyval.InstVal).I = new AllocaInst(Ty, getVal((yyvsp[(4) - (6)].PrimType).T, (yyvsp[(5) - (6)].ValIDVal)), (yyvsp[(6) - (6)].UIntVal)); - delete (yyvsp[(2) - (6)].TypeVal).PAT; - ;} - break; - - case 306: -#line 3433 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type *PTy = (yyvsp[(2) - (2)].ValueVal).V->getType(); + CallInst *CI = new CallInst(V, &Args[0], Args.size()); + CI->setTailCall(yyvsp[-6].BoolVal); + CI->setCallingConv(upgradeCallingConv(yyvsp[-5].UIntVal)); + yyval.InstVal.I = CI; + yyval.InstVal.S = yyvsp[-4].TypeVal.S; + } + delete yyvsp[-4].TypeVal.PAT; + delete yyvsp[-1].ValueList; + ; + break;} +case 296: +#line 3391 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + yyval.InstVal = yyvsp[0].InstVal; + ; + break;} +case 297: +#line 3399 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValueList = yyvsp[0].ValueList; ; + break;} +case 298: +#line 3400 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.ValueList = new std::vector(); ; + break;} +case 299: +#line 3404 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.BoolVal = true; ; + break;} +case 300: +#line 3405 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ yyval.BoolVal = false; ; + break;} +case 301: +#line 3409 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); + yyval.InstVal.S = yyvsp[-1].TypeVal.S; + yyval.InstVal.I = new MallocInst(Ty, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 302: +#line 3415 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-4].TypeVal.PAT->get(); + yyval.InstVal.S = yyvsp[-4].TypeVal.S; + yyval.InstVal.I = new MallocInst(Ty, getVal(yyvsp[-2].PrimType.T, yyvsp[-1].ValIDVal), yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal.PAT; + ; + break;} +case 303: +#line 3421 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-1].TypeVal.PAT->get(); + yyval.InstVal.S = yyvsp[-1].TypeVal.S; + yyval.InstVal.I = new AllocaInst(Ty, 0, yyvsp[0].UIntVal); + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 304: +#line 3427 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *Ty = yyvsp[-4].TypeVal.PAT->get(); + yyval.InstVal.S = yyvsp[-4].TypeVal.S; + yyval.InstVal.I = new AllocaInst(Ty, getVal(yyvsp[-2].PrimType.T, yyvsp[-1].ValIDVal), yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal.PAT; + ; + break;} +case 305: +#line 3433 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type *PTy = yyvsp[0].ValueVal.V->getType(); if (!isa(PTy)) error("Trying to free nonpointer type '" + PTy->getDescription() + "'"); - (yyval.InstVal).I = new FreeInst((yyvsp[(2) - (2)].ValueVal).V); - (yyval.InstVal).S = Signless; - ;} - break; - - case 307: -#line 3440 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* Ty = (yyvsp[(3) - (4)].TypeVal).PAT->get(); - (yyval.InstVal).S = (yyvsp[(3) - (4)].TypeVal).S; + yyval.InstVal.I = new FreeInst(yyvsp[0].ValueVal.V); + yyval.InstVal.S = Signless; + ; + break;} +case 306: +#line 3440 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* Ty = yyvsp[-1].TypeVal.PAT->get(); + yyval.InstVal.S = yyvsp[-1].TypeVal.S; if (!isa(Ty)) error("Can't load from nonpointer type: " + Ty->getDescription()); if (!cast(Ty)->getElementType()->isFirstClassType()) error("Can't load from pointer of non-first-class type: " + Ty->getDescription()); - Value* tmpVal = getVal(Ty, (yyvsp[(4) - (4)].ValIDVal)); - (yyval.InstVal).I = new LoadInst(tmpVal, "", (yyvsp[(1) - (4)].BoolVal)); - delete (yyvsp[(3) - (4)].TypeVal).PAT; - ;} - break; - - case 308: -#line 3452 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const PointerType *PTy = dyn_cast((yyvsp[(5) - (6)].TypeVal).PAT->get()); + Value* tmpVal = getVal(Ty, yyvsp[0].ValIDVal); + yyval.InstVal.I = new LoadInst(tmpVal, "", yyvsp[-3].BoolVal); + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 307: +#line 3452 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal.PAT->get()); if (!PTy) error("Can't store to a nonpointer type: " + - (yyvsp[(5) - (6)].TypeVal).PAT->get()->getDescription()); + yyvsp[-1].TypeVal.PAT->get()->getDescription()); const Type *ElTy = PTy->getElementType(); - Value *StoreVal = (yyvsp[(3) - (6)].ValueVal).V; - Value* tmpVal = getVal(PTy, (yyvsp[(6) - (6)].ValIDVal)); - if (ElTy != (yyvsp[(3) - (6)].ValueVal).V->getType()) { - StoreVal = handleSRetFuncTypeMerge((yyvsp[(3) - (6)].ValueVal).V, ElTy); + Value *StoreVal = yyvsp[-3].ValueVal.V; + Value* tmpVal = getVal(PTy, yyvsp[0].ValIDVal); + if (ElTy != yyvsp[-3].ValueVal.V->getType()) { + StoreVal = handleSRetFuncTypeMerge(yyvsp[-3].ValueVal.V, ElTy); if (!StoreVal) - error("Can't store '" + (yyvsp[(3) - (6)].ValueVal).V->getType()->getDescription() + + error("Can't store '" + yyvsp[-3].ValueVal.V->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); else { PTy = PointerType::get(StoreVal->getType()); @@ -6413,247 +5317,251 @@ tmpVal = new BitCastInst(tmpVal, PTy, "upgrd.cast", CurBB); } } - (yyval.InstVal).I = new StoreInst(StoreVal, tmpVal, (yyvsp[(1) - (6)].BoolVal)); - (yyval.InstVal).S = Signless; - delete (yyvsp[(5) - (6)].TypeVal).PAT; - ;} - break; - - case 309: -#line 3477 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" - { - const Type* Ty = (yyvsp[(2) - (4)].TypeVal).PAT->get(); + yyval.InstVal.I = new StoreInst(StoreVal, tmpVal, yyvsp[-5].BoolVal); + yyval.InstVal.S = Signless; + delete yyvsp[-1].TypeVal.PAT; + ; + break;} +case 308: +#line 3477 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" +{ + const Type* Ty = yyvsp[-2].TypeVal.PAT->get(); if (!isa(Ty)) error("getelementptr insn requires pointer operand"); std::vector VIndices; - upgradeGEPIndices(Ty, (yyvsp[(4) - (4)].ValueList), VIndices); - - Value* tmpVal = getVal(Ty, (yyvsp[(3) - (4)].ValIDVal)); - (yyval.InstVal).I = new GetElementPtrInst(tmpVal, &VIndices[0], VIndices.size()); - (yyval.InstVal).S = Signless; - delete (yyvsp[(2) - (4)].TypeVal).PAT; - delete (yyvsp[(4) - (4)].ValueList); - ;} - break; + upgradeGEPIndices(Ty, yyvsp[0].ValueList, VIndices); + Value* tmpVal = getVal(Ty, yyvsp[-1].ValIDVal); + yyval.InstVal.I = new GetElementPtrInst(tmpVal, &VIndices[0], VIndices.size()); + yyval.InstVal.S = Signless; + delete yyvsp[-2].TypeVal.PAT; + delete yyvsp[0].ValueList; + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" + + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif -/* Line 1267 of yacc.c. */ -#line 6443 "UpgradeParser.tab.c" - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif *++yyvsp = yyval; +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTOKENS]; + yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; +yyerrlab: /* here on detecting error */ -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ { ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ - - if (yychar <= YYEOF) + if (yyn > YYFLAG && yyn < YYLAST) { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); } - /* Else will try to reuse look-ahead token after shifting the error - token. */ goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + goto yyerrhandle; -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ +yyerrdefault: /* current state does not do anything special for the error token. */ - for (;;) +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; } + else if (yyn == 0) + goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; - *++yyvsp = yylval; - +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif yystate = yyn; goto yynewstate; + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + } + return 1; } - - -#line 3493 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" +#line 3493 "/Users/sabre/cvs/llvm/tools/llvm-upgrade/UpgradeParser.y" int yyerror(const char *ErrorMsg) { @@ -6686,4 +5594,3 @@ yyerror(ErrorMsg.c_str()); } - Index: llvm/tools/llvm-upgrade/UpgradeParser.h.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.45 llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.46 --- llvm/tools/llvm-upgrade/UpgradeParser.h.cvs:1.45 Mon Feb 12 16:58:38 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.h.cvs Tue Feb 13 00:04:17 2007 @@ -1,353 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.3. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - SINTVAL = 260, - UINTVAL = 261, - FPVAL = 262, - VOID = 263, - BOOL = 264, - SBYTE = 265, - UBYTE = 266, - SHORT = 267, - USHORT = 268, - INT = 269, - UINT = 270, - LONG = 271, - ULONG = 272, - FLOAT = 273, - DOUBLE = 274, - TYPE = 275, - LABEL = 276, - VAR_ID = 277, - LABELSTR = 278, - STRINGCONSTANT = 279, - IMPLEMENTATION = 280, - ZEROINITIALIZER = 281, - TRUETOK = 282, - FALSETOK = 283, - BEGINTOK = 284, - ENDTOK = 285, - DECLARE = 286, - GLOBAL = 287, - CONSTANT = 288, - SECTION = 289, - VOLATILE = 290, - TO = 291, - DOTDOTDOT = 292, - NULL_TOK = 293, - UNDEF = 294, - CONST = 295, - INTERNAL = 296, - LINKONCE = 297, - WEAK = 298, - APPENDING = 299, - DLLIMPORT = 300, - DLLEXPORT = 301, - EXTERN_WEAK = 302, - OPAQUE = 303, - NOT = 304, - EXTERNAL = 305, - TARGET = 306, - TRIPLE = 307, - ENDIAN = 308, - POINTERSIZE = 309, - LITTLE = 310, - BIG = 311, - ALIGN = 312, - DEPLIBS = 313, - CALL = 314, - TAIL = 315, - ASM_TOK = 316, - MODULE = 317, - SIDEEFFECT = 318, - CC_TOK = 319, - CCC_TOK = 320, - CSRETCC_TOK = 321, - FASTCC_TOK = 322, - COLDCC_TOK = 323, - X86_STDCALLCC_TOK = 324, - X86_FASTCALLCC_TOK = 325, - DATALAYOUT = 326, - RET = 327, - BR = 328, - SWITCH = 329, - INVOKE = 330, - UNREACHABLE = 331, - UNWIND = 332, - EXCEPT = 333, - ADD = 334, - SUB = 335, - MUL = 336, - DIV = 337, - UDIV = 338, - SDIV = 339, - FDIV = 340, - REM = 341, - UREM = 342, - SREM = 343, - FREM = 344, - AND = 345, - OR = 346, - XOR = 347, - SHL = 348, - SHR = 349, - ASHR = 350, - LSHR = 351, - SETLE = 352, - SETGE = 353, - SETLT = 354, - SETGT = 355, - SETEQ = 356, - SETNE = 357, - ICMP = 358, - FCMP = 359, - MALLOC = 360, - ALLOCA = 361, - FREE = 362, - LOAD = 363, - STORE = 364, - GETELEMENTPTR = 365, - PHI_TOK = 366, - SELECT = 367, - VAARG = 368, - EXTRACTELEMENT = 369, - INSERTELEMENT = 370, - SHUFFLEVECTOR = 371, - VAARG_old = 372, - VANEXT_old = 373, - EQ = 374, - NE = 375, - SLT = 376, - SGT = 377, - SLE = 378, - SGE = 379, - ULT = 380, - UGT = 381, - ULE = 382, - UGE = 383, - OEQ = 384, - ONE = 385, - OLT = 386, - OGT = 387, - OLE = 388, - OGE = 389, - ORD = 390, - UNO = 391, - UEQ = 392, - UNE = 393, - CAST = 394, - TRUNC = 395, - ZEXT = 396, - SEXT = 397, - FPTRUNC = 398, - FPEXT = 399, - FPTOUI = 400, - FPTOSI = 401, - UITOFP = 402, - SITOFP = 403, - PTRTOINT = 404, - INTTOPTR = 405, - BITCAST = 406 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define SINTVAL 260 -#define UINTVAL 261 -#define FPVAL 262 -#define VOID 263 -#define BOOL 264 -#define SBYTE 265 -#define UBYTE 266 -#define SHORT 267 -#define USHORT 268 -#define INT 269 -#define UINT 270 -#define LONG 271 -#define ULONG 272 -#define FLOAT 273 -#define DOUBLE 274 -#define TYPE 275 -#define LABEL 276 -#define VAR_ID 277 -#define LABELSTR 278 -#define STRINGCONSTANT 279 -#define IMPLEMENTATION 280 -#define ZEROINITIALIZER 281 -#define TRUETOK 282 -#define FALSETOK 283 -#define BEGINTOK 284 -#define ENDTOK 285 -#define DECLARE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define SECTION 289 -#define VOLATILE 290 -#define TO 291 -#define DOTDOTDOT 292 -#define NULL_TOK 293 -#define UNDEF 294 -#define CONST 295 -#define INTERNAL 296 -#define LINKONCE 297 -#define WEAK 298 -#define APPENDING 299 -#define DLLIMPORT 300 -#define DLLEXPORT 301 -#define EXTERN_WEAK 302 -#define OPAQUE 303 -#define NOT 304 -#define EXTERNAL 305 -#define TARGET 306 -#define TRIPLE 307 -#define ENDIAN 308 -#define POINTERSIZE 309 -#define LITTLE 310 -#define BIG 311 -#define ALIGN 312 -#define DEPLIBS 313 -#define CALL 314 -#define TAIL 315 -#define ASM_TOK 316 -#define MODULE 317 -#define SIDEEFFECT 318 -#define CC_TOK 319 -#define CCC_TOK 320 -#define CSRETCC_TOK 321 -#define FASTCC_TOK 322 -#define COLDCC_TOK 323 -#define X86_STDCALLCC_TOK 324 -#define X86_FASTCALLCC_TOK 325 -#define DATALAYOUT 326 -#define RET 327 -#define BR 328 -#define SWITCH 329 -#define INVOKE 330 -#define UNREACHABLE 331 -#define UNWIND 332 -#define EXCEPT 333 -#define ADD 334 -#define SUB 335 -#define MUL 336 -#define DIV 337 -#define UDIV 338 -#define SDIV 339 -#define FDIV 340 -#define REM 341 -#define UREM 342 -#define SREM 343 -#define FREM 344 -#define AND 345 -#define OR 346 -#define XOR 347 -#define SHL 348 -#define SHR 349 -#define ASHR 350 -#define LSHR 351 -#define SETLE 352 -#define SETGE 353 -#define SETLT 354 -#define SETGT 355 -#define SETEQ 356 -#define SETNE 357 -#define ICMP 358 -#define FCMP 359 -#define MALLOC 360 -#define ALLOCA 361 -#define FREE 362 -#define LOAD 363 -#define STORE 364 -#define GETELEMENTPTR 365 -#define PHI_TOK 366 -#define SELECT 367 -#define VAARG 368 -#define EXTRACTELEMENT 369 -#define INSERTELEMENT 370 -#define SHUFFLEVECTOR 371 -#define VAARG_old 372 -#define VANEXT_old 373 -#define EQ 374 -#define NE 375 -#define SLT 376 -#define SGT 377 -#define SLE 378 -#define SGE 379 -#define ULT 380 -#define UGT 381 -#define ULE 382 -#define UGE 383 -#define OEQ 384 -#define ONE 385 -#define OLT 386 -#define OGT 387 -#define OLE 388 -#define OGE 389 -#define ORD 390 -#define UNO 391 -#define UEQ 392 -#define UNE 393 -#define CAST 394 -#define TRUNC 395 -#define ZEXT 396 -#define SEXT 397 -#define FPTRUNC 398 -#define FPEXT 399 -#define FPTOUI 400 -#define FPTOSI 401 -#define UITOFP 402 -#define SITOFP 403 -#define PTRTOINT 404 -#define INTTOPTR 405 -#define BITCAST 406 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -#line 1454 "/Users/sabre/llvm/tools/llvm-upgrade/UpgradeParser.y" -{ +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -387,14 +38,156 @@ llvm::ICmpInst::Predicate IPred; llvm::FCmpInst::Predicate FPred; llvm::Module::Endianness Endianness; -} -/* Line 1529 of yacc.c. */ -#line 393 "UpgradeParser.tab.h" - YYSTYPE; -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif +} YYSTYPE; +#define ESINT64VAL 257 +#define EUINT64VAL 258 +#define SINTVAL 259 +#define UINTVAL 260 +#define FPVAL 261 +#define VOID 262 +#define BOOL 263 +#define SBYTE 264 +#define UBYTE 265 +#define SHORT 266 +#define USHORT 267 +#define INT 268 +#define UINT 269 +#define LONG 270 +#define ULONG 271 +#define FLOAT 272 +#define DOUBLE 273 +#define TYPE 274 +#define LABEL 275 +#define VAR_ID 276 +#define LABELSTR 277 +#define STRINGCONSTANT 278 +#define IMPLEMENTATION 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define GLOBAL 286 +#define CONSTANT 287 +#define SECTION 288 +#define VOLATILE 289 +#define TO 290 +#define DOTDOTDOT 291 +#define NULL_TOK 292 +#define UNDEF 293 +#define CONST 294 +#define INTERNAL 295 +#define LINKONCE 296 +#define WEAK 297 +#define APPENDING 298 +#define DLLIMPORT 299 +#define DLLEXPORT 300 +#define EXTERN_WEAK 301 +#define OPAQUE 302 +#define NOT 303 +#define EXTERNAL 304 +#define TARGET 305 +#define TRIPLE 306 +#define ENDIAN 307 +#define POINTERSIZE 308 +#define LITTLE 309 +#define BIG 310 +#define ALIGN 311 +#define DEPLIBS 312 +#define CALL 313 +#define TAIL 314 +#define ASM_TOK 315 +#define MODULE 316 +#define SIDEEFFECT 317 +#define CC_TOK 318 +#define CCC_TOK 319 +#define CSRETCC_TOK 320 +#define FASTCC_TOK 321 +#define COLDCC_TOK 322 +#define X86_STDCALLCC_TOK 323 +#define X86_FASTCALLCC_TOK 324 +#define DATALAYOUT 325 +#define RET 326 +#define BR 327 +#define SWITCH 328 +#define INVOKE 329 +#define UNREACHABLE 330 +#define UNWIND 331 +#define EXCEPT 332 +#define ADD 333 +#define SUB 334 +#define MUL 335 +#define DIV 336 +#define UDIV 337 +#define SDIV 338 +#define FDIV 339 +#define REM 340 +#define UREM 341 +#define SREM 342 +#define FREM 343 +#define AND 344 +#define OR 345 +#define XOR 346 +#define SHL 347 +#define SHR 348 +#define ASHR 349 +#define LSHR 350 +#define SETLE 351 +#define SETGE 352 +#define SETLT 353 +#define SETGT 354 +#define SETEQ 355 +#define SETNE 356 +#define ICMP 357 +#define FCMP 358 +#define MALLOC 359 +#define ALLOCA 360 +#define FREE 361 +#define LOAD 362 +#define STORE 363 +#define GETELEMENTPTR 364 +#define PHI_TOK 365 +#define SELECT 366 +#define VAARG 367 +#define EXTRACTELEMENT 368 +#define INSERTELEMENT 369 +#define SHUFFLEVECTOR 370 +#define VAARG_old 371 +#define VANEXT_old 372 +#define EQ 373 +#define NE 374 +#define SLT 375 +#define SGT 376 +#define SLE 377 +#define SGE 378 +#define ULT 379 +#define UGT 380 +#define ULE 381 +#define UGE 382 +#define OEQ 383 +#define ONE 384 +#define OLT 385 +#define OGT 386 +#define OLE 387 +#define OGE 388 +#define ORD 389 +#define UNO 390 +#define UEQ 391 +#define UNE 392 +#define CAST 393 +#define TRUNC 394 +#define ZEXT 395 +#define SEXT 396 +#define FPTRUNC 397 +#define FPEXT 398 +#define FPTOUI 399 +#define FPTOSI 400 +#define UITOFP 401 +#define SITOFP 402 +#define PTRTOINT 403 +#define INTTOPTR 404 +#define BITCAST 405 -extern YYSTYPE Upgradelval; +extern YYSTYPE Upgradelval; Index: llvm/tools/llvm-upgrade/UpgradeParser.y.cvs diff -u llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.60 llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.61 --- llvm/tools/llvm-upgrade/UpgradeParser.y.cvs:1.60 Mon Feb 12 16:58:38 2007 +++ llvm/tools/llvm-upgrade/UpgradeParser.y.cvs Tue Feb 13 00:04:17 2007 @@ -1222,7 +1222,7 @@ const PointerType *PFTy = PointerType::get(FTy); Value* Func = getVal(PFTy, ID); Args[0] = new BitCastInst(Args[0], PtrTy, makeNameUnique("va"), CurBB); - return new CallInst(Func, Args); + return new CallInst(Func, &Args[0], Args.size()); } else if (Name == "llvm.va_copy") { if (Args.size() != 2) error("Invalid prototype for " + Name + " prototype"); @@ -1235,7 +1235,7 @@ std::string InstName1(makeNameUnique("va1")); Args[0] = new BitCastInst(Args[0], PtrTy, InstName0, CurBB); Args[1] = new BitCastInst(Args[1], PtrTy, InstName1, CurBB); - return new CallInst(Func, Args); + return new CallInst(Func, &Args[0], Args.size()); } } return 0; @@ -2978,7 +2978,7 @@ // Create the call node... if (!$6) { // Has no arguments? - $$ = new InvokeInst(V, Normal, Except, std::vector()); + $$ = new InvokeInst(V, Normal, Except, 0, 0); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified // correctly! @@ -2998,7 +2998,7 @@ if (I != E || (ArgI != ArgE && !Ty->isVarArg())) error("Invalid number of parameters detected"); - $$ = new InvokeInst(V, Normal, Except, Args); + $$ = new InvokeInst(V, Normal, Except, &Args[0], Args.size()); } cast($$)->setCallingConv(upgradeCallingConv($2)); delete $3.PAT; @@ -3379,7 +3379,7 @@ } // Create the call instruction - CallInst *CI = new CallInst(V, Args); + CallInst *CI = new CallInst(V, &Args[0], Args.size()); CI->setTailCall($1); CI->setCallingConv(upgradeCallingConv($2)); $$.I = CI; From sabre at nondot.org Tue Feb 13 00:05:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:05:59 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/Miscompilation.cpp Message-ID: <200702130605.l1D65xbm009029@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: Miscompilation.cpp updated: 1.87 -> 1.88 --- Log message: eliminate use of vector-related ctors --- Diffs of the changes: (+7 -4) Miscompilation.cpp | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.87 llvm/tools/bugpoint/Miscompilation.cpp:1.88 --- llvm/tools/bugpoint/Miscompilation.cpp:1.87 Mon Feb 5 15:19:13 2007 +++ llvm/tools/bugpoint/Miscompilation.cpp Tue Feb 13 00:05:43 2007 @@ -663,7 +663,8 @@ // Call the old main function and return its result BasicBlock *BB = new BasicBlock("entry", newMain); - CallInst *call = new CallInst(oldMainProto, args, "", BB); + CallInst *call = new CallInst(oldMainProto, &args[0], args.size(), + "", BB); // If the type of old function wasn't void, return value of call new ReturnInst(call, BB); @@ -734,7 +735,8 @@ // Resolve the call to function F via the JIT API: // // call resolver(GetElementPtr...) - CallInst *Resolver = new CallInst(resolverFunc, ResolverArgs, + CallInst *Resolver = new CallInst(resolverFunc, &ResolverArgs[0], + ResolverArgs.size(), "resolver", LookupBB); // cast the result from the resolver to correctly-typed function CastInst *CastedResolver = new BitCastInst(Resolver, @@ -756,10 +758,11 @@ // Pass on the arguments to the real function, return its result if (F->getReturnType() == Type::VoidTy) { - new CallInst(FuncPtr, Args, "", DoCallBB); + new CallInst(FuncPtr, &Args[0], Args.size(), "", DoCallBB); new ReturnInst(DoCallBB); } else { - CallInst *Call = new CallInst(FuncPtr, Args, "retval", DoCallBB); + CallInst *Call = new CallInst(FuncPtr, &Args[0], Args.size(), + "retval", DoCallBB); new ReturnInst(Call, DoCallBB); } From sabre at nondot.org Tue Feb 13 00:06:42 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:06:42 -0600 Subject: [llvm-commits] CVS: llvm/examples/HowToUseJIT/HowToUseJIT.cpp Message-ID: <200702130606.l1D66geA009071@zion.cs.uiuc.edu> Changes in directory llvm/examples/HowToUseJIT: HowToUseJIT.cpp updated: 1.15 -> 1.16 --- Log message: eliminate vector-related ctors --- Diffs of the changes: (+1 -3) HowToUseJIT.cpp | 4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/examples/HowToUseJIT/HowToUseJIT.cpp diff -u llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.15 llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.16 --- llvm/examples/HowToUseJIT/HowToUseJIT.cpp:1.15 Fri Jan 19 16:45:05 2007 +++ llvm/examples/HowToUseJIT/HowToUseJIT.cpp Tue Feb 13 00:06:26 2007 @@ -89,9 +89,7 @@ Value *Ten = ConstantInt::get(Type::Int32Ty, 10); // Pass Ten to the call call: - std::vector Params; - Params.push_back(Ten); - CallInst *Add1CallRes = new CallInst(Add1F, Params, "add1", BB); + CallInst *Add1CallRes = new CallInst(Add1F, Ten, "add1", BB); Add1CallRes->setTailCall(true); // Create the return instruction and add it to the basic block. From sabre at nondot.org Tue Feb 13 00:22:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:22:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp Message-ID: <200702130622.l1D6MqkS009369@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.73 -> 1.74 --- Log message: eliminate instruction ctors that take vectors. --- Diffs of the changes: (+0 -37) Instructions.cpp | 37 ------------------------------------- 1 files changed, 37 deletions(-) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.73 llvm/lib/VMCore/Instructions.cpp:1.74 --- llvm/lib/VMCore/Instructions.cpp:1.73 Mon Feb 12 19:04:01 2007 +++ llvm/lib/VMCore/Instructions.cpp Tue Feb 13 00:22:32 2007 @@ -268,14 +268,6 @@ assert(FTy->getNumParams() == 0 && "Calling a function with bad signature"); } -CallInst::CallInst(Value *Func, const std::vector &Params, - const std::string &Name, Instruction *InsertBefore) - : Instruction(cast(cast(Func->getType()) - ->getElementType())->getReturnType(), - Instruction::Call, 0, 0, Name, InsertBefore) { - init(Func, &Params[0], Params.size()); -} - CallInst::CallInst(Value *Func, Value* const *Args, unsigned NumArgs, const std::string &Name, BasicBlock *InsertAtEnd) : Instruction(cast(cast(Func->getType()) @@ -291,15 +283,6 @@ init(Func, Args, NumArgs); } -CallInst::CallInst(Value *Func, const std::vector &Params, - const std::string &Name, BasicBlock *InsertAtEnd) -: Instruction(cast(cast(Func->getType()) - ->getElementType())->getReturnType(), - Instruction::Call, 0, 0, Name, InsertAtEnd) { - init(Func, &Params[0], Params.size()); -} - - CallInst::CallInst(Value *Func, Value *Actual1, Value *Actual2, const std::string &Name, Instruction *InsertBefore) : Instruction(cast(cast(Func->getType()) @@ -411,26 +394,6 @@ init(Fn, IfNormal, IfException, Args, NumArgs); } -InvokeInst::InvokeInst(Value *Fn, BasicBlock *IfNormal, - BasicBlock *IfException, - const std::vector &Params, - const std::string &Name, Instruction *InsertBefore) - : TerminatorInst(cast(cast(Fn->getType()) - ->getElementType())->getReturnType(), - Instruction::Invoke, 0, 0, Name, InsertBefore) { - init(Fn, IfNormal, IfException, &Params[0], Params.size()); -} - -InvokeInst::InvokeInst(Value *Fn, BasicBlock *IfNormal, - BasicBlock *IfException, - const std::vector &Params, - const std::string &Name, BasicBlock *InsertAtEnd) - : TerminatorInst(cast(cast(Fn->getType()) - ->getElementType())->getReturnType(), - Instruction::Invoke, 0, 0, Name, InsertAtEnd) { - init(Fn, IfNormal, IfException, &Params[0], Params.size()); -} - InvokeInst::InvokeInst(const InvokeInst &II) : TerminatorInst(II.getType(), Instruction::Invoke, new Use[II.getNumOperands()], II.getNumOperands()) { From sabre at nondot.org Tue Feb 13 00:22:53 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:22:53 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Instructions.h Message-ID: <200702130622.l1D6Mr3v009374@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Instructions.h updated: 1.56 -> 1.57 --- Log message: eliminate instruction ctors that take vectors. --- Diffs of the changes: (+0 -12) Instructions.h | 12 ------------ 1 files changed, 12 deletions(-) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.56 llvm/include/llvm/Instructions.h:1.57 --- llvm/include/llvm/Instructions.h:1.56 Mon Feb 12 19:04:01 2007 +++ llvm/include/llvm/Instructions.h Tue Feb 13 00:22:32 2007 @@ -17,7 +17,6 @@ #define LLVM_INSTRUCTIONS_H #include "llvm/InstrTypes.h" -#include // fixme remove. namespace llvm { @@ -700,11 +699,6 @@ CallInst(Value *F, Value *const *Args, unsigned NumArgs, const std::string &Name, BasicBlock *InsertAtEnd); - CallInst(Value *F, const std::vector &Par, - const std::string &Name = "", Instruction *InsertBefore = 0); - CallInst(Value *F, const std::vector &Par, - const std::string &Name, BasicBlock *InsertAtEnd); - // Alternate CallInst ctors w/ two actuals, w/ one actual and no // actuals, respectively. CallInst(Value *F, Value *Actual1, Value *Actual2, @@ -1487,12 +1481,6 @@ Value* const *Args, unsigned NumArgs); public: InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, - const std::vector &Params, const std::string &Name = "", - Instruction *InsertBefore = 0); - InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, - const std::vector &Params, const std::string &Name, - BasicBlock *InsertAtEnd); - InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, Value* const* Args, unsigned NumArgs, const std::string &Name = "", Instruction *InsertBefore = 0); InvokeInst(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, From sabre at nondot.org Tue Feb 13 00:30:59 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 00:30:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200702130630.l1D6UxkN009521@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.237 -> 1.238 --- Log message: now that we can pass ranges into CallInst ctors, eliminate vector heap traffic --- Diffs of the changes: (+2 -2) Reader.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.237 llvm/lib/Bytecode/Reader/Reader.cpp:1.238 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.237 Mon Feb 12 19:53:54 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Feb 13 00:30:42 2007 @@ -669,7 +669,7 @@ const FunctionType *FTy = dyn_cast(PTy->getElementType()); if (FTy == 0) error("Call to non function pointer value!"); - std::vector Params; + SmallVector Params; if (!FTy->isVarArg()) { FunctionType::param_iterator It = FTy->param_begin(); @@ -720,7 +720,7 @@ if (FTy == 0) error("Invoke to non function pointer value!"); - std::vector Params; + SmallVector Params; BasicBlock *Normal, *Except; unsigned CallingConv = Oprnds.back(); Oprnds.pop_back(); From sabre at nondot.org Tue Feb 13 01:25:52 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 01:25:52 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200702130725.l1D7PqiI010392@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.23 -> 1.24 --- Log message: fix a critical bug in smallvector, where it would destroy elements that are not in its range (!). --- Diffs of the changes: (+1 -1) SmallVector.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.23 llvm/include/llvm/ADT/SmallVector.h:1.24 --- llvm/include/llvm/ADT/SmallVector.h:1.23 Wed Jan 31 14:08:34 2007 +++ llvm/include/llvm/ADT/SmallVector.h Tue Feb 13 01:25:36 2007 @@ -275,8 +275,8 @@ void destroy_range(T *S, T *E) { while (S != E) { - E->~T(); --E; + E->~T(); } } }; From sabre at nondot.org Tue Feb 13 01:28:36 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 01:28:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.h Message-ID: <200702130728.l1D7SaQ5010483@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.h updated: 1.49 -> 1.50 --- Log message: Use a SmallVector to reduce heap traffic. This speeds up bcreader 10% --- Diffs of the changes: (+1 -1) Reader.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Reader/Reader.h diff -u llvm/lib/Bytecode/Reader/Reader.h:1.49 llvm/lib/Bytecode/Reader/Reader.h:1.50 --- llvm/lib/Bytecode/Reader/Reader.h:1.49 Mon Feb 12 12:53:43 2007 +++ llvm/lib/Bytecode/Reader/Reader.h Tue Feb 13 01:28:20 2007 @@ -80,7 +80,7 @@ /// globals section. /// @brief A list of values as a User of those Values. class ValueList : public User { - std::vector Uses; + SmallVector Uses; public: ValueList() : User(Type::VoidTy, Value::ArgumentVal, 0, 0) {} From sabre at nondot.org Tue Feb 13 01:53:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 01:53:54 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Value.h Message-ID: <200702130753.l1D7rsXo010954@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Value.h updated: 1.94 -> 1.95 --- Log message: add a setName variant that takes a null-terminated string. This can be used to avoid std::string allocations in common cases. --- Diffs of the changes: (+2 -0) Value.h | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.94 llvm/include/llvm/Value.h:1.95 --- llvm/include/llvm/Value.h:1.94 Mon Feb 12 12:52:59 2007 +++ llvm/include/llvm/Value.h Tue Feb 13 01:53:34 2007 @@ -92,6 +92,8 @@ void setName(const std::string &name); void setName(const char *Name, unsigned NameLen); + void setName(const char *Name); // Takes a null-terminated string. + /// takeName - transfer the name from V to this value, setting V's name to /// empty. It is an error to call V->takeName(V). From sabre at nondot.org Tue Feb 13 01:53:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 01:53:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Value.cpp Message-ID: <200702130753.l1D7rt1x010957@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Value.cpp updated: 1.67 -> 1.68 --- Log message: add a setName variant that takes a null-terminated string. This can be used to avoid std::string allocations in common cases. --- Diffs of the changes: (+4 -0) Value.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/VMCore/Value.cpp diff -u llvm/lib/VMCore/Value.cpp:1.67 llvm/lib/VMCore/Value.cpp:1.68 --- llvm/lib/VMCore/Value.cpp:1.67 Mon Feb 12 12:52:59 2007 +++ llvm/lib/VMCore/Value.cpp Tue Feb 13 01:53:34 2007 @@ -122,6 +122,10 @@ setName(&name[0], name.size()); } +void Value::setName(const char *Name) { + setName(Name, Name ? strlen(Name) : 0); +} + void Value::setName(const char *NameStr, unsigned NameLen) { if (NameLen == 0 && !hasName()) return; if (getType() != Type::VoidTy && "Cannot assign a name to void values!"); From sabre at nondot.org Tue Feb 13 01:55:02 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 01:55:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Instruction.cpp Instructions.cpp Message-ID: <200702130755.l1D7t2D2011015@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Instruction.cpp updated: 1.64 -> 1.65 Instructions.cpp updated: 1.74 -> 1.75 --- Log message: Switch UnaryOperators to default to passing names up by const char* when possible. This speeds up bcreading by 1.5%. --- Diffs of the changes: (+74 -8) Instruction.cpp | 28 ++++++++++++++++++++++++++++ Instructions.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 74 insertions(+), 8 deletions(-) Index: llvm/lib/VMCore/Instruction.cpp diff -u llvm/lib/VMCore/Instruction.cpp:1.64 llvm/lib/VMCore/Instruction.cpp:1.65 --- llvm/lib/VMCore/Instruction.cpp:1.64 Sun Feb 11 23:18:08 2007 +++ llvm/lib/VMCore/Instruction.cpp Tue Feb 13 01:54:42 2007 @@ -44,6 +44,34 @@ setName(Name); } +Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps, + const char *Name, Instruction *InsertBefore) + : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) { + // Make sure that we get added to a basicblock + LeakDetector::addGarbageObject(this); + + // If requested, insert this instruction into a basic block... + if (InsertBefore) { + assert(InsertBefore->getParent() && + "Instruction to insert before is not in a basic block!"); + InsertBefore->getParent()->getInstList().insert(InsertBefore, this); + } + if (Name && *Name) setName(Name); +} + +Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps, + const char *Name, BasicBlock *InsertAtEnd) + : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) { + // Make sure that we get added to a basicblock + LeakDetector::addGarbageObject(this); + + // append this instruction into the basic block + assert(InsertAtEnd && "Basic block to append to may not be NULL!"); + InsertAtEnd->getInstList().push_back(this); + if (Name && *Name) setName(Name); +} + + // Out of line virtual method, so the vtable, etc has a home. Instruction::~Instruction() { assert(Parent == 0 && "Instruction still linked in the program!"); Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.74 llvm/lib/VMCore/Instructions.cpp:1.75 --- llvm/lib/VMCore/Instructions.cpp:1.74 Tue Feb 13 00:22:32 2007 +++ llvm/lib/VMCore/Instructions.cpp Tue Feb 13 01:54:42 2007 @@ -531,18 +531,20 @@ unsigned Align, const std::string &Name, Instruction *InsertBefore) : UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize), - Name, InsertBefore), Alignment(Align) { + 0, InsertBefore), Alignment(Align) { assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!"); assert(Ty != Type::VoidTy && "Cannot allocate void!"); + setName(Name); } AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy, unsigned Align, const std::string &Name, BasicBlock *InsertAtEnd) : UnaryInstruction(PointerType::get(Ty), iTy, getAISize(ArraySize), - Name, InsertAtEnd), Alignment(Align) { + 0, InsertAtEnd), Alignment(Align) { assert((Align & (Align-1)) == 0 && "Alignment is not a power of 2!"); assert(Ty != Type::VoidTy && "Cannot allocate void!"); + setName(Name); } // Out of line virtual method, so the vtable, etc has a home. @@ -579,12 +581,12 @@ } FreeInst::FreeInst(Value *Ptr, Instruction *InsertBefore) - : UnaryInstruction(Type::VoidTy, Free, Ptr, "", InsertBefore) { + : UnaryInstruction(Type::VoidTy, Free, Ptr, 0, InsertBefore) { AssertOK(); } FreeInst::FreeInst(Value *Ptr, BasicBlock *InsertAtEnd) - : UnaryInstruction(Type::VoidTy, Free, Ptr, "", InsertAtEnd) { + : UnaryInstruction(Type::VoidTy, Free, Ptr, 0, InsertAtEnd) { AssertOK(); } @@ -600,30 +602,66 @@ LoadInst::LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBef) : UnaryInstruction(cast(Ptr->getType())->getElementType(), - Load, Ptr, Name, InsertBef) { + Load, Ptr, 0, InsertBef) { setVolatile(false); AssertOK(); + setName(Name); } LoadInst::LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAE) : UnaryInstruction(cast(Ptr->getType())->getElementType(), - Load, Ptr, Name, InsertAE) { + Load, Ptr, 0, InsertAE) { setVolatile(false); AssertOK(); + setName(Name); } LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, Instruction *InsertBef) : UnaryInstruction(cast(Ptr->getType())->getElementType(), - Load, Ptr, Name, InsertBef) { + Load, Ptr, 0, InsertBef) { setVolatile(isVolatile); AssertOK(); + setName(Name); } LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, BasicBlock *InsertAE) : UnaryInstruction(cast(Ptr->getType())->getElementType(), - Load, Ptr, Name, InsertAE) { + Load, Ptr, 0, InsertAE) { + setVolatile(isVolatile); + AssertOK(); + setName(Name); +} + + + +LoadInst::LoadInst(Value *Ptr, const char *Name, Instruction *InsertBef) +: UnaryInstruction(cast(Ptr->getType())->getElementType(), + Load, Ptr, Name, InsertBef) { + setVolatile(false); + AssertOK(); +} + +LoadInst::LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAE) +: UnaryInstruction(cast(Ptr->getType())->getElementType(), + Load, Ptr, Name, InsertAE) { + setVolatile(false); + AssertOK(); +} + +LoadInst::LoadInst(Value *Ptr, const char *Name, bool isVolatile, + Instruction *InsertBef) +: UnaryInstruction(cast(Ptr->getType())->getElementType(), + Load, Ptr, Name, InsertBef) { + setVolatile(isVolatile); + AssertOK(); +} + +LoadInst::LoadInst(Value *Ptr, const char *Name, bool isVolatile, + BasicBlock *InsertAE) +: UnaryInstruction(cast(Ptr->getType())->getElementType(), + Load, Ptr, Name, InsertAE) { setVolatile(isVolatile); AssertOK(); } From sabre at nondot.org Tue Feb 13 01:55:03 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 01:55:03 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/InstrTypes.h Instruction.h Instructions.h Message-ID: <200702130755.l1D7t3rk011024@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: InstrTypes.h updated: 1.60 -> 1.61 Instruction.h updated: 1.79 -> 1.80 Instructions.h updated: 1.57 -> 1.58 --- Log message: Switch UnaryOperators to default to passing names up by const char* when possible. This speeds up bcreading by 1.5%. --- Diffs of the changes: (+26 -12) InstrTypes.h | 14 ++++++++------ Instruction.h | 7 +++++-- Instructions.h | 17 +++++++++++++---- 3 files changed, 26 insertions(+), 12 deletions(-) Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.60 llvm/include/llvm/InstrTypes.h:1.61 --- llvm/include/llvm/InstrTypes.h:1.60 Tue Jan 16 20:46:11 2007 +++ llvm/include/llvm/InstrTypes.h Tue Feb 13 01:54:42 2007 @@ -91,11 +91,11 @@ Use Op; protected: UnaryInstruction(const Type *Ty, unsigned iType, Value *V, - const std::string &Name = "", Instruction *IB = 0) + const char *Name = 0, Instruction *IB = 0) : Instruction(Ty, iType, &Op, 1, Name, IB), Op(V, this) { } UnaryInstruction(const Type *Ty, unsigned iType, Value *V, - const std::string &Name, BasicBlock *IAE) + const char *Name = 0, BasicBlock *IAE) : Instruction(Ty, iType, &Op, 1, Name, IAE), Op(V, this) { } public: @@ -263,13 +263,15 @@ protected: /// @brief Constructor with insert-before-instruction semantics for subclasses CastInst(const Type *Ty, unsigned iType, Value *S, - const std::string &Name = "", Instruction *InsertBefore = 0) - : UnaryInstruction(Ty, iType, S, Name, InsertBefore) { + const std::string &Name = "", Instruction *InsertBefore = 0) + : UnaryInstruction(Ty, iType, S, 0, InsertBefore) { + setName(Name); } /// @brief Constructor with insert-at-end-of-block semantics for subclasses CastInst(const Type *Ty, unsigned iType, Value *S, - const std::string &Name, BasicBlock *InsertAtEnd) - : UnaryInstruction(Ty, iType, S, Name, InsertAtEnd) { + const std::string &Name, BasicBlock *InsertAtEnd) + : UnaryInstruction(Ty, iType, S, 0, InsertAtEnd) { + setName(Name); } public: /// Provides a way to construct any of the CastInst subclasses using an Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.79 llvm/include/llvm/Instruction.h:1.80 --- llvm/include/llvm/Instruction.h:1.79 Thu Feb 1 20:16:21 2007 +++ llvm/include/llvm/Instruction.h Tue Feb 13 01:54:42 2007 @@ -41,10 +41,13 @@ void setParent(BasicBlock *P); protected: Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, - const std::string &Name = "", - Instruction *InsertBefore = 0); + const std::string &Name, Instruction *InsertBefore = 0); Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, const std::string &Name, BasicBlock *InsertAtEnd); + Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, + const char *Name = 0, Instruction *InsertBefore = 0); + Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, + const char *Name, BasicBlock *InsertAtEnd); public: // Out of line virtual method, so the vtable, etc has a home. ~Instruction(); Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.57 llvm/include/llvm/Instructions.h:1.58 --- llvm/include/llvm/Instructions.h:1.57 Tue Feb 13 00:22:32 2007 +++ llvm/include/llvm/Instructions.h Tue Feb 13 01:54:42 2007 @@ -222,11 +222,18 @@ public: LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBefore); LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAtEnd); - explicit LoadInst(Value *Ptr, const std::string &Name = "", - bool isVolatile = false, Instruction *InsertBefore = 0); + LoadInst(Value *Ptr, const std::string &Name, bool isVolatile = false, + Instruction *InsertBefore = 0); LoadInst(Value *Ptr, const std::string &Name, bool isVolatile, BasicBlock *InsertAtEnd); + LoadInst(Value *Ptr, const char *Name, Instruction *InsertBefore); + LoadInst(Value *Ptr, const char *Name, BasicBlock *InsertAtEnd); + explicit LoadInst(Value *Ptr, const char *Name = 0, bool isVolatile = false, + Instruction *InsertBefore = 0); + LoadInst(Value *Ptr, const char *Name, bool isVolatile, + BasicBlock *InsertAtEnd); + /// isVolatile - Return true if this is a load from a volatile memory /// location. /// @@ -828,11 +835,13 @@ public: VAArgInst(Value *List, const Type *Ty, const std::string &Name = "", Instruction *InsertBefore = 0) - : UnaryInstruction(Ty, VAArg, List, Name, InsertBefore) { + : UnaryInstruction(Ty, VAArg, List, 0, InsertBefore) { + setName(Name); } VAArgInst(Value *List, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) - : UnaryInstruction(Ty, VAArg, List, Name, InsertAtEnd) { + : UnaryInstruction(Ty, VAArg, List, 0, InsertAtEnd) { + setName(Name); } virtual VAArgInst *clone() const; From reid at x10sys.com Tue Feb 13 03:06:18 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 03:06:18 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702130906.l1D96IwV021188@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html added (r1.1) --- Log message: First draft of the LLVM Developer Policy. This document is a "first cut" at stating in clear terms the LLVM project's policies with respect to developers and their contributions. Feedback on this is welcome while it is in draft stage. --- Diffs of the changes: (+436 -0) DeveloperPolicy.html | 436 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 436 insertions(+) Index: llvm/docs/DeveloperPolicy.html diff -c /dev/null llvm/docs/DeveloperPolicy.html:1.1 *** /dev/null Tue Feb 13 03:06:11 2007 --- llvm/docs/DeveloperPolicy.html Tue Feb 13 03:06:01 2007 *************** *** 0 **** --- 1,436 ---- + + + + LLVM Developer Policy + + + +
DRAFT Only.
+ +
LLVM Developer Policy
+
+

Contents

+
    +
  1. Overview
  2. +
  3. Terminology
  4. +
  5. Copyright and License +
      +
    1. Copyright
    2. +
    3. License
    4. +
    5. Developer Agreements
    6. +
  6. +
  7. General Policies +
      +
    1. Stay Informed
    2. +
    3. Starting New Work
    4. +
    5. Code Reviews
    6. +
    7. Incremental Development
    8. +
    9. Quality
    10. +
    11. Test Cases
    12. +
  8. +
  9. Patch Policies +
      +
    1. Patch Form
    2. +
    3. Patch Testing
    4. +
    5. Patch Submission
    6. +
    7. After Submission
    8. +
    9. Obtaining Commit Access
    10. +
    11. New Committers
    12. +
  10. +
+
Written by LLVM Oversight Team
+
+ + + + +
+

This document contains the LLVM Developer Policy which defines the + project's policy towards developer's and their contributions. The intent of + this policy is to eliminate mis-communication, rework, and confusion that + might arise from the distributed nature of LLVM's development. By stating + the policy in clear terms, we hope each developer can know ahead of time + what to expect when making LLVM contributions.

+
+ + + +
+

So that the policies defined in the next sections are clear, we first + define some terms here.

+
+
Change
+
Any modification to LLVM including documentation, tests, build system, + etc. either in patch or + commit form.
+
Commit
+
A change submitted directly to LLVM software + respository via the cvs commit command.
+
Developer
+
Anyone who submits a change to LLVM.
+
Increment
+
A change or set of changes, whether by + patch or commit, that are + related by a single common purpose. Increments are atomic as they + leave LLVM in a stable state (both compiling and working properly).
+
Must
+
When used in a policy statement, the term must implies a + non-optional requirement on the developer.
+
Patch
+
A change submitted by email in patch (diff) + format generated by the cvs diff command.
+
Should
+
When used in a policy statement, the term should implies a + recommended but optional requirement on the developer.
+
+
+ +
+ + + + +
+

We address here the issues of copyright and license for the LLVM project. + A copyright is literally the "right to copy". It is a set of exclusive rights + granted to a party regulating the particular expression of information. + In this case, the information is LLVM. A license is something granted by a + copyright holder to other parties that controls the use of the information + by them. Currently, the University of Illinois is the LLVM copyright holder + and the terms of its license to LLVM users and developers is the + University of Illinois Open Source License (see LICENSE.txt).

+
+ + +
+

The LLVM project believes in correct attribution of contributions to + their contributors. Developers should, therefore, place their name at the + top of any source file they originate and list their contributions in the + CREDITS.TXT file. Furthermore, correct attribution of submitted patches + should be made in the commit comments.

+

However, for consistency and ease of management, the project requires the + copyright for all LLVM software to be held by a single copyright holder. + Although UIUC may assign the copyright of the software to another entity, + the intent for the project is to always have a single entity hold the copy + rights to LLVM at any given time. +

Having multiple copyright holders for various portions of LLVM is + problematic in the management of the software. Having a single copyright + holder is in the best interests of all developers and users as it greatly + reduces the managerial burden for any kind of administrative or technical + decisions about LLVM.

+
+ + +
+

LLVM licensing decisions will be made by the LLVM Oversight Group. Any + issues, comments or suggestions with the licensing should be sent to + oversight at llvm.org.

+

The LLVM Oversight Group intends to keep LLVM perpetually open source + and to use liberal open source licenses. The current license is the + University of Illinois Open Source License (see LICENSE.TXT), which boils + down to this:

+
    +
  • You can freely distribute LLVM.
  • +
  • You must retain the copyright notice if you redistribute.
  • +
  • Binaries derived from LLVM must reproduce the copyright notice.
  • +
  • You can't use our names to promote your LLVM derived products.
  • +
  • There's no warranty on LLVM at all.
  • +
+

We believe this fosters the widest adoption of LLVM because it allows + commercial products to be derived from LLVM with few restrictions and + without a requirement for making any derived works also open source. The + intent of the license is to let people use LLVM freely with only the + obligation to be honest about where it came from.

+
+ + +
+

With regards to the LLVM copyright and licensing, developer's agree to:

+
    +
  • give up their copy rights to any contribution made so that the entire + software base can be managed by a single copyright holder.
  • +
  • allow their contribution(s) to be licensed as open source by the then + current or subsequent license chosen by the LLVM Oversight Group.
  • +
  • not make LLVM available under any other licensing agreement.
  • +
+
+ + + + +
+

This section contains policies that pertain generally to LLVM developers. +

LLVM Developers are expected to meet the following obligations in order + for LLVM to maintain a high standard of quality

+

+ + + +
+

Developers should stay informed by reading at least the + llvmdev email list. If you are doing + anything more than just casual work on LLVM, it is highly suggested that you + also subscribe to the llvm-commits list and pay attention to changes being + made by others.

+

Active developers must register an email account with bugzilla + (http://llvm.org/bugs/) and preferably + subscribe to the llvm-bugs email list to keep track of bugs occuring in + LLVM.

+
+ + + +
+

When a developer begins new work with the aim of contributing it back to + LLVM, s/he must inform the community with an email to llvm-dev email list, + to the extent possible. The reason for this is to: +

    +
  • keep the community informed about future changes to LLVM,
  • +
  • avoid duplication of effort by having multiple parties working on the + same thing and not knowing about it, and
  • +
  • ensure that any issues around the proposed work are discussed and + resolved before any significant work is accomplished.
  • +
+
+ + + +
+

LLVM has a code review policy. Code review is an excellent way to ensure + high quality in the software. The following policies apply:

+
    +
  1. All developers are required to have any significant changes reviewed + before they are committed to the repository.
  2. +
  3. Code reviews are conducted by email.
  4. +
  5. Code can be reviewed either before it is committed or after.
  6. +
  7. The developer responsible for a code change is also responsible for + making all necessary review changes.
  8. +
  9. Developers should participate in code reviews as both a reviewer and + a reviewee. We don't have a dedicated team of reviewers. If someone is + kind enough to review your code, you should return the favor for someone + else.
  10. +
+
+ + + +
+

LLVM uses an incremental development style and all developers are expected + to follow this practice. Incremental development is a big key to LLVM's + success and it is essential that developers submit incremental patches. The + following defines the incremental development approach:

+
    +
  1. The first task is to define the increment and get consensus (with the + LLVM development community) on what the end goal of the change is. Making + random small changes that go nowhere is not useful for anyone.
  2. +
  3. An increment is the smallest patch size necessary to effect one change + in LLVM.
  4. +
  5. Increments can be stand alone (e.g. to fix a bug), or part of a planned + series of increments towards some development goal.
  6. +
  7. Increments should be kept as small as possible. This simplifies your + work (into a logical progression), simplifies code review and reduces the + chance that you will get negative feedback on the change. Small increments + also facilitate the maintenance of a high quality code base.
  8. +
+
+ + + +
+

The minimum quality standards for any change to the main development + branch are:

+
    +
  1. Code must adhere to the + LLVM Coding Standards.
  2. +
  3. Code must compile cleanly (no errors, no warnings) on at least one + platform.
  4. +
  5. Code must pass the deja gnu (llvm/test) test suite.
  6. +
  7. +
+

Additionally, the committer is responsible for all of the following items. + It is considered significantly preferable for all of these items to be + accounted for before the code is submitted for review or committed.

+
    +
  1. Code must compile cleanly on all platforms.
  2. +
  3. Code must pass the llvm-test test suite including + SPEC CINT2000, SPEC CFP2000, SPEC CINT2006, and SPEC CFP2006.
  4. +
  5. The changesat must not cause performance or correctness regressions + for the LLVM tools.
  6. +
  7. The changes must not cause performance or correctness regressions in + code compiled with LLVM on all applicable targets.
  8. +
+
+ + + +
+

Developers are required to create test cases for regressions and new + features and include them with their changes. The following policies + apply:

+
    +
  1. All feature and regression test cases must be added to the + llvm/test directory. The appropriate subdirectory should be + selected (see the Testing Guide for + details.
  2. +
  3. Test cases should be written in LLVM assembly language unless the + feature or regression being tested requires another language.
  4. +
  5. Test cases, especially for regressions, should be as reduced as + possible, preferably by + bugpoint. It is unacceptable + to place an entire failing program into llvm/test as this creates + a time-to-test burden on all developers. Keep them short!
  6. +
  7. More extensive test cases (applications, benchmarks, etc.) should be + added to the llvm-test test suite, after approval from the + Oversight Group. This test suite is for coverage not features or + regressions.
  8. +
+
+ + + + +
+

This section contains policies that pertain to submitting patches + to LLVM and committing code to the repository

+
+ + +
+

When submitting a patch, developers must follow these rules:

+
    +
  1. Patches must be made against the CVS HEAD (main development trunk), + not a branch.
  2. +
  3. Patches must be made with this cvs command:
    +     cvs diff -Ntdup -5
    or with the utility utils/mkpatch.
  4. +
  5. Patches must not include differences in generated code such as the + code generated by flex, bison or tblgen. The + utils/mkpatch utility takes care of this for you.
  6. +
+
+ + +
+

Before a patch is submitted for review, it should be tested to ensure + that:

+
    +
  1. The patch must compile against the CVS HEAD cleanly (zero warnings, zero + errors).
  2. +
  3. All the llvm/test (Deja Gnu) tests must pass.
  4. +
  5. All the llvm-test tests must pass on at least one platform.
  6. +
+
+ + +
+

When a patch is ready to be submitted, these policies apply:

+
    +
  1. Patches should be submitted immediately after they are generated. Stale + patches are unlikely to apply correctly and could be rejected simply due to + age.
  2. +
  3. Patches must be submitted by e-mail to the + + llvm-commits list.
  4. +
+
+ + + +
+

After a patch has been submitted, these policies apply:

+
    +
  1. The patch is subject to review by anyone on the llvm-commits email list. +
  2. +
  3. Any changes recommended by the reviewer must be made by the submitter + of the patch and the patch re-submitted.
  4. +
  5. If the submitter believes the review comment is in error, a response to + the + llvm-commits list should be made explaining why the recommendation + cannot be followed.
  6. +
+
+ + + +
+

After a patch has been committed, these policies apply:

+
    +
  1. The patch is subject to further review by anyone on the llvm-commits + email list.
  2. +
  3. The patch submitter is responsible for all aspects of the patch per + the quality policy above.
  4. +
  5. If the patch is discovered to not meet the + quality standards standards within a reasonable time + frame (24 hours), it may be subject to reversal.
  6. +
+
+ + + +
+

Commit access to the repository is granted according to this policy:

+
    +
  1. Commit access is not granted to anyone unless they specifically ask for + it.
  2. +
  3. Requests for commit access must be sent to the LLVM Oversight Group at + oversight at llvm.org.
  4. +
  5. Granting commit access is at the sole discretion of the LLVM Oversight + Group.
  6. +
  7. Submitting patches to LLVM via the patch policy above will greatly + increase the chance that your request for commit access is granted.
  8. +
  9. Getting to know the members of the LLVM community (email, IRC, in person + contact, etc.) will also increase your chances.
  10. +
+
+ + + +
+

For those who have recently obtained commit access, the following policies + apply:

+
    +
  1. You are granted commit-after-approval to all parts of LLVM. + To get approval, submit a patch to llvm-commits per the patch policies + above. When approved you may commit it yourself.
  2. +
  3. You are granted commit-without-approavl to those portions of LLVM + that you own (contributed) or maintain (have been assigned responsibility + for), with the proviso that such commits must not break the build. This is + a "trust but verify" policy and commits of this nature are reviewed after + they are committed.
  4. +
  5. Commits that violate the quality standards may + be reverted. This is necessary when the change blocks other developers from + making progress. The developers is welcome to re-commit the change after + the problem has been fixed.
  6. +
  7. Multiple violations of these policies or a single aggregious violation + may cause commit access to be revoked, at the sole discretion of the + LLVM Oversight Group.
  8. +
+
+ + + + +
+

This section contains some notes on policy topics that need to be + resolved and incorporated into the main body of the document above.

+
    +
  1. When to open a new bug and when to re-use an existing one. For example + PR1158. If the same assertion happens do you open a new bug or reopen + 1158?
  2. +
+
+ + +
+
+ Valid CSS! + Valid HTML 4.01! + Written By: LLVM Oversight Group
+ The LLVM Compiler Infrastructure
+ Last modified: $Date: 2007/02/13 09:06:01 $ +
+ + From reid at x10sys.com Tue Feb 13 03:08:43 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 03:08:43 -0600 Subject: [llvm-commits] CVS: llvm/docs/index.html Message-ID: <200702130908.l1D98huJ021306@zion.cs.uiuc.edu> Changes in directory llvm/docs: index.html updated: 1.61 -> 1.62 --- Log message: Add DeveloperPolicy.html --- Diffs of the changes: (+4 -1) index.html | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/docs/index.html diff -u llvm/docs/index.html:1.61 llvm/docs/index.html:1.62 --- llvm/docs/index.html:1.61 Fri Feb 9 09:59:08 2007 +++ llvm/docs/index.html Tue Feb 13 03:08:27 2007 @@ -64,6 +64,9 @@ Microsoft Visual Studio - An addendum to the main Getting Started guide for those using Visual Studio on Windows. +
  • Developer Policy - The LLVM project's +policy towards developers and their contributions.
  • +
  • LLVM Command Guide - A reference manual for the LLVM command line utilities ("man" pages for LLVM tools).
    Current tools: @@ -262,6 +265,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/09 15:59:08 $ + Last modified: $Date: 2007/02/13 09:08:27 $ From reid at x10sys.com Tue Feb 13 03:09:36 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 03:09:36 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702130909.l1D99a8G021394@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.1 -> 1.2 --- Log message: Make the draft notice more prominent. --- Diffs of the changes: (+2 -2) DeveloperPolicy.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.1 llvm/docs/DeveloperPolicy.html:1.2 --- llvm/docs/DeveloperPolicy.html:1.1 Tue Feb 13 03:06:01 2007 +++ llvm/docs/DeveloperPolicy.html Tue Feb 13 03:09:20 2007 @@ -6,7 +6,7 @@ -
    DRAFT Only.
    +
    DRAFT Only. DRAFT Only. DRAFT Only. DRAFT Only.
    LLVM Developer Policy
    @@ -430,7 +430,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> Written By: LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/13 09:06:01 $ + Last modified: $Date: 2007/02/13 09:09:20 $ From reid at x10sys.com Tue Feb 13 03:11:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 03:11:49 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702130911.l1D9Bn1S021495@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.2 -> 1.3 --- Log message: Fix an HTML validation error. --- Diffs of the changes: (+2 -2) DeveloperPolicy.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.2 llvm/docs/DeveloperPolicy.html:1.3 --- llvm/docs/DeveloperPolicy.html:1.2 Tue Feb 13 03:09:20 2007 +++ llvm/docs/DeveloperPolicy.html Tue Feb 13 03:11:33 2007 @@ -278,7 +278,7 @@ feature or regression being tested requires another language.
  • Test cases, especially for regressions, should be as reduced as possible, preferably by - bugpoint. It is unacceptable + bugpoint. It is unacceptable to place an entire failing program into llvm/test as this creates a time-to-test burden on all developers. Keep them short!
  • More extensive test cases (applications, benchmarks, etc.) should be @@ -430,7 +430,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> Written By: LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/13 09:09:20 $ + Last modified: $Date: 2007/02/13 09:11:33 $ From reid at x10sys.com Tue Feb 13 03:20:31 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 03:20:31 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702130920.l1D9KVOB021730@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.3 -> 1.4 --- Log message: Clean up spelling mistakes. --- Diffs of the changes: (+7 -7) DeveloperPolicy.html | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.3 llvm/docs/DeveloperPolicy.html:1.4 --- llvm/docs/DeveloperPolicy.html:1.3 Tue Feb 13 03:11:33 2007 +++ llvm/docs/DeveloperPolicy.html Tue Feb 13 03:20:14 2007 @@ -66,7 +66,7 @@ commit form.
    Commit
    A change submitted directly to LLVM software - respository via the cvs commit command.
    + repository via the cvs commit command.
    Developer
    Anyone who submits a change to LLVM.
    Increment
    @@ -175,7 +175,7 @@ made by others.

    Active developers must register an email account with bugzilla (http://llvm.org/bugs/) and preferably - subscribe to the llvm-bugs email list to keep track of bugs occuring in + subscribe to the llvm-bugs email list to keep track of bugs occurring in LLVM.

    @@ -256,7 +256,7 @@
  • Code must compile cleanly on all platforms.
  • Code must pass the llvm-test test suite including SPEC CINT2000, SPEC CFP2000, SPEC CINT2006, and SPEC CFP2006.
  • -
  • The changesat must not cause performance or correctness regressions +
  • The change set must not cause performance or correctness regressions for the LLVM tools.
  • The changes must not cause performance or correctness regressions in code compiled with LLVM on all applicable targets.
  • @@ -271,7 +271,7 @@ apply:

    1. All feature and regression test cases must be added to the - llvm/test directory. The appropriate subdirectory should be + llvm/test directory. The appropriate sub-directory should be selected (see the Testing Guide for details.
    2. Test cases should be written in LLVM assembly language unless the @@ -393,7 +393,7 @@
    3. You are granted commit-after-approval to all parts of LLVM. To get approval, submit a patch to llvm-commits per the patch policies above. When approved you may commit it yourself.
    4. -
    5. You are granted commit-without-approavl to those portions of LLVM +
    6. You are granted commit-without-approval to those portions of LLVM that you own (contributed) or maintain (have been assigned responsibility for), with the proviso that such commits must not break the build. This is a "trust but verify" policy and commits of this nature are reviewed after @@ -402,7 +402,7 @@ be reverted. This is necessary when the change blocks other developers from making progress. The developers is welcome to re-commit the change after the problem has been fixed.
    7. -
    8. Multiple violations of these policies or a single aggregious violation +
    9. Multiple violations of these policies or a single egregious violation may cause commit access to be revoked, at the sole discretion of the LLVM Oversight Group.
    @@ -430,7 +430,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> Written By: LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/13 09:11:33 $ + Last modified: $Date: 2007/02/13 09:20:14 $ From reid at x10sys.com Tue Feb 13 03:26:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 03:26:27 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/InstrTypes.h Message-ID: <200702130926.l1D9QRow021879@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: InstrTypes.h updated: 1.61 -> 1.62 --- Log message: Fix a compilation error that caused the nightly test to fail. --- Diffs of the changes: (+1 -1) InstrTypes.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.61 llvm/include/llvm/InstrTypes.h:1.62 --- llvm/include/llvm/InstrTypes.h:1.61 Tue Feb 13 01:54:42 2007 +++ llvm/include/llvm/InstrTypes.h Tue Feb 13 03:26:04 2007 @@ -95,7 +95,7 @@ : Instruction(Ty, iType, &Op, 1, Name, IB), Op(V, this) { } UnaryInstruction(const Type *Ty, unsigned iType, Value *V, - const char *Name = 0, BasicBlock *IAE) + const char *Name, BasicBlock *IAE) : Instruction(Ty, iType, &Op, 1, Name, IAE), Op(V, this) { } public: From baldrick at free.fr Tue Feb 13 05:08:06 2007 From: baldrick at free.fr (Duncan Sands) Date: Tue, 13 Feb 2007 12:08:06 +0100 Subject: [llvm-commits] llvm-gcc4: compile fixes Message-ID: <200702131208.07907.baldrick@free.fr> Breakage caused by "eliminate instruction ctors that take vectors": http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070212/044423.html No idea if this is the right approach, but it compiles! Ciao, Duncan. -------------- next part -------------- A non-text attachment was scrubbed... Name: instruction_ctors.diff Type: text/x-diff Size: 5469 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070213/0c901fe4/attachment.bin From lauro.venancio at gmail.com Tue Feb 13 07:50:24 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 07:50:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702131350.l1DDoOCZ027008@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.361 -> 1.362 --- Log message: Add "original alignment" to function arguments flags. --- Diffs of the changes: (+30 -10) SelectionDAGISel.cpp | 40 ++++++++++++++++++++++++++++++---------- 1 files changed, 30 insertions(+), 10 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.361 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.362 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.361 Mon Feb 12 19:05:56 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Feb 13 07:50:08 2007 @@ -2933,8 +2933,13 @@ MVT::ValueType VT = getValueType(I->getType()); bool isInReg = FTy->paramHasAttr(j, FunctionType::InRegAttribute); bool isSRet = FTy->paramHasAttr(j, FunctionType::StructRetAttribute); - unsigned Flags = (isInReg << 1) | (isSRet << 2); - + unsigned OriginalAlignment = + getTargetData()->getTypeAlignmentABI(I->getType()); + //Flags[31:27]-> OriginalAlignment + //Flags[2] -> isSRet + //Flags[1] -> isInReg + unsigned Flags = (isInReg << 1) | (isSRet << 2) | (OriginalAlignment << 27); + switch (getTypeAction(VT)) { default: assert(0 && "Unknown type action!"); case Legal: @@ -2954,6 +2959,8 @@ unsigned NumVals = getNumElements(VT); for (unsigned i = 0; i != NumVals; ++i) { RetVals.push_back(NVT); + //if it isn't first piece, alignment must be 1 + if (i == 1) Flags = (Flags & 0x07ffffff) | (1 << 27); Ops.push_back(DAG.getConstant(Flags, MVT::i32)); } } else { @@ -3053,11 +3060,16 @@ /// ExpandScalarCallArgs - Recursively expand call argument node by /// bit_converting it or extract a pair of elements from the larger node. static void ExpandScalarCallArgs(MVT::ValueType VT, SDOperand Arg, - unsigned Flags, + unsigned Flags, SmallVector &Ops, SelectionDAG &DAG, - TargetLowering &TLI) { + TargetLowering &TLI, + bool isFirst = true) { + if (TLI.getTypeAction(VT) != TargetLowering::Expand) { + //if it isn't first piece, alignment must be 1 + if (!isFirst) + Flags = (Flags & 0x07ffffff) | (1 << 27); Ops.push_back(Arg); Ops.push_back(DAG.getConstant(Flags, MVT::i32)); return; @@ -3067,7 +3079,7 @@ unsigned NumVals = MVT::getSizeInBits(VT) / MVT::getSizeInBits(EVT); if (NumVals == 1) { Arg = DAG.getNode(ISD::BIT_CONVERT, EVT, Arg); - ExpandScalarCallArgs(EVT, Arg, Flags, Ops, DAG, TLI); + ExpandScalarCallArgs(EVT, Arg, Flags, Ops, DAG, TLI, isFirst); } else if (NumVals == 2) { SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, EVT, Arg, DAG.getConstant(0, TLI.getPointerTy())); @@ -3075,8 +3087,8 @@ DAG.getConstant(1, TLI.getPointerTy())); if (!TLI.isLittleEndian()) std::swap(Lo, Hi); - ExpandScalarCallArgs(EVT, Lo, Flags, Ops, DAG, TLI); - ExpandScalarCallArgs(EVT, Hi, Flags, Ops, DAG, TLI); + ExpandScalarCallArgs(EVT, Lo, Flags, Ops, DAG, TLI, isFirst); + ExpandScalarCallArgs(EVT, Hi, Flags, Ops, DAG, TLI, false); } else { // Value scalarized into many values. Unimp for now. assert(0 && "Cannot expand i64 -> i16 yet!"); @@ -3106,11 +3118,19 @@ SDOperand Op = Args[i].Node; bool isSigned = Args[i].isSigned; bool isInReg = Args[i].isInReg; - bool isSRet = Args[i].isSRet; - unsigned Flags = (isSRet << 2) | (isInReg << 1) | isSigned; + bool isSRet = Args[i].isSRet; + unsigned OriginalAlignment = + getTargetData()->getTypeAlignmentABI(Args[i].Ty); + //Flags[31:27]-> OriginalAlignment + //Flags[2] -> isSRet + //Flags[1] -> isInReg + //Flags[0] -> isSigned + unsigned Flags = (isSRet << 2) | (isInReg << 1) | isSigned | + (OriginalAlignment << 27); + switch (getTypeAction(VT)) { default: assert(0 && "Unknown type action!"); - case Legal: + case Legal: Ops.push_back(Op); Ops.push_back(DAG.getConstant(Flags, MVT::i32)); break; From lauro.venancio at gmail.com Tue Feb 13 08:07:30 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 08:07:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp ARMTargetMachine.cpp Message-ID: <200702131407.l1DE7Tm8027368@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.13 -> 1.14 ARMTargetMachine.cpp updated: 1.20 -> 1.21 --- Log message: According to ARM EABI, 8-bytes function arguments must be 8-bytes aligned. --- Diffs of the changes: (+53 -30) ARMISelLowering.cpp | 79 ++++++++++++++++++++++++++++++++------------------- ARMTargetMachine.cpp | 4 +- 2 files changed, 53 insertions(+), 30 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.14 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 Sat Feb 3 02:53:01 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Tue Feb 13 08:07:13 2007 @@ -338,29 +338,36 @@ } static void -HowToPassArgument(MVT::ValueType ObjectVT, - unsigned NumGPRs, unsigned &ObjSize, unsigned &ObjGPRs) { - ObjSize = 0; - ObjGPRs = 0; - +HowToPassArgument(MVT::ValueType ObjectVT, unsigned NumGPRs, + unsigned StackOffset, unsigned &NeededGPRs, + unsigned &NeededStackSize, unsigned &GPRPad, + unsigned &StackPad, unsigned Flags) { + NeededStackSize = 0; + NeededGPRs = 0; + StackPad = 0; + GPRPad = 0; + unsigned align = (Flags >> 27); + GPRPad = NumGPRs % ((align + 3)/4); + StackPad = StackOffset % align; + unsigned firstGPR = NumGPRs + GPRPad; switch (ObjectVT) { default: assert(0 && "Unhandled argument type!"); case MVT::i32: case MVT::f32: - if (NumGPRs < 4) - ObjGPRs = 1; + if (firstGPR < 4) + NeededGPRs = 1; else - ObjSize = 4; + NeededStackSize = 4; break; case MVT::i64: case MVT::f64: - if (NumGPRs < 3) - ObjGPRs = 2; - else if (NumGPRs == 3) { - ObjGPRs = 1; - ObjSize = 4; + if (firstGPR < 3) + NeededGPRs = 2; + else if (firstGPR == 3) { + NeededGPRs = 1; + NeededStackSize = 4; } else - ObjSize = 8; + NeededStackSize = 8; } } @@ -383,12 +390,16 @@ // Add up all the space actually used. for (unsigned i = 0; i < NumOps; ++i) { - unsigned ObjSize = 0; - unsigned ObjGPRs = 0; + unsigned ObjSize; + unsigned ObjGPRs; + unsigned StackPad; + unsigned GPRPad; MVT::ValueType ObjectVT = Op.getOperand(5+2*i).getValueType(); - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); - NumBytes += ObjSize; - NumGPRs += ObjGPRs; + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); + HowToPassArgument(ObjectVT, NumGPRs, NumBytes, ObjGPRs, ObjSize, + GPRPad, StackPad, Flags); + NumBytes += ObjSize + StackPad; + NumGPRs += ObjGPRs + GPRPad; } // Adjust the stack pointer for the new arguments... @@ -407,18 +418,24 @@ std::vector MemOpChains; for (unsigned i = 0; i != NumOps; ++i) { SDOperand Arg = Op.getOperand(5+2*i); + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); MVT::ValueType ArgVT = Arg.getValueType(); - unsigned ObjSize = 0; - unsigned ObjGPRs = 0; - HowToPassArgument(ArgVT, NumGPRs, ObjSize, ObjGPRs); + unsigned ObjSize; + unsigned ObjGPRs; + unsigned GPRPad; + unsigned StackPad; + HowToPassArgument(ArgVT, NumGPRs, ArgOffset, ObjGPRs, + ObjSize, GPRPad, StackPad, Flags); + NumGPRs += GPRPad; + ArgOffset += StackPad; if (ObjGPRs > 0) { switch (ArgVT) { default: assert(0 && "Unexpected ValueType for argument!"); case MVT::i32: RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], Arg)); break; - case MVT::f32: + case MVT::f32: RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], DAG.getNode(ISD::BIT_CONVERT, MVT::i32, Arg))); break; @@ -436,7 +453,7 @@ MemOpChains.push_back(DAG.getStore(Chain, Hi, PtrOff, NULL, 0)); } break; - } + } case MVT::f64: { SDOperand Cvt = DAG.getNode(ARMISD::FMRRD, DAG.getVTList(MVT::i32, MVT::i32), @@ -715,7 +732,7 @@ } static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG &DAG, - unsigned *vRegs, unsigned ArgNo, + unsigned *vRegs, unsigned ArgNo, unsigned &NumGPRs, unsigned &ArgOffset) { MachineFunction &MF = DAG.getMachineFunction(); MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType(); @@ -727,9 +744,15 @@ ARM::R0, ARM::R1, ARM::R2, ARM::R3 }; - unsigned ObjSize = 0; - unsigned ObjGPRs = 0; - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); + unsigned ObjSize; + unsigned ObjGPRs; + unsigned GPRPad; + unsigned StackPad; + unsigned Flags = Op.getConstantOperandVal(ArgNo + 3); + HowToPassArgument(ObjectVT, NumGPRs, ArgOffset, ObjGPRs, + ObjSize, GPRPad, StackPad, Flags); + NumGPRs += GPRPad; + ArgOffset += StackPad; SDOperand ArgValue; if (ObjGPRs == 1) { Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.21 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 Wed Jan 31 20:18:36 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 08:07:13 2007 @@ -39,8 +39,8 @@ std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32-A:32") : std::string("e-p:32:32-d:32:32-l:32:32")) : (Subtarget.isThumb() ? - std::string("e-p:32:32-d:32:64-l:32:64-s:16:32-b:8:32-B:8:32-A:32") : - std::string("e-p:32:32-d:32:64-l:32:64"))), + std::string("e-p:32:32-d:32:64-l:64:64-s:16:32-b:8:32-B:8:32-A:32") : + std::string("e-p:32:32-d:32:64-l:64:64"))), InstrInfo(Subtarget), FrameInfo(Subtarget) {} From lauro.venancio at gmail.com Tue Feb 13 08:07:32 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 08:07:32 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/arguments.ll Message-ID: <200702131407.l1DE7Wtd027375@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: arguments.ll added (r1.1) --- Log message: According to ARM EABI, 8-bytes function arguments must be 8-bytes aligned. --- Diffs of the changes: (+10 -0) arguments.ll | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/test/CodeGen/ARM/arguments.ll diff -c /dev/null llvm/test/CodeGen/ARM/arguments.ll:1.1 *** /dev/null Tue Feb 13 08:07:23 2007 --- llvm/test/CodeGen/ARM/arguments.ll Tue Feb 13 08:07:13 2007 *************** *** 0 **** --- 1,10 ---- + ; RUN: llvm-as < %s | llc -march=arm && + ; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep "mov r0, r2" | wc -l | grep 1 && + ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep "mov r0, r1" | wc -l | grep 1 + + define i32 @f(i32 %a, i64 %b) { + %tmp = call i32 @g(i64 %b) + ret i32 %tmp + } + + declare i32 @g(i64) \ No newline at end of file From djg at cray.com Tue Feb 13 09:40:53 2007 From: djg at cray.com (Dan Gohman) Date: Tue, 13 Feb 2007 09:40:53 -0600 Subject: [llvm-commits] fix cases of assert("foo") Message-ID: <20070213154051.GX26946@gold.us.cray.com> While preparing http://llvm.org/PR1198 I noticed several asserts protecting unprepared code from i128 types that weren't actually failing when they should because they were written as assert("foo") instead of something like assert(0 && "foo"). This patch fixes all the cases that a quick grep found. Dan -- Dan Gohman, Cray Inc. -------------- next part -------------- Index: lib/Bytecode/Reader/Reader.cpp =================================================================== RCS file: /var/cvs/llvm/llvm/lib/Bytecode/Reader/Reader.cpp,v retrieving revision 1.238 diff -u -r1.238 Reader.cpp --- lib/Bytecode/Reader/Reader.cpp +++ lib/Bytecode/Reader/Reader.cpp @@ -1265,7 +1265,7 @@ Result = ConstantInt::get(IT, Val); if (Handler) Handler->handleConstantValue(Result); } else - assert("Integer types > 64 bits not supported"); + assert(0 && "Integer types > 64 bits not supported"); break; } case Type::FloatTyID: { Index: lib/Bytecode/Writer/Writer.cpp =================================================================== RCS file: /var/cvs/llvm/llvm/lib/Bytecode/Writer/Writer.cpp,v retrieving revision 1.166 diff -u -r1.166 Writer.cpp --- lib/Bytecode/Writer/Writer.cpp +++ lib/Bytecode/Writer/Writer.cpp @@ -313,7 +313,7 @@ else if (NumBits <= 64) output_vbr(uint64_t(cast(CPV)->getZExtValue())); else - assert("Integer types > 64 bits not supported."); + assert(0 && "Integer types > 64 bits not supported."); break; } Index: lib/ExecutionEngine/ExecutionEngine.cpp =================================================================== RCS file: /var/cvs/llvm/llvm/lib/ExecutionEngine/ExecutionEngine.cpp,v retrieving revision 1.105 diff -u -r1.105 ExecutionEngine.cpp --- lib/ExecutionEngine/ExecutionEngine.cpp +++ lib/ExecutionEngine/ExecutionEngine.cpp @@ -292,7 +292,7 @@ const_cast(dyn_cast(GV))) EmitGlobalVariable(GVar); else - assert("Global hasn't had an address allocated yet!"); + assert(0 && "Global hasn't had an address allocated yet!"); return state.getGlobalAddressMap(locked)[GV]; } @@ -425,7 +425,7 @@ else if (BitWidth <= 64) Result.Int64Val = (uint64_t )cast(C)->getZExtValue(); else - assert("Integers with > 64-bits not implemented"); + assert(0 && "Integers with > 64-bits not implemented"); break; } Index: lib/ExecutionEngine/Interpreter/Execution.cpp =================================================================== RCS file: /var/cvs/llvm/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp,v retrieving revision 1.169 diff -u -r1.169 Execution.cpp --- lib/ExecutionEngine/Interpreter/Execution.cpp +++ lib/ExecutionEngine/Interpreter/Execution.cpp @@ -1690,7 +1690,7 @@ else if (BitWidth <= 64) Dest.Int64Val = Src.Int64Val; else - assert("Integer types > 64 bits not supported"); + assert(0 && "Integer types > 64 bits not supported"); maskToBitWidth(Dest, BitWidth); } IMPLEMENT_VAARG(Pointer); From reid at x10sys.com Tue Feb 13 11:04:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 11:04:25 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702131704.l1DH4Pli007742@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.4 -> 1.5 --- Log message: Fix tow grammaros that Bill Wendling noticed. --- Diffs of the changes: (+3 -3) DeveloperPolicy.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.4 llvm/docs/DeveloperPolicy.html:1.5 --- llvm/docs/DeveloperPolicy.html:1.4 Tue Feb 13 03:20:14 2007 +++ llvm/docs/DeveloperPolicy.html Tue Feb 13 11:04:09 2007 @@ -47,7 +47,7 @@

    This document contains the LLVM Developer Policy which defines the - project's policy towards developer's and their contributions. The intent of + project's policy towards developers and their contributions. The intent of this policy is to eliminate mis-communication, rework, and confusion that might arise from the distributed nature of LLVM's development. By stating the policy in clear terms, we hope each developer can know ahead of time @@ -146,7 +146,7 @@

    -

    With regards to the LLVM copyright and licensing, developer's agree to:

    +

    With regards to the LLVM copyright and licensing, developers agree to:

    • give up their copy rights to any contribution made so that the entire software base can be managed by a single copyright holder.
    • @@ -430,7 +430,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> Written By: LLVM Oversight Group
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2007/02/13 09:20:14 $ + Last modified: $Date: 2007/02/13 17:04:09 $ From evan.cheng at apple.com Tue Feb 13 11:20:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 Feb 2007 09:20:41 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp ARMTargetMachine.cpp In-Reply-To: <200702131407.l1DE7Tm8027368@zion.cs.uiuc.edu> References: <200702131407.l1DE7Tm8027368@zion.cs.uiuc.edu> Message-ID: Hi Lauro, This is wrong for Mac OS X. Please back out the patch until it is fixed. Make sure you conditionalize base on the ABI of choice Please add an ABI enum ABIType to ARMSubtarget.h and the corresponding methods. Looking at llvm-gcc/gcc/config/arm/arm.h, I see there are 5 ARM abi's: ARM_ABI_APCS, ARM_ABI_ATPCS, ARM_ABI_AAPCS, ARM_ABI_IWMMXT, ARM_ABI_AAPCS_LINUX The default is ARM_ABI_APCS, I suppose ARM EABI is ARM_ABI_AAPCS_LINUX? Thanks, Evan On Feb 13, 2007, at 6:07 AM, Lauro Ramos Venancio wrote: > > > Changes in directory llvm/lib/Target/ARM: > > ARMISelLowering.cpp updated: 1.13 -> 1.14 > ARMTargetMachine.cpp updated: 1.20 -> 1.21 > --- > Log message: > > According to ARM EABI, 8-bytes function arguments must be 8-bytes > aligned. > > > --- > Diffs of the changes: (+53 -30) > > ARMISelLowering.cpp | 79 +++++++++++++++++++++++++++++++ > +------------------- > ARMTargetMachine.cpp | 4 +- > 2 files changed, 53 insertions(+), 30 deletions(-) > > > Index: llvm/lib/Target/ARM/ARMISelLowering.cpp > diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 llvm/lib/ > Target/ARM/ARMISelLowering.cpp:1.14 > --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 Sat Feb 3 > 02:53:01 2007 > +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Tue Feb 13 08:07:13 2007 > @@ -338,29 +338,36 @@ > } > > static void > -HowToPassArgument(MVT::ValueType ObjectVT, > - unsigned NumGPRs, unsigned &ObjSize, unsigned > &ObjGPRs) { > - ObjSize = 0; > - ObjGPRs = 0; > - > +HowToPassArgument(MVT::ValueType ObjectVT, unsigned NumGPRs, > + unsigned StackOffset, unsigned &NeededGPRs, > + unsigned &NeededStackSize, unsigned &GPRPad, > + unsigned &StackPad, unsigned Flags) { > + NeededStackSize = 0; > + NeededGPRs = 0; > + StackPad = 0; > + GPRPad = 0; > + unsigned align = (Flags >> 27); > + GPRPad = NumGPRs % ((align + 3)/4); > + StackPad = StackOffset % align; > + unsigned firstGPR = NumGPRs + GPRPad; > switch (ObjectVT) { > default: assert(0 && "Unhandled argument type!"); > case MVT::i32: > case MVT::f32: > - if (NumGPRs < 4) > - ObjGPRs = 1; > + if (firstGPR < 4) > + NeededGPRs = 1; > else > - ObjSize = 4; > + NeededStackSize = 4; > break; > case MVT::i64: > case MVT::f64: > - if (NumGPRs < 3) > - ObjGPRs = 2; > - else if (NumGPRs == 3) { > - ObjGPRs = 1; > - ObjSize = 4; > + if (firstGPR < 3) > + NeededGPRs = 2; > + else if (firstGPR == 3) { > + NeededGPRs = 1; > + NeededStackSize = 4; > } else > - ObjSize = 8; > + NeededStackSize = 8; > } > } > > @@ -383,12 +390,16 @@ > > // Add up all the space actually used. > for (unsigned i = 0; i < NumOps; ++i) { > - unsigned ObjSize = 0; > - unsigned ObjGPRs = 0; > + unsigned ObjSize; > + unsigned ObjGPRs; > + unsigned StackPad; > + unsigned GPRPad; > MVT::ValueType ObjectVT = Op.getOperand(5+2*i).getValueType(); > - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); > - NumBytes += ObjSize; > - NumGPRs += ObjGPRs; > + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); > + HowToPassArgument(ObjectVT, NumGPRs, NumBytes, ObjGPRs, ObjSize, > + GPRPad, StackPad, Flags); > + NumBytes += ObjSize + StackPad; > + NumGPRs += ObjGPRs + GPRPad; > } > > // Adjust the stack pointer for the new arguments... > @@ -407,18 +418,24 @@ > std::vector MemOpChains; > for (unsigned i = 0; i != NumOps; ++i) { > SDOperand Arg = Op.getOperand(5+2*i); > + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); > MVT::ValueType ArgVT = Arg.getValueType(); > > - unsigned ObjSize = 0; > - unsigned ObjGPRs = 0; > - HowToPassArgument(ArgVT, NumGPRs, ObjSize, ObjGPRs); > + unsigned ObjSize; > + unsigned ObjGPRs; > + unsigned GPRPad; > + unsigned StackPad; > + HowToPassArgument(ArgVT, NumGPRs, ArgOffset, ObjGPRs, > + ObjSize, GPRPad, StackPad, Flags); > + NumGPRs += GPRPad; > + ArgOffset += StackPad; > if (ObjGPRs > 0) { > switch (ArgVT) { > default: assert(0 && "Unexpected ValueType for argument!"); > case MVT::i32: > RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], > Arg)); > break; > - case MVT::f32: > + case MVT::f32: > RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], > DAG.getNode(ISD::BIT_CONVERT, > MVT::i32, Arg))); > break; > @@ -436,7 +453,7 @@ > MemOpChains.push_back(DAG.getStore(Chain, Hi, PtrOff, > NULL, 0)); > } > break; > - } > + } > case MVT::f64: { > SDOperand Cvt = DAG.getNode(ARMISD::FMRRD, > DAG.getVTList(MVT::i32, > MVT::i32), > @@ -715,7 +732,7 @@ > } > > static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG > &DAG, > - unsigned *vRegs, unsigned ArgNo, > + unsigned *vRegs, unsigned > ArgNo, > unsigned &NumGPRs, unsigned > &ArgOffset) { > MachineFunction &MF = DAG.getMachineFunction(); > MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType(); > @@ -727,9 +744,15 @@ > ARM::R0, ARM::R1, ARM::R2, ARM::R3 > }; > > - unsigned ObjSize = 0; > - unsigned ObjGPRs = 0; > - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); > + unsigned ObjSize; > + unsigned ObjGPRs; > + unsigned GPRPad; > + unsigned StackPad; > + unsigned Flags = Op.getConstantOperandVal(ArgNo + 3); > + HowToPassArgument(ObjectVT, NumGPRs, ArgOffset, ObjGPRs, > + ObjSize, GPRPad, StackPad, Flags); > + NumGPRs += GPRPad; > + ArgOffset += StackPad; > > SDOperand ArgValue; > if (ObjGPRs == 1) { > > > Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp > diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 llvm/lib/ > Target/ARM/ARMTargetMachine.cpp:1.21 > --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 Wed Jan 31 > 20:18:36 2007 > +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 08:07:13 2007 > @@ -39,8 +39,8 @@ > std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B: > 8:32-A:32") : > std::string("e-p:32:32-d:32:32-l:32:32")) : > (Subtarget.isThumb() ? > - std::string("e-p:32:32-d:32:64-l:32:64-s:16:32-b:8:32-B: > 8:32-A:32") : > - std::string("e-p:32:32-d:32:64-l:32:64"))), > + std::string("e-p:32:32-d:32:64-l:64:64-s:16:32-b:8:32-B: > 8:32-A:32") : > + std::string("e-p:32:32-d:32:64-l:64:64"))), > InstrInfo(Subtarget), > FrameInfo(Subtarget) {} > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From lauro.venancio at gmail.com Tue Feb 13 11:33:11 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 14:33:11 -0300 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp ARMTargetMachine.cpp In-Reply-To: References: <200702131407.l1DE7Tm8027368@zion.cs.uiuc.edu> Message-ID: <9c10c9f0702130933l5850c293md23b3f5f4da99a97@mail.gmail.com> Hi Evan, I change function arguments alignment only for ELF. The code generated for mtriple=arm-apple-darwin remains the same. For now, I am implementing only ARM EABI. I don't have testing environment for others ABIs. Did you found any miscompilation caused by this patch? Lauro 2007/2/13, Evan Cheng : > Hi Lauro, > > This is wrong for Mac OS X. Please back out the patch until it is > fixed. Make sure you conditionalize base on the ABI of choice > > Please add an ABI enum ABIType to ARMSubtarget.h and the > corresponding methods. Looking at llvm-gcc/gcc/config/arm/arm.h, I > see there are 5 ARM abi's: > > ARM_ABI_APCS, > ARM_ABI_ATPCS, > ARM_ABI_AAPCS, > ARM_ABI_IWMMXT, > ARM_ABI_AAPCS_LINUX > > The default is ARM_ABI_APCS, I suppose ARM EABI is ARM_ABI_AAPCS_LINUX? > > Thanks, > > Evan > > On Feb 13, 2007, at 6:07 AM, Lauro Ramos Venancio wrote: > > > > > > > Changes in directory llvm/lib/Target/ARM: > > > > ARMISelLowering.cpp updated: 1.13 -> 1.14 > > ARMTargetMachine.cpp updated: 1.20 -> 1.21 > > --- > > Log message: > > > > According to ARM EABI, 8-bytes function arguments must be 8-bytes > > aligned. > > > > > > --- > > Diffs of the changes: (+53 -30) > > > > ARMISelLowering.cpp | 79 +++++++++++++++++++++++++++++++ > > +------------------- > > ARMTargetMachine.cpp | 4 +- > > 2 files changed, 53 insertions(+), 30 deletions(-) > > > > > > Index: llvm/lib/Target/ARM/ARMISelLowering.cpp > > diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 llvm/lib/ > > Target/ARM/ARMISelLowering.cpp:1.14 > > --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 Sat Feb 3 > > 02:53:01 2007 > > +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Tue Feb 13 08:07:13 2007 > > @@ -338,29 +338,36 @@ > > } > > > > static void > > -HowToPassArgument(MVT::ValueType ObjectVT, > > - unsigned NumGPRs, unsigned &ObjSize, unsigned > > &ObjGPRs) { > > - ObjSize = 0; > > - ObjGPRs = 0; > > - > > +HowToPassArgument(MVT::ValueType ObjectVT, unsigned NumGPRs, > > + unsigned StackOffset, unsigned &NeededGPRs, > > + unsigned &NeededStackSize, unsigned &GPRPad, > > + unsigned &StackPad, unsigned Flags) { > > + NeededStackSize = 0; > > + NeededGPRs = 0; > > + StackPad = 0; > > + GPRPad = 0; > > + unsigned align = (Flags >> 27); > > + GPRPad = NumGPRs % ((align + 3)/4); > > + StackPad = StackOffset % align; > > + unsigned firstGPR = NumGPRs + GPRPad; > > switch (ObjectVT) { > > default: assert(0 && "Unhandled argument type!"); > > case MVT::i32: > > case MVT::f32: > > - if (NumGPRs < 4) > > - ObjGPRs = 1; > > + if (firstGPR < 4) > > + NeededGPRs = 1; > > else > > - ObjSize = 4; > > + NeededStackSize = 4; > > break; > > case MVT::i64: > > case MVT::f64: > > - if (NumGPRs < 3) > > - ObjGPRs = 2; > > - else if (NumGPRs == 3) { > > - ObjGPRs = 1; > > - ObjSize = 4; > > + if (firstGPR < 3) > > + NeededGPRs = 2; > > + else if (firstGPR == 3) { > > + NeededGPRs = 1; > > + NeededStackSize = 4; > > } else > > - ObjSize = 8; > > + NeededStackSize = 8; > > } > > } > > > > @@ -383,12 +390,16 @@ > > > > // Add up all the space actually used. > > for (unsigned i = 0; i < NumOps; ++i) { > > - unsigned ObjSize = 0; > > - unsigned ObjGPRs = 0; > > + unsigned ObjSize; > > + unsigned ObjGPRs; > > + unsigned StackPad; > > + unsigned GPRPad; > > MVT::ValueType ObjectVT = Op.getOperand(5+2*i).getValueType(); > > - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); > > - NumBytes += ObjSize; > > - NumGPRs += ObjGPRs; > > + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); > > + HowToPassArgument(ObjectVT, NumGPRs, NumBytes, ObjGPRs, ObjSize, > > + GPRPad, StackPad, Flags); > > + NumBytes += ObjSize + StackPad; > > + NumGPRs += ObjGPRs + GPRPad; > > } > > > > // Adjust the stack pointer for the new arguments... > > @@ -407,18 +418,24 @@ > > std::vector MemOpChains; > > for (unsigned i = 0; i != NumOps; ++i) { > > SDOperand Arg = Op.getOperand(5+2*i); > > + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); > > MVT::ValueType ArgVT = Arg.getValueType(); > > > > - unsigned ObjSize = 0; > > - unsigned ObjGPRs = 0; > > - HowToPassArgument(ArgVT, NumGPRs, ObjSize, ObjGPRs); > > + unsigned ObjSize; > > + unsigned ObjGPRs; > > + unsigned GPRPad; > > + unsigned StackPad; > > + HowToPassArgument(ArgVT, NumGPRs, ArgOffset, ObjGPRs, > > + ObjSize, GPRPad, StackPad, Flags); > > + NumGPRs += GPRPad; > > + ArgOffset += StackPad; > > if (ObjGPRs > 0) { > > switch (ArgVT) { > > default: assert(0 && "Unexpected ValueType for argument!"); > > case MVT::i32: > > RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], > > Arg)); > > break; > > - case MVT::f32: > > + case MVT::f32: > > RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], > > DAG.getNode(ISD::BIT_CONVERT, > > MVT::i32, Arg))); > > break; > > @@ -436,7 +453,7 @@ > > MemOpChains.push_back(DAG.getStore(Chain, Hi, PtrOff, > > NULL, 0)); > > } > > break; > > - } > > + } > > case MVT::f64: { > > SDOperand Cvt = DAG.getNode(ARMISD::FMRRD, > > DAG.getVTList(MVT::i32, > > MVT::i32), > > @@ -715,7 +732,7 @@ > > } > > > > static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG > > &DAG, > > - unsigned *vRegs, unsigned ArgNo, > > + unsigned *vRegs, unsigned > > ArgNo, > > unsigned &NumGPRs, unsigned > > &ArgOffset) { > > MachineFunction &MF = DAG.getMachineFunction(); > > MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType(); > > @@ -727,9 +744,15 @@ > > ARM::R0, ARM::R1, ARM::R2, ARM::R3 > > }; > > > > - unsigned ObjSize = 0; > > - unsigned ObjGPRs = 0; > > - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); > > + unsigned ObjSize; > > + unsigned ObjGPRs; > > + unsigned GPRPad; > > + unsigned StackPad; > > + unsigned Flags = Op.getConstantOperandVal(ArgNo + 3); > > + HowToPassArgument(ObjectVT, NumGPRs, ArgOffset, ObjGPRs, > > + ObjSize, GPRPad, StackPad, Flags); > > + NumGPRs += GPRPad; > > + ArgOffset += StackPad; > > > > SDOperand ArgValue; > > if (ObjGPRs == 1) { > > > > > > Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp > > diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 llvm/lib/ > > Target/ARM/ARMTargetMachine.cpp:1.21 > > --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 Wed Jan 31 > > 20:18:36 2007 > > +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 08:07:13 2007 > > @@ -39,8 +39,8 @@ > > std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B: > > 8:32-A:32") : > > std::string("e-p:32:32-d:32:32-l:32:32")) : > > (Subtarget.isThumb() ? > > - std::string("e-p:32:32-d:32:64-l:32:64-s:16:32-b:8:32-B: > > 8:32-A:32") : > > - std::string("e-p:32:32-d:32:64-l:32:64"))), > > + std::string("e-p:32:32-d:32:64-l:64:64-s:16:32-b:8:32-B: > > 8:32-A:32") : > > + std::string("e-p:32:32-d:32:64-l:64:64"))), > > InstrInfo(Subtarget), > > FrameInfo(Subtarget) {} > > > > > > > > > > _______________________________________________ > > llvm-commits mailing list > > llvm-commits at cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > From evan.cheng at apple.com Tue Feb 13 11:35:38 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 Feb 2007 09:35:38 -0800 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp In-Reply-To: <200702131350.l1DDoOCZ027008@zion.cs.uiuc.edu> References: <200702131350.l1DDoOCZ027008@zion.cs.uiuc.edu> Message-ID: <796C6F51-EF30-40DA-BC25-75BF1CB85425@apple.com> On Feb 13, 2007, at 5:50 AM, Lauro Ramos Venancio wrote: > > > Changes in directory llvm/lib/CodeGen/SelectionDAG: > > SelectionDAGISel.cpp updated: 1.361 -> 1.362 > --- > Log message: > > Add "original alignment" to function arguments flags. > > > --- > Diffs of the changes: (+30 -10) > > SelectionDAGISel.cpp | 40 ++++++++++++++++++++++++++++++---------- > 1 files changed, 30 insertions(+), 10 deletions(-) > > > Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp > diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.361 > llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.362 > --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.361 Mon > Feb 12 19:05:56 2007 > +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Feb 13 > 07:50:08 2007 > @@ -2933,8 +2933,13 @@ > MVT::ValueType VT = getValueType(I->getType()); > bool isInReg = FTy->paramHasAttr(j, > FunctionType::InRegAttribute); > bool isSRet = FTy->paramHasAttr(j, > FunctionType::StructRetAttribute); > - unsigned Flags = (isInReg << 1) | (isSRet << 2); > - > + unsigned OriginalAlignment = > + getTargetData()->getTypeAlignmentABI(I->getType()); > + //Flags[31:27]-> OriginalAlignment > + //Flags[2] -> isSRet > + //Flags[1] -> isInReg > + unsigned Flags = (isInReg << 1) | (isSRet << 2) | > (OriginalAlignment << 27); > + Some comments: 1. Why 27 - 31 instead of 3 - 6? Please add comment to SelectionDAGNodes.h (see CALL). 2. Purely a stylistic nitpick. Please add a space between // and the actual comment. Thanks, Evan > switch (getTypeAction(VT)) { > default: assert(0 && "Unknown type action!"); > case Legal: > @@ -2954,6 +2959,8 @@ > unsigned NumVals = getNumElements(VT); > for (unsigned i = 0; i != NumVals; ++i) { > RetVals.push_back(NVT); > + //if it isn't first piece, alignment must be 1 > + if (i == 1) Flags = (Flags & 0x07ffffff) | (1 << 27); > Ops.push_back(DAG.getConstant(Flags, MVT::i32)); > } > } else { > @@ -3053,11 +3060,16 @@ > /// ExpandScalarCallArgs - Recursively expand call argument node by > /// bit_converting it or extract a pair of elements from the > larger node. > static void ExpandScalarCallArgs(MVT::ValueType VT, SDOperand Arg, > - unsigned Flags, > + unsigned Flags, > SmallVector &Ops, > SelectionDAG &DAG, > - TargetLowering &TLI) { > + TargetLowering &TLI, > + bool isFirst = true) { > + > if (TLI.getTypeAction(VT) != TargetLowering::Expand) { > + //if it isn't first piece, alignment must be 1 > + if (!isFirst) > + Flags = (Flags & 0x07ffffff) | (1 << 27); > Ops.push_back(Arg); > Ops.push_back(DAG.getConstant(Flags, MVT::i32)); > return; > @@ -3067,7 +3079,7 @@ > unsigned NumVals = MVT::getSizeInBits(VT) / MVT::getSizeInBits > (EVT); > if (NumVals == 1) { > Arg = DAG.getNode(ISD::BIT_CONVERT, EVT, Arg); > - ExpandScalarCallArgs(EVT, Arg, Flags, Ops, DAG, TLI); > + ExpandScalarCallArgs(EVT, Arg, Flags, Ops, DAG, TLI, isFirst); > } else if (NumVals == 2) { > SDOperand Lo = DAG.getNode(ISD::EXTRACT_ELEMENT, EVT, Arg, > DAG.getConstant(0, TLI.getPointerTy > ())); > @@ -3075,8 +3087,8 @@ > DAG.getConstant(1, TLI.getPointerTy > ())); > if (!TLI.isLittleEndian()) > std::swap(Lo, Hi); > - ExpandScalarCallArgs(EVT, Lo, Flags, Ops, DAG, TLI); > - ExpandScalarCallArgs(EVT, Hi, Flags, Ops, DAG, TLI); > + ExpandScalarCallArgs(EVT, Lo, Flags, Ops, DAG, TLI, isFirst); > + ExpandScalarCallArgs(EVT, Hi, Flags, Ops, DAG, TLI, false); > } else { > // Value scalarized into many values. Unimp for now. > assert(0 && "Cannot expand i64 -> i16 yet!"); > @@ -3106,11 +3118,19 @@ > SDOperand Op = Args[i].Node; > bool isSigned = Args[i].isSigned; > bool isInReg = Args[i].isInReg; > - bool isSRet = Args[i].isSRet; > - unsigned Flags = (isSRet << 2) | (isInReg << 1) | isSigned; > + bool isSRet = Args[i].isSRet; > + unsigned OriginalAlignment = > + getTargetData()->getTypeAlignmentABI(Args[i].Ty); > + //Flags[31:27]-> OriginalAlignment > + //Flags[2] -> isSRet > + //Flags[1] -> isInReg > + //Flags[0] -> isSigned > + unsigned Flags = (isSRet << 2) | (isInReg << 1) | isSigned | > + (OriginalAlignment << 27); > + > switch (getTypeAction(VT)) { > default: assert(0 && "Unknown type action!"); > - case Legal: > + case Legal: > Ops.push_back(Op); > Ops.push_back(DAG.getConstant(Flags, MVT::i32)); > break; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From evan.cheng at apple.com Tue Feb 13 11:42:27 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 13 Feb 2007 09:42:27 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp ARMTargetMachine.cpp In-Reply-To: <9c10c9f0702130933l5850c293md23b3f5f4da99a97@mail.gmail.com> References: <200702131407.l1DE7Tm8027368@zion.cs.uiuc.edu> <9c10c9f0702130933l5850c293md23b3f5f4da99a97@mail.gmail.com> Message-ID: Ah, I see you have only changed long alignment when target isn't Darwin. My mistake, this will not break Mac OS X / APCS support. What is the default ABI for Linux? Can you experiment with gcc -mabi= to see if this might break other ABI's? Thanks, Evan On Feb 13, 2007, at 9:33 AM, Lauro Ramos Venancio wrote: > Hi Evan, > > I change function arguments alignment only for ELF. The code generated > for mtriple=arm-apple-darwin remains the same. For now, I am > implementing only ARM EABI. I don't have testing environment for > others ABIs. Did you found any miscompilation caused by this patch? > > Lauro > > 2007/2/13, Evan Cheng : >> Hi Lauro, >> >> This is wrong for Mac OS X. Please back out the patch until it is >> fixed. Make sure you conditionalize base on the ABI of choice >> >> Please add an ABI enum ABIType to ARMSubtarget.h and the >> corresponding methods. Looking at llvm-gcc/gcc/config/arm/arm.h, I >> see there are 5 ARM abi's: >> >> ARM_ABI_APCS, >> ARM_ABI_ATPCS, >> ARM_ABI_AAPCS, >> ARM_ABI_IWMMXT, >> ARM_ABI_AAPCS_LINUX >> >> The default is ARM_ABI_APCS, I suppose ARM EABI is >> ARM_ABI_AAPCS_LINUX? >> >> Thanks, >> >> Evan >> >> On Feb 13, 2007, at 6:07 AM, Lauro Ramos Venancio wrote: >> >> > >> > >> > Changes in directory llvm/lib/Target/ARM: >> > >> > ARMISelLowering.cpp updated: 1.13 -> 1.14 >> > ARMTargetMachine.cpp updated: 1.20 -> 1.21 >> > --- >> > Log message: >> > >> > According to ARM EABI, 8-bytes function arguments must be 8-bytes >> > aligned. >> > >> > >> > --- >> > Diffs of the changes: (+53 -30) >> > >> > ARMISelLowering.cpp | 79 +++++++++++++++++++++++++++++++ >> > +------------------- >> > ARMTargetMachine.cpp | 4 +- >> > 2 files changed, 53 insertions(+), 30 deletions(-) >> > >> > >> > Index: llvm/lib/Target/ARM/ARMISelLowering.cpp >> > diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 llvm/lib/ >> > Target/ARM/ARMISelLowering.cpp:1.14 >> > --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.13 Sat Feb 3 >> > 02:53:01 2007 >> > +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Tue Feb 13 >> 08:07:13 2007 >> > @@ -338,29 +338,36 @@ >> > } >> > >> > static void >> > -HowToPassArgument(MVT::ValueType ObjectVT, >> > - unsigned NumGPRs, unsigned &ObjSize, unsigned >> > &ObjGPRs) { >> > - ObjSize = 0; >> > - ObjGPRs = 0; >> > - >> > +HowToPassArgument(MVT::ValueType ObjectVT, unsigned NumGPRs, >> > + unsigned StackOffset, unsigned &NeededGPRs, >> > + unsigned &NeededStackSize, unsigned &GPRPad, >> > + unsigned &StackPad, unsigned Flags) { >> > + NeededStackSize = 0; >> > + NeededGPRs = 0; >> > + StackPad = 0; >> > + GPRPad = 0; >> > + unsigned align = (Flags >> 27); >> > + GPRPad = NumGPRs % ((align + 3)/4); >> > + StackPad = StackOffset % align; >> > + unsigned firstGPR = NumGPRs + GPRPad; >> > switch (ObjectVT) { >> > default: assert(0 && "Unhandled argument type!"); >> > case MVT::i32: >> > case MVT::f32: >> > - if (NumGPRs < 4) >> > - ObjGPRs = 1; >> > + if (firstGPR < 4) >> > + NeededGPRs = 1; >> > else >> > - ObjSize = 4; >> > + NeededStackSize = 4; >> > break; >> > case MVT::i64: >> > case MVT::f64: >> > - if (NumGPRs < 3) >> > - ObjGPRs = 2; >> > - else if (NumGPRs == 3) { >> > - ObjGPRs = 1; >> > - ObjSize = 4; >> > + if (firstGPR < 3) >> > + NeededGPRs = 2; >> > + else if (firstGPR == 3) { >> > + NeededGPRs = 1; >> > + NeededStackSize = 4; >> > } else >> > - ObjSize = 8; >> > + NeededStackSize = 8; >> > } >> > } >> > >> > @@ -383,12 +390,16 @@ >> > >> > // Add up all the space actually used. >> > for (unsigned i = 0; i < NumOps; ++i) { >> > - unsigned ObjSize = 0; >> > - unsigned ObjGPRs = 0; >> > + unsigned ObjSize; >> > + unsigned ObjGPRs; >> > + unsigned StackPad; >> > + unsigned GPRPad; >> > MVT::ValueType ObjectVT = Op.getOperand(5+2*i).getValueType(); >> > - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); >> > - NumBytes += ObjSize; >> > - NumGPRs += ObjGPRs; >> > + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); >> > + HowToPassArgument(ObjectVT, NumGPRs, NumBytes, ObjGPRs, >> ObjSize, >> > + GPRPad, StackPad, Flags); >> > + NumBytes += ObjSize + StackPad; >> > + NumGPRs += ObjGPRs + GPRPad; >> > } >> > >> > // Adjust the stack pointer for the new arguments... >> > @@ -407,18 +418,24 @@ >> > std::vector MemOpChains; >> > for (unsigned i = 0; i != NumOps; ++i) { >> > SDOperand Arg = Op.getOperand(5+2*i); >> > + unsigned Flags = Op.getConstantOperandVal(5+2*i+1); >> > MVT::ValueType ArgVT = Arg.getValueType(); >> > >> > - unsigned ObjSize = 0; >> > - unsigned ObjGPRs = 0; >> > - HowToPassArgument(ArgVT, NumGPRs, ObjSize, ObjGPRs); >> > + unsigned ObjSize; >> > + unsigned ObjGPRs; >> > + unsigned GPRPad; >> > + unsigned StackPad; >> > + HowToPassArgument(ArgVT, NumGPRs, ArgOffset, ObjGPRs, >> > + ObjSize, GPRPad, StackPad, Flags); >> > + NumGPRs += GPRPad; >> > + ArgOffset += StackPad; >> > if (ObjGPRs > 0) { >> > switch (ArgVT) { >> > default: assert(0 && "Unexpected ValueType for argument!"); >> > case MVT::i32: >> > RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], >> > Arg)); >> > break; >> > - case MVT::f32: >> > + case MVT::f32: >> > RegsToPass.push_back(std::make_pair(GPRArgRegs[NumGPRs], >> > DAG.getNode(ISD::BIT_CONVERT, >> > MVT::i32, Arg))); >> > break; >> > @@ -436,7 +453,7 @@ >> > MemOpChains.push_back(DAG.getStore(Chain, Hi, PtrOff, >> > NULL, 0)); >> > } >> > break; >> > - } >> > + } >> > case MVT::f64: { >> > SDOperand Cvt = DAG.getNode(ARMISD::FMRRD, >> > DAG.getVTList(MVT::i32, >> > MVT::i32), >> > @@ -715,7 +732,7 @@ >> > } >> > >> > static SDOperand LowerFORMAL_ARGUMENT(SDOperand Op, SelectionDAG >> > &DAG, >> > - unsigned *vRegs, unsigned >> ArgNo, >> > + unsigned *vRegs, unsigned >> > ArgNo, >> > unsigned &NumGPRs, unsigned >> > &ArgOffset) { >> > MachineFunction &MF = DAG.getMachineFunction(); >> > MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType(); >> > @@ -727,9 +744,15 @@ >> > ARM::R0, ARM::R1, ARM::R2, ARM::R3 >> > }; >> > >> > - unsigned ObjSize = 0; >> > - unsigned ObjGPRs = 0; >> > - HowToPassArgument(ObjectVT, NumGPRs, ObjSize, ObjGPRs); >> > + unsigned ObjSize; >> > + unsigned ObjGPRs; >> > + unsigned GPRPad; >> > + unsigned StackPad; >> > + unsigned Flags = Op.getConstantOperandVal(ArgNo + 3); >> > + HowToPassArgument(ObjectVT, NumGPRs, ArgOffset, ObjGPRs, >> > + ObjSize, GPRPad, StackPad, Flags); >> > + NumGPRs += GPRPad; >> > + ArgOffset += StackPad; >> > >> > SDOperand ArgValue; >> > if (ObjGPRs == 1) { >> > >> > >> > Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp >> > diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 llvm/lib/ >> > Target/ARM/ARMTargetMachine.cpp:1.21 >> > --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.20 Wed Jan 31 >> > 20:18:36 2007 >> > +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 >> 08:07:13 2007 >> > @@ -39,8 +39,8 @@ >> > std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b: >> 8:32-B: >> > 8:32-A:32") : >> > std::string("e-p:32:32-d:32:32-l:32:32")) : >> > (Subtarget.isThumb() ? >> > - std::string("e-p:32:32-d:32:64-l:32:64-s:16:32-b: >> 8:32-B: >> > 8:32-A:32") : >> > - std::string("e-p:32:32-d:32:64-l:32:64"))), >> > + std::string("e-p:32:32-d:32:64-l:64:64-s:16:32-b: >> 8:32-B: >> > 8:32-A:32") : >> > + std::string("e-p:32:32-d:32:64-l:64:64"))), >> > InstrInfo(Subtarget), >> > FrameInfo(Subtarget) {} >> > >> > >> > >> > >> > _______________________________________________ >> > llvm-commits mailing list >> > llvm-commits at cs.uiuc.edu >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits >> >> From lauro.venancio at gmail.com Tue Feb 13 11:57:55 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 11:57:55 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h Message-ID: <200702131757.l1DHvtxw012617@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAGNodes.h updated: 1.175 -> 1.176 --- Log message: Add comment about original function argument alignment. --- Diffs of the changes: (+2 -0) SelectionDAGNodes.h | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.175 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.176 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.175 Sun Feb 4 02:35:21 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Feb 13 11:57:38 2007 @@ -159,6 +159,8 @@ /// Bit 0 - signness /// Bit 1 - 'inreg' attribute /// Bit 2 - 'sret' attribute + /// Bits 31:27 - argument ABI alignment in the first argument piece and + /// alignment '1' in other argument pieces. CALL, // EXTRACT_ELEMENT - This is used to get the first or second (determined by From lauro.venancio at gmail.com Tue Feb 13 12:10:29 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 12:10:29 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702131810.l1DIATKo013601@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.362 -> 1.363 --- Log message: Add a space between // and the comment. --- Diffs of the changes: (+9 -9) SelectionDAGISel.cpp | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.362 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.363 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.362 Tue Feb 13 07:50:08 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Feb 13 12:10:13 2007 @@ -2935,9 +2935,9 @@ bool isSRet = FTy->paramHasAttr(j, FunctionType::StructRetAttribute); unsigned OriginalAlignment = getTargetData()->getTypeAlignmentABI(I->getType()); - //Flags[31:27]-> OriginalAlignment - //Flags[2] -> isSRet - //Flags[1] -> isInReg + // Flags[31:27] -> OriginalAlignment + // Flags[2] -> isSRet + // Flags[1] -> isInReg unsigned Flags = (isInReg << 1) | (isSRet << 2) | (OriginalAlignment << 27); switch (getTypeAction(VT)) { @@ -2959,7 +2959,7 @@ unsigned NumVals = getNumElements(VT); for (unsigned i = 0; i != NumVals; ++i) { RetVals.push_back(NVT); - //if it isn't first piece, alignment must be 1 + // if it isn't first piece, alignment must be 1 if (i == 1) Flags = (Flags & 0x07ffffff) | (1 << 27); Ops.push_back(DAG.getConstant(Flags, MVT::i32)); } @@ -3067,7 +3067,7 @@ bool isFirst = true) { if (TLI.getTypeAction(VT) != TargetLowering::Expand) { - //if it isn't first piece, alignment must be 1 + // if it isn't first piece, alignment must be 1 if (!isFirst) Flags = (Flags & 0x07ffffff) | (1 << 27); Ops.push_back(Arg); @@ -3121,10 +3121,10 @@ bool isSRet = Args[i].isSRet; unsigned OriginalAlignment = getTargetData()->getTypeAlignmentABI(Args[i].Ty); - //Flags[31:27]-> OriginalAlignment - //Flags[2] -> isSRet - //Flags[1] -> isInReg - //Flags[0] -> isSigned + // Flags[31:27] -> OriginalAlignment + // Flags[2] -> isSRet + // Flags[1] -> isInReg + // Flags[0] -> isSigned unsigned Flags = (isSRet << 2) | (isInReg << 1) | isSigned | (OriginalAlignment << 27); From lauro.venancio at gmail.com Tue Feb 13 12:11:49 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 15:11:49 -0300 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp In-Reply-To: <796C6F51-EF30-40DA-BC25-75BF1CB85425@apple.com> References: <200702131350.l1DDoOCZ027008@zion.cs.uiuc.edu> <796C6F51-EF30-40DA-BC25-75BF1CB85425@apple.com> Message-ID: <9c10c9f0702131011g8595342w521745b4ff06974@mail.gmail.com> > Some comments: > > 1. Why 27 - 31 instead of 3 - 6? I preferred to separate multi-bit values from boolean values. > Please add comment to > SelectionDAGNodes.h (see CALL). Added. > 2. Purely a stylistic nitpick. Please add a space between // and the > actual comment. Added. From dpatel at apple.com Tue Feb 13 12:19:31 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Tue, 13 Feb 2007 10:19:31 -0800 (PST) Subject: [llvm-commits] [123793] Fix target-specific .cpp files dependencies. Message-ID: <20070213181931.857BF419ED6D@src> Revision: 123793 Author: dpatel Date: 2007-02-13 10:19:31 -0800 (Tue, 13 Feb 2007) Log Message: ----------- Fix target-specific .cpp files dependencies. Modified Paths: -------------- apple-local/branches/llvm/gcc/Makefile.in Modified: apple-local/branches/llvm/gcc/Makefile.in =================================================================== --- apple-local/branches/llvm/gcc/Makefile.in 2007-02-13 17:23:34 UTC (rev 123792) +++ apple-local/branches/llvm/gcc/Makefile.in 2007-02-13 18:19:31 UTC (rev 123793) @@ -2488,9 +2488,9 @@ $(out_file) $(OUTPUT_OPTION) # APPLE LOCAL begin LLVM ifneq ($(out_cxx_file),) -$(out_cxx_object_file): $(srcdir)/config/$(out_cxx_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \ +$(out_cxx_object_file): $(srcdir)/config/$(out_cxx_file) $(ALL_HEADERS) $(TREE_H) $(GGC_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \ - output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \ + output.h $(INSN_ATTR_H) toplev.h $(TARGET_H) libfuncs.h \ $(TARGET_DEF_H) function.h $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) $(OPTABS_H) \ langhooks.h $(CXX) -c $(ALL_CXXFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ From scottm at rushg.aero.org Tue Feb 13 12:19:46 2007 From: scottm at rushg.aero.org (Scott Michel) Date: Tue, 13 Feb 2007 10:19:46 -0800 Subject: [llvm-commits] (yet another) updated TargetData patch Message-ID: <20070213181945.GA3344@rush.aero.org> - Merged llvm HEAD changes. - Found/fixed structure size calculation bug. -------------- next part -------------- A non-text attachment was scrubbed... Name: TargetData.diff Type: text/x-diff Size: 50923 bytes Desc: TargetData patch Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070213/c12e271b/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm-cfrontend.diff Type: text/x-diff Size: 2383 bytes Desc: Associated C frontend diffs Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070213/c12e271b/attachment-0001.bin From dpatel at apple.com Tue Feb 13 12:39:43 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Tue, 13 Feb 2007 10:39:43 -0800 (PST) Subject: [llvm-commits] [123794] Fix llvm-gcc builds without --enable-llvm Message-ID: <20070213183943.51DFC41AD29C@src> Revision: 123794 Author: dpatel Date: 2007-02-13 10:39:43 -0800 (Tue, 13 Feb 2007) Log Message: ----------- Fix llvm-gcc builds without --enable-llvm Modified Paths: -------------- apple-local/branches/llvm/gcc/Makefile.in Modified: apple-local/branches/llvm/gcc/Makefile.in =================================================================== --- apple-local/branches/llvm/gcc/Makefile.in 2007-02-13 18:19:31 UTC (rev 123793) +++ apple-local/branches/llvm/gcc/Makefile.in 2007-02-13 18:39:43 UTC (rev 123794) @@ -1030,8 +1030,10 @@ OBJS-md = $(out_object_file) # APPLE LOCAL begin LLVM ifneq ($(out_cxx_file),) +ifneq ($(LLVMOBJDIR),) OBJC-md += $(out_cxx_object_file) endif +endif # APPLE LOCAL end LLVM OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o \ cgraph.o cgraphunit.o tree-nomudflap.o @@ -1125,8 +1127,10 @@ OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive) # APPLE LOCAL begin LLVM ifneq ($(out_cxx_file),) +ifneq ($(LLVMOBJDIR),) OBJS += $(out_cxx_object_file) endif +endif # APPLE LOCAL end LLVM OBJS-onestep = libbackend.o $(OBJS-archive) From lauro.venancio at gmail.com Tue Feb 13 13:52:44 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 13:52:44 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/ARM/arguments.ll Message-ID: <200702131952.l1DJqiOZ021847@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/ARM: arguments.ll updated: 1.1 -> 1.2 --- Log message: Add ABI information to ARM subtarget. --- Diffs of the changes: (+1 -1) arguments.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/CodeGen/ARM/arguments.ll diff -u llvm/test/CodeGen/ARM/arguments.ll:1.1 llvm/test/CodeGen/ARM/arguments.ll:1.2 --- llvm/test/CodeGen/ARM/arguments.ll:1.1 Tue Feb 13 08:07:13 2007 +++ llvm/test/CodeGen/ARM/arguments.ll Tue Feb 13 13:52:28 2007 @@ -1,5 +1,5 @@ ; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -mtriple=arm-linux | grep "mov r0, r2" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -mtriple=arm-linux-gnueabi | grep "mov r0, r2" | wc -l | grep 1 && ; RUN: llvm-as < %s | llc -mtriple=arm-apple-darwin | grep "mov r0, r1" | wc -l | grep 1 define i32 @f(i32 %a, i64 %b) { From lauro.venancio at gmail.com Tue Feb 13 13:52:46 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 13:52:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMSubtarget.cpp ARMSubtarget.h ARMTargetMachine.cpp Message-ID: <200702131952.l1DJqko8021861@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMSubtarget.cpp updated: 1.2 -> 1.3 ARMSubtarget.h updated: 1.2 -> 1.3 ARMTargetMachine.cpp updated: 1.21 -> 1.22 --- Log message: Add ABI information to ARM subtarget. --- Diffs of the changes: (+24 -8) ARMSubtarget.cpp | 14 ++++++++++---- ARMSubtarget.h | 10 +++++++++- ARMTargetMachine.cpp | 8 +++++--- 3 files changed, 24 insertions(+), 8 deletions(-) Index: llvm/lib/Target/ARM/ARMSubtarget.cpp diff -u llvm/lib/Target/ARM/ARMSubtarget.cpp:1.2 llvm/lib/Target/ARM/ARMSubtarget.cpp:1.3 --- llvm/lib/Target/ARM/ARMSubtarget.cpp:1.2 Fri Jan 19 13:22:40 2007 +++ llvm/lib/Target/ARM/ARMSubtarget.cpp Tue Feb 13 13:52:28 2007 @@ -26,8 +26,9 @@ , HasVFP2(false) , UseThumbBacktraces(false) , IsR9Reserved(false) - , stackAlignment(8) - , TargetType(isELF) { // Default to ELF unless otherwise specified. + , stackAlignment(4) + , TargetType(isELF) // Default to ELF unless otherwise specified. + , TargetABI(ARM_ABI_APCS) { // Determine default and user specified characteristics std::string CPU = "generic"; @@ -49,9 +50,14 @@ #endif } + if (TT.find("eabi") != std::string::npos) + TargetABI = ARM_ABI_AAPCS; + + if (isAAPCS_ABI()) + stackAlignment = 8; + if (isTargetDarwin()) { UseThumbBacktraces = true; IsR9Reserved = true; - stackAlignment = 4; - } + } } Index: llvm/lib/Target/ARM/ARMSubtarget.h diff -u llvm/lib/Target/ARM/ARMSubtarget.h:1.2 llvm/lib/Target/ARM/ARMSubtarget.h:1.3 --- llvm/lib/Target/ARM/ARMSubtarget.h:1.2 Fri Jan 19 13:22:40 2007 +++ llvm/lib/Target/ARM/ARMSubtarget.h Tue Feb 13 13:52:28 2007 @@ -42,7 +42,7 @@ /// IsR9Reserved - True if R9 is a not available as general purpose register. bool IsR9Reserved; - + /// stackAlignment - The minimum alignment known to hold of the stack frame on /// entry to the function and which must be maintained by every function. unsigned stackAlignment; @@ -52,6 +52,11 @@ isELF, isDarwin } TargetType; + enum { + ARM_ABI_APCS, + ARM_ABI_AAPCS // ARM EABI + } TargetABI; + /// This constructor initializes the data members to match that /// of the specified module. /// @@ -71,6 +76,9 @@ bool isTargetDarwin() const { return TargetType == isDarwin; } bool isTargetELF() const { return TargetType == isELF; } + bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; } + bool isAAPCS_ABI() const { return TargetABI == ARM_ABI_AAPCS; } + bool isThumb() const { return IsThumb; } bool useThumbBacktraces() const { return UseThumbBacktraces; } Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.21 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.22 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.21 Tue Feb 13 08:07:13 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 13:52:28 2007 @@ -34,13 +34,15 @@ /// ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) : Subtarget(M, FS), - DataLayout(Subtarget.isTargetDarwin() ? + DataLayout(Subtarget.isAPCS_ABI() ? + //APCS ABI (Subtarget.isThumb() ? std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32-A:32") : std::string("e-p:32:32-d:32:32-l:32:32")) : + //AAPCS ABI (Subtarget.isThumb() ? - std::string("e-p:32:32-d:32:64-l:64:64-s:16:32-b:8:32-B:8:32-A:32") : - std::string("e-p:32:32-d:32:64-l:64:64"))), + std::string("e-p:32:32-d:64:64-l:64:64-s:16:32-b:8:32-B:8:32-A:32") : + std::string("e-p:32:32-d:64:64-l:64:64"))), InstrInfo(Subtarget), FrameInfo(Subtarget) {} From lauro.venancio at gmail.com Tue Feb 13 14:06:31 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 13 Feb 2007 14:06:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetMachine.cpp Message-ID: <200702132006.l1DK6V9t022988@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetMachine.cpp updated: 1.22 -> 1.23 --- Log message: Add space between // and the comment. --- Diffs of the changes: (+2 -2) ARMTargetMachine.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.22 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.23 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.22 Tue Feb 13 13:52:28 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 14:06:15 2007 @@ -35,11 +35,11 @@ ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) : Subtarget(M, FS), DataLayout(Subtarget.isAPCS_ABI() ? - //APCS ABI + // APCS ABI (Subtarget.isThumb() ? std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32-A:32") : std::string("e-p:32:32-d:32:32-l:32:32")) : - //AAPCS ABI + // AAPCS ABI (Subtarget.isThumb() ? std::string("e-p:32:32-d:64:64-l:64:64-s:16:32-b:8:32-B:8:32-A:32") : std::string("e-p:32:32-d:64:64-l:64:64"))), From sabre at nondot.org Tue Feb 13 14:09:23 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 14:09:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702132009.l1DK9NM5023233@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.363 -> 1.364 --- Log message: revert my previous switch lowering change, which miscompiles a few programs. This will break a dj test until I have time to investigate. --- Diffs of the changes: (+2 -2) SelectionDAGISel.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.363 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.364 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.363 Tue Feb 13 12:10:13 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Feb 13 14:09:07 2007 @@ -389,8 +389,8 @@ struct CaseCmp { bool operator () (const Case& C1, const Case& C2) { assert(isa(C1.first) && isa(C2.first)); - return cast(C1.first)->getZExtValue() < - cast(C2.first)->getZExtValue(); + return cast(C1.first)->getSExtValue() < + cast(C2.first)->getSExtValue(); } }; From reid at x10sys.com Tue Feb 13 14:58:13 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 14:58:13 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702132058.l1DKwDiH027047@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.5 -> 1.6 --- Log message: Add missing closing parenthesis. --- Diffs of the changes: (+2 -2) DeveloperPolicy.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.5 llvm/docs/DeveloperPolicy.html:1.6 --- llvm/docs/DeveloperPolicy.html:1.5 Tue Feb 13 11:04:09 2007 +++ llvm/docs/DeveloperPolicy.html Tue Feb 13 14:57:57 2007 @@ -273,7 +273,7 @@
    • All feature and regression test cases must be added to the llvm/test directory. The appropriate sub-directory should be selected (see the Testing Guide for - details.
    • + details).
    • Test cases should be written in LLVM assembly language unless the feature or regression being tested requires another language.
    • Test cases, especially for regressions, should be as reduced as @@ -430,7 +430,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> Written By: LLVM Oversight Group
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2007/02/13 17:04:09 $ + Last modified: $Date: 2007/02/13 20:57:57 $ From sabre at nondot.org Tue Feb 13 15:45:00 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 15:45:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/README.txt Message-ID: <200702132145.l1DLj0Yc029836@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: README.txt updated: 1.54 -> 1.55 --- Log message: add a note --- Diffs of the changes: (+4 -0) README.txt | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/README.txt diff -u llvm/lib/Target/README.txt:1.54 llvm/lib/Target/README.txt:1.55 --- llvm/lib/Target/README.txt:1.54 Tue Jan 16 00:39:48 2007 +++ llvm/lib/Target/README.txt Tue Feb 13 15:44:43 2007 @@ -415,3 +415,7 @@ //===---------------------------------------------------------------------===// +Promote for i32 bswap can use i64 bswap + shr. Useful on targets with 64-bit +regs and bswap, like itanium. + +//===---------------------------------------------------------------------===// From criswell at cs.uiuc.edu Tue Feb 13 16:02:52 2007 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue, 13 Feb 2007 16:02:52 -0600 Subject: [llvm-commits] [release_19] CVS: llvm-poolalloc/lib/DSA/DataStructure.cpp Message-ID: <200702132202.l1DM2qnZ030896@zion.cs.uiuc.edu> Changes in directory llvm-poolalloc/lib/DSA: DataStructure.cpp updated: 1.248.2.3 -> 1.248.2.4 --- Log message: Merged in revision 1.258. This patch marks nodes incomplete. --- Diffs of the changes: (+8 -0) DataStructure.cpp | 8 ++++++++ 1 files changed, 8 insertions(+) Index: llvm-poolalloc/lib/DSA/DataStructure.cpp diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.3 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.4 --- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.3 Wed Dec 13 15:58:21 2006 +++ llvm-poolalloc/lib/DSA/DataStructure.cpp Tue Feb 13 16:02:36 2007 @@ -1978,6 +1978,14 @@ E = AuxFunctionCalls.end(); I != E; ++I) markIncomplete(*I); + // Mark stuff passed into external functions as being incomplete. + // External functions may not appear in Aux during td, so process + // them specially + for (std::list::iterator I = FunctionCalls.begin(), + E = FunctionCalls.end(); I != E; ++I) + if(I->isDirectCall() && I->getCalleeFunc()->isExternal()) + markIncomplete(*I); + // Mark all global nodes as incomplete. for (DSScalarMap::global_iterator I = ScalarMap.global_begin(), E = ScalarMap.global_end(); I != E; ++I) From reid at x10sys.com Tue Feb 13 16:40:57 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 16:40:57 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp Message-ID: <200702132240.l1DMevQh000576@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: arith.cpp updated: 1.3 -> 1.4 --- Log message: Significantly beef up this test to check all interface operations on a variety of bitwidths from 1 to 1024 and using randomly generated data. --- Diffs of the changes: (+162 -54) arith.cpp | 216 ++++++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 162 insertions(+), 54 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.3 llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.4 --- llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.3 Sun Feb 11 02:49:48 2007 +++ llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp Tue Feb 13 16:40:41 2007 @@ -11,6 +11,7 @@ #include "llvm/ADT/APInt.h" #include +#include using namespace llvm; @@ -18,67 +19,174 @@ APInt y(0x0fffff, 21); -int my_test() -{ - APInt i(uint64_t(0), 10); - APInt j(0, 10); - APInt k(0, 10); - APInt l(0, 10); - APInt result(0, 21); - short temp; - int i_temp; - unsigned int ui_x; - unsigned int ui_y; - j = i; - j -= 1; - temp = (short)j.getValue(); - printf( "temp = %hd\n", temp); - k = i; - k += 1; - temp = k.getValue(); - printf( "temp = %hd\n", temp); - k = j * k; - temp = k.getValue(); - printf( "temp = %hd\n", temp); - j *= 120; - l = APIntOps::sdiv(j, k); - temp = l.getValue(); - printf( "temp = %hd\n", temp); - j *= (-176); // after truncation, the value should be -384 - l = APIntOps::sdiv(j, k); - temp = l.getValue(); - printf( "temp = %hd\n", temp); - l = 120; - l = (j * l); - l = APIntOps::urem(l, 4); - temp = l.getValue(); - printf( "temp = %hd\n", temp); - l = -217; - l = (j * l); - l = APIntOps::sdiv(l, (++i)); - temp = l.getValue(); - printf( "temp = %hd\n", temp); - result = ++x; - - i_temp = result.getValue(); - printf( "i_temp = %x\n", i_temp); +const char* str(const APInt& X) { + static std::string temp_str; + temp_str = X.to_string(); + return temp_str.c_str(); +} + +void test_interface(const APInt &val) { + printf("INTERFACE TEST: val = %s\n", str(val)); + unsigned bitwidth = val.getNumBits(); + unsigned pos = rand() % bitwidth; + printf("val[%u] = %d\n", pos, val[pos]); + APInt smax = APInt::getMaxValue(bitwidth, true); + APInt umax = APInt::getMaxValue(bitwidth, false); + APInt smin = APInt::getMinValue(bitwidth, true); + APInt umin = APInt::getMinValue(bitwidth, false); + printf("APInt::getMaxValue(%d, true) = %s\n", bitwidth, str(smax)); + printf("APInt::getMaxValue(%d, false) = %s\n", bitwidth, str(umax)); + printf("APInt::getMinValue(%d, true) = %s\n", bitwidth, str(smin)); + printf("APInt::getMinValue(%d, false) = %s\n", bitwidth, str(umin)); + APInt null = APInt::getNullValue(bitwidth); + APInt allone = APInt::getAllOnesValue(bitwidth); + printf("APInt::getNullValue(%d) = %s\n", bitwidth, str(umin)); + printf("APInt::getAllOnesValue(%d) = %s\n", bitwidth, str(umin)); + APInt x(val); + x.set(pos); + printf("val.set(%d) = %s\n", pos, str(x)); + x.set(); + printf("val.set() = %s\n", str(x)); + x = val; + x.clear(pos); + printf("val.clear(%d) = %s\n", pos, str(x)); + x.clear(); + printf("val.clear() = %s\n", str(x)); + x = val; + x.flip(pos); + printf("val.flip(%d) = %s\n", pos, str(x)); + x = val; + x.flip(); + printf("val.flip() = %s\n", str(x)); + unsigned bitsize = bitwidth / 2; + printf("val.HiBits(%d) = %s\n", bitsize, str(val.HiBits(bitsize))); + printf("val.LoBits(%d) = %s\n", bitsize, str(val.LoBits(bitsize))); + printf("val.IsIntN(%d) = %d\n", bitsize, str(val.IsIntN(bitsize))); +} + +void test_unops(const APInt &val) { + printf("UNARY OPERATORS TEST: val = %s\n", str(val)); + APInt x(val); + x++; + printf("val++ = %s\n", str(x)); + x = val; + ++x; + printf("++val = %s\n", str(x)); + x = val; x--; - - result = x + y; - i_temp = result.getValue(); - printf("i_temp = %x\n", i_temp); - ui_x = x.getValue(); - ui_y = y.getValue(); - i_temp = ui_x - ui_y; - printf("i_temp = %x\n", i_temp); + printf("val-- = %s\n", str(x)); + x = val; + --x; + printf("--val = %s\n", str(x)); + x = -val; + printf("-val = %s\n", str(x)); + x = ~val; + printf("~val = %s\n", str(x)); + printf("!val = %d\n", !val); + printf("val.isPowerOf2() = %d\n", val.isPowerOf2()); + printf("val.LogBase2() = %d\n", val.getNumBits()); + printf("val.CountLeadingZeros() = %d\n", val.CountLeadingZeros()); + printf("val.CountTrailingZeros() = %d\n", val.CountTrailingZeros()); + printf("val.CountPopulation() = %d\n", val.CountPopulation()); + printf("val.getNumBits() = %d\n", val.getNumBits()); + x = val.ByteSwap(); + printf("val.ByteSwap() = %d\n", str(x)); + printf("val.RoundToDouble(true) %d = %f\n", val.RoundToDouble(true)); + printf("val.getValue() = "); + if (val.getNumBits() > 64) + printf("too wide\n"); + else + printf("%ul\n", val.getValue()); - return 0; +} + +void test_binops(const APInt &v1, const APInt &v2) { + printf("BINARY OPERATORS TEST: vl = %s, v2 = %s\n", str(v1), str(v2)); + APInt result(v1); + result &= v2; + printf("v1 &= v2: %s\n", str(result)); + result = v1; + result |= v2; + printf("v1 |= v2: %s\n", str(result)); + result = v1; + result ^= v2; + printf("v1 ^= v2: %s\n", str(result)); + result = v1; + result *= v2; + printf("v1 *= v2: %s\n", str(result)); + result = v1; + result += v2; + printf("v1 += v2: %s\n", str(result)); + result = v1; + result -= v2; + printf("v1 -= v2: %s\n", str(result)); + result = v1 & v2; + printf("v1 & v2: %s\n", str(result)); + result = v1 | v2; + printf("v1 | v2: %s\n", str(result)); + result = v1 ^ v2; + printf("v1 ^ v2: %s\n", str(result)); + result = v1 && v2; + printf("v1 && v2: %s\n", str(result)); + result = v1 || v2; + printf("v1 || v2: %s\n", str(result)); + result = v1 * v2; + printf("v1 * v2: %s\n", str(result)); + result = v1 + v2; + printf("v1 + v2: %s\n", str(result)); + result = v1 - v2; + printf("v1 - v2: %s\n", str(result)); + printf("v1 == v2: %d\n", v1 == v2); + printf("v1 != v2: %d\n", v1 == v2); + printf("v1 < v2: %d\n", v1 == v2); + printf("v1 <= v2: %d\n", v1 == v2); + printf("v1 > v2: %d\n", v1 == v2); + printf("v1 >= v2: %d\n", v1 == v2); + { + using namespace APIntOps; + unsigned shiftAmt = rand() % v1.getNumBits(); + result = AShr(v1,shiftAmt); + printf("AShr(v1,%d) = %s\n", shiftAmt, str(result)); + result = LShr(v1,shiftAmt); + printf("LShr(v1,%d) = %s\n", shiftAmt, str(result)); + result = Shl(v1,shiftAmt); + printf("Shl(v1,%d) = %s\n", shiftAmt, str(result)); + result = SDiv(v1,v2); + printf("SDiv(v1,v2) = %s\n", str(result)); + result = UDiv(v1,v2); + printf("UDiv(v1,v2) = %s\n", str(result)); + result = SRem(v1,v2); + printf("SRem(v1,v2) = %s\n", str(result)); + result = URem(v1,v2); + printf("URem(v1,v2) = %s\n", str(result)); + } +} +void test_multiple() { + srand(0); + for (unsigned i = 0; i < 1024; ++i) { + unsigned bits = rand() % 1024; + APInt v1(0u, bits); + APInt v2(0u, bits); + for (unsigned i = 0; i < bits; ++i) { + unsigned bit = rand() % 2; + v1.Shl(1); + v1 |= bit; + } + for (unsigned i = 0; i < bits; ++i) { + unsigned bit = rand() % 2; + v2.Shl(1); + v2 |= bit; + } + test_interface(v1); + test_unops(v2); + test_binops(v1,v2); + } } int main() { - my_test(); + test_multiple(); return 0; } From reid at x10sys.com Tue Feb 13 16:42:16 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 16:42:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp Message-ID: <200702132242.l1DMgGtx000701@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: APInt.cpp updated: 1.8 -> 1.9 --- Log message: Make some minor improvements to APInt: 1. Make all the operators use uppercase 2. Rename APIntRoundToDouble method just RoundToDouble, the APInt is redundant. 3. Turn the class on for compilation. --- Diffs of the changes: (+11 -15) APInt.cpp | 26 +++++++++++--------------- 1 files changed, 11 insertions(+), 15 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.8 llvm/lib/Support/APInt.cpp:1.9 --- llvm/lib/Support/APInt.cpp:1.8 Mon Feb 12 14:02:55 2007 +++ llvm/lib/Support/APInt.cpp Tue Feb 13 16:41:58 2007 @@ -14,7 +14,6 @@ #include "llvm/ADT/APInt.h" -#if 0 #include "llvm/DerivedTypes.h" #include "llvm/Support/MathExtras.h" #include @@ -878,12 +877,12 @@ /// HiBits - This function returns the high "numBits" bits of this APInt. APInt APInt::HiBits(unsigned numBits) const { - return APIntOps::lshr(*this, BitsNum - numBits); + return APIntOps::LShr(*this, BitsNum - numBits); } /// LoBits - This function returns the low "numBits" bits of this APInt. APInt APInt::LoBits(unsigned numBits) const { - return APIntOps::lshr(APIntOps::shl(*this, BitsNum - numBits), + return APIntOps::LShr(APIntOps::Shl(*this, BitsNum - numBits), BitsNum - numBits); } @@ -949,7 +948,7 @@ APInt A = API1, B = API2; while (!!B) { APInt T = B; - B = APIntOps::urem(A, B); + B = APIntOps::URem(A, B); A = T; } return A; @@ -972,18 +971,18 @@ return isNeg ? -APInt(mantissa >> (52 - exp)) : APInt(mantissa >> (52 - exp)); APInt Tmp(mantissa, exp + 1); - Tmp = Tmp.shl(exp - 52); + Tmp = Tmp.Shl(exp - 52); return isNeg ? -Tmp : Tmp; } -/// APIntRoundToDouble - This function convert this APInt to a double. +/// RoundToDouble - This function convert this APInt to a double. /// The layout for double is as following (IEEE Standard 754): /// -------------------------------------- /// | Sign Exponent Fraction Bias | /// |-------------------------------------- | /// | 1[63] 11[62-52] 52[51-00] 1023 | /// -------------------------------------- -double APInt::APIntRoundToDouble(bool isSigned) const { +double APInt::RoundToDouble(bool isSigned) const { bool isNeg = isSigned ? (*this)[BitsNum-1] : false; APInt Tmp(isNeg ? -(*this) : (*this)); if (Tmp.isSingleWord()) @@ -1020,7 +1019,7 @@ /// Arithmetic right-shift this APInt by shiftAmt. /// @brief Arithmetic right-shift function. -APInt APInt::ashr(unsigned shiftAmt) const { +APInt APInt::AShr(unsigned shiftAmt) const { APInt API(*this); if (API.isSingleWord()) API.VAL = (((int64_t(API.VAL) << (64 - API.BitsNum)) >> (64 - API.BitsNum)) @@ -1046,7 +1045,7 @@ /// Logical right-shift this APInt by shiftAmt. /// @brief Logical right-shift function. -APInt APInt::lshr(unsigned shiftAmt) const { +APInt APInt::LShr(unsigned shiftAmt) const { APInt API(*this); if (API.isSingleWord()) API.VAL >>= shiftAmt; @@ -1065,7 +1064,7 @@ /// Left-shift this APInt by shiftAmt. /// @brief Left-shift function. -APInt APInt::shl(unsigned shiftAmt) const { +APInt APInt::Shl(unsigned shiftAmt) const { APInt API(*this); if (API.isSingleWord()) API.VAL <<= shiftAmt; @@ -1089,7 +1088,7 @@ /// Unsigned divide this APInt by APInt RHS. /// @brief Unsigned division function for APInt. -APInt APInt::udiv(const APInt& RHS) const { +APInt APInt::UDiv(const APInt& RHS) const { APInt API(*this); unsigned first = RHS.getNumWords() * APInt::APINT_BITS_PER_WORD - RHS.CountLeadingZeros(); @@ -1134,7 +1133,7 @@ /// Unsigned remainder operation on APInt. /// @brief Function for unsigned remainder operation. -APInt APInt::urem(const APInt& RHS) const { +APInt APInt::URem(const APInt& RHS) const { APInt API(*this); unsigned first = RHS.getNumWords() * APInt::APINT_BITS_PER_WORD - RHS.CountLeadingZeros(); @@ -1176,6 +1175,3 @@ } return API; } - -#endif - From reid at x10sys.com Tue Feb 13 16:42:17 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 16:42:17 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h Message-ID: <200702132242.l1DMgHDu000707@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.7 -> 1.8 --- Log message: Make some minor improvements to APInt: 1. Make all the operators use uppercase 2. Rename APIntRoundToDouble method just RoundToDouble, the APInt is redundant. 3. Turn the class on for compilation. --- Diffs of the changes: (+37 -37) APInt.h | 74 ++++++++++++++++++++++++++++++++-------------------------------- 1 files changed, 37 insertions(+), 37 deletions(-) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.7 llvm/include/llvm/ADT/APInt.h:1.8 --- llvm/include/llvm/ADT/APInt.h:1.7 Mon Feb 12 14:02:55 2007 +++ llvm/include/llvm/ADT/APInt.h Tue Feb 13 16:41:58 2007 @@ -24,8 +24,8 @@ /// Forward declaration. class APInt; namespace APIntOps { - APInt udiv(const APInt& LHS, const APInt& RHS); - APInt urem(const APInt& LHS, const APInt& RHS); + APInt UDiv(const APInt& LHS, const APInt& RHS); + APInt URem(const APInt& LHS, const APInt& RHS); } //===----------------------------------------------------------------------===// @@ -286,7 +286,7 @@ /// @returns a uint64_t value from this APInt. If this APInt contains a single /// word, just returns VAL, otherwise pVal[0]. - inline uint64_t getValue() { + inline uint64_t getValue() const { if (isSingleWord()) return VAL; unsigned n = getNumWords() * 64 - CountLeadingZeros(); @@ -310,6 +310,10 @@ /// @brief Get the all-ones value. static APInt getAllOnesValue(unsigned numBits); + /// @returns the '0' value for an APInt of the specified bit-width. + /// @brief Get the '0' value. + static APInt getNullValue(unsigned numBits); + /// @brief Set every bit to 1. APInt& set(); @@ -317,10 +321,6 @@ /// @brief Set a given bit to 1. APInt& set(unsigned bitPosition); - /// @returns the '0' value for an APInt of the specified bit-width. - /// @brief Get the '0' value. - static APInt getNullValue(unsigned numBits); - /// @brief Set every bit to 0. APInt& clear(); @@ -370,7 +370,7 @@ { return BitsNum; } /// @brief Check if this APInt has a N-bits integer value. - inline bool isIntN(unsigned N) const { + inline bool IsIntN(unsigned N) const { if (isSingleWord()) { return VAL == VAL & (~uint64_t(0ULL) >> (64 - N)); } else { @@ -389,43 +389,43 @@ } /// @brief Converts this APInt to a double value. - double APIntRoundToDouble(bool isSigned = false) const; + double RoundToDouble(bool isSigned = false) const; /// Arithmetic right-shift this APInt by shiftAmt. /// @brief Arithmetic right-shift function. - APInt ashr(unsigned shiftAmt) const; + APInt AShr(unsigned shiftAmt) const; /// Logical right-shift this APInt by shiftAmt. /// @brief Logical right-shift function. - APInt lshr(unsigned shiftAmt) const; + APInt LShr(unsigned shiftAmt) const; /// Left-shift this APInt by shiftAmt. /// @brief Left-shift function. - APInt shl(unsigned shiftAmt) const; + APInt Shl(unsigned shiftAmt) const; /// Signed divide this APInt by APInt RHS. /// @brief Signed division function for APInt. - inline APInt sdiv(const APInt& RHS) const { + inline APInt SDiv(const APInt& RHS) const { bool isSignedLHS = (*this)[BitsNum - 1], isSignedRHS = RHS[RHS.BitsNum - 1]; - APInt API = APIntOps::udiv(isSignedLHS ? -(*this) : (*this), isSignedRHS ? -RHS : RHS); + APInt API = APIntOps::UDiv(isSignedLHS ? -(*this) : (*this), isSignedRHS ? -RHS : RHS); return isSignedLHS != isSignedRHS ? -API : API;; } /// Unsigned divide this APInt by APInt RHS. /// @brief Unsigned division function for APInt. - APInt udiv(const APInt& RHS) const; + APInt UDiv(const APInt& RHS) const; /// Signed remainder operation on APInt. /// @brief Function for signed remainder operation. - inline APInt srem(const APInt& RHS) const { + inline APInt SRem(const APInt& RHS) const { bool isSignedLHS = (*this)[BitsNum - 1], isSignedRHS = RHS[RHS.BitsNum - 1]; - APInt API = APIntOps::urem(isSignedLHS ? -(*this) : (*this), isSignedRHS ? -RHS : RHS); + APInt API = APIntOps::URem(isSignedLHS ? -(*this) : (*this), isSignedRHS ? -RHS : RHS); return isSignedLHS ? -API : API; } /// Unsigned remainder operation on APInt. /// @brief Function for unsigned remainder operation. - APInt urem(const APInt& RHS) const; + APInt URem(const APInt& RHS) const; }; @@ -433,7 +433,7 @@ /// @brief Check if the specified APInt has a N-bits integer value. inline bool isIntN(unsigned N, const APInt& APIVal) { - return APIVal.isIntN(N); + return APIVal.IsIntN(N); } /// @returns true if the argument APInt value is a sequence of ones @@ -464,7 +464,7 @@ /// @brief Converts the given APInt to a double value. inline double APIntRoundToDouble(const APInt& APIVal, bool isSigned = false) { - return APIVal.APIntRoundToDouble(isSigned); + return APIVal.RoundToDouble(isSigned); } /// @brief Converts the given APInt to a float vlalue. @@ -482,61 +482,61 @@ /// Arithmetic right-shift the APInt by shiftAmt. /// @brief Arithmetic right-shift function. -inline APInt ashr(const APInt& LHS, unsigned shiftAmt) { - return LHS.ashr(shiftAmt); +inline APInt AShr(const APInt& LHS, unsigned shiftAmt) { + return LHS.AShr(shiftAmt); } /// Logical right-shift the APInt by shiftAmt. /// @brief Logical right-shift function. -inline APInt lshr(const APInt& LHS, unsigned shiftAmt) { - return LHS.lshr(shiftAmt); +inline APInt LShr(const APInt& LHS, unsigned shiftAmt) { + return LHS.LShr(shiftAmt); } /// Left-shift the APInt by shiftAmt. /// @brief Left-shift function. -inline APInt shl(const APInt& LHS, unsigned shiftAmt) { - return LHS.shl(shiftAmt); +inline APInt Shl(const APInt& LHS, unsigned shiftAmt) { + return LHS.Shl(shiftAmt); } /// Signed divide APInt LHS by APInt RHS. /// @brief Signed division function for APInt. -inline APInt sdiv(const APInt& LHS, const APInt& RHS) { - return LHS.sdiv(RHS); +inline APInt SDiv(const APInt& LHS, const APInt& RHS) { + return LHS.SDiv(RHS); } /// Unsigned divide APInt LHS by APInt RHS. /// @brief Unsigned division function for APInt. -inline APInt udiv(const APInt& LHS, const APInt& RHS) { - return LHS.udiv(RHS); +inline APInt UDiv(const APInt& LHS, const APInt& RHS) { + return LHS.UDiv(RHS); } /// Signed remainder operation on APInt. /// @brief Function for signed remainder operation. -inline APInt srem(const APInt& LHS, const APInt& RHS) { - return LHS.srem(RHS); +inline APInt SRem(const APInt& LHS, const APInt& RHS) { + return LHS.SRem(RHS); } /// Unsigned remainder operation on APInt. /// @brief Function for unsigned remainder operation. -inline APInt urem(const APInt& LHS, const APInt& RHS) { - return LHS.urem(RHS); +inline APInt URem(const APInt& LHS, const APInt& RHS) { + return LHS.URem(RHS); } /// Performs multiplication on APInt values. /// @brief Function for multiplication operation. -inline APInt mul(const APInt& LHS, const APInt& RHS) { +inline APInt Mul(const APInt& LHS, const APInt& RHS) { return LHS * RHS; } /// Performs addition on APInt values. /// @brief Function for addition operation. -inline APInt add(const APInt& LHS, const APInt& RHS) { +inline APInt Add(const APInt& LHS, const APInt& RHS) { return LHS + RHS; } /// Performs subtraction on APInt values. /// @brief Function for subtraction operation. -inline APInt sub(const APInt& LHS, const APInt& RHS) { +inline APInt Sub(const APInt& LHS, const APInt& RHS) { return LHS - RHS; } From alenhar2 at cs.uiuc.edu Tue Feb 13 17:41:36 2007 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Tue, 13 Feb 2007 17:41:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Message-ID: <200702132341.l1DNfa6X003947@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaAsmPrinter.cpp updated: 1.62 -> 1.63 --- Log message: Well this isn't as ugly and it works better. At least gcc bootstraps again --- Diffs of the changes: (+70 -71) AlphaAsmPrinter.cpp | 141 +++++++++++++++++++++++++--------------------------- 1 files changed, 70 insertions(+), 71 deletions(-) Index: llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp diff -u llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.62 llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.63 --- llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp:1.62 Wed Jan 24 15:09:16 2007 +++ llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp Tue Feb 13 17:41:16 2007 @@ -112,9 +112,13 @@ O << MO.getSymbolName(); return; - case MachineOperand::MO_GlobalAddress: - O << Mang->getValueName(MO.getGlobal()); + case MachineOperand::MO_GlobalAddress: { + GlobalValue *GV = MO.getGlobal(); + O << Mang->getValueName(GV); + if (GV->isDeclaration() && GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); return; + } case MachineOperand::MO_JumpTableIndex: O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() @@ -189,88 +193,83 @@ bool AlphaAsmPrinter::doInitialization(Module &M) { - AsmPrinter::doInitialization(M); if(TM.getSubtarget().hasCT()) O << "\t.arch ev6\n"; //This might need to be ev67, so leave this test here else O << "\t.arch ev6\n"; O << "\t.set noat\n"; + AsmPrinter::doInitialization(M); return false; } bool AlphaAsmPrinter::doFinalization(Module &M) { const TargetData *TD = TM.getTargetData(); - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (I->hasInitializer()) { // External global require no code - // Check to see if this is a special global used by LLVM, if so, emit it. - if (EmitSpecialLLVMGlobal(I)) - continue; - - O << "\n\n"; - std::string name = Mang->getValueName(I); - Constant *C = I->getInitializer(); - unsigned Size = TD->getTypeSize(C->getType()); - // unsigned Align = TD->getPreferredTypeAlignmentShift(C->getType()); - unsigned Align = TD->getPreferredAlignmentLog(I); - - if (C->isNullValue() && - (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || - I->hasWeakLinkage() /* FIXME: Verify correct */)) { - SwitchToDataSection("\t.section .data", I); - if (I->hasInternalLinkage()) - O << "\t.local " << name << "\n"; - - O << "\t.comm " << name << "," << TD->getTypeSize(C->getType()) - << "," << (1 << Align) - << "\n"; - } else { - switch (I->getLinkage()) { - case GlobalValue::LinkOnceLinkage: - case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak. - // Nonnull linkonce -> weak - O << "\t.weak " << name << "\n"; - O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\", at progbits\n"; - SwitchToDataSection("", I); - break; - case GlobalValue::AppendingLinkage: - // FIXME: appending linkage variables should go into a section of - // their name or something. For now, just emit them as external. - case GlobalValue::ExternalLinkage: - // If external or appending, declare as a global symbol - O << "\t.globl " << name << "\n"; - // FALL THROUGH - case GlobalValue::InternalLinkage: - SwitchToDataSection(C->isNullValue() ? "\t.section .bss" : - "\t.section .data", I); - break; - case GlobalValue::GhostLinkage: - cerr << "GhostLinkage cannot appear in AlphaAsmPrinter!\n"; - abort(); - case GlobalValue::DLLImportLinkage: - cerr << "DLLImport linkage is not supported by this target!\n"; - abort(); - case GlobalValue::DLLExportLinkage: - cerr << "DLLExport linkage is not supported by this target!\n"; - abort(); - default: - assert(0 && "Unknown linkage type!"); - } - - EmitAlignment(Align); - O << "\t.type " << name << ", at object\n"; - O << "\t.size " << name << "," << Size << "\n"; - O << name << ":\n"; - EmitGlobalConstant(C); - } - } + for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->hasExternalWeakLinkage()) { - O << "\n\n"; - std::string name = Mang->getValueName(I); - O << "\t.weak " << name << "\n"; + if (!I->hasInitializer()) continue; // External global require no code + + // Check to see if this is a special global used by LLVM, if so, emit it. + if (EmitSpecialLLVMGlobal(I)) + continue; + + std::string name = Mang->getValueName(I); + Constant *C = I->getInitializer(); + unsigned Size = TD->getTypeSize(C->getType()); + unsigned Align = TD->getPreferredAlignmentLog(I); + + //1: hidden? + if (I->hasHiddenVisibility()) + O << TAI->getHiddenDirective() << name << "\n"; + + //2: kind + switch (I->getLinkage()) { + case GlobalValue::LinkOnceLinkage: + case GlobalValue::WeakLinkage: + O << TAI->getWeakRefDirective() << name << '\n'; + break; + case GlobalValue::AppendingLinkage: + case GlobalValue::ExternalLinkage: + O << "\t.globl " << name << "\n"; + break; + case GlobalValue::InternalLinkage: + break; + default: + assert(0 && "Unknown linkage type!"); + cerr << "Unknown linkage type!\n"; + abort(); + } + + //3: Section (if changed) + if (I->hasSection() && + (I->getSection() == ".ctors" || + I->getSection() == ".dtors")) { + std::string SectionName = ".section\t" + I->getSection() + + ",\"aw\", at progbits"; + SwitchToDataSection(SectionName.c_str()); + } else { + if (C->isNullValue()) + SwitchToDataSection("\t.section\t.bss", I); + else + SwitchToDataSection("\t.section\t.data", I); } + + //4: Type, Size, Align + O << "\t.type\t" << name << ", @object\n"; + O << "\t.size\t" << name << ", " << Size << "\n"; + EmitAlignment(Align, I); + + O << name << ":\n"; + + // If the initializer is a extern weak symbol, remember to emit the weak + // reference! + if (const GlobalValue *GV = dyn_cast(C)) + if (GV->hasExternalWeakLinkage()) + ExtWeakSymbols.insert(GV); + + EmitGlobalConstant(C); + O << '\n'; + } AsmPrinter::doFinalization(M); return false; From sabre at nondot.org Tue Feb 13 17:41:41 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 17:41:41 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/X86/i128-mul.ll Message-ID: <200702132341.l1DNffZt003961@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/X86: i128-mul.ll added (r1.1) --- Log message: new testcase, by Dan Gohman --- Diffs of the changes: (+12 -0) i128-mul.ll | 12 ++++++++++++ 1 files changed, 12 insertions(+) Index: llvm/test/CodeGen/X86/i128-mul.ll diff -c /dev/null llvm/test/CodeGen/X86/i128-mul.ll:1.1 *** /dev/null Tue Feb 13 17:41:34 2007 --- llvm/test/CodeGen/X86/i128-mul.ll Tue Feb 13 17:41:24 2007 *************** *** 0 **** --- 1,12 ---- + ; RUN: llvm-as < %s | llc -march=x86-64 + ; PR1198 + + define i64 @foo(i64 %x, i64 %y) { + %tmp0 = zext i64 %x to i128 + %tmp1 = zext i64 %y to i128 + %tmp2 = mul i128 %tmp0, %tmp1 + %tmp7 = zext i32 64 to i128 + %tmp3 = lshr i128 %tmp2, %tmp7 + %tmp4 = trunc i128 %tmp3 to i64 + ret i64 %tmp4 + } From sabre at nondot.org Tue Feb 13 17:41:55 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 17:41:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Message-ID: <200702132341.l1DNftRB003990@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.89 -> 1.90 --- Log message: Fix PR1198: http://llvm.org/PR1198 , by adding initial i128 support. Patch by Dan Gohman. --- Diffs of the changes: (+1 -0) TargetLowering.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.89 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.90 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.89 Thu Feb 8 16:13:59 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Feb 13 17:41:38 2007 @@ -2200,6 +2200,7 @@ case 16: return MVT::i16; case 32: return MVT::i32; case 64: return MVT::i64; + case 128: return MVT::i128; } break; case Type::FloatTyID: return MVT::f32; From sabre at nondot.org Tue Feb 13 17:55:34 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 17:55:34 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200702132355.l1DNtYJs004854@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.472 -> 1.473 --- Log message: implement expand of truncate. This allows truncates from i128 to i64 to be supported on 32-bit hosts. --- Diffs of the changes: (+13 -0) LegalizeDAG.cpp | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.472 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.473 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.472 Thu Feb 8 16:16:19 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Feb 13 17:55:16 2007 @@ -4859,6 +4859,19 @@ Hi = DAG.getConstant(0, NVT); break; + case ISD::TRUNCATE: { + // The input value must be larger than this value. Expand *it*. + SDOperand NewLo; + ExpandOp(Node->getOperand(0), NewLo, Hi); + + // The low part is now either the right size, or it is closer. If not the + // right size, make an illegal truncate so we recursively expand it. + if (NewLo.getValueType() != Node->getValueType(0)) + NewLo = DAG.getNode(ISD::TRUNCATE, Node->getValueType(0), NewLo); + ExpandOp(NewLo, Lo, Hi); + break; + } + case ISD::BIT_CONVERT: { SDOperand Tmp; if (TLI.getOperationAction(ISD::BIT_CONVERT, VT) == TargetLowering::Custom){ From sabre at nondot.org Tue Feb 13 17:58:12 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 17:58:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/ValueTypes.cpp Message-ID: <200702132358.l1DNwChk005016@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: ValueTypes.cpp updated: 1.12 -> 1.13 --- Log message: better support for i128. --- Diffs of the changes: (+1 -0) ValueTypes.cpp | 1 + 1 files changed, 1 insertion(+) Index: llvm/lib/VMCore/ValueTypes.cpp diff -u llvm/lib/VMCore/ValueTypes.cpp:1.12 llvm/lib/VMCore/ValueTypes.cpp:1.13 --- llvm/lib/VMCore/ValueTypes.cpp:1.12 Sat Jan 20 16:35:55 2007 +++ llvm/lib/VMCore/ValueTypes.cpp Tue Feb 13 17:57:55 2007 @@ -93,6 +93,7 @@ case MVT::i16: return Type::Int16Ty; case MVT::i32: return Type::Int32Ty; case MVT::i64: return Type::Int64Ty; + case MVT::i128: return IntegerType::get(128); case MVT::f32: return Type::FloatTy; case MVT::f64: return Type::DoubleTy; case MVT::v8i8: return PackedType::get(Type::Int8Ty, 8); From sabre at nondot.org Tue Feb 13 17:59:38 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 17:59:38 -0600 Subject: [llvm-commits] CVS: llvm/test/CodeGen/Generic/i128-arith.ll Message-ID: <200702132359.l1DNxcPd005133@zion.cs.uiuc.edu> Changes in directory llvm/test/CodeGen/Generic: i128-arith.ll added (r1.1) --- Log message: sanity check for *basic* i128 arithmetic on all hosts. --- Diffs of the changes: (+11 -0) i128-arith.ll | 11 +++++++++++ 1 files changed, 11 insertions(+) Index: llvm/test/CodeGen/Generic/i128-arith.ll diff -c /dev/null llvm/test/CodeGen/Generic/i128-arith.ll:1.1 *** /dev/null Tue Feb 13 17:59:31 2007 --- llvm/test/CodeGen/Generic/i128-arith.ll Tue Feb 13 17:59:21 2007 *************** *** 0 **** --- 1,11 ---- + ; RUN: llvm-as < %s | llc + + define i64 @foo(i64 %x, i64 %y, i32 %amt) { + %tmp0 = zext i64 %x to i128 + %tmp1 = sext i64 %y to i128 + %tmp2 = or i128 %tmp0, %tmp1 + %tmp7 = zext i32 13 to i128 + %tmp3 = lshr i128 %tmp2, %tmp7 + %tmp4 = trunc i128 %tmp3 to i64 + ret i64 %tmp4 + } From bwendlin at apple.com Tue Feb 13 17:58:36 2007 From: bwendlin at apple.com (bwendlin at apple.com) Date: Tue, 13 Feb 2007 15:58:36 -0800 (PST) Subject: [llvm-commits] [123798] Pred needed to be initialized. Message-ID: <20070213235836.DF17B42F9674@src> Revision: 123798 Author: bwendlin Date: 2007-02-13 15:58:36 -0800 (Tue, 13 Feb 2007) Log Message: ----------- Pred needed to be initialized. During a "buildit", warnings are treated as errors. Modified Paths: -------------- apple-local/branches/llvm/gcc/config/i386/llvm-i386.cpp Modified: apple-local/branches/llvm/gcc/config/i386/llvm-i386.cpp =================================================================== --- apple-local/branches/llvm/gcc/config/i386/llvm-i386.cpp 2007-02-13 23:55:13 UTC (rev 123797) +++ apple-local/branches/llvm/gcc/config/i386/llvm-i386.cpp 2007-02-13 23:58:36 UTC (rev 123798) @@ -455,7 +455,7 @@ v4f32, v4f32, v4f32, Type::Int8Ty, NULL); } bool flip = false; - Value *Pred; + Value *Pred = 0; switch (FnCode) { case IX86_BUILTIN_CMPEQPS: Pred = ConstantInt::get(Type::Int8Ty, 0); @@ -524,7 +524,7 @@ cmpss = M->getOrInsertFunction("llvm.x86.sse.cmp.ss", v4f32, v4f32, v4f32, Type::Int8Ty, NULL); } - Value *Pred; + Value *Pred = 0; switch (FnCode) { case IX86_BUILTIN_CMPEQSS: Pred = ConstantInt::get(Type::Int8Ty, 0); @@ -580,7 +580,7 @@ v2f64, v2f64, v2f64, Type::Int8Ty, NULL); } bool flip = false; - Value *Pred; + Value *Pred = 0; switch (FnCode) { case IX86_BUILTIN_CMPEQPD: Pred = ConstantInt::get(Type::Int8Ty, 0); @@ -648,7 +648,7 @@ cmpss = M->getOrInsertFunction("llvm.x86.sse2.cmp.sd", v2f64, v2f64, v2f64, Type::Int8Ty, NULL); } - Value *Pred; + Value *Pred = 0; switch (FnCode) { case IX86_BUILTIN_CMPEQSD: Pred = ConstantInt::get(Type::Int8Ty, 0); From reid at x10sys.com Tue Feb 13 20:49:39 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 20:49:39 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile Message-ID: <200702140249.l1E2nd15013944@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: Makefile updated: 1.1 -> 1.2 --- Log message: turn on debug for these test. --- Diffs of the changes: (+2 -1) Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile diff -u llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile:1.1 llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile:1.2 --- llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile:1.1 Mon Jan 29 17:07:32 2007 +++ llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile Tue Feb 13 20:49:22 2007 @@ -1,7 +1,8 @@ # SingleSource/UnitTests/Integer/Makefile LEVEL = ../../../.. +DISABLE_JIT := 1 include $(LEVEL)/SingleSource/Makefile.singlesrc LDFLAGS += -L$(LLVM_OBJ_ROOT)/Debug/lib -lLLVMSupport -lLLVMSystem -lstdc++ -CXXFLAGS += -I$(LLVM_SRC_ROOT)/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__NO_MATH_INLINES +CXXFLAGS += -I$(LLVM_SRC_ROOT)/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__NO_MATH_INLINES -g From reid at x10sys.com Tue Feb 13 20:50:06 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 20:50:06 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/to_string.cpp Message-ID: <200702140250.l1E2o6R6013988@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: to_string.cpp added (r1.1) --- Log message: A test program to test the to_string method. --- Diffs of the changes: (+33 -0) to_string.cpp | 33 +++++++++++++++++++++++++++++++++ 1 files changed, 33 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/to_string.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/APInt/to_string.cpp:1.1 *** /dev/null Tue Feb 13 20:50:00 2007 --- llvm-test/SingleSource/UnitTests/Integer/APInt/to_string.cpp Tue Feb 13 20:49:50 2007 *************** *** 0 **** --- 1,33 ---- + //===--- convert.c --- Test Cases for Bit Accurate Types ------------------===// + // + // This file was developed by Reid Spencer and is distributed under the + // University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This is a general test for arithmetic operations with signed and + // unsigned operands. + // + //===----------------------------------------------------------------------===// + + #include "llvm/ADT/APInt.h" + #include + + using namespace llvm; + + int + main ( int argc, char** argv) + { + for (unsigned i = 1; i < 128; i += 3) { + APInt x(0, i); + APInt y(1, i); + unsigned randval = rand(); + APInt z(randval, i); + std::string x_str = x.to_string(); + std::string y_str = y.to_string(); + std::string z_str = z.to_string(); + printf("APInt(0, %d) = %s\n", i, x_str.c_str()); + printf("APInt(1, %d) = %s\n", i, y_str.c_str()); + printf("APInt(%d, %d) = %s\n", randval, i, z_str.c_str()); + } + } From reid at x10sys.com Tue Feb 13 20:52:41 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 20:52:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/APInt.cpp Message-ID: <200702140252.l1E2qfMK014108@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: APInt.cpp updated: 1.9 -> 1.10 --- Log message: Use brute-force algorithm for to_string. It doesn't have to be efficient at this point, it just needs to work so we can test things reliably. --- Diffs of the changes: (+35 -28) APInt.cpp | 63 ++++++++++++++++++++++++++++++++++---------------------------- 1 files changed, 35 insertions(+), 28 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.9 llvm/lib/Support/APInt.cpp:1.10 --- llvm/lib/Support/APInt.cpp:1.9 Tue Feb 13 16:41:58 2007 +++ llvm/lib/Support/APInt.cpp Tue Feb 13 20:52:25 2007 @@ -13,7 +13,6 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/APInt.h" - #include "llvm/DerivedTypes.h" #include "llvm/Support/MathExtras.h" #include @@ -814,36 +813,44 @@ std::string APInt::to_string(uint8_t radix) const { assert((radix == 10 || radix == 8 || radix == 16 || radix == 2) && "Radix should be 2, 8, 10, or 16!"); - char *buf = 0; - unsigned n = getNumWords() * 64 - CountLeadingZeros(); - std::string format = radix == 8 ? - "%0*llo" : (radix == 10 ? "%0*llu" : "%0*llx"); - // If the radix is a power of 2, set the format of ostringstream, - // and output the value into buf. - if ((radix & (radix - 1)) == 0) { - assert((buf = new char[n / Log2_32(radix) + 2]) && - "Memory allocation failed"); - if (isSingleWord()) - sprintf(buf, format.c_str(), 0, VAL); - else { - unsigned offset = sprintf(buf, format.c_str(), 0, pVal[whichWord(n-1)]); - for (int i = whichWord(n-1) - 1; i >= 0; --i) - offset += sprintf(buf + offset, format.c_str(), - 64 / Log2_32(radix) + (64 % Log2_32(radix) ? 1 : 0), pVal[i]); + static const char *digits[] = { + "0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F" + }; + std::string result; + unsigned bits_used = getNumWords() * 64 - CountLeadingZeros(); + if (isSingleWord()) { + char buf[65]; + const char *format = (radix == 10 ? "%llu" : + (radix == 16 ? "%llX" : (radix == 8 ? "%llo" : 0))); + if (format) { + sprintf(buf, format, VAL); + } else { + memset(buf, 0, 65); + uint64_t v = VAL; + while (bits_used) { + unsigned bit = v & 1; + bits_used--; + buf[bits_used] = digits[bit][0]; + v >>=1; + } } + result = buf; + return result; } - else { // If the radix = 10, need to translate the value into a - // string. - assert((buf = new char[(n / 64 + 1) * 20]) && "Memory allocation failed"); - if (isSingleWord()) - sprintf(buf, format.c_str(), 0, VAL); - else { - // FIXME: To be supported. - } + + APInt tmp(*this); + APInt divisor(radix,64); + if (tmp == 0) + result = "0"; + else while (tmp != 0) { + APInt APdigit = APIntOps::URem(tmp,divisor); + unsigned digit = APdigit.getValue(); + assert(digit < radix && "URem failed"); + result.insert(0,digits[digit]); + tmp = APIntOps::UDiv(tmp, divisor); } - std::string retStr(buf); - delete[] buf; - return retStr; + + return result; } /// getMaxValue - This function returns the largest value From reid at x10sys.com Tue Feb 13 21:05:49 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 21:05:49 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp Message-ID: <200702140305.l1E35nZ7014697@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: arith.cpp updated: 1.4 -> 1.5 --- Log message: 1. Add a utility function for getting a printable string from an APInt 2. Comment out the ByteSwap function, it crashes. 3. Prevent divid by zero. 4. Test every bit width from 1 to 1024, not 1024 random bit widths. --- Diffs of the changes: (+20 -14) arith.cpp | 34 ++++++++++++++++++++-------------- 1 files changed, 20 insertions(+), 14 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.4 llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.5 --- llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.4 Tue Feb 13 16:40:41 2007 +++ llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp Tue Feb 13 21:05:33 2007 @@ -19,8 +19,9 @@ APInt y(0x0fffff, 21); +static std::string temp_str; + const char* str(const APInt& X) { - static std::string temp_str; temp_str = X.to_string(); return temp_str.c_str(); } @@ -89,15 +90,17 @@ printf("val.CountTrailingZeros() = %d\n", val.CountTrailingZeros()); printf("val.CountPopulation() = %d\n", val.CountPopulation()); printf("val.getNumBits() = %d\n", val.getNumBits()); - x = val.ByteSwap(); - printf("val.ByteSwap() = %d\n", str(x)); + if (val.getNumBits() >= 16 && val.getNumBits() % 16 == 0) { + // FIXME: ByteSwap crashes! + // x = val.ByteSwap(); + printf("val.ByteSwap() = %d\n", str(x)); + } printf("val.RoundToDouble(true) %d = %f\n", val.RoundToDouble(true)); printf("val.getValue() = "); if (val.getNumBits() > 64) printf("too wide\n"); else printf("%ul\n", val.getValue()); - } void test_binops(const APInt &v1, const APInt &v2) { @@ -151,21 +154,24 @@ printf("LShr(v1,%d) = %s\n", shiftAmt, str(result)); result = Shl(v1,shiftAmt); printf("Shl(v1,%d) = %s\n", shiftAmt, str(result)); - result = SDiv(v1,v2); - printf("SDiv(v1,v2) = %s\n", str(result)); - result = UDiv(v1,v2); - printf("UDiv(v1,v2) = %s\n", str(result)); - result = SRem(v1,v2); - printf("SRem(v1,v2) = %s\n", str(result)); - result = URem(v1,v2); - printf("URem(v1,v2) = %s\n", str(result)); + if (v2 == 0) + printf("SDiv/UDiv/SRem/URem not tested, v2 == 0\n"); + else { + result = SDiv(v1,v2); + printf("SDiv(v1,v2) = %s\n", str(result)); + result = UDiv(v1,v2); + printf("UDiv(v1,v2) = %s\n", str(result)); + result = SRem(v1,v2); + printf("SRem(v1,v2) = %s\n", str(result)); + result = URem(v1,v2); + printf("URem(v1,v2) = %s\n", str(result)); + } } } void test_multiple() { srand(0); - for (unsigned i = 0; i < 1024; ++i) { - unsigned bits = rand() % 1024; + for (unsigned bits = 1; bits <= 1024; ++bits) { APInt v1(0u, bits); APInt v2(0u, bits); for (unsigned i = 0; i < bits; ++i) { From reid at x10sys.com Tue Feb 13 21:38:42 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 21:38:42 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp Message-ID: <200702140338.l1E3cg5o016124@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: arith.cpp updated: 1.5 -> 1.6 --- Log message: Clean up some output. Actually shift the bits when generating the random values. --- Diffs of the changes: (+6 -4) arith.cpp | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp diff -u llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.5 llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.6 --- llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp:1.5 Tue Feb 13 21:05:33 2007 +++ llvm-test/SingleSource/UnitTests/Integer/APInt/arith.cpp Tue Feb 13 21:38:26 2007 @@ -100,11 +100,12 @@ if (val.getNumBits() > 64) printf("too wide\n"); else - printf("%ul\n", val.getValue()); + printf("%lu\n", val.getValue()); } void test_binops(const APInt &v1, const APInt &v2) { - printf("BINARY OPERATORS TEST: vl = %s, v2 = %s\n", str(v1), str(v2)); + printf("BINARY OPERATORS TEST: vl = %s, ", str(v1)); + printf("v2 = %s\n", str(v2)); APInt result(v1); result &= v2; printf("v1 &= v2: %s\n", str(result)); @@ -176,14 +177,15 @@ APInt v2(0u, bits); for (unsigned i = 0; i < bits; ++i) { unsigned bit = rand() % 2; - v1.Shl(1); + v1 = v1.Shl(1); v1 |= bit; } for (unsigned i = 0; i < bits; ++i) { unsigned bit = rand() % 2; - v2.Shl(1); + v2 = v2.Shl(1); v2 |= bit; } + printf("\nTEST CASE: %d bits\n\n", bits); test_interface(v1); test_unops(v2); test_binops(v1,v2); From reid at x10sys.com Tue Feb 13 21:47:56 2007 From: reid at x10sys.com (Reid Spencer) Date: Tue, 13 Feb 2007 21:47:56 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile Message-ID: <200702140347.l1E3lulG016489@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer/APInt: Makefile updated: 1.2 -> 1.3 --- Log message: Disable optimization for better testing. --- Diffs of the changes: (+1 -1) Makefile | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile diff -u llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile:1.2 llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile:1.3 --- llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile:1.2 Tue Feb 13 20:49:22 2007 +++ llvm-test/SingleSource/UnitTests/Integer/APInt/Makefile Tue Feb 13 21:47:40 2007 @@ -5,4 +5,4 @@ include $(LEVEL)/SingleSource/Makefile.singlesrc LDFLAGS += -L$(LLVM_OBJ_ROOT)/Debug/lib -lLLVMSupport -lLLVMSystem -lstdc++ -CXXFLAGS += -I$(LLVM_SRC_ROOT)/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__NO_MATH_INLINES -g +CXXFLAGS += -I$(LLVM_SRC_ROOT)/include -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__NO_MATH_INLINES -g -O0 From clattner at apple.com Tue Feb 13 23:44:24 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 Feb 2007 21:44:24 -0800 Subject: [llvm-commits] (yet another) updated TargetData patch In-Reply-To: <20070213181945.GA3344@rush.aero.org> References: <20070213181945.GA3344@rush.aero.org> Message-ID: On Feb 13, 2007, at 10:19 AM, Scott Michel wrote: > - Merged llvm HEAD changes. > - Found/fixed structure size calculation bug. > > Hi Scott, I'm going to commit this patch, because it looks like a great step forward and is a pain for you to maintain. I'll respond to my own commits with specific changes to be made though, please follow through! Thanks! -Chris From sabre at nondot.org Tue Feb 13 23:52:50 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:50 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200702140552.l1E5qor5022613@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.92 -> 1.93 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+309 -216) TargetData.cpp | 525 +++++++++++++++++++++++++++++++++------------------------ 1 files changed, 309 insertions(+), 216 deletions(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.92 llvm/lib/Target/TargetData.cpp:1.93 --- llvm/lib/Target/TargetData.cpp:1.92 Sat Feb 10 14:26:17 2007 +++ llvm/lib/Target/TargetData.cpp Tue Feb 13 23:52:17 2007 @@ -36,12 +36,6 @@ RegisterPass X("targetdata", "Target Data Layout"); } -static inline void getTypeInfoABI(const Type *Ty, const TargetData *TD, - uint64_t &Size, unsigned char &Alignment); - -static inline void getTypeInfoPref(const Type *Ty, const TargetData *TD, - uint64_t &Size, unsigned char &Alignment); - //===----------------------------------------------------------------------===// // Support for StructLayout //===----------------------------------------------------------------------===// @@ -54,11 +48,10 @@ // Loop over each of the elements, placing them in memory... for (unsigned i = 0, e = NumElements; i != e; ++i) { const Type *Ty = ST->getElementType(i); - unsigned char A; unsigned TyAlign; uint64_t TySize; - getTypeInfoABI(Ty, &TD, TySize, A); - TyAlign = ST->isPacked() ? 1 : A; + TyAlign = (unsigned) TD.getABITypeAlignment(Ty); + TySize = (unsigned) TD.getTypeSize(Ty); // Add padding if necessary to make the data element aligned properly... if (StructSize % TyAlign != 0) @@ -96,38 +89,126 @@ } //===----------------------------------------------------------------------===// +// TargetAlignElem, TargetAlign support +//===----------------------------------------------------------------------===// + +TargetAlignElem +TargetAlignElem::get(AlignTypeEnum align_type, unsigned char abi_align, + unsigned char pref_align, short bit_width) +{ + TargetAlignElem retval; + retval.AlignType = align_type; + retval.ABIAlign = abi_align; + retval.PrefAlign = pref_align; + retval.TypeBitWidth = bit_width; + return retval; +} + +bool +TargetAlignElem::operator<(const TargetAlignElem &rhs) const +{ + return ((AlignType < rhs.AlignType) + || (AlignType == rhs.AlignType && TypeBitWidth < rhs.TypeBitWidth)); +} + +bool +TargetAlignElem::operator==(const TargetAlignElem &rhs) const +{ + return (AlignType == rhs.AlignType + && ABIAlign == rhs.ABIAlign + && PrefAlign == rhs.PrefAlign + && TypeBitWidth == rhs.TypeBitWidth); +} + +std::ostream & +TargetAlignElem::dump(std::ostream &os) const +{ + return os << AlignType + << TypeBitWidth + << ":" << (int) (ABIAlign * 8) + << ":" << (int) (PrefAlign * 8); +} + +std::ostream & +llvm::operator<<(std::ostream &os, const TargetAlignElem &elem) +{ + return elem.dump(os); +} + +const TargetAlignElem TargetData::InvalidAlignmentElem = + TargetAlignElem::get((AlignTypeEnum) -1, 0, 0, 0); + +//===----------------------------------------------------------------------===// // TargetData Class Implementation //===----------------------------------------------------------------------===// +/*! + A TargetDescription string consists of a sequence of hyphen-delimited + specifiers for target endianness, pointer size and alignments, and various + primitive type sizes and alignments. A typical string looks something like: +
      + "E-p:32:32:32-i1:8:8-i8:8:8-i32:32:32-i64:32:64-f32:32:32-f64:32:64" +
      + (note: this string is not fully specified and is only an example.) + \p + Alignments come in two flavors: ABI and preferred. ABI alignment (abi_align, + below) dictates how a type will be aligned within an aggregate and when used + as an argument. Preferred alignment (pref_align, below) determines a type's + alignment when emitted as a global. + \p + Specifier string details: +

      + [E|e]: Endianness. "E" specifies a big-endian target data model, "e" + specifies a little-endian target data model. +

      + p:::: Pointer size, ABI and preferred + alignment. +

      + ::: Numeric type alignment. Type is + one of i|f|v|a, corresponding to integer, floating point, vector (aka + packed) or aggregate. Size indicates the size, e.g., 32 or 64 bits. + \p + The default string, fully specified is: +

      + "E-p:64:64:64-a0:0:0-f32:32:32-f64:0:64" + "-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:0:64" + "-v64:64:64-v128:128:128" +

      + Note that in the case of aggregates, 0 is the default ABI and preferred + alignment. This is a special case, where the aggregate's computed worst-case + alignment will be used. + */ void TargetData::init(const std::string &TargetDescription) { std::string temp = TargetDescription; LittleEndian = false; PointerMemSize = 8; - PointerABIAlignment = 8; - DoubleABIAlignment = 0; - FloatABIAlignment = 4; - LongABIAlignment = 0; - IntABIAlignment = 4; - ShortABIAlignment = 2; - ByteABIAlignment = 1; - BoolABIAlignment = 1; - BoolPrefAlignment = BoolABIAlignment; - BytePrefAlignment = ByteABIAlignment; - ShortPrefAlignment = ShortABIAlignment; - IntPrefAlignment = IntABIAlignment; - LongPrefAlignment = 8; - FloatPrefAlignment = FloatABIAlignment; - DoublePrefAlignment = 8; - PointerPrefAlignment = PointerABIAlignment; - AggMinPrefAlignment = 0; + PointerABIAlign = 8; + PointerPrefAlign = PointerABIAlign; + + // Default alignments + setAlignment(INTEGER_ALIGN, 1, 1, 1); // Bool + setAlignment(INTEGER_ALIGN, 1, 1, 8); // Byte + setAlignment(INTEGER_ALIGN, 2, 2, 16); // short + setAlignment(INTEGER_ALIGN, 4, 4, 32); // int + setAlignment(INTEGER_ALIGN, 0, 8, 64); // long + setAlignment(FLOAT_ALIGN, 4, 4, 32); // float + setAlignment(FLOAT_ALIGN, 0, 8, 64); // double + setAlignment(PACKED_ALIGN, 8, 8, 64); // v2i32 + setAlignment(PACKED_ALIGN, 16, 16, 128); // v16i8, v8i16, v4i32, ... + setAlignment(AGGREGATE_ALIGN, 0, 0, 0); // struct, union, class, ... while (!temp.empty()) { std::string token = getToken(temp, "-"); - char signal = getToken(token, ":")[0]; - - switch(signal) { + std::string arg0 = getToken(token, ":"); + const char *p = arg0.c_str(); + AlignTypeEnum align_type; + short size; + unsigned char abi_align; + unsigned char pref_align; + + switch(*p) { case 'E': LittleEndian = false; break; @@ -136,56 +217,26 @@ break; case 'p': PointerMemSize = atoi(getToken(token,":").c_str()) / 8; - PointerABIAlignment = atoi(getToken(token,":").c_str()) / 8; - PointerPrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (PointerPrefAlignment == 0) - PointerPrefAlignment = PointerABIAlignment; - break; - case 'd': - DoubleABIAlignment = atoi(getToken(token,":").c_str()) / 8; - DoublePrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (DoublePrefAlignment == 0) - DoublePrefAlignment = DoubleABIAlignment; - break; - case 'f': - FloatABIAlignment = atoi(getToken(token, ":").c_str()) / 8; - FloatPrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (FloatPrefAlignment == 0) - FloatPrefAlignment = FloatABIAlignment; - break; - case 'l': - LongABIAlignment = atoi(getToken(token, ":").c_str()) / 8; - LongPrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (LongPrefAlignment == 0) - LongPrefAlignment = LongABIAlignment; + PointerABIAlign = atoi(getToken(token,":").c_str()) / 8; + PointerPrefAlign = atoi(getToken(token,":").c_str()) / 8; + if (PointerPrefAlign == 0) + PointerPrefAlign = PointerABIAlign; break; case 'i': - IntABIAlignment = atoi(getToken(token, ":").c_str()) / 8; - IntPrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (IntPrefAlignment == 0) - IntPrefAlignment = IntABIAlignment; - break; - case 's': - ShortABIAlignment = atoi(getToken(token, ":").c_str()) / 8; - ShortPrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (ShortPrefAlignment == 0) - ShortPrefAlignment = ShortABIAlignment; - break; - case 'b': - ByteABIAlignment = atoi(getToken(token, ":").c_str()) / 8; - BytePrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (BytePrefAlignment == 0) - BytePrefAlignment = ByteABIAlignment; - break; - case 'B': - BoolABIAlignment = atoi(getToken(token, ":").c_str()) / 8; - BoolPrefAlignment = atoi(getToken(token,":").c_str()) / 8; - if (BoolPrefAlignment == 0) - BoolPrefAlignment = BoolABIAlignment; - break; - case 'A': - AggMinPrefAlignment = atoi(getToken(token,":").c_str()) / 8; + case 'v': + case 'f': + case 'a': { + align_type = (*p == 'i' ? INTEGER_ALIGN : + (*p == 'f' ? FLOAT_ALIGN : + (*p == 'v' ? PACKED_ALIGN : AGGREGATE_ALIGN))); + size = (short) atoi(++p); + abi_align = atoi(getToken(token, ":").c_str()) / 8; + pref_align = atoi(getToken(token, ":").c_str()) / 8; + if (pref_align == 0) + pref_align = abi_align; + setAlignment(align_type, abi_align, pref_align, size); break; + } default: break; } @@ -193,16 +244,62 @@ // Unless explicitly specified, the alignments for longs and doubles is // capped by pointer size. - if (LongABIAlignment == 0) - LongABIAlignment = LongPrefAlignment = PointerMemSize; - if (DoubleABIAlignment == 0) - DoubleABIAlignment = DoublePrefAlignment = PointerMemSize; + // FIXME: Is this still necessary? + const TargetAlignElem &long_align = getAlignment(INTEGER_ALIGN, 64); + if (long_align.ABIAlign == 0) + setAlignment(INTEGER_ALIGN, PointerMemSize, PointerMemSize, 64); + + const TargetAlignElem &double_align = getAlignment(FLOAT_ALIGN, 64); + if (double_align.ABIAlign == 0) + setAlignment(FLOAT_ALIGN, PointerMemSize, PointerMemSize, 64); } TargetData::TargetData(const Module *M) { init(M->getDataLayout()); } +void +TargetData::setAlignment(AlignTypeEnum align_type, unsigned char abi_align, + unsigned char pref_align, short bit_width) { + TargetAlignElem elt = TargetAlignElem::get(align_type, abi_align, + pref_align, bit_width); + std::pair ins_result = + std::equal_range(Alignments.begin(), Alignments.end(), elt); + align_iterator I = ins_result.first; + if (I->AlignType == align_type && I->TypeBitWidth == bit_width) { + // Update the abi, preferred alignments. + I->ABIAlign = abi_align; + I->PrefAlign = pref_align; + } else + Alignments.insert(I, elt); + +#if 0 + // Keep around for debugging and testing... + align_iterator E = ins_result.second; + + cerr << "setAlignment(" << elt << ")\n"; + cerr << "I = " << (I - Alignments.begin()) + << ", E = " << (E - Alignments.begin()) << "\n"; + std::copy(Alignments.begin(), Alignments.end(), + std::ostream_iterator(*cerr, "\n")); + cerr << "=====\n"; +#endif +} + +const TargetAlignElem & +TargetData::getAlignment(AlignTypeEnum align_type, short bit_width) const +{ + std::pair find_result = + std::equal_range(Alignments.begin(), Alignments.end(), + TargetAlignElem::get(align_type, 0, 0, + bit_width)); + align_const_iterator I = find_result.first; + + // Note: This may not be reasonable if variable-width integer sizes are + // passed, at which point, more sophisticated searching will need to be done. + return *I; +} + /// LayoutInfo - The lazy cache of structure layout information maintained by /// TargetData. Note that the struct types must have been free'd before /// llvm_shutdown is called (and thus this is deallocated) because all the @@ -280,190 +377,187 @@ } +struct hyphen_delimited : + public std::iterator +{ + std::ostream &o; + + hyphen_delimited(std::ostream &os) : + o(os) + { } + + hyphen_delimited &operator=(const TargetAlignElem &elem) + { + o << "-" << elem; + return *this; + } + + hyphen_delimited &operator*() + { + return *this; + } + + hyphen_delimited &operator++() + { + return *this; + } +}; + + std::string TargetData::getStringRepresentation() const { std::stringstream repr; - + if (LittleEndian) repr << "e"; else repr << "E"; - - repr << "-p:" << (PointerMemSize * 8) << ":" << (PointerABIAlignment * 8); - repr << "-d:" << (DoubleABIAlignment * 8) << ":" - << (DoublePrefAlignment * 8); - repr << "-f:" << (FloatABIAlignment * 8) << ":" - << (FloatPrefAlignment * 8); - repr << "-l:" << (LongABIAlignment * 8) << ":" - << (LongPrefAlignment * 8); - repr << "-i:" << (IntABIAlignment * 8) << ":" - << (IntPrefAlignment * 8); - repr << "-s:" << (ShortABIAlignment * 8) << ":" - << (ShortPrefAlignment * 8); - repr << "-b:" << (ByteABIAlignment * 8) << ":" - << (BytePrefAlignment * 8); - repr << "-B:" << (BoolABIAlignment * 8) << ":" - << (BoolPrefAlignment * 8); - repr << "-A:" << (AggMinPrefAlignment * 8); - + repr << "-p:" << (PointerMemSize * 8) << ":" << (PointerABIAlign * 8) + << ":" << (PointerPrefAlign * 8); + std::copy(Alignments.begin(), Alignments.end(), hyphen_delimited(repr)); return repr.str(); } -static inline void getTypeInfoABI(const Type *Ty, const TargetData *TD, - uint64_t &Size, unsigned char &Alignment) { +uint64_t TargetData::getTypeSize(const Type *Ty) const { assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"); switch (Ty->getTypeID()) { - case Type::IntegerTyID: { - unsigned BitWidth = cast(Ty)->getBitWidth(); - if (BitWidth <= 8) { - Size = 1; Alignment = TD->getByteABIAlignment(); - } else if (BitWidth <= 16) { - Size = 2; Alignment = TD->getShortABIAlignment(); - } else if (BitWidth <= 32) { - Size = 4; Alignment = TD->getIntABIAlignment(); - } else if (BitWidth <= 64) { - Size = 8; Alignment = TD->getLongABIAlignment(); - } else { - Size = ((BitWidth + 7) / 8) & ~1; - Alignment = TD->getLongABIAlignment(); - } - return; - } - case Type::VoidTyID: Size = 1; Alignment = TD->getByteABIAlignment(); return; - case Type::FloatTyID: Size = 4; Alignment = TD->getFloatABIAlignment(); return; - case Type::DoubleTyID: Size = 8; Alignment = TD->getDoubleABIAlignment(); return; case Type::LabelTyID: case Type::PointerTyID: - Size = TD->getPointerSize(); Alignment = TD->getPointerABIAlignment(); - return; + return getPointerSize(); case Type::ArrayTyID: { const ArrayType *ATy = cast(Ty); - getTypeInfoABI(ATy->getElementType(), TD, Size, Alignment); + uint64_t Size; + unsigned char Alignment; + Size = getTypeSize(ATy->getElementType()); + Alignment = getABITypeAlignment(ATy->getElementType()); unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment; - Size = AlignedSize*ATy->getNumElements(); - return; - } - case Type::PackedTyID: { - const PackedType *PTy = cast(Ty); - getTypeInfoABI(PTy->getElementType(), TD, Size, Alignment); - unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment; - Size = AlignedSize*PTy->getNumElements(); - // FIXME: The alignments of specific packed types are target dependent. - // For now, just set it to be equal to Size. - Alignment = Size; - return; + return AlignedSize*ATy->getNumElements(); } case Type::StructTyID: { // Get the layout annotation... which is lazily created on demand. - const StructLayout *Layout = TD->getStructLayout(cast(Ty)); - Size = Layout->getSizeInBytes(); Alignment = Layout->getAlignment(); - return; - } - - default: - assert(0 && "Bad type for getTypeInfo!!!"); - return; + const StructLayout *Layout = getStructLayout(cast(Ty)); + return Layout->getSizeInBytes(); } -} - -static inline void getTypeInfoPref(const Type *Ty, const TargetData *TD, - uint64_t &Size, unsigned char &Alignment) { - assert(Ty->isSized() && "Cannot getTypeInfoPref() on a type that is unsized!"); - switch (Ty->getTypeID()) { case Type::IntegerTyID: { unsigned BitWidth = cast(Ty)->getBitWidth(); if (BitWidth <= 8) { - Size = 1; Alignment = TD->getBytePrefAlignment(); + return 1; } else if (BitWidth <= 16) { - Size = 2; Alignment = TD->getShortPrefAlignment(); + return 2; } else if (BitWidth <= 32) { - Size = 4; Alignment = TD->getIntPrefAlignment(); + return 4; } else if (BitWidth <= 64) { - Size = 8; Alignment = TD->getLongPrefAlignment(); + return 8; } else assert(0 && "Integer types > 64 bits not supported."); - return; + break; } case Type::VoidTyID: - Size = 1; Alignment = TD->getBytePrefAlignment(); - return; + return 1; case Type::FloatTyID: - Size = 4; Alignment = TD->getFloatPrefAlignment(); - return; + return 4; case Type::DoubleTyID: - Size = 8; Alignment = TD->getDoublePrefAlignment(); - return; + return 8; + case Type::PackedTyID: { + const PackedType *PTy = cast(Ty); + return PTy->getBitWidth() / 8; + } + default: + assert(0 && "TargetData::getTypeSize(): Unsupported type"); + break; + } + return 0; +} + +uint64_t TargetData::getTypeSizeInBits(const Type *Ty) const { + if (Ty->isInteger()) + return cast(Ty)->getBitWidth(); + else + return getTypeSize(Ty) * 8; +} + + +/*! + \param abi_or_pref Flag that determines which alignment is returned. true + returns the ABI alignment, false returns the preferred alignment. + \param Ty The underlying type for which alignment is determined. + + Get the ABI (\a abi_or_pref == true) or preferred alignment (\a abi_or_pref + == false) for the requested type \a Ty. + */ +unsigned char TargetData::getAlignment(const Type *Ty, bool abi_or_pref) const +{ + int AlignType = -1; + + assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"); + switch (Ty->getTypeID()) { + /* Early escape for the non-numeric types */ case Type::LabelTyID: case Type::PointerTyID: - Size = TD->getPointerSize(); Alignment = TD->getPointerPrefAlignment(); - return; + return (abi_or_pref + ? getPointerABIAlignment() + : getPointerPrefAlignment()); case Type::ArrayTyID: { const ArrayType *ATy = cast(Ty); - getTypeInfoPref(ATy->getElementType(), TD, Size, Alignment); - unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment; - Size = AlignedSize*ATy->getNumElements(); - return; - } - case Type::PackedTyID: { - const PackedType *PTy = cast(Ty); - getTypeInfoPref(PTy->getElementType(), TD, Size, Alignment); - unsigned AlignedSize = (Size + Alignment - 1)/Alignment*Alignment; - Size = AlignedSize*PTy->getNumElements(); - // FIXME: The alignments of specific packed types are target dependent. - // For now, just set it to be equal to Size. - Alignment = Size; - return; + return (abi_or_pref + ? getABITypeAlignment(ATy->getElementType()) + : getPrefTypeAlignment(ATy->getElementType())); } case Type::StructTyID: { - // Get the layout annotation... which is lazily created on demand; - // enforce minimum aggregate alignment. - const StructLayout *Layout = TD->getStructLayout(cast(Ty)); - Size = Layout->getSizeInBytes(); - Alignment = std::max(Layout->getAlignment(), - (const unsigned int)TD->getAggMinPrefAlignment()); - return; + // Get the layout annotation... which is lazily created on demand. + const StructLayout *Layout = getStructLayout(cast(Ty)); + const TargetAlignElem &elem = getAlignment(AGGREGATE_ALIGN, 0); + assert(validAlignment(elem) + && "Aggregate alignment return invalid in getAlignment"); + if (abi_or_pref) { + return (elem.ABIAlign < Layout->getAlignment() + ? Layout->StructAlignment + : elem.ABIAlign); + } else { + return (elem.PrefAlign < Layout->getAlignment() + ? Layout->StructAlignment + : elem.PrefAlign); + } } - + case Type::IntegerTyID: + case Type::VoidTyID: + AlignType = INTEGER_ALIGN; + break; + case Type::FloatTyID: + case Type::DoubleTyID: + AlignType = FLOAT_ALIGN; + break; + case Type::PackedTyID: + AlignType = PACKED_ALIGN; + break; default: - assert(0 && "Bad type for getTypeInfoPref!!!"); - return; + assert(0 && "Bad type for getAlignment!!!"); + break; } -} - -uint64_t TargetData::getTypeSize(const Type *Ty) const { - uint64_t Size; - unsigned char Align; - getTypeInfoABI(Ty, this, Size, Align); - return Size; + const TargetAlignElem &elem = getAlignment((AlignTypeEnum) AlignType, + getTypeSize(Ty) * 8); + if (validAlignment(elem)) + return (abi_or_pref ? elem.ABIAlign : elem.PrefAlign); + else { + cerr << "TargetData::getAlignment: align type " << AlignType + << " size " << getTypeSize(Ty) << " not found in Alignments.\n"; + abort(); + /*NOTREACHED*/ + return 0; + } } -uint64_t TargetData::getTypeSizeInBits(const Type *Ty) const { - if (Ty->isInteger()) - return cast(Ty)->getBitWidth(); +unsigned char TargetData::getABITypeAlignment(const Type *Ty) const { + return getAlignment(Ty, true); +} - uint64_t Size; - unsigned char Align; - getTypeInfoABI(Ty, this, Size, Align); - return Size * 8; -} - -unsigned char TargetData::getTypeAlignmentABI(const Type *Ty) const { - uint64_t Size; - unsigned char Align; - getTypeInfoABI(Ty, this, Size, Align); - return Align; -} - -unsigned char TargetData::getTypeAlignmentPref(const Type *Ty) const { - uint64_t Size; - unsigned char Align; - getTypeInfoPref(Ty, this, Size, Align); - return Align; +unsigned char TargetData::getPrefTypeAlignment(const Type *Ty) const { + return getAlignment(Ty, false); } unsigned char TargetData::getPreferredTypeAlignmentShift(const Type *Ty) const { - unsigned Align = getTypeAlignmentPref(Ty); + unsigned Align = (unsigned) getPrefTypeAlignment(Ty); assert(!(Align & (Align-1)) && "Alignment is not a power of two!"); return Log2_32(Align); } @@ -533,4 +627,3 @@ } return Alignment; } - From sabre at nondot.org Tue Feb 13 23:52:54 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:54 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetMachine.cpp Message-ID: <200702140552.l1E5qs59022620@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMTargetMachine.cpp updated: 1.23 -> 1.24 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+6 -4) ARMTargetMachine.cpp | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.23 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.24 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.23 Tue Feb 13 14:06:15 2007 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 23:52:17 2007 @@ -37,12 +37,14 @@ DataLayout(Subtarget.isAPCS_ABI() ? // APCS ABI (Subtarget.isThumb() ? - std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B:8:32-A:32") : - std::string("e-p:32:32-d:32:32-l:32:32")) : + std::string("e-p:32:32-f64:32:32-i64:32:32-" + "i16:16:32-i8:8:32-i1:8:32-a:0:32") : + std::string("e-p:32:32-f64:32:32-i64:32:32")) : // AAPCS ABI (Subtarget.isThumb() ? - std::string("e-p:32:32-d:64:64-l:64:64-s:16:32-b:8:32-B:8:32-A:32") : - std::string("e-p:32:32-d:64:64-l:64:64"))), + std::string("e-p:32:32-f64:64:64-i64:64:64-" + "i16:16:32-i8:8:32-i1:8:32-a:0:32") : + std::string("e-p:32:32-f64:64:64-i64:64:64"))), InstrInfo(Subtarget), FrameInfo(Subtarget) {} From sabre at nondot.org Tue Feb 13 23:52:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp Message-ID: <200702140552.l1E5qubJ022627@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.141 -> 1.142 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+2 -2) X86TargetMachine.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.141 llvm/lib/Target/X86/X86TargetMachine.cpp:1.142 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.141 Wed Feb 7 19:39:44 2007 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Tue Feb 13 23:52:17 2007 @@ -109,8 +109,8 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS, bool is64Bit) : Subtarget(M, FS, is64Bit), DataLayout(Subtarget.is64Bit() ? - std::string("e-p:64:64-d:32:64-l:32:64") : - std::string("e-p:32:32-d:32:64-l:32:64")), + std::string("e-p:64:64-f64:32:64-i64:32:64") : + std::string("e-p:32:32-f64:32:64-i64:32:64")), FrameInfo(TargetFrameInfo::StackGrowsDown, Subtarget.getStackAlignment(), Subtarget.is64Bit() ? -8 : -4), InstrInfo(*this), JITInfo(*this), TLInfo(*this) { From sabre at nondot.org Tue Feb 13 23:52:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:56 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h Message-ID: <200702140552.l1E5quRD022630@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.53 -> 1.54 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+99 -153) TargetData.h | 252 +++++++++++++++++++++++------------------------------------ 1 files changed, 99 insertions(+), 153 deletions(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.53 llvm/include/llvm/Target/TargetData.h:1.54 --- llvm/include/llvm/Target/TargetData.h:1.53 Sat Feb 10 14:37:40 2007 +++ llvm/include/llvm/Target/TargetData.h Tue Feb 13 23:52:16 2007 @@ -22,6 +22,8 @@ #include "llvm/Pass.h" #include "llvm/Support/DataTypes.h" +#include "llvm/ADT/SmallVector.h" +#include namespace llvm { @@ -31,45 +33,96 @@ class StructLayout; class GlobalVariable; -class TargetData : public ImmutablePass { - bool LittleEndian; // Defaults to false +/// Enum used to categorize the alignment types stored by TargetAlignElem +enum AlignTypeEnum { + INTEGER_ALIGN = 'i', ///< Integer type alignment + PACKED_ALIGN = 'v', ///< Vector type alignment + FLOAT_ALIGN = 'f', ///< Floating point type alignment + AGGREGATE_ALIGN = 'a' ///< Aggregate alignment +}; +/// Target alignment element. +/// +/// Stores the alignment data associated with a given alignment type (pointer, +/// integer, packed/vector, float) and type bit width. +/// +/// @note The unusual order of elements in the structure attempts to reduce +/// padding and make the structure slightly more cache friendly. +struct TargetAlignElem { + unsigned char AlignType; //< Alignment type (AlignTypeEnum) + unsigned char ABIAlign; //< ABI alignment for this type/bitw + unsigned char PrefAlign; //< Pref. alignment for this type/bitw + short TypeBitWidth; //< Type bit width + + /// Initializer + static TargetAlignElem get(AlignTypeEnum align_type, unsigned char abi_align, + unsigned char pref_align, short bit_width); + /// Less-than predicate + bool operator<(const TargetAlignElem &rhs) const; + /// Equality predicate + bool operator==(const TargetAlignElem &rhs) const; + /// output stream operator + std::ostream &dump(std::ostream &os) const; +}; - // ABI alignments - unsigned char BoolABIAlignment; // Defaults to 1 byte - unsigned char ByteABIAlignment; // Defaults to 1 byte - unsigned char ShortABIAlignment; // Defaults to 2 bytes - unsigned char IntABIAlignment; // Defaults to 4 bytes - unsigned char LongABIAlignment; // Defaults to 8 bytes - unsigned char FloatABIAlignment; // Defaults to 4 bytes - unsigned char DoubleABIAlignment; // Defaults to 8 bytes - unsigned char PointerMemSize; // Defaults to 8 bytes - unsigned char PointerABIAlignment; // Defaults to 8 bytes - - // Preferred stack/global type alignments - unsigned char BoolPrefAlignment; // Defaults to BoolABIAlignment - unsigned char BytePrefAlignment; // Defaults to ByteABIAlignment - unsigned char ShortPrefAlignment; // Defaults to ShortABIAlignment - unsigned char IntPrefAlignment; // Defaults to IntABIAlignment - unsigned char LongPrefAlignment; // Defaults to LongABIAlignment - unsigned char FloatPrefAlignment; // Defaults to FloatABIAlignment - unsigned char DoublePrefAlignment; // Defaults to DoubleABIAlignment - unsigned char PointerPrefAlignment; // Defaults to PointerABIAlignment - unsigned char AggMinPrefAlignment; // Defaults to 0 bytes +//! TargetAlignElem output stream inserter +/*! + @sa TargetAlignElem::dump() + */ +std::ostream &operator<<(std::ostream &os, const TargetAlignElem &elem); + +class TargetData : public ImmutablePass { +private: + bool LittleEndian; ///< Defaults to false + unsigned char PointerMemSize; ///< Pointer size in bytes + unsigned char PointerABIAlign; ///< Pointer ABI alignment + unsigned char PointerPrefAlign; ///< Pointer preferred global alignment + + //! Where the primitive type alignment data is stored. + /*! + @sa init(). + @note Could support multiple size pointer alignments, e.g., 32-bit pointers + vs. 64-bit pointers by extending TargetAlignment, but for now, we don't. + */ + SmallVector Alignments; + //! Alignment iterator shorthand + typedef SmallVector::iterator align_iterator; + //! Constant alignment iterator shorthand + typedef SmallVector::const_iterator align_const_iterator; + //! Invalid alignment. + /*! + This member is a signal that a requested alignment type and bit width were + not found in the SmallVector. + */ + static const TargetAlignElem InvalidAlignmentElem; + + //! Set/initialize target alignments + void setAlignment(AlignTypeEnum align_type, unsigned char abi_align, + unsigned char pref_align, short bit_width); + //! Get TargetAlignElem from alignment type and bit width + const TargetAlignElem &getAlignment(AlignTypeEnum, short) const; + //! Internal helper method that returns requested alignment for type. + unsigned char getAlignment(const Type *Ty, bool abi_or_pref) const; + + /// Valid alignment predicate. + /// + /// Predicate that tests a TargetAlignElem reference returned by get() against + /// InvalidAlignmentElem. + inline bool validAlignment(const TargetAlignElem &align) const { + return (&align != &InvalidAlignmentElem); + } public: - /// Default ctor - This has to exist, because this is a pass, but it should - /// never be used. + /// Default ctor. + /// + /// @note This has to exist, because this is a pass, but it should never be + /// used. TargetData() { assert(0 && "ERROR: Bad TargetData ctor used. " "Tool did not specify a TargetData to use?"); abort(); } - /// Constructs a TargetData from a string of the following format: - /// "E-p:64:64-d:64-f:32-l:64-i:32-s:16-b:8-B:8" - /// The above string is considered the default, and any values not specified - /// in the string will be assumed to be as above, with the caveat that unspecified - /// values are always assumed to be smaller than the size of a pointer. + /// Constructs a TargetData from a specification string. See init(). TargetData(const std::string &TargetDescription) { init(TargetDescription); } @@ -80,143 +133,36 @@ TargetData(const TargetData &TD) : ImmutablePass(), LittleEndian(TD.isLittleEndian()), - BoolABIAlignment(TD.getBoolABIAlignment()), - ByteABIAlignment(TD.getByteABIAlignment()), - ShortABIAlignment(TD.getShortABIAlignment()), - IntABIAlignment(TD.getIntABIAlignment()), - LongABIAlignment(TD.getLongABIAlignment()), - FloatABIAlignment(TD.getFloatABIAlignment()), - DoubleABIAlignment(TD.getDoubleABIAlignment()), - PointerMemSize(TD.getPointerSize()), - PointerABIAlignment(TD.getPointerABIAlignment()), - BoolPrefAlignment(TD.getBoolPrefAlignment()), - BytePrefAlignment(TD.getBytePrefAlignment()), - ShortPrefAlignment(TD.getShortPrefAlignment()), - IntPrefAlignment(TD.getIntPrefAlignment()), - LongPrefAlignment(TD.getLongPrefAlignment()), - FloatPrefAlignment(TD.getFloatPrefAlignment()), - DoublePrefAlignment(TD.getDoublePrefAlignment()), - PointerPrefAlignment(TD.getPointerPrefAlignment()), - AggMinPrefAlignment(TD.getAggMinPrefAlignment()) { - } + PointerMemSize(TD.PointerMemSize), + PointerABIAlign(TD.PointerABIAlign), + PointerPrefAlign(TD.PointerPrefAlign), + Alignments(TD.Alignments) + { } ~TargetData(); // Not virtual, do not subclass this class - /// Parse a target data layout string and initialize TargetData members. - /// - /// Parse a target data layout string, initializing the various TargetData - /// members along the way. A TargetData specification string looks like - /// "E-p:64:64-d:64-f:32-l:64-i:32-s:16-b:8-B:8" and specifies the - /// target's endianess, the ABI alignments of various data types and - /// the size of pointers. - /// - /// "-" is used as a separator and ":" separates a token from its argument. - /// - /// Alignment is indicated in bits and internally converted to the - /// appropriate number of bytes. - /// - /// The preferred stack/global alignment specifications (":[prefalign]") are - /// optional and default to the ABI alignment. - /// - /// Valid tokens: - ///
      - /// E specifies big endian architecture (1234) [default]
      - /// e specifies little endian architecture (4321)
      - /// p:[ptr size]:[ptr align] specifies pointer size and alignment - /// [default = 64:64]
      - /// d:[align]:[prefalign] specifies double floating - /// point alignment [default = 64]
      - /// f:[align]:[prefalign] specifies single floating - /// point alignment [default = 32]
      - /// l:[align]:[prefalign]:[globalign[ specifies long integer - /// alignment [default = 64]
      - /// i:[align]:[prefalign] specifies integer alignment - /// [default = 32]
      - /// s:[align]:[prefalign] specifies short integer - /// alignment [default = 16]
      - /// b:[align]:[prefalign] specifies byte data type - /// alignment [default = 8]
      - /// B:[align]:[prefalign] specifies boolean data type - /// alignment [default = 8]
      - /// A:[prefalign] specifies an aggregates' minimum alignment - /// on the stack and when emitted as a global. The default minimum aggregate - /// alignment defaults to 0, which causes the aggregate's "natural" internal - /// alignment calculated by llvm to be preferred. - /// - /// All other token types are silently ignored. + //! Parse a target data layout string and initialize TargetData alignments. void init(const std::string &TargetDescription); - /// Target endianness... bool isLittleEndian() const { return LittleEndian; } bool isBigEndian() const { return !LittleEndian; } - /// Target boolean alignment - unsigned char getBoolABIAlignment() const { return BoolABIAlignment; } - /// Target byte alignment - unsigned char getByteABIAlignment() const { return ByteABIAlignment; } - /// Target short alignment - unsigned char getShortABIAlignment() const { return ShortABIAlignment; } - /// Target integer alignment - unsigned char getIntABIAlignment() const { return IntABIAlignment; } - /// Target long alignment - unsigned char getLongABIAlignment() const { return LongABIAlignment; } - /// Target single precision float alignment - unsigned char getFloatABIAlignment() const { return FloatABIAlignment; } - /// Target double precision float alignment - unsigned char getDoubleABIAlignment() const { return DoubleABIAlignment; } - /// Target pointer alignment - unsigned char getPointerABIAlignment() const { return PointerABIAlignment; } - /// Target pointer size - unsigned char getPointerSize() const { return PointerMemSize; } - /// Target pointer size, in bits - unsigned char getPointerSizeInBits() const { return 8*PointerMemSize; } - - /// Return target's alignment for booleans on stack - unsigned char getBoolPrefAlignment() const { - return BoolPrefAlignment; - } - /// Return target's alignment for integers on stack - unsigned char getBytePrefAlignment() const { - return BytePrefAlignment; - } - /// Return target's alignment for shorts on stack - unsigned char getShortPrefAlignment() const { - return ShortPrefAlignment; - } - /// Return target's alignment for integers on stack - unsigned char getIntPrefAlignment() const { - return IntPrefAlignment; - } - /// Return target's alignment for longs on stack - unsigned char getLongPrefAlignment() const { - return LongPrefAlignment; - } - /// Return target's alignment for single precision floats on stack - unsigned char getFloatPrefAlignment() const { - return FloatPrefAlignment; - } - /// Return target's alignment for double preceision floats on stack - unsigned char getDoublePrefAlignment() const { - return DoublePrefAlignment; - } - /// Return target's alignment for stack-based pointers - unsigned char getPointerPrefAlignment() const { - return PointerPrefAlignment; - } - /// Return target's alignment for stack-based structures - unsigned char getAggMinPrefAlignment() const { - return AggMinPrefAlignment; - } - /// getStringRepresentation - Return the string representation of the /// TargetData. This representation is in the same format accepted by the /// string constructor above. std::string getStringRepresentation() const; + /// Target pointer alignment + unsigned char getPointerABIAlignment() const { return PointerABIAlign; } + /// Return target's alignment for stack-based pointers + unsigned char getPointerPrefAlignment() const { return PointerPrefAlign; } + /// Target pointer size + unsigned char getPointerSize() const { return PointerMemSize; } + /// Target pointer size, in bits + unsigned char getPointerSizeInBits() const { return 8*PointerMemSize; } /// getTypeSize - Return the number of bytes necessary to hold the specified /// type. - /// uint64_t getTypeSize(const Type *Ty) const; /// getTypeSizeInBits - Return the number of bytes necessary to hold the @@ -225,11 +171,11 @@ /// getTypeAlignmentABI - Return the minimum ABI-required alignment for the /// specified type. - unsigned char getTypeAlignmentABI(const Type *Ty) const; + unsigned char getABITypeAlignment(const Type *Ty) const; /// getTypeAlignmentPref - Return the preferred stack/global alignment for /// the specified type. - unsigned char getTypeAlignmentPref(const Type *Ty) const; + unsigned char getPrefTypeAlignment(const Type *Ty) const; /// getPreferredTypeAlignmentShift - Return the preferred alignment for the /// specified type, returned as log2 of the value (a shift amount). From sabre at nondot.org Tue Feb 13 23:52:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAGISel.cpp Message-ID: <200702140552.l1E5quwk022639@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.473 -> 1.474 SelectionDAGISel.cpp updated: 1.364 -> 1.365 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+7 -7) LegalizeDAG.cpp | 6 +++--- SelectionDAGISel.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.473 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.474 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.473 Tue Feb 13 17:55:16 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Feb 13 23:52:17 2007 @@ -3056,7 +3056,7 @@ // new ones, as reuse may inhibit scheduling. const Type *Ty = MVT::getTypeForValueType(ExtraVT); unsigned TySize = (unsigned)TLI.getTargetData()->getTypeSize(Ty); - unsigned Align = TLI.getTargetData()->getTypeAlignmentPref(Ty); + unsigned Align = TLI.getTargetData()->getPrefTypeAlignment(Ty); MachineFunction &MF = DAG.getMachineFunction(); int SSFI = MF.getFrameInfo()->CreateStackObject((unsigned)TySize, Align); @@ -3979,7 +3979,7 @@ MachineFrameInfo *FrameInfo = DAG.getMachineFunction().getFrameInfo(); unsigned ByteSize = MVT::getSizeInBits(VT)/8; const Type *Ty = MVT::getTypeForValueType(VT); - unsigned StackAlign = (unsigned)TLI.getTargetData()->getTypeAlignmentPref(Ty); + unsigned StackAlign = (unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty); int FrameIdx = FrameInfo->CreateStackObject(ByteSize, StackAlign); return DAG.getFrameIndex(FrameIdx, TLI.getPointerTy()); } @@ -4289,7 +4289,7 @@ MachineFunction &MF = DAG.getMachineFunction(); const Type *F64Type = MVT::getTypeForValueType(MVT::f64); unsigned StackAlign = - (unsigned)TLI.getTargetData()->getTypeAlignmentPref(F64Type); + (unsigned)TLI.getTargetData()->getPrefTypeAlignment(F64Type); int SSFI = MF.getFrameInfo()->CreateStackObject(8, StackAlign); // get address of 8 byte buffer SDOperand StackSlot = DAG.getFrameIndex(SSFI, TLI.getPointerTy()); Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.364 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.365 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.364 Tue Feb 13 14:09:07 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Feb 13 23:52:17 2007 @@ -244,7 +244,7 @@ const Type *Ty = AI->getAllocatedType(); uint64_t TySize = TLI.getTargetData()->getTypeSize(Ty); unsigned Align = - std::max((unsigned)TLI.getTargetData()->getTypeAlignmentPref(Ty), + std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), AI->getAlignment()); TySize *= CUI->getZExtValue(); // Get total allocated size. @@ -1733,7 +1733,7 @@ const Type *Ty = I.getAllocatedType(); uint64_t TySize = TLI.getTargetData()->getTypeSize(Ty); unsigned Align = - std::max((unsigned)TLI.getTargetData()->getTypeAlignmentPref(Ty), + std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), I.getAlignment()); SDOperand AllocSize = getValue(I.getArraySize()); @@ -2934,7 +2934,7 @@ bool isInReg = FTy->paramHasAttr(j, FunctionType::InRegAttribute); bool isSRet = FTy->paramHasAttr(j, FunctionType::StructRetAttribute); unsigned OriginalAlignment = - getTargetData()->getTypeAlignmentABI(I->getType()); + getTargetData()->getABITypeAlignment(I->getType()); // Flags[31:27] -> OriginalAlignment // Flags[2] -> isSRet // Flags[1] -> isInReg @@ -3120,7 +3120,7 @@ bool isInReg = Args[i].isInReg; bool isSRet = Args[i].isSRet; unsigned OriginalAlignment = - getTargetData()->getTypeAlignmentABI(Args[i].Ty); + getTargetData()->getABITypeAlignment(Args[i].Ty); // Flags[31:27] -> OriginalAlignment // Flags[2] -> isSRet // Flags[1] -> isInReg From sabre at nondot.org Tue Feb 13 23:52:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCSubtarget.h Message-ID: <200702140552.l1E5qu2U022641@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCSubtarget.h updated: 1.23 -> 1.24 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+2 -2) PPCSubtarget.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCSubtarget.h diff -u llvm/lib/Target/PowerPC/PPCSubtarget.h:1.23 llvm/lib/Target/PowerPC/PPCSubtarget.h:1.24 --- llvm/lib/Target/PowerPC/PPCSubtarget.h:1.23 Mon Jan 22 17:11:06 2007 +++ llvm/lib/Target/PowerPC/PPCSubtarget.h Tue Feb 13 23:52:17 2007 @@ -104,8 +104,8 @@ /// getTargetDataString - Return the pointer size and type alignment /// properties of this subtarget. const char *getTargetDataString() const { - return isPPC64() ? "E-p:64:64-d:32:64-l:32:64" - : "E-p:32:32-d:32:64-l:32:64"; + return isPPC64() ? "E-p:64:64-f64:32:64-i64:32:64" + : "E-p:32:32-f64:32:64-i64:32:64"; } /// isPPC64 - Return true if we are generating code for 64-bit pointer mode. From sabre at nondot.org Tue Feb 13 23:52:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcAsmPrinter.cpp Message-ID: <200702140552.l1E5quMI022655@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcAsmPrinter.cpp updated: 1.76 -> 1.77 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+1 -1) SparcAsmPrinter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/Sparc/SparcAsmPrinter.cpp diff -u llvm/lib/Target/Sparc/SparcAsmPrinter.cpp:1.76 llvm/lib/Target/Sparc/SparcAsmPrinter.cpp:1.77 --- llvm/lib/Target/Sparc/SparcAsmPrinter.cpp:1.76 Sat Jan 20 16:35:55 2007 +++ llvm/lib/Target/Sparc/SparcAsmPrinter.cpp Tue Feb 13 23:52:17 2007 @@ -229,7 +229,7 @@ std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); unsigned Size = TD->getTypeSize(C->getType()); - unsigned Align = TD->getTypeAlignmentPref(C->getType()); + unsigned Align = TD->getPrefTypeAlignment(C->getType()); if (C->isNullValue() && (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || From sabre at nondot.org Tue Feb 13 23:52:56 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/ELFWriter.cpp MachOWriter.cpp MachineFunction.cpp Message-ID: <200702140552.l1E5quor022653@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: ELFWriter.cpp updated: 1.37 -> 1.38 MachOWriter.cpp updated: 1.26 -> 1.27 MachineFunction.cpp updated: 1.108 -> 1.109 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+5 -4) ELFWriter.cpp | 2 +- MachOWriter.cpp | 4 ++-- MachineFunction.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/CodeGen/ELFWriter.cpp diff -u llvm/lib/CodeGen/ELFWriter.cpp:1.37 llvm/lib/CodeGen/ELFWriter.cpp:1.38 --- llvm/lib/CodeGen/ELFWriter.cpp:1.37 Wed Feb 7 19:35:27 2007 +++ llvm/lib/CodeGen/ELFWriter.cpp Tue Feb 13 23:52:17 2007 @@ -255,7 +255,7 @@ } const Type *GVType = (const Type*)GV->getType(); - unsigned Align = TM.getTargetData()->getTypeAlignmentPref(GVType); + unsigned Align = TM.getTargetData()->getPrefTypeAlignment(GVType); unsigned Size = TM.getTargetData()->getTypeSize(GVType); // If this global has a zero initializer, it is part of the .bss or common Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.26 llvm/lib/CodeGen/MachOWriter.cpp:1.27 --- llvm/lib/CodeGen/MachOWriter.cpp:1.26 Sat Feb 10 14:31:59 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Tue Feb 13 23:52:17 2007 @@ -147,7 +147,7 @@ // Align the output buffer to the appropriate alignment, power of 2. unsigned FnAlign = F->getAlignment(); - unsigned TDAlign = TD->getTypeAlignmentPref(F->getType()); + unsigned TDAlign = TD->getPrefTypeAlignment(F->getType()); unsigned Align = Log2_32(std::max(FnAlign, TDAlign)); assert(!(Align & (Align-1)) && "Alignment is not a power of two!"); @@ -332,7 +332,7 @@ unsigned Size = TM.getTargetData()->getTypeSize(Ty); unsigned Align = GV->getAlignment(); if (Align == 0) - Align = TM.getTargetData()->getTypeAlignmentPref(Ty); + Align = TM.getTargetData()->getPrefTypeAlignment(Ty); MachOSym Sym(GV, Mang->getValueName(GV), Sec->Index, TM); Index: llvm/lib/CodeGen/MachineFunction.cpp diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.108 llvm/lib/CodeGen/MachineFunction.cpp:1.109 --- llvm/lib/CodeGen/MachineFunction.cpp:1.108 Sat Jan 20 16:35:55 2007 +++ llvm/lib/CodeGen/MachineFunction.cpp Tue Feb 13 23:52:17 2007 @@ -13,6 +13,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm/DerivedTypes.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/SSARegMap.h" @@ -123,7 +124,7 @@ const TargetData &TD = *TM.getTargetData(); bool IsPic = TM.getRelocationModel() == Reloc::PIC_; unsigned EntrySize = IsPic ? 4 : TD.getPointerSize(); - unsigned Alignment = IsPic ? TD.getIntABIAlignment() + unsigned Alignment = IsPic ? TD.getABITypeAlignment(Type::Int32Ty) : TD.getPointerABIAlignment(); JumpTableInfo = new MachineJumpTableInfo(EntrySize, Alignment); From sabre at nondot.org Tue Feb 13 23:52:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200702140552.l1E5qvjJ022665@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.631 -> 1.632 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+13 -12) InstructionCombining.cpp | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.631 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.632 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.631 Mon Feb 12 20:10:56 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Feb 13 23:52:17 2007 @@ -366,7 +366,6 @@ /// This function is a wrapper around CastInst::isEliminableCastPair. It /// simply extracts arguments and returns what that function returns. -/// @Determine if it is valid to eliminate a Convert pair static Instruction::CastOps isEliminableCastPair( const CastInst *CI, ///< The first cast instruction @@ -5813,8 +5812,8 @@ const Type *CastElTy = PTy->getElementType(); if (!AllocElTy->isSized() || !CastElTy->isSized()) return 0; - unsigned AllocElTyAlign = TD->getTypeAlignmentABI(AllocElTy); - unsigned CastElTyAlign = TD->getTypeAlignmentABI(CastElTy); + unsigned AllocElTyAlign = TD->getABITypeAlignment(AllocElTy); + unsigned CastElTyAlign = TD->getABITypeAlignment(CastElTy); if (CastElTyAlign < AllocElTyAlign) return 0; // If the allocation has multiple uses, only promote it if we are strictly @@ -6903,22 +6902,22 @@ if (GlobalVariable *GV = dyn_cast(V)) { unsigned Align = GV->getAlignment(); if (Align == 0 && TD) - Align = TD->getTypeAlignmentPref(GV->getType()->getElementType()); + Align = TD->getPrefTypeAlignment(GV->getType()->getElementType()); return Align; } else if (AllocationInst *AI = dyn_cast(V)) { unsigned Align = AI->getAlignment(); if (Align == 0 && TD) { if (isa(AI)) - Align = TD->getTypeAlignmentPref(AI->getType()->getElementType()); + Align = TD->getPrefTypeAlignment(AI->getType()->getElementType()); else if (isa(AI)) { // Malloc returns maximally aligned memory. - Align = TD->getTypeAlignmentABI(AI->getType()->getElementType()); + Align = TD->getABITypeAlignment(AI->getType()->getElementType()); Align = std::max(Align, - (unsigned)TD->getTypeAlignmentABI(Type::DoubleTy)); + (unsigned)TD->getABITypeAlignment(Type::DoubleTy)); Align = std::max(Align, - (unsigned)TD->getTypeAlignmentABI(Type::Int64Ty)); + (unsigned)TD->getABITypeAlignment(Type::Int64Ty)); } } return Align; @@ -6954,11 +6953,11 @@ const Type *BasePtrTy = GEPI->getOperand(0)->getType(); const PointerType *PtrTy = cast(BasePtrTy); - if (TD->getTypeAlignmentABI(PtrTy->getElementType()) + if (TD->getABITypeAlignment(PtrTy->getElementType()) <= BaseAlignment) { const Type *GEPTy = GEPI->getType(); const PointerType *GEPPtrTy = cast(GEPTy); - return TD->getTypeAlignmentABI(GEPPtrTy->getElementType()); + return TD->getABITypeAlignment(GEPPtrTy->getElementType()); } return 0; } @@ -8550,8 +8549,10 @@ return false; } -/// getShuffleMask - Read and decode a shufflevector mask. It turns undef -/// elements into values that are larger than the #elts in the input. +/// Read and decode a shufflevector mask. +/// +/// It turns undef elements into values that are larger than the number of +/// elements in the input. static std::vector getShuffleMask(const ShuffleVectorInst *SVI) { unsigned NElts = SVI->getType()->getNumElements(); if (isa(SVI->getOperand(2))) From sabre at nondot.org Tue Feb 13 23:52:57 2007 From: sabre at nondot.org (Chris Lattner) Date: Tue, 13 Feb 2007 23:52:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp Message-ID: <200702140552.l1E5qvIE022670@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JIT.cpp updated: 1.92 -> 1.93 --- Log message: Generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel. --- Diffs of the changes: (+1 -1) JIT.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.92 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.93 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.92 Tue Feb 13 00:01:22 2007 +++ llvm/lib/ExecutionEngine/JIT/JIT.cpp Tue Feb 13 23:52:17 2007 @@ -338,7 +338,7 @@ // compilation. const Type *GlobalType = GV->getType()->getElementType(); size_t S = getTargetData()->getTypeSize(GlobalType); - size_t A = getTargetData()->getTypeAlignmentPref(GlobalType); + size_t A = getTargetData()->getPrefTypeAlignment(GlobalType); if (A <= 8) { Ptr = malloc(S); } else { From clattner at apple.com Tue Feb 13 23:53:56 2007 From: clattner at apple.com (clattner at apple.com) Date: Tue, 13 Feb 2007 21:53:56 -0800 (PST) Subject: [llvm-commits] [123805] Patches to support generalize TargetData strings, to support Message-ID: <20070214055356.86DA843981F0@src> Revision: 123805 Author: clattner Date: 2007-02-13 21:53:55 -0800 (Tue, 13 Feb 2007) Log Message: ----------- Patches to support generalize TargetData strings, to support more interesting forms of data. Patch by Scott Michel, a couple bugfixes by me. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-backend.cpp apple-local/branches/llvm/gcc/llvm-convert.cpp apple-local/branches/llvm/gcc/llvm-types.cpp Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 05:34:58 UTC (rev 123804) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 05:53:55 UTC (rev 123805) @@ -600,7 +600,7 @@ // Set the alignment for the global. if (DECL_ALIGN_UNIT(decl) && - getTargetData().getTypeAlignmentABI(GV->getType()->getElementType()) != + getTargetData().getABITypeAlignment(GV->getType()->getElementType()) != DECL_ALIGN_UNIT(decl)) GV->setAlignment(DECL_ALIGN_UNIT(decl)); Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-02-14 05:34:58 UTC (rev 123804) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-02-14 05:53:55 UTC (rev 123805) @@ -4280,7 +4280,7 @@ // In this case, we know that the alignment of the field is less than // the size of the field. To get the pointer close enough, add some // number of alignment units to the pointer. - unsigned ByteAlignment = TD.getTypeAlignmentABI(FieldTy); + unsigned ByteAlignment = TD.getABITypeAlignment(FieldTy); assert(ByteAlignment*8 <= LLVMValueBitSize && "Unknown overlap case!"); unsigned NumAlignmentUnits = BitStart/(ByteAlignment*8); assert(NumAlignmentUnits && "Not adjusting pointer?"); @@ -4971,8 +4971,8 @@ } // Otherwise, we can get away with this initialization. - assert(TD.getTypeAlignmentABI(FieldTy) >= - TD.getTypeAlignmentABI(Val->getType()) && + assert(TD.getABITypeAlignment(FieldTy) >= + TD.getABITypeAlignment(Val->getType()) && "Field initialize is over aligned for LLVM type!"); return Val; } Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-02-14 05:34:58 UTC (rev 123804) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-02-14 05:53:55 UTC (rev 123805) @@ -702,7 +702,7 @@ /// getTypeAlignment - Return the alignment of the specified type in bytes. /// unsigned getTypeAlignment(const Type *Ty) const { - return TD.getTypeAlignmentABI(Ty); + return TD.getABITypeAlignment(Ty); } /// getTypeSize - Return the size of the specified type in bytes. @@ -1178,7 +1178,7 @@ const Type *TheTy = ConvertType(TREE_TYPE(Field)); unsigned Size = TD.getTypeSize(TheTy); - unsigned Align = TD.getTypeAlignmentABI(TheTy); + unsigned Align = TD.getABITypeAlignment(TheTy); if (UnionTy == 0 || Size>MaxSize || (Size == MaxSize && Align > MaxAlign)) { UnionTy = TheTy; MaxSize = Size; From clattner at apple.com Wed Feb 14 00:01:01 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 Feb 2007 22:01:01 -0800 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h In-Reply-To: <200702140552.l1E5quRD022630@zion.cs.uiuc.edu> References: <200702140552.l1E5quRD022630@zion.cs.uiuc.edu> Message-ID: <457561D5-24F1-4082-B151-FBC0EF271704@apple.com> On Feb 13, 2007, at 9:52 PM, Chris Lattner wrote: > Generalize TargetData strings, to support more interesting forms of > data. > Patch by Scott Michel. Scott, > Index: llvm/include/llvm/Target/TargetData.h > diff -u llvm/include/llvm/Target/TargetData.h:1.53 llvm/include/ > llvm/Target/TargetData.h:1.54 > --- llvm/include/llvm/Target/TargetData.h:1.53 Sat Feb 10 14:37:40 > 2007 > +++ llvm/include/llvm/Target/TargetData.h Tue Feb 13 23:52:16 2007 > @@ -22,6 +22,8 @@ > > #include "llvm/Pass.h" > #include "llvm/Support/DataTypes.h" > +#include "llvm/ADT/SmallVector.h" > +#include > > namespace llvm { > > @@ -31,45 +33,96 @@ > class StructLayout; > class GlobalVariable; > > -class TargetData : public ImmutablePass { > - bool LittleEndian; // Defaults to false > +/// Enum used to categorize the alignment types stored by > TargetAlignElem > +enum AlignTypeEnum { > + INTEGER_ALIGN = 'i', ///< Integer type alignment > + PACKED_ALIGN = 'v', ///< Vector type alignment > + FLOAT_ALIGN = 'f', ///< Floating point type > alignment > + AGGREGATE_ALIGN = 'a' ///< Aggregate alignment > +}; > +/// Target alignment element. > +/// > +/// Stores the alignment data associated with a given alignment > type (pointer, > +/// integer, packed/vector, float) and type bit width. > +/// > +/// @note The unusual order of elements in the structure attempts > to reduce > +/// padding and make the structure slightly more cache friendly. > +struct TargetAlignElem { > + unsigned char AlignType; //< Alignment type > (AlignTypeEnum) This should be: AlignTypeEnum AlignType : 8; > + unsigned char ABIAlign; //< ABI alignment for this > type/bitw > + unsigned char PrefAlign; //< Pref. alignment for this > type/bitw > + short TypeBitWidth; //< Type bit width > + > + /// Initializer > + static TargetAlignElem get(AlignTypeEnum align_type, unsigned > char abi_align, > + unsigned char pref_align, short > bit_width); > + /// Less-than predicate > + bool operator<(const TargetAlignElem &rhs) const; > + /// Equality predicate > + bool operator==(const TargetAlignElem &rhs) const; > + /// output stream operator > + std::ostream &dump(std::ostream &os) const; > +}; > > - // ABI alignments > - unsigned char BoolABIAlignment; // Defaults to 1 byte > - unsigned char ByteABIAlignment; // Defaults to 1 byte > - unsigned char ShortABIAlignment; // Defaults to 2 bytes > - unsigned char IntABIAlignment; // Defaults to 4 bytes > - unsigned char LongABIAlignment; // Defaults to 8 bytes > - unsigned char FloatABIAlignment; // Defaults to 4 bytes > - unsigned char DoubleABIAlignment; // Defaults to 8 bytes > - unsigned char PointerMemSize; // Defaults to 8 bytes > - unsigned char PointerABIAlignment; // Defaults to 8 bytes > - > - // Preferred stack/global type alignments > - unsigned char BoolPrefAlignment; // Defaults to BoolABIAlignment > - unsigned char BytePrefAlignment; // Defaults to ByteABIAlignment > - unsigned char ShortPrefAlignment; // Defaults to > ShortABIAlignment > - unsigned char IntPrefAlignment; // Defaults to IntABIAlignment > - unsigned char LongPrefAlignment; // Defaults to LongABIAlignment > - unsigned char FloatPrefAlignment; // Defaults to > FloatABIAlignment > - unsigned char DoublePrefAlignment; // Defaults to > DoubleABIAlignment > - unsigned char PointerPrefAlignment; // Defaults to > PointerABIAlignment > - unsigned char AggMinPrefAlignment; // Defaults to 0 bytes > +//! TargetAlignElem output stream inserter > +/*! > + @sa TargetAlignElem::dump() > + */ > +std::ostream &operator<<(std::ostream &os, const TargetAlignElem > &elem); > + > +class TargetData : public ImmutablePass { > +private: > + bool LittleEndian; ///< Defaults to false > + unsigned char PointerMemSize; ///< Pointer size in bytes > + unsigned char PointerABIAlign; ///< Pointer ABI alignment > + unsigned char PointerPrefAlign; ///< Pointer preferred > global alignment 'Pointer preferred global alignment' ? global what? > + > + //! Where the primitive type alignment data is stored. > + /*! > + @sa init(). > + @note Could support multiple size pointer alignments, e.g., 32- > bit pointers > + vs. 64-bit pointers by extending TargetAlignment, but for now, > we don't. > + */ > + SmallVector Alignments; > + //! Alignment iterator shorthand > + typedef SmallVector::iterator align_iterator; I don't think the elements in 'Alignments' should ever be mutable through iterators. I'd suggest using: typedef SmallVector::const_iterator align_iterator; > + //! Invalid alignment. > + /*! > + This member is a signal that a requested alignment type and > bit width were > + not found in the SmallVector. > + */ > + static const TargetAlignElem InvalidAlignmentElem; > + > + //! Set/initialize target alignments > + void setAlignment(AlignTypeEnum align_type, unsigned char > abi_align, > + unsigned char pref_align, short bit_width); > + //! Get TargetAlignElem from alignment type and bit width > + const TargetAlignElem &getAlignment(AlignTypeEnum, short) const; Please give these arguments names to indicate what they are. > + //! Internal helper method that returns requested alignment for > type. > + unsigned char getAlignment(const Type *Ty, bool abi_or_pref) const; abi_or_pref doesn't indicate what 'true' means. Should this be an enum with two values? > - /// Parse a target data layout string and initialize TargetData > members. > - /// > - /// Parse a target data layout string, initializing the various > TargetData > - /// members along the way. A TargetData specification string > looks like > - /// "E-p:64:64-d:64-f:32-l:64-i:32-s:16-b:8-B:8" and specifies the > - /// target's endianess, the ABI alignments of various data types > and > - /// the size of pointers. The format of this string should be described somewhere. Perhaps in LangRef.html? -Chris From clattner at apple.com Wed Feb 14 00:18:40 2007 From: clattner at apple.com (Chris Lattner) Date: Tue, 13 Feb 2007 22:18:40 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp In-Reply-To: <200702140552.l1E5qor5022613@zion.cs.uiuc.edu> References: <200702140552.l1E5qor5022613@zion.cs.uiuc.edu> Message-ID: > Generalize TargetData strings, to support more interesting forms of > data. > Patch by Scott Michel. Scott, > @@ -54,11 +48,10 @@ > // Loop over each of the elements, placing them in memory... > for (unsigned i = 0, e = NumElements; i != e; ++i) { > const Type *Ty = ST->getElementType(i); > - unsigned char A; > unsigned TyAlign; > uint64_t TySize; > - getTypeInfoABI(Ty, &TD, TySize, A); > - TyAlign = ST->isPacked() ? 1 : A; > + TyAlign = (unsigned) TD.getABITypeAlignment(Ty); > + TySize = (unsigned) TD.getTypeSize(Ty); Why are you casting typesize to unsigned here? This breaks support for structs that are are bigger than 4G on a 64-bit system. > +TargetAlignElem > +TargetAlignElem::get(AlignTypeEnum align_type, unsigned char > abi_align, > + unsigned char pref_align, short bit_width) > +{ Please use K&R style braces ( '{' on same line) for consistency with the rest of this file. > + // FIXME: Is this still necessary? > + const TargetAlignElem &long_align = getAlignment(INTEGER_ALIGN, > 64); > + if (long_align.ABIAlign == 0) > + setAlignment(INTEGER_ALIGN, PointerMemSize, PointerMemSize, 64); Please decide if this is needed :) > +struct hyphen_delimited : > + public std::iterator void> This is very cute, but also very obtuse. :) Please write it as a simple loop for maintainability. > std::string TargetData::getStringRepresentation() const { > std::stringstream repr; Also, you should be able to eliminate the stringstream here. Just use 'ustostr' from llvm/ADT/StringExtras.h > > -uint64_t TargetData::getTypeSize(const Type *Ty) const { > - uint64_t Size; > - unsigned char Align; > - getTypeInfoABI(Ty, this, Size, Align); > - return Size; > + const TargetAlignElem &elem = getAlignment((AlignTypeEnum) > AlignType, > + getTypeSize(Ty) * 8); > + if (validAlignment(elem)) > + return (abi_or_pref ? elem.ABIAlign : elem.PrefAlign); > + else { > + cerr << "TargetData::getAlignment: align type " << AlignType > + << " size " << getTypeSize(Ty) << " not found in > Alignments.\n"; Please turn this into an assert message. Overall, very nice work Scott! -Chris From sabre at nondot.org Wed Feb 14 00:20:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 00:20:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200702140620.l1E6KPh5024032@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.238 -> 1.239 --- Log message: >From Dan Gohman: While preparing http://llvm.org/PR1198: http://llvm.org/PR1198 I noticed several asserts protecting unprepared code from i128 types that weren't actually failing when they should because they were written as assert("foo") instead of something like assert(0 && "foo"). This patch fixes all the cases that a quick grep found. --- Diffs of the changes: (+1 -1) Reader.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.238 llvm/lib/Bytecode/Reader/Reader.cpp:1.239 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.238 Tue Feb 13 00:30:42 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Wed Feb 14 00:20:04 2007 @@ -1265,7 +1265,7 @@ Result = ConstantInt::get(IT, Val); if (Handler) Handler->handleConstantValue(Result); } else - assert("Integer types > 64 bits not supported"); + assert(0 && "Integer types > 64 bits not supported"); break; } case Type::FloatTyID: { From sabre at nondot.org Wed Feb 14 00:20:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 00:20:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200702140620.l1E6KPL2024041@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.105 -> 1.106 --- Log message: >From Dan Gohman: While preparing http://llvm.org/PR1198: http://llvm.org/PR1198 I noticed several asserts protecting unprepared code from i128 types that weren't actually failing when they should because they were written as assert("foo") instead of something like assert(0 && "foo"). This patch fixes all the cases that a quick grep found. --- Diffs of the changes: (+2 -2) ExecutionEngine.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.105 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.106 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.105 Sat Feb 10 14:35:22 2007 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Wed Feb 14 00:20:04 2007 @@ -292,7 +292,7 @@ const_cast(dyn_cast(GV))) EmitGlobalVariable(GVar); else - assert("Global hasn't had an address allocated yet!"); + assert(0 && "Global hasn't had an address allocated yet!"); return state.getGlobalAddressMap(locked)[GV]; } @@ -425,7 +425,7 @@ else if (BitWidth <= 64) Result.Int64Val = (uint64_t )cast(C)->getZExtValue(); else - assert("Integers with > 64-bits not implemented"); + assert(0 && "Integers with > 64-bits not implemented"); break; } From sabre at nondot.org Wed Feb 14 00:20:25 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 00:20:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Writer/Writer.cpp Message-ID: <200702140620.l1E6KPqb024030@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Writer: Writer.cpp updated: 1.166 -> 1.167 --- Log message: >From Dan Gohman: While preparing http://llvm.org/PR1198: http://llvm.org/PR1198 I noticed several asserts protecting unprepared code from i128 types that weren't actually failing when they should because they were written as assert("foo") instead of something like assert(0 && "foo"). This patch fixes all the cases that a quick grep found. --- Diffs of the changes: (+1 -1) Writer.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Bytecode/Writer/Writer.cpp diff -u llvm/lib/Bytecode/Writer/Writer.cpp:1.166 llvm/lib/Bytecode/Writer/Writer.cpp:1.167 --- llvm/lib/Bytecode/Writer/Writer.cpp:1.166 Sun Feb 11 23:18:08 2007 +++ llvm/lib/Bytecode/Writer/Writer.cpp Wed Feb 14 00:20:04 2007 @@ -313,7 +313,7 @@ else if (NumBits <= 64) output_vbr(uint64_t(cast(CPV)->getZExtValue())); else - assert("Integer types > 64 bits not supported."); + assert(0 && "Integer types > 64 bits not supported."); break; } From sabre at nondot.org Wed Feb 14 00:20:28 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 00:20:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Message-ID: <200702140620.l1E6KSO7024049@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: Execution.cpp updated: 1.169 -> 1.170 --- Log message: >From Dan Gohman: While preparing http://llvm.org/PR1198: http://llvm.org/PR1198 I noticed several asserts protecting unprepared code from i128 types that weren't actually failing when they should because they were written as assert("foo") instead of something like assert(0 && "foo"). This patch fixes all the cases that a quick grep found. --- Diffs of the changes: (+1 -1) Execution.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/Interpreter/Execution.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.169 llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.170 --- llvm/lib/ExecutionEngine/Interpreter/Execution.cpp:1.169 Sat Feb 10 13:55:17 2007 +++ llvm/lib/ExecutionEngine/Interpreter/Execution.cpp Wed Feb 14 00:20:04 2007 @@ -1690,7 +1690,7 @@ else if (BitWidth <= 64) Dest.Int64Val = Src.Int64Val; else - assert("Integer types > 64 bits not supported"); + assert(0 && "Integer types > 64 bits not supported"); maskToBitWidth(Dest, BitWidth); } IMPLEMENT_VAARG(Pointer); From sabre at nondot.org Wed Feb 14 01:18:32 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:18:32 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702140718.l1E7IWge026709@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.365 -> 1.366 --- Log message: Refix CodeGen/Generic/switch-lower.ll. In contrast to my previous patch, this doesn't miscompile lots of programs :) --- Diffs of the changes: (+5 -5) SelectionDAGISel.cpp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.365 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.366 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.365 Tue Feb 13 23:52:17 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Feb 14 01:18:16 2007 @@ -1205,8 +1205,8 @@ if ((TLI.isOperationLegal(ISD::BR_JT, MVT::Other) || TLI.isOperationLegal(ISD::BRIND, MVT::Other)) && Cases.size() > 5) { - uint64_t First =cast(Cases.front().first)->getZExtValue(); - uint64_t Last = cast(Cases.back().first)->getZExtValue(); + uint64_t First =cast(Cases.front().first)->getSExtValue(); + uint64_t Last = cast(Cases.back().first)->getSExtValue(); double Density = (double)Cases.size() / (double)((Last - First) + 1ULL); if (Density >= 0.3125) { @@ -1255,7 +1255,7 @@ std::vector DestBBs; uint64_t TEI = First; for (CaseItr ii = Cases.begin(), ee = Cases.end(); ii != ee; ++TEI) - if (cast(ii->first)->getZExtValue() == TEI) { + if (cast(ii->first)->getSExtValue() == TEI) { DestBBs.push_back(ii->second); ++ii; } else { @@ -1363,8 +1363,8 @@ // Create a CaseBlock record representing a conditional branch to // the LHS node if the value being switched on SV is less than C. // Otherwise, branch to LHS. - ISD::CondCode CC = ISD::SETLT; - SelectionDAGISel::CaseBlock CB(CC, SV, C, TrueBB, FalseBB, CR.CaseBB); + SelectionDAGISel::CaseBlock CB(ISD::SETLT, SV, C, TrueBB, FalseBB, + CR.CaseBB); if (CR.CaseBB == CurMBB) visitSwitchCase(CB); From reid at x10sys.com Wed Feb 14 01:22:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 01:22:35 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702140722.l1E7MZuk026966@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.6 -> 1.7 --- Log message: Incorporate Chris' first round of comments. --- Diffs of the changes: (+114 -83) DeveloperPolicy.html | 197 +++++++++++++++++++++++++++++---------------------- 1 files changed, 114 insertions(+), 83 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.6 llvm/docs/DeveloperPolicy.html:1.7 --- llvm/docs/DeveloperPolicy.html:1.6 Tue Feb 13 14:57:57 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 01:22:19 2007 @@ -12,14 +12,8 @@

      Contents

        -
      1. Overview
      2. +
      3. Introduction
      4. Terminology
      5. -
      6. Copyright and License -
          -
        1. Copyright
        2. -
        3. License
        4. -
        5. Developer Agreements
        6. -
      7. General Policies
        1. Stay Informed
        2. @@ -38,6 +32,12 @@
        3. Obtaining Commit Access
        4. New Committers
      8. +
      9. Copyright and License +
          +
        1. Copyright
        2. +
        3. License
        4. +
        5. Developer Agreements
        6. +
      Written by LLVM Oversight Team
      @@ -89,74 +89,6 @@
      - - -
      -

      We address here the issues of copyright and license for the LLVM project. - A copyright is literally the "right to copy". It is a set of exclusive rights - granted to a party regulating the particular expression of information. - In this case, the information is LLVM. A license is something granted by a - copyright holder to other parties that controls the use of the information - by them. Currently, the University of Illinois is the LLVM copyright holder - and the terms of its license to LLVM users and developers is the - University of Illinois Open Source License (see LICENSE.txt).

      -
      - - -
      -

      The LLVM project believes in correct attribution of contributions to - their contributors. Developers should, therefore, place their name at the - top of any source file they originate and list their contributions in the - CREDITS.TXT file. Furthermore, correct attribution of submitted patches - should be made in the commit comments.

      -

      However, for consistency and ease of management, the project requires the - copyright for all LLVM software to be held by a single copyright holder. - Although UIUC may assign the copyright of the software to another entity, - the intent for the project is to always have a single entity hold the copy - rights to LLVM at any given time. -

      Having multiple copyright holders for various portions of LLVM is - problematic in the management of the software. Having a single copyright - holder is in the best interests of all developers and users as it greatly - reduces the managerial burden for any kind of administrative or technical - decisions about LLVM.

      -
      - - -
      -

      LLVM licensing decisions will be made by the LLVM Oversight Group. Any - issues, comments or suggestions with the licensing should be sent to - oversight at llvm.org.

      -

      The LLVM Oversight Group intends to keep LLVM perpetually open source - and to use liberal open source licenses. The current license is the - University of Illinois Open Source License (see LICENSE.TXT), which boils - down to this:

      -
        -
      • You can freely distribute LLVM.
      • -
      • You must retain the copyright notice if you redistribute.
      • -
      • Binaries derived from LLVM must reproduce the copyright notice.
      • -
      • You can't use our names to promote your LLVM derived products.
      • -
      • There's no warranty on LLVM at all.
      • -
      -

      We believe this fosters the widest adoption of LLVM because it allows - commercial products to be derived from LLVM with few restrictions and - without a requirement for making any derived works also open source. The - intent of the license is to let people use LLVM freely with only the - obligation to be honest about where it came from.

      -
      - - -
      -

      With regards to the LLVM copyright and licensing, developers agree to:

      -
        -
      • give up their copy rights to any contribution made so that the entire - software base can be managed by a single copyright holder.
      • -
      • allow their contribution(s) to be licensed as open source by the then - current or subsequent license chosen by the LLVM Oversight Group.
      • -
      • not make LLVM available under any other licensing agreement.
      • -
      -
      - -
      @@ -173,18 +105,19 @@ anything more than just casual work on LLVM, it is highly suggested that you also subscribe to the llvm-commits list and pay attention to changes being made by others.

      -

      Active developers must register an email account with bugzilla - (http://llvm.org/bugs/) and preferably - subscribe to the llvm-bugs email list to keep track of bugs occurring in - LLVM.

      +

      We recommend that active developers register an email account with + LLVM Bugzilla and preferably subscribe to + the llvm-bugs + email list to keep track of bugs and enhancements occurring in LLVM.

      -

      When a developer begins new work with the aim of contributing it back to - LLVM, s/he must inform the community with an email to llvm-dev email list, - to the extent possible. The reason for this is to: +

      When a developer begins a major new project with the aim of contributing + it back to LLVM, s/he should inform the community with an email to + the llvm-dev + email list, to the extent possible. The reason for this is to:

      • keep the community informed about future changes to LLVM,
      • avoid duplication of effort by having multiple parties working on the @@ -192,6 +125,10 @@
      • ensure that any issues around the proposed work are discussed and resolved before any significant work is accomplished.
      +

      The design of LLVM is carefully controlled to ensure that all the pieces + fit together well. If you plan to make a major change to the way LLVM works or + a major new extension, it is a good idea to get consensus with the development + community before you start working on it.

      @@ -409,6 +346,100 @@
    + + +
    +

    We address here the issues of copyright and license for the LLVM project. + The object of the copyright and license is the LLVM source and documentation. + Currently, the University of Illinois is the LLVM copyright holder and the + terms of its license to LLVM users and developers is the + University of + Illinois/NCSA Open Source License. +

    + +
    +

    NOTE: This section deals with legal matters but does not provide legal + advice. It is intended only as a general guideline.

    +
    + + + +
    +

    The LLVM project believes in correct attribution of contributions to + their contributors, as follows:

    +
      +
    1. Developers who originate new files in LLVM should place their name at + the top of the file per the + Coding Standards.
    2. +
    3. There should be only one name at the top of the file and it should be + the person who created the file.
    4. +
    5. Placing your name in the file does not imply copyright but does + correctly attribute the file to its author.
    6. +
    7. Developers should be aware that after some time has passed, the name at + the top of a file may become meaningless as maintenance/ownership of files + changes.
    8. +
    9. Developers should submit or commit patches to the + CREDITS.txt + file to summarize their contributions.
    10. +
    11. Commit comments should contain correct attribution of the person who s + submitted the patch if that person is not the committer (i.e. when a + developer with commit privileges commits a patch for someone else).
    12. +
    +
    + + + +
    +

    +

    However, for consistency and ease of management, the project requires the + copyright for all LLVM software to be held by a single copyright holder. + Although UIUC may assign the copyright of the software to another entity, + the intent for the project is to always have a single entity hold the copy + rights to LLVM at any given time. +

    Having multiple copyright holders for various portions of LLVM is + problematic in the management of the software. Having a single copyright + holder is in the best interests of all developers and users as it greatly + reduces the managerial burden for any kind of administrative or technical + decisions about LLVM.

    +
    + + +
    +

    LLVM licensing decisions will be made by the LLVM Oversight Group. Any + issues, comments or suggestions with the licensing should be sent to + oversight at llvm.org.

    +

    The LLVM Oversight Group intends to keep LLVM perpetually open source + and to use liberal open source licenses. The current license is the + University of Illinois Open Source License (see LICENSE.TXT), which boils + down to this:

    +
      +
    • You can freely distribute LLVM.
    • +
    • You must retain the copyright notice if you redistribute LLVM.
    • +
    • Binaries derived from LLVM must reproduce the copyright notice.
    • +
    • You can't use our names to promote your LLVM derived products.
    • +
    • There's no warranty on LLVM at all.
    • +
    +

    We believe this fosters the widest adoption of LLVM because it allows + commercial products to be derived from LLVM with few restrictions and + without a requirement for making any derived works also open source. We + suggest that you read the + License if + further clarification is needed.

    +
    + + +
    +

    With regards to the LLVM copyright and licensing, developers agree to:

    +
      +
    • assign their copy rights to UIUC for any contribution made so that + the entire software base can be managed by a single copyright holder.
    • +
    • allow their contribution(s) to be licensed as open source by the then + current license chosen by the LLVM Oversight Group.
    • +
    • not make LLVM available under any other licensing agreement.
    • +
    +
    + +
    @@ -430,7 +461,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> Written By: LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/13 20:57:57 $ + Last modified: $Date: 2007/02/14 07:22:19 $ From sabre at nondot.org Wed Feb 14 01:33:16 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:33:16 -0600 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200702140733.l1E7XGtD027440@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.153 -> 1.154 --- Log message: There is no circular dependency between llvm and llvm-gcc anymore. stop scaring users. --- Diffs of the changes: (+14 -5) GettingStarted.html | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.153 llvm/docs/GettingStarted.html:1.154 --- llvm/docs/GettingStarted.html:1.153 Fri Feb 9 09:59:08 2007 +++ llvm/docs/GettingStarted.html Wed Feb 14 01:33:00 2007 @@ -730,10 +730,11 @@
    -

    Before configuring and compiling the LLVM suite, you need to extract the LLVM -GCC front end from the binary distribution. It is used for building the -bytecode libraries later used by the GCC front end for linking programs, and its -location must be specified when the LLVM suite is configured.

    +

    Before configuring and compiling the LLVM suite, you can optionally extract the +LLVM GCC front end from the binary distribution. It is used for running the +llvm-test testsuite and for compiling C/C++ programs. Note that you can optionally +build llvm-gcc yourself after building the +main LLVM repository.

    To install the GCC front end, do the following:

    @@ -743,6 +744,14 @@ - +

    Once the binary is uncompressed, you should add a symlink for llvm-gcc and +llvm-g++ to some directory in your path. When you configure LLVM, it will +automatically detect llvm-gcc's presence (if it is in your path) enabling its +use in llvm-test. Note that you can always build or install llvm-gcc at any +pointer after building the main LLVM repository: just reconfigure llvm and +llvm-test will pick it up. +

    +

    The binary versions of the GCC front end may not suit all of your needs. For example, the binary distribution may include an old version of a system header file, not "fix" a header file that needs to be fixed for GCC, or it may be @@ -1607,7 +1616,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/09 15:59:08 $ + Last modified: $Date: 2007/02/14 07:33:00 $ From sabre at nondot.org Wed Feb 14 01:34:39 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:34:39 -0600 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200702140734.l1E7Yd18027543@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.154 -> 1.155 --- Log message: remove obsolete warning --- Diffs of the changes: (+2 -2) GettingStarted.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.154 llvm/docs/GettingStarted.html:1.155 --- llvm/docs/GettingStarted.html:1.154 Wed Feb 14 01:33:00 2007 +++ llvm/docs/GettingStarted.html Wed Feb 14 01:34:22 2007 @@ -759,7 +759,7 @@

    In cases like these, you may want to try building the GCC front end from source. This is -not for the faint of heart, so be forewarned.

    +much easier now than it was in the past.

    @@ -1616,7 +1616,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 07:33:00 $ + Last modified: $Date: 2007/02/14 07:34:22 $ From sabre at nondot.org Wed Feb 14 01:35:13 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:35:13 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Message-ID: <200702140735.l1E7ZDA4027600@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.366 -> 1.367 --- Log message: fix a warning --- Diffs of the changes: (+1 -1) SelectionDAGISel.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.366 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.367 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.366 Wed Feb 14 01:18:16 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Feb 14 01:34:56 2007 @@ -1253,7 +1253,7 @@ // a case statement, push the case's BB onto the vector, otherwise, push // the default BB. std::vector DestBBs; - uint64_t TEI = First; + int64_t TEI = First; for (CaseItr ii = Cases.begin(), ee = Cases.end(); ii != ee; ++TEI) if (cast(ii->first)->getSExtValue() == TEI) { DestBBs.push_back(ii->second); From sabre at nondot.org Wed Feb 14 01:39:51 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:39:51 -0600 Subject: [llvm-commits] CVS: llvm/utils/makellvm Message-ID: <200702140739.l1E7dp65027797@zion.cs.uiuc.edu> Changes in directory llvm/utils: makellvm updated: 1.10 -> 1.11 --- Log message: remove obsolete path --- Diffs of the changes: (+1 -1) makellvm | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/makellvm diff -u llvm/utils/makellvm:1.10 llvm/utils/makellvm:1.11 --- llvm/utils/makellvm:1.10 Mon Aug 1 19:10:52 2005 +++ llvm/utils/makellvm Wed Feb 14 01:39:35 2007 @@ -11,7 +11,7 @@ ## Search path for automatically finding the obj-root to use. ## Note: The src root directory ${LLVMDIR} will be prepended to this path later. ## -set OBJROOTDIRLIST = ( "/localhome/$USER/llvm" ) +set OBJROOTDIRLIST = ( ) set doit = 1 unset options_done From sabre at nondot.org Wed Feb 14 01:40:33 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:40:33 -0600 Subject: [llvm-commits] CVS: llvm/docs/FAQ.html Message-ID: <200702140740.l1E7eXBv027877@zion.cs.uiuc.edu> Changes in directory llvm/docs: FAQ.html updated: 1.41 -> 1.42 --- Log message: remove an obsolete question --- Diffs of the changes: (+1 -18) FAQ.html | 19 +------------------ 1 files changed, 1 insertion(+), 18 deletions(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.41 llvm/docs/FAQ.html:1.42 --- llvm/docs/FAQ.html:1.41 Fri Feb 9 09:59:08 2007 +++ llvm/docs/FAQ.html Wed Feb 14 01:40:16 2007 @@ -36,7 +36,6 @@
  • Build Problems
    1. When I run configure, it finds the wrong C compiler.
    2. -
    3. I compile the code, and I get some error about /localhome.
    4. The configure script finds the right C compiler, but it uses the LLVM linker from a previous build. What do I do?
    5. When creating a dynamic library, I get a strange GLIBC error.
    6. @@ -216,22 +215,6 @@
  • -

    I compile the code, and I get some error about /localhome.

    -
    - -
    - -

    There are several possible causes for this. The first is that you didn't set -a pathname properly when using configure, and it defaulted to a -pathname that we use on our research machines.

    - -

    Another possibility is that we hardcoded a path in our Makefiles. If you see -this, please email the LLVM bug mailing list with the name of the offending -Makefile and a description of what is wrong with it.

    - -
    - -

    The configure script finds the right C compiler, but it uses the LLVM linker from a previous build. What do I do?

    @@ -685,7 +668,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/09 15:59:08 $ + Last modified: $Date: 2007/02/14 07:40:16 $ From sabre at nondot.org Wed Feb 14 01:42:29 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:42:29 -0600 Subject: [llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html Message-ID: <200702140742.l1E7gTGB027999@zion.cs.uiuc.edu> Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.62 -> 1.63 --- Log message: now that llvm-gcc3 is gone, life is significantly simpler and less scary --- Diffs of the changes: (+9 -350) CFEBuildInstrs.html | 359 +--------------------------------------------------- 1 files changed, 9 insertions(+), 350 deletions(-) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.62 llvm/docs/CFEBuildInstrs.html:1.63 --- llvm/docs/CFEBuildInstrs.html:1.62 Fri Feb 9 09:59:08 2007 +++ llvm/docs/CFEBuildInstrs.html Wed Feb 14 01:42:12 2007 @@ -4,112 +4,26 @@ - Bootstrapping the LLVM C/C++ Front-End + Building the LLVM C/C++ Front-End
    - Bootstrapping the LLVM C/C++ Front-End + Building the LLVM C/C++ Front-End
      -
    1. A Cautionary Note - -
    2. -
    3. llvm-gcc4 Instructions
    4. -
    5. llvm-gcc3 Instructions
    6. +
    7. Building llvm-gcc 4 from Source
    8. License Information
    -

    Written by Brian R. Gaeke and - Chris Lattner

    +

    Written by the LLVM Team

    - - -
    - -

    This document is intended to explain the process of building the LLVM C/C++ -front-end from its source code. You have to do this, for example, if you are -porting LLVM to a new architecture or operating system, if you are working from -Top-Of-Tree CVS/SVN, or if there is no precompiled snapshot available.

    - -

    NOTE: This is currently a somewhat fragile, error-prone process, and -you should only try to do it if:

    - -
      -
    1. you really, really, really can't use the - binaries we distribute
    2. -
    3. you are an elite GCC hacker.
    4. -
    5. you want to use the latest bits from CVS.
    6. -
    - -

    We welcome patches to help make this process simpler.

    - -
    - - - - - -
    - -

    If you are building LLVM and the GCC front-end under Cygwin, please note that -the LLVM and GCC makefiles do not correctly handle spaces in paths. To deal -with this issue, make sure that your LLVM and GCC source and build trees are -located in a top-level directory (like /cygdrive/c/llvm and -/cygdrive/c/llvm-cfrontend), not in a directory that contains a space -(which includes your "home directory", because it lives under the "Documents and -Settings" directory). We welcome patches to fix this issue.

    - -

    It has been found that the GCC 3.3.3 compiler provided with recent Cygwin -versions is incapable of compiling the LLVM GCC front-end correctly. If your -Cygwin installation includes GCC 3.3.3, we strongly recommend that you -download GCC 3.4.3, build it separately, and use it for compiling the LLVM GCC -front-end. This has been shown to work correctly.

    - -

    Some versions of Cygwin utilize an experimental version of GNU binutils that -will cause the GNU ld linker to fail an assertion when linking -components of the libstdc++. It is recommended that you replace the entire -binutils package with version 2.15 such that "ld --version" responds -with

    - -
    -
    GNU ld version 2.15
    -
    - -

    not with:

    - -
    -
    GNU ld version 2.15.91 20040725
    -
    - -
    - - - - -
    - -

    If you are building LLVM and the GCC front-end under AIX, do NOT use GNU -Binutils. They are not stable under AIX and may produce incorrect and/or -invalid code. Instead, use the system assembler and linker.

    - -
    - - - @@ -118,11 +32,12 @@

    This section describes how to aquire and build llvm-gcc4, which is based on the GCC 4.0.1 front-end. This front-end supports C, C++, Objective-C, and Objective-C++. Note that the instructions for building this front-end are -completely different than those for building llvm-gcc3.

    +completely different (and much easier!) than those for building llvm-gcc3 in +the past.

    1. Retrieve the appropriate llvm-gcc4-x.y.source.tar.gz archive from the - llvm web site.

      + llvm web site.

      It is also possible to download the sources of the llvm-gcc4 front end from a read-only mirror using subversion. To check out the code the @@ -148,261 +63,6 @@

    - - - - - -
    - -
      -
    1. Aquire llvm-gcc3 from LLVM CVS - or from a release tarball.
    2. - -
    3. Configure and build the LLVM libraries and tools. There are two ways to - do this: either with objdir == srcdir or - objdir != srcdir. It is recommended that - srcdir be the same as objdir for your - LLVM tree (but note that you should always use srcdir != - objdir for llvm-gcc):

      - -
        -
      • With objdir != srcdir:

        - -
        -
        -% cd objdir
        -% srcdir/configure --prefix=/some/path/you/can/install/to [options...]
        -% gmake tools-only
        -
        -
        -
      • -
      • With objdir == srcdir:

        - -
        -
        -% cd llvm
        -% ./configure --prefix=/some/path/you/can/install/to [options...]
        -% gmake tools-only
        -
        -
        -
      • -
      - -

      This will build all of the LLVM tools and libraries. The - --prefix option defaults to /usr/local (per configure - standards) but unless you are a system administrator, you probably - won't be able to install LLVM there because of permissions. Specify a - path into which LLVM can be installed - (e.g. --prefix=/home/user/llvm).

    4. -
    5. Add the directory containing the tools to your PATH.

      - -
      -csh: -
      -  % set path = ( `cd llvm/Debug/bin && pwd` $path )
      -
      -sh: -
      -  % export PATH=`cd llvm/Debug/bin && pwd`:$PATH
      -
      -
      -
    6. - -
    7. Unpack the C/C++ front-end source, either by - untar'ing/unzipping a tar.gz file or checking out CVS into this - directory.

    8. -
    9. Make "build" and "install" directories as siblings of the "src" - tree:

      - -
      -csh: -
      -  % pwd
      -  /usr/local/example/llvm-gcc3.4/src
      -  % cd ..
      -  % mkdir build install
      -  % set CFEINSTALL = `pwd`/install
      -
      -sh: -
      -  % pwd
      -  /usr/local/example/llvm-gcc3.4/src
      -  % cd ..
      -  % mkdir build install
      -  % export CFEINSTALL=`pwd`/install
      -
      -
      -
    10. - -
    11. Configure, build, and install the GCC front-end:

      - -

      - Linux/x86:
      - Linux/IA-64:
      - MacOS X/PowerPC (requires dlcompat library):
      - AIX/PowerPC: -

      - -
      -
      -% cd build
      -% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
      -  --disable-shared --enable-languages=c,c++ --program-prefix=llvm-
      -% gmake all; gmake install
      -
      -
      - -

      Cygwin/x86:

      - -
      -
      -% cd build
      -% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
      -  --disable-shared --enable-languages=c,c++ --disable-c-mbchar \
      -  --program-prefix=llvm-
      -% gmake all; gmake install
      -
      -
      - -

      Solaris/SPARC:

      - -

      The GCC front-end can be configured for either SPARC V8 (32 bit) or - SPARC V9 (64 bit). This changes, among other things, the sizes of - integer types and the macros defined for conditional compilation.

      - -

      The SPARC V8 ABI support is more robust than the V9 ABI support and can - generate SPARC V9 code. It is highly recommended that you use the V8 - ABI with LLVM, as shown below. Also, note that Solaris has trouble - with various wide (multibyte) character functions from C as referenced - from C++, so we typically configure with --disable-c-mbchar (cf. Bug 206).

      - -
      -
      -% cd build
      -% ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \
      -  --disable-shared --enable-languages=c,c++ --host=sparc-sun-solaris2.8 \
      -  --disable-c-mbchar --program-prefix=llvm-
      -% gmake all; gmake install
      -
      -
      - -

      Common Problem: You may get error messages regarding the fact - that LLVM does not support inline assembly. Here are two common - fixes:

      - -
        -
      • Fix 1: If you have system header files that include inline - assembly, you may have to modify them to remove the inline assembly - and install the modified versions in - $CFEINSTALL/lib/gcc/target-triplet/3.4-llvm/include.

      • - -
      • Fix 2: If you are building the C++ front-end on a CPU we - haven't tried yet, you will probably have to edit the appropriate - version of atomicity.h under - src/libstdc++-v3/config/cpu/name-of-cpu/atomicity.h - and apply a patch so that it does not use inline assembly.
      • -
      - -

      Porting to a new architecture: If you are porting the front-end - to a new architecture or compiling in a configuration that we have not - tried previously, there are probably several changes you will have to - make to the GCC target to get it to work correctly. These include:

      - -
        -
      • Often targets include special assembler or linker flags which - llvm-as, opt, or llvm-ld do not - understand. In general, these can just be removed.
      • - -
      • LLVM currently does not support any floating point values other than - 32-bit and 64-bit IEEE floating point. The primary effect of this - is that you may have to map "long double" onto "double".
      • - -
      • The profiling hooks in GCC do not apply at all to the LLVM - front-end. These may need to be disabled.
      • - -
      • No inline assembly for position independent code. At the LLVM - level, everything is position independent.
      • - -
      • We handle .init and .fini differently.
      • - -
      • You may have to disable multilib support in your target. Using - multilib support causes the GCC compiler driver to add a lot of - "-L" options to the link line, which do not relate to - LLVM. To disable multilibs, delete any - MULTILIB_OPTIONS lines from your target files.
      • - -
      • Did we mention that we don't support inline assembly? You'll - probably have to add some fixinclude hacks to disable it in the - system headers.
      • -
    12. - -
    13. Put $CFEINSTALL/bin into your PATH environment - variable.

      - -
      -csh: -
      -  % setenv PATH $CFEINSTALL/bin:$PATH
      -
      -sh: -
      -  % export PATH=$CFEINSTALL/bin:$PATH
      -
      -
      -
    14. - -
    15. Go back into the LLVM source tree proper. Rerun configure, using the - same options as the last time. This will cause the configuration to now - find the newly built llvm-gcc and llvm-g++ executables.

    16. - -
    17. Rebuild your CVS tree. This shouldn't cause the whole thing to be - rebuilt, but it should build the runtime libraries. After the tree is - built, install the runtime libraries into your GCC front-end build tree. - These are the commands you need:

      - -
      -
      -% gmake
      -% gmake -C runtime install-bytecode
      -
      -
      -
    18. - -
    19. Optionally, build a symbol table for the newly installed runtime - libraries. Although this step is optional, you are strongly encouraged to - do this as the symbol tables will make a significant difference in your - link times. Use the llvm-ranlib tool to do this, as follows:

      - -
      -
      -% cd $CFEINSTALL/lib
      -% llvm-ranlib libiberty.a
      -% llvm-ranlib libstdc++.a
      -% llvm-ranlib libsupc++.a
      -% cd $CFEINSTALL/lib/gcc/target-triplet/3.4-llvm
      -% llvm-ranlib libgcc.a
      -% llvm-ranlib libgcov.a
      -
      -
      -
    20. - -
    21. Test the newly-installed C frontend by one or more of the following - means:

      - -
        -
      • running the feature & regression tests via make - check
      • -
      • compiling and running a "hello, LLVM" program in C and C++.
      • -
      • running the tests found in the llvm-test CVS module
      • -
    22. -
    - -
    -
    License Information @@ -430,9 +90,8 @@ Valid HTML 4.01! - Brian Gaeke
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/09 15:59:08 $ + Last modified: $Date: 2007/02/14 07:42:12 $ From sabre at nondot.org Wed Feb 14 01:43:15 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 01:43:15 -0600 Subject: [llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html Message-ID: <200702140743.l1E7hFpL028105@zion.cs.uiuc.edu> Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.63 -> 1.64 --- Log message: fix validation bug --- Diffs of the changes: (+1 -2) CFEBuildInstrs.html | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.63 llvm/docs/CFEBuildInstrs.html:1.64 --- llvm/docs/CFEBuildInstrs.html:1.63 Wed Feb 14 01:42:12 2007 +++ llvm/docs/CFEBuildInstrs.html Wed Feb 14 01:42:59 2007 @@ -78,7 +78,6 @@

    More information is available in the FAQ.

    -
    @@ -91,7 +90,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 07:42:12 $ + Last modified: $Date: 2007/02/14 07:42:59 $ From reid at x10sys.com Wed Feb 14 01:58:04 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 01:58:04 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702140758.l1E7w4Y8028840@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.7 -> 1.8 --- Log message: Incorporate Chris Lattner's second round of feedback. --- Diffs of the changes: (+40 -32) DeveloperPolicy.html | 72 ++++++++++++++++++++++++++++----------------------- 1 files changed, 40 insertions(+), 32 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.7 llvm/docs/DeveloperPolicy.html:1.8 --- llvm/docs/DeveloperPolicy.html:1.7 Wed Feb 14 01:22:19 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 01:57:48 2007 @@ -34,6 +34,7 @@
  • Copyright and License
      +
    1. Attribution
    2. Copyright
    3. License
    4. Developer Agreements
    5. @@ -184,11 +185,10 @@
    6. Code must compile cleanly (no errors, no warnings) on at least one platform.
    7. Code must pass the deja gnu (llvm/test) test suite.
    8. -

    Additionally, the committer is responsible for all of the following items. - It is considered significantly preferable for all of these items to be - accounted for before the code is submitted for review or committed.

    + The developer should ensure each of the following before the code is + submitted for review or committed.

    1. Code must compile cleanly on all platforms.
    2. Code must pass the llvm-test test suite including @@ -212,16 +212,17 @@ selected (see the Testing Guide for details).
    3. Test cases should be written in LLVM assembly language unless the - feature or regression being tested requires another language.
    4. -
    5. Test cases, especially for regressions, should be as reduced as - possible, preferably by - bugpoint. It is unacceptable + feature or regression being tested requires another language (e.g. the + but being fixed or feature being implemented is in the lvm-gcc C++ + front-end).
    6. +
    7. Test cases, especially for regressions, should be much as reduced as + possible, by bugpoint or + manually. It is unacceptable to place an entire failing program into llvm/test as this creates a time-to-test burden on all developers. Keep them short!
    8. More extensive test cases (applications, benchmarks, etc.) should be - added to the llvm-test test suite, after approval from the - Oversight Group. This test suite is for coverage not features or - regressions.
    9. + added to the llvm-test test suite. This test suite is for + coverage not features or regressions.
    @@ -239,9 +240,9 @@
    1. Patches must be made against the CVS HEAD (main development trunk), not a branch.
    2. -
    3. Patches must be made with this cvs command:
      +    
    4. Patches should be made with this command:
           cvs diff -Ntdup -5
      or with the utility utils/mkpatch.
    5. -
    6. Patches must not include differences in generated code such as the +
    7. Patches should not include differences in generated code such as the code generated by flex, bison or tblgen. The utils/mkpatch utility takes care of this for you.
    @@ -264,9 +265,9 @@

    When a patch is ready to be submitted, these policies apply:

    1. Patches should be submitted immediately after they are generated. Stale - patches are unlikely to apply correctly and could be rejected simply due to - age.
    2. -
    3. Patches must be submitted by e-mail to the + patches may not apply correctly if the underlying code changes between the + time the patch was created and the time it is applied.
    4. +
    5. Patches should be submitted by e-mail to the llvm-commits list.
    @@ -279,8 +280,9 @@
    1. The patch is subject to review by anyone on the llvm-commits email list.
    2. -
    3. Any changes recommended by the reviewer must be made by the submitter - of the patch and the patch re-submitted.
    4. +
    5. Changes recommended by a reviewer should be incorporated into your + patch or you should explain why the reviewer is incorrect. This patch + iterates until there are no more review comments.
    6. If the submitter believes the review comment is in error, a response to the llvm-commits list should be made explaining why the recommendation @@ -310,14 +312,15 @@
      1. Commit access is not granted to anyone unless they specifically ask for it.
      2. -
      3. Requests for commit access must be sent to the LLVM Oversight Group at - oversight at llvm.org.
      4. +
      5. Requests for commit access must be sent to the + LLVM Oversight Group.
      6. Granting commit access is at the sole discretion of the LLVM Oversight Group.
      7. -
      8. Submitting patches to LLVM via the patch policy above will greatly - increase the chance that your request for commit access is granted.
      9. -
      10. Getting to know the members of the LLVM community (email, IRC, in person - contact, etc.) will also increase your chances.
      11. +
      +

      Submitting patches to LLVM via the patch policy above will greatly + increase the chance that your request for commit access is granted. Getting + to know the members of the LLVM community (email, IRC, in person contact, + etc.) will also increase your chances.

    @@ -328,8 +331,13 @@ apply:

    1. You are granted commit-after-approval to all parts of LLVM. - To get approval, submit a patch to llvm-commits per the patch policies - above. When approved you may commit it yourself.
    2. + To get approval, submit a patch to + llvm-commits + per the patch policies above. When approved you may commit it + yourself. +
    3. You are allowed to commit patches without approval which you think are + obvious. This is clearly a subjective decision. We simply expect you to + use good judgement.
    4. You are granted commit-without-approval to those portions of LLVM that you own (contributed) or maintain (have been assigned responsibility for), with the proviso that such commits must not break the build. This is @@ -340,8 +348,7 @@ making progress. The developers is welcome to re-commit the change after the problem has been fixed.
    5. Multiple violations of these policies or a single egregious violation - may cause commit access to be revoked, at the sole discretion of the - LLVM Oversight Group.
    6. + may cause commit access to be revoked.
    @@ -363,7 +370,7 @@ - +

    The LLVM project believes in correct attribution of contributions to their contributors, as follows:

    @@ -406,8 +413,8 @@

    LLVM licensing decisions will be made by the LLVM Oversight Group. Any - issues, comments or suggestions with the licensing should be sent to - oversight at llvm.org.

    + issues, comments or suggestions with the licensing should be sent to the + LLVM Oversight Group.

    The LLVM Oversight Group intends to keep LLVM perpetually open source and to use liberal open source licenses. The current license is the University of Illinois Open Source License (see LICENSE.TXT), which boils @@ -459,9 +466,10 @@ src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> Valid HTML 4.01! - Written By: LLVM Oversight Group
    + Written By: the + LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 07:22:19 $ + Last modified: $Date: 2007/02/14 07:57:48 $ From evan.cheng at apple.com Wed Feb 14 02:00:41 2007 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 14 Feb 2007 00:00:41 -0800 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMSubtarget.cpp ARMSubtarget.h ARMTargetMachine.cpp In-Reply-To: <200702131952.l1DJqko8021861@zion.cs.uiuc.edu> References: <200702131952.l1DJqko8021861@zion.cs.uiuc.edu> Message-ID: <7661060F-E494-4814-B2A5-FCAF2C382FA3@apple.com> > > Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp > diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.21 llvm/lib/ > Target/ARM/ARMTargetMachine.cpp:1.22 > --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.21 Tue Feb 13 > 08:07:13 2007 > +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Tue Feb 13 13:52:28 2007 > @@ -34,13 +34,15 @@ > /// > ARMTargetMachine::ARMTargetMachine(const Module &M, const > std::string &FS) > : Subtarget(M, FS), > - DataLayout(Subtarget.isTargetDarwin() ? > + DataLayout(Subtarget.isAPCS_ABI() ? > + //APCS ABI > (Subtarget.isThumb() ? > std::string("e-p:32:32-d:32:32-l:32:32-s:16:32-b:8:32-B: > 8:32-A:32") : > std::string("e-p:32:32-d:32:32-l:32:32")) : > + //AAPCS ABI > (Subtarget.isThumb() ? > - std::string("e-p:32:32-d:32:64-l:64:64-s:16:32-b:8:32-B: > 8:32-A:32") : > - std::string("e-p:32:32-d:32:64-l:64:64"))), > + std::string("e-p:32:32-d:64:64-l:64:64-s:16:32-b:8:32-B: > 8:32-A:32") : > + std::string("e-p:32:32-d:64:64-l:64:64"))), > InstrInfo(Subtarget), > FrameInfo(Subtarget) {} Hi Lauro, I am not sure if this is correct. Mac OS X sets i64 alignment to 8, but I am not sure if other OS which also uses APCS ABI has the same alignment requirement. I think it's possible for ARM / Linux to use APCS ABI as well? Is it possible for you to find out what's the long alignment requirement in that case? Thanks, Evan > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From reid at x10sys.com Wed Feb 14 02:10:00 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 02:10:00 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702140810.l1E8A0se031246@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.8 -> 1.9 --- Log message: Add a missing . --- Diffs of the changes: (+2 -2) DeveloperPolicy.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.8 llvm/docs/DeveloperPolicy.html:1.9 --- llvm/docs/DeveloperPolicy.html:1.8 Wed Feb 14 01:57:48 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 02:09:40 2007 @@ -95,7 +95,7 @@

    This section contains policies that pertain generally to LLVM developers.

    LLVM Developers are expected to meet the following obligations in order - for LLVM to maintain a high standard of quality

    + for LLVM to maintain a high standard of quality.

    @@ -469,7 +469,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 07:57:48 $ + Last modified: $Date: 2007/02/14 08:09:40 $ From reid at x10sys.com Wed Feb 14 02:13:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 02:13:58 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702140813.l1E8Dw6O001089@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.9 -> 1.10 --- Log message: Fix word usage. --- Diffs of the changes: (+2 -2) DeveloperPolicy.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.9 llvm/docs/DeveloperPolicy.html:1.10 --- llvm/docs/DeveloperPolicy.html:1.9 Wed Feb 14 02:09:40 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 02:13:38 2007 @@ -281,7 +281,7 @@
  • The patch is subject to review by anyone on the llvm-commits email list.
  • Changes recommended by a reviewer should be incorporated into your - patch or you should explain why the reviewer is incorrect. This patch + patch or you should explain why the reviewer is incorrect. This process iterates until there are no more review comments.
  • If the submitter believes the review comment is in error, a response to the @@ -469,7 +469,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 08:09:40 $ + Last modified: $Date: 2007/02/14 08:13:38 $ From reid at x10sys.com Wed Feb 14 02:19:35 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 02:19:35 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702140819.l1E8JZSo005488@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.10 -> 1.11 --- Log message: Some more minor tweaks. --- Diffs of the changes: (+11 -11) DeveloperPolicy.html | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.10 llvm/docs/DeveloperPolicy.html:1.11 --- llvm/docs/DeveloperPolicy.html:1.10 Wed Feb 14 02:13:38 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 02:19:16 2007 @@ -186,16 +186,16 @@ platform.
  • Code must pass the deja gnu (llvm/test) test suite.
  • -

    Additionally, the committer is responsible for all of the following items. - The developer should ensure each of the following before the code is - submitted for review or committed.

    -
      -
    1. Code must compile cleanly on all platforms.
    2. -
    3. Code must pass the llvm-test test suite including - SPEC CINT2000, SPEC CFP2000, SPEC CINT2006, and SPEC CFP2006.
    4. -
    5. The change set must not cause performance or correctness regressions +

      Additionally, the committer is responsible for addressing all of the + following items (preferably before submission):

      +
        +
      1. The code should compile cleanly on all platforms.
      2. +
      3. The changes should not cause regressions in the llvm-test + suite including SPEC CINT2000, SPEC CFP2000, SPEC CINT2006, and + SPEC CFP2006.
      4. +
      5. The change set should not cause performance or correctness regressions for the LLVM tools.
      6. -
      7. The changes must not cause performance or correctness regressions in +
      8. The changes should not cause performance or correctness regressions in code compiled with LLVM on all applicable targets.
      @@ -213,7 +213,7 @@ details).
    6. Test cases should be written in LLVM assembly language unless the feature or regression being tested requires another language (e.g. the - but being fixed or feature being implemented is in the lvm-gcc C++ + bug being fixed or feature being implemented is in the lvm-gcc C++ front-end).
    7. Test cases, especially for regressions, should be much as reduced as possible, by bugpoint or @@ -469,7 +469,7 @@ Written By: the LLVM Oversight Group
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2007/02/14 08:13:38 $ + Last modified: $Date: 2007/02/14 08:19:16 $ From reid at x10sys.com Wed Feb 14 02:23:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 02:23:25 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702140823.l1E8NPOr006582@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.11 -> 1.12 --- Log message: Drop a policy. --- Diffs of the changes: (+1 -2) DeveloperPolicy.html | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.11 llvm/docs/DeveloperPolicy.html:1.12 --- llvm/docs/DeveloperPolicy.html:1.11 Wed Feb 14 02:19:16 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 02:23:08 2007 @@ -442,7 +442,6 @@ the entire software base can be managed by a single copyright holder.
    8. allow their contribution(s) to be licensed as open source by the then current license chosen by the LLVM Oversight Group.
    9. -
    10. not make LLVM available under any other licensing agreement.
    11. @@ -469,7 +468,7 @@ Written By: the LLVM Oversight Group
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2007/02/14 08:19:16 $ + Last modified: $Date: 2007/02/14 08:23:08 $ From lauro.venancio at gmail.com Wed Feb 14 07:48:48 2007 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Wed, 14 Feb 2007 10:48:48 -0300 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMSubtarget.cpp ARMSubtarget.h ARMTargetMachine.cpp In-Reply-To: <7661060F-E494-4814-B2A5-FCAF2C382FA3@apple.com> References: <200702131952.l1DJqko8021861@zion.cs.uiuc.edu> <7661060F-E494-4814-B2A5-FCAF2C382FA3@apple.com> Message-ID: <9c10c9f0702140548k58914ab9ic0d60bdf48ebad9e@mail.gmail.com> > Hi Lauro, > > I am not sure if this is correct. Mac OS X sets i64 alignment to 8, > but I am not sure if other OS which also uses APCS ABI has the same > alignment requirement. In the code, i64 darwin alignment was always 4 bytes. > I think it's possible for ARM / Linux to use > APCS ABI as well? Is it possible for you to find out what's the long > alignment requirement in that case? > Linux uses APCS ABI too. arm-linux-gnu uses APCS and arm-linux-gnueabi uses AAPCS. The i64 arm-linux-gnu alignment is 4. Lauro From reid at x10sys.com Wed Feb 14 10:21:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 10:21:27 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702141621.l1EGLRsc031344@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.12 -> 1.13 --- Log message: A few changes: 1. Fix typos 2. Move Terminology to the end 3. Simplify language in a few spots. 4. Add a policy that larger increments require a larger testing effort. --- Diffs of the changes: (+78 -70) DeveloperPolicy.html | 148 ++++++++++++++++++++++++++------------------------- 1 files changed, 78 insertions(+), 70 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.12 llvm/docs/DeveloperPolicy.html:1.13 --- llvm/docs/DeveloperPolicy.html:1.12 Wed Feb 14 02:23:08 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 10:21:10 2007 @@ -54,47 +54,13 @@ the policy in clear terms, we hope each developer can know ahead of time what to expect when making LLVM contributions.

      - - - -
      -

      So that the policies defined in the next sections are clear, we first - define some terms here.

      -
      -
      Change
      -
      Any modification to LLVM including documentation, tests, build system, - etc. either in patch or - commit form.
      -
      Commit
      -
      A change submitted directly to LLVM software - repository via the cvs commit command.
      -
      Developer
      -
      Anyone who submits a change to LLVM.
      -
      Increment
      -
      A change or set of changes, whether by - patch or commit, that are - related by a single common purpose. Increments are atomic as they - leave LLVM in a stable state (both compiling and working properly).
      -
      Must
      -
      When used in a policy statement, the term must implies a - non-optional requirement on the developer.
      -
      Patch
      -
      A change submitted by email in patch (diff) - format generated by the cvs diff command.
      -
      Should
      -
      When used in a policy statement, the term should implies a - recommended but optional requirement on the developer.
      -
      -
      - -

    This section contains policies that pertain generally to LLVM developers. -

    LLVM Developers are expected to meet the following obligations in order + LLVM Developers are expected to meet the following obligations in order for LLVM to maintain a high standard of quality.

    @@ -102,10 +68,11 @@

    Developers should stay informed by reading at least the - llvmdev email list. If you are doing - anything more than just casual work on LLVM, it is highly suggested that you - also subscribe to the llvm-commits list and pay attention to changes being - made by others.

    + llvmdev + email list. If you are doing anything more than just casual work on LLVM, + it is suggested that you also subscribe to the + llvm-commits + list and pay attention to changes being made by others.

    We recommend that active developers register an email account with LLVM Bugzilla and preferably subscribe to the llvm-bugs @@ -123,14 +90,15 @@

  • keep the community informed about future changes to LLVM,
  • avoid duplication of effort by having multiple parties working on the same thing and not knowing about it, and
  • -
  • ensure that any issues around the proposed work are discussed and - resolved before any significant work is accomplished.
  • +
  • ensure that any technical issues around the proposed work are + discussed and resolved before any significant work is done.
  • The design of LLVM is carefully controlled to ensure that all the pieces fit together well. If you plan to make a major change to the way LLVM works or a major new extension, it is a good idea to get consensus with the development community before you start working on it.

    + @@ -138,7 +106,7 @@

    LLVM has a code review policy. Code review is an excellent way to ensure high quality in the software. The following policies apply:

      -
    1. All developers are required to have any significant changes reviewed +
    2. All developers are required to have significant changes reviewed before they are committed to the repository.
    3. Code reviews are conducted by email.
    4. Code can be reviewed either before it is committed or after.
    5. @@ -171,6 +139,7 @@ work (into a logical progression), simplifies code review and reduces the chance that you will get negative feedback on the change. Small increments also facilitate the maintenance of a high quality code base. +
    6. Larger increments require a larger testing effort.
    @@ -196,7 +165,7 @@
  • The change set should not cause performance or correctness regressions for the LLVM tools.
  • The changes should not cause performance or correctness regressions in - code compiled with LLVM on all applicable targets.
  • + code compiled by LLVM on all applicable targets. @@ -211,15 +180,16 @@ llvm/test directory. The appropriate sub-directory should be selected (see the Testing Guide for details). -
  • Test cases should be written in LLVM assembly language unless the +
  • Test cases should be written in + LLVM assembly language unless the feature or regression being tested requires another language (e.g. the bug being fixed or feature being implemented is in the lvm-gcc C++ front-end).
  • -
  • Test cases, especially for regressions, should be much as reduced as +
  • Test cases, especially for regressions, should be reduced as much as possible, by bugpoint or manually. It is unacceptable to place an entire failing program into llvm/test as this creates - a time-to-test burden on all developers. Keep them short!
  • + a time-to-test burden on all developers. Please keep them short.
  • More extensive test cases (applications, benchmarks, etc.) should be added to the llvm-test test suite. This test suite is for coverage not features or regressions.
  • @@ -256,7 +226,10 @@
  • The patch must compile against the CVS HEAD cleanly (zero warnings, zero errors).
  • All the llvm/test (Deja Gnu) tests must pass.
  • -
  • All the llvm-test tests must pass on at least one platform.
  • +
  • The patch should cause no regressions in the llvm-test test suite. How + much testing is appropriate depends on the nature of the patch. We leave it + to your good judgement, but you will be responsible for fixing any + regressions or reverting the patch.
  • @@ -278,15 +251,15 @@

    After a patch has been submitted, these policies apply:

      -
    1. The patch is subject to review by anyone on the llvm-commits email list. -
    2. +
    3. The patch is subject to review by anyone on the + llvm-commits + email list.
    4. Changes recommended by a reviewer should be incorporated into your - patch or you should explain why the reviewer is incorrect. This process - iterates until there are no more review comments.
    5. -
    6. If the submitter believes the review comment is in error, a response to - the - llvm-commits list should be made explaining why the recommendation - cannot be followed.
    7. + patch or you should explain why the reviewer is incorrect. +
    8. Changes to the patch must be re-submitted to the + llvm-commits + email list.
    9. +
    10. This process iterates until all review issues have been addressed.
    @@ -300,7 +273,7 @@
  • The patch submitter is responsible for all aspects of the patch per the quality policy above.
  • If the patch is discovered to not meet the - quality standards standards within a reasonable time + quality policy standards within a reasonable time frame (24 hours), it may be subject to reversal.
  • @@ -333,19 +306,19 @@
  • You are granted commit-after-approval to all parts of LLVM. To get approval, submit a patch to llvm-commits - per the patch policies above. When approved you may commit it - yourself.
  • + per the patch policies above. When approved you + may commit it yourself.
  • You are allowed to commit patches without approval which you think are obvious. This is clearly a subjective decision. We simply expect you to use good judgement.
  • -
  • You are granted commit-without-approval to those portions of LLVM - that you own (contributed) or maintain (have been assigned responsibility - for), with the proviso that such commits must not break the build. This is - a "trust but verify" policy and commits of this nature are reviewed after - they are committed.
  • +
  • You are allowed to commit patches without approval to those portions + of LLVM that you own (contributed) or maintain (have been assigned + responsibility for), with the proviso that such commits must not break the + build. This is a "trust but verify" policy and commits of this nature are + reviewed after they are committed.
  • Commits that violate the quality standards may be reverted. This is necessary when the change blocks other developers from - making progress. The developers is welcome to re-commit the change after + making progress. The developer is welcome to re-commit the change after the problem has been fixed.
  • Multiple violations of these policies or a single egregious violation may cause commit access to be revoked.
  • @@ -357,7 +330,8 @@

    We address here the issues of copyright and license for the LLVM project. - The object of the copyright and license is the LLVM source and documentation. + The object of the copyright and license is the LLVM source code and + documentation. Currently, the University of Illinois is the LLVM copyright holder and the terms of its license to LLVM users and developers is the University of @@ -366,7 +340,7 @@

    @@ -388,7 +362,7 @@
  • Developers should submit or commit patches to the CREDITS.txt file to summarize their contributions.
  • -
  • Commit comments should contain correct attribution of the person who s +
  • Commit comments should contain correct attribution of the person who submitted the patch if that person is not the committer (i.e. when a developer with commit privileges commits a patch for someone else).
  • @@ -398,7 +372,7 @@

    -

    However, for consistency and ease of management, the project requires the +

    For consistency and ease of management, the project requires the copyright for all LLVM software to be held by a single copyright holder. Although UIUC may assign the copyright of the software to another entity, the intent for the project is to always have a single entity hold the copy @@ -417,7 +391,8 @@ LLVM Oversight Group.

    The LLVM Oversight Group intends to keep LLVM perpetually open source and to use liberal open source licenses. The current license is the - University of Illinois Open Source License (see LICENSE.TXT), which boils + + University of Illinois/NCSA Open Source License, which boils down to this:

    • You can freely distribute LLVM.
    • @@ -446,6 +421,39 @@
    + + +
    +

    So that the policies defined in this document are clear, we define some + terms here.

    +
    +
    Change
    +
    Any modification to LLVM including documentation, tests, build system, + etc. either in patch or + commit form.
    +
    Commit
    +
    A change submitted directly to LLVM software + repository via the cvs commit command.
    +
    Developer
    +
    Anyone who submits a change to LLVM.
    +
    Increment
    +
    A change or set of changes, whether by + patch or commit, that are + related by a single common purpose. Increments are atomic as they + leave LLVM in a stable state (both compiling and working properly).
    +
    Must
    +
    When used in a policy statement, the term must implies a + non-optional requirement on the developer.
    +
    Patch
    +
    A change submitted by email in patch (diff) + format generated by the cvs diff command.
    +
    Should
    +
    When used in a policy statement, the term should implies a + recommended but optional requirement on the developer.
    +
    +
    + +
    @@ -468,7 +476,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 08:23:08 $ + Last modified: $Date: 2007/02/14 16:21:10 $ From reid at x10sys.com Wed Feb 14 10:22:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 10:22:11 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702141622.l1EGMBnk031437@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.13 -> 1.14 --- Log message: Fix a grammaro. --- Diffs of the changes: (+2 -2) DeveloperPolicy.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.13 llvm/docs/DeveloperPolicy.html:1.14 --- llvm/docs/DeveloperPolicy.html:1.13 Wed Feb 14 10:21:10 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 10:21:54 2007 @@ -340,7 +340,7 @@

    NOTE: This section deals with legal matters but does not provide legal - advice. It is intended only as a general guideline only.

    + advice. It is intended only as a general guideline.

    @@ -476,7 +476,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 16:21:10 $ + Last modified: $Date: 2007/02/14 16:21:54 $ From reid at x10sys.com Wed Feb 14 11:21:15 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 11:21:15 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702141721.l1EHLFAa002035@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.14 -> 1.15 --- Log message: Fix the table of contents to match the document body. --- Diffs of the changes: (+8 -6) DeveloperPolicy.html | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.14 llvm/docs/DeveloperPolicy.html:1.15 --- llvm/docs/DeveloperPolicy.html:1.14 Wed Feb 14 10:21:54 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 11:20:59 2007 @@ -13,7 +13,6 @@

    Contents

    1. Introduction
    2. -
    3. Terminology
    4. General Policies
      1. Stay Informed
      2. @@ -28,7 +27,8 @@
      3. Patch Form
      4. Patch Testing
      5. Patch Submission
      6. -
      7. After Submission
      8. +
      9. After Submission
      10. +
      11. After Commit
      12. Obtaining Commit Access
      13. New Committers
    5. @@ -39,6 +39,8 @@
    6. License
    7. Developer Agreements
    +
  • Terminology
  • +
  • Policy Notes
  • Written by LLVM Oversight Team
    @@ -247,7 +249,7 @@
    - +

    After a patch has been submitted, these policies apply:

      @@ -264,7 +266,7 @@
    - +

    After a patch has been committed, these policies apply:

      @@ -454,7 +456,7 @@
    - +

    This section contains some notes on policy topics that need to be @@ -476,7 +478,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 16:21:54 $ + Last modified: $Date: 2007/02/14 17:20:59 $ From reid at x10sys.com Wed Feb 14 11:24:21 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 11:24:21 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702141724.l1EHOLCe002224@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.15 -> 1.16 --- Log message: Synchronize TOC headings with actual headings. --- Diffs of the changes: (+3 -3) DeveloperPolicy.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.15 llvm/docs/DeveloperPolicy.html:1.16 --- llvm/docs/DeveloperPolicy.html:1.15 Wed Feb 14 11:20:59 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 11:24:04 2007 @@ -46,7 +46,7 @@ -

    +

    This document contains the LLVM Developer Policy which defines the @@ -281,7 +281,7 @@

    - +

    Commit access to the repository is granted according to this policy:

      @@ -478,7 +478,7 @@ Written By: the LLVM Oversight Group
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2007/02/14 17:20:59 $ + Last modified: $Date: 2007/02/14 17:24:04 $ From llvm at cs.uiuc.edu Wed Feb 14 11:57:36 2007 From: llvm at cs.uiuc.edu (LLVM) Date: Wed, 14 Feb 2007 11:57:36 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bit_reduce.c bit_reduce.reference_output Message-ID: <200702141757.l1EHvaT0003178@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource/UnitTests/Integer: bit_reduce.c (r1.2) removed bit_reduce.reference_output (r1.2) removed --- Log message: The bit reduction functions are no longer implemented. --- Diffs of the changes: (+0 -0) 0 files changed From reid at x10sys.com Wed Feb 14 12:00:52 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 12:00:52 -0600 Subject: [llvm-commits] CVS: llvm-test/SingleSource/Makefile.singlesrc Message-ID: <200702141800.l1EI0qY5003254@zion.cs.uiuc.edu> Changes in directory llvm-test/SingleSource: Makefile.singlesrc updated: 1.35 -> 1.36 --- Log message: Don't let make fail if a singlesource compile failed. --- Diffs of the changes: (+1 -1) Makefile.singlesrc | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/SingleSource/Makefile.singlesrc diff -u llvm-test/SingleSource/Makefile.singlesrc:1.35 llvm-test/SingleSource/Makefile.singlesrc:1.36 --- llvm-test/SingleSource/Makefile.singlesrc:1.35 Thu Feb 8 21:43:45 2007 +++ llvm-test/SingleSource/Makefile.singlesrc Wed Feb 14 12:00:36 2007 @@ -23,7 +23,7 @@ ifndef USE_PRECOMPILED_BYTECODE Output/%.linked.rbc: Output/%.bc - cp -f $< $@ + -cp -f $< $@ Output/%.LOC.txt: $(SourceDir)/%.c cat $< | wc -l > $@ From dpatel at apple.com Wed Feb 14 15:54:22 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Wed, 14 Feb 2007 13:54:22 -0800 (PST) Subject: [llvm-commits] [123874] Maintain GCC Type Tree <--> LLVM Type connection during Message-ID: <20070214215422.084C7459ADCB@src> Revision: 123874 Author: dpatel Date: 2007-02-14 13:54:21 -0800 (Wed, 14 Feb 2007) Log Message: ----------- Maintain GCC Type Tree <--> LLVM Type connection during PCH write and PCH read. Use LLVM Type vector index, instead of pointer to LLVM Type, to connect LLVM Type with GCC Type Tree node. Modified Paths: -------------- apple-local/branches/llvm/gcc/flags.h apple-local/branches/llvm/gcc/llvm-backend.cpp apple-local/branches/llvm/gcc/llvm-internal.h apple-local/branches/llvm/gcc/llvm-types.cpp apple-local/branches/llvm/gcc/toplev.c apple-local/branches/llvm/gcc/tree.h Modified: apple-local/branches/llvm/gcc/flags.h =================================================================== --- apple-local/branches/llvm/gcc/flags.h 2007-02-14 20:34:14 UTC (rev 123873) +++ apple-local/branches/llvm/gcc/flags.h 2007-02-14 21:54:21 UTC (rev 123874) @@ -334,4 +334,7 @@ extern int flag_save_repository; /* APPLE LOCAL end ss2 */ +/* APPLE LOCAL LLVM */ +extern int flag_llvm_pch_read; + #endif /* ! GCC_FLAGS_H */ Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 20:34:14 UTC (rev 123873) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 21:54:21 UTC (rev 123874) @@ -64,6 +64,9 @@ #include "tree-inline.h" } +// Non-zero if bytecode from PCH is successfully read. +int flag_llvm_pch_read; + // Global state for the LLVM backend. Module *TheModule = 0; DebugInfo *TheDebugInfo = 0; @@ -184,6 +187,8 @@ oFILEstream *AsmOutStream = 0; +/// Read bytecode from PCH file. Initialize TheModue and setup +/// LTypes vector. void llvm_pch_read(void) { if (TheModule) @@ -199,10 +204,15 @@ cerr << ErrMsg << "\n"; exit(1); } + + // Read LLVM Types string table + readLLVMTypesStringTable(); + flag_llvm_pch_read = 1; } // Initialize PCH writing. void llvm_pch_write_init(void) { + timevar_push(TV_LLVM_INIT); AsmOutStream = new oFILEstream(asm_out_file); AsmOutFile = new OStream(*AsmOutStream); @@ -218,6 +228,8 @@ // wrong for llvm/.bc emission cases. flag_no_ident = 1; + flag_llvm_pch_read = 0; + timevar_pop(TV_LLVM_INIT); } @@ -227,6 +239,8 @@ AsmOutStream = new oFILEstream(asm_out_file); AsmOutFile = new OStream(*AsmOutStream); + flag_llvm_pch_read = 0; + // Create and set up the per-function pass manager. // FIXME: Move the code generator to be function-at-a-time. PerFunctionPasses = @@ -410,7 +424,10 @@ void llvm_asm_file_end(void) { timevar_push(TV_LLVM_PERFILE); llvm_shutdown_obj X; // Call llvm_shutdown() on exit. - + + if (flag_pch_file) + writeLLVMTypesStringTable(); + // Add an llvm.global_ctors global if needed. if (!StaticCtors.empty()) CreateStructorsList(StaticCtors, "llvm.global_ctors"); Modified: apple-local/branches/llvm/gcc/llvm-internal.h =================================================================== --- apple-local/branches/llvm/gcc/llvm-internal.h 2007-02-14 20:34:14 UTC (rev 123873) +++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-02-14 21:54:21 UTC (rev 123874) @@ -94,6 +94,9 @@ extern std::map EmittedGlobalVars; extern std::map EmittedFunctions; +extern void readLLVMTypesStringTable(); +extern void writeLLVMTypesStringTable(); + struct StructTypeConversionInfo; /// TypeConverter - Implement the converter from GCC types to LLVM types. Modified: apple-local/branches/llvm/gcc/llvm-types.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-types.cpp 2007-02-14 20:34:14 UTC (rev 123873) +++ apple-local/branches/llvm/gcc/llvm-types.cpp 2007-02-14 21:54:21 UTC (rev 123874) @@ -29,9 +29,11 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" +#include "llvm/TypeSymbolTable.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Assembly/Writer.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringExtras.h" #include #include @@ -45,7 +47,149 @@ #include "llvm-abi.h" +//===----------------------------------------------------------------------===// +// Matching LLVM types with GCC trees +//===----------------------------------------------------------------------===// +// +// LTypes is a vector of LLVM types. GCC tree nodes keep track of LLVM types +// using this vector's index. It is easier to save and restore the index than +// the LLVM type pointer while usig PCH. STL vector does not provide fast +// searching mechanism which is required to remove LLVM Type entry when type is +// refined and replaced by another LLVM Type. This is achieved by maintaining +// a map. +// Collection of LLVM Types and their names +static std::vector LTypes; +typedef DenseMap LTypesMapTy; +static LTypesMapTy LTypesMap; + +// GET_TYPE_LLVM/SET_TYPE_LLVM - Associate an LLVM type with each TREE type. +// These are lazily computed by ConvertType, accessors available only to C++ +// code. + +#define SET_TYPE_SYMTAB_LLVM(NODE, index) (TYPE_CHECK (NODE)->type.symtab.llvm = index) + +// Note down LLVM type for GCC tree node. +static const Type * llvm_set_type(tree Tr, const Type *Ty) { + + unsigned &TypeSlot = LTypesMap[Ty]; + if (TypeSlot) { + // Already in map. + SET_TYPE_SYMTAB_LLVM(Tr, TypeSlot); + return Ty; + } + + unsigned Index = LTypes.size() + 1; + LTypes.push_back(Ty); + SET_TYPE_SYMTAB_LLVM(Tr, Index); + LTypesMap[Ty] = Index; + + return Ty; +} + +#define SET_TYPE_LLVM(NODE, TYPE) (const Type *)llvm_set_type(NODE, TYPE) + +// Get LLVM Type for the GCC tree node based on LTypes vector index. +// When GCC tree node is initialized, it has 0 as the index value. This is +// why all recorded indexes are offset by 1. +static inline const Type *llvm_get_type(unsigned Index) { + + if (Index == 0) + return NULL; + assert ((Index - 1) < LTypes.size() && "Invalid LLVM Type index"); + return LTypes[Index - 1]; +} + +#define GET_TYPE_LLVM(NODE) \ + (const Type *)llvm_get_type( TYPE_CHECK (NODE)->type.symtab.llvm) + +// Erase type from LTypes vector +static void llvmEraseLType(const Type *Ty) { + + LTypesMapTy::iterator I = LTypesMap.find(Ty); + + if (I != LTypesMap.end()) { + // It is OK to clear this entry instead of removing this entry + // to avoid re-indexing of other entries. + LTypes[ LTypesMap[Ty] - 1] = NULL; + LTypesMap.erase(I); + } +} + +// Read LLVM Types string table +void readLLVMTypesStringTable() { + + GlobalValue *V = TheModule->getNamedGlobal("llvm.pch.types"); + if (!V) + return; + + // Value *GV = TheModule->getValueSymbolTable().lookup("llvm.pch.types"); + GlobalVariable *GV = cast(V); + ConstantStruct *LTypesNames = cast(GV->getOperand(0)); + + for (unsigned i = 0; i < LTypesNames->getNumOperands(); ++i) { + const Type *Ty = NULL; + + if (ConstantArray *CA = + dyn_cast(LTypesNames->getOperand(i))) { + std::string Str = CA->getAsString(); + Ty = TheModule->getTypeByName(Str); + assert (Ty != NULL && "Invalid Type in LTypes string table"); + } + // If V is not a string then it is empty. Insert NULL to represent + // empty entries. + LTypes.push_back(Ty); + } + + // Now, llvm.pch.types value is not required so remove it from the symbol table. + GV->eraseFromParent(); +} + + +// GCC tree's uses LTypes vector's index to reach LLVM types. +// Create a string table to hold these LLVM types' names. This string +// table will be used to recreate LTypes vector after loading PCH. +void writeLLVMTypesStringTable() { + + if (LTypes.empty()) + return; + + std::vector LTypesNames; + std::map < const Type *, std::string > TypeNameMap; + + // Collect Type Names in advance. + const TypeSymbolTable &ST = TheModule->getTypeSymbolTable(); + TypeSymbolTable::const_iterator TI = ST.begin(); + for (; TI != ST.end(); ++TI) { + TypeNameMap[TI->second] = TI->first; + } + + // Populate LTypesNames vector. + for (std::vector::iterator I = LTypes.begin(), + E = LTypes.end(); I != E; ++I) { + const Type *Ty = *I; + + // Give names to nameless types. + if (Ty && TypeNameMap[Ty].empty()) { + std::string NewName = TheModule->getTypeSymbolTable().getUniqueName("llvm.fe.ty"); + TheModule->addTypeName (NewName, Ty); + TypeNameMap[*I] = NewName; + } + + const std::string &TypeName = TypeNameMap[*I]; + LTypesNames.push_back(ConstantArray::get(TypeName, false)); + } + + // Create string table. + Constant *LTypesNameTable = ConstantStruct::get(LTypesNames, false); + + // Create variable to hold this string table. + GlobalVariable *GV = new GlobalVariable(LTypesNameTable->getType(), true, + GlobalValue::ExternalLinkage, + LTypesNameTable, + "llvm.pch.types", TheModule); +} + //===----------------------------------------------------------------------===// // Recursive Type Handling Code and Data //===----------------------------------------------------------------------===// @@ -193,7 +337,6 @@ } } - /// refineAbstractType - The callback method invoked when an abstract type is /// resolved to another type. An object must override this method to update /// its internal state to reference NewType instead of OldType. @@ -223,6 +366,7 @@ } } + llvmEraseLType(OldTy); TypeUsers.erase(I); // Next, remove OldTy's entry in the TargetData object if it has one. Modified: apple-local/branches/llvm/gcc/toplev.c =================================================================== --- apple-local/branches/llvm/gcc/toplev.c 2007-02-14 20:34:14 UTC (rev 123873) +++ apple-local/branches/llvm/gcc/toplev.c 2007-02-14 21:54:21 UTC (rev 123874) @@ -2279,6 +2279,13 @@ unlink (asm_file_name2); else if (fclose (asm_out_file) != 0) /* APPLE LOCAL end ss2 */ + /* APPLE LOCAL begin LLVM */ +#ifdef ENABLE_LLVM + /* While reading bytecodes from PCH file, asm_out_file was already + closed by llvm-backend. */ + if (!flag_llvm_pch_read) +#endif + /* APPLE LOCAL end LLVM */ fatal_error ("error closing %s: %m", asm_file_name); } Modified: apple-local/branches/llvm/gcc/tree.h =================================================================== --- apple-local/branches/llvm/gcc/tree.h 2007-02-14 20:34:14 UTC (rev 123873) +++ apple-local/branches/llvm/gcc/tree.h 2007-02-14 21:54:21 UTC (rev 123874) @@ -1750,7 +1750,7 @@ char * GTY ((tag ("1"))) pointer; struct die_struct * GTY ((tag ("2"))) die; /* APPLE LOCAL begin LLVM */ - long GTY ((tag ("3"))) llvm; /* Really an LLVM "Type*" */ + unsigned GTY ((tag ("3"))) llvm; /* Really an LLVM Type vector (LTypes) index */ } GTY ((desc ("LLVM_IS_ENABLED ? 3 : debug_hooks == &sdb_debug_hooks ? 1 : debug_hooks == &dwarf2_debug_hooks ? 2 : 0"), descbits ("2"))) symtab; /* APPLE LOCAL end LLVM */ @@ -2078,13 +2078,6 @@ #define SET_DECL_LLVM(NODE, LLVM) \ (DECL_CHECK (NODE)->decl.llvm = (long)(Value*)LLVM) -/* GET_TYPE_LLVM/SET_TYPE_LLVM - Associate an LLVM type with each TREE type. - * These are lazily computed by ConvertType, accessors available only to C++ - * code. - */ -#define GET_TYPE_LLVM(NODE) (const Type *)(TYPE_CHECK (NODE)->type.symtab.llvm) -#define SET_TYPE_LLVM(NODE, TYPE) \ - (const Type*)((TYPE_CHECK (NODE)->type.symtab.llvm) = (long)(TYPE)) #else /* C versions */ #define DECL_LLVM(NODE) \ From dpatel at apple.com Wed Feb 14 16:42:10 2007 From: dpatel at apple.com (dpatel at apple.com) Date: Wed, 14 Feb 2007 14:42:10 -0800 (PST) Subject: [llvm-commits] [123875] Clear llvm bytecode from asm_out_file after reading PCH. Message-ID: <20070214224210.D78F245D5605@src> Revision: 123875 Author: dpatel Date: 2007-02-14 14:42:10 -0800 (Wed, 14 Feb 2007) Log Message: ----------- Clear llvm bytecode from asm_out_file after reading PCH. Modified Paths: -------------- apple-local/branches/llvm/gcc/llvm-backend.cpp apple-local/branches/llvm/gcc/toplev.c Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp =================================================================== --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 21:54:21 UTC (rev 123874) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-14 22:42:10 UTC (rev 123875) @@ -195,6 +195,7 @@ delete TheModule; fclose (asm_out_file); + std::string ErrMsg; TheModule = ParseBytecodeFile(asm_file_name, Compressor::decompressToNewBuffer, @@ -205,6 +206,12 @@ exit(1); } + // Reopen asm_out_file for the rest of the compiler's use. + // This also removes llvm byte code from the asm_out_file. + asm_out_file = fopen (asm_file_name, "w+b"); + if (asm_out_file == 0) + fatal_error ("can%'t open %s for writing: %m", asm_file_name); + // Read LLVM Types string table readLLVMTypesStringTable(); flag_llvm_pch_read = 1; Modified: apple-local/branches/llvm/gcc/toplev.c =================================================================== --- apple-local/branches/llvm/gcc/toplev.c 2007-02-14 21:54:21 UTC (rev 123874) +++ apple-local/branches/llvm/gcc/toplev.c 2007-02-14 22:42:10 UTC (rev 123875) @@ -2279,13 +2279,6 @@ unlink (asm_file_name2); else if (fclose (asm_out_file) != 0) /* APPLE LOCAL end ss2 */ - /* APPLE LOCAL begin LLVM */ -#ifdef ENABLE_LLVM - /* While reading bytecodes from PCH file, asm_out_file was already - closed by llvm-backend. */ - if (!flag_llvm_pch_read) -#endif - /* APPLE LOCAL end LLVM */ fatal_error ("error closing %s: %m", asm_file_name); } From reid at x10sys.com Wed Feb 14 16:55:57 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 16:55:57 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702142255.l1EMtvSe008601@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.16 -> 1.17 --- Log message: Add feedback from Vikram Adve. --- Diffs of the changes: (+17 -3) DeveloperPolicy.html | 20 +++++++++++++++++--- 1 files changed, 17 insertions(+), 3 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.16 llvm/docs/DeveloperPolicy.html:1.17 --- llvm/docs/DeveloperPolicy.html:1.16 Wed Feb 14 11:24:04 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 16:55:40 2007 @@ -55,6 +55,13 @@ might arise from the distributed nature of LLVM's development. By stating the policy in clear terms, we hope each developer can know ahead of time what to expect when making LLVM contributions.

      +

      This policy is also designed to accomplish the following objectives:

      +
        +
      1. Attract both users and developers to the LLVM project.
      2. +
      3. Make life as simple and easy for contributors as possible.
      4. +
      5. Indicate that LLVM is a mature project with a thriving community and + sensible policies directing its ongoing development.
      6. +
    @@ -217,6 +224,9 @@
  • Patches should not include differences in generated code such as the code generated by flex, bison or tblgen. The utils/mkpatch utility takes care of this for you.
  • +
  • Patches must not include any patent violations. To the best of our + knowledge, LLVM is free of any existing patent violations and it is our + intent to keep it that way.
  • @@ -405,8 +415,8 @@

    We believe this fosters the widest adoption of LLVM because it allows commercial products to be derived from LLVM with few restrictions and - without a requirement for making any derived works also open source. We - suggest that you read the + without a requirement for making any derived works also open source (i.e. + LLVM' license is not a copyleft license). We suggest that you read the License if further clarification is needed.

    @@ -436,6 +446,10 @@
    Commit
    A change submitted directly to LLVM software repository via the cvs commit command.
    +
    Copyleft
    +
    A licensing policy that requires the licensee to adopt the terms of the + license for derived works. LLVM does not subscribe to this + policy.
    Developer
    Anyone who submits a change to LLVM.
    Increment
    @@ -478,7 +492,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 17:24:04 $ + Last modified: $Date: 2007/02/14 22:55:40 $ From reid at x10sys.com Wed Feb 14 16:58:58 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 16:58:58 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702142258.l1EMwwV8008714@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.17 -> 1.18 --- Log message: Fix a typo. --- Diffs of the changes: (+4 -4) DeveloperPolicy.html | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.17 llvm/docs/DeveloperPolicy.html:1.18 --- llvm/docs/DeveloperPolicy.html:1.17 Wed Feb 14 16:55:40 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 16:58:39 2007 @@ -416,9 +416,9 @@

    We believe this fosters the widest adoption of LLVM because it allows commercial products to be derived from LLVM with few restrictions and without a requirement for making any derived works also open source (i.e. - LLVM' license is not a copyleft license). We suggest that you read the - License if - further clarification is needed.

    + LLVM's license is not a copyleft license). We suggest that you read + the License + if further clarification is needed.

    @@ -492,7 +492,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 22:55:40 $ + Last modified: $Date: 2007/02/14 22:58:39 $ From sabre at nondot.org Wed Feb 14 18:54:36 2007 From: sabre at nondot.org (Chris Lattner) Date: Wed, 14 Feb 2007 18:54:36 -0600 Subject: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/cast-malloc.ll Message-ID: <200702150054.l1F0sa6U010571@zion.cs.uiuc.edu> Changes in directory llvm/test/Transforms/InstCombine: cast-malloc.ll updated: 1.3 -> 1.4 --- Log message: update to new t-d strings. --- Diffs of the changes: (+1 -1) cast-malloc.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Transforms/InstCombine/cast-malloc.ll diff -u llvm/test/Transforms/InstCombine/cast-malloc.ll:1.3 llvm/test/Transforms/InstCombine/cast-malloc.ll:1.4 --- llvm/test/Transforms/InstCombine/cast-malloc.ll:1.3 Fri Jan 26 02:25:06 2007 +++ llvm/test/Transforms/InstCombine/cast-malloc.ll Wed Feb 14 18:54:16 2007 @@ -5,7 +5,7 @@ ; The target datalayout is important for this test case. We have to tell ; instcombine that the ABI alignment for a long is 4-bytes, not 8, otherwise ; it won't do the transform. -target datalayout = "e-l:32:64" +target datalayout = "e-i64:32:64" int* %test(uint %size) { %X = malloc long, uint %size %ret = bitcast long* %X to int* From reid at x10sys.com Wed Feb 14 19:12:11 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 19:12:11 -0600 Subject: [llvm-commits] CVS: llvm/docs/DeveloperPolicy.html Message-ID: <200702150112.l1F1CBcC010894@zion.cs.uiuc.edu> Changes in directory llvm/docs: DeveloperPolicy.html updated: 1.18 -> 1.19 --- Log message: Fix validation errors. --- Diffs of the changes: (+2 -3) DeveloperPolicy.html | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/docs/DeveloperPolicy.html diff -u llvm/docs/DeveloperPolicy.html:1.18 llvm/docs/DeveloperPolicy.html:1.19 --- llvm/docs/DeveloperPolicy.html:1.18 Wed Feb 14 16:58:39 2007 +++ llvm/docs/DeveloperPolicy.html Wed Feb 14 19:11:54 2007 @@ -306,7 +306,6 @@ increase the chance that your request for commit access is granted. Getting to know the members of the LLVM community (email, IRC, in person contact, etc.) will also increase your chances.

    - @@ -372,7 +371,7 @@ the top of a file may become meaningless as maintenance/ownership of files changes.
  • Developers should submit or commit patches to the - CREDITS.txt + CREDITS.txt file to summarize their contributions.
  • Commit comments should contain correct attribution of the person who submitted the patch if that person is not the committer (i.e. when a @@ -492,7 +491,7 @@ Written By: the LLVM Oversight Group
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/14 22:58:39 $ + Last modified: $Date: 2007/02/15 01:11:54 $ From scottm at rushg.aero.org Wed Feb 14 19:57:50 2007 From: scottm at rushg.aero.org (Scott Michel) Date: Wed, 14 Feb 2007 17:57:50 -0800 Subject: [llvm-commits] TargetData update Message-ID: <20070215015750.GA30681@rush.aero.org> Included most of Chris' comments, fixed packed structure bug... -scooter -- Scott Michel scottm at aero.org High Performance Hardware Section Manager 310/336-5034 Computer Systems Research Department The Aerospace Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: TargetData-1.diff Type: text/x-diff Size: 7933 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20070214/297b36b9/attachment.bin From reid at x10sys.com Wed Feb 14 20:11:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:11:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/TargetData.cpp Message-ID: <200702150211.l1F2BQHh011803@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target: TargetData.cpp updated: 1.93 -> 1.94 --- Log message: Fixed packed structure breakage from earlier TargetData patch; applied Chris Lattner's code style suggestions. Patch by Scott Michel! --- Diffs of the changes: (+31 -75) TargetData.cpp | 106 ++++++++++++++++----------------------------------------- 1 files changed, 31 insertions(+), 75 deletions(-) Index: llvm/lib/Target/TargetData.cpp diff -u llvm/lib/Target/TargetData.cpp:1.93 llvm/lib/Target/TargetData.cpp:1.94 --- llvm/lib/Target/TargetData.cpp:1.93 Tue Feb 13 23:52:17 2007 +++ llvm/lib/Target/TargetData.cpp Wed Feb 14 20:11:06 2007 @@ -50,8 +50,8 @@ const Type *Ty = ST->getElementType(i); unsigned TyAlign; uint64_t TySize; - TyAlign = (unsigned) TD.getABITypeAlignment(Ty); - TySize = (unsigned) TD.getTypeSize(Ty); + TyAlign = (ST->isPacked() ? 1 : TD.getABITypeAlignment(Ty)); + TySize = TD.getTypeSize(Ty); // Add padding if necessary to make the data element aligned properly... if (StructSize % TyAlign != 0) @@ -94,8 +94,7 @@ TargetAlignElem TargetAlignElem::get(AlignTypeEnum align_type, unsigned char abi_align, - unsigned char pref_align, short bit_width) -{ + unsigned char pref_align, short bit_width) { TargetAlignElem retval; retval.AlignType = align_type; retval.ABIAlign = abi_align; @@ -105,15 +104,13 @@ } bool -TargetAlignElem::operator<(const TargetAlignElem &rhs) const -{ +TargetAlignElem::operator<(const TargetAlignElem &rhs) const { return ((AlignType < rhs.AlignType) || (AlignType == rhs.AlignType && TypeBitWidth < rhs.TypeBitWidth)); } bool -TargetAlignElem::operator==(const TargetAlignElem &rhs) const -{ +TargetAlignElem::operator==(const TargetAlignElem &rhs) const { return (AlignType == rhs.AlignType && ABIAlign == rhs.ABIAlign && PrefAlign == rhs.PrefAlign @@ -121,20 +118,13 @@ } std::ostream & -TargetAlignElem::dump(std::ostream &os) const -{ +TargetAlignElem::dump(std::ostream &os) const { return os << AlignType << TypeBitWidth << ":" << (int) (ABIAlign * 8) << ":" << (int) (PrefAlign * 8); } -std::ostream & -llvm::operator<<(std::ostream &os, const TargetAlignElem &elem) -{ - return elem.dump(os); -} - const TargetAlignElem TargetData::InvalidAlignmentElem = TargetAlignElem::get((AlignTypeEnum) -1, 0, 0, 0); @@ -146,9 +136,9 @@ A TargetDescription string consists of a sequence of hyphen-delimited specifiers for target endianness, pointer size and alignments, and various primitive type sizes and alignments. A typical string looks something like: -
    +

    "E-p:32:32:32-i1:8:8-i8:8:8-i32:32:32-i64:32:64-f32:32:32-f64:32:64" -
    +

    (note: this string is not fully specified and is only an example.) \p Alignments come in two flavors: ABI and preferred. ABI alignment (abi_align, @@ -187,16 +177,16 @@ PointerPrefAlign = PointerABIAlign; // Default alignments - setAlignment(INTEGER_ALIGN, 1, 1, 1); // Bool - setAlignment(INTEGER_ALIGN, 1, 1, 8); // Byte - setAlignment(INTEGER_ALIGN, 2, 2, 16); // short - setAlignment(INTEGER_ALIGN, 4, 4, 32); // int - setAlignment(INTEGER_ALIGN, 0, 8, 64); // long - setAlignment(FLOAT_ALIGN, 4, 4, 32); // float - setAlignment(FLOAT_ALIGN, 0, 8, 64); // double - setAlignment(PACKED_ALIGN, 8, 8, 64); // v2i32 + setAlignment(INTEGER_ALIGN, 1, 1, 1); // Bool + setAlignment(INTEGER_ALIGN, 1, 1, 8); // Byte + setAlignment(INTEGER_ALIGN, 2, 2, 16); // short + setAlignment(INTEGER_ALIGN, 4, 4, 32); // int + setAlignment(INTEGER_ALIGN, 4, 8, 64); // long + setAlignment(FLOAT_ALIGN, 4, 4, 32); // float + setAlignment(FLOAT_ALIGN, 8, 8, 64); // double + setAlignment(PACKED_ALIGN, 8, 8, 64); // v2i32 setAlignment(PACKED_ALIGN, 16, 16, 128); // v16i8, v8i16, v4i32, ... - setAlignment(AGGREGATE_ALIGN, 0, 0, 0); // struct, union, class, ... + setAlignment(AGGREGATE_ALIGN, 0, 0, 0); // struct, union, class, ... while (!temp.empty()) { std::string token = getToken(temp, "-"); @@ -241,17 +231,6 @@ break; } } - - // Unless explicitly specified, the alignments for longs and doubles is - // capped by pointer size. - // FIXME: Is this still necessary? - const TargetAlignElem &long_align = getAlignment(INTEGER_ALIGN, 64); - if (long_align.ABIAlign == 0) - setAlignment(INTEGER_ALIGN, PointerMemSize, PointerMemSize, 64); - - const TargetAlignElem &double_align = getAlignment(FLOAT_ALIGN, 64); - if (double_align.ABIAlign == 0) - setAlignment(FLOAT_ALIGN, PointerMemSize, PointerMemSize, 64); } TargetData::TargetData(const Module *M) { @@ -377,44 +356,21 @@ } -struct hyphen_delimited : - public std::iterator -{ - std::ostream &o; - - hyphen_delimited(std::ostream &os) : - o(os) - { } - - hyphen_delimited &operator=(const TargetAlignElem &elem) - { - o << "-" << elem; - return *this; - } - - hyphen_delimited &operator*() - { - return *this; - } - - hyphen_delimited &operator++() - { - return *this; - } -}; - - std::string TargetData::getStringRepresentation() const { - std::stringstream repr; - - if (LittleEndian) - repr << "e"; - else - repr << "E"; - repr << "-p:" << (PointerMemSize * 8) << ":" << (PointerABIAlign * 8) - << ":" << (PointerPrefAlign * 8); - std::copy(Alignments.begin(), Alignments.end(), hyphen_delimited(repr)); - return repr.str(); + std::string repr; + repr.append(LittleEndian ? "e" : "E"); + repr.append("-p:").append(itostr((int64_t) (PointerMemSize * 8))). + append(":").append(itostr((int64_t) (PointerABIAlign * 8))). + append(":").append(itostr((int64_t) (PointerPrefAlign * 8))); + for (align_const_iterator I = Alignments.begin(); + I != Alignments.end(); + ++I) { + repr.append("-").append(1, (char) I->AlignType). + append(utostr((int64_t) I->TypeBitWidth)). + append(":").append(utostr((uint64_t) (I->ABIAlign * 8))). + append(":").append(utostr((uint64_t) (I->PrefAlign * 8))); + } + return repr; } From reid at x10sys.com Wed Feb 14 20:11:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:11:25 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetData.h Message-ID: <200702150211.l1F2BPbt011800@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetData.h updated: 1.54 -> 1.55 --- Log message: Fixed packed structure breakage from earlier TargetData patch; applied Chris Lattner's code style suggestions. Patch by Scott Michel! --- Diffs of the changes: (+4 -9) TargetData.h | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) Index: llvm/include/llvm/Target/TargetData.h diff -u llvm/include/llvm/Target/TargetData.h:1.54 llvm/include/llvm/Target/TargetData.h:1.55 --- llvm/include/llvm/Target/TargetData.h:1.54 Tue Feb 13 23:52:16 2007 +++ llvm/include/llvm/Target/TargetData.h Wed Feb 14 20:11:06 2007 @@ -48,7 +48,7 @@ /// @note The unusual order of elements in the structure attempts to reduce /// padding and make the structure slightly more cache friendly. struct TargetAlignElem { - unsigned char AlignType; //< Alignment type (AlignTypeEnum) + AlignTypeEnum AlignType : 8; //< Alignment type (AlignTypeEnum) unsigned char ABIAlign; //< ABI alignment for this type/bitw unsigned char PrefAlign; //< Pref. alignment for this type/bitw short TypeBitWidth; //< Type bit width @@ -64,18 +64,12 @@ std::ostream &dump(std::ostream &os) const; }; -//! TargetAlignElem output stream inserter -/*! - @sa TargetAlignElem::dump() - */ -std::ostream &operator<<(std::ostream &os, const TargetAlignElem &elem); - class TargetData : public ImmutablePass { private: bool LittleEndian; ///< Defaults to false unsigned char PointerMemSize; ///< Pointer size in bytes unsigned char PointerABIAlign; ///< Pointer ABI alignment - unsigned char PointerPrefAlign; ///< Pointer preferred global alignment + unsigned char PointerPrefAlign; ///< Pointer preferred alignment //! Where the primitive type alignment data is stored. /*! @@ -99,7 +93,8 @@ void setAlignment(AlignTypeEnum align_type, unsigned char abi_align, unsigned char pref_align, short bit_width); //! Get TargetAlignElem from alignment type and bit width - const TargetAlignElem &getAlignment(AlignTypeEnum, short) const; + const TargetAlignElem &getAlignment(AlignTypeEnum align_type, + short bit_width) const; //! Internal helper method that returns requested alignment for type. unsigned char getAlignment(const Type *Ty, bool abi_or_pref) const; From reid at x10sys.com Wed Feb 14 20:27:20 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Analyzer.cpp Reader.cpp Message-ID: <200702150227.l1F2RKjB012209@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Analyzer.cpp updated: 1.37 -> 1.38 Reader.cpp updated: 1.239 -> 1.240 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+12 -12) Analyzer.cpp | 4 ++-- Reader.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) Index: llvm/lib/Bytecode/Reader/Analyzer.cpp diff -u llvm/lib/Bytecode/Reader/Analyzer.cpp:1.37 llvm/lib/Bytecode/Reader/Analyzer.cpp:1.38 --- llvm/lib/Bytecode/Reader/Analyzer.cpp:1.37 Mon Feb 12 12:53:42 2007 +++ llvm/lib/Bytecode/Reader/Analyzer.cpp Wed Feb 14 20:26:09 2007 @@ -423,8 +423,8 @@ bca.numValues++; } - virtual void handleConstantPacked( - const PackedType* PT, + virtual void handleConstantVector( + const VectorType* PT, Constant**Elements, unsigned NumElts, unsigned TypeSlot, Constant* PackedVal) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.239 llvm/lib/Bytecode/Reader/Reader.cpp:1.240 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.239 Wed Feb 14 00:20:04 2007 +++ llvm/lib/Bytecode/Reader/Reader.cpp Wed Feb 14 20:26:09 2007 @@ -482,7 +482,7 @@ break; } case Instruction::InsertElement: { - const PackedType *PackedTy = dyn_cast(InstTy); + const VectorType *PackedTy = dyn_cast(InstTy); if (!PackedTy || Oprnds.size() != 3) error("Invalid insertelement instruction!"); @@ -496,13 +496,13 @@ break; } case Instruction::ShuffleVector: { - const PackedType *PackedTy = dyn_cast(InstTy); + const VectorType *PackedTy = dyn_cast(InstTy); if (!PackedTy || Oprnds.size() != 3) error("Invalid shufflevector instruction!"); Value *V1 = getValue(iType, Oprnds[0]); Value *V2 = getValue(iType, Oprnds[1]); - const PackedType *EltTy = - PackedType::get(Type::Int32Ty, PackedTy->getNumElements()); + const VectorType *EltTy = + VectorType::get(Type::Int32Ty, PackedTy->getNumElements()); Value *V3 = getValue(getTypeSlot(EltTy), Oprnds[2]); if (!ShuffleVectorInst::isValidOperands(V1, V2, V3)) error("Invalid shufflevector instruction!"); @@ -1029,10 +1029,10 @@ Result = ArrayType::get(ElementType, NumElements); break; } - case Type::PackedTyID: { + case Type::VectorTyID: { const Type *ElementType = readType(); unsigned NumElements = read_vbr_uint(); - Result = PackedType::get(ElementType, NumElements); + Result = VectorType::get(ElementType, NumElements); break; } case Type::StructTyID: { @@ -1314,8 +1314,8 @@ break; } - case Type::PackedTyID: { - const PackedType *PT = cast(Ty); + case Type::VectorTyID: { + const VectorType *PT = cast(Ty); unsigned NumElements = PT->getNumElements(); unsigned TypeSlot = getTypeSlot(PT->getElementType()); std::vector Elements; @@ -1323,8 +1323,8 @@ while (NumElements--) // Read all of the elements of the constant. Elements.push_back(getConstantValue(TypeSlot, read_vbr_uint())); - Result = ConstantPacked::get(PT, Elements); - if (Handler) Handler->handleConstantPacked(PT, &Elements[0],Elements.size(), + Result = ConstantVector::get(PT, Elements); + if (Handler) Handler->handleConstantVector(PT, &Elements[0],Elements.size(), TypeSlot, Result); break; } From reid at x10sys.com Wed Feb 14 20:27:20 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:20 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h DerivedTypes.h Instructions.h Intrinsics.td Type.h Value.h Message-ID: <200702150227.l1F2RKqn012224@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.123 -> 1.124 DerivedTypes.h updated: 1.82 -> 1.83 Instructions.h updated: 1.58 -> 1.59 Intrinsics.td updated: 1.45 -> 1.46 Type.h updated: 1.103 -> 1.104 Value.h updated: 1.95 -> 1.96 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+51 -51) Constants.h | 28 ++++++++++++++-------------- DerivedTypes.h | 34 +++++++++++++++++----------------- Instructions.h | 14 +++++++------- Intrinsics.td | 18 +++++++++--------- Type.h | 6 +++--- Value.h | 2 +- 6 files changed, 51 insertions(+), 51 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.123 llvm/include/llvm/Constants.h:1.124 --- llvm/include/llvm/Constants.h:1.123 Thu Feb 1 20:16:21 2007 +++ llvm/include/llvm/Constants.h Wed Feb 14 20:26:09 2007 @@ -28,7 +28,7 @@ class ArrayType; class StructType; class PointerType; -class PackedType; +class VectorType; template struct ConstantCreator; @@ -334,31 +334,31 @@ }; //===----------------------------------------------------------------------===// -/// ConstantPacked - Constant Packed Declarations +/// ConstantVector - Constant Vector Declarations /// -class ConstantPacked : public Constant { - friend struct ConstantCreator >; - ConstantPacked(const ConstantPacked &); // DO NOT IMPLEMENT + ConstantVector(const ConstantVector &); // DO NOT IMPLEMENT protected: - ConstantPacked(const PackedType *T, const std::vector &Val); - ~ConstantPacked(); + ConstantVector(const VectorType *T, const std::vector &Val); + ~ConstantVector(); public: /// get() - Static factory methods - Return objects of the specified value - static Constant *get(const PackedType *T, const std::vector &); + static Constant *get(const VectorType *T, const std::vector &); static Constant *get(const std::vector &V); - /// getType - Specialize the getType() method to always return an PackedType, + /// getType - Specialize the getType() method to always return an VectorType, /// which reduces the amount of casting needed in parts of the compiler. /// - inline const PackedType *getType() const { - return reinterpret_cast(Value::getType()); + inline const VectorType *getType() const { + return reinterpret_cast(Value::getType()); } /// @returns the value for an packed integer constant of the given type that /// has all its bits set to true. /// @brief Get the all ones value - static ConstantPacked *getAllOnesValue(const PackedType *Ty); + static ConstantVector *getAllOnesValue(const VectorType *Ty); /// isNullValue - Return true if this is the value that would be returned by /// getNullValue. This always returns false because zero arrays are always @@ -375,9 +375,9 @@ virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U); /// Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const ConstantPacked *) { return true; } + static inline bool classof(const ConstantVector *) { return true; } static bool classof(const Value *V) { - return V->getValueType() == ConstantPackedVal; + return V->getValueType() == ConstantVectorVal; } }; Index: llvm/include/llvm/DerivedTypes.h diff -u llvm/include/llvm/DerivedTypes.h:1.82 llvm/include/llvm/DerivedTypes.h:1.83 --- llvm/include/llvm/DerivedTypes.h:1.82 Sun Jan 28 07:31:35 2007 +++ llvm/include/llvm/DerivedTypes.h Wed Feb 14 20:26:09 2007 @@ -28,7 +28,7 @@ class ArrayValType; class StructValType; class PointerValType; -class PackedValType; +class VectorValType; class IntegerValType; class DerivedType : public Type { @@ -214,7 +214,7 @@ /// CompositeType - Common super class of ArrayType, StructType, PointerType -/// and PackedType +/// and VectorType class CompositeType : public DerivedType { protected: inline CompositeType(TypeID id) : DerivedType(id) { } @@ -232,7 +232,7 @@ return T->getTypeID() == ArrayTyID || T->getTypeID() == StructTyID || T->getTypeID() == PointerTyID || - T->getTypeID() == PackedTyID; + T->getTypeID() == VectorTyID; } }; @@ -317,7 +317,7 @@ static inline bool classof(const Type *T) { return T->getTypeID() == ArrayTyID || T->getTypeID() == PointerTyID || - T->getTypeID() == PackedTyID; + T->getTypeID() == VectorTyID; } }; @@ -350,25 +350,25 @@ } }; -/// PackedType - Class to represent packed types +/// VectorType - Class to represent packed types /// -class PackedType : public SequentialType { - friend class TypeMap; +class VectorType : public SequentialType { + friend class TypeMap; unsigned NumElements; - PackedType(const PackedType &); // Do not implement - const PackedType &operator=(const PackedType &); // Do not implement - PackedType(const Type *ElType, unsigned NumEl); + VectorType(const VectorType &); // Do not implement + const VectorType &operator=(const VectorType &); // Do not implement + VectorType(const Type *ElType, unsigned NumEl); public: - /// PackedType::get - This static method is the primary way to construct an - /// PackedType + /// VectorType::get - This static method is the primary way to construct an + /// VectorType /// - static PackedType *get(const Type *ElementType, unsigned NumElements); + static VectorType *get(const Type *ElementType, unsigned NumElements); - /// @brief Return the number of elements in the Packed type. + /// @brief Return the number of elements in the Vector type. inline unsigned getNumElements() const { return NumElements; } - /// @brief Return the number of bits in the Packed type. + /// @brief Return the number of bits in the Vector type. inline unsigned getBitWidth() const { return NumElements *getElementType()->getPrimitiveSizeInBits(); } @@ -378,9 +378,9 @@ virtual void typeBecameConcrete(const DerivedType *AbsTy); // Methods for support type inquiry through isa, cast, and dyn_cast: - static inline bool classof(const PackedType *T) { return true; } + static inline bool classof(const VectorType *T) { return true; } static inline bool classof(const Type *T) { - return T->getTypeID() == PackedTyID; + return T->getTypeID() == VectorTyID; } }; Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.58 llvm/include/llvm/Instructions.h:1.59 --- llvm/include/llvm/Instructions.h:1.58 Tue Feb 13 01:54:42 2007 +++ llvm/include/llvm/Instructions.h Wed Feb 14 20:26:09 2007 @@ -23,7 +23,7 @@ class BasicBlock; class ConstantInt; class PointerType; -class PackedType; +class VectorType; //===----------------------------------------------------------------------===// // AllocationInst Class @@ -862,7 +862,7 @@ //===----------------------------------------------------------------------===// /// ExtractElementInst - This instruction extracts a single (scalar) -/// element from a PackedType value +/// element from a VectorType value /// class ExtractElementInst : public Instruction { Use Ops[2]; @@ -916,7 +916,7 @@ //===----------------------------------------------------------------------===// /// InsertElementInst - This instruction inserts a single (scalar) -/// element into a PackedType value +/// element into a VectorType value /// class InsertElementInst : public Instruction { Use Ops[3]; @@ -942,8 +942,8 @@ /// getType - Overload to return most specific packed type. /// - inline const PackedType *getType() const { - return reinterpret_cast(Instruction::getType()); + inline const VectorType *getType() const { + return reinterpret_cast(Instruction::getType()); } /// Transparently provide more efficient getOperand methods. @@ -994,8 +994,8 @@ /// getType - Overload to return most specific packed type. /// - inline const PackedType *getType() const { - return reinterpret_cast(Instruction::getType()); + inline const VectorType *getType() const { + return reinterpret_cast(Instruction::getType()); } /// Transparently provide more efficient getOperand methods. Index: llvm/include/llvm/Intrinsics.td diff -u llvm/include/llvm/Intrinsics.td:1.45 llvm/include/llvm/Intrinsics.td:1.46 --- llvm/include/llvm/Intrinsics.td:1.45 Mon Feb 12 13:05:51 2007 +++ llvm/include/llvm/Intrinsics.td Wed Feb 14 20:26:09 2007 @@ -62,8 +62,8 @@ int Width = width; } -class LLVMPackedType - : LLVMType{ +class LLVMVectorType + : LLVMType{ int NumElts = numelts; LLVMType ElTy = elty; } @@ -90,13 +90,13 @@ def llvm_empty_ty : LLVMEmptyStructType; // { } def llvm_descriptor_ty : LLVMPointerType; // { }* -def llvm_v16i8_ty : LLVMPackedType; // 16 x i8 -def llvm_v8i16_ty : LLVMPackedType; // 8 x i16 -def llvm_v2i64_ty : LLVMPackedType; // 2 x i64 -def llvm_v2i32_ty : LLVMPackedType; // 2 x i32 -def llvm_v4i32_ty : LLVMPackedType; // 4 x i32 -def llvm_v4f32_ty : LLVMPackedType; // 4 x float -def llvm_v2f64_ty : LLVMPackedType;// 2 x double +def llvm_v16i8_ty : LLVMVectorType; // 16 x i8 +def llvm_v8i16_ty : LLVMVectorType; // 8 x i16 +def llvm_v2i64_ty : LLVMVectorType; // 2 x i64 +def llvm_v2i32_ty : LLVMVectorType; // 2 x i32 +def llvm_v4i32_ty : LLVMVectorType; // 4 x i32 +def llvm_v4f32_ty : LLVMVectorType; // 4 x float +def llvm_v2f64_ty : LLVMVectorType;// 2 x double def llvm_vararg_ty : LLVMType; // vararg Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.103 llvm/include/llvm/Type.h:1.104 --- llvm/include/llvm/Type.h:1.103 Sun Jan 28 18:09:00 2007 +++ llvm/include/llvm/Type.h Wed Feb 14 20:26:09 2007 @@ -81,7 +81,7 @@ ArrayTyID, ///< 8: Arrays PointerTyID, ///< 9: Pointers OpaqueTyID, ///< 10: Opaque: type with unknown structure - PackedTyID, ///< 11: SIMD 'packed' format, or other vector type + VectorTyID, ///< 11: SIMD 'packed' format, or other vector type NumTypeIDs, // Must remain as last defined ID LastPrimitiveTyID = LabelTyID, @@ -191,7 +191,7 @@ /// inline bool isFirstClassType() const { return (ID != VoidTyID && ID <= LastPrimitiveTyID) || - ID == IntegerTyID || ID == PointerTyID || ID == PackedTyID; + ID == IntegerTyID || ID == PointerTyID || ID == VectorTyID; } /// isSized - Return true if it makes sense to take the size of this type. To @@ -204,7 +204,7 @@ return true; // If it is not something that can have a size (e.g. a function or label), // it doesn't have a size. - if (ID != StructTyID && ID != ArrayTyID && ID != PackedTyID && + if (ID != StructTyID && ID != ArrayTyID && ID != VectorTyID && ID != PackedStructTyID) return false; // If it is something that can have a size and it's concrete, it definitely Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.95 llvm/include/llvm/Value.h:1.96 --- llvm/include/llvm/Value.h:1.95 Tue Feb 13 01:53:34 2007 +++ llvm/include/llvm/Value.h Wed Feb 14 20:26:09 2007 @@ -167,7 +167,7 @@ ConstantFPVal, // This is an instance of ConstantFP ConstantArrayVal, // This is an instance of ConstantArray ConstantStructVal, // This is an instance of ConstantStruct - ConstantPackedVal, // This is an instance of ConstantPacked + ConstantVectorVal, // This is an instance of ConstantPacked ConstantPointerNullVal, // This is an instance of ConstantPointerNull InlineAsmVal, // This is an instance of InlineAsm InstructionVal, // This is an instance of Instruction From reid at x10sys.com Wed Feb 14 20:27:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/ValueMapper.cpp Message-ID: <200702150227.l1F2ROSP012235@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: ValueMapper.cpp updated: 1.29 -> 1.30 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+2 -2) ValueMapper.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/Utils/ValueMapper.cpp diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.29 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.30 --- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.29 Fri Feb 2 18:08:31 2007 +++ llvm/lib/Transforms/Utils/ValueMapper.cpp Wed Feb 14 20:26:10 2007 @@ -78,7 +78,7 @@ for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) Ops.push_back(cast(MapValue(CE->getOperand(i), VM))); return VM[V] = CE->getWithOperands(Ops); - } else if (ConstantPacked *CP = dyn_cast(C)) { + } else if (ConstantVector *CP = dyn_cast(C)) { for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) { Value *MV = MapValue(CP->getOperand(i), VM); if (MV != CP->getOperand(i)) { @@ -92,7 +92,7 @@ Values.push_back(cast(MV)); for (++i; i != e; ++i) Values.push_back(cast(MapValue(CP->getOperand(i), VM))); - return VM[V] = ConstantPacked::get(Values); + return VM[V] = ConstantVector::get(Values); } } return VMSlot = C; From reid at x10sys.com Wed Feb 14 20:27:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkModules.cpp Message-ID: <200702150227.l1F2ROba012236@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkModules.cpp updated: 1.137 -> 1.138 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+2 -2) LinkModules.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Linker/LinkModules.cpp diff -u llvm/lib/Linker/LinkModules.cpp:1.137 llvm/lib/Linker/LinkModules.cpp:1.138 --- llvm/lib/Linker/LinkModules.cpp:1.137 Sat Feb 10 18:39:38 2007 +++ llvm/lib/Linker/LinkModules.cpp Wed Feb 14 20:26:10 2007 @@ -295,11 +295,11 @@ Result = ConstantStruct::get(cast(CPS->getType()), Operands); } else if (isa(CPV) || isa(CPV)) { Result = const_cast(CPV); - } else if (const ConstantPacked *CP = dyn_cast(CPV)) { + } else if (const ConstantVector *CP = dyn_cast(CPV)) { std::vector Operands(CP->getNumOperands()); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) Operands[i] = cast(RemapOperand(CP->getOperand(i), ValueMap)); - Result = ConstantPacked::get(Operands); + Result = ConstantVector::get(Operands); } else if (const ConstantExpr *CE = dyn_cast(CPV)) { std::vector Ops; for (unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) From reid at x10sys.com Wed Feb 14 20:27:24 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp LowerPacked.cpp Reassociate.cpp SCCP.cpp ScalarReplAggregates.cpp Message-ID: <200702150227.l1F2RO0P012244@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.632 -> 1.633 LowerPacked.cpp updated: 1.17 -> 1.18 Reassociate.cpp updated: 1.75 -> 1.76 SCCP.cpp updated: 1.162 -> 1.163 ScalarReplAggregates.cpp updated: 1.73 -> 1.74 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+69 -69) InstructionCombining.cpp | 62 +++++++++++++++++++++++------------------------ LowerPacked.cpp | 38 ++++++++++++++-------------- Reassociate.cpp | 2 - SCCP.cpp | 8 +++--- ScalarReplAggregates.cpp | 28 ++++++++++----------- 5 files changed, 69 insertions(+), 69 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.632 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.633 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.632 Tue Feb 13 23:52:17 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Feb 14 20:26:10 2007 @@ -1262,7 +1262,7 @@ Value *InstCombiner::SimplifyDemandedVectorElts(Value *V, uint64_t DemandedElts, uint64_t &UndefElts, unsigned Depth) { - unsigned VWidth = cast(V->getType())->getNumElements(); + unsigned VWidth = cast(V->getType())->getNumElements(); assert(VWidth <= 64 && "Vector too wide to analyze!"); uint64_t EltMask = ~0ULL >> (64-VWidth); assert(DemandedElts != EltMask && (DemandedElts & ~EltMask) == 0 && @@ -1278,8 +1278,8 @@ } UndefElts = 0; - if (ConstantPacked *CP = dyn_cast(V)) { - const Type *EltTy = cast(V->getType())->getElementType(); + if (ConstantVector *CP = dyn_cast(V)) { + const Type *EltTy = cast(V->getType())->getElementType(); Constant *Undef = UndefValue::get(EltTy); std::vector Elts; @@ -1295,19 +1295,19 @@ } // If we changed the constant, return it. - Constant *NewCP = ConstantPacked::get(Elts); + Constant *NewCP = ConstantVector::get(Elts); return NewCP != CP ? NewCP : 0; } else if (isa(V)) { - // Simplify the CAZ to a ConstantPacked where the non-demanded elements are + // Simplify the CAZ to a ConstantVector where the non-demanded elements are // set to undef. - const Type *EltTy = cast(V->getType())->getElementType(); + const Type *EltTy = cast(V->getType())->getElementType(); Constant *Zero = Constant::getNullValue(EltTy); Constant *Undef = UndefValue::get(EltTy); std::vector Elts; for (unsigned i = 0; i != VWidth; ++i) Elts.push_back((DemandedElts & (1ULL << i)) ? Zero : Undef); UndefElts = DemandedElts ^ EltMask; - return ConstantPacked::get(Elts); + return ConstantVector::get(Elts); } if (!V->hasOneUse()) { // Other users may use these bits. @@ -1743,7 +1743,7 @@ // See if SimplifyDemandedBits can simplify this. This handles stuff like // (X & 254)+1 -> (X&254)|1 uint64_t KnownZero, KnownOne; - if (!isa(I.getType()) && + if (!isa(I.getType()) && SimplifyDemandedBits(&I, cast(I.getType())->getBitMask(), KnownZero, KnownOne)) return &I; @@ -3064,12 +3064,12 @@ // See if we can simplify any instructions used by the instruction whose sole // purpose is to compute bits we don't care about. uint64_t KnownZero, KnownOne; - if (!isa(I.getType())) { + if (!isa(I.getType())) { if (SimplifyDemandedBits(&I, cast(I.getType())->getBitMask(), KnownZero, KnownOne)) return &I; } else { - if (ConstantPacked *CP = dyn_cast(Op1)) { + if (ConstantVector *CP = dyn_cast(Op1)) { if (CP->isAllOnesValue()) return ReplaceInstUsesWith(I, I.getOperand(0)); } @@ -3543,7 +3543,7 @@ // See if we can simplify any instructions used by the instruction whose sole // purpose is to compute bits we don't care about. uint64_t KnownZero, KnownOne; - if (!isa(I.getType()) && + if (!isa(I.getType()) && SimplifyDemandedBits(&I, cast(I.getType())->getBitMask(), KnownZero, KnownOne)) return &I; @@ -3874,7 +3874,7 @@ // See if we can simplify any instructions used by the instruction whose sole // purpose is to compute bits we don't care about. uint64_t KnownZero, KnownOne; - if (!isa(I.getType()) && + if (!isa(I.getType()) && SimplifyDemandedBits(&I, cast(I.getType())->getBitMask(), KnownZero, KnownOne)) return &I; @@ -6460,8 +6460,8 @@ if (SVI->hasOneUse()) { // Okay, we have (bitconvert (shuffle ..)). Check to see if this is // a bitconvert to a vector with the same # elts. - if (isa(DestTy) && - cast(DestTy)->getNumElements() == + if (isa(DestTy) && + cast(DestTy)->getNumElements() == SVI->getType()->getNumElements()) { CastInst *Tmp; // If either of the operands is a cast from CI.getType(), then @@ -7082,7 +7082,7 @@ case Intrinsic::ppc_altivec_vperm: // Turn vperm(V1,V2,mask) -> shuffle(V1,V2,mask) if mask is a constant. - if (ConstantPacked *Mask = dyn_cast(II->getOperand(3))) { + if (ConstantVector *Mask = dyn_cast(II->getOperand(3))) { assert(Mask->getNumOperands() == 16 && "Bad type for intrinsic!"); // Check that all of the elements are integer constants or undefs. @@ -8037,7 +8037,7 @@ const Type *SrcPTy = SrcTy->getElementType(); if (DestPTy->isInteger() || isa(DestPTy) || - isa(DestPTy)) { + isa(DestPTy)) { // If the source is an array, the code below will not succeed. Check to // see if a trivial 'gep P, 0, 0' will help matters. Only do this for // constants. @@ -8052,7 +8052,7 @@ } if ((SrcPTy->isInteger() || isa(SrcPTy) || - isa(SrcPTy)) && + isa(SrcPTy)) && // Do not allow turning this into a load of an integer, which is then // casted to a pointer, this pessimizes pointer analysis a lot. (isa(SrcPTy) == isa(LI.getType())) && @@ -8516,7 +8516,7 @@ static bool CheapToScalarize(Value *V, bool isConstant) { if (isa(V)) return true; - if (ConstantPacked *C = dyn_cast(V)) { + if (ConstantVector *C = dyn_cast(V)) { if (isConstant) return true; // If all elts are the same, we can extract. Constant *Op0 = C->getOperand(0); @@ -8561,7 +8561,7 @@ return std::vector(NElts, 2*NElts); std::vector Result; - const ConstantPacked *CP = cast(SVI->getOperand(2)); + const ConstantVector *CP = cast(SVI->getOperand(2)); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) if (isa(CP->getOperand(i))) Result.push_back(NElts*2); // undef -> 8 @@ -8574,8 +8574,8 @@ /// value is already around as a register, for example if it were inserted then /// extracted from the vector. static Value *FindScalarElement(Value *V, unsigned EltNo) { - assert(isa(V->getType()) && "Not looking at a vector?"); - const PackedType *PTy = cast(V->getType()); + assert(isa(V->getType()) && "Not looking at a vector?"); + const VectorType *PTy = cast(V->getType()); unsigned Width = PTy->getNumElements(); if (EltNo >= Width) // Out of range access. return UndefValue::get(PTy->getElementType()); @@ -8584,7 +8584,7 @@ return UndefValue::get(PTy->getElementType()); else if (isa(V)) return Constant::getNullValue(PTy->getElementType()); - else if (ConstantPacked *CP = dyn_cast(V)) + else if (ConstantVector *CP = dyn_cast(V)) return CP->getOperand(EltNo); else if (InsertElementInst *III = dyn_cast(V)) { // If this is an insert to a variable element, we don't know what it is. @@ -8624,7 +8624,7 @@ if (isa(EI.getOperand(0))) return ReplaceInstUsesWith(EI, Constant::getNullValue(EI.getType())); - if (ConstantPacked *C = dyn_cast(EI.getOperand(0))) { + if (ConstantVector *C = dyn_cast(EI.getOperand(0))) { // If packed val is constant with uniform operands, replace EI // with that operand Constant *op0 = C->getOperand(0); @@ -8724,7 +8724,7 @@ std::vector &Mask) { assert(V->getType() == LHS->getType() && V->getType() == RHS->getType() && "Invalid CollectSingleShuffleElements"); - unsigned NumElts = cast(V->getType())->getNumElements(); + unsigned NumElts = cast(V->getType())->getNumElements(); if (isa(V)) { Mask.assign(NumElts, UndefValue::get(Type::Int32Ty)); @@ -8792,10 +8792,10 @@ /// that computes V and the LHS value of the shuffle. static Value *CollectShuffleElements(Value *V, std::vector &Mask, Value *&RHS) { - assert(isa(V->getType()) && + assert(isa(V->getType()) && (RHS == 0 || V->getType() == RHS->getType()) && "Invalid shuffle!"); - unsigned NumElts = cast(V->getType())->getNumElements(); + unsigned NumElts = cast(V->getType())->getNumElements(); if (isa(V)) { Mask.assign(NumElts, UndefValue::get(Type::Int32Ty)); @@ -8895,7 +8895,7 @@ } Mask[InsertedIdx] = ConstantInt::get(Type::Int32Ty, ExtractedIdx); return new ShuffleVectorInst(EI->getOperand(0), VecOp, - ConstantPacked::get(Mask)); + ConstantVector::get(Mask)); } // If this insertelement isn't used by some other insertelement, turn it @@ -8906,7 +8906,7 @@ Value *LHS = CollectShuffleElements(&IE, Mask, RHS); if (RHS == 0) RHS = UndefValue::get(LHS->getType()); // We now have a shuffle of LHS, RHS, Mask. - return new ShuffleVectorInst(LHS, RHS, ConstantPacked::get(Mask)); + return new ShuffleVectorInst(LHS, RHS, ConstantVector::get(Mask)); } } } @@ -8947,7 +8947,7 @@ else Elts.push_back(ConstantInt::get(Type::Int32Ty, Mask[i])); } - SVI.setOperand(2, ConstantPacked::get(Elts)); + SVI.setOperand(2, ConstantVector::get(Elts)); } } @@ -8975,7 +8975,7 @@ } SVI.setOperand(0, SVI.getOperand(1)); SVI.setOperand(1, UndefValue::get(RHS->getType())); - SVI.setOperand(2, ConstantPacked::get(Elts)); + SVI.setOperand(2, ConstantVector::get(Elts)); LHS = SVI.getOperand(0); RHS = SVI.getOperand(1); MadeChange = true; @@ -9030,7 +9030,7 @@ } return new ShuffleVectorInst(LHSSVI->getOperand(0), LHSSVI->getOperand(1), - ConstantPacked::get(Elts)); + ConstantVector::get(Elts)); } } } Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.17 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.18 --- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.17 Mon Feb 12 16:56:41 2007 +++ llvm/lib/Transforms/Scalar/LowerPacked.cpp Wed Feb 14 20:26:10 2007 @@ -72,13 +72,13 @@ /// @param EI the insertelement operator to convert void visitInsertElementInst(InsertElementInst& IE); - /// This function asserts if the instruction is a PackedType but + /// This function asserts if the instruction is a VectorType but /// is handled by another function. /// - /// @brief Asserts if PackedType instruction is not handled elsewhere. + /// @brief Asserts if VectorType instruction is not handled elsewhere. /// @param I the unhandled instruction void visitInstruction(Instruction &I) { - if (isa(I.getType())) + if (isa(I.getType())) cerr << "Unhandled Instruction with Packed ReturnType: " << I << '\n'; } private: @@ -150,8 +150,8 @@ // the program. std::vector& LowerPacked::getValues(Value* value) { - assert(isa(value->getType()) && - "Value must be PackedType"); + assert(isa(value->getType()) && + "Value must be VectorType"); // reject further processing if this one has // already been handled @@ -161,7 +161,7 @@ return it->second; } - if (ConstantPacked* CP = dyn_cast(value)) { + if (ConstantVector* CP = dyn_cast(value)) { // non-zero constant case std::vector results; results.reserve(CP->getNumOperands()); @@ -174,7 +174,7 @@ else if (ConstantAggregateZero* CAZ = dyn_cast(value)) { // zero constant - const PackedType* PKT = cast(CAZ->getType()); + const VectorType* PKT = cast(CAZ->getType()); std::vector results; results.reserve(PKT->getNumElements()); @@ -187,7 +187,7 @@ } else if (isa(value)) { // foward reference - const PackedType* PKT = cast(value->getType()); + const VectorType* PKT = cast(value->getType()); std::vector results; results.reserve(PKT->getNumElements()); @@ -200,7 +200,7 @@ else { // we don't know what it is, and we are trying to retrieve // a value for it - assert(false && "Unhandled PackedType value"); + assert(false && "Unhandled VectorType value"); abort(); } } @@ -208,7 +208,7 @@ void LowerPacked::visitLoadInst(LoadInst& LI) { // Make sure what we are dealing with is a packed type - if (const PackedType* PKT = dyn_cast(LI.getType())) { + if (const VectorType* PKT = dyn_cast(LI.getType())) { // Initialization, Idx is needed for getelementptr needed later std::vector Idx(2); Idx[0] = ConstantInt::get(Type::Int32Ty,0); @@ -249,8 +249,8 @@ void LowerPacked::visitBinaryOperator(BinaryOperator& BO) { - // Make sure both operands are PackedTypes - if (isa(BO.getOperand(0)->getType())) { + // Make sure both operands are VectorTypes + if (isa(BO.getOperand(0)->getType())) { std::vector& op0Vals = getValues(BO.getOperand(0)); std::vector& op1Vals = getValues(BO.getOperand(1)); std::vector result; @@ -277,8 +277,8 @@ void LowerPacked::visitICmpInst(ICmpInst& IC) { - // Make sure both operands are PackedTypes - if (isa(IC.getOperand(0)->getType())) { + // Make sure both operands are VectorTypes + if (isa(IC.getOperand(0)->getType())) { std::vector& op0Vals = getValues(IC.getOperand(0)); std::vector& op1Vals = getValues(IC.getOperand(1)); std::vector result; @@ -306,8 +306,8 @@ void LowerPacked::visitStoreInst(StoreInst& SI) { - if (const PackedType* PKT = - dyn_cast(SI.getOperand(0)->getType())) { + if (const VectorType* PKT = + dyn_cast(SI.getOperand(0)->getType())) { // We will need this for getelementptr std::vector Idx(2); Idx[0] = ConstantInt::get(Type::Int32Ty,0); @@ -343,8 +343,8 @@ void LowerPacked::visitSelectInst(SelectInst& SELI) { - // Make sure both operands are PackedTypes - if (isa(SELI.getType())) { + // Make sure both operands are VectorTypes + if (isa(SELI.getType())) { std::vector& op0Vals = getValues(SELI.getTrueValue()); std::vector& op1Vals = getValues(SELI.getFalseValue()); std::vector result; @@ -369,7 +369,7 @@ void LowerPacked::visitExtractElementInst(ExtractElementInst& EI) { std::vector& op0Vals = getValues(EI.getOperand(0)); - const PackedType *PTy = cast(EI.getOperand(0)->getType()); + const VectorType *PTy = cast(EI.getOperand(0)->getType()); Value *op1 = EI.getOperand(1); if (ConstantInt *C = dyn_cast(op1)) { Index: llvm/lib/Transforms/Scalar/Reassociate.cpp diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.75 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.76 --- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.75 Sat Feb 10 19:23:03 2007 +++ llvm/lib/Transforms/Scalar/Reassociate.cpp Wed Feb 14 20:26:10 2007 @@ -752,7 +752,7 @@ // Reject cases where it is pointless to do this. if (!isa(BI) || BI->getType()->isFloatingPoint() || - isa(BI->getType())) + isa(BI->getType())) continue; // Floating point ops are not associative. // If this is a subtract instruction which is not already in negate form, Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.162 llvm/lib/Transforms/Scalar/SCCP.cpp:1.163 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.162 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Wed Feb 14 20:26:10 2007 @@ -702,8 +702,8 @@ // Could annihilate value. if (I.getOpcode() == Instruction::And) markConstant(IV, &I, Constant::getNullValue(I.getType())); - else if (const PackedType *PT = dyn_cast(I.getType())) - markConstant(IV, &I, ConstantPacked::getAllOnesValue(PT)); + else if (const VectorType *PT = dyn_cast(I.getType())) + markConstant(IV, &I, ConstantVector::getAllOnesValue(PT)); else markConstant(IV, &I, ConstantInt::getAllOnesValue(I.getType())); return; @@ -1237,8 +1237,8 @@ case Instruction::Or: // undef | X -> -1. X could be -1. - if (const PackedType *PTy = dyn_cast(ITy)) - markForcedConstant(LV, I, ConstantPacked::getAllOnesValue(PTy)); + if (const VectorType *PTy = dyn_cast(ITy)) + markForcedConstant(LV, I, ConstantVector::getAllOnesValue(PTy)); else markForcedConstant(LV, I, ConstantInt::getAllOnesValue(ITy)); return true; Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.73 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.74 --- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.73 Mon Feb 12 16:56:41 2007 +++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp Wed Feb 14 20:26:10 2007 @@ -323,12 +323,12 @@ // // Scalar replacing *just* the outer index of the array is probably not // going to be a win anyway, so just give up. - for (++I; I != E && (isa(*I) || isa(*I)); ++I) { + for (++I; I != E && (isa(*I) || isa(*I)); ++I) { uint64_t NumElements; if (const ArrayType *SubArrayTy = dyn_cast(*I)) NumElements = SubArrayTy->getNumElements(); else - NumElements = cast(*I)->getNumElements(); + NumElements = cast(*I)->getNumElements(); if (!isa(I.getOperand())) return 0; if (cast(I.getOperand())->getZExtValue() >= NumElements) @@ -440,7 +440,7 @@ static bool MergeInType(const Type *In, const Type *&Accum, const TargetData &TD) { // If this is our first type, just use it. - const PackedType *PTy; + const VectorType *PTy; if (Accum == Type::VoidTy || In == Accum) { Accum = In; } else if (In == Type::VoidTy) { @@ -452,16 +452,16 @@ Accum = In; } else if (isa(In) && isa(Accum)) { // Pointer unions just stay as one of the pointers. - } else if (isa(In) || isa(Accum)) { - if ((PTy = dyn_cast(Accum)) && + } else if (isa(In) || isa(Accum)) { + if ((PTy = dyn_cast(Accum)) && PTy->getElementType() == In) { // Accum is a vector, and we are accessing an element: ok. - } else if ((PTy = dyn_cast(In)) && + } else if ((PTy = dyn_cast(In)) && PTy->getElementType() == Accum) { // In is a vector, and accum is an element: ok, remember In. Accum = In; - } else if ((PTy = dyn_cast(In)) && isa(Accum) && - PTy->getBitWidth() == cast(Accum)->getBitWidth()) { + } else if ((PTy = dyn_cast(In)) && isa(Accum) && + PTy->getBitWidth() == cast(Accum)->getBitWidth()) { // Two vectors of the same size: keep Accum. } else { // Cannot insert an short into a <4 x int> or handle @@ -561,7 +561,7 @@ if (const ArrayType *ATy = dyn_cast(AggTy)) { if (Idx >= ATy->getNumElements()) return 0; // Out of range. - } else if (const PackedType *PackedTy = dyn_cast(AggTy)) { + } else if (const VectorType *PackedTy = dyn_cast(AggTy)) { // Getting an element of the packed vector. if (Idx >= PackedTy->getNumElements()) return 0; // Out of range. @@ -630,7 +630,7 @@ /// Offset is an offset from the original alloca, in bits that need to be /// shifted to the right. By the end of this, there should be no uses of Ptr. void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) { - bool isVectorInsert = isa(NewAI->getType()->getElementType()); + bool isVectorInsert = isa(NewAI->getType()->getElementType()); const TargetData &TD = getAnalysis(); while (!Ptr->use_empty()) { Instruction *User = cast(Ptr->use_back()); @@ -639,10 +639,10 @@ // The load is a bit extract from NewAI shifted right by Offset bits. Value *NV = new LoadInst(NewAI, LI->getName(), LI); if (NV->getType() != LI->getType()) { - if (const PackedType *PTy = dyn_cast(NV->getType())) { + if (const VectorType *PTy = dyn_cast(NV->getType())) { // If the result alloca is a packed type, this is either an element // access or a bitcast to another packed type. - if (isa(LI->getType())) { + if (isa(LI->getType())) { NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI); } else { // Must be an element access. @@ -702,10 +702,10 @@ if (SV->getType() != AllocaType) { Value *Old = new LoadInst(NewAI, NewAI->getName()+".in", SI); - if (const PackedType *PTy = dyn_cast(AllocaType)) { + if (const VectorType *PTy = dyn_cast(AllocaType)) { // If the result alloca is a packed type, this is either an element // access or a bitcast to another packed type. - if (isa(SV->getType())) { + if (isa(SV->getType())) { SV = new BitCastInst(SV, AllocaType, SV->getName(), SI); } else { // Must be an element insertion. From reid at x10sys.com Wed Feb 14 20:27:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp MachOWriter.cpp Message-ID: <200702150227.l1F2RPMO012257@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: AsmPrinter.cpp updated: 1.149 -> 1.150 MachOWriter.cpp updated: 1.27 -> 1.28 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+3 -3) AsmPrinter.cpp | 4 ++-- MachOWriter.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/AsmPrinter.cpp diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.149 llvm/lib/CodeGen/AsmPrinter.cpp:1.150 --- llvm/lib/CodeGen/AsmPrinter.cpp:1.149 Sat Feb 10 14:31:59 2007 +++ llvm/lib/CodeGen/AsmPrinter.cpp Wed Feb 14 20:26:09 2007 @@ -805,8 +805,8 @@ } return; } - } else if (const ConstantPacked *CP = dyn_cast(CV)) { - const PackedType *PTy = CP->getType(); + } else if (const ConstantVector *CP = dyn_cast(CV)) { + const VectorType *PTy = CP->getType(); for (unsigned I = 0, E = PTy->getNumElements(); I < E; ++I) EmitGlobalConstant(CP->getOperand(I)); Index: llvm/lib/CodeGen/MachOWriter.cpp diff -u llvm/lib/CodeGen/MachOWriter.cpp:1.27 llvm/lib/CodeGen/MachOWriter.cpp:1.28 --- llvm/lib/CodeGen/MachOWriter.cpp:1.27 Tue Feb 13 23:52:17 2007 +++ llvm/lib/CodeGen/MachOWriter.cpp Wed Feb 14 20:26:09 2007 @@ -769,7 +769,7 @@ if (isa(PC)) { continue; - } else if (const ConstantPacked *CP = dyn_cast(PC)) { + } else if (const ConstantVector *CP = dyn_cast(PC)) { unsigned ElementSize = TD->getTypeSize(CP->getType()->getElementType()); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) WorkList.push_back(CPair(CP->getOperand(i), PA+i*ElementSize)); From reid at x10sys.com Wed Feb 14 20:27:25 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:25 -0600 Subject: [llvm-commits] CVS: llvm/docs/ProgrammersManual.html Message-ID: <200702150227.l1F2RPR6012254@zion.cs.uiuc.edu> Changes in directory llvm/docs: ProgrammersManual.html updated: 1.124 -> 1.125 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+2 -2) ProgrammersManual.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ProgrammersManual.html diff -u llvm/docs/ProgrammersManual.html:1.124 llvm/docs/ProgrammersManual.html:1.125 --- llvm/docs/ProgrammersManual.html:1.124 Fri Feb 9 10:00:28 2007 +++ llvm/docs/ProgrammersManual.html Wed Feb 14 20:26:09 2007 @@ -2314,7 +2314,7 @@
    PointerType
    Subclass of SequentialType for pointer types.
    -
    PackedType
    +
    VectorType
    Subclass of SequentialType for packed (vector) types. A packed type is similar to an ArrayType but is distinguished because it is a first class type wherease ArrayType is not. Packed types are used for @@ -3177,7 +3177,7 @@ Dinakar Dhurjati and Chris Lattner
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2007/02/09 16:00:28 $ + Last modified: $Date: 2007/02/15 02:26:09 $ From reid at x10sys.com Wed Feb 14 20:27:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:26 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200702150227.l1F2RQ9Q012269@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.38 -> 1.39 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+8 -8) CppWriter.cpp | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.38 llvm/tools/llvm2cpp/CppWriter.cpp:1.39 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.38 Mon Feb 5 15:19:13 2007 +++ llvm/tools/llvm2cpp/CppWriter.cpp Wed Feb 14 20:26:10 2007 @@ -174,7 +174,7 @@ case Type::StructTyID: return "struct_"; case Type::ArrayTyID: return "array_"; case Type::PointerTyID: return "ptr_"; - case Type::PackedTyID: return "packed_"; + case Type::VectorTyID: return "packed_"; case Type::OpaqueTyID: return "opaque_"; default: return "other_"; } @@ -338,7 +338,7 @@ case Type::ArrayTyID: prefix = "ArrayTy_"; break; case Type::PointerTyID: prefix = "PointerTy_"; break; case Type::OpaqueTyID: prefix = "OpaqueTy_"; break; - case Type::PackedTyID: prefix = "PackedTy_"; break; + case Type::VectorTyID: prefix = "PackedTy_"; break; default: prefix = "OtherTy_"; break; // prevent breakage } @@ -512,12 +512,12 @@ nl(Out); break; } - case Type::PackedTyID: { - const PackedType* PT = cast(Ty); + case Type::VectorTyID: { + const VectorType* PT = cast(Ty); const Type* ET = PT->getElementType(); bool isForward = printTypeInternal(ET); std::string elemName(getCppName(ET)); - Out << "PackedType* " << typeName << " = PackedType::get(" + Out << "VectorType* " << typeName << " = VectorType::get(" << elemName << (isForward ? "_fwd" : "") << ", " << utostr(PT->getNumElements()) << ");"; nl(Out); @@ -560,7 +560,7 @@ case Type::FunctionTyID: Out << "FunctionType"; break; case Type::ArrayTyID: Out << "ArrayType"; break; case Type::StructTyID: Out << "StructType"; break; - case Type::PackedTyID: Out << "PackedType"; break; + case Type::VectorTyID: Out << "VectorType"; break; case Type::PointerTyID: Out << "PointerType"; break; case Type::OpaqueTyID: Out << "OpaqueType"; break; default: Out << "NoSuchDerivedType"; break; @@ -711,7 +711,7 @@ } Out << "Constant* " << constName << " = ConstantStruct::get(" << typeName << ", " << constName << "_fields);"; - } else if (const ConstantPacked *CP = dyn_cast(CV)) { + } else if (const ConstantVector *CP = dyn_cast(CV)) { Out << "std::vector " << constName << "_elems;"; nl(Out); unsigned N = CP->getNumOperands(); @@ -721,7 +721,7 @@ << getCppName(CP->getOperand(i)) << ");"; nl(Out); } - Out << "Constant* " << constName << " = ConstantPacked::get(" + Out << "Constant* " << constName << " = ConstantVector::get(" << typeName << ", " << constName << "_elems);"; } else if (isa(CV)) { Out << "UndefValue* " << constName << " = UndefValue::get(" From reid at x10sys.com Wed Feb 14 20:27:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200702150227.l1F2RQ7j012284@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.106 -> 1.107 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+1 -1) ExecutionEngine.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.106 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.107 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.106 Wed Feb 14 00:20:04 2007 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Wed Feb 14 20:26:10 2007 @@ -687,7 +687,7 @@ void ExecutionEngine::InitializeMemory(const Constant *Init, void *Addr) { if (isa(Init)) { return; - } else if (const ConstantPacked *CP = dyn_cast(Init)) { + } else if (const ConstantVector *CP = dyn_cast(Init)) { unsigned ElementSize = getTargetData()->getTypeSize(CP->getType()->getElementType()); for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i) From reid at x10sys.com Wed Feb 14 20:27:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:26 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Scalar.h Message-ID: <200702150227.l1F2RQpA012304@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Transforms: Scalar.h updated: 1.71 -> 1.72 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+1 -1) Scalar.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Transforms/Scalar.h diff -u llvm/include/llvm/Transforms/Scalar.h:1.71 llvm/include/llvm/Transforms/Scalar.h:1.72 --- llvm/include/llvm/Transforms/Scalar.h:1.71 Sat Feb 3 17:15:56 2007 +++ llvm/include/llvm/Transforms/Scalar.h Wed Feb 14 20:26:09 2007 @@ -261,7 +261,7 @@ //===----------------------------------------------------------------------===// // -// LowerPacked - This pass converts PackedType operations into low-level scalar +// LowerPacked - This pass converts VectorType operations into low-level scalar // operations. // FunctionPass *createLowerPackedPass(); From reid at x10sys.com Wed Feb 14 20:27:27 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp SelectionDAGISel.cpp TargetLowering.cpp Message-ID: <200702150227.l1F2RRBe012327@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: LegalizeDAG.cpp updated: 1.474 -> 1.475 SelectionDAGISel.cpp updated: 1.367 -> 1.368 TargetLowering.cpp updated: 1.90 -> 1.91 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+33 -33) LegalizeDAG.cpp | 2 - SelectionDAGISel.cpp | 58 +++++++++++++++++++++++++-------------------------- TargetLowering.cpp | 6 ++--- 3 files changed, 33 insertions(+), 33 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.474 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.475 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.474 Tue Feb 13 23:52:17 2007 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Wed Feb 14 20:26:09 2007 @@ -3874,7 +3874,7 @@ CV.push_back(UndefValue::get(OpNTy)); } } - Constant *CP = ConstantPacked::get(CV); + Constant *CP = ConstantVector::get(CV); SDOperand CPIdx = DAG.getConstantPool(CP, TLI.getPointerTy()); return DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, NULL, 0); } Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.367 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.368 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.367 Wed Feb 14 01:34:56 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Feb 14 20:26:09 2007 @@ -281,7 +281,7 @@ else { MVT::ValueType VT1,VT2; NumElements = - TLI.getPackedTypeBreakdown(cast(PN->getType()), + TLI.getVectorTypeBreakdown(cast(PN->getType()), VT1, VT2); } unsigned PHIReg = ValueMap[PN]; @@ -306,7 +306,7 @@ // If this is a packed type, figure out what type it will decompose into // and how many of the elements it will use. if (VT == MVT::Vector) { - const PackedType *PTy = cast(V->getType()); + const VectorType *PTy = cast(V->getType()); unsigned NumElts = PTy->getNumElements(); MVT::ValueType EltTy = TLI.getValueType(PTy->getElementType()); @@ -504,7 +504,7 @@ void visitEitherBinary(User &I, unsigned ScalarOp, unsigned VectorOp); void visitShift(User &I, unsigned Opcode); void visitAdd(User &I) { - if (isa(I.getType())) + if (isa(I.getType())) visitVectorBinary(I, ISD::VADD); else if (I.getType()->isFloatingPoint()) visitScalarBinary(I, ISD::FADD); @@ -513,7 +513,7 @@ } void visitSub(User &I); void visitMul(User &I) { - if (isa(I.getType())) + if (isa(I.getType())) visitVectorBinary(I, ISD::VMUL); else if (I.getType()->isFloatingPoint()) visitScalarBinary(I, ISD::FMUL); @@ -601,11 +601,11 @@ } else if (isa(C)) { return N = DAG.getConstant(0, TLI.getPointerTy()); } else if (isa(C)) { - if (!isa(VTy)) + if (!isa(VTy)) return N = DAG.getNode(ISD::UNDEF, VT); // Create a VBUILD_VECTOR of undef nodes. - const PackedType *PTy = cast(VTy); + const VectorType *PTy = cast(VTy); unsigned NumElements = PTy->getNumElements(); MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); @@ -619,7 +619,7 @@ &Ops[0], Ops.size()); } else if (ConstantFP *CFP = dyn_cast(C)) { return N = DAG.getConstantFP(CFP->getValue(), VT); - } else if (const PackedType *PTy = dyn_cast(VTy)) { + } else if (const VectorType *PTy = dyn_cast(VTy)) { unsigned NumElements = PTy->getNumElements(); MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); @@ -627,7 +627,7 @@ // Constant or ConstantFP node onto the ops list for each element of // the packed constant. SmallVector Ops; - if (ConstantPacked *CP = dyn_cast(C)) { + if (ConstantVector *CP = dyn_cast(C)) { for (unsigned i = 0; i != NumElements; ++i) Ops.push_back(getValue(CP->getOperand(i))); } else { @@ -691,8 +691,8 @@ // Otherwise, if this is a vector, make it available as a generic vector // here. MVT::ValueType PTyElementVT, PTyLegalElementVT; - const PackedType *PTy = cast(VTy); - unsigned NE = TLI.getPackedTypeBreakdown(PTy, PTyElementVT, + const VectorType *PTy = cast(VTy); + unsigned NE = TLI.getVectorTypeBreakdown(PTy, PTyElementVT, PTyLegalElementVT); // Build a VBUILD_VECTOR with the input registers. @@ -1377,7 +1377,7 @@ void SelectionDAGLowering::visitSub(User &I) { // -0.0 - X --> fneg const Type *Ty = I.getType(); - if (isa(Ty)) { + if (isa(Ty)) { visitVectorBinary(I, ISD::VSUB); } else if (Ty->isFloatingPoint()) { if (ConstantFP *CFP = dyn_cast(I.getOperand(0))) @@ -1400,8 +1400,8 @@ void SelectionDAGLowering::visitVectorBinary(User &I, unsigned OpCode) { - assert(isa(I.getType())); - const PackedType *Ty = cast(I.getType()); + assert(isa(I.getType())); + const VectorType *Ty = cast(I.getType()); SDOperand Typ = DAG.getValueType(TLI.getValueType(Ty->getElementType())); setValue(&I, DAG.getNode(OpCode, MVT::Vector, @@ -1413,7 +1413,7 @@ void SelectionDAGLowering::visitEitherBinary(User &I, unsigned ScalarOp, unsigned VectorOp) { - if (isa(I.getType())) + if (isa(I.getType())) visitVectorBinary(I, VectorOp); else visitScalarBinary(I, ScalarOp); @@ -1501,7 +1501,7 @@ SDOperand Cond = getValue(I.getOperand(0)); SDOperand TrueVal = getValue(I.getOperand(1)); SDOperand FalseVal = getValue(I.getOperand(2)); - if (!isa(I.getType())) { + if (!isa(I.getType())) { setValue(&I, DAG.getNode(ISD::SELECT, TrueVal.getValueType(), Cond, TrueVal, FalseVal)); } else { @@ -1611,7 +1611,7 @@ if (DestVT == MVT::Vector) { // This is a cast to a vector from something else. // Get information about the output vector. - const PackedType *DestTy = cast(I.getType()); + const VectorType *DestTy = cast(I.getType()); MVT::ValueType EltVT = TLI.getValueType(DestTy->getElementType()); setValue(&I, DAG.getNode(ISD::VBIT_CONVERT, DestVT, N, DAG.getConstant(DestTy->getNumElements(),MVT::i32), @@ -1793,7 +1793,7 @@ const Value *SV, SDOperand Root, bool isVolatile) { SDOperand L; - if (const PackedType *PTy = dyn_cast(Ty)) { + if (const VectorType *PTy = dyn_cast(Ty)) { MVT::ValueType PVT = TLI.getValueType(PTy->getElementType()); L = DAG.getVecLoad(PTy->getNumElements(), PVT, Root, Ptr, DAG.getSrcValue(SV)); @@ -1863,7 +1863,7 @@ // If this is a vector type, force it to the right packed type. if (Op.getValueType() == MVT::Vector) { - const PackedType *OpTy = cast(I.getOperand(i)->getType()); + const VectorType *OpTy = cast(I.getOperand(i)->getType()); MVT::ValueType EltVT = TLI.getValueType(OpTy->getElementType()); MVT::ValueType VVT = MVT::getVectorType(EltVT, OpTy->getNumElements()); @@ -1880,7 +1880,7 @@ if (I.getType() != Type::VoidTy) { MVT::ValueType VT = TLI.getValueType(I.getType()); if (VT == MVT::Vector) { - const PackedType *DestTy = cast(I.getType()); + const VectorType *DestTy = cast(I.getType()); MVT::ValueType EltVT = TLI.getValueType(DestTy->getElementType()); VT = MVT::getVectorType(EltVT, DestTy->getNumElements()); @@ -1915,7 +1915,7 @@ DAG.setRoot(Chain); } if (I.getType() != Type::VoidTy) { - if (const PackedType *PTy = dyn_cast(I.getType())) { + if (const VectorType *PTy = dyn_cast(I.getType())) { MVT::ValueType EVT = TLI.getValueType(PTy->getElementType()); Result = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, Result, DAG.getConstant(PTy->getNumElements(), MVT::i32), @@ -2966,8 +2966,8 @@ } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - unsigned NumElems = cast(I->getType())->getNumElements(); - const Type *EltTy = cast(I->getType())->getElementType(); + unsigned NumElems = cast(I->getType())->getNumElements(); + const Type *EltTy = cast(I->getType())->getElementType(); // Figure out if there is a Packed type corresponding to this Vector // type. If so, convert to the packed type. @@ -3031,7 +3031,7 @@ } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - const PackedType *PTy = cast(I->getType()); + const VectorType *PTy = cast(I->getType()); unsigned NumElems = PTy->getNumElements(); const Type *EltTy = PTy->getElementType(); @@ -3154,7 +3154,7 @@ } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - const PackedType *PTy = cast(Args[i].Ty); + const VectorType *PTy = cast(Args[i].Ty); unsigned NumElems = PTy->getNumElements(); const Type *EltTy = PTy->getElementType(); @@ -3200,7 +3200,7 @@ } else { // Otherwise, this is a vector type. We only support legal vectors // right now. - const PackedType *PTy = cast(RetTy); + const VectorType *PTy = cast(RetTy); unsigned NumElems = PTy->getNumElements(); const Type *EltTy = PTy->getElementType(); @@ -3238,8 +3238,8 @@ if (VT == MVT::Vector) { // Insert a VBITCONVERT to convert from the packed result type to the // MVT::Vector type. - unsigned NumElems = cast(RetTy)->getNumElements(); - const Type *EltTy = cast(RetTy)->getElementType(); + unsigned NumElems = cast(RetTy)->getNumElements(); + const Type *EltTy = cast(RetTy)->getElementType(); // Figure out if there is a Packed type corresponding to this Vector // type. If so, convert to the packed type. @@ -3938,7 +3938,7 @@ } else if (SrcVT == MVT::Vector) { // Handle copies from generic vectors to registers. MVT::ValueType PTyElementVT, PTyLegalElementVT; - unsigned NE = TLI.getPackedTypeBreakdown(cast(V->getType()), + unsigned NE = TLI.getVectorTypeBreakdown(cast(V->getType()), PTyElementVT, PTyLegalElementVT); // Insert a VBIT_CONVERT of the input vector to a "N x PTyElementVT" @@ -4133,7 +4133,7 @@ else { MVT::ValueType VT1,VT2; NumElements = - TLI.getPackedTypeBreakdown(cast(PN->getType()), + TLI.getVectorTypeBreakdown(cast(PN->getType()), VT1, VT2); } for (unsigned i = 0, e = NumElements; i != e; ++i) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.90 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.91 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.90 Tue Feb 13 17:41:38 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Wed Feb 14 20:26:10 2007 @@ -278,13 +278,13 @@ return NULL; } -/// getPackedTypeBreakdown - Packed types are broken down into some number of +/// getVectorTypeBreakdown - Packed types are broken down into some number of /// legal first class types. For example, <8 x float> maps to 2 MVT::v4f32 /// with Altivec or SSE1, or 8 promoted MVT::f64 values with the X86 FP stack. /// /// This method returns the number and type of the resultant breakdown. /// -unsigned TargetLowering::getPackedTypeBreakdown(const PackedType *PTy, +unsigned TargetLowering::getVectorTypeBreakdown(const VectorType *PTy, MVT::ValueType &PTyElementVT, MVT::ValueType &PTyLegalElementVT) const { // Figure out the right, legal destination reg to copy into. @@ -2206,6 +2206,6 @@ case Type::FloatTyID: return MVT::f32; case Type::DoubleTyID: return MVT::f64; case Type::PointerTyID: return PointerTy; - case Type::PackedTyID: return MVT::Vector; + case Type::VectorTyID: return MVT::Vector; } } From reid at x10sys.com Wed Feb 14 20:27:26 2007 From: reid at x10sys.com (Reid Spencer) Date: Wed, 14 Feb 2007 20:27:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200702150227.l1F2RQlL012288@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.68 -> 1.69 llvmAsmParser.h.cvs updated: 1.54 -> 1.55 llvmAsmParser.y updated: 1.323 -> 1.324 llvmAsmParser.y.cvs updated: 1.69 -> 1.70 --- Log message: For PR1195: http://llvm.org/PR1195 : Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. --- Diffs of the changes: (+4302 -3223) llvmAsmParser.cpp.cvs | 6998 ++++++++++++++++++++++++++++---------------------- llvmAsmParser.h.cvs | 439 ++- llvmAsmParser.y | 30 llvmAsmParser.y.cvs | 30 4 files changed, 4302 insertions(+), 3195 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.68 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.69 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.68 Mon Feb 12 23:53:56 2007 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Wed Feb 14 20:26:09 2007 @@ -1,147 +1,336 @@ +/* A Bison parser, made by GNU Bison 2.1. */ -/* A Bison parser, made from /Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y - by GNU Bison version 1.28 */ +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -#define YYBISON 1 /* Identify Bison output. */ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 +/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define LOCALVAL_ID 259 -#define GLOBALVAL_ID 260 -#define FPVAL 261 -#define VOID 262 -#define INTTYPE 263 -#define FLOAT 264 -#define DOUBLE 265 -#define LABEL 266 -#define TYPE 267 -#define LOCALVAR 268 -#define GLOBALVAR 269 -#define LABELSTR 270 -#define STRINGCONSTANT 271 -#define ATSTRINGCONSTANT 272 -#define IMPLEMENTATION 273 -#define ZEROINITIALIZER 274 -#define TRUETOK 275 -#define FALSETOK 276 -#define BEGINTOK 277 -#define ENDTOK 278 -#define DECLARE 279 -#define DEFINE 280 -#define GLOBAL 281 -#define CONSTANT 282 -#define SECTION 283 -#define VOLATILE 284 -#define TO 285 -#define DOTDOTDOT 286 -#define NULL_TOK 287 -#define UNDEF 288 -#define INTERNAL 289 -#define LINKONCE 290 -#define WEAK 291 -#define APPENDING 292 -#define DLLIMPORT 293 -#define DLLEXPORT 294 -#define EXTERN_WEAK 295 -#define OPAQUE 296 -#define EXTERNAL 297 -#define TARGET 298 -#define TRIPLE 299 -#define ALIGN 300 -#define DEPLIBS 301 -#define CALL 302 -#define TAIL 303 -#define ASM_TOK 304 -#define MODULE 305 -#define SIDEEFFECT 306 -#define CC_TOK 307 -#define CCC_TOK 308 -#define FASTCC_TOK 309 -#define COLDCC_TOK 310 -#define X86_STDCALLCC_TOK 311 -#define X86_FASTCALLCC_TOK 312 -#define DATALAYOUT 313 -#define RET 314 -#define BR 315 -#define SWITCH 316 -#define INVOKE 317 -#define UNWIND 318 -#define UNREACHABLE 319 -#define ADD 320 -#define SUB 321 -#define MUL 322 -#define UDIV 323 -#define SDIV 324 -#define FDIV 325 -#define UREM 326 -#define SREM 327 -#define FREM 328 -#define AND 329 -#define OR 330 -#define XOR 331 -#define SHL 332 -#define LSHR 333 -#define ASHR 334 -#define ICMP 335 -#define FCMP 336 -#define EQ 337 -#define NE 338 -#define SLT 339 -#define SGT 340 -#define SLE 341 -#define SGE 342 -#define ULT 343 -#define UGT 344 -#define ULE 345 -#define UGE 346 -#define OEQ 347 -#define ONE 348 -#define OLT 349 -#define OGT 350 -#define OLE 351 -#define OGE 352 -#define ORD 353 -#define UNO 354 -#define UEQ 355 -#define UNE 356 -#define MALLOC 357 -#define ALLOCA 358 -#define FREE 359 -#define LOAD 360 -#define STORE 361 -#define GETELEMENTPTR 362 -#define TRUNC 363 -#define ZEXT 364 -#define SEXT 365 -#define FPTRUNC 366 -#define FPEXT 367 -#define BITCAST 368 -#define UITOFP 369 -#define SITOFP 370 -#define FPTOUI 371 -#define FPTOSI 372 -#define INTTOPTR 373 -#define PTRTOINT 374 -#define PHI_TOK 375 -#define SELECT 376 -#define VAARG 377 -#define EXTRACTELEMENT 378 -#define INSERTELEMENT 379 -#define SHUFFLEVECTOR 380 -#define NORETURN 381 -#define INREG 382 -#define SRET 383 -#define DEFAULT 384 -#define HIDDEN 385 -#line 14 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + LOCALVAL_ID = 260, + GLOBALVAL_ID = 261, + FPVAL = 262, + VOID = 263, + INTTYPE = 264, + FLOAT = 265, + DOUBLE = 266, + LABEL = 267, + TYPE = 268, + LOCALVAR = 269, + GLOBALVAR = 270, + LABELSTR = 271, + STRINGCONSTANT = 272, + ATSTRINGCONSTANT = 273, + IMPLEMENTATION = 274, + ZEROINITIALIZER = 275, + TRUETOK = 276, + FALSETOK = 277, + BEGINTOK = 278, + ENDTOK = 279, + DECLARE = 280, + DEFINE = 281, + GLOBAL = 282, + CONSTANT = 283, + SECTION = 284, + VOLATILE = 285, + TO = 286, + DOTDOTDOT = 287, + NULL_TOK = 288, + UNDEF = 289, + INTERNAL = 290, + LINKONCE = 291, + WEAK = 292, + APPENDING = 293, + DLLIMPORT = 294, + DLLEXPORT = 295, + EXTERN_WEAK = 296, + OPAQUE = 297, + EXTERNAL = 298, + TARGET = 299, + TRIPLE = 300, + ALIGN = 301, + DEPLIBS = 302, + CALL = 303, + TAIL = 304, + ASM_TOK = 305, + MODULE = 306, + SIDEEFFECT = 307, + CC_TOK = 308, + CCC_TOK = 309, + FASTCC_TOK = 310, + COLDCC_TOK = 311, + X86_STDCALLCC_TOK = 312, + X86_FASTCALLCC_TOK = 313, + DATALAYOUT = 314, + RET = 315, + BR = 316, + SWITCH = 317, + INVOKE = 318, + UNWIND = 319, + UNREACHABLE = 320, + ADD = 321, + SUB = 322, + MUL = 323, + UDIV = 324, + SDIV = 325, + FDIV = 326, + UREM = 327, + SREM = 328, + FREM = 329, + AND = 330, + OR = 331, + XOR = 332, + SHL = 333, + LSHR = 334, + ASHR = 335, + ICMP = 336, + FCMP = 337, + EQ = 338, + NE = 339, + SLT = 340, + SGT = 341, + SLE = 342, + SGE = 343, + ULT = 344, + UGT = 345, + ULE = 346, + UGE = 347, + OEQ = 348, + ONE = 349, + OLT = 350, + OGT = 351, + OLE = 352, + OGE = 353, + ORD = 354, + UNO = 355, + UEQ = 356, + UNE = 357, + MALLOC = 358, + ALLOCA = 359, + FREE = 360, + LOAD = 361, + STORE = 362, + GETELEMENTPTR = 363, + TRUNC = 364, + ZEXT = 365, + SEXT = 366, + FPTRUNC = 367, + FPEXT = 368, + BITCAST = 369, + UITOFP = 370, + SITOFP = 371, + FPTOUI = 372, + FPTOSI = 373, + INTTOPTR = 374, + PTRTOINT = 375, + PHI_TOK = 376, + SELECT = 377, + VAARG = 378, + EXTRACTELEMENT = 379, + INSERTELEMENT = 380, + SHUFFLEVECTOR = 381, + NORETURN = 382, + INREG = 383, + SRET = 384, + DEFAULT = 385, + HIDDEN = 386 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define LOCALVAL_ID 260 +#define GLOBALVAL_ID 261 +#define FPVAL 262 +#define VOID 263 +#define INTTYPE 264 +#define FLOAT 265 +#define DOUBLE 266 +#define LABEL 267 +#define TYPE 268 +#define LOCALVAR 269 +#define GLOBALVAR 270 +#define LABELSTR 271 +#define STRINGCONSTANT 272 +#define ATSTRINGCONSTANT 273 +#define IMPLEMENTATION 274 +#define ZEROINITIALIZER 275 +#define TRUETOK 276 +#define FALSETOK 277 +#define BEGINTOK 278 +#define ENDTOK 279 +#define DECLARE 280 +#define DEFINE 281 +#define GLOBAL 282 +#define CONSTANT 283 +#define SECTION 284 +#define VOLATILE 285 +#define TO 286 +#define DOTDOTDOT 287 +#define NULL_TOK 288 +#define UNDEF 289 +#define INTERNAL 290 +#define LINKONCE 291 +#define WEAK 292 +#define APPENDING 293 +#define DLLIMPORT 294 +#define DLLEXPORT 295 +#define EXTERN_WEAK 296 +#define OPAQUE 297 +#define EXTERNAL 298 +#define TARGET 299 +#define TRIPLE 300 +#define ALIGN 301 +#define DEPLIBS 302 +#define CALL 303 +#define TAIL 304 +#define ASM_TOK 305 +#define MODULE 306 +#define SIDEEFFECT 307 +#define CC_TOK 308 +#define CCC_TOK 309 +#define FASTCC_TOK 310 +#define COLDCC_TOK 311 +#define X86_STDCALLCC_TOK 312 +#define X86_FASTCALLCC_TOK 313 +#define DATALAYOUT 314 +#define RET 315 +#define BR 316 +#define SWITCH 317 +#define INVOKE 318 +#define UNWIND 319 +#define UNREACHABLE 320 +#define ADD 321 +#define SUB 322 +#define MUL 323 +#define UDIV 324 +#define SDIV 325 +#define FDIV 326 +#define UREM 327 +#define SREM 328 +#define FREM 329 +#define AND 330 +#define OR 331 +#define XOR 332 +#define SHL 333 +#define LSHR 334 +#define ASHR 335 +#define ICMP 336 +#define FCMP 337 +#define EQ 338 +#define NE 339 +#define SLT 340 +#define SGT 341 +#define SLE 342 +#define SGE 343 +#define ULT 344 +#define UGT 345 +#define ULE 346 +#define UGE 347 +#define OEQ 348 +#define ONE 349 +#define OLT 350 +#define OGT 351 +#define OLE 352 +#define OGE 353 +#define ORD 354 +#define UNO 355 +#define UEQ 356 +#define UNE 357 +#define MALLOC 358 +#define ALLOCA 359 +#define FREE 360 +#define LOAD 361 +#define STORE 362 +#define GETELEMENTPTR 363 +#define TRUNC 364 +#define ZEXT 365 +#define SEXT 366 +#define FPTRUNC 367 +#define FPEXT 368 +#define BITCAST 369 +#define UITOFP 370 +#define SITOFP 371 +#define FPTOUI 372 +#define FPTOSI 373 +#define INTTOPTR 374 +#define PTRTOINT 375 +#define PHI_TOK 376 +#define SELECT 377 +#define VAARG 378 +#define EXTRACTELEMENT 379 +#define INSERTELEMENT 380 +#define SHUFFLEVECTOR 381 +#define NORETURN 382 +#define INREG 383 +#define SRET 384 +#define DEFAULT 385 +#define HIDDEN 386 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1028,8 +1217,28 @@ } -#line 901 "/Users/sabre/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -typedef union { + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 901 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1074,1061 +1283,1519 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } YYSTYPE; -#include +/* Line 196 of yacc.c. */ +#line 1288 "llvmAsmParser.tab.c" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 219 of yacc.c. */ +#line 1300 "llvmAsmParser.tab.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short int yyss; + YYSTYPE yyvs; + }; -#define YYFINAL 557 -#define YYFLAG -32768 -#define YYNTBASE 146 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 385 ? yytranslate[x] : 223) - -static const short yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 136, - 137, 134, 2, 133, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 141, - 132, 142, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 138, 135, 140, 2, 2, 2, 2, 2, 145, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 139, - 2, 2, 143, 2, 144, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131 -}; +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, - 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, - 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, - 119, 122, 123, 125, 127, 130, 131, 133, 135, 137, - 139, 141, 143, 145, 147, 148, 150, 151, 153, 155, - 156, 158, 160, 162, 164, 165, 167, 169, 171, 173, - 175, 178, 180, 182, 184, 186, 187, 190, 192, 194, - 195, 198, 199, 202, 203, 207, 210, 211, 213, 214, - 218, 220, 223, 225, 227, 229, 231, 233, 235, 238, - 240, 243, 249, 255, 261, 267, 271, 274, 280, 285, - 288, 290, 292, 294, 298, 300, 304, 306, 307, 309, - 313, 318, 322, 326, 331, 336, 340, 347, 353, 356, - 359, 362, 365, 368, 371, 374, 377, 380, 383, 390, - 396, 405, 412, 419, 427, 435, 442, 451, 460, 464, - 466, 468, 470, 472, 473, 475, 478, 479, 483, 484, - 488, 492, 494, 498, 502, 503, 510, 511, 519, 520, - 528, 531, 535, 537, 541, 545, 549, 553, 555, 556, - 562, 566, 568, 572, 574, 575, 585, 587, 589, 594, - 596, 598, 601, 605, 606, 608, 610, 612, 614, 616, - 618, 620, 622, 624, 628, 630, 636, 638, 640, 642, - 644, 646, 648, 651, 654, 657, 661, 664, 665, 667, - 670, 673, 677, 687, 697, 706, 721, 723, 725, 732, - 738, 741, 748, 756, 760, 766, 767, 768, 772, 775, - 777, 783, 789, 796, 803, 808, 815, 820, 825, 832, - 839, 842, 851, 853, 855, 856, 860, 867, 871, 878, - 881, 886, 893 -}; +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined (__GNUC__) && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) -static const short yyrhs[] = { 66, - 0, 67, 0, 68, 0, 69, 0, 70, 0, 71, - 0, 72, 0, 73, 0, 74, 0, 78, 0, 79, - 0, 80, 0, 75, 0, 76, 0, 77, 0, 109, - 0, 110, 0, 111, 0, 112, 0, 113, 0, 114, - 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, - 0, 120, 0, 83, 0, 84, 0, 85, 0, 86, - 0, 87, 0, 88, 0, 89, 0, 90, 0, 91, - 0, 92, 0, 93, 0, 94, 0, 95, 0, 96, - 0, 97, 0, 98, 0, 99, 0, 100, 0, 101, - 0, 102, 0, 89, 0, 90, 0, 91, 0, 92, - 0, 21, 0, 22, 0, 9, 0, 10, 0, 11, - 0, 14, 0, 17, 0, 153, 0, 0, 153, 132, - 0, 0, 15, 0, 18, 0, 156, 132, 0, 0, - 35, 0, 37, 0, 36, 0, 38, 0, 40, 0, - 39, 0, 41, 0, 43, 0, 0, 131, 0, 0, - 39, 0, 41, 0, 0, 35, 0, 36, 0, 37, - 0, 40, 0, 0, 54, 0, 55, 0, 56, 0, - 57, 0, 58, 0, 53, 4, 0, 110, 0, 111, - 0, 128, 0, 129, 0, 0, 165, 164, 0, 127, - 0, 164, 0, 0, 167, 166, 0, 0, 46, 4, - 0, 0, 133, 46, 4, 0, 29, 17, 0, 0, - 170, 0, 0, 133, 173, 172, 0, 170, 0, 46, - 4, 0, 9, 0, 10, 0, 11, 0, 12, 0, - 42, 0, 174, 0, 175, 134, 0, 207, 0, 135, - 4, 0, 175, 136, 179, 137, 167, 0, 8, 136, - 179, 137, 167, 0, 138, 4, 139, 175, 140, 0, - 141, 4, 139, 175, 142, 0, 143, 180, 144, 0, - 143, 144, 0, 141, 143, 180, 144, 142, 0, 141, - 143, 144, 142, 0, 175, 165, 0, 175, 0, 8, - 0, 176, 0, 178, 133, 176, 0, 178, 0, 178, - 133, 32, 0, 32, 0, 0, 175, 0, 180, 133, - 175, 0, 175, 138, 183, 140, 0, 175, 138, 140, - 0, 175, 145, 17, 0, 175, 141, 183, 142, 0, - 175, 143, 183, 144, 0, 175, 143, 144, 0, 175, - 141, 143, 183, 144, 142, 0, 175, 141, 143, 144, - 142, 0, 175, 33, 0, 175, 34, 0, 175, 207, - 0, 175, 182, 0, 175, 20, 0, 151, 3, 0, - 151, 4, 0, 9, 21, 0, 9, 22, 0, 152, - 7, 0, 148, 136, 181, 31, 175, 137, 0, 108, - 136, 181, 218, 137, 0, 122, 136, 181, 133, 181, - 133, 181, 137, 0, 146, 136, 181, 133, 181, 137, - 0, 147, 136, 181, 133, 181, 137, 0, 81, 149, - 136, 181, 133, 181, 137, 0, 82, 150, 136, 181, - 133, 181, 137, 0, 124, 136, 181, 133, 181, 137, - 0, 125, 136, 181, 133, 181, 133, 181, 137, 0, - 126, 136, 181, 133, 181, 133, 181, 137, 0, 183, - 133, 181, 0, 181, 0, 27, 0, 28, 0, 186, - 0, 0, 187, 0, 186, 187, 0, 0, 26, 188, - 203, 0, 0, 25, 189, 204, 0, 51, 50, 193, - 0, 19, 0, 155, 13, 175, 0, 155, 13, 8, - 0, 0, 157, 160, 184, 181, 190, 172, 0, 0, - 157, 158, 160, 184, 181, 191, 172, 0, 0, 157, - 159, 160, 184, 175, 192, 172, 0, 44, 194, 0, - 47, 132, 195, 0, 17, 0, 45, 132, 17, 0, - 59, 132, 17, 0, 138, 196, 140, 0, 196, 133, - 17, 0, 17, 0, 0, 197, 133, 175, 165, 154, - 0, 175, 165, 154, 0, 197, 0, 197, 133, 32, - 0, 32, 0, 0, 163, 177, 156, 136, 198, 137, - 167, 171, 168, 0, 23, 0, 143, 0, 162, 160, - 199, 200, 0, 24, 0, 144, 0, 210, 202, 0, - 161, 160, 199, 0, 0, 52, 0, 3, 0, 4, - 0, 7, 0, 21, 0, 22, 0, 33, 0, 34, - 0, 20, 0, 141, 183, 142, 0, 182, 0, 50, - 205, 17, 133, 17, 0, 5, 0, 6, 0, 153, - 0, 156, 0, 207, 0, 206, 0, 175, 208, 0, - 210, 211, 0, 201, 211, 0, 212, 155, 213, 0, - 212, 215, 0, 0, 16, 0, 60, 209, 0, 60, - 8, 0, 61, 12, 208, 0, 61, 9, 208, 133, - 12, 208, 133, 12, 208, 0, 62, 151, 208, 133, - 12, 208, 138, 214, 140, 0, 62, 151, 208, 133, - 12, 208, 138, 140, 0, 63, 163, 177, 208, 136, - 217, 137, 167, 31, 12, 208, 64, 12, 208, 0, - 64, 0, 65, 0, 214, 151, 206, 133, 12, 208, - 0, 151, 206, 133, 12, 208, 0, 155, 220, 0, - 175, 138, 208, 133, 208, 140, 0, 216, 133, 138, - 208, 133, 208, 140, 0, 175, 208, 165, 0, 217, - 133, 175, 208, 165, 0, 0, 0, 218, 133, 209, - 0, 49, 48, 0, 48, 0, 146, 175, 208, 133, - 208, 0, 147, 175, 208, 133, 208, 0, 81, 149, - 175, 208, 133, 208, 0, 82, 150, 175, 208, 133, - 208, 0, 148, 209, 31, 175, 0, 122, 209, 133, - 209, 133, 209, 0, 123, 209, 133, 175, 0, 124, - 209, 133, 209, 0, 125, 209, 133, 209, 133, 209, - 0, 126, 209, 133, 209, 133, 209, 0, 121, 216, - 0, 219, 163, 177, 208, 136, 217, 137, 167, 0, - 222, 0, 30, 0, 0, 103, 175, 169, 0, 103, - 175, 133, 9, 208, 169, 0, 104, 175, 169, 0, - 104, 175, 133, 9, 208, 169, 0, 105, 209, 0, - 221, 106, 175, 208, 0, 221, 107, 209, 133, 175, - 208, 0, 108, 175, 208, 218, 0 -}; +#endif +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1049, - 1049, 1049, 1049, 1049, 1049, 1050, 1050, 1050, 1050, 1050, - 1050, 1050, 1051, 1051, 1051, 1051, 1051, 1054, 1054, 1055, - 1055, 1056, 1056, 1057, 1057, 1058, 1058, 1062, 1062, 1063, - 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, 1067, 1068, - 1068, 1069, 1070, 1075, 1076, 1076, 1078, 1078, 1079, 1079, - 1083, 1087, 1092, 1092, 1094, 1098, 1104, 1105, 1106, 1107, - 1108, 1112, 1113, 1114, 1118, 1119, 1123, 1124, 1125, 1129, - 1130, 1131, 1132, 1133, 1136, 1136, 1137, 1138, 1139, 1140, - 1141, 1149, 1150, 1151, 1152, 1155, 1156, 1161, 1162, 1165, - 1166, 1173, 1173, 1180, 1180, 1189, 1197, 1197, 1203, 1203, - 1205, 1210, 1223, 1223, 1223, 1223, 1226, 1230, 1234, 1241, - 1246, 1254, 1272, 1290, 1295, 1307, 1317, 1321, 1331, 1338, - 1345, 1352, 1357, 1362, 1369, 1370, 1377, 1384, 1392, 1397, - 1408, 1436, 1452, 1481, 1509, 1534, 1553, 1578, 1597, 1609, - 1616, 1682, 1692, 1702, 1708, 1714, 1719, 1724, 1732, 1744, - 1766, 1774, 1780, 1791, 1796, 1801, 1807, 1813, 1822, 1826, - 1834, 1834, 1845, 1850, 1858, 1859, 1863, 1863, 1867, 1867, - 1870, 1873, 1885, 1909, 1920, 1927, 1930, 1935, 1938, 1944, - 1948, 1951, 1957, 1970, 1974, 1979, 1981, 1986, 1991, 2000, - 2010, 2021, 2025, 2034, 2043, 2048, 2160, 2160, 2162, 2171, - 2171, 2173, 2178, 2190, 2194, 2199, 2203, 2207, 2211, 2215, - 2219, 2223, 2227, 2231, 2256, 2260, 2274, 2278, 2282, 2286, - 2292, 2292, 2298, 2307, 2311, 2320, 2330, 2339, 2351, 2364, - 2368, 2372, 2377, 2387, 2406, 2415, 2482, 2486, 2493, 2504, - 2517, 2527, 2538, 2548, 2556, 2564, 2567, 2568, 2575, 2579, - 2584, 2605, 2622, 2635, 2648, 2660, 2668, 2675, 2681, 2687, - 2693, 2708, 2772, 2777, 2781, 2788, 2795, 2803, 2810, 2818, - 2826, 2840, 2857 +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 40 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1439 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 146 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 78 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 284 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 557 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 386 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 136, 137, 134, 2, 133, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 141, 132, 142, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 138, 135, 140, 2, 2, 2, 2, 2, 145, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 139, 2, 2, 143, 2, 144, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131 }; -#endif +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short int yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, + 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, + 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, + 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, + 119, 121, 122, 125, 126, 128, 130, 133, 134, 136, + 138, 140, 142, 144, 146, 148, 150, 151, 153, 154, + 156, 158, 159, 161, 163, 165, 167, 168, 170, 172, + 174, 176, 178, 181, 183, 185, 187, 189, 190, 193, + 195, 197, 198, 201, 202, 205, 206, 210, 213, 214, + 216, 217, 221, 223, 226, 228, 230, 232, 234, 236, + 238, 241, 243, 246, 252, 258, 264, 270, 274, 277, + 283, 288, 291, 293, 295, 297, 301, 303, 307, 309, + 310, 312, 316, 321, 325, 329, 334, 339, 343, 350, + 356, 359, 362, 365, 368, 371, 374, 377, 380, 383, + 386, 393, 399, 408, 415, 422, 430, 438, 445, 454, + 463, 467, 469, 471, 473, 475, 476, 478, 481, 482, + 486, 487, 491, 495, 497, 501, 505, 506, 513, 514, + 522, 523, 531, 534, 538, 540, 544, 548, 552, 556, + 558, 559, 565, 569, 571, 575, 577, 578, 588, 590, + 592, 597, 599, 601, 604, 608, 609, 611, 613, 615, + 617, 619, 621, 623, 625, 627, 631, 633, 639, 641, + 643, 645, 647, 649, 651, 654, 657, 660, 664, 667, + 668, 670, 673, 676, 680, 690, 700, 709, 724, 726, + 728, 735, 741, 744, 751, 759, 763, 769, 770, 771, + 775, 778, 780, 786, 792, 799, 806, 811, 818, 823, + 828, 835, 842, 845, 854, 856, 858, 859, 863, 870, + 874, 881, 884, 889, 896 +}; -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short int yyrhs[] = +{ + 186, 0, -1, 66, -1, 67, -1, 68, -1, 69, + -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, + -1, 78, -1, 79, -1, 80, -1, 75, -1, 76, + -1, 77, -1, 109, -1, 110, -1, 111, -1, 112, + -1, 113, -1, 114, -1, 115, -1, 116, -1, 117, + -1, 118, -1, 119, -1, 120, -1, 83, -1, 84, + -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, + -1, 90, -1, 91, -1, 92, -1, 93, -1, 94, + -1, 95, -1, 96, -1, 97, -1, 98, -1, 99, + -1, 100, -1, 101, -1, 102, -1, 89, -1, 90, + -1, 91, -1, 92, -1, 21, -1, 22, -1, 9, + -1, 10, -1, 11, -1, 14, -1, 17, -1, 154, + -1, -1, 154, 132, -1, -1, 15, -1, 18, -1, + 157, 132, -1, -1, 35, -1, 37, -1, 36, -1, + 38, -1, 40, -1, 39, -1, 41, -1, 43, -1, + -1, 131, -1, -1, 39, -1, 41, -1, -1, 35, + -1, 36, -1, 37, -1, 40, -1, -1, 54, -1, + 55, -1, 56, -1, 57, -1, 58, -1, 53, 4, + -1, 110, -1, 111, -1, 128, -1, 129, -1, -1, + 166, 165, -1, 127, -1, 165, -1, -1, 168, 167, + -1, -1, 46, 4, -1, -1, 133, 46, 4, -1, + 29, 17, -1, -1, 171, -1, -1, 133, 174, 173, + -1, 171, -1, 46, 4, -1, 9, -1, 10, -1, + 11, -1, 12, -1, 42, -1, 175, -1, 176, 134, + -1, 208, -1, 135, 4, -1, 176, 136, 180, 137, + 168, -1, 8, 136, 180, 137, 168, -1, 138, 4, + 139, 176, 140, -1, 141, 4, 139, 176, 142, -1, + 143, 181, 144, -1, 143, 144, -1, 141, 143, 181, + 144, 142, -1, 141, 143, 144, 142, -1, 176, 166, + -1, 176, -1, 8, -1, 177, -1, 179, 133, 177, + -1, 179, -1, 179, 133, 32, -1, 32, -1, -1, + 176, -1, 181, 133, 176, -1, 176, 138, 184, 140, + -1, 176, 138, 140, -1, 176, 145, 17, -1, 176, + 141, 184, 142, -1, 176, 143, 184, 144, -1, 176, + 143, 144, -1, 176, 141, 143, 184, 144, 142, -1, + 176, 141, 143, 144, 142, -1, 176, 33, -1, 176, + 34, -1, 176, 208, -1, 176, 183, -1, 176, 20, + -1, 152, 3, -1, 152, 4, -1, 9, 21, -1, + 9, 22, -1, 153, 7, -1, 149, 136, 182, 31, + 176, 137, -1, 108, 136, 182, 219, 137, -1, 122, + 136, 182, 133, 182, 133, 182, 137, -1, 147, 136, + 182, 133, 182, 137, -1, 148, 136, 182, 133, 182, + 137, -1, 81, 150, 136, 182, 133, 182, 137, -1, + 82, 151, 136, 182, 133, 182, 137, -1, 124, 136, + 182, 133, 182, 137, -1, 125, 136, 182, 133, 182, + 133, 182, 137, -1, 126, 136, 182, 133, 182, 133, + 182, 137, -1, 184, 133, 182, -1, 182, -1, 27, + -1, 28, -1, 187, -1, -1, 188, -1, 187, 188, + -1, -1, 26, 189, 204, -1, -1, 25, 190, 205, + -1, 51, 50, 194, -1, 19, -1, 156, 13, 176, + -1, 156, 13, 8, -1, -1, 158, 161, 185, 182, + 191, 173, -1, -1, 158, 159, 161, 185, 182, 192, + 173, -1, -1, 158, 160, 161, 185, 176, 193, 173, + -1, 44, 195, -1, 47, 132, 196, -1, 17, -1, + 45, 132, 17, -1, 59, 132, 17, -1, 138, 197, + 140, -1, 197, 133, 17, -1, 17, -1, -1, 198, + 133, 176, 166, 155, -1, 176, 166, 155, -1, 198, + -1, 198, 133, 32, -1, 32, -1, -1, 164, 178, + 157, 136, 199, 137, 168, 172, 169, -1, 23, -1, + 143, -1, 163, 161, 200, 201, -1, 24, -1, 144, + -1, 211, 203, -1, 162, 161, 200, -1, -1, 52, + -1, 3, -1, 4, -1, 7, -1, 21, -1, 22, + -1, 33, -1, 34, -1, 20, -1, 141, 184, 142, + -1, 183, -1, 50, 206, 17, 133, 17, -1, 5, + -1, 6, -1, 154, -1, 157, -1, 208, -1, 207, + -1, 176, 209, -1, 211, 212, -1, 202, 212, -1, + 213, 156, 214, -1, 213, 216, -1, -1, 16, -1, + 60, 210, -1, 60, 8, -1, 61, 12, 209, -1, + 61, 9, 209, 133, 12, 209, 133, 12, 209, -1, + 62, 152, 209, 133, 12, 209, 138, 215, 140, -1, + 62, 152, 209, 133, 12, 209, 138, 140, -1, 63, + 164, 178, 209, 136, 218, 137, 168, 31, 12, 209, + 64, 12, 209, -1, 64, -1, 65, -1, 215, 152, + 207, 133, 12, 209, -1, 152, 207, 133, 12, 209, + -1, 156, 221, -1, 176, 138, 209, 133, 209, 140, + -1, 217, 133, 138, 209, 133, 209, 140, -1, 176, + 209, 166, -1, 218, 133, 176, 209, 166, -1, -1, + -1, 219, 133, 210, -1, 49, 48, -1, 48, -1, + 147, 176, 209, 133, 209, -1, 148, 176, 209, 133, + 209, -1, 81, 150, 176, 209, 133, 209, -1, 82, + 151, 176, 209, 133, 209, -1, 149, 210, 31, 176, + -1, 122, 210, 133, 210, 133, 210, -1, 123, 210, + 133, 176, -1, 124, 210, 133, 210, -1, 125, 210, + 133, 210, 133, 210, -1, 126, 210, 133, 210, 133, + 210, -1, 121, 217, -1, 220, 164, 178, 209, 136, + 218, 137, 168, -1, 223, -1, 30, -1, -1, 103, + 176, 170, -1, 103, 176, 133, 9, 209, 170, -1, + 104, 176, 170, -1, 104, 176, 133, 9, 209, 170, + -1, 105, 210, -1, 222, 106, 176, 209, -1, 222, + 107, 210, 133, 176, 209, -1, 108, 176, 209, 219, + -1 +}; -static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", -"EUINT64VAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL","VOID","INTTYPE","FLOAT","DOUBLE", -"LABEL","TYPE","LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT", -"IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK", -"DECLARE","DEFINE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO","DOTDOTDOT", -"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", -"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","DEPLIBS","CALL", -"TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK","CCC_TOK","FASTCC_TOK","COLDCC_TOK", -"X86_STDCALLCC_TOK","X86_FASTCALLCC_TOK","DATALAYOUT","RET","BR","SWITCH","INVOKE", -"UNWIND","UNREACHABLE","ADD","SUB","MUL","UDIV","SDIV","FDIV","UREM","SREM", -"FREM","AND","OR","XOR","SHL","LSHR","ASHR","ICMP","FCMP","EQ","NE","SLT","SGT", -"SLE","SGE","ULT","UGT","ULE","UGE","OEQ","ONE","OLT","OGT","OLE","OGE","ORD", -"UNO","UEQ","UNE","MALLOC","ALLOCA","FREE","LOAD","STORE","GETELEMENTPTR","TRUNC", -"ZEXT","SEXT","FPTRUNC","FPEXT","BITCAST","UITOFP","SITOFP","FPTOUI","FPTOSI", -"INTTOPTR","PTRTOINT","PHI_TOK","SELECT","VAARG","EXTRACTELEMENT","INSERTELEMENT", -"SHUFFLEVECTOR","NORETURN","INREG","SRET","DEFAULT","HIDDEN","'='","','","'*'", -"'\\\\'","'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'c'","ArithmeticOps", -"LogicalOps","CastOps","IPredicates","FPredicates","IntType","FPType","LocalName", -"OptLocalName","OptLocalAssign","GlobalName","OptGlobalAssign","GVInternalLinkage", -"GVExternalLinkage","GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage", -"OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs","OptAlign", -"OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", -"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI", -"ConstVal","ConstExpr","ConstVector","GlobalType","Module","DefinitionList", -"Definition","@1","@2","@3","@4","@5","AsmBlock","TargetDefinition","LibrariesDefinition", -"LibList","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", -"Function","FunctionProto","OptSideEffect","ConstValueRef","SymbolicValueRef", -"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", -"JumpTable","Inst","PHIList","ValueRefList","IndexList","OptTailCall","InstVal", -"OptVolatile","MemoryInst", NULL +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short int yyrline[] = +{ + 0, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1049, 1049, 1049, 1049, 1049, 1049, 1050, 1050, 1050, + 1050, 1050, 1050, 1051, 1051, 1051, 1051, 1051, 1051, 1054, + 1054, 1055, 1055, 1056, 1056, 1057, 1057, 1058, 1058, 1062, + 1062, 1063, 1063, 1064, 1064, 1065, 1065, 1066, 1066, 1067, + 1067, 1068, 1068, 1069, 1070, 1075, 1076, 1076, 1078, 1078, + 1079, 1079, 1083, 1087, 1092, 1092, 1094, 1098, 1104, 1105, + 1106, 1107, 1108, 1112, 1113, 1114, 1118, 1119, 1123, 1124, + 1125, 1129, 1130, 1131, 1132, 1133, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1149, 1150, 1151, 1152, 1155, 1156, 1161, + 1162, 1165, 1166, 1173, 1174, 1180, 1181, 1189, 1197, 1198, + 1203, 1204, 1205, 1210, 1223, 1223, 1223, 1223, 1226, 1230, + 1234, 1241, 1246, 1254, 1272, 1290, 1295, 1307, 1317, 1321, + 1331, 1338, 1345, 1352, 1357, 1362, 1369, 1370, 1377, 1384, + 1392, 1397, 1408, 1436, 1452, 1481, 1509, 1534, 1553, 1578, + 1597, 1609, 1616, 1682, 1692, 1702, 1708, 1714, 1719, 1724, + 1732, 1744, 1766, 1774, 1780, 1791, 1796, 1801, 1807, 1813, + 1822, 1826, 1834, 1834, 1845, 1850, 1858, 1859, 1863, 1863, + 1867, 1867, 1870, 1873, 1885, 1909, 1920, 1920, 1930, 1930, + 1938, 1938, 1948, 1951, 1957, 1970, 1974, 1979, 1981, 1986, + 1991, 2000, 2010, 2021, 2025, 2034, 2043, 2048, 2160, 2160, + 2162, 2171, 2171, 2173, 2178, 2190, 2194, 2199, 2203, 2207, + 2211, 2215, 2219, 2223, 2227, 2231, 2256, 2260, 2274, 2278, + 2282, 2286, 2292, 2292, 2298, 2307, 2311, 2320, 2330, 2339, + 2351, 2364, 2368, 2372, 2377, 2387, 2406, 2415, 2482, 2486, + 2493, 2504, 2517, 2527, 2538, 2548, 2556, 2564, 2567, 2568, + 2575, 2579, 2584, 2605, 2622, 2635, 2648, 2660, 2668, 2675, + 2681, 2687, 2693, 2708, 2772, 2777, 2781, 2788, 2795, 2803, + 2810, 2818, 2826, 2840, 2857 }; #endif -static const short yyr1[] = { 0, - 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, - 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 150, 150, 151, 152, 152, 153, 153, 154, 154, - 155, 155, 156, 156, 157, 157, 158, 158, 158, 158, - 158, 159, 159, 159, 160, 160, 161, 161, 161, 162, - 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, - 163, 164, 164, 164, 164, 165, 165, 166, 166, 167, - 167, 168, 168, 169, 169, 170, 171, 171, 172, 172, - 173, 173, 174, 174, 174, 174, 175, 175, 175, 175, - 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, - 177, 177, 178, 178, 179, 179, 179, 179, 180, 180, - 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, - 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, - 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, - 184, 184, 185, 185, 186, 186, 188, 187, 189, 187, - 187, 187, 187, 187, 190, 187, 191, 187, 192, 187, - 187, 187, 193, 194, 194, 195, 196, 196, 196, 197, - 197, 198, 198, 198, 198, 199, 200, 200, 201, 202, - 202, 203, 204, 205, 205, 206, 206, 206, 206, 206, - 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, - 208, 208, 209, 210, 210, 211, 212, 212, 212, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, - 215, 216, 216, 217, 217, 217, 218, 218, 219, 219, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 221, 221, 222, 222, 222, 222, 222, - 222, 222, 222 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", + "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", "FLOAT", + "DOUBLE", "LABEL", "TYPE", "LOCALVAR", "GLOBALVAR", "LABELSTR", + "STRINGCONSTANT", "ATSTRINGCONSTANT", "IMPLEMENTATION", + "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", + "DECLARE", "DEFINE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", + "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "DEPLIBS", "CALL", "TAIL", + "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", "FASTCC_TOK", + "COLDCC_TOK", "X86_STDCALLCC_TOK", "X86_FASTCALLCC_TOK", "DATALAYOUT", + "RET", "BR", "SWITCH", "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", + "MUL", "UDIV", "SDIV", "FDIV", "UREM", "SREM", "FREM", "AND", "OR", + "XOR", "SHL", "LSHR", "ASHR", "ICMP", "FCMP", "EQ", "NE", "SLT", "SGT", + "SLE", "SGE", "ULT", "UGT", "ULE", "UGE", "OEQ", "ONE", "OLT", "OGT", + "OLE", "OGE", "ORD", "UNO", "UEQ", "UNE", "MALLOC", "ALLOCA", "FREE", + "LOAD", "STORE", "GETELEMENTPTR", "TRUNC", "ZEXT", "SEXT", "FPTRUNC", + "FPEXT", "BITCAST", "UITOFP", "SITOFP", "FPTOUI", "FPTOSI", "INTTOPTR", + "PTRTOINT", "PHI_TOK", "SELECT", "VAARG", "EXTRACTELEMENT", + "INSERTELEMENT", "SHUFFLEVECTOR", "NORETURN", "INREG", "SRET", "DEFAULT", + "HIDDEN", "'='", "','", "'*'", "'\\\\'", "'('", "')'", "'['", "'x'", + "']'", "'<'", "'>'", "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", + "LogicalOps", "CastOps", "IPredicates", "FPredicates", "IntType", + "FPType", "LocalName", "OptLocalName", "OptLocalAssign", "GlobalName", + "OptGlobalAssign", "GVInternalLinkage", "GVExternalLinkage", + "GVVisibilityStyle", "FunctionDeclareLinkage", "FunctionDefineLinkage", + "OptCallingConv", "ParamAttr", "OptParamAttrs", "FuncAttr", + "OptFuncAttrs", "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "PrimType", "Types", + "ArgType", "ResultTypes", "ArgTypeList", "ArgTypeListI", "TypeListI", + "ConstVal", "ConstExpr", "ConstVector", "GlobalType", "Module", + "DefinitionList", "Definition", "@1", "@2", "@3", "@4", "@5", "AsmBlock", + "TargetDefinition", "LibrariesDefinition", "LibList", "ArgListH", + "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", "END", + "Function", "FunctionProto", "OptSideEffect", "ConstValueRef", + "SymbolicValueRef", "ValueRef", "ResolvedVal", "BasicBlockList", + "BasicBlock", "InstructionList", "BBTerminatorInst", "JumpTable", "Inst", + "PHIList", "ValueRefList", "IndexList", "OptTailCall", "InstVal", + "OptVolatile", "MemoryInst", 0 }; +#endif -static const short yyr2[] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 0, 1, 1, 2, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, - 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 0, 2, 1, 1, 0, - 2, 0, 2, 0, 3, 2, 0, 1, 0, 3, - 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, - 2, 5, 5, 5, 5, 3, 2, 5, 4, 2, - 1, 1, 1, 3, 1, 3, 1, 0, 1, 3, - 4, 3, 3, 4, 4, 3, 6, 5, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 6, 5, - 8, 6, 6, 7, 7, 6, 8, 8, 3, 1, - 1, 1, 1, 0, 1, 2, 0, 3, 0, 3, - 3, 1, 3, 3, 0, 6, 0, 7, 0, 7, - 2, 3, 1, 3, 3, 3, 3, 1, 0, 5, - 3, 1, 3, 1, 0, 9, 1, 1, 4, 1, - 1, 2, 3, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 5, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 3, 2, 0, 1, 2, - 2, 3, 9, 9, 8, 14, 1, 1, 6, 5, - 2, 6, 7, 3, 5, 0, 0, 3, 2, 1, - 5, 5, 6, 6, 4, 6, 4, 4, 6, 6, - 2, 8, 1, 1, 0, 3, 6, 3, 6, 2, - 4, 6, 4 +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short int yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 61, 44, 42, 92, 40, 41, 91, 120, + 93, 60, 62, 123, 125, 99 }; +# endif -static const short yydefact[] = { 66, - 57, 63, 58, 64, 182, 179, 177, 0, 0, 0, - 0, 0, 0, 75, 66, 175, 77, 80, 0, 0, - 191, 0, 0, 61, 0, 65, 67, 69, 68, 70, - 72, 71, 73, 74, 76, 75, 75, 0, 176, 78, - 79, 75, 180, 81, 82, 83, 84, 75, 238, 178, - 238, 0, 0, 199, 192, 193, 181, 227, 228, 184, - 113, 114, 115, 116, 117, 0, 0, 0, 0, 229, - 230, 118, 183, 120, 0, 0, 171, 172, 0, 85, - 85, 239, 235, 62, 210, 211, 212, 234, 194, 195, - 198, 0, 138, 121, 0, 0, 0, 0, 127, 139, - 0, 119, 138, 0, 0, 113, 114, 115, 0, 0, - 0, 185, 0, 86, 87, 88, 89, 90, 0, 213, - 0, 275, 237, 0, 196, 137, 96, 133, 135, 0, - 0, 0, 0, 0, 0, 126, 0, 187, 189, 156, - 157, 154, 155, 158, 153, 149, 150, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 13, 14, 15, 10, - 11, 12, 0, 0, 0, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 152, 151, - 109, 91, 132, 131, 0, 207, 208, 209, 274, 260, - 0, 0, 0, 0, 85, 247, 248, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 236, 85, 251, 0, 273, 197, 130, 0, - 100, 0, 0, 129, 0, 140, 100, 109, 109, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 0, - 52, 53, 48, 49, 50, 51, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, - 0, 0, 142, 170, 0, 0, 0, 146, 0, 143, - 0, 0, 0, 0, 186, 0, 259, 241, 0, 240, - 0, 0, 54, 0, 0, 0, 0, 104, 104, 280, - 0, 0, 271, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 92, 93, 94, 95, 97, 136, - 134, 123, 124, 125, 128, 122, 188, 190, 0, 0, - 257, 0, 0, 0, 0, 0, 141, 127, 139, 0, - 144, 145, 0, 0, 0, 0, 0, 111, 109, 205, - 216, 217, 218, 223, 219, 220, 221, 222, 214, 0, - 225, 232, 231, 233, 0, 242, 0, 0, 0, 0, - 0, 276, 0, 278, 257, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 98, 99, - 101, 0, 0, 0, 0, 0, 0, 0, 169, 148, - 0, 0, 0, 0, 106, 112, 110, 204, 96, 202, - 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 283, 0, 0, 0, 267, 268, 0, 0, - 0, 0, 265, 0, 281, 0, 0, 0, 0, 160, - 0, 0, 0, 0, 147, 0, 0, 0, 60, 0, - 100, 0, 224, 0, 0, 256, 0, 0, 104, 105, - 104, 0, 0, 0, 0, 0, 261, 262, 256, 0, - 0, 0, 258, 0, 166, 0, 0, 162, 163, 159, - 59, 201, 203, 96, 107, 0, 0, 0, 0, 0, - 263, 264, 0, 277, 279, 0, 0, 266, 269, 270, - 0, 282, 164, 165, 0, 0, 0, 60, 108, 102, - 226, 0, 0, 96, 0, 100, 252, 0, 100, 161, - 167, 168, 200, 0, 206, 0, 245, 0, 0, 254, - 0, 0, 253, 272, 103, 243, 0, 244, 0, 96, - 0, 0, 0, 255, 0, 0, 0, 0, 250, 0, - 0, 249, 0, 246, 0, 0, 0 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 146, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 148, 148, 148, 148, 148, 148, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, + 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, + 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, + 151, 151, 151, 151, 151, 152, 153, 153, 154, 154, + 155, 155, 156, 156, 157, 157, 158, 158, 159, 159, + 159, 159, 159, 160, 160, 160, 161, 161, 162, 162, + 162, 163, 163, 163, 163, 163, 164, 164, 164, 164, + 164, 164, 164, 165, 165, 165, 165, 166, 166, 167, + 167, 168, 168, 169, 169, 170, 170, 171, 172, 172, + 173, 173, 174, 174, 175, 175, 175, 175, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 177, 178, 178, 179, 179, 180, 180, 180, 180, + 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 184, 184, 185, 185, 186, 186, 187, 187, 189, 188, + 190, 188, 188, 188, 188, 188, 191, 188, 192, 188, + 193, 188, 188, 188, 194, 195, 195, 196, 197, 197, + 197, 198, 198, 199, 199, 199, 199, 200, 201, 201, + 202, 203, 203, 204, 205, 206, 206, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, + 208, 208, 209, 209, 210, 211, 211, 212, 213, 213, + 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 215, 215, 216, 217, 217, 218, 218, 218, 219, 219, + 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, + 221, 221, 221, 221, 221, 222, 222, 223, 223, 223, + 223, 223, 223, 223, 223 }; -static const short yydefgoto[] = { 186, - 187, 188, 250, 267, 109, 110, 70, 482, 12, 71, - 14, 36, 37, 38, 42, 48, 119, 319, 229, 391, - 322, 525, 372, 348, 510, 285, 349, 72, 111, 128, - 195, 129, 130, 101, 274, 361, 275, 79, 555, 15, - 16, 18, 17, 191, 238, 239, 57, 21, 55, 92, - 410, 411, 120, 198, 49, 87, 50, 43, 413, 362, - 74, 364, 290, 51, 83, 84, 223, 529, 123, 303, - 490, 394, 224, 225, 226, 227 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 2, 0, 1, 1, 2, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, + 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 0, 2, 1, + 1, 0, 2, 0, 2, 0, 3, 2, 0, 1, + 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, + 2, 1, 2, 5, 5, 5, 5, 3, 2, 5, + 4, 2, 1, 1, 1, 3, 1, 3, 1, 0, + 1, 3, 4, 3, 3, 4, 4, 3, 6, 5, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 6, 5, 8, 6, 6, 7, 7, 6, 8, 8, + 3, 1, 1, 1, 1, 0, 1, 2, 0, 3, + 0, 3, 3, 1, 3, 3, 0, 6, 0, 7, + 0, 7, 2, 3, 1, 3, 3, 3, 3, 1, + 0, 5, 3, 1, 3, 1, 0, 9, 1, 1, + 4, 1, 1, 2, 3, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 3, 2, 0, + 1, 2, 2, 3, 9, 9, 8, 14, 1, 1, + 6, 5, 2, 6, 7, 3, 5, 0, 0, 3, + 2, 1, 5, 5, 6, 6, 4, 6, 4, 4, + 6, 6, 2, 8, 1, 1, 0, 3, 6, 3, + 6, 2, 4, 6, 4 }; -static const short yypact[] = { 438, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 27, -119, -29, - -84, 43, -57, -6, 525,-32768, 195, 140, -38, -27, --32768, -39, 112,-32768, 828,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 32, 32, 227,-32768,-32768, --32768, 32,-32768,-32768,-32768,-32768,-32768, 32, 119,-32768, - -2, 188, 210, 213,-32768,-32768,-32768,-32768,-32768, 49, --32768,-32768,-32768,-32768,-32768, 214, 245, 5, 104,-32768, --32768,-32768, 110,-32768, 227, 227,-32768,-32768, 1043, 154, - 154,-32768,-32768, 109,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -89, 1085,-32768, 125, 139, 122, 49,-32768, 110, - -55,-32768, 1085, 1043, 1188, 46, 249, 272, 266, 273, - 589,-32768, 279,-32768,-32768,-32768,-32768,-32768, 1204,-32768, - 2, 1327,-32768, 268,-32768,-32768, 110,-32768, 153, 150, - 1188, 1188, 149, -53, 1188,-32768, 155,-32768, 110,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 494, 943, 157,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 158, 159, 163, - 164, 790, 1226, 495, 284, 166, 167, 169,-32768,-32768, - 173,-32768, 49, 110, 28,-32768,-32768,-32768,-32768,-32768, - 262, 1243, 142, 302, 154,-32768,-32768, 494, 943, 1188, - 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, - 1188, 1188,-32768, 154,-32768, 168,-32768,-32768, -58, 1124, --32768, 25, 16,-32768, 170, 110,-32768, 173, 173,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 177, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 181, 1043, 1043, 1043, - 1043, 1043,-32768,-32768, 20, 668, -40,-32768, -48,-32768, - 1043, 1043, 1043, 18,-32768, 182,-32768, 49, 747,-32768, - 872, 872,-32768, 872, 1204, 1188, 1188, 99, 117,-32768, - 747, 33, 186, 187, 191, 192, 198, 200, 747, 747, - 290, 1204, 1188, 1188,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -87,-32768,-32768,-32768, -87,-32768,-32768, 1043, 1043, --32768, 203, 204, 205, 209, 1043,-32768, 202, 589, -43, --32768,-32768, 216, 218, 312, 328, 342,-32768, 173, 1140, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 295, 1043, --32768,-32768,-32768,-32768, 219,-32768, 229, 872, 747, 747, - 8,-32768, 17,-32768,-32768, 872, 225, 1188, 1188, 1188, - 1188, 1188, 231, 232, 1188, 872, 747, 233,-32768,-32768, --32768, 234, 235, -33, 1043, 1043, 1043, 1043,-32768,-32768, - 230, 1043, 1043, 1188,-32768,-32768,-32768,-32768, 110, 238, - 236,-32768, 357, -36, 363, 364, 241, 246, 248, 872, - 374, 872, 251, 254, 872, 255, 110,-32768, 256, 258, - 872, 872, 110, 260,-32768, 1188, 1043, 1043, 1188,-32768, - 261, 263, 264, 270,-32768, 267, 276, 47, 130, 1159, --32768, 274,-32768, 872, 872, 1188, 872, 872, 281,-32768, - 281, 872, 283, 1188, 1188, 1188,-32768,-32768, 1188, 747, - 282, 285,-32768, 1043,-32768, 1043, 1043,-32768,-32768,-32768, --32768,-32768,-32768, 110, 45, 382, 287, 280, 747, -13, --32768,-32768, 355,-32768,-32768, 265, 872,-32768,-32768,-32768, - 29,-32768,-32768,-32768, 286, 291, 292, 130,-32768, 375, --32768, 412, 1,-32768, 1188,-32768,-32768, 293,-32768,-32768, --32768,-32768,-32768, 423,-32768, 872,-32768, 996, 9, -58, - 747, 212,-32768, -87,-32768,-32768, 297,-32768, 996,-32768, - 419, 422, 303, -58, 872, 872, 425, 371,-32768, 872, - 427,-32768, 872,-32768, 443, 444,-32768 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned short int yydefact[] = +{ + 67, 58, 64, 59, 65, 183, 180, 178, 0, 0, + 0, 0, 0, 0, 76, 0, 67, 176, 78, 81, + 0, 0, 192, 0, 0, 62, 0, 66, 68, 70, + 69, 71, 73, 72, 74, 75, 77, 76, 76, 0, + 1, 177, 79, 80, 76, 181, 82, 83, 84, 85, + 76, 239, 179, 239, 0, 0, 200, 193, 194, 182, + 228, 229, 185, 114, 115, 116, 117, 118, 0, 0, + 0, 0, 230, 231, 119, 184, 121, 0, 0, 172, + 173, 0, 86, 86, 240, 236, 63, 211, 212, 213, + 235, 195, 196, 199, 0, 139, 122, 0, 0, 0, + 0, 128, 140, 0, 120, 139, 0, 0, 114, 115, + 116, 0, 0, 0, 186, 0, 87, 88, 89, 90, + 91, 0, 214, 0, 276, 238, 0, 197, 138, 97, + 134, 136, 0, 0, 0, 0, 0, 0, 127, 0, + 188, 190, 157, 158, 155, 156, 159, 154, 150, 151, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, + 15, 16, 11, 12, 13, 0, 0, 0, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 153, 152, 110, 92, 133, 132, 0, 208, 209, + 210, 275, 261, 0, 0, 0, 0, 86, 248, 249, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 237, 86, 252, 0, 274, + 198, 131, 0, 101, 0, 0, 130, 0, 141, 101, + 110, 110, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 0, 53, 54, 49, 50, 51, 52, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 0, + 0, 0, 0, 0, 0, 143, 171, 0, 0, 0, + 147, 0, 144, 0, 0, 0, 0, 187, 0, 260, + 242, 0, 241, 0, 0, 55, 0, 0, 0, 0, + 105, 105, 281, 0, 0, 272, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 93, 94, 95, + 96, 98, 137, 135, 124, 125, 126, 129, 123, 189, + 191, 0, 0, 258, 0, 0, 0, 0, 0, 142, + 128, 140, 0, 145, 146, 0, 0, 0, 0, 0, + 112, 110, 206, 217, 218, 219, 224, 220, 221, 222, + 223, 215, 0, 226, 233, 232, 234, 0, 243, 0, + 0, 0, 0, 0, 277, 0, 279, 258, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 99, 100, 102, 0, 0, 0, 0, 0, 0, + 0, 170, 149, 0, 0, 0, 0, 107, 113, 111, + 205, 97, 203, 0, 216, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 284, 0, 0, 0, 268, + 269, 0, 0, 0, 0, 266, 0, 282, 0, 0, + 0, 0, 161, 0, 0, 0, 0, 148, 0, 0, + 0, 61, 0, 101, 0, 225, 0, 0, 257, 0, + 0, 105, 106, 105, 0, 0, 0, 0, 0, 262, + 263, 257, 0, 0, 0, 259, 0, 167, 0, 0, + 163, 164, 160, 60, 202, 204, 97, 108, 0, 0, + 0, 0, 0, 264, 265, 0, 278, 280, 0, 0, + 267, 270, 271, 0, 283, 165, 166, 0, 0, 0, + 61, 109, 103, 227, 0, 0, 97, 0, 101, 253, + 0, 101, 162, 168, 169, 201, 0, 207, 0, 246, + 0, 0, 255, 0, 0, 254, 273, 104, 244, 0, + 245, 0, 97, 0, 0, 0, 256, 0, 0, 0, + 0, 251, 0, 0, 250, 0, 247 }; -static const short yypgoto[] = { 324, - 325, 326, 242, 252, -197,-32768, 0, -50, 376, 4, --32768,-32768,-32768, 40,-32768,-32768, -167, -306, -397,-32768, - -235,-32768, -291, -23,-32768, -211,-32768,-32768, -24, 237, - -229,-32768, 362, 369, -68, -108, -178, 201,-32768,-32768, - 453,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 391,-32768,-32768,-32768,-32768,-32768,-32768, -436, - -72, 101, -157,-32768, 424,-32768,-32768,-32768,-32768,-32768, - 7, 105,-32768,-32768,-32768,-32768 +/* YYDEFGOTO[NTERM-NUM]. */ +static const short int yydefgoto[] = +{ + -1, 188, 189, 190, 252, 269, 111, 112, 72, 484, + 12, 73, 14, 37, 38, 39, 44, 50, 121, 321, + 231, 393, 324, 527, 374, 350, 512, 287, 351, 74, + 113, 130, 197, 131, 132, 103, 276, 363, 277, 81, + 15, 16, 17, 19, 18, 193, 240, 241, 59, 22, + 57, 94, 412, 413, 122, 200, 51, 89, 52, 45, + 415, 364, 76, 366, 292, 53, 85, 86, 225, 531, + 125, 305, 492, 396, 226, 227, 228, 229 }; - -#define YYLAST 1453 - - -static const short yytable[] = { 11, - 73, 326, 189, 13, 277, 279, 294, 374, 96, 293, - 112, 449, 22, 82, 11, 390, 420, 293, 13, 390, - 23, 85, 315, 316, 196, 422, 327, 328, 27, 28, - 29, 30, 31, 32, 33, 138, 34, 295, 190, 389, - 317, 318, 2, 124, 100, 4, 346, 24, -54, -54, - 125, 315, 316, 421, 300, 25, 312, 304, 305, 306, - 307, 308, 421, 347, 311, 368, 140, 141, 127, 317, - 318, 19, 100, 346, 26, 75, 76, 135, 127, 135, - 139, 80, 386, 11, 336, 20, 508, 81, 136, 336, - 235, 537, 336, 52, 194, 342, 336, 340, 54, 439, - 401, 341, 543, 440, 53, 453, 232, 233, 58, 59, - 236, 98, 61, 62, 63, 64, 530, 1, 2, 515, - 3, 4, 1, 516, 35, 3, 58, 59, 56, 98, - 61, 62, 63, 64, 82, 1, 2, 407, 3, 4, - 527, 86, 544, 1, 197, 65, 3, 97, 538, 102, - 291, 103, 336, 292, 315, 316, 388, 324, 102, 337, - 103, 515, 35, 65, 323, 519, 102, 494, 103, 495, - 376, 389, 317, 318, 44, 45, 46, 289, 390, 47, - 102, 414, 103, 480, 93, 298, 299, 289, 301, 302, - 289, 289, 289, 289, 289, 309, 310, 289, 286, 331, - 332, 333, 334, 335, 89, 127, 113, 114, 115, 116, - 117, 118, 343, 344, 345, 485, 363, 94, 363, 363, - 426, 363, 428, 429, 430, 390, 90, 390, 363, 91, - 189, 371, 102, 40, 103, 41, 363, 363, 66, 315, - 316, 67, 541, 102, 68, 103, 69, 99, 95, 373, - 102, 339, 103, 77, 78, -55, 66, 317, 318, 67, - 392, 393, 68, 131, 69, 133, 190, 399, 142, 143, - 194, 369, 370, 313, 314, 104, 105, 132, -56, 144, - 532, 473, 192, 534, 228, 230, 231, 194, 387, 289, - 234, 237, 268, 269, 270, 363, 363, 363, 271, 272, - 280, 281, 282, 363, 283, 284, 498, 499, 500, 287, - 293, 325, 329, 363, 363, 528, 330, 350, 377, 378, - 385, 315, 316, 379, 380, 409, 441, 442, 443, 444, - 381, 539, 382, 446, 447, 395, 396, 397, 389, 317, - 318, 398, 404, 400, 405, 406, 412, 363, 402, 363, - 403, 415, 363, 289, 427, 289, 289, 289, 363, 363, - 433, 416, 425, 431, 432, 436, 437, 438, 471, 472, - 450, 445, 451, 452, 454, 455, 456, 460, 457, 448, - 458, 363, 363, 439, 363, 363, 462, 464, 465, 363, - 466, 365, 366, 474, 367, 469, 476, 363, 511, 475, - 421, 375, 477, 478, 517, 505, 486, 506, 507, 383, - 384, 470, 479, 493, 289, 497, 363, 513, 503, 512, - 524, 504, 520, 526, 363, 484, 535, 521, 522, 542, - 545, 489, 533, 546, 551, 547, 550, -174, 553, 289, - 289, 289, 556, 557, 489, 220, 221, 222, 481, 296, - -62, 1, 2, 363, 3, 4, 5, 523, 363, 122, - 297, 509, 6, 7, 137, 134, 321, 39, 417, 418, - 419, 121, 363, 363, 88, 501, 424, 363, 0, 423, - 363, 8, 0, 0, 9, 0, 434, 435, 10, 0, - 531, 0, 0, 0, 0, 0, 0, 0, 0, 58, - 59, 0, 98, 106, 107, 108, 64, 481, 1, 2, - 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, - 459, 0, 461, 0, -173, 463, 0, 0, 0, 0, - 0, 467, 468, 0, 0, 0, 65, -62, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 6, - 7, 0, 0, 0, 487, 488, 0, 491, 492, 0, - 0, 0, 496, 0, 0, 0, 0, 0, 8, 0, - 502, 9, 0, 0, 0, 10, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 0, 0, 0, 514, - 0, 0, 0, 58, 59, 0, 0, 518, 0, 0, - 0, 0, 1, 2, 0, 3, 4, 0, 145, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 146, 147, 0, 0, 0, 536, 0, 0, 66, - 0, 540, 67, 0, 0, 68, 0, 69, 278, 0, - 0, 0, 0, 0, 0, 548, 549, 0, 0, 0, - 552, 0, 0, 554, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 0, 58, 59, 0, 98, 106, 107, 108, 64, - 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 65, - 178, 0, 179, 180, 181, 0, 0, 0, 0, 0, - 0, 0, 102, 0, 103, 0, 182, 0, 0, 183, - 0, 184, 0, 185, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 351, - 352, 58, 59, 353, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 3, 4, 0, 354, 355, 356, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 357, - 358, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 58, 59, 359, 98, 106, 107, - 108, 64, 66, 1, 2, 67, 3, 4, 68, 0, - 69, 338, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 0, - 0, 65, 58, 59, 0, 60, 61, 62, 63, 64, - 0, 1, 2, 0, 3, 4, 0, 0, 0, 0, - 0, 0, 0, 0, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 0, 178, 65, - 179, 180, 181, 0, 351, 352, 58, 59, 353, 0, - 102, 0, 103, 0, 0, 1, 2, 360, 3, 4, - 0, 354, 355, 356, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 357, 358, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 359, 0, 0, 66, 0, 0, 67, 0, 273, - 68, 0, 69, 0, 0, 0, 0, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 0, 0, 0, 0, 0, 0, - 0, 0, 66, 251, 252, 67, 0, 0, 68, 0, - 69, 0, 0, 0, 0, 0, 0, 0, 0, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 0, 178, 0, 179, 180, 181, 351, 352, - 0, 0, 353, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 360, 0, 0, 354, 355, 356, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 357, 358, - 0, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 359, 0, 58, 59, 0, - 98, 106, 107, 108, 64, 0, 1, 2, 0, 3, - 4, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 0, 0, - 0, 0, 0, 0, 65, 0, 0, 0, 0, 58, - 59, 0, 98, 61, 62, 63, 64, 0, 1, 2, - 0, 3, 4, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 126, 178, 0, 179, - 180, 181, 0, 0, 0, 0, 65, 0, 58, 59, - 0, 98, 61, 62, 63, 64, 360, 1, 2, 0, - 3, 4, 0, 0, 58, 59, 0, 98, 61, 62, - 63, 64, 0, 1, 2, 320, 3, 4, 0, 0, - 0, 0, 0, 58, 59, 65, 98, 61, 62, 63, - 64, 408, 1, 2, 0, 3, 4, 66, 0, 0, - 67, 65