From sabre at nondot.org Mon Jan 28 00:10:48 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 06:10:48 -0000 Subject: [llvm-commits] [test-suite] r46438 - in /test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm: ./ Makefile bmm.c Message-ID: <200801280610.m0S6AmCb005953@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 00:10:47 2008 New Revision: 46438 URL: http://llvm.org/viewvc/llvm-project?rev=46438&view=rev Log: add the bmm benchmark, hacked to not produce huge output nor use huge input. Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/ test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile?rev=46438&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/Makefile Mon Jan 28 00:10:47 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = bmm +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 1024 1024 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 128 32 +else +RUN_OPTIONS = 1024 64 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c?rev=46438&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/bmm/bmm.c Mon Jan 28 00:10:47 2008 @@ -0,0 +1,246 @@ +/****************************************************************************** + + SOFTWARE LICENSE AGREEMENT NOTICE + ----------------------------------- + +IT IS A BREACH OF THIS LICENSE AGREEMENT TO REMOVE THIS NOTICE FROM +THE FILE OR SOFTWARE, OR ANY MODIFIED VERSIONS OF THIS FILE OR +SOFTWARE OR DERIVATIVE WORKS. +___________________________________________________ + +Copyright Notices/Identification of Licensor(s) of Original Software +in the File + +Copyright (C) 1994 Hewlett-Packard Company + +All rights reserved by the foregoing, respectively. +___________________________________________________ + +Copyright Notices/Identification of Subsequent +Licensor(s)/Contributors of Derivative Works + +Copyright + + +All rights reserved by the foregoing, respectively. +___________________________________________________ + +The code contained in this file, including both binary and source [if +released by the owner(s)] (hereafter, Software) is subject to +copyright by the respective Licensor(s) and ownership remains with +such Licensor(s). The Licensor(s) of the original Software remain +free to license their respective proprietary Software for other +purposes that are independent and separate from this file, without +obligation to any party. + +Licensor(s) grant(s) you (hereafter, Licensee) a license to use the +Software for academic, research and internal business purposes only, +without a fee. "Internal business purposes" means that Licensee may +install, use and execute the Software for the purpose of designing and +evaluating products. Licensee may submit proposals for research +support, and receive funding from private and Government sponsors for +continued development, support and maintenance of the Software for the +purposes permitted herein. + +Licensee may also disclose results obtained by executing the Software, +as well as algorithms embodied therein. Licensee may redistribute the +Software to third parties provided that the copyright notices and this +License Agreement Notice statement are reproduced on all copies and +that no charge is associated with such copies. No patent or other +intellectual property license is granted or implied by this Agreement, +and this Agreement does not license any acts except those expressly +recited. + +Licensee may modify the Software to make derivative works (as defined +in Section 101 of Title 17, U.S. Code) (hereafter, Derivative Works), +as necessary for its own academic, research and internal business +purposes. Title to copyrights and other proprietary rights in +Derivative Works created by Licensee shall be owned by Licensee +subject, however, to the underlying ownership interest(s) of the +Licensor(s) in the copyrights and other proprietary rights in the +original Software. All the same rights and licenses granted herein +and all other terms and conditions contained in this Agreement +pertaining to the Software shall continue to apply to any parts of the +Software included in Derivative Works. Licensee's Derivative Work +should clearly notify users that it is a modified version and not the +original Software distributed by the Licensor(s). + +If Licensee wants to make its Derivative Works available to other +parties, such distribution will be governed by the terms and +conditions of this License Agreement. Licensee shall not modify this +License Agreement, except that Licensee shall clearly identify the +contribution of its Derivative Work to this file by adding an +additional copyright notice to the other copyright notices listed +above, to be added below the line "Copyright Notices/Identification of +Subsequent Licensor(s)/Contributors of Derivative Works." A party who +is not an owner of such Derivative Work within the meaning of +U.S. Copyright Law (i.e., the original author, or the employer of the +author if "work of hire") shall not modify this License Agreement or +add such party's name to the copyright notices above. + +Each party who contributes Software or makes a Derivative Work to this +file (hereafter, Contributed Code) represents to each Licensor and to +other Licensees for its own Contributed Code that: + +(a) Such Contributed Code does not violate (or cause the Software to +violate) the laws of the United States, including the export control +laws of the United States, or the laws of any other jurisdiction. + +(b) The contributing party has all legal right and authority to make +such Contributed Code available and to grant the rights and licenses +contained in this License Agreement without violation or conflict with +any law. + +(c) To the best of the contributing party's knowledge and belief, the +Contributed Code does not infringe upon any proprietary rights or +intellectual property rights of any third party. + +LICENSOR(S) MAKE(S) NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE +SOFTWARE OR DERIVATIVE WORKS FOR ANY PURPOSE. IT IS PROVIDED "AS IS" +WITHOUT EXPRESS OR IMPLIED WARRANTY, INCLUDING BUT NOT LIMITED TO THE +MERCHANTABILITY, USE OR FITNESS FOR ANY PARTICULAR PURPOSE AND ANY +WARRANTY AGAINST INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS. +LICENSOR(S) SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY THE USERS +OF THE SOFTWARE OR DERIVATIVE WORKS. + +Any Licensee wishing to make commercial use of the Software or +Derivative Works should contact each and every Licensor to negotiate +an appropriate license for such commercial use, and written permission +of all Licensors will be required for such a commercial license. +Commercial use includes (1) integration of all or part of the source +code into a product for sale by or on behalf of Licensee to third +parties, or (2) distribution of the Software or Derivative Works to +third parties that need it to utilize a commercial product sold or +licensed by or on behalf of Licensee. + +By using or copying this Contributed Code, Licensee agrees to abide by +the copyright law and all other applicable laws of the U.S., and the +terms of this License Agreement. Any individual Licensor shall have +the right to terminate this license immediately by written notice upon +Licensee's breach of, or non-compliance with, any of its terms. +Licensee may be held legally responsible for any copyright +infringement that is caused or encouraged by Licensee's failure to +abide by the terms of this License Agreement. + +******************************************************************************/ + +/* The Matrix Multiply computation. + + Creates and multiplies two matrices and sums up all the elements + of the resulting matrices. + + October 31, 1995 + Shail Aditya. +*/ + +/* Modified by: Rodric M. Rabbah 06-03-04 */ + +#include +#include + +#define SIZE 1024 + +float a[SIZE][SIZE], b[SIZE][SIZE]; +float c[SIZE][SIZE] = {0}; + +int NUM, BLOCK; + + + +/* Use Linear congruential PRNG */ +int my_rand_r(int *seedp) +{ + /* Knuth & Lewis */ + unsigned x = *seedp * 1664525 + 1013904223; + *seedp = x; + return (x >> 16) & 0x7fff; +} + + +void init() { + int i,j; + int random_seed = 1; + for (i=0 ; i < SIZE ; i++) { + for (j=0 ; j < SIZE; j++) { + a[i][j] = (my_rand_r(&random_seed) >> j-i) & 0xF; + b[i][j] = (my_rand_r(&random_seed) << i+j) & 0xF; + } + } +} + +void mm_inner(int I, int J, int K) +{ + int i,j,k; + + for (i=I ; i < I+BLOCK ; i++) + for (j=J ; j < J+BLOCK ; j++) + for (k=K ; k < K+BLOCK ; k++) + c[i][j] += a[i][k]*b[k][j]; +} + +void matmult() { + int i,j,k; + float s1; + + for (i=0 ; i < NUM ; i += BLOCK) + for (j=0 ; j < NUM ; j += BLOCK) + for (k=0; k < NUM ; k += BLOCK) { + mm_inner(i,j,k); + //printf("ACC:blocks a(%d,%d)*b(%d,%d), c[%d][%d] = %f\n", + // i,k,k,j,i,j,c[i][j]); + } +} + +float mm_sum(int I, int J) +{ + int i,j; + float s = 0.0; + + for (i=I ; i < I+BLOCK ; i++) + for (j=J ; j < J+BLOCK ; j++) + s += c[i][j]; + return (s); +} + +float sumup() +{ + int i,j; + float s = 0.0; + + for (i=0 ; i < NUM ; i += BLOCK) + for (j=0 ; j < NUM ; j += BLOCK) { + s += mm_sum(i,j); + //printf("SUM:block c(%d,%d) = %f\n",i,j,s); + } + return s; +} + +int main (int argc, char* argv[]) +{ + int i,j,k; + float s; + + if (argc != 3) { + printf("Usage: bmm \n"); + exit(1); + } + NUM = atoi(argv[1]); + BLOCK = atoi(argv[2]); + + if (((unsigned) NUM > 1024) | ((unsigned) BLOCK > (unsigned) NUM)) { + printf("size must be in [0, 1024]; block must be <= than size\n"); + exit(1); + } + + init(); + + /*** VERSABENCH START ***/ + + matmult(); + + /*** VERSABENCH END ***/ + s = sumup(); + printf("final sum = %f\n", s); + exit(0); +} + From sabre at nondot.org Mon Jan 28 00:14:28 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 06:14:28 -0000 Subject: [llvm-commits] [test-suite] r46439 - in /test-suite/trunk/MultiSource/Benchmarks: Makefile VersaBench/Makefile VersaBench/README.txt Message-ID: <200801280614.m0S6ESTG006075@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 00:14:28 2008 New Revision: 46439 URL: http://llvm.org/viewvc/llvm-project?rev=46439&view=rev Log: run versabench by default Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Makefile?rev=46439&r1=46438&r2=46439&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/Makefile Mon Jan 28 00:14:28 2008 @@ -4,6 +4,6 @@ PARALLEL_DIRS := Fhourstones Fhourstones-3.1 \ McCat Olden OptimizerEval Ptrdist llubenchmark \ sim FreeBench MallocBench Prolangs-C Prolangs-C++ SciMark2-C\ - mediabench ASCI_Purple MiBench tramp3d-v4 + mediabench ASCI_Purple MiBench VersaBench tramp3d-v4 include $(LEVEL)/Makefile.programs Added: test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile?rev=46439&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/Makefile Mon Jan 28 00:14:28 2008 @@ -0,0 +1,6 @@ +# MultiSource/VersaBench Makefile: Build all subdirectories automatically + +LEVEL = ../../.. +PARALLEL_DIRS = 8b10b beamformer bmm dbms ecbdes + +include $(LEVEL)/Makefile.programs Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt?rev=46439&r1=46438&r2=46439&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt (original) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/README.txt Mon Jan 28 00:14:28 2008 @@ -1,2 +1,5 @@ Obtained from: http://cag.csail.mit.edu/versabench/benchmarks.html + +This contains a subset of the programs and some are hacked to run +long enough. From sabre at nondot.org Mon Jan 28 00:27:01 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 06:27:01 -0000 Subject: [llvm-commits] [test-suite] r46440 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran: ./ enc-3des/ enc-3des/Makefile enc-3des/des.c enc-3des/des.h Message-ID: <200801280627.m0S6R1Zc006397@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 00:27:00 2008 New Revision: 46440 URL: http://llvm.org/viewvc/llvm-project?rev=46440&view=rev Log: Add a benchmark from the trimaran collection Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile?rev=46440&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/Makefile Mon Jan 28 00:27:00 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-3des +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 200 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 10 +else +RUN_OPTIONS = 100 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c?rev=46440&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.c Mon Jan 28 00:27:00 2008 @@ -0,0 +1,606 @@ +/* + * FIPS-46-3 compliant 3DES implementation + * + * Copyright (C) 2001-2003 Christophe Devine + * + * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "des.h" + +/* the eight DES S-boxes */ + +uint32 SB1[64] = +{ + 0x01010400, 0x00000000, 0x00010000, 0x01010404, + 0x01010004, 0x00010404, 0x00000004, 0x00010000, + 0x00000400, 0x01010400, 0x01010404, 0x00000400, + 0x01000404, 0x01010004, 0x01000000, 0x00000004, + 0x00000404, 0x01000400, 0x01000400, 0x00010400, + 0x00010400, 0x01010000, 0x01010000, 0x01000404, + 0x00010004, 0x01000004, 0x01000004, 0x00010004, + 0x00000000, 0x00000404, 0x00010404, 0x01000000, + 0x00010000, 0x01010404, 0x00000004, 0x01010000, + 0x01010400, 0x01000000, 0x01000000, 0x00000400, + 0x01010004, 0x00010000, 0x00010400, 0x01000004, + 0x00000400, 0x00000004, 0x01000404, 0x00010404, + 0x01010404, 0x00010004, 0x01010000, 0x01000404, + 0x01000004, 0x00000404, 0x00010404, 0x01010400, + 0x00000404, 0x01000400, 0x01000400, 0x00000000, + 0x00010004, 0x00010400, 0x00000000, 0x01010004 +}; + +static uint32 SB2[64] = +{ + 0x80108020, 0x80008000, 0x00008000, 0x00108020, + 0x00100000, 0x00000020, 0x80100020, 0x80008020, + 0x80000020, 0x80108020, 0x80108000, 0x80000000, + 0x80008000, 0x00100000, 0x00000020, 0x80100020, + 0x00108000, 0x00100020, 0x80008020, 0x00000000, + 0x80000000, 0x00008000, 0x00108020, 0x80100000, + 0x00100020, 0x80000020, 0x00000000, 0x00108000, + 0x00008020, 0x80108000, 0x80100000, 0x00008020, + 0x00000000, 0x00108020, 0x80100020, 0x00100000, + 0x80008020, 0x80100000, 0x80108000, 0x00008000, + 0x80100000, 0x80008000, 0x00000020, 0x80108020, + 0x00108020, 0x00000020, 0x00008000, 0x80000000, + 0x00008020, 0x80108000, 0x00100000, 0x80000020, + 0x00100020, 0x80008020, 0x80000020, 0x00100020, + 0x00108000, 0x00000000, 0x80008000, 0x00008020, + 0x80000000, 0x80100020, 0x80108020, 0x00108000 +}; + +static uint32 SB3[64] = +{ + 0x00000208, 0x08020200, 0x00000000, 0x08020008, + 0x08000200, 0x00000000, 0x00020208, 0x08000200, + 0x00020008, 0x08000008, 0x08000008, 0x00020000, + 0x08020208, 0x00020008, 0x08020000, 0x00000208, + 0x08000000, 0x00000008, 0x08020200, 0x00000200, + 0x00020200, 0x08020000, 0x08020008, 0x00020208, + 0x08000208, 0x00020200, 0x00020000, 0x08000208, + 0x00000008, 0x08020208, 0x00000200, 0x08000000, + 0x08020200, 0x08000000, 0x00020008, 0x00000208, + 0x00020000, 0x08020200, 0x08000200, 0x00000000, + 0x00000200, 0x00020008, 0x08020208, 0x08000200, + 0x08000008, 0x00000200, 0x00000000, 0x08020008, + 0x08000208, 0x00020000, 0x08000000, 0x08020208, + 0x00000008, 0x00020208, 0x00020200, 0x08000008, + 0x08020000, 0x08000208, 0x00000208, 0x08020000, + 0x00020208, 0x00000008, 0x08020008, 0x00020200 +}; + +static uint32 SB4[64] = +{ + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802080, 0x00800081, 0x00800001, 0x00002001, + 0x00000000, 0x00802000, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00800080, 0x00800001, + 0x00000001, 0x00002000, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002001, 0x00002080, + 0x00800081, 0x00000001, 0x00002080, 0x00800080, + 0x00002000, 0x00802080, 0x00802081, 0x00000081, + 0x00800080, 0x00800001, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00000000, 0x00802000, + 0x00002080, 0x00800080, 0x00800081, 0x00000001, + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802081, 0x00000081, 0x00000001, 0x00002000, + 0x00800001, 0x00002001, 0x00802080, 0x00800081, + 0x00002001, 0x00002080, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002000, 0x00802080 +}; + +static uint32 SB5[64] = +{ + 0x00000100, 0x02080100, 0x02080000, 0x42000100, + 0x00080000, 0x00000100, 0x40000000, 0x02080000, + 0x40080100, 0x00080000, 0x02000100, 0x40080100, + 0x42000100, 0x42080000, 0x00080100, 0x40000000, + 0x02000000, 0x40080000, 0x40080000, 0x00000000, + 0x40000100, 0x42080100, 0x42080100, 0x02000100, + 0x42080000, 0x40000100, 0x00000000, 0x42000000, + 0x02080100, 0x02000000, 0x42000000, 0x00080100, + 0x00080000, 0x42000100, 0x00000100, 0x02000000, + 0x40000000, 0x02080000, 0x42000100, 0x40080100, + 0x02000100, 0x40000000, 0x42080000, 0x02080100, + 0x40080100, 0x00000100, 0x02000000, 0x42080000, + 0x42080100, 0x00080100, 0x42000000, 0x42080100, + 0x02080000, 0x00000000, 0x40080000, 0x42000000, + 0x00080100, 0x02000100, 0x40000100, 0x00080000, + 0x00000000, 0x40080000, 0x02080100, 0x40000100 +}; + +static uint32 SB6[64] = +{ + 0x20000010, 0x20400000, 0x00004000, 0x20404010, + 0x20400000, 0x00000010, 0x20404010, 0x00400000, + 0x20004000, 0x00404010, 0x00400000, 0x20000010, + 0x00400010, 0x20004000, 0x20000000, 0x00004010, + 0x00000000, 0x00400010, 0x20004010, 0x00004000, + 0x00404000, 0x20004010, 0x00000010, 0x20400010, + 0x20400010, 0x00000000, 0x00404010, 0x20404000, + 0x00004010, 0x00404000, 0x20404000, 0x20000000, + 0x20004000, 0x00000010, 0x20400010, 0x00404000, + 0x20404010, 0x00400000, 0x00004010, 0x20000010, + 0x00400000, 0x20004000, 0x20000000, 0x00004010, + 0x20000010, 0x20404010, 0x00404000, 0x20400000, + 0x00404010, 0x20404000, 0x00000000, 0x20400010, + 0x00000010, 0x00004000, 0x20400000, 0x00404010, + 0x00004000, 0x00400010, 0x20004010, 0x00000000, + 0x20404000, 0x20000000, 0x00400010, 0x20004010 +}; + +static uint32 SB7[64] = +{ + 0x00200000, 0x04200002, 0x04000802, 0x00000000, + 0x00000800, 0x04000802, 0x00200802, 0x04200800, + 0x04200802, 0x00200000, 0x00000000, 0x04000002, + 0x00000002, 0x04000000, 0x04200002, 0x00000802, + 0x04000800, 0x00200802, 0x00200002, 0x04000800, + 0x04000002, 0x04200000, 0x04200800, 0x00200002, + 0x04200000, 0x00000800, 0x00000802, 0x04200802, + 0x00200800, 0x00000002, 0x04000000, 0x00200800, + 0x04000000, 0x00200800, 0x00200000, 0x04000802, + 0x04000802, 0x04200002, 0x04200002, 0x00000002, + 0x00200002, 0x04000000, 0x04000800, 0x00200000, + 0x04200800, 0x00000802, 0x00200802, 0x04200800, + 0x00000802, 0x04000002, 0x04200802, 0x04200000, + 0x00200800, 0x00000000, 0x00000002, 0x04200802, + 0x00000000, 0x00200802, 0x04200000, 0x00000800, + 0x04000002, 0x04000800, 0x00000800, 0x00200002 +}; + +static uint32 SB8[64] = +{ + 0x10001040, 0x00001000, 0x00040000, 0x10041040, + 0x10000000, 0x10001040, 0x00000040, 0x10000000, + 0x00040040, 0x10040000, 0x10041040, 0x00041000, + 0x10041000, 0x00041040, 0x00001000, 0x00000040, + 0x10040000, 0x10000040, 0x10001000, 0x00001040, + 0x00041000, 0x00040040, 0x10040040, 0x10041000, + 0x00001040, 0x00000000, 0x00000000, 0x10040040, + 0x10000040, 0x10001000, 0x00041040, 0x00040000, + 0x00041040, 0x00040000, 0x10041000, 0x00001000, + 0x00000040, 0x10040040, 0x00001000, 0x00041040, + 0x10001000, 0x00000040, 0x10000040, 0x10040000, + 0x10040040, 0x10000000, 0x00040000, 0x10001040, + 0x00000000, 0x10041040, 0x00040040, 0x10000040, + 0x10040000, 0x10001000, 0x10001040, 0x00000000, + 0x10041040, 0x00041000, 0x00041000, 0x00001040, + 0x00001040, 0x00040040, 0x10000000, 0x10041000 +}; + +/* PC1: left and right halves bit-swap */ + +static uint32 LHs[16] = +{ + 0x00000000, 0x00000001, 0x00000100, 0x00000101, + 0x00010000, 0x00010001, 0x00010100, 0x00010101, + 0x01000000, 0x01000001, 0x01000100, 0x01000101, + 0x01010000, 0x01010001, 0x01010100, 0x01010101 +}; + +static uint32 RHs[16] = +{ + 0x00000000, 0x01000000, 0x00010000, 0x01010000, + 0x00000100, 0x01000100, 0x00010100, 0x01010100, + 0x00000001, 0x01000001, 0x00010001, 0x01010001, + 0x00000101, 0x01000101, 0x00010101, 0x01010101, +}; + +/* platform-independant 32-bit integer manipulation macros */ + +#define GET_UINT32(n,b,i) \ +{ \ + (n) = ( (uint32) (b)[(i) ] << 24 ) \ + | ( (uint32) (b)[(i) + 1] << 16 ) \ + | ( (uint32) (b)[(i) + 2] << 8 ) \ + | ( (uint32) (b)[(i) + 3] ); \ +} + +#define PUT_UINT32(n,b,i) \ +{ \ + (b)[(i) ] = (uint8) ( (n) >> 24 ); \ + (b)[(i) + 1] = (uint8) ( (n) >> 16 ); \ + (b)[(i) + 2] = (uint8) ( (n) >> 8 ); \ + (b)[(i) + 3] = (uint8) ( (n) ); \ +} + +/* Initial Permutation macro */ + +#define DES_IP(X,Y) \ +{ \ + T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ + T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ + T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ + T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ + Y = ((Y << 1) | (Y >> 31)) & 0xFFFFFFFF; \ + T = (X ^ Y) & 0xAAAAAAAA; Y ^= T; X ^= T; \ + X = ((X << 1) | (X >> 31)) & 0xFFFFFFFF; \ +} + +/* Final Permutation macro */ + +#define DES_FP(X,Y) \ +{ \ + X = ((X << 31) | (X >> 1)) & 0xFFFFFFFF; \ + T = (X ^ Y) & 0xAAAAAAAA; X ^= T; Y ^= T; \ + Y = ((Y << 31) | (Y >> 1)) & 0xFFFFFFFF; \ + T = ((Y >> 8) ^ X) & 0x00FF00FF; X ^= T; Y ^= (T << 8); \ + T = ((Y >> 2) ^ X) & 0x33333333; X ^= T; Y ^= (T << 2); \ + T = ((X >> 16) ^ Y) & 0x0000FFFF; Y ^= T; X ^= (T << 16); \ + T = ((X >> 4) ^ Y) & 0x0F0F0F0F; Y ^= T; X ^= (T << 4); \ +} + +/* DES round macro */ + +#define DES_ROUND(X,Y) \ +{ \ + T = *SK++ ^ X; \ + Y ^= SB8[ (T ) & 0x3F ] ^ \ + SB6[ (T >> 8) & 0x3F ] ^ \ + SB4[ (T >> 16) & 0x3F ] ^ \ + SB2[ (T >> 24) & 0x3F ]; \ + \ + T = *SK++ ^ ((X << 28) | (X >> 4)); \ + Y ^= SB7[ (T ) & 0x3F ] ^ \ + SB5[ (T >> 8) & 0x3F ] ^ \ + SB3[ (T >> 16) & 0x3F ] ^ \ + SB1[ (T >> 24) & 0x3F ]; \ +} + +/* DES key schedule */ + +int des_main_ks( uint32 SK[32], uint8 key[8] ) +{ + int i; + uint32 X, Y, T; + + GET_UINT32( X, key, 0 ); + GET_UINT32( Y, key, 4 ); + + /* Permuted Choice 1 */ + + T = ((Y >> 4) ^ X) & 0x0F0F0F0F; X ^= T; Y ^= (T << 4); + T = ((Y ) ^ X) & 0x10101010; X ^= T; Y ^= (T ); + + X = (LHs[ (X ) & 0xF] << 3) | (LHs[ (X >> 8) & 0xF ] << 2) + | (LHs[ (X >> 16) & 0xF] << 1) | (LHs[ (X >> 24) & 0xF ] ) + | (LHs[ (X >> 5) & 0xF] << 7) | (LHs[ (X >> 13) & 0xF ] << 6) + | (LHs[ (X >> 21) & 0xF] << 5) | (LHs[ (X >> 29) & 0xF ] << 4); + + Y = (RHs[ (Y >> 1) & 0xF] << 3) | (RHs[ (Y >> 9) & 0xF ] << 2) + | (RHs[ (Y >> 17) & 0xF] << 1) | (RHs[ (Y >> 25) & 0xF ] ) + | (RHs[ (Y >> 4) & 0xF] << 7) | (RHs[ (Y >> 12) & 0xF ] << 6) + | (RHs[ (Y >> 20) & 0xF] << 5) | (RHs[ (Y >> 28) & 0xF ] << 4); + + X &= 0x0FFFFFFF; + Y &= 0x0FFFFFFF; + + /* calculate subkeys */ + + for( i = 0; i < 16; i++ ) + { + if( i < 2 || i == 8 || i == 15 ) + { + X = ((X << 1) | (X >> 27)) & 0x0FFFFFFF; + Y = ((Y << 1) | (Y >> 27)) & 0x0FFFFFFF; + } + else + { + X = ((X << 2) | (X >> 26)) & 0x0FFFFFFF; + Y = ((Y << 2) | (Y >> 26)) & 0x0FFFFFFF; + } + + *SK++ = ((X << 4) & 0x24000000) | ((X << 28) & 0x10000000) + | ((X << 14) & 0x08000000) | ((X << 18) & 0x02080000) + | ((X << 6) & 0x01000000) | ((X << 9) & 0x00200000) + | ((X >> 1) & 0x00100000) | ((X << 10) & 0x00040000) + | ((X << 2) & 0x00020000) | ((X >> 10) & 0x00010000) + | ((Y >> 13) & 0x00002000) | ((Y >> 4) & 0x00001000) + | ((Y << 6) & 0x00000800) | ((Y >> 1) & 0x00000400) + | ((Y >> 14) & 0x00000200) | ((Y ) & 0x00000100) + | ((Y >> 5) & 0x00000020) | ((Y >> 10) & 0x00000010) + | ((Y >> 3) & 0x00000008) | ((Y >> 18) & 0x00000004) + | ((Y >> 26) & 0x00000002) | ((Y >> 24) & 0x00000001); + + *SK++ = ((X << 15) & 0x20000000) | ((X << 17) & 0x10000000) + | ((X << 10) & 0x08000000) | ((X << 22) & 0x04000000) + | ((X >> 2) & 0x02000000) | ((X << 1) & 0x01000000) + | ((X << 16) & 0x00200000) | ((X << 11) & 0x00100000) + | ((X << 3) & 0x00080000) | ((X >> 6) & 0x00040000) + | ((X << 15) & 0x00020000) | ((X >> 4) & 0x00010000) + | ((Y >> 2) & 0x00002000) | ((Y << 8) & 0x00001000) + | ((Y >> 14) & 0x00000808) | ((Y >> 9) & 0x00000400) + | ((Y ) & 0x00000200) | ((Y << 7) & 0x00000100) + | ((Y >> 7) & 0x00000020) | ((Y >> 3) & 0x00000011) + | ((Y << 2) & 0x00000004) | ((Y >> 21) & 0x00000002); + } + + return( 0 ); +} + +int des_set_key( des_context *ctx, uint8 key[8] ) +{ + int i; + + /* setup encryption subkeys */ + + des_main_ks( ctx->esk, key ); + + /* setup decryption subkeys */ + + for( i = 0; i < 32; i += 2 ) + { + ctx->dsk[i ] = ctx->esk[30 - i]; + ctx->dsk[i + 1] = ctx->esk[31 - i]; + } + + return( 0 ); +} + +/* DES 64-bit block encryption/decryption */ + +void des_crypt( uint32 SK[32], uint8 input[8], uint8 output[8] ) +{ + uint32 X, Y, T; + + GET_UINT32( X, input, 0 ); + GET_UINT32( Y, input, 4 ); + + DES_IP( X, Y ); + + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + + DES_FP( Y, X ); + + PUT_UINT32( Y, output, 0 ); + PUT_UINT32( X, output, 4 ); +} + +void des_encrypt( des_context *ctx, uint8 input[8], uint8 output[8] ) +{ + des_crypt( ctx->esk, input, output ); +} + +void des_decrypt( des_context *ctx, uint8 input[8], uint8 output[8] ) +{ + des_crypt( ctx->dsk, input, output ); +} + +/* Triple-DES key schedule */ + +int des3_set_2keys( des3_context *ctx, uint8 key1[8], uint8 key2[8] ) +{ + int i; + + des_main_ks( ctx->esk , key1 ); + des_main_ks( ctx->dsk + 32, key2 ); + + for( i = 0; i < 32; i += 2 ) + { + ctx->dsk[i ] = ctx->esk[30 - i]; + ctx->dsk[i + 1] = ctx->esk[31 - i]; + + ctx->esk[i + 32] = ctx->dsk[62 - i]; + ctx->esk[i + 33] = ctx->dsk[63 - i]; + + ctx->esk[i + 64] = ctx->esk[ i]; + ctx->esk[i + 65] = ctx->esk[ 1 + i]; + + ctx->dsk[i + 64] = ctx->dsk[ i]; + ctx->dsk[i + 65] = ctx->dsk[ 1 + i]; + } + + return( 0 ); +} + +int des3_set_3keys( des3_context *ctx, uint8 key1[8], uint8 key2[8], + uint8 key3[8] ) +{ + int i; + + des_main_ks( ctx->esk , key1 ); + des_main_ks( ctx->dsk + 32, key2 ); + des_main_ks( ctx->esk + 64, key3 ); + + for( i = 0; i < 32; i += 2 ) + { + ctx->dsk[i ] = ctx->esk[94 - i]; + ctx->dsk[i + 1] = ctx->esk[95 - i]; + + ctx->esk[i + 32] = ctx->dsk[62 - i]; + ctx->esk[i + 33] = ctx->dsk[63 - i]; + + ctx->dsk[i + 64] = ctx->esk[30 - i]; + ctx->dsk[i + 65] = ctx->esk[31 - i]; + } + + return( 0 ); +} + +/* Triple-DES 64-bit block encryption/decryption */ + +void des3_crypt( uint32 SK[96], uint8 input[8], uint8 output[8] ) +{ + uint32 X, Y, T; + + GET_UINT32( X, input, 0 ); + GET_UINT32( Y, input, 4 ); + + DES_IP( X, Y ); + + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + DES_ROUND( X, Y ); DES_ROUND( Y, X ); + + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + DES_ROUND( Y, X ); DES_ROUND( X, Y ); + + DES_FP( Y, X ); + + PUT_UINT32( Y, output, 0 ); + PUT_UINT32( X, output, 4 ); +} + +void des3_encrypt( des3_context *ctx, uint8 input[8], uint8 output[8] ) +{ + des3_crypt( ctx->esk, input, output ); +} + +void des3_decrypt( des3_context *ctx, uint8 input[8], uint8 output[8] ) +{ + des3_crypt( ctx->dsk, input, output ); +} + + +#include +#include + +/* + * Triple-DES Monte Carlo Test: ECB mode + * source: NIST - tripledes-vectors.zip + */ + +static unsigned char DES3_keys[3][8] = +{ + { 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF }, + { 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01 }, + { 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23 } +}; + +static unsigned char DES3_init[8] = +{ + 0x4E, 0x6F, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74 +}; + +static unsigned char DES3_enc_test[3][8] = +{ + { 0x6A, 0x2A, 0x19, 0xF4, 0x1E, 0xCA, 0x85, 0x4B }, + { 0x03, 0xE6, 0x9F, 0x5B, 0xFA, 0x58, 0xEB, 0x42 }, + { 0xDD, 0x17, 0xE8, 0xB8, 0xB4, 0x37, 0xD2, 0x32 } +}; + +static unsigned char DES3_dec_test[3][8] = +{ + { 0xCD, 0xD6, 0x4F, 0x2F, 0x94, 0x27, 0xC1, 0x5D }, + { 0x69, 0x96, 0xC8, 0xFA, 0x47, 0xA2, 0xAB, 0xEB }, + { 0x83, 0x25, 0x39, 0x76, 0x44, 0x09, 0x1A, 0x0A } +}; + +int main( int argc, char**argv ) +{ + int m, n, i; + des_context ctx; + des3_context ctx3; + unsigned char buf[8]; + int delay; + int NumDelay = 100; + if (argc == 2) NumDelay = atoi(argv[1]); + + for( m = 0; m < 2; m++ ) + { + printf( "\n Triple-DES Monte Carlo Test (ECB mode) - " ); + + if( m == 0 ) printf( "encryption\n\n" ); + if( m == 1 ) printf( "decryption\n\n" ); + + for( n = 0; n < 3; n++ ) + { + printf( " Test %d, key size = %3d bits: ", + n + 1, 64 + n * 64 ); + + fflush( stdout ); + + for (delay = 0; delay < NumDelay; ++delay) { + + memcpy( buf, DES3_init, 8 ); + + switch( n ) + { + case 0: + des_set_key( &ctx, DES3_keys[0] ); + break; + + case 1: + des3_set_2keys( &ctx3, DES3_keys[0], + DES3_keys[1] ); + break; + + case 2: + des3_set_3keys( &ctx3, DES3_keys[0], + DES3_keys[1], + DES3_keys[2] ); + break; + } + + for( i = 0; i < 10000; i++ ) + { + if( n == 0 ) + { + if( m == 0 ) des_encrypt( &ctx, buf, buf ); + if( m == 1 ) des_decrypt( &ctx, buf, buf ); + } + else + { + if( m == 0 ) des3_encrypt( &ctx3, buf, buf ); + if( m == 1 ) des3_decrypt( &ctx3, buf, buf ); + } + } + + if( ( m == 0 && memcmp( buf, DES3_enc_test[n], 8 ) ) || + ( m == 1 && memcmp( buf, DES3_dec_test[n], 8 ) ) ) + { + printf( "failed!\n" ); + return( 1 ); + } + } + + printf( "passed.\n" ); + } + } + + printf( "\n" ); + + return( 0 ); +} + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.h?rev=46440&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-3des/des.h Mon Jan 28 00:27:00 2008 @@ -0,0 +1,37 @@ +#ifndef _DES_H +#define _DES_H + +#ifndef uint8 +#define uint8 unsigned char +#endif + +#ifndef uint32 +#define uint32 unsigned long int +#endif + +typedef struct +{ + uint32 esk[32]; /* DES encryption subkeys */ + uint32 dsk[32]; /* DES decryption subkeys */ +} +des_context; + +typedef struct +{ + uint32 esk[96]; /* Triple-DES encryption subkeys */ + uint32 dsk[96]; /* Triple-DES decryption subkeys */ +} +des3_context; + +int des_set_key( des_context *ctx, uint8 key[8] ); +void des_encrypt( des_context *ctx, uint8 input[8], uint8 output[8] ); +void des_decrypt( des_context *ctx, uint8 input[8], uint8 output[8] ); + +int des3_set_2keys( des3_context *ctx, uint8 key1[8], uint8 key2[8] ); +int des3_set_3keys( des3_context *ctx, uint8 key1[8], uint8 key2[8], + uint8 key3[8] ); + +void des3_encrypt( des3_context *ctx, uint8 input[8], uint8 output[8] ); +void des3_decrypt( des3_context *ctx, uint8 input[8], uint8 output[8] ); + +#endif /* des.h */ From sabre at nondot.org Mon Jan 28 00:36:11 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 06:36:11 -0000 Subject: [llvm-commits] [test-suite] r46441 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5: ./ Makefile md5.c md5.h Message-ID: <200801280636.m0S6aB3T006648@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 00:36:10 2008 New Revision: 46441 URL: http://llvm.org/viewvc/llvm-project?rev=46441&view=rev Log: add an adapted version of md5 Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile?rev=46441&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/Makefile Mon Jan 28 00:36:10 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-md5 +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 50 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 1 +else +RUN_OPTIONS = 10 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c?rev=46441&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.c Mon Jan 28 00:36:10 2008 @@ -0,0 +1,293 @@ +/* + * RFC 1321 compliant MD5 implementation + * + * Copyright (C) 2001-2003 Christophe Devine + * + * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#include "md5.h" + +#define GET_UINT32(n,b,i) \ +{ \ + (n) = ( (uint32) (b)[(i) ] ) \ + | ( (uint32) (b)[(i) + 1] << 8 ) \ + | ( (uint32) (b)[(i) + 2] << 16 ) \ + | ( (uint32) (b)[(i) + 3] << 24 ); \ +} + +#define PUT_UINT32(n,b,i) \ +{ \ + (b)[(i) ] = (uint8) ( (n) ); \ + (b)[(i) + 1] = (uint8) ( (n) >> 8 ); \ + (b)[(i) + 2] = (uint8) ( (n) >> 16 ); \ + (b)[(i) + 3] = (uint8) ( (n) >> 24 ); \ +} + +void md5_starts( md5_context *ctx ) +{ + ctx->total[0] = 0; + ctx->total[1] = 0; + + ctx->state[0] = 0x67452301; + ctx->state[1] = 0xEFCDAB89; + ctx->state[2] = 0x98BADCFE; + ctx->state[3] = 0x10325476; +} + +void md5_process( md5_context *ctx, uint8 data[64] ) +{ + uint32 X[16], A, B, C, D; + + GET_UINT32( X[0], data, 0 ); + GET_UINT32( X[1], data, 4 ); + GET_UINT32( X[2], data, 8 ); + GET_UINT32( X[3], data, 12 ); + GET_UINT32( X[4], data, 16 ); + GET_UINT32( X[5], data, 20 ); + GET_UINT32( X[6], data, 24 ); + GET_UINT32( X[7], data, 28 ); + GET_UINT32( X[8], data, 32 ); + GET_UINT32( X[9], data, 36 ); + GET_UINT32( X[10], data, 40 ); + GET_UINT32( X[11], data, 44 ); + GET_UINT32( X[12], data, 48 ); + GET_UINT32( X[13], data, 52 ); + GET_UINT32( X[14], data, 56 ); + GET_UINT32( X[15], data, 60 ); + +#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) + +#define P(a,b,c,d,k,s,t) \ +{ \ + a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ +} + + A = ctx->state[0]; + B = ctx->state[1]; + C = ctx->state[2]; + D = ctx->state[3]; + +#define F(x,y,z) (z ^ (x & (y ^ z))) + + P( A, B, C, D, 0, 7, 0xD76AA478 ); + P( D, A, B, C, 1, 12, 0xE8C7B756 ); + P( C, D, A, B, 2, 17, 0x242070DB ); + P( B, C, D, A, 3, 22, 0xC1BDCEEE ); + P( A, B, C, D, 4, 7, 0xF57C0FAF ); + P( D, A, B, C, 5, 12, 0x4787C62A ); + P( C, D, A, B, 6, 17, 0xA8304613 ); + P( B, C, D, A, 7, 22, 0xFD469501 ); + P( A, B, C, D, 8, 7, 0x698098D8 ); + P( D, A, B, C, 9, 12, 0x8B44F7AF ); + P( C, D, A, B, 10, 17, 0xFFFF5BB1 ); + P( B, C, D, A, 11, 22, 0x895CD7BE ); + P( A, B, C, D, 12, 7, 0x6B901122 ); + P( D, A, B, C, 13, 12, 0xFD987193 ); + P( C, D, A, B, 14, 17, 0xA679438E ); + P( B, C, D, A, 15, 22, 0x49B40821 ); + +#undef F + +#define F(x,y,z) (y ^ (z & (x ^ y))) + + P( A, B, C, D, 1, 5, 0xF61E2562 ); + P( D, A, B, C, 6, 9, 0xC040B340 ); + P( C, D, A, B, 11, 14, 0x265E5A51 ); + P( B, C, D, A, 0, 20, 0xE9B6C7AA ); + P( A, B, C, D, 5, 5, 0xD62F105D ); + P( D, A, B, C, 10, 9, 0x02441453 ); + P( C, D, A, B, 15, 14, 0xD8A1E681 ); + P( B, C, D, A, 4, 20, 0xE7D3FBC8 ); + P( A, B, C, D, 9, 5, 0x21E1CDE6 ); + P( D, A, B, C, 14, 9, 0xC33707D6 ); + P( C, D, A, B, 3, 14, 0xF4D50D87 ); + P( B, C, D, A, 8, 20, 0x455A14ED ); + P( A, B, C, D, 13, 5, 0xA9E3E905 ); + P( D, A, B, C, 2, 9, 0xFCEFA3F8 ); + P( C, D, A, B, 7, 14, 0x676F02D9 ); + P( B, C, D, A, 12, 20, 0x8D2A4C8A ); + +#undef F + +#define F(x,y,z) (x ^ y ^ z) + + P( A, B, C, D, 5, 4, 0xFFFA3942 ); + P( D, A, B, C, 8, 11, 0x8771F681 ); + P( C, D, A, B, 11, 16, 0x6D9D6122 ); + P( B, C, D, A, 14, 23, 0xFDE5380C ); + P( A, B, C, D, 1, 4, 0xA4BEEA44 ); + P( D, A, B, C, 4, 11, 0x4BDECFA9 ); + P( C, D, A, B, 7, 16, 0xF6BB4B60 ); + P( B, C, D, A, 10, 23, 0xBEBFBC70 ); + P( A, B, C, D, 13, 4, 0x289B7EC6 ); + P( D, A, B, C, 0, 11, 0xEAA127FA ); + P( C, D, A, B, 3, 16, 0xD4EF3085 ); + P( B, C, D, A, 6, 23, 0x04881D05 ); + P( A, B, C, D, 9, 4, 0xD9D4D039 ); + P( D, A, B, C, 12, 11, 0xE6DB99E5 ); + P( C, D, A, B, 15, 16, 0x1FA27CF8 ); + P( B, C, D, A, 2, 23, 0xC4AC5665 ); + +#undef F + +#define F(x,y,z) (y ^ (x | ~z)) + + P( A, B, C, D, 0, 6, 0xF4292244 ); + P( D, A, B, C, 7, 10, 0x432AFF97 ); + P( C, D, A, B, 14, 15, 0xAB9423A7 ); + P( B, C, D, A, 5, 21, 0xFC93A039 ); + P( A, B, C, D, 12, 6, 0x655B59C3 ); + P( D, A, B, C, 3, 10, 0x8F0CCC92 ); + P( C, D, A, B, 10, 15, 0xFFEFF47D ); + P( B, C, D, A, 1, 21, 0x85845DD1 ); + P( A, B, C, D, 8, 6, 0x6FA87E4F ); + P( D, A, B, C, 15, 10, 0xFE2CE6E0 ); + P( C, D, A, B, 6, 15, 0xA3014314 ); + P( B, C, D, A, 13, 21, 0x4E0811A1 ); + P( A, B, C, D, 4, 6, 0xF7537E82 ); + P( D, A, B, C, 11, 10, 0xBD3AF235 ); + P( C, D, A, B, 2, 15, 0x2AD7D2BB ); + P( B, C, D, A, 9, 21, 0xEB86D391 ); + +#undef F + + ctx->state[0] += A; + ctx->state[1] += B; + ctx->state[2] += C; + ctx->state[3] += D; +} + +void md5_update( md5_context *ctx, uint8 *input, uint32 length ) +{ + uint32 left, fill; + + if( ! length ) return; + + left = ctx->total[0] & 0x3F; + fill = 64 - left; + + ctx->total[0] += length; + ctx->total[0] &= 0xFFFFFFFF; + + if( ctx->total[0] < length ) + ctx->total[1]++; + + if( left && length >= fill ) + { + memcpy( (void *) (ctx->buffer + left), + (void *) input, fill ); + md5_process( ctx, ctx->buffer ); + length -= fill; + input += fill; + left = 0; + } + + while( length >= 64 ) + { + md5_process( ctx, input ); + length -= 64; + input += 64; + } + + if( length ) + { + memcpy( (void *) (ctx->buffer + left), + (void *) input, length ); + } +} + +static uint8 md5_padding[64] = +{ + 0x80, 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, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +void md5_finish( md5_context *ctx, uint8 digest[16] ) +{ + uint32 last, padn; + uint32 high, low; + uint8 msglen[8]; + + high = ( ctx->total[0] >> 29 ) + | ( ctx->total[1] << 3 ); + low = ( ctx->total[0] << 3 ); + + PUT_UINT32( low, msglen, 0 ); + PUT_UINT32( high, msglen, 4 ); + + last = ctx->total[0] & 0x3F; + padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); + + md5_update( ctx, md5_padding, padn ); + md5_update( ctx, msglen, 8 ); + + PUT_UINT32( ctx->state[0], digest, 0 ); + PUT_UINT32( ctx->state[1], digest, 4 ); + PUT_UINT32( ctx->state[2], digest, 8 ); + PUT_UINT32( ctx->state[3], digest, 12 ); +} + +#include +#include + +/* Use Linear congruential PRNG */ +int my_rand_r(int *seedp) +{ + /* Knuth & Lewis */ + unsigned x = *seedp * 1664525 + 1013904223; + *seedp = x; + return (x >> 16) & 0x7fff; +} + +int main( int argc, char *argv[] ) +{ + FILE *f; + int i, j; + int repeat; + char output[33]; + md5_context ctx; + unsigned char buf[100000]; + unsigned char md5sum[16]; + + // Fill buffer with random, but deterministic data. + int random_seed = 1; + for (i = 0; i < sizeof(buf); ++i) + buf[i] = my_rand_r(&random_seed); + + repeat = 1; + if (argc == 2) repeat = atoi(argv[1]); + + for (; repeat; --repeat) { + md5_starts( &ctx ); + for (i = 0; i < 512; ++i) + md5_update( &ctx, buf+repeat, sizeof( buf )-repeat ); + md5_finish( &ctx, md5sum ); + + for( j = 0; j < 16; j++ ) + { + printf( "%02x", md5sum[j] ); + } + + printf( "\n" ); + } + + return( 0 ); +} + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.h?rev=46441&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-md5/md5.h Mon Jan 28 00:36:10 2008 @@ -0,0 +1,24 @@ +#ifndef _MD5_H +#define _MD5_H + +#ifndef uint8 +#define uint8 unsigned char +#endif + +#ifndef uint32 +#define uint32 unsigned long int +#endif + +typedef struct +{ + uint32 total[2]; + uint32 state[4]; + uint8 buffer[64]; +} +md5_context; + +void md5_starts( md5_context *ctx ); +void md5_update( md5_context *ctx, uint8 *input, uint32 length ); +void md5_finish( md5_context *ctx, uint8 digest[16] ); + +#endif /* md5.h */ From sabre at nondot.org Mon Jan 28 00:52:21 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 06:52:21 -0000 Subject: [llvm-commits] [test-suite] r46442 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1: ./ Makefile pc1cod.c Message-ID: <200801280652.m0S6qLvB007118@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 00:52:21 2008 New Revision: 46442 URL: http://llvm.org/viewvc/llvm-project?rev=46442&view=rev Log: add a really scary benchmark Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile?rev=46442&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/Makefile Mon Jan 28 00:52:21 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-pc1 +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 20000000 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 1000000 +else +RUN_OPTIONS = 5000000 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c?rev=46442&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-pc1/pc1cod.c Mon Jan 28 00:52:21 2008 @@ -0,0 +1,333 @@ + /* File PC1COD.c */ + /* written in Borland Turbo C 2.0 on PC */ + /* PC1 Cipher Algorithm ( Pukall Cipher 1 ) */ + /* By Alexander PUKALL 1991 */ + /* free code no restriction to use */ + /* please include the name of the Author in the final software */ + /* the Key is 256 bits */ + /* Tested with Turbo C 2.0 for DOS and Microsoft Visual C++ 5.0 for Win 32 */ + + /* Note that PC1COD256.c is the encryption routine */ + /* PC1DEC256.c is the decryption routine */ + /* Only the K zone change in the two routines */ + /* You can create a single routine with the two parts in it */ + +#include +#include +unsigned short ax, bx, cx, dx, si, tmp, x1a2, x1a0[16], res, i, +inter, cfc, cfd, compte; + +unsigned char cle[32]; /* les variables sont definies de facon + * globale */ + +unsigned char buff[32]; + +short c; + +int c1, count; + +short d, e; + +FILE * in; + + +assemble() +{ + + + x1a0[0] = (cle[0] * 256) + cle[1]; + + code(); + + inter = res; + + + x1a0[1] = x1a0[0] ^ ((cle[2] * 256) + cle[3]); + + code(); + + inter = inter ^ res; + + + x1a0[2] = x1a0[1] ^ ((cle[4] * 256) + cle[5]); + + code(); + + inter = inter ^ res; + + + x1a0[3] = x1a0[2] ^ ((cle[6] * 256) + cle[7]); + + code(); + + inter = inter ^ res; + + + x1a0[4] = x1a0[3] ^ ((cle[8] * 256) + cle[9]); + + code(); + + inter = inter ^ res; + + + x1a0[5] = x1a0[4] ^ ((cle[10] * 256) + cle[11]); + + code(); + + inter = inter ^ res; + + + x1a0[6] = x1a0[5] ^ ((cle[12] * 256) + cle[13]); + + code(); + + inter = inter ^ res; + + + x1a0[7] = x1a0[6] ^ ((cle[14] * 256) + cle[15]); + + code(); + + inter = inter ^ res; + + + x1a0[8] = x1a0[7] ^ ((cle[16] * 256) + cle[17]); + + code(); + + inter = inter ^ res; + + + x1a0[9] = x1a0[8] ^ ((cle[18] * 256) + cle[19]); + + code(); + + inter = inter ^ res; + + + x1a0[10] = x1a0[9] ^ ((cle[20] * 256) + cle[21]); + + code(); + + inter = inter ^ res; + + + x1a0[11] = x1a0[10] ^ ((cle[22] * 256) + cle[23]); + + code(); + + inter = inter ^ res; + + + x1a0[12] = x1a0[11] ^ ((cle[24] * 256) + cle[25]); + + code(); + + inter = inter ^ res; + + + x1a0[13] = x1a0[12] ^ ((cle[26] * 256) + cle[27]); + + code(); + + inter = inter ^ res; + + + x1a0[14] = x1a0[13] ^ ((cle[28] * 256) + cle[29]); + + code(); + + inter = inter ^ res; + + + x1a0[15] = x1a0[14] ^ ((cle[30] * 256) + cle[31]); + + code(); + + inter = inter ^ res; + + + i = 0; + + return (0); + +} + +code() +{ + + dx = x1a2 + i; + + ax = x1a0[i]; + + cx = 0x015a; + + bx = 0x4e35; + + + tmp = ax; + + ax = si; + + si = tmp; + + + tmp = ax; + + ax = dx; + + dx = tmp; + + + if (ax != 0) + + { + + ax = ax * bx; + + } + + tmp = ax; + + ax = cx; + + cx = tmp; + + + if (ax != 0) + + { + + ax = ax * si; + + cx = ax + cx; + + } + + tmp = ax; + + ax = si; + + si = tmp; + + ax = ax * bx; + + dx = cx + dx; + + + ax = ax + 1; + + + x1a2 = dx; + + x1a0[i] = ax; + + + res = ax ^ dx; + + i = i + 1; + + return (0); + +} + +/* Use Linear congruential PRNG */ +int my_rand_r(int *seedp) +{ + /* Knuth & Lewis */ + unsigned x = *seedp * 1664525 + 1013904223; + *seedp = x; + return (x >> 16) & 0x7fff; +} + +main(int argc, const char **argv) +{ + int NumInput = 20000; + int Print; + int random_seed = 1; + + if (argc == 2) NumInput = atoi(argv[1]); + + si = 0; + + x1a2 = 0; + + i = 0; + + + + /* ('abcdefghijklmnopqrstuvwxyz012345') is the default password used */ + /* if the user enter a key < 32 characters, characters of the default */ + /* password will be used */ + + strcpy(cle, "abcdefghijklmnopqrstuvwxyz012345"); + + + printf("PC1 Cipher 256 bits \nENCRYPT file IN.BIN to OUT.BIN\n"); + + + /* hack so that it doesn't require user input. ntclark 3/12/04 */ + buff[1] = '\0'; + + + if (strlen(buff) > 32) + + { + count = 32; + } + else + + { + count = strlen(buff); + } + + for (c1 = 0; c1 < count; c1++) + + { + + cle[c1] = buff[c1]; + + } + + Print = 0; + while (--NumInput) { + c = my_rand_r(&random_seed);/* c contains the byte read in the file */ + assemble(); + + cfc = inter >> 8; + + cfd = inter & 255; /* cfc^cfd = random byte */ + + + /* K ZONE !!!!!!!!!!!!! */ + /* + * here the mix of c and cle[compte] is before the encryption + * of c + */ + + for (compte = 0; compte <= 31; compte++) + { + + /* we mix the plaintext byte with the key */ + + cle[compte] = cle[compte] ^ c; + + } + + c = c ^ (cfc ^ cfd); + + + + d = (c >> 4); /* we split the 'c' crypted byte into + * two 4 bits parts 'd' and 'e' */ + + e = (c & 15); + + if ((++ Print & 2047) == 0) + printf("%d %d ", d, e); + } + + printf("\n"); + return (0); +} + From sabre at nondot.org Mon Jan 28 00:56:33 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 06:56:33 -0000 Subject: [llvm-commits] [test-suite] r46443 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4: ./ Makefile rc4.c rc4.h Message-ID: <200801280656.m0S6uYgl007242@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 00:56:33 2008 New Revision: 46443 URL: http://llvm.org/viewvc/llvm-project?rev=46443&view=rev Log: add a new benchmark. Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile?rev=46443&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/Makefile Mon Jan 28 00:56:33 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = enc-rc4 +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 1000000 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 2000 +else +RUN_OPTIONS = 200000 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c?rev=46443&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.c Mon Jan 28 00:56:33 2008 @@ -0,0 +1,153 @@ +/* + * An implementation of the ARC4 algorithm + * + * Copyright (C) 2001-2003 Christophe Devine + * + * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "rc4.h" + +void rc4_setup( struct rc4_state *s, unsigned char *key, int length ) +{ + int i, j, k, *m, a; + + s->x = 0; + s->y = 0; + m = s->m; + + for( i = 0; i < 256; i++ ) + { + m[i] = i; + } + + j = k = 0; + + for( i = 0; i < 256; i++ ) + { + a = m[i]; + j = (unsigned char) ( j + a + key[k] ); + m[i] = m[j]; m[j] = a; + if( ++k >= length ) k = 0; + } +} + +void rc4_crypt( struct rc4_state *s, unsigned char *data, int length ) +{ + int i, x, y, *m, a, b; + + x = s->x; + y = s->y; + m = s->m; + + for( i = 0; i < length; i++ ) + { + x = (unsigned char) ( x + 1 ); a = m[x]; + y = (unsigned char) ( y + a ); + m[x] = b = m[y]; + m[y] = a; + data[i] ^= m[(unsigned char) ( a + b )]; + } + + s->x = x; + s->y = y; +} + +#include +#include + +/* + * ARC4 tests vectors from OpenSSL (crypto/rc4/rc4test.c) + */ + +static unsigned char keys[7][30]={ + {8,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}, + {8,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}, + {8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + {4,0xef,0x01,0x23,0x45}, + {8,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}, + {4,0xef,0x01,0x23,0x45}, + }; + +static unsigned char data_len[7]={8,8,8,20,28,10}; +static unsigned char data[7][30]={ + {0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xff}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff}, + {0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0, + 0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0, + 0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0, + 0x12,0x34,0x56,0x78,0xff}, + {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}, + {0}, + }; + +static unsigned char output[7][30]={ + {0x75,0xb7,0x87,0x80,0x99,0xe0,0xc5,0x96,0x00}, + {0x74,0x94,0xc2,0xe7,0x10,0x4b,0x08,0x79,0x00}, + {0xde,0x18,0x89,0x41,0xa3,0x37,0x5d,0x3a,0x00}, + {0xd6,0xa1,0x41,0xa7,0xec,0x3c,0x38,0xdf, + 0xbd,0x61,0x5a,0x11,0x62,0xe1,0xc7,0xba, + 0x36,0xb6,0x78,0x58,0x00}, + {0x66,0xa0,0x94,0x9f,0x8a,0xf7,0xd6,0x89, + 0x1f,0x7f,0x83,0x2b,0xa8,0x33,0xc0,0x0c, + 0x89,0x2e,0xbe,0x30,0x14,0x3c,0xe2,0x87, + 0x40,0x01,0x1e,0xcf,0x00}, + {0xd6,0xa1,0x41,0xa7,0xec,0x3c,0x38,0xdf,0xbd,0x61,0x00}, + {0}, + }; + +int main( int argc, const char **argv ) +{ + int i, j; + struct rc4_state s; + unsigned char buffer[30]; + + int count = 200000; + if (argc == 2) count = atoi(argv[1]); + + printf( "\n RC4 Validation Tests:\n\n" ); + + for( i = 0; i < 6; i++ ) + { + printf( " Test %d ", i + 1 ); + + for( j = 0; j < count; j++ ) + { + + memcpy( buffer, data[i], data_len[i] ); + + rc4_setup( &s, &keys[i][1], keys[i][0] ); + rc4_crypt( &s, buffer, data_len[i] ); + + } + + if( memcmp( buffer, output[i], data_len[i] ) ) + { + printf( "failed!\n" ); + return( 1 ); + } + + printf( "passed.\n" ); + } + + printf( "\n" ); + + return( 0 ); +} + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.h?rev=46443&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/enc-rc4/rc4.h Mon Jan 28 00:56:33 2008 @@ -0,0 +1,12 @@ +#ifndef _RC4_H +#define _RC4_H + +struct rc4_state +{ + int x, y, m[256]; +}; + +void rc4_setup( struct rc4_state *s, unsigned char *key, int length ); +void rc4_crypt( struct rc4_state *s, unsigned char *data, int length ); + +#endif /* rc4.h */ From sabre at nondot.org Mon Jan 28 01:09:41 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 07:09:41 -0000 Subject: [llvm-commits] [test-suite] r46444 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url: ./ Makefile headers.h medium_inputs packet.c packet.h packet_lengths.h search.c search.h url.c url.h utils.c utils.h Message-ID: <200801280709.m0S79gVh007637@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 01:09:41 2008 New Revision: 46444 URL: http://llvm.org/viewvc/llvm-project?rev=46444&view=rev Log: Add another program. This seems to be miscompiled by llc. Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/headers.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/medium_inputs test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet_lengths.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/Makefile?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/Makefile Mon Jan 28 01:09:41 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = netbench-url +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = $(PROJ_SRC_DIR)/medium_inputs 1400 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = $(PROJ_SRC_DIR)/medium_inputs 100 +else +RUN_OPTIONS = $(PROJ_SRC_DIR)/medium_inputs 900 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/headers.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/headers.h?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/headers.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/headers.h Mon Jan 28 01:09:41 2008 @@ -0,0 +1,102 @@ +unsigned char headers[100][36] = { +{69, 0, 0, 60, 237, 188, 64, 0, 125, 6, 95, 223, 0, 1, 0, 1, 0, 2, 0, 1, 26, 32, 5, 119, 2, 141, 165, 39, 0, 0, 222, 220, 80, 24, 33, 209}, +{0, 114, 6, 43, 148, 0, 3, 0, 1, 0, 4, 0, 1, 11, 117, 24, 202, 0, 113, 219, 105, 32, 225, 253, 125, 80, 24, 31, 39, 58, 164, 222, 138, 1, 0, 162}, +{5, 0, 1, 18, 29, 26, 43, 14, 223, 211, 56, 0, 0, 228, 228, 80, 24, 254, 254, 58, 164, 222, 138, 1, 0, 164, 173, 69, 0, 0, 77, 18, 227, 64, 0, 123}, +{113, 220, 37, 80, 24, 63, 8, 58, 164, 222, 138, 2, 0, 166, 50, 69, 0, 0, 52, 156, 53, 64, 0, 122, 6, 12, 247, 0, 6, 0, 1, 0, 1, 0, 3, 5}, +{222, 138, 1, 0, 168, 49, 69, 0, 0, 74, 18, 228, 64, 0, 123, 6, 106, 136, 0, 4, 0, 1, 0, 7, 0, 1, 4, 139, 24, 202, 103, 113, 237, 12, 65, 209}, +{0, 5, 220, 142, 37, 64, 0, 124, 6, 117, 154, 0, 8, 0, 1, 0, 9, 0, 1, 26, 32, 13, 30, 132, 240, 181, 176, 41, 224, 24, 115, 128, 24, 68, 32, 58}, +{17, 6, 104, 0, 10, 0, 1, 0, 1, 0, 4, 105, 135, 105, 125, 0, 65, 19, 197, 58, 164, 222, 138, 2, 0, 173, 39, 58, 164, 222, 138, 1, 0, 174, 116, 69}, +{1, 0, 1, 0, 2, 0, 1, 26, 32, 5, 119, 2, 141, 165, 59, 0, 0, 222, 220, 80, 16, 33, 209, 58, 164, 222, 138, 1, 0, 174, 206, 69, 0, 5, 220, 142}, +{0, 1, 26, 32, 13, 30, 132, 240, 187, 88, 41, 224, 24, 115, 128, 16, 68, 32, 58, 164, 222, 138, 1, 0, 175, 149, 69, 0, 5, 220, 35, 112, 64, 0, 124, 6}, +{152, 99, 253, 0, 10, 2, 208, 80, 24, 33, 224, 58, 164, 222, 138, 1, 0, 176, 35, 69, 0, 2, 116, 239, 188, 64, 0, 125, 6, 91, 167, 0, 1, 0, 1, 0}, +{209, 58, 164, 222, 138, 2, 0, 176, 211, 69, 0, 0, 44, 89, 100, 64, 0, 121, 6, 170, 184, 0, 11, 0, 1, 0, 8, 0, 2, 0, 80, 5, 233, 133, 234, 167}, +{123, 6, 200, 231, 0, 8, 0, 2, 0, 11, 0, 1, 5, 233, 0, 80, 114, 12, 101, 163, 133, 234, 167, 179, 80, 16, 68, 112, 58, 164, 222, 138, 2, 0, 183, 194}, +{4, 0, 2, 26, 43, 193, 37, 1, 33, 115, 32, 26, 142, 226, 221, 80, 16, 254, 177, 58, 164, 222, 138, 1, 0, 184, 183, 69, 0, 5, 220, 98, 25, 64, 0, 124}, +{4, 198, 11, 125, 80, 16, 68, 112, 58, 164, 222, 138, 2, 0, 185, 228, 69, 0, 5, 220, 158, 203, 64, 0, 120, 6, 11, 223, 0, 12, 0, 1, 0, 4, 0, 2}, +{64, 0, 124, 6, 10, 243, 0, 1, 0, 5, 0, 13, 0, 1, 39, 14, 5, 254, 31, 143, 191, 155, 4, 198, 11, 125, 80, 24, 68, 112, 58, 164, 222, 138, 2, 0}, +{0, 2, 26, 43, 193, 37, 1, 33, 126, 136, 26, 142, 226, 221, 80, 24, 254, 177, 58, 164, 222, 138, 1, 0, 188, 136, 69, 0, 1, 98, 57, 58, 64, 0, 123, 6}, +{68, 112, 58, 164, 222, 138, 2, 0, 189, 229, 69, 16, 0, 120, 176, 81, 64, 0, 119, 6, 1, 133, 0, 14, 0, 1, 0, 8, 0, 3, 9, 196, 0, 25, 0, 159}, +{0, 192, 67, 69, 0, 0, 40, 17, 198, 64, 0, 122, 6, 19, 112, 0, 15, 0, 1, 0, 1, 0, 6, 4, 123, 18, 116, 1, 247, 207, 93, 231, 52, 1, 202, 80}, +{27, 64, 0, 124, 6, 8, 186, 0, 1, 0, 5, 0, 13, 0, 1, 39, 14, 5, 254, 31, 143, 195, 23, 4, 198, 11, 125, 80, 16, 68, 112, 58, 164, 222, 138, 1}, +{100, 1, 25, 65, 154, 24, 163, 112, 193, 80, 16, 34, 56, 58, 164, 222, 138, 1, 0, 204, 92, 69, 0, 5, 220, 188, 11, 64, 0, 125, 6, 96, 118, 0, 1, 0}, +{202, 1, 247, 207, 93, 80, 16, 68, 112, 58, 164, 222, 138, 1, 0, 205, 79, 69, 0, 5, 140, 187, 144, 64, 0, 125, 6, 24, 189, 0, 1, 0, 9, 0, 18, 0}, +{58, 164, 222, 138, 1, 0, 207, 51, 69, 0, 3, 164, 188, 12, 64, 0, 125, 6, 98, 173, 0, 1, 0, 6, 0, 15, 0, 1, 18, 116, 4, 123, 231, 52, 7, 126}, +{69, 0, 0, 40, 79, 64, 64, 0, 249, 6, 224, 29, 0, 4, 0, 2, 0, 12, 0, 1, 193, 37, 26, 43, 26, 142, 226, 221, 1, 33, 126, 136, 80, 16, 128, 0}, +{155, 0, 1, 0, 8, 0, 17, 0, 1, 4, 100, 26, 43, 24, 163, 118, 117, 1, 25, 65, 154, 80, 24, 254, 254, 58, 164, 222, 138, 1, 0, 213, 55, 69, 0, 5}, +{26, 43, 24, 163, 124, 41, 1, 25, 65, 154, 80, 24, 254, 254, 58, 164, 222, 138, 1, 0, 218, 4, 69, 0, 5, 220, 216, 118, 64, 0, 125, 6, 214, 155, 0, 1}, +{154, 80, 16, 254, 254, 58, 164, 222, 138, 1, 0, 226, 23, 69, 0, 0, 40, 104, 223, 64, 0, 56, 6, 142, 34, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238}, +{171, 64, 0, 118, 6, 60, 191, 0, 21, 0, 1, 0, 1, 0, 10, 241, 12, 206, 190, 129, 60, 126, 158, 251, 108, 252, 146, 128, 16, 68, 112, 58, 164, 222, 138, 2}, +{43, 193, 38, 1, 17, 190, 172, 26, 213, 223, 111, 80, 16, 254, 164, 58, 164, 222, 138, 2, 0, 244, 249, 69, 0, 0, 40, 116, 185, 64, 0, 117, 6, 235, 32, 0}, +{29, 160, 58, 164, 222, 138, 1, 0, 245, 184, 69, 0, 0, 40, 79, 65, 64, 0, 249, 6, 224, 28, 0, 4, 0, 2, 0, 12, 0, 1, 193, 36, 26, 43, 26, 104}, +{0, 5, 220, 161, 203, 64, 0, 120, 6, 8, 223, 0, 12, 0, 1, 0, 4, 0, 2, 26, 43, 193, 38, 1, 17, 196, 96, 26, 213, 223, 111, 80, 16, 254, 164, 58}, +{20, 26, 213, 223, 111, 80, 24, 254, 164, 58, 164, 222, 138, 2, 0, 250, 219, 69, 0, 0, 40, 18, 198, 64, 0, 122, 6, 18, 112, 0, 15, 0, 1, 0, 1, 0}, +{33, 64, 0, 61, 6, 109, 215, 0, 8, 0, 3, 0, 14, 0, 1, 0, 25, 9, 196, 30, 152, 194, 61, 0, 159, 146, 4, 80, 24, 96, 244, 58, 164, 222, 138, 2}, +{169, 0, 23, 0, 1, 0, 1, 0, 11, 0, 20, 7, 47, 9, 177, 105, 101, 2, 25, 246, 43, 128, 16, 68, 112, 58, 164, 222, 138, 1, 1, 6, 238, 69, 0, 5}, +{1, 18, 116, 4, 123, 231, 52, 10, 250, 1, 247, 207, 93, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 8, 80, 69, 0, 0, 40, 79, 66, 64, 0, 249, 6, 224}, +{20, 80, 16, 128, 0, 58, 164, 222, 138, 2, 1, 9, 40, 69, 0, 0, 40, 27, 226, 64, 0, 120, 6, 163, 224, 0, 24, 0, 1, 0, 4, 0, 3, 8, 154, 0}, +{138, 2, 1, 11, 15, 69, 0, 0, 52, 121, 162, 64, 0, 120, 6, 217, 168, 0, 23, 0, 1, 0, 1, 0, 11, 0, 20, 7, 47, 9, 177, 105, 101, 2, 25, 246}, +{69, 0, 0, 52, 84, 91, 64, 0, 120, 6, 127, 8, 0, 25, 0, 1, 0, 1, 0, 11, 0, 20, 7, 44, 109, 47, 0, 51, 2, 142, 167, 191, 128, 16, 68, 112}, +{0, 0, 143, 91, 251, 64, 0, 123, 6, 33, 44, 0, 7, 0, 1, 0, 4, 0, 1, 24, 202, 4, 139, 65, 209, 165, 21, 103, 113, 237, 46, 80, 24, 199, 50, 58}, +{1, 0, 6, 0, 15, 0, 1, 18, 116, 4, 123, 231, 52, 16, 174, 1, 247, 207, 93, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 17, 216, 69, 0, 5, 220, 68}, +{47, 0, 20, 2, 25, 246, 43, 9, 177, 105, 101, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 17, 254, 69, 0, 0, 40, 84, 92, 64, 0, 120, 6, 127, 19, 0}, +{219, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 20, 9, 69, 0, 0, 77, 18, 229, 64, 0, 123, 6, 106, 132, 0, 4, 0, 1, 0, 7, 0, 1, 4, 139, 24}, +{138, 2, 1, 20, 32, 69, 0, 0, 40, 195, 62, 64, 0, 117, 6, 196, 230, 0, 26, 0, 1, 0, 19, 0, 2, 7, 172, 0, 80, 17, 201, 176, 102, 125, 36, 102}, +{0, 1, 7, 47, 0, 20, 2, 26, 7, 71, 9, 177, 105, 101, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 24, 223, 69, 0, 0, 40, 229, 133, 64, 0, 116, 6}, +{32, 164, 222, 185, 140, 4, 58, 123, 13, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 29, 7, 69, 0, 5, 220, 70, 35, 64, 0, 125, 6, 130, 152, 0, 1, 0}, +{184, 219, 109, 47, 0, 51, 80, 24, 34, 56, 58, 164, 222, 138, 1, 1, 33, 141, 69, 0, 5, 220, 151, 94, 64, 0, 124, 6, 29, 148, 0, 1, 0, 13, 0, 28}, +{222, 185, 140, 80, 24, 33, 244, 58, 164, 222, 138, 1, 1, 33, 248, 69, 0, 5, 220, 71, 35, 64, 0, 125, 6, 129, 152, 0, 1, 0, 11, 0, 25, 0, 1, 7}, +{164, 222, 138, 2, 1, 35, 49, 69, 0, 0, 52, 61, 212, 64, 0, 116, 6, 159, 215, 0, 29, 0, 1, 0, 1, 0, 14, 26, 43, 15, 153, 212, 127, 67, 47, 61}, +{38, 69, 69, 0, 5, 220, 152, 94, 64, 0, 124, 6, 28, 148, 0, 1, 0, 13, 0, 28, 0, 1, 26, 32, 7, 119, 4, 58, 128, 193, 164, 222, 185, 140, 80, 16}, +{33, 64, 0, 124, 6, 20, 226, 0, 1, 0, 14, 0, 29, 0, 1, 15, 153, 26, 43, 61, 68, 188, 54, 212, 127, 67, 47, 80, 24, 34, 54, 58, 164, 222, 138, 1}, +{1, 0, 8, 0, 4, 15, 139, 26, 32, 0, 149, 18, 41, 4, 66, 205, 224, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 55, 121, 69, 0, 5, 220, 11, 70, 64}, +{97, 4, 75, 182, 240, 255, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 56, 21, 69, 0, 5, 220, 11, 71, 64, 0, 249, 6, 37, 6, 0, 20}, +{2, 1, 56, 252, 69, 0, 5, 220, 11, 72, 64, 0, 249, 6, 37, 5, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 182, 252, 103, 39, 105, 222, 147}, +{4, 0, 31, 0, 1, 26, 32, 15, 139, 4, 66, 205, 224, 0, 149, 18, 41, 80, 24, 33, 234, 58, 164, 222, 138, 2, 1, 57, 181, 69, 0, 5, 220, 11, 73, 64}, +{75, 183, 2, 27, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 58, 106, 69, 0, 5, 220, 11, 74, 64, 0, 249, 6, 37, 3, 0, 20, 0, 1}, +{56, 58, 164, 222, 138, 2, 1, 58, 242, 69, 0, 5, 220, 11, 75, 64, 0, 249, 6, 37, 2, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 13}, +{64, 0, 249, 6, 37, 1, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 19, 55, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 2, 1}, +{24, 34, 56, 58, 164, 222, 138, 2, 1, 60, 217, 69, 0, 5, 220, 11, 79, 64, 0, 249, 6, 36, 254, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75}, +{69, 0, 5, 220, 11, 80, 64, 0, 249, 6, 36, 253, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 42, 7, 39, 105, 222, 147, 80, 24, 34, 56}, +{1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 47, 187, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 62, 138, 69, 0, 0, 52, 19, 198, 64}, +{1, 247, 207, 93, 231, 52, 10, 250, 128, 16, 34, 56, 58, 164, 222, 138, 1, 1, 62, 191, 69, 0, 5, 220, 220, 107, 64, 0, 124, 6, 74, 24, 0, 8, 0, 4}, +{16, 33, 234, 58, 164, 222, 138, 2, 1, 63, 52, 69, 0, 5, 220, 11, 82, 64, 0, 249, 6, 36, 251, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75}, +{0, 5, 220, 142, 200, 64, 0, 252, 6, 177, 36, 0, 8, 0, 5, 0, 32, 0, 1, 201, 148, 0, 119, 225, 31, 71, 114, 81, 1, 252, 37, 80, 16, 34, 56, 58}, +{31, 77, 38, 81, 1, 252, 37, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 65, 4, 69, 0, 0, 52, 86, 7, 64, 0, 53, 6, 182, 104, 0, 33, 0, 1, 0}, +{112, 58, 164, 222, 138, 2, 1, 67, 146, 69, 0, 0, 40, 211, 16, 64, 0, 120, 6, 144, 214, 0, 34, 0, 1, 0, 1, 0, 16, 8, 110, 160, 230, 0, 93, 217}, +{104, 228, 64, 0, 56, 6, 142, 29, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 182, 252, 103, 80, 16, 192, 0, 58, 164, 222, 138}, +{22, 0, 2, 39, 14, 4, 141, 157, 116, 105, 70, 1, 152, 6, 61, 80, 24, 68, 112, 58, 164, 222, 138, 2, 1, 72, 231, 69, 0, 0, 40, 228, 156, 64, 0, 253}, +{94, 66, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 73, 45, 69, 0, 0, 40, 104, 230, 64, 0, 56, 6, 142, 27, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4}, +{69, 0, 0, 40, 117, 185, 64, 0, 117, 6, 234, 32, 0, 22, 0, 1, 0, 1, 0, 5, 7, 172, 39, 14, 0, 97, 50, 3, 57, 236, 31, 43, 80, 16, 34, 56}, +{64, 0, 56, 6, 142, 26, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 183, 19, 55, 80, 16, 192, 0, 58, 164, 222, 138, 2, 1}, +{179, 114, 12, 102, 221, 80, 24, 32, 254, 58, 164, 222, 138, 2, 1, 74, 8, 69, 0, 0, 40, 228, 157, 64, 0, 253, 6, 96, 3, 0, 32, 0, 1, 0, 8, 0}, +{64, 0, 125, 6, 96, 114, 0, 1, 0, 6, 0, 15, 0, 1, 18, 116, 4, 123, 231, 52, 22, 98, 1, 247, 207, 93, 80, 24, 68, 112, 58, 164, 222, 138, 1, 1}, +{19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 183, 24, 235, 80, 16, 192, 0, 58, 164, 222, 138, 2, 1, 75, 91, 69, 0, 5, 220, 11}, +{35, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 75, 188, 69, 0, 5, 220, 11, 84, 64, 0, 249, 6, 36, 249, 0, 20, 0, 1, 0, 19, 0}, +{1, 1, 76, 81, 69, 0, 5, 220, 142, 202, 64, 0, 252, 6, 177, 34, 0, 8, 0, 5, 0, 32, 0, 1, 201, 148, 0, 119, 225, 31, 94, 66, 81, 1, 252, 37}, +{110, 152, 238, 126, 216, 0, 93, 217, 25, 80, 16, 127, 218, 58, 164, 222, 138, 1, 1, 76, 211, 69, 0, 5, 220, 142, 203, 64, 0, 252, 6, 177, 33, 0, 8, 0}, +{69, 0, 5, 220, 11, 86, 64, 0, 249, 6, 36, 247, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 76, 63, 39, 105, 222, 147, 80, 24, 34, 56}, +{75, 183, 36, 83, 80, 16, 192, 0, 58, 164, 222, 138, 2, 1, 77, 171, 69, 0, 5, 220, 11, 87, 64, 0, 249, 6, 36, 246, 0, 20, 0, 1, 0, 19, 0, 1}, +{6, 36, 244, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 93, 91, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 79, 84, 69}, +{4, 75, 183, 99, 15, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 2, 1, 80, 23, 69, 0, 5, 220, 11, 91, 64, 0, 249, 6, 36, 242, 0, 20, 0}, +{34, 56, 58, 164, 222, 138, 1, 1, 80, 37, 69, 0, 0, 40, 104, 234, 64, 0, 56, 6, 142, 23, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105}, +{80, 207, 69, 0, 5, 220, 11, 92, 64, 0, 249, 6, 36, 241, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 110, 119, 39, 105, 222, 147, 80, 24}, +{6, 200, 60, 0, 35, 0, 1, 0, 4, 0, 4, 7, 110, 17, 80, 0, 238, 77, 101, 4, 141, 76, 110, 128, 16, 250, 0, 58, 164, 222, 138, 2, 1, 81, 107, 69}, +{247, 97, 4, 75, 183, 116, 43, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 1, 1, 81, 112, 69, 0, 5, 220, 13, 37, 64, 0, 124, 6, 77, 14, 0}, +{132, 140, 0, 93, 217, 25, 80, 16, 127, 218, 58, 164, 222, 138, 2, 1, 81, 248, 69, 0, 5, 220, 11, 94, 64, 0, 249, 6, 36, 239, 0, 20, 0, 1, 0, 19}, +{0, 5, 220, 98, 33, 64, 0, 124, 6, 241, 4, 0, 1, 0, 5, 0, 22, 0, 1, 39, 14, 7, 172, 57, 236, 35, 195, 0, 97, 50, 3, 80, 16, 68, 112, 58}, +{97, 4, 75, 183, 127, 147, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 83, 56, 69, 0, 4, 182, 91, 100, 64, 0, 121, 6, 164, 46, 0, 11}, +{168, 4, 114, 12, 102, 221, 80, 25, 32, 254, 58, 164, 222, 138, 2, 1, 83, 150, 69, 0, 5, 220, 11, 96, 64, 0, 249, 6, 36, 237, 0, 20, 0, 1, 0, 19}, +{20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 144, 175, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 2, 1, 85, 85, 69, 0, 5, 220, 11}, +{150, 99, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 85, 119, 69, 0, 0, 40, 228, 158, 64, 0, 253, 6, 96, 2, 0, 32, 0, 1, 0, 8}, +{6, 96, 1, 0, 32, 0, 1, 0, 8, 0, 5, 0, 119, 201, 148, 81, 1, 252, 37, 225, 31, 111, 94, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 87, 25, 69}, +{119, 0, 97, 50, 3, 80, 16, 68, 112, 58, 164, 222, 138, 2, 1, 87, 40, 69, 0, 5, 220, 11, 101, 64, 0, 249, 6, 36, 232, 0, 20, 0, 1, 0, 19, 0}, +{222, 138, 2, 1, 87, 148, 69, 0, 5, 220, 11, 102, 64, 0, 249, 6, 36, 231, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 167, 127, 39, 105}, +{103, 64, 0, 249, 6, 38, 206, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 173, 51, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 1}, +{31, 111, 94, 81, 1, 252, 37, 80, 24, 34, 56, 58, 164, 222, 138, 1, 1, 88, 245, 69, 0, 0, 40, 104, 236, 64, 0, 56, 6, 142, 21, 0, 19, 0, 1, 0}, +{89, 154, 69, 0, 0, 48, 44, 68, 64, 0, 119, 6, 194, 118, 0, 36, 0, 1, 0, 4, 0, 1, 6, 188, 24, 202, 3, 34, 61, 114, 0, 0, 0, 0, 112, 2}, +{0, 5, 220, 142, 206, 64, 0, 252, 6, 177, 30, 0, 8, 0, 5, 0, 32, 0, 1, 201, 148, 0, 119, 225, 31, 117, 18, 81, 1, 252, 37, 80, 16, 34, 56, 58}, +{37, 80, 24, 34, 56, 58, 164, 222, 138, 1, 1, 91, 66, 69, 0, 0, 40, 104, 237, 64, 0, 56, 6, 142, 20, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238}, +{238, 64, 0, 56, 6, 142, 19, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 183, 93, 91, 80, 16, 136, 224, 58, 164, 222, 138, 2}, +{35, 0, 1, 0, 4, 0, 4, 7, 110, 17, 80, 0, 238, 77, 101, 4, 141, 76, 110, 128, 16, 250, 0, 58, 164, 222, 138, 1, 1, 96, 85, 69, 0, 5, 220, 78}, +{110, 4, 141, 93, 138, 0, 238, 77, 101, 80, 16, 28, 167, 58, 164, 222, 138, 1, 1, 96, 176, 69, 0, 0, 40, 57, 60, 64, 0, 123, 6, 200, 228, 0, 8, 0} +}; Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/medium_inputs URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/medium_inputs?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/medium_inputs (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/medium_inputs Mon Jan 28 01:09:41 2008 @@ -0,0 +1,400 @@ +1(5), 70, 83, 63, 36, 38 +2(9:50), 69, 34, 62, 45, 51, 76, 96, 78, 33 +1(9), 38, 72, 32, 87, 81, 78, 37, 80, 97 +2(9:50), 34, 67, 83, 33, 38, 41, 97, 68, 73 +1(12), 93, 40, 62, 76, 45, 71, 74, 45, 68, 45, 98, 89 +1(9), 33, 49, 39, 58, 94, 71, 79, 83, 57 +2(11:100), 86, 58, 90, 56, 62, 50, 33, 48, 92, 99, 75 +2(8:50), 66, 75, 73, 58, 86, 58, 68, 55 +2(19:100), 34, 40, 86, 42, 85, 71, 76, 30, 70, 84, 52, 87, 51, 35, 95, 60, 42, 43, 76 +1(7), 90, 82, 83, 92, 72, 79, 98 +1(9), 68, 51, 80, 90, 55, 65, 56, 35, 66 +1(16), 85, 71, 91, 46, 34, 59, 74, 68, 47, 99, 93, 73, 53, 88, 55, 42 +1(9), 79, 55, 65, 74, 59, 68, 91, 96, 42 +2(15:100), 70, 74, 80, 39, 74, 61, 72, 53, 67, 96, 67, 34, 49, 84, 46 +1(7), 64, 80, 77, 30, 84, 30, 100 +1(10), 91, 39, 52, 61, 88, 84, 50, 46, 83, 57 +1(10), 57, 100, 53, 52, 44, 33, 72, 62, 50, 92 +2(13:50), 71, 54, 38, 79, 63, 40, 87, 54, 93, 56, 70, 70, 76 +1(8), 92, 91, 85, 42, 52, 69, 40, 94 +1(19), 49, 72, 45, 90, 40, 70, 61, 83, 88, 80, 42, 100, 83, 99, 64, 99, 63, 48, 37 +2(7:100), 64, 96, 78, 63, 78, 76, 100 +1(10), 47, 87, 97, 40, 57, 36, 55, 55, 59, 92 +1(20), 40, 39, 69, 63, 92, 41, 69, 49, 54, 68, 93, 44, 56, 49, 75, 68, 42, 30, 77, 37 +1(6), 53, 71, 39, 100, 61, 78 +1(10), 49, 59, 56, 95, 86, 83, 63, 51, 57, 89 +1(7), 91, 39, 48, 70, 66, 93, 45 +1(11), 65, 91, 50, 76, 98, 78, 82, 36, 52, 79, 66 +1(11), 97, 95, 52, 52, 84, 52, 55, 74, 74, 50, 67 +1(13), 93, 68, 50, 82, 68, 41, 39, 72, 70, 77, 34, 60, 47 +1(9), 96, 63, 54, 97, 68, 75, 57, 73, 41 +2(11:100), 77, 85, 76, 57, 82, 51, 94, 75, 50, 36, 56 +1(16), 30, 89, 95, 88, 89, 38, 70, 68, 90, 45, 84, 94, 40, 33, 80, 96 +1(10), 60, 89, 30, 95, 47, 73, 53, 85, 57, 54 +1(8), 81, 59, 50, 42, 62, 95, 44, 35 +1(7), 47, 65, 76, 76, 72, 32, 62 +1(13), 38, 61, 99, 30, 76, 90, 68, 70, 39, 79, 63, 85, 90 +1(18), 83, 45, 43, 83, 46, 47, 69, 87, 85, 91, 88, 66, 63, 53, 95, 75, 67, 83 +1(9), 97, 93, 40, 42, 42, 39, 33, 76, 99 +2(14:100), 71, 78, 47, 100, 97, 91, 94, 59, 91, 30, 49, 73, 51, 81 +1(13), 61, 38, 46, 62, 55, 51, 87, 89, 69, 86, 72, 92, 49 +2(8:100), 30, 47, 62, 93, 86, 30, 82, 42 +1(14), 91, 93, 40, 62, 86, 63, 44, 85, 47, 39, 92, 84, 55, 35 +2(8:100), 39, 67, 74, 42, 75, 60, 51, 73 +1(7), 84, 68, 41, 59, 45, 41, 44 +1(8), 38, 98, 81, 58, 35, 94, 85, 81 +1(20), 70, 52, 57, 50, 89, 72, 54, 32, 39, 95, 51, 64, 38, 58, 83, 87, 74, 68, 63, 84 +1(18), 61, 96, 66, 93, 38, 70, 83, 50, 30, 32, 32, 46, 65, 91, 93, 37, 41, 68 +1(15), 74, 94, 92, 91, 42, 86, 87, 61, 75, 48, 95, 87, 31, 87, 93 +1(14), 87, 98, 60, 90, 34, 68, 90, 44, 40, 65, 35, 77, 38, 79 +1(7), 30, 84, 59, 64, 68, 86, 80 +1(9), 58, 87, 70, 86, 77, 38, 88, 59, 62 +1(8), 95, 97, 68, 53, 44, 100, 78, 46 +1(10), 39, 64, 79, 45, 83, 71, 66, 33, 53, 68 +1(10), 35, 61, 32, 97, 97, 32, 33, 46, 33, 73 +2(10:100), 65, 48, 83, 63, 38, 92, 97, 75, 100, 65 +1(12), 90, 31, 90, 69, 67, 44, 75, 83, 63, 84, 41, 62 +1(10), 94, 36, 59, 42, 77, 98, 38, 33, 58, 95 +1(5), 97, 88, 77, 63, 90 +1(12), 39, 91, 68, 40, 99, 61, 39, 56, 66, 36, 36, 85 +1(9), 75, 40, 83, 67, 30, 37, 79, 91, 92 +1(7), 85, 44, 61, 55, 58, 86, 45 +1(12), 54, 42, 42, 97, 66, 54, 91, 66, 81, 64, 74, 98 +1(10), 54, 80, 95, 37, 58, 65, 65, 75, 63, 61 +1(7), 75, 82, 33, 55, 55, 43, 52 +2(9:50), 65, 87, 53, 60, 61, 86, 84, 92, 81 +1(14), 95, 63, 54, 37, 34, 70, 66, 43, 40, 34, 91, 86, 31, 80 +2(15:50), 87, 92, 95, 92, 78, 58, 89, 72, 73, 93, 84, 36, 35, 93, 87 +1(13), 69, 61, 94, 41, 30, 62, 73, 82, 99, 40, 85, 65, 76 +1(10), 42, 67, 99, 64, 98, 73, 63, 95, 37, 64 +1(18), 67, 69, 50, 94, 65, 38, 82, 48, 40, 62, 54, 96, 30, 64, 73, 59, 41, 82 +1(15), 100, 38, 92, 48, 91, 40, 73, 43, 81, 42, 34, 84, 98, 33, 54 +1(11), 82, 35, 87, 58, 94, 63, 81, 62, 98, 37, 79 +1(10), 38, 83, 39, 63, 95, 31, 30, 57, 88, 42 +2(6:50), 94, 41, 65, 93, 54, 37 +1(9), 86, 87, 77, 58, 49, 87, 91, 32, 66 +1(6), 37, 84, 93, 80, 89, 90 +2(7:50), 51, 36, 64, 33, 47, 89, 36 +1(7), 77, 36, 44, 77, 69, 63, 69 +1(15), 60, 60, 59, 76, 99, 47, 43, 55, 75, 81, 99, 52, 32, 51, 42 +1(13), 98, 82, 75, 90, 71, 44, 67, 45, 56, 55, 63, 39, 36 +1(15), 61, 33, 83, 47, 31, 35, 73, 53, 43, 50, 88, 73, 80, 35, 79 +1(8), 62, 97, 58, 88, 42, 49, 46, 90 +2(15:50), 84, 96, 48, 90, 66, 93, 58, 39, 58, 76, 37, 70, 82, 90, 56 +1(11), 58, 86, 69, 52, 69, 53, 78, 42, 66, 58, 98 +1(9), 83, 60, 76, 53, 58, 52, 39, 99, 100 +1(13), 43, 75, 97, 31, 82, 66, 42, 31, 58, 44, 70, 67, 85 +2(7:50), 60, 70, 85, 45, 59, 47, 53 +1(9), 63, 60, 31, 53, 38, 61, 73, 42, 35 +1(13), 33, 72, 59, 55, 93, 63, 43, 84, 41, 88, 56, 85, 70 +1(5), 75, 63, 51, 34, 89 +1(10), 85, 60, 72, 77, 88, 90, 61, 98, 41, 95 +1(20), 54, 73, 84, 30, 90, 70, 63, 48, 91, 31, 82, 62, 90, 47, 39, 58, 67, 82, 30, 60 +1(10), 79, 58, 41, 48, 82, 31, 71, 53, 44, 75 +1(14), 34, 97, 93, 43, 71, 92, 53, 41, 63, 81, 76, 44, 40, 46 +1(18), 33, 63, 93, 88, 96, 77, 55, 78, 32, 64, 35, 88, 46, 77, 57, 69, 57, 33 +1(12), 46, 72, 85, 82, 85, 58, 39, 86, 58, 54, 95, 62 +1(7), 33, 35, 98, 56, 93, 94, 60 +1(11), 98, 93, 33, 68, 86, 55, 78, 63, 59, 60, 57 +1(5), 30, 88, 45, 43, 79 +1(10), 50, 48, 75, 59, 50, 91, 79, 82, 98, 52 +1(19), 83, 71, 83, 73, 71, 76, 41, 99, 81, 46, 94, 99, 63, 79, 57, 47, 51, 55, 93 +1(9), 31, 48, 68, 56, 30, 83, 91, 30, 37 +1(8), 42, 95, 95, 31, 39, 33, 86, 51 +1(7), 66, 77, 94, 51, 72, 71, 73 +1(11), 36, 57, 99, 43, 55, 81, 96, 31, 49, 86, 89 +1(13), 84, 38, 45, 40, 32, 46, 69, 38, 48, 37, 72, 63, 80 +1(13), 81, 36, 77, 62, 77, 83, 56, 64, 38, 75, 71, 74, 42 +2(8:50), 54, 78, 97, 36, 41, 63, 81, 59 +1(7), 82, 35, 95, 87, 47, 68, 97 +1(7), 35, 38, 36, 45, 50, 59, 57 +1(15), 69, 90, 74, 87, 52, 76, 56, 68, 37, 84, 100, 56, 48, 80, 76 +2(10:50), 60, 77, 73, 100, 62, 87, 30, 41, 87, 60 +2(15:50), 100, 93, 94, 92, 82, 59, 72, 49, 91, 42, 43, 81, 49, 53, 47 +1(14), 74, 74, 44, 37, 95, 73, 97, 40, 58, 73, 90, 69, 56, 75 +1(9), 66, 40, 94, 69, 47, 70, 76, 93, 73 +1(9), 50, 91, 31, 83, 55, 32, 35, 50, 52 +1(17), 93, 35, 40, 51, 67, 99, 35, 65, 46, 87, 43, 74, 96, 99, 40, 48, 68 +1(8), 65, 95, 97, 55, 65, 89, 80, 78 +1(8), 31, 38, 96, 55, 82, 80, 51, 31 +1(6), 64, 55, 76, 77, 96, 79 +1(20), 34, 97, 59, 52, 67, 38, 66, 54, 31, 41, 45, 30, 99, 98, 47, 99, 71, 35, 80, 77 +1(10), 50, 40, 56, 91, 72, 46, 97, 61, 31, 89 +1(10), 74, 43, 50, 37, 99, 89, 85, 56, 81, 65 +1(7), 95, 90, 88, 66, 78, 39, 88 +1(10), 51, 52, 61, 72, 87, 48, 63, 39, 95, 63 +2(12:100), 56, 59, 61, 32, 56, 67, 32, 86, 99, 64, 31, 81 +2(10:100), 65, 56, 38, 74, 93, 98, 95, 44, 65, 50 +1(10), 30, 69, 40, 39, 54, 99, 63, 60, 80, 51 +1(14), 62, 80, 87, 68, 38, 60, 63, 35, 68, 30, 51, 69, 34, 64 +1(15), 82, 56, 30, 57, 72, 52, 61, 56, 50, 66, 98, 96, 69, 61, 91 +1(16), 31, 46, 44, 91, 99, 93, 48, 41, 32, 90, 64, 37, 95, 64, 41, 47 +2(6:100), 51, 31, 73, 46, 98, 83 +2(10:50), 47, 61, 99, 68, 35, 90, 36, 68, 85, 59 +2(15:100), 72, 79, 55, 92, 50, 71, 70, 56, 76, 90, 83, 48, 62, 52, 33 +1(14), 87, 89, 63, 53, 61, 62, 31, 80, 81, 47, 91, 33, 67, 47 +1(8), 94, 70, 77, 48, 90, 85, 65, 45 +1(20), 37, 91, 73, 62, 30, 44, 96, 45, 55, 82, 66, 98, 36, 56, 85, 85, 79, 80, 35, 66 +1(19), 78, 46, 90, 74, 89, 68, 97, 64, 54, 41, 63, 38, 38, 35, 46, 30, 55, 31, 83 +1(14), 67, 40, 80, 71, 95, 47, 44, 89, 48, 82, 99, 97, 46, 84 +1(8), 63, 85, 85, 30, 96, 41, 63, 99 +1(7), 50, 71, 87, 46, 41, 52, 30 +1(10), 62, 64, 47, 33, 78, 93, 89, 80, 71, 88 +1(10), 86, 76, 46, 98, 83, 53, 91, 81, 72, 59 +1(13), 36, 67, 57, 85, 59, 82, 84, 71, 55, 53, 92, 47, 47 +2(15:50), 85, 48, 63, 60, 40, 57, 86, 61, 52, 85, 69, 94, 77, 73, 93 +1(11), 71, 75, 45, 97, 44, 82, 53, 81, 94, 81, 71 +1(10), 38, 30, 35, 47, 86, 44, 58, 97, 91, 83 +1(15), 69, 87, 40, 88, 57, 31, 90, 73, 47, 66, 74, 48, 97, 54, 93 +1(16), 63, 61, 76, 83, 48, 51, 49, 66, 52, 50, 68, 36, 78, 54, 61, 51 +1(16), 54, 73, 68, 94, 64, 72, 45, 78, 56, 45, 32, 64, 65, 73, 31, 46 +1(4), 53, 45, 40, 31 +1(12), 81, 64, 38, 77, 41, 37, 100, 43, 64, 34, 88, 38 +1(14), 59, 65, 97, 35, 40, 78, 93, 92, 58, 46, 59, 94, 60, 60 +1(8), 43, 44, 98, 64, 41, 32, 41, 49 +1(8), 70, 72, 93, 64, 68, 85, 83, 82 +1(7), 41, 59, 90, 34, 61, 78, 64 +1(10), 80, 97, 34, 82, 35, 71, 68, 92, 58, 79 +1(8), 58, 64, 67, 44, 50, 88, 91, 37 +1(10), 47, 88, 46, 83, 51, 64, 43, 56, 66, 43 +2(7:100), 39, 90, 59, 93, 42, 35, 79 +2(6:100), 56, 35, 50, 52, 52, 33 +1(7), 98, 88, 34, 50, 94, 47, 52 +1(7), 91, 86, 67, 64, 53, 84, 64 +1(16), 46, 69, 92, 54, 37, 93, 34, 96, 55, 70, 62, 36, 48, 32, 97, 67 +1(14), 79, 45, 68, 46, 35, 97, 41, 50, 35, 75, 58, 49, 71, 56 +1(6), 72, 75, 97, 45, 94, 64 +1(12), 61, 45, 59, 53, 89, 76, 82, 73, 91, 83, 63, 45 +1(14), 98, 71, 94, 64, 68, 34, 99, 99, 75, 53, 69, 48, 51, 84 +2(10:100), 59, 91, 63, 100, 46, 86, 48, 34, 91, 49 +1(5), 97, 79, 90, 50, 86 +2(7:50), 71, 68, 64, 74, 77, 91, 85 +1(12), 61, 65, 63, 78, 51, 94, 35, 32, 76, 91, 90, 83 +1(11), 57, 98, 72, 57, 52, 46, 33, 64, 79, 60, 100 +2(10:50), 63, 39, 79, 100, 68, 72, 42, 79, 67, 60 +1(13), 32, 63, 96, 66, 30, 82, 42, 56, 80, 89, 67, 35, 58 +1(13), 74, 70, 43, 90, 95, 76, 100, 67, 87, 63, 65, 85, 42 +2(18:50), 61, 77, 65, 65, 50, 93, 77, 82, 30, 94, 45, 52, 84, 79, 38, 40, 90, 31 +2(7:50), 30, 48, 68, 69, 70, 41, 91 +1(7), 84, 40, 58, 34, 97, 33, 100 +1(10), 93, 34, 61, 73, 78, 80, 65, 77, 37, 62 +1(14), 86, 61, 44, 79, 86, 66, 71, 78, 38, 47, 97, 63, 75, 43 +2(12:100), 78, 88, 64, 53, 55, 75, 84, 40, 68, 98, 31, 68 +2(10:50), 43, 81, 54, 41, 40, 49, 71, 40, 69, 60 +1(6), 52, 68, 31, 70, 75, 37 +2(15:50), 49, 40, 97, 52, 40, 68, 48, 95, 80, 64, 97, 82, 91, 52, 95 +1(13), 77, 47, 75, 60, 45, 47, 41, 36, 87, 47, 32, 70, 92 +1(10), 84, 95, 53, 41, 33, 93, 67, 34, 81, 33 +1(9), 37, 88, 45, 69, 85, 47, 35, 69, 80 +1(11), 68, 76, 59, 89, 83, 32, 81, 48, 31, 94, 84 +2(12:50), 72, 51, 43, 36, 60, 55, 63, 87, 37, 45, 32, 100 +1(20), 99, 44, 71, 64, 37, 84, 47, 60, 99, 66, 63, 96, 84, 71, 43, 68, 99, 46, 83, 71 +1(7), 45, 88, 81, 90, 81, 54, 42 +2(9:50), 59, 77, 56, 94, 66, 73, 95, 75, 54 +1(9), 74, 93, 31, 47, 76, 38, 54, 96, 81 +1(10), 62, 73, 53, 53, 57, 30, 51, 54, 82, 54 +1(11), 73, 72, 46, 79, 56, 56, 57, 53, 72, 58, 57 +1(18), 41, 65, 87, 71, 75, 36, 67, 85, 70, 52, 71, 77, 91, 44, 33, 57, 75, 62 +1(7), 63, 85, 88, 77, 78, 36, 56 +1(12), 89, 69, 48, 53, 32, 85, 76, 93, 50, 49, 95, 90 +2(12:50), 86, 39, 86, 70, 89, 57, 88, 95, 72, 96, 88, 43 +2(10:100), 54, 49, 34, 52, 96, 94, 88, 31, 40, 72 +1(8), 32, 66, 73, 78, 67, 86, 30, 64 +1(12), 86, 31, 59, 61, 85, 67, 60, 98, 67, 58, 84, 79 +1(10), 31, 49, 62, 40, 52, 44, 55, 39, 68, 68 +1(8), 83, 81, 32, 74, 85, 47, 62, 62 +1(10), 54, 33, 90, 98, 44, 69, 78, 82, 51, 90 +2(7:50), 55, 30, 100, 90, 99, 70, 69 +1(14), 34, 49, 68, 78, 99, 52, 62, 83, 63, 77, 30, 70, 74, 37 +1(10), 60, 55, 78, 66, 52, 48, 40, 79, 74, 44 +1(8), 59, 59, 65, 71, 42, 83, 61, 66 +1(12), 41, 57, 40, 80, 83, 75, 88, 66, 65, 70, 61, 31 +1(4), 60, 37, 53, 43 +2(10:50), 68, 60, 62, 32, 93, 75, 35, 58, 63, 100 +1(14), 43, 48, 59, 64, 42, 34, 95, 37, 82, 88, 75, 34, 85, 35 +1(8), 80, 31, 36, 59, 32, 83, 38, 78 +1(8), 76, 84, 74, 84, 98, 78, 66, 79 +2(15:100), 32, 70, 36, 46, 85, 74, 43, 66, 43, 32, 61, 86, 58, 46, 43 +1(12), 40, 58, 96, 48, 42, 40, 59, 81, 75, 52, 94, 32 +1(17), 51, 100, 80, 54, 73, 51, 94, 62, 88, 99, 79, 51, 31, 68, 56, 60, 50 +1(9), 68, 86, 87, 55, 95, 94, 43, 32, 59 +2(16:50), 66, 31, 38, 86, 32, 79, 60, 72, 83, 57, 97, 41, 44, 95, 42, 75 +1(8), 91, 56, 38, 44, 72, 62, 68, 65 +1(5), 55, 57, 41, 57, 35 +1(8), 35, 90, 48, 63, 43, 56, 92, 81 +1(6), 92, 57, 61, 60, 30, 49 +1(9), 72, 95, 80, 67, 93, 88, 93, 47, 58 +1(8), 88, 50, 70, 89, 80, 44, 60, 55 +1(7), 82, 48, 45, 88, 91, 67, 72 +1(14), 81, 31, 44, 96, 30, 43, 66, 55, 71, 84, 77, 39, 55, 68 +1(7), 81, 32, 88, 89, 31, 48, 93 +1(12), 63, 58, 39, 73, 70, 96, 97, 93, 100, 56, 54, 30 +2(12:50), 43, 56, 82, 83, 77, 66, 48, 100, 87, 68, 87, 93 +1(8), 88, 46, 41, 39, 47, 38, 96, 86 +1(10), 84, 99, 54, 97, 48, 41, 99, 47, 61, 81 +1(7), 75, 79, 76, 52, 95, 46, 52 +2(8:50), 89, 96, 76, 43, 62, 72, 45, 89 +2(20:50), 88, 40, 85, 66, 73, 83, 94, 65, 98, 53, 71, 63, 36, 59, 61, 58, 60, 79, 52, 88 +1(14), 81, 44, 93, 68, 76, 79, 83, 78, 100, 56, 90, 85, 54, 68 +2(10:50), 94, 95, 72, 43, 80, 55, 58, 75, 73, 53 +2(20:100), 94, 64, 48, 67, 66, 65, 33, 66, 40, 77, 94, 78, 96, 87, 60, 44, 56, 46, 94, 72 +1(14), 68, 65, 92, 37, 87, 35, 59, 78, 88, 78, 63, 57, 53, 75 +1(7), 41, 69, 60, 85, 83, 53, 67 +1(15), 74, 87, 67, 48, 85, 70, 54, 42, 85, 93, 37, 58, 68, 97, 38 +1(9), 48, 95, 75, 75, 34, 72, 51, 69, 94 +1(6), 60, 95, 31, 57, 83, 93 +2(15:50), 91, 36, 64, 60, 33, 53, 61, 87, 61, 40, 36, 45, 51, 72, 96 +1(19), 33, 43, 81, 53, 76, 54, 95, 81, 71, 31, 68, 90, 86, 62, 98, 94, 44, 99, 43 +1(10), 69, 48, 45, 95, 83, 62, 94, 90, 73, 89 +1(11), 93, 69, 58, 70, 47, 89, 85, 32, 87, 98, 48 +1(9), 86, 37, 95, 59, 87, 78, 95, 73, 63 +1(13), 92, 92, 34, 35, 66, 81, 52, 48, 99, 76, 85, 58, 85 +1(11), 85, 33, 80, 85, 89, 82, 66, 93, 92, 67, 63 +1(5), 47, 71, 64, 53, 67 +1(4), 31, 64, 48, 31 +1(14), 51, 81, 41, 71, 77, 38, 65, 77, 51, 78, 74, 52, 35, 81 +1(10), 50, 31, 58, 60, 99, 60, 88, 47, 56, 58 +1(13), 60, 41, 86, 85, 91, 47, 100, 100, 69, 80, 89, 32, 94 +1(10), 34, 95, 86, 73, 89, 73, 66, 78, 91, 46 +1(7), 86, 74, 33, 83, 99, 31, 59 +2(8:100), 80, 77, 40, 90, 41, 53, 35, 38 +1(9), 83, 35, 52, 99, 57, 100, 83, 61, 61 +1(7), 64, 64, 86, 72, 94, 44, 86 +1(7), 74, 58, 43, 70, 41, 49, 99 +1(16), 87, 61, 58, 60, 55, 41, 30, 44, 63, 87, 57, 63, 88, 51, 99, 67 +1(10), 58, 52, 54, 43, 43, 49, 97, 44, 80, 53 +2(9:100), 33, 94, 94, 30, 62, 83, 63, 94, 50 +1(13), 49, 97, 68, 42, 32, 89, 97, 72, 46, 59, 41, 78, 98 +1(10), 76, 97, 91, 59, 43, 30, 95, 70, 49, 56 +1(20), 47, 42, 59, 81, 38, 97, 88, 71, 64, 31, 44, 63, 87, 87, 82, 54, 52, 67, 66, 72 +1(10), 76, 53, 56, 72, 68, 88, 64, 88, 78, 60 +1(10), 30, 46, 100, 55, 61, 77, 77, 81, 45, 48 +1(12), 65, 84, 31, 33, 30, 63, 94, 66, 90, 47, 30, 39 +1(10), 36, 78, 52, 43, 35, 44, 41, 34, 35, 96 +2(9:50), 34, 100, 81, 39, 30, 59, 82, 66, 57 +1(8), 35, 71, 55, 35, 48, 87, 91, 81 +1(4), 63, 60, 96, 92 +2(4:100), 35, 70, 91, 75 +1(11), 32, 96, 90, 55, 37, 66, 55, 90, 73, 33, 50 +1(11), 34, 58, 30, 93, 61, 45, 40, 95, 86, 68, 76 +1(7), 72, 66, 59, 42, 94, 50, 67 +1(7), 60, 43, 59, 83, 92, 59, 74 +1(19), 45, 38, 64, 96, 71, 51, 46, 53, 32, 75, 32, 52, 59, 89, 34, 68, 35, 47, 30 +1(11), 49, 94, 40, 67, 98, 96, 52, 73, 48, 41, 92 +1(11), 62, 73, 30, 73, 43, 85, 96, 32, 99, 82, 80 +1(15), 77, 34, 55, 94, 97, 74, 71, 88, 84, 33, 71, 63, 97, 58, 64 +1(10), 92, 77, 93, 87, 37, 77, 43, 48, 65, 45 +1(10), 68, 30, 100, 90, 74, 33, 42, 57, 77, 31 +2(15:100), 73, 84, 39, 35, 60, 55, 65, 89, 77, 87, 58, 81, 67, 82, 36 +1(13), 43, 91, 67, 50, 99, 42, 85, 32, 30, 51, 74, 88, 40 +1(7), 30, 87, 97, 98, 81, 53, 56 +1(7), 69, 100, 34, 75, 71, 80, 92 +1(17), 41, 75, 58, 47, 48, 69, 45, 59, 87, 92, 99, 34, 45, 31, 59, 94, 90 +2(5:100), 45, 76, 35, 97, 70 +1(7), 87, 31, 48, 78, 87, 94, 54 +1(15), 47, 66, 72, 82, 95, 99, 49, 33, 69, 53, 50, 69, 53, 44, 42 +1(7), 38, 84, 44, 67, 64, 80, 42 +1(10), 47, 79, 47, 90, 69, 54, 37, 55, 69, 44 +1(13), 91, 45, 45, 74, 53, 52, 44, 61, 32, 51, 81, 70, 62 +1(7), 85, 59, 67, 87, 37, 36, 36 +2(8:100), 43, 97, 90, 73, 53, 88, 59, 37 +1(15), 39, 74, 43, 63, 45, 53, 81, 88, 37, 66, 97, 87, 98, 47, 45 +2(7:50), 98, 63, 89, 77, 49, 46, 68 +1(14), 58, 47, 87, 86, 90, 60, 49, 43, 66, 36, 30, 67, 72, 85 +2(10:100), 90, 89, 59, 54, 60, 77, 100, 62, 88, 48 +1(12), 45, 44, 77, 90, 69, 83, 48, 41, 39, 97, 45, 60 +1(8), 57, 100, 62, 37, 83, 37, 82, 45 +2(16:100), 42, 64, 44, 32, 64, 82, 60, 47, 78, 41, 89, 46, 71, 58, 76, 56 +1(8), 57, 50, 67, 75, 44, 63, 69, 55 +1(10), 40, 81, 68, 30, 66, 83, 73, 71, 40, 89 +1(7), 52, 35, 49, 59, 92, 84, 75 +1(9), 89, 32, 55, 69, 47, 59, 81, 76, 54 +2(4:100), 48, 86, 40, 75 +1(14), 55, 83, 94, 46, 44, 35, 83, 92, 87, 45, 45, 100, 91, 96 +1(14), 30, 74, 52, 49, 80, 75, 98, 87, 93, 80, 45, 88, 60, 40 +1(7), 44, 94, 50, 56, 84, 84, 54 +1(14), 81, 75, 58, 42, 36, 41, 53, 84, 99, 31, 81, 42, 80, 30 +1(5), 39, 73, 37, 91, 53 +1(6), 30, 36, 76, 57, 53, 77 +1(7), 68, 81, 39, 74, 54, 61, 52 +1(4), 34, 93, 73, 80 +1(11), 99, 48, 62, 37, 41, 40, 69, 56, 47, 41, 35 +1(11), 67, 41, 60, 69, 47, 34, 54, 92, 78, 79, 86 +1(20), 70, 95, 55, 99, 84, 76, 100, 30, 59, 70, 93, 32, 89, 85, 57, 94, 73, 91, 94, 92 +1(14), 59, 31, 80, 48, 79, 56, 51, 98, 31, 31, 84, 82, 85, 76 +1(14), 48, 78, 80, 73, 77, 51, 86, 61, 65, 84, 40, 32, 43, 99 +1(8), 47, 96, 49, 86, 70, 86, 77, 57 +1(7), 31, 46, 46, 34, 69, 80, 95 +1(6), 68, 64, 65, 31, 33, 78 +1(20), 73, 66, 60, 81, 81, 37, 48, 59, 67, 41, 74, 68, 80, 30, 42, 97, 40, 35, 55, 32 +1(8), 35, 36, 95, 79, 31, 64, 76, 58 +1(9), 85, 97, 83, 41, 46, 66, 48, 30, 82 +1(10), 58, 61, 50, 81, 64, 90, 58, 86, 96, 30 +1(9), 100, 36, 61, 52, 41, 47, 55, 88, 70 +1(14), 91, 89, 89, 83, 49, 48, 60, 98, 97, 84, 92, 49, 48, 45 +1(11), 82, 89, 43, 37, 57, 61, 92, 30, 99, 100, 37 +1(14), 49, 74, 78, 45, 100, 42, 77, 33, 69, 52, 32, 46, 30, 49 +1(9), 87, 99, 48, 51, 82, 71, 38, 58, 30 +1(7), 75, 65, 36, 47, 93, 36, 85 +1(8), 61, 79, 69, 67, 68, 32, 71, 58 +1(11), 60, 96, 42, 38, 71, 61, 55, 64, 79, 100, 66 +1(17), 35, 72, 32, 65, 65, 75, 60, 53, 33, 40, 78, 92, 31, 81, 70, 99, 96 +1(8), 71, 46, 39, 43, 30, 55, 91, 91 +1(11), 54, 70, 83, 44, 92, 96, 34, 39, 97, 88, 74 +1(16), 39, 41, 89, 71, 66, 100, 93, 72, 72, 84, 83, 73, 84, 93, 35, 74 +1(7), 92, 43, 64, 38, 34, 86, 73 +1(7), 61, 97, 47, 65, 63, 81, 95 +1(7), 51, 46, 77, 93, 78, 44, 81 +1(6), 33, 83, 81, 39, 65, 52 +2(5:50), 49, 60, 72, 48, 31 +1(12), 86, 38, 41, 81, 95, 93, 92, 55, 82, 74, 95, 93 +2(9:100), 70, 63, 100, 93, 85, 100, 87, 86, 87 +1(4), 63, 46, 69, 61 +1(13), 38, 93, 90, 52, 76, 49, 76, 91, 46, 63, 87, 83, 81 +1(8), 48, 33, 73, 39, 52, 81, 35, 48 +1(10), 38, 64, 73, 98, 73, 81, 30, 52, 82, 40 +1(15), 85, 71, 37, 82, 47, 78, 44, 70, 67, 92, 88, 76, 88, 86, 93 +1(20), 31, 54, 63, 74, 92, 50, 34, 89, 37, 72, 49, 45, 80, 73, 81, 70, 88, 56, 69, 87 +1(14), 70, 99, 51, 73, 99, 89, 52, 46, 82, 63, 41, 98, 60, 55 +2(4:50), 34, 59, 58, 83 +1(16), 77, 40, 34, 100, 86, 47, 38, 79, 100, 77, 42, 46, 33, 93, 65, 38 +1(9), 57, 60, 80, 72, 63, 43, 80, 100, 61 +1(10), 37, 89, 77, 38, 36, 72, 68, 34, 32, 57 +1(4), 56, 74, 46, 57 +1(8), 30, 42, 62, 38, 51, 75, 78, 58 +1(9), 91, 81, 94, 78, 82, 71, 97, 66, 58 +1(18), 33, 30, 91, 73, 54, 91, 61, 48, 39, 38, 71, 41, 84, 43, 99, 92, 71, 45 +1(8), 41, 82, 75, 81, 44, 49, 55, 87 +1(14), 92, 46, 87, 86, 52, 46, 55, 58, 91, 65, 91, 62, 52, 46 +1(7), 36, 72, 59, 48, 40, 89, 42 +2(10:100), 71, 95, 49, 66, 76, 67, 80, 62, 37, 40 +1(7), 76, 30, 55, 76, 41, 95, 51 +1(9), 57, 58, 35, 35, 48, 60, 45, 44, 57 +1(4), 61, 32, 88, 60 +1(10), 95, 76, 68, 87, 30, 50, 60, 62, 84, 63 +1(17), 34, 100, 76, 96, 35, 75, 49, 46, 77, 38, 88, 71, 64, 50, 56, 82, 71 +1(6), 58, 52, 34, 70, 97, 45 +1(8), 92, 85, 52, 57, 46, 37, 42, 54 +1(11), 46, 98, 39, 56, 48, 51, 47, 67, 78, 61, 76 +1(11), 99, 71, 94, 90, 78, 99, 94, 60, 38, 41, 41 +1(7), 39, 93, 79, 90, 75, 34, 72 +2(10:50), 67, 59, 94, 99, 34, 70, 73, 30, 57, 40 +1(7), 47, 74, 41, 93, 31, 63, 93 +1(10), 64, 36, 81, 98, 31, 38, 33, 50, 38, 45 +1(13), 60, 95, 93, 46, 64, 53, 76, 40, 59, 83, 100, 31, 47 +1(13), 80, 42, 85, 44, 61, 89, 88, 48, 94, 65, 92, 85, 36 +2(8:100), 83, 89, 58, 75, 84, 99, 33, 74 +1(15), 87, 65, 75, 89, 70, 54, 72, 68, 51, 36, 36, 66, 54, 56, 69 +2(7:50), 47, 65, 70, 95, 39, 54, 36 +1(10), 33, 40, 67, 74, 98, 78, 69, 46, 80, 85 +1(9), 76, 34, 31, 54, 85, 81, 99, 47, 72 +1(14), 69, 100, 49, 64, 88, 89, 84, 85, 44, 44, 51, 40, 77, 96 +2(8:50), 59, 42, 46, 63, 66, 48, 45, 38 +1(11), 83, 48, 34, 36, 91, 68, 68, 31, 100, 51, 86 +2(10:100), 35, 45, 65, 75, 95, 80, 69, 45, 51, 93 +1(7), 30, 49, 84, 69, 48, 68, 68 +1(9), 80, 44, 37, 35, 67, 64, 69, 100, 53 +1(10), 49, 31, 74, 92, 87, 45, 66, 67, 47, 91 +2(10:100), 68, 63, 71, 88, 75, 40, 32, 77, 91, 37 +1(5), 50, 93, 72, 30, 55 +1(6), 31, 67, 74, 91, 45, 99 Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c Mon Jan 28 01:09:41 2008 @@ -0,0 +1,78 @@ +/* + * packet.c - Implementation of the packet interface + * + * This file is a part of the NetBench suite by Gokhan Memik + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * You are welcome to use, share and improve this + * source file. You are forbidden to forbid anyone else to use, share + * and improve what you give them. + * + */ + +#include +#include +#include "packet_lengths.h" +#include "headers.h" +#include "packet.h" + +/* Traces automatically drop the TCP checksum and urgent pointer, so header is 36 bytes */ +#define HEADER_SIZE 36 +int packets_processed = 0; + +#ifdef CONSTANT_PACKET +unsigned int packet_index = 0; +#endif + +char * +get_next_packet () +{ + char *packet; + unsigned int packet_length; + + if (packets_processed == MAX_PACKETS) + { + fprintf (stderr, "All packets (%d) processed, recompile with larger MAX_PACKETS \n", MAX_PACKETS); + exit (1); + } + + packet_length = (packet_lengths[packets_processed]); + if (packet_length < 40) + { + /* Should never happen */ + fprintf (stderr, "Packet not large enough, increasing the size\n"); + packet_length = 40; + } + +#ifdef CONSTANT_PACKET + /* Packets are stored in a continuous chunk in the memory, just change the index... */ + packet = &packets[packet_index]; + packet_index += packet_length; +#else + /* Have to call malloc to create packet memory */ + if ((packet = (char *) malloc (packet_length)) == NULL) + { + fprintf (stderr, "Not enough space to create packet data \n"); + exit (1); + } + + /* Copy the header information */ + memcpy ((void *)packet, (void *)headers[packets_processed], HEADER_SIZE); +#endif + + packets_processed ++; + return packet; +} + +/* For debugging purposes, to get the size of the packet_numberth packet */ +unsigned int +packet_size (unsigned int packet_number) +{ + if (packet_number == MAX_PACKETS) + return (packet_lengths[packets_processed]); + else return (packet_lengths[packet_number]); +} Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h Mon Jan 28 01:09:41 2008 @@ -0,0 +1,22 @@ +/* + * packet.h - Interface for reading packet information + * + * This file is a part of the NetBench suite by Gokhan Memik + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * You are welcome to use, share and improve this + * source file. You are forbidden to forbid anyone else to use, share + * and improve what you give them. + * + */ +#define MAX_PACKETS 1500 + +char *get_next_packet (); + +/* For testing...*/ +unsigned int packet_size (unsigned int); + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet_lengths.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet_lengths.h?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet_lengths.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet_lengths.h Mon Jan 28 01:09:41 2008 @@ -0,0 +1,10002 @@ +unsigned int packet_lengths[10000] = { +60, +1579, +274, +9552, +256, +56462, +26624, +256, +6688, +64768, +42206, +51431, +538, +2941, +31750, +6699, +15012, +17221, +124, +6465, +63439, +56970, +40, +256, +6307, +4350, +118, +9729, +15012, +56481, +54751, +61, +5888, +29700, +4224, +267, +52, +36699, +1536, +5122, +4164, +276, +1839, +57017, +27951, +35920, +35330, +17664, +124, +2048, +19382, +14588, +7936, +539, +42206, +63750, +14394, +1500, +4864, +53085, +59962, +56462, +9809, +42206, +16384, +551, +20496, +40, +14342, +3174, +32006, +256, +27102, +19537, +61054, +1500, +9299, +62464, +46947, +15012, +17664, +15360, +1099, +93, +56418, +19383, +29196, +256, +10089, +256, +24882, +513, +249, +24145, +17664, +56462, +6178, +56, +256, +36189, +60076, +35329, +40, +63271, +28730, +56462, +1216, +257, +46998, +257, +10440, +4864, +63271, +40, +282, +36563, +20504, +16384, +14394, +16384, +256, +56970, +8654, +47104, +1792, +10089, +17664, +47061, +15012, +56331, +4864, +20496, +36119, +123, +10089, +4128, +14394, +10344, +1262, +21328, +39115, +24655, +56477, +112, +10468, +11013, +26724, +58693, +44933, +35330, +1500, +4576, +1863, +42206, +44608, +12032, +4130, +35329, +38912, +44289, +22096, +47864, +47616, +13294, +14394, +56380, +63103, +62281, +42206, +13441, +37312, +19383, +15012, +31750, +29197, +15012, +1024, +261, +55, +63766, +114, +113, +34117, +43742, +19724, +6409, +52708, +4164, +35329, +17664, +125, +57375, +53064, +24645, +7351, +2120, +953, +2395, +53306, +514, +61, +51557, +222, +6177, +124, +4576, +45370, +56656, +2048, +60427, +514, +35329, +1024, +5127, +39448, +39276, +50787, +260, +35329, +19869, +260, +16794, +56321, +53760, +14080, +65055, +514, +514, +17664, +253, +1912, +2481, +20496, +1574, +8630, +37445, +30982, +282, +39489, +31515, +46405, +64513, +118, +256, +538, +65204, +16384, +12032, +6176, +42206, +1866, +43264, +6212, +304, +57289, +4576, +20521, +11470, +2048, +11834, +1500, +74, +51800, +23888, +697, +16384, +11264, +20485, +4890, +12422, +35330, +54459, +16384, +2048, +263, +222, +50512, +56416, +5137, +42206, +56970, +56951, +28741, +1024, +651, +35329, +5959, +10576, +56418, +2048, +5632, +774, +65297, +2816, +1839, +21140, +56970, +42994, +64133, +16384, +2048, +34560, +23957, +56970, +56370, +56832, +6760, +13518, +65024, +515, +18245, +53, +43008, +11034, +18702, +15012, +14402, +64197, +56489, +50899, +32006, +259, +50899, +42206, +14394, +63750, +48935, +56970, +249, +1099, +8760, +16384, +1099, +8760, +50432, +47180, +56970, +63750, +4864, +7493, +28443, +18768, +259, +32768, +5120, +6178, +40, +56, +27816, +56970, +16384, +12141, +20496, +40, +5120, +27102, +259, +16384, +5120, +26915, +35329, +353, +27951, +56970, +16384, +10089, +15012, +259, +11050, +44716, +4576, +8760, +17664, +5120, +10089, +39046, +56, +5120, +6178, +17664, +1032, +528, +25601, +15012, +17664, +16384, +27102, +15012, +56, +5632, +20504, +30726, +46848, +256, +27102, +14394, +259, +56, +4608, +5122, +56979, +56970, +14592, +5888, +3000, +58077, +52, +6400, +56656, +17664, +48325, +64000, +17218, +975, +16384, +7424, +6798, +37461, +15012, +61253, +16384, +8375, +28928, +8665, +259, +50699, +1012, +256, +3589, +20496, +259, +39106, +1287, +36604, +31856, +125, +1738, +256, +36615, +47917, +32784, +1039, +16468, +12362, +8760, +35329, +49250, +9728, +57004, +4421, +31238, +64000, +30550, +6394, +21061, +3840, +51463, +40381, +9216, +16384, +21313, +8760, +15012, +516, +59504, +1759, +5970, +15012, +56199, +4950, +15012, +576, +31910, +256, +6688, +67, +15012, +56970, +56383, +57358, +1836, +39106, +38970, +42206, +39807, +24912, +16384, +21912, +256, +26481, +20496, +56970, +59102, +17101, +65194, +50268, +16384, +56161, +35330, +35329, +17664, +651, +4157, +47429, +18949, +5221, +35329, +119, +3840, +18946, +17520, +260, +5632, +25547, +1275, +2048, +26981, +29319, +14394, +32512, +2816, +41897, +35330, +4580, +28218, +52, +1615, +3847, +651, +15012, +517, +1784, +263, +26915, +42206, +651, +24539, +19258, +261, +30214, +7312, +19960, +15012, +17664, +37307, +15012, +51918, +250, +6173, +30621, +3847, +56161, +6177, +60, +31750, +512, +26724, +51301, +24912, +35439, +10330, +3840, +2941, +17664, +256, +20504, +261, +1778, +4164, +15012, +17664, +249, +8708, +58596, +27984, +56970, +261, +1550, +11116, +3771, +20504, +10485, +2048, +56970, +32581, +31750, +2048, +13058, +2390, +56970, +256, +2390, +8665, +17664, +46001, +256, +17622, +517, +256, +7444, +127, +38213, +10407, +1032, +36421, +31238, +4950, +21562, +1572, +23993, +47681, +42206, +256, +36949, +44368, +518, +56456, +31245, +39248, +56970, +34629, +22518, +17622, +14160, +22737, +13560, +50843, +4130, +33228, +1681, +80, +29786, +18402, +31719, +1702, +35788, +35330, +1690, +31750, +2048, +51712, +22077, +518, +16384, +256, +1360, +6736, +8760, +17664, +1620, +263, +18968, +13388, +20496, +35329, +1866, +58077, +17664, +8760, +17664, +41, +24025, +42206, +17391, +58, +1769, +30214, +416, +13340, +56970, +118, +18949, +23888, +35329, +16384, +3840, +6760, +20496, +519, +124, +256, +56400, +53562, +17664, +124, +3072, +5146, +52, +1536, +7424, +1222, +263, +3328, +46874, +51, +27951, +4130, +42206, +519, +1500, +21153, +6178, +42206, +119, +16077, +58, +15283, +6144, +4164, +48197, +1024, +222, +22096, +1951, +16384, +26112, +5200, +17664, +53672, +4171, +124, +35608, +24539, +4164, +42206, +13562, +1024, +10496, +6307, +17520, +1500, +125, +5632, +8200, +46149, +5632, +28417, +56970, +20496, +52, +1679, +31845, +65278, +16384, +6346, +39130, +56970, +17680, +119, +2500, +300, +7832, +4171, +35329, +30470, +3584, +256, +43559, +56523, +15012, +22808, +124, +282, +40882, +2993, +42810, +17664, +4497, +10496, +56161, +51, +20496, +15012, +56645, +3840, +6699, +24912, +35329, +124, +20496, +17520, +17664, +31750, +282, +31488, +53880, +35329, +28730, +25951, +24912, +42206, +30726, +274, +520, +10496, +65024, +35329, +8760, +10324, +266, +655, +27951, +13136, +7814, +59311, +256, +9084, +20496, +56970, +17664, +30470, +2560, +56970, +41, +256, +49664, +4130, +521, +256, +10089, +521, +31750, +2048, +7426, +2395, +2384, +14829, +64256, +5381, +47334, +521, +1775, +8760, +1572, +8197, +8760, +39168, +47386, +15012, +62396, +1572, +14394, +56331, +5120, +27102, +36755, +3007, +256, +8760, +4864, +28607, +56970, +14342, +5120, +12032, +1500, +5120, +20970, +15012, +62475, +54, +10089, +47420, +56970, +26927, +7680, +2388, +56979, +13136, +50490, +36303, +256, +60696, +56970, +17664, +47616, +38827, +17664, +263, +45639, +47828, +256, +4130, +4107, +5120, +49878, +63750, +353, +8760, +521, +50432, +19968, +6208, +35329, +56331, +159, +56970, +2511, +48, +5343, +64551, +40, +1207, +22586, +60940, +56970, +16384, +30726, +54864, +17664, +99, +11013, +32730, +17680, +63750, +20496, +15012, +63673, +36578, +49400, +732, +159, +56970, +19428, +30197, +256, +61005, +15012, +266, +64006, +9216, +5122, +22934, +42206, +266, +17664, +80, +35329, +40, +118, +1035, +1058, +15012, +44869, +40, +31750, +50688, +256, +15012, +124, +9984, +8207, +60866, +522, +6699, +57199, +31494, +14030, +8079, +42206, +17664, +16384, +256, +51514, +34824, +32784, +43637, +11520, +7287, +21174, +47584, +256, +31502, +8760, +42206, +119, +20594, +13136, +2765, +120, +4160, +261, +2048, +1082, +32784, +522, +8582, +35608, +47616, +56478, +256, +3106, +46829, +17664, +522, +16384, +512, +4128, +124, +56951, +36154, +35329, +56342, +27904, +1163, +6166, +35329, +57793, +27238, +512, +24212, +56970, +37411, +1662, +256, +18178, +27951, +4130, +23715, +120, +4608, +6699, +655, +48384, +4351, +40, +48128, +263, +11017, +56656, +52480, +59604, +2096, +8464, +35330, +1557, +64065, +40283, +16384, +22914, +14416, +2984, +61238, +42206, +56410, +26297, +256, +5961, +7504, +267, +56970, +17664, +21607, +51716, +35330, +111, +40077, +27205, +6077, +28672, +34665, +2534, +35329, +256, +267, +28730, +59689, +6869, +35330, +17664, +16384, +768, +11780, +4130, +256, +11856, +42206, +43670, +115, +3072, +27951, +60752, +3086, +16384, +38144, +20816, +35329, +16384, +8080, +7931, +14301, +51716, +5325, +51525, +122, +260, +2941, +11482, +51542, +16849, +59216, +37888, +6178, +56901, +2048, +58077, +35330, +65525, +32262, +2816, +18871, +33053, +43, +655, +42206, +119, +15012, +3212, +16384, +58112, +17440, +8684, +2816, +6699, +64771, +15012, +35329, +3237, +256, +22709, +56970, +3262, +48, +252, +21251, +4288, +56970, +69, +52992, +256, +1165, +15283, +4130, +4096, +256, +11022, +42206, +40997, +19978, +15012, +32006, +5310, +42, +42206, +16384, +6912, +9473, +42206, +23365, +5632, +655, +12803, +15622, +50047, +28730, +17664, +11034, +525, +1612, +23376, +20496, +1686, +51, +269, +1500, +9984, +36839, +31245, +42206, +31750, +25858, +6774, +21840, +17664, +1500, +2388, +35329, +56901, +16384, +1642, +1360, +54751, +24561, +3072, +15012, +269, +47660, +87, +18032, +71, +80, +14596, +11017, +27142, +269, +17477, +1662, +25344, +2363, +42206, +5120, +14080, +5127, +65076, +49201, +125, +3328, +13294, +20496, +35329, +25214, +256, +11530, +42206, +1163, +6177, +2048, +58077, +20497, +3558, +1839, +35330, +4096, +63267, +33244, +51719, +40438, +42206, +17856, +59392, +576, +3632, +3637, +12288, +26704, +17446, +1662, +27461, +10446, +256, +42206, +14394, +45332, +31528, +49210, +17664, +29446, +39760, +56331, +1099, +35330, +27648, +8760, +26880, +31245, +51002, +63750, +369, +46976, +3048, +19386, +42206, +11264, +12711, +24752, +16384, +256, +8760, +56970, +1500, +23296, +12809, +27102, +35330, +36404, +494, +56979, +36270, +47734, +15012, +56462, +47751, +42206, +1639, +24836, +27102, +3397, +36266, +256, +336, +16001, +20736, +24836, +54016, +6178, +56970, +40, +1723, +20496, +41728, +6760, +56979, +65201, +16384, +56656, +58880, +6688, +20496, +15012, +10089, +526, +5888, +47785, +35330, +63750, +34599, +4129, +4864, +36524, +17520, +3909, +56, +256, +5122, +20496, +56970, +6869, +13830, +11008, +35330, +1360, +40263, +56420, +17330, +1163, +47819, +1024, +26877, +50501, +63744, +23957, +15012, +122, +1714, +256, +35091, +18757, +37573, +49920, +20496, +17664, +256, +21288, +20496, +256, +44368, +41, +52, +1280, +25773, +256, +32262, +32961, +41285, +1779, +256, +57017, +20504, +78, +17664, +3979, +42206, +44294, +35586, +15984, +33866, +7936, +62457, +15012, +256, +24389, +1539, +1024, +44201, +8011, +30265, +7232, +3840, +1792, +3630, +43870, +56971, +124, +18970, +538, +56971, +14661, +1662, +21504, +8661, +256, +256, +6346, +19728, +10478, +280, +6960, +56971, +30726, +35073, +256, +1024, +32784, +17664, +16384, +41, +58, +17664, +31494, +44544, +4351, +16384, +55552, +8760, +1686, +19761, +12803, +42206, +513, +1648, +27156, +42206, +513, +1653, +6869, +35585, +1500, +31750, +256, +13058, +17406, +16384, +65282, +257, +43008, +256, +11009, +34128, +314, +56432, +27331, +20496, +35585, +8976, +4864, +9478, +2466, +58, +48307, +538, +15012, +1622, +52584, +45294, +43870, +16384, +16640, +34628, +3085, +4130, +23109, +56576, +256, +27102, +56332, +4864, +15012, +31761, +256, +27102, +62021, +33982, +12071, +49862, +9263, +47927, +24645, +10089, +513, +48027, +10089, +513, +37888, +113, +56971, +51399, +31494, +5120, +63271, +56971, +16384, +31855, +20304, +10345, +27207, +24576, +63271, +20504, +257, +10345, +4432, +27102, +42206, +53061, +1024, +11524, +20496, +16896, +10429, +256, +1059, +20496, +489, +4537, +20496, +17664, +4864, +47373, +32069, +1368, +20504, +23598, +62621, +65286, +258, +63813, +49920, +256, +27102, +35586, +29702, +5120, +27102, +35585, +3122, +24576, +6178, +7443, +63750, +44294, +42206, +9603, +16384, +5120, +21504, +56979, +10924, +17664, +31494, +14862, +7620, +42206, +63750, +48053, +45062, +5120, +15012, +38783, +19200, +15757, +15012, +1719, +256, +51716, +33018, +258, +17664, +34560, +2466, +47427, +42206, +49668, +24576, +3072, +49350, +4130, +135, +1638, +1262, +36578, +11498, +51730, +39183, +680, +49152, +1765, +24576, +11290, +18334, +22570, +35586, +27973, +52, +1105, +42, +15012, +5239, +63750, +19387, +39846, +35586, +249, +16032, +56979, +35586, +10496, +59595, +36421, +256, +11017, +27102, +256, +10089, +28730, +120, +1099, +4154, +17664, +249, +289, +15012, +63750, +24836, +8760, +56332, +27102, +35585, +3157, +4864, +4130, +4864, +48235, +35585, +40, +24836, +52867, +14342, +512, +63271, +36078, +36208, +84, +1216, +41808, +733, +123, +353, +27102, +15012, +48197, +16384, +2048, +58298, +32736, +4864, +35585, +96, +841, +47696, +55621, +33828, +4864, +14394, +10746, +114, +353, +10089, +9190, +42239, +125, +512, +353, +37707, +35586, +17664, +1570, +280, +20480, +41770, +820, +13398, +1629, +45544, +43578, +31750, +12032, +20504, +31750, +256, +4327, +51, +15012, +853, +58077, +55866, +5445, +50552, +1755, +57, +10510, +14336, +48698, +17664, +41216, +8201, +11268, +53085, +56511, +48607, +39424, +7789, +4224, +16384, +25600, +43148, +259, +32837, +25242, +46860, +42222, +4164, +40, +16384, +31761, +256, +90, +63, +11119, +14394, +56971, +10264, +13760, +259, +124, +32662, +14336, +17520, +56508, +22272, +19968, +17664, +25626, +4129, +35585, +29446, +38981, +28730, +16384, +4432, +60808, +59042, +1003, +42013, +4129, +28741, +256, +10752, +123, +27951, +720, +1500, +31249, +21504, +11034, +27951, +52558, +42206, +13736, +361, +11008, +20496, +42206, +15012, +1024, +1410, +4164, +21802, +58769, +58962, +58077, +61572, +31750, +11911, +20239, +9285, +2366, +21646, +62522, +124, +27136, +35585, +38252, +3923, +901, +35585, +1362, +38400, +17664, +21639, +45326, +8760, +58539, +222, +1500, +20737, +35585, +47872, +56951, +56462, +2246, +35585, +256, +20496, +11077, +57631, +19678, +25773, +260, +16384, +1500, +1280, +40, +256, +25773, +15012, +8150, +2048, +62690, +44101, +8167, +260, +517, +256, +20504, +6725, +124, +56577, +28674, +42309, +1621, +65063, +8962, +17664, +56418, +2609, +58698, +6159, +64774, +18178, +1222, +118, +1327, +35585, +457, +49563, +252, +35074, +28730, +1333, +37378, +256, +36930, +10468, +508, +16384, +656, +6178, +1280, +64000, +22064, +21316, +10468, +8218, +1715, +2048, +56951, +25294, +1280, +1391, +37946, +31381, +125, +67, +4288, +1422, +121, +21333, +32768, +35586, +1703, +3088, +35585, +20104, +261, +16384, +1453, +517, +35585, +12421, +31750, +256, +2808, +58, +261, +29758, +222, +28730, +51055, +56832, +56971, +17664, +38656, +256, +2388, +39444, +42206, +2539, +124, +778, +6699, +12229, +22750, +35586, +16384, +256, +1360, +503, +6178, +1500, +1709, +4130, +262, +10340, +42206, +1566, +538, +44368, +46661, +8192, +56971, +3397, +1280, +24451, +59188, +15012, +262, +21353, +53187, +16568, +1536, +290, +32826, +1664, +27005, +39943, +65221, +8360, +5888, +31380, +26411, +262, +40, +32448, +25088, +53120, +50385, +12544, +1222, +56971, +47182, +31750, +8249, +24539, +15012, +282, +64212, +6159, +56971, +56518, +30470, +60269, +14394, +17664, +16384, +8704, +3847, +6345, +43600, +35585, +16384, +2048, +652, +65201, +17664, +13754, +15012, +1760, +8798, +28730, +42206, +1615, +256, +6346, +3605, +14394, +124, +29440, +33399, +20816, +1129, +31246, +228, +35586, +1923, +1500, +30726, +1836, +652, +57199, +31238, +1098, +28060, +5712, +42565, +41276, +15910, +1453, +33433, +4130, +35585, +16384, +39680, +80, +25951, +16794, +58181, +31494, +6699, +20496, +16384, +29319, +55990, +3106, +53683, +42206, +16384, +256, +45417, +65194, +17664, +15872, +11034, +10720, +58, +1774, +26724, +656, +7504, +35585, +16384, +1663, +1165, +29818, +35699, +4164, +8760, +135, +256, +42206, +14342, +52, +3589, +14333, +30001, +45970, +2369, +1091, +30080, +35586, +10365, +123, +6688, +1082, +23632, +15012, +2199, +10565, +56520, +49299, +8417, +15012, +56355, +45662, +12032, +80, +14394, +11333, +16384, +13568, +28820, +56971, +30726, +61175, +20496, +139, +42, +264, +2278, +32006, +106, +33796, +42206, +19484, +42206, +6207, +1536, +28496, +17664, +63750, +4864, +16794, +35586, +16384, +27015, +4130, +14394, +1500, +256, +27102, +256, +56979, +56971, +5120, +274, +6204, +53760, +48389, +6177, +52736, +25626, +19388, +7464, +32006, +61175, +15632, +521, +1776, +353, +521, +17664, +9163, +353, +15012, +48140, +61175, +14394, +19200, +256, +48458, +56971, +3211, +56979, +14736, +40, +14342, +256, +1262, +27102, +4164, +16384, +5120, +12041, +31087, +20496, +19489, +125, +45, +538, +44, +15012, +35586, +44, +301, +15012, +35586, +1334, +15012, +249, +4864, +1688, +35586, +1574, +4864, +49950, +256, +56979, +43589, +1574, +1216, +35408, +15012, +1677, +11034, +30550, +56971, +16384, +256, +353, +20857, +42206, +521, +31750, +8960, +13568, +40528, +42206, +17664, +124, +256, +49, +4224, +35586, +45469, +16384, +256, +51723, +28544, +2497, +16384, +14848, +2304, +6869, +265, +97, +11264, +17664, +4171, +35585, +22645, +59648, +1801, +24084, +56971, +27200, +2547, +521, +56971, +7439, +15012, +17664, +1361, +5122, +12329, +2015, +1572, +31750, +6699, +15005, +32080, +2581, +1622, +35952, +4112, +42206, +55552, +2609, +35393, +35585, +58949, +1649, +4888, +2467, +42206, +38144, +1208, +17218, +56971, +2633, +123, +4352, +2048, +656, +47184, +56971, +62208, +6798, +17664, +5248, +25620, +30214, +25601, +51514, +35585, +40, +39680, +25626, +2384, +8760, +31165, +30726, +40308, +15113, +28730, +35586, +30726, +538, +42206, +42206, +2747, +119, +63750, +6918, +6177, +56971, +2773, +45972, +1031, +13058, +42206, +56475, +965, +26724, +2048, +14665, +35585, +249, +2962, +35453, +35408, +35585, +122, +1762, +11034, +49664, +42206, +31750, +2481, +58118, +42206, +30533, +16384, +7351, +41728, +7789, +16223, +4531, +58, +29702, +1280, +6178, +253, +20737, +64518, +16925, +16384, +3584, +8080, +2986, +56418, +2048, +768, +16829, +32080, +1280, +21374, +17664, +1361, +12317, +49240, +2048, +8207, +50142, +20496, +16384, +19975, +6307, +6177, +523, +256, +1897, +6465, +17664, +13732, +2072, +5325, +523, +37278, +5325, +21573, +111, +47836, +56491, +125, +58819, +57567, +13312, +1077, +42206, +3072, +57304, +15012, +17664, +6346, +45417, +42206, +37892, +5781, +41797, +249, +4864, +33070, +3077, +15012, +249, +27005, +56979, +56971, +63750, +1099, +57199, +268, +30726, +31311, +50304, +17664, +120, +63271, +33506, +3101, +1500, +256, +6178, +56979, +5120, +56979, +17664, +4864, +31087, +14394, +6469, +9116, +19390, +11348, +14342, +256, +10846, +8760, +11716, +3254, +1024, +40167, +268, +9797, +6346, +55691, +33605, +1571, +61175, +56122, +22853, +256, +61175, +6175, +268, +57, +256, +48715, +15012, +376, +51712, +43066, +18820, +10345, +36137, +105, +33792, +8760, +17664, +96, +44, +7174, +26167, +13882, +5120, +10089, +8005, +1571, +15143, +56971, +1790, +15012, +43357, +353, +27102, +15012, +36373, +11154, +256, +5961, +20496, +4164, +35586, +24901, +116, +24576, +1091, +6380, +10810, +40, +3335, +901, +42206, +524, +12470, +124, +4608, +256, +56979, +15012, +268, +16384, +80, +19390, +24820, +13398, +3585, +58298, +58, +124, +36318, +55045, +124, +37889, +56971, +124, +2048, +17664, +10249, +44428, +17664, +22570, +5684, +1304, +122, +13568, +8192, +29204, +6177, +525, +15622, +256, +12218, +42206, +16384, +266, +26481, +49210, +31813, +16384, +256, +28999, +7201, +42206, +3373, +3648, +10392, +8758, +13991, +15745, +40859, +44289, +269, +52293, +5120, +20496, +364, +8576, +1500, +53454, +1288, +16829, +19795, +4130, +3430, +16559, +36352, +8197, +20504, +3435, +1500, +45568, +3271, +59255, +56971, +17664, +252, +36578, +1024, +15012, +1617, +63271, +4666, +17664, +15360, +2048, +14658, +35586, +1567, +31744, +10752, +19436, +1242, +32006, +282, +65050, +33070, +20504, +50471, +32000, +14394, +3277, +1099, +15012, +3281, +19390, +42206, +3284, +48829, +35586, +9077, +10089, +35586, +19390, +4164, +3545, +152, +6178, +16384, +45863, +16384, +1262, +15012, +56332, +24836, +37552, +269, +56, +353, +14394, +31750, +56971, +249, +27102, +3051, +20496, +16384, +10089, +55365, +1262, +29312, +40, +19200, +19391, +35586, +353, +58, +256, +28114, +3581, +48955, +3585, +99, +24836, +48967, +15012, +17664, +10089, +58949, +256, +22439, +35586, +62476, +4130, +17664, +9533, +512, +3602, +63750, +1677, +63271, +34874, +24663, +6699, +49152, +17165, +17956, +2048, +8981, +22586, +3840, +1032, +56413, +35585, +52, +6699, +15012, +1500, +124, +52992, +64204, +15012, +35586, +16384, +64071, +47880, +27102, +20504, +270, +16384, +34560, +35408, +62522, +3726, +10258, +7622, +25626, +43077, +31719, +4164, +10401, +35585, +56460, +135, +536, +38912, +19258, +77, +65483, +42055, +512, +526, +56971, +7878, +84, +13568, +18256, +46405, +19477, +14394, +124, +12218, +10136, +16384, +56, +15012, +17664, +25406, +4666, +17664, +15012, +252, +36677, +36578, +31750, +256, +10094, +58, +15012, +17664, +16384, +35586, +44680, +64000, +45568, +30017, +51959, +8424, +125, +11008, +61100, +17664, +120, +902, +63439, +35586, +2048, +17520, +22016, +2562, +42206, +256, +11780, +1059, +40, +125, +512, +24120, +6173, +9649, +1500, +13317, +124, +1654, +38144, +2048, +1024, +17856, +6160, +249, +902, +42206, +63439, +56972, +41, +26724, +96, +46661, +115, +512, +6688, +35997, +20496, +17664, +8192, +20504, +256, +17664, +47647, +35841, +1695, +1024, +7424, +17619, +4224, +15012, +56972, +10319, +1124, +28218, +512, +179, +256, +1597, +65082, +53, +256, +62006, +33920, +42206, +1500, +80, +50402, +1024, +43870, +20504, +124, +4096, +1098, +46112, +11988, +58, +122, +14848, +4096, +6960, +23376, +42206, +137, +1147, +31311, +56972, +60132, +125, +6688, +38162, +56972, +17664, +10086, +56972, +54853, +6699, +56972, +16384, +52, +13440, +20504, +35841, +31750, +8704, +4350, +10317, +16384, +8425, +20504, +16384, +19391, +42206, +71, +56979, +42206, +63750, +8760, +17664, +48719, +56972, +16384, +6178, +5120, +56333, +529, +61859, +35842, +1028, +10346, +19391, +42206, +56333, +1099, +42206, +56333, +256, +56979, +17664, +30470, +9998, +7504, +52172, +14394, +58693, +5120, +1222, +15012, +17664, +120, +24836, +6145, +45370, +31750, +15012, +12357, +14342, +25651, +56972, +20942, +38895, +42352, +43967, +15012, +343, +25343, +11034, +49206, +35842, +357, +249, +16763, +56972, +17664, +4130, +56972, +62208, +49240, +65188, +1573, +13882, +366, +256, +9729, +42042, +37707, +56972, +30464, +4864, +6869, +1283, +6394, +56972, +23350, +1360, +42885, +9631, +6346, +36684, +16472, +55065, +14394, +10346, +2469, +5712, +61545, +1024, +261, +49280, +47669, +30464, +42206, +25580, +56972, +118, +256, +6688, +4111, +15012, +257, +31750, +256, +6409, +11722, +26170, +476, +1500, +301, +6970, +23109, +56545, +31750, +25603, +42206, +256, +20484, +62522, +10372, +1624, +256, +3840, +6346, +20916, +524, +49920, +25626, +4224, +546, +31238, +2816, +51770, +58, +35842, +52, +6021, +256, +51463, +39272, +4351, +16384, +39272, +35842, +252, +512, +15012, +2048, +50000, +48186, +17664, +8304, +514, +56133, +56600, +51777, +47685, +16384, +6688, +4351, +34814, +1024, +14908, +6212, +56972, +7704, +18859, +19392, +19781, +1638, +45417, +6178, +42206, +30982, +1024, +13576, +51823, +29697, +42435, +28730, +32006, +1024, +260, +3328, +14394, +60, +3840, +55270, +58, +57755, +41984, +32031, +514, +56320, +16599, +59912, +56457, +9472, +2941, +124, +256, +6699, +36124, +754, +56614, +56972, +1280, +6869, +17664, +125, +2048, +1500, +15012, +1774, +6400, +64595, +35842, +249, +8760, +56333, +256, +6178, +23552, +56972, +16384, +4864, +8760, +1500, +19392, +35842, +249, +1099, +35841, +52745, +768, +27102, +20496, +17664, +53504, +353, +56979, +2304, +26373, +56979, +56333, +10089, +60741, +12289, +249, +8760, +17664, +159, +10089, +8784, +15012, +14413, +14342, +6346, +32736, +40, +46642, +20483, +42294, +20496, +17664, +1725, +256, +9697, +17664, +58624, +53031, +10346, +25936, +1500, +1642, +42206, +1537, +94, +4130, +20235, +20496, +17664, +36032, +1341, +17218, +56972, +17664, +252, +453, +26981, +58, +886, +4585, +9217, +20496, +892, +56950, +38336, +4164, +35841, +6409, +2452, +10328, +42206, +124, +159, +1165, +14658, +20496, +15012, +28485, +56, +57243, +8888, +40253, +27984, +58, +56972, +1624, +35841, +16384, +56, +417, +1262, +40214, +49494, +959, +1688, +720, +9029, +125, +256, +41434, +27005, +15012, +1291, +28999, +57308, +35842, +1280, +11072, +41434, +1776, +29161, +15012, +16894, +29958, +265, +56972, +19264, +51723, +516, +7453, +106, +8668, +27136, +8926, +42206, +16384, +62134, +282, +6688, +15012, +16384, +10752, +57199, +260, +6869, +17664, +1024, +56972, +18944, +27005, +6667, +19393, +28730, +17664, +47898, +35842, +25925, +16384, +1099, +39991, +43088, +15012, +16384, +61780, +20504, +56348, +5888, +282, +42, +15012, +1500, +256, +16666, +15012, +1500, +2048, +28447, +35842, +34304, +49502, +35842, +1500, +13312, +56979, +1500, +42206, +56333, +4130, +16384, +19393, +516, +256, +14394, +123, +61175, +56144, +256, +14394, +27219, +1098, +327, +1262, +4130, +56333, +256, +56979, +1482, +8918, +63271, +35842, +1557, +56979, +1262, +26724, +261, +22081, +36007, +1024, +60240, +6706, +27229, +50401, +3072, +56979, +8760, +42206, +5120, +55079, +38981, +2905, +56972, +16384, +20720, +35841, +16384, +40960, +6688, +56979, +3942, +56972, +628, +31750, +5120, +30466, +42160, +1099, +17025, +517, +30214, +256, +60473, +39604, +42206, +17664, +4352, +7168, +37892, +42206, +38725, +1538, +256, +20504, +17664, +125, +2560, +35079, +3976, +14394, +30211, +31750, +3051, +1688, +29568, +56972, +125, +78, +57, +6179, +39692, +8829, +282, +6177, +45125, +10402, +31750, +113, +20504, +1462, +56339, +62208, +51463, +11524, +20504, +15012, +124, +2048, +35152, +1500, +13568, +37889, +1518, +8218, +63627, +3840, +20496, +21573, +64204, +11032, +39846, +56972, +63750, +16641, +13882, +29253, +1777, +1285, +33253, +14394, +49221, +1539, +6699, +59392, +6240, +12488, +119, +1777, +1866, +149, +4129, +518, +40, +30981, +256, +56161, +14394, +35841, +1738, +37039, +8364, +41530, +123, +256, +370, +15012, +226, +16384, +6346, +4224, +42206, +34028, +1500, +61, +29568, +1764, +256, +6760, +1718, +10323, +14854, +47908, +51536, +49210, +4432, +30671, +6208, +262, +12357, +56460, +15646, +20496, +35841, +3942, +35841, +10422, +31494, +24416, +28730, +19731, +18949, +56972, +50555, +57519, +592, +212, +7983, +4272, +14978, +32730, +16384, +1612, +1287, +14658, +49210, +1579, +512, +9998, +8188, +17664, +25098, +39805, +84, +2213, +5200, +35842, +1500, +1759, +50459, +61572, +17664, +9728, +479, +15012, +56, +1453, +48175, +28218, +35842, +282, +49485, +16077, +57402, +1893, +1500, +256, +15012, +11264, +42028, +17518, +56972, +10475, +1759, +43507, +28218, +16384, +5120, +10089, +48197, +8894, +25851, +6213, +8890, +49787, +35842, +249, +39719, +519, +63750, +1099, +42206, +16384, +19394, +42206, +249, +56979, +17664, +63750, +19394, +63258, +35842, +1570, +49913, +17664, +35986, +717, +20504, +56972, +256, +36352, +1202, +56979, +6211, +40363, +10346, +1792, +5120, +80, +30145, +20496, +7424, +10089, +20504, +56972, +4864, +9729, +17232, +17664, +35830, +256, +3923, +49924, +57925, +717, +8760, +35842, +1574, +28218, +16384, +49951, +56972, +17664, +16384, +49958, +35841, +16384, +9342, +6380, +13882, +17664, +1601, +1262, +56378, +31238, +53, +61175, +49964, +1991, +29745, +2048, +15130, +20496, +8760, +519, +37445, +35808, +113, +2220, +1024, +49744, +35842, +16384, +10752, +63258, +14394, +59024, +17152, +57359, +63258, +35841, +17664, +20496, +263, +14342, +61175, +22608, +15012, +4677, +256, +9312, +31246, +6398, +2071, +124, +256, +20307, +15012, +119, +256, +3923, +28730, +17664, +6699, +6760, +122, +44032, +15360, +43889, +20496, +17664, +4306, +15104, +13689, +40, +13751, +256, +6688, +2128, +4350, +17664, +768, +4576, +49664, +56972, +40, +1650, +57199, +4350, +17664, +21598, +16566, +47461, +5840, +16384, +14592, +6688, +21402, +7789, +15012, +56493, +32006, +6688, +31901, +2213, +13341, +13568, +63032, +42206, +43883, +30470, +1280, +2222, +7673, +256, +6346, +11856, +1500, +57632, +55610, +49300, +122, +256, +8326, +252, +20496, +8960, +34560, +21407, +16384, +57017, +264, +35841, +2048, +8760, +9984, +19876, +56972, +13340, +37632, +8349, +39680, +33439, +6760, +35841, +20496, +42206, +47872, +4363, +36578, +49920, +31105, +42206, +17664, +512, +67, +265, +7424, +6960, +21306, +2360, +10754, +1556, +20485, +4164, +35842, +2377, +29446, +1629, +23710, +15012, +2386, +13859, +1754, +282, +14481, +720, +56972, +62080, +256, +8064, +15012, +15941, +355, +94, +42206, +29747, +16384, +17664, +20762, +11009, +56700, +33872, +45312, +20748, +62281, +8760, +15012, +40156, +16384, +256, +1024, +38162, +33251, +8250, +17664, +116, +2048, +27374, +20504, +35841, +1801, +15012, +256, +51112, +56576, +124, +256, +26724, +57361, +15012, +48402, +256, +6699, +24882, +15012, +5888, +2120, +19541, +32581, +52480, +50731, +6212, +35841, +117, +96, +652, +15012, +56530, +536, +4130, +29253, +45, +780, +15362, +28690, +124, +33441, +41384, +60474, +52, +1691, +256, +1880, +35841, +16384, +40, +35842, +266, +2048, +59728, +522, +16270, +8192, +22709, +20504, +15012, +17664, +118, +31716, +20496, +40, +1948, +1280, +49785, +2642, +30214, +6688, +30329, +58, +56972, +28216, +266, +31494, +51, +27951, +2668, +15012, +256, +61509, +256, +1839, +59985, +20496, +522, +32006, +56712, +2693, +17664, +31750, +40529, +35841, +20444, +15360, +58077, +60, +120, +1608, +5922, +63656, +522, +2048, +63656, +2395, +39676, +16384, +1723, +370, +55610, +1670, +3130, +29954, +20496, +15012, +16384, +4096, +37497, +8610, +13381, +16450, +8760, +2781, +56381, +2048, +8196, +40, +5658, +58298, +4127, +35841, +354, +96, +20487, +33251, +4164, +267, +17664, +26229, +1839, +52727, +48720, +28218, +56972, +2856, +64382, +2048, +28177, +50214, +28218, +14976, +51253, +62976, +6773, +20504, +64069, +1564, +44058, +33251, +6177, +34885, +16384, +6699, +56972, +17664, +16384, +44973, +52480, +2048, +717, +19395, +56972, +17664, +1098, +25773, +17828, +30145, +3808, +267, +44034, +11264, +65188, +1500, +124, +256, +6869, +27561, +16384, +512, +20496, +2927, +1500, +31750, +538, +62522, +17664, +16384, +2048, +2220, +49661, +4176, +44101, +28160, +27102, +1570, +49975, +16384, +18715, +523, +1567, +4864, +8760, +8842, +10089, +30277, +52727, +15684, +55877, +16384, +8836, +30146, +56972, +249, +40615, +4164, +35842, +1500, +1787, +49685, +19395, +1500, +794, +63271, +523, +31750, +4864, +10911, +16384, +4864, +8760, +40538, +56333, +2048, +52295, +4350, +34373, +19395, +42020, +249, +13576, +24290, +56, +52, +15872, +4130, +56972, +16384, +54528, +62976, +20496, +16384, +53, +1262, +33872, +16384, +18334, +9216, +45584, +2048, +353, +50141, +42206, +2999, +1716, +24832, +37707, +28218, +267, +60317, +45942, +24576, +265, +717, +17518, +523, +40, +57468, +1839, +56979, +3019, +5120, +8760, +16384, +42206, +3021, +42206, +2048, +15702, +267, +10279, +256, +31488, +56979, +35842, +16384, +1024, +27102, +6212, +17664, +51968, +51716, +48732, +35842, +35933, +5120, +63271, +4130, +35841, +10346, +28928, +282, +4164, +3043, +31494, +6175, +41595, +35842, +256, +52727, +27984, +267, +7168, +57375, +15332, +15012, +43772, +54274, +15012, +1617, +94, +45370, +49209, +6346, +94, +10713, +31238, +5325, +63813, +42206, +1759, +26724, +42, +35842, +13867, +10089, +9483, +15012, +17664, +1628, +4576, +370, +15012, +51904, +1964, +46160, +17664, +31238, +1280, +27005, +11008, +6398, +29958, +2816, +8356, +3923, +56972, +56401, +37888, +263, +46829, +4384, +49152, +359, +25850, +4115, +17664, +124, +4692, +4288, +40, +4576, +63258, +56972, +16384, +53, +11125, +6211, +17664, +20992, +35842, +27465, +524, +5640, +11012, +42206, +20452, +282, +4351, +124, +361, +17518, +10302, +39168, +28730, +60354, +2128, +15012, +32006, +31368, +8196, +21641, +3330, +113, +4637, +17518, +26693, +2048, +11201, +6398, +17664, +56972, +525, +1567, +11016, +20658, +58, +3356, +39767, +113, +11800, +22837, +42206, +17664, +27313, +8448, +1024, +12041, +8434, +38956, +35841, +16384, +2048, +20496, +42206, +31045, +2481, +48464, +14661, +123, +6699, +26981, +794, +21459, +28218, +123, +9984, +63258, +15012, +29745, +54, +6773, +924, +256, +30146, +20451, +3564, +256, +14394, +21048, +24064, +2855, +35842, +16384, +61175, +6178, +17664, +16384, +1099, +14394, +16384, +2220, +27102, +17664, +768, +15429, +8780, +525, +1676, +6773, +56972, +56, +56979, +42206, +3428, +16384, +6699, +63271, +6960, +32826, +56972, +14342, +4864, +14394, +56334, +2220, +27102, +42206, +628, +16384, +4864, +20496, +30221, +56458, +256, +49887, +6960, +6212, +35842, +16384, +16640, +21568, +56972, +27330, +256, +52727, +3463, +125, +256, +50409, +269, +16384, +717, +4677, +31761, +8081, +256, +8760, +36968, +63750, +52727, +37296, +1500, +1099, +6736, +56972, +8079, +6699, +49925, +50430, +56972, +3486, +32006, +4864, +15646, +19968, +4164, +269, +123, +20224, +28928, +2290, +717, +6736, +60395, +32863, +256, +49943, +21501, +35841, +17664, +6699, +45370, +12828, +49300, +56335, +17664, +125, +2048, +44058, +63660, +42206, +26110, +302, +20496, +42206, +54872, +56577, +35841, +1500, +31494, +5120, +2092, +6465, +56972, +126, +6918, +20496, +42206, +28928, +6869, +5267, +32006, +282, +41762, +20496, +35841, +17664, +45056, +388, +34798, +3574, +2048, +58298, +58781, +9984, +222, +35842, +124, +1885, +26481, +526, +17664, +56419, +1757, +1035, +36252, +50161, +270, +124, +256, +6145, +42214, +56972, +1760, +5632, +5120, +28730, +3644, +19373, +33624, +8760, +17664, +125, +15012, +21929, +17520, +1500, +1536, +5122, +6721, +65188, +16384, +1024, +59188, +15012, +56972, +256, +4224, +30214, +25936, +31290, +270, +125, +512, +16849, +20496, +526, +16384, +4625, +58596, +14394, +35841, +1720, +3840, +5961, +4130, +17664, +30055, +256, +4352, +11600, +4129, +270, +3772, +256, +28673, +4130, +46661, +48128, +1540, +42206, +256, +3924, +42464, +14394, +2373, +69, +3076, +42878, +21714, +47736, +56972, +1500, +27951, +65043, +1178, +4130, +19525, +1500, +16384, +6699, +2384, +42206, +16384, +1792, +35842, +64001, +15012, +20496, +59133, +6798, +55435, +15012, +25502, +2048, +20496, +3874, +2048, +63439, +527, +1759, +56577, +15012, +17664, +32262, +7168, +14658, +1436, +60051, +57359, +35841, +64518, +24882, +42206, +32006, +57199, +4129, +3902, +16384, +147, +295, +28730, +1500, +16384, +40529, +36729, +17792, +36656, +5781, +8659, +17664, +8760, +4531, +28416, +8400, +36098, +1500, +28416, +508, +1629, +34731, +40036, +4130, +56973, +3840, +55424, +10468, +97, +45240, +22031, +65082, +9925, +48224, +256, +1453, +41384, +65082, +45824, +57632, +56973, +16384, +508, +581, +16384, +13514, +6177, +13551, +6688, +15889, +42051, +52, +42206, +56463, +11008, +16384, +32466, +256, +1723, +56524, +20496, +56973, +60, +27951, +14661, +256, +36671, +1477, +50872, +4130, +8261, +1583, +43589, +16384, +20737, +17664, +8192, +6211, +16384, +256, +902, +30550, +42206, +40, +14238, +252, +44949, +56973, +12510, +1590, +11264, +53085, +47872, +15012, +3611, +8192, +256, +4864, +44949, +512, +50483, +42206, +32827, +8746, +50501, +31557, +24359, +51781, +1280, +36097, +63750, +263, +10089, +56973, +63750, +61175, +14394, +256, +10089, +31813, +35880, +14394, +10468, +24836, +8760, +3640, +8760, +38139, +256, +10089, +27102, +58192, +12613, +256, +63439, +36097, +64518, +20480, +33616, +16384, +31238, +361, +13542, +51258, +11012, +64549, +24084, +8760, +864, +58611, +17664, +8713, +19397, +20496, +1571, +50681, +8285, +42206, +187, +1631, +27102, +36098, +26317, +64549, +30544, +44357, +4864, +26724, +35863, +24836, +6211, +49733, +1032, +6992, +51813, +1024, +902, +15012, +282, +256, +26829, +37984, +14394, +36098, +8594, +216, +1216, +512, +42206, +10259, +13136, +60040, +5049, +1024, +90, +4130, +256, +2560, +201, +49210, +258, +15366, +512, +7148, +3664, +15012, +123, +7424, +51712, +56973, +40, +178, +7940, +28730, +257, +35747, +31750, +6912, +265, +902, +42206, +56973, +40074, +1297, +1193, +56656, +69, +1024, +31528, +36097, +13056, +34842, +17664, +2048, +3979, +27003, +58, +30054, +17664, +26880, +6688, +37090, +4159, +1500, +27398, +36578, +32350, +371, +36864, +1902, +60951, +15012, +10408, +10467, +388, +16384, +6224, +312, +256, +513, +11264, +46978, +35840, +56573, +30470, +25344, +26668, +59450, +16384, +52626, +20504, +4421, +56539, +6699, +260, +257, +40000, +1707, +15012, +124, +280, +513, +256, +1101, +40976, +36097, +16384, +256, +6145, +11600, +36097, +252, +953, +4351, +52, +7789, +58464, +59036, +256, +8192, +28485, +3584, +3075, +8760, +16384, +15685, +42206, +10447, +56973, +249, +10089, +1500, +19398, +27973, +4864, +42206, +13893, +19398, +56389, +1099, +56973, +256, +56979, +17664, +36875, +17664, +19398, +53829, +44175, +64920, +1099, +17664, +25424, +282, +1676, +1360, +37707, +4130, +56466, +35847, +1360, +14394, +56, +6175, +33955, +533, +353, +10534, +50854, +56973, +258, +14336, +50877, +514, +8670, +50983, +5120, +27003, +15012, +252, +1099, +514, +55296, +56979, +21573, +256, +15362, +16384, +1024, +43066, +55085, +7237, +37632, +57199, +249, +40984, +21867, +16384, +1712, +2816, +50436, +29523, +39366, +32826, +258, +1500, +61797, +14394, +36097, +576, +26660, +45922, +1885, +32043, +4130, +685, +56378, +256, +1144, +13032, +47133, +17664, +124, +137, +20485, +44945, +514, +51329, +122, +42, +51754, +1500, +29958, +256, +453, +24882, +36097, +5028, +74, +56656, +56463, +388, +4129, +64769, +11898, +258, +28296, +1248, +1753, +8192, +67, +8760, +799, +29190, +11268, +13058, +17664, +55552, +5122, +259, +32512, +260, +59245, +15012, +42206, +17664, +11520, +41472, +15012, +576, +14351, +3463, +20496, +15012, +10565, +16384, +32006, +42497, +3942, +36097, +256, +11018, +51712, +4227, +515, +13321, +31238, +6699, +40065, +63568, +1612, +282, +20341, +65278, +1500, +15130, +36097, +52, +253, +42829, +16976, +56463, +1280, +56833, +56654, +42206, +92, +50176, +948, +121, +256, +41256, +18178, +12032, +7228, +15012, +49705, +120, +256, +22906, +8760, +259, +29411, +29472, +42206, +2048, +15873, +15012, +17664, +50992, +55827, +1093, +32579, +35277, +1065, +20496, +6699, +6465, +16384, +20496, +57669, +256, +27102, +3714, +8760, +36098, +2048, +28455, +516, +50176, +19519, +2663, +249, +44, +51037, +56973, +1569, +1964, +27102, +36098, +24836, +14394, +56334, +50957, +17664, +10089, +40, +5120, +27102, +5878, +56419, +35819, +256, +353, +24882, +15012, +10347, +56979, +15012, +52, +125, +1262, +35579, +62277, +2048, +256, +353, +51117, +10347, +2220, +611, +31312, +1085, +3741, +19399, +36098, +117, +44032, +10089, +65278, +56339, +44032, +794, +28420, +20496, +42206, +31494, +1280, +1262, +657, +35623, +28218, +40, +43264, +27102, +17664, +65215, +2048, +657, +36354, +42206, +17664, +37153, +50031, +20496, +34555, +30468, +1957, +1130, +17664, +58615, +7168, +11125, +15360, +20496, +22016, +2220, +17518, +42206, +4165, +16384, +7164, +11008, +56973, +36098, +33954, +124, +41552, +55610, +24832, +90, +30147, +13392, +56973, +44058, +50071, +42206, +31494, +63744, +46181, +4154, +45381, +16384, +6699, +50087, +36097, +1500, +5093, +13576, +4422, +23203, +1500, +768, +11016, +31488, +23211, +40, +178, +53, +717, +4979, +42206, +1233, +17664, +41863, +256, +1092, +17218, +36097, +40, +16384, +1091, +6177, +40, +29440, +44058, +24539, +56973, +628, +31750, +1866, +4649, +36098, +17664, +32006, +50135, +63258, +56973, +256, +41552, +1272, +16384, +20496, +31494, +30017, +17520, +1282, +17664, +2048, +453, +20496, +54597, +16384, +94, +50157, +20496, +15012, +36097, +17664, +20790, +1761, +21248, +17408, +55599, +28218, +23406, +178, +50974, +20496, +56973, +17664, +56432, +28928, +1065, +63258, +11405, +28928, +8061, +20496, +56973, +13109, +32848, +1338, +40, +21353, +717, +17520, +42206, +27057, +56, +256, +302, +58, +56973, +36098, +40764, +178, +31488, +18809, +13392, +20241, +16384, +8758, +36097, +23806, +11012, +50205, +64080, +261, +1590, +1092, +15012, +53248, +8704, +63258, +52727, +56973, +32006, +256, +1092, +39366, +4164, +42206, +49989, +64006, +1024, +8322, +59717, +14336, +56577, +42206, +25503, +17518, +17664, +21670, +16384, +6688, +52727, +17520, +36098, +33814, +122, +1092, +17408, +34544, +2048, +30699, +28218, +40, +1603, +90, +52727, +20504, +42206, +11016, +4979, +517, +1024, +2220, +22742, +20496, +20805, +114, +10829, +6177, +4096, +7174, +8888, +4130, +17664, +31494, +17920, +2094, +20496, +15012, +6699, +12803, +53840, +56973, +1469, +1597, +8710, +20496, +56973, +17664, +31494, +2048, +9220, +1500, +20504, +56973, +12928, +6400, +47616, +44058, +1492, +17664, +40, +7095, +23331, +22018, +36097, +116, +6400, +45056, +717, +29492, +17518, +1507, +17664, +16384, +178, +282, +11125, +717, +28730, +31045, +273, +539, +62301, +14395, +24834, +517, +2220, +42206, +6699, +390, +17680, +37707, +1540, +1185, +31238, +42206, +1542, +200, +60527, +34039, +80, +717, +6160, +15012, +123, +17408, +43430, +33616, +36098, +40, +44288, +256, +42206, +52, +257, +717, +27907, +32768, +42206, +24328, +17408, +4979, +56973, +1649, +2048, +2220, +11125, +56477, +42206, +17664, +41472, +30148, +13045, +123, +8608, +30214, +59748, +56334, +5120, +4979, +1500, +256, +2220, +37707, +8665, +32006, +28928, +56973, +16384, +2560, +36115, +15012, +43561, +249, +5120, +6178, +19775, +3766, +14394, +36097, +16384, +123, +32512, +2048, +15303, +518, +17408, +408, +53829, +27444, +14336, +47616, +23377, +42206, +22592, +60547, +36608, +24063, +8589, +26407, +5725, +56973, +262, +40, +7069, +91, +56979, +13392, +20504, +36098, +26963, +10347, +7067, +58710, +518, +56334, +51719, +14394, +60553, +8583, +49152, +22341, +33792, +10089, +17989, +39168, +56, +63258, +1664, +56461, +24576, +1536, +63258, +34283, +256, +1262, +6736, +56973, +56464, +178, +2048, +13312, +36098, +1708, +2048, +717, +17518, +37861, +40, +32006, +15360, +13576, +38162, +30800, +65280, +15573, +45568, +53, +6773, +20496, +17518, +56973, +13354, +46206, +42752, +262, +1500, +8760, +10476, +1569, +16167, +20496, +17664, +3795, +10089, +59450, +53829, +123, +47616, +51238, +48256, +4164, +39749, +56, +113, +19400, +33115, +518, +57925, +2048, +24836, +23379, +17664, +16384, +4864, +6699, +8705, +717, +3942, +1730, +15576, +45, +4979, +56973, +55621, +16384, +256, +2220, +36786, +42206, +1739, +9073, +47917, +28730, +1742, +512, +13964, +36097, +31238, +11125, +25773, +1218, +3072, +42206, +58, +64518, +14336, +15012, +32006, +188, +50485, +45370, +34048, +17520, +14336, +57633, +16384, +188, +6773, +48186, +1775, +16384, +5712, +20496, +44058, +6736, +30789, +1500, +117, +58880, +36097, +15012, +58620, +2220, +23894, +17520, +47685, +252, +5225, +263, +40, +16384, +53, +11201, +23866, +15012, +36098, +7336, +28928, +282, +11012, +20737, +32006, +23443, +3229, +4164, +1830, +16384, +1566, +1024, +508, +10476, +1593, +49664, +8474, +50543, +6736, +14394, +36098, +120, +1024, +36352, +46860, +41474, +20496, +15012, +1853, +30982, +6145, +265, +263, +56832, +216, +11461, +28730, +36097, +13576, +1261, +20504, +42206, +125, +256, +29492, +65278, +17664, +16384, +256, +4350, +10390, +122, +1092, +4979, +56973, +26437, +1563, +12032, +15362, +32784, +14336, +50583, +25249, +1297, +768, +3051, +149, +42206, +50245, +16384, +54016, +13576, +8418, +28730, +37744, +28928, +1092, +30778, +36098, +46149, +17434, +6269, +17664, +31494, +56, +4346, +37035, +29746, +11013, +10839, +50615, +1940, +51269, +16384, +32006, +52224, +48128, +8375, +238, +4118, +42206, +44101, +628, +1245, +9112, +36097, +125, +39090, +40584, +56973, +45893, +32006, +51200, +45568, +11016, +23513, +52727, +17518, +263, +16384, +23808, +53, +15012, +36098, +17664, +31494, +12495, +20496, +43077, +768, +50043, +42206, +41797, +10382, +23515, +29492, +42206, +21760, +3610, +52304, +13927, +36098, +628, +48128, +282, +36097, +16384, +20496, +263, +32006, +1839, +25820, +64183, +256, +46860, +52727, +65410, +63258, +2050, +124, +44, +50693, +58, +3823, +123, +29696, +6688, +20496, +42206, +123, +29696, +38970, +20504, +56973, +10476, +1675, +178, +1092, +841, +6736, +56973, +4165, +62014, +17408, +31105, +42206, +628, +1601, +11008, +5781, +56973, +41474, +45381, +249, +44058, +23579, +54608, +52293, +31494, +74, +17408, +14242, +15012, +52549, +5120, +41474, +520, +1569, +57127, +60997, +63750, +51447, +42206, +42752, +51453, +17518, +27470, +27392, +56979, +36098, +27471, +26880, +92, +18338, +17664, +2053, +56979, +1500, +282, +56979, +27102, +63750, +45778, +8680, +264, +1569, +10089, +36098, +12101, +4864, +1099, +13392, +36098, +5120, +56979, +56973, +16384, +494, +36419, +8760, +3833, +768, +63271, +20496, +42206, +2156, +30150, +32730, +17664, +19864, +29492, +36097, +31494, +17792, +2165, +16514, +16384, +45312, +5120, +4164, +36097, +59248, +44058, +57332, +51584, +15012, +32940, +125, +1650, +41472, +4979, +17520, +36097, +1639, +13576, +50459, +41552, +2189, +49152, +1790, +26481, +42206, +37701, +17434, +30150, +58, +15012, +44493, +17408, +50807, +13392, +2202, +56973, +1500, +119, +25936, +40723, +768, +45904, +40872, +14394, +1024, +8760, +530, +43967, +32768, +17664, +28218, +36098, +16384, +1571, +10089, +44437, +1500, +25825, +1024, +353, +2500, +16077, +17518, +2226, +31494, +8760, +17664, +122, +31238, +1581, +6957, +8025, +6212, +56973, +11159, +44034, +717, +20504, +56973, +50842, +16384, +2246, +47843, +56973, +17664, +7824, +9216, +42914, +28730, +31883, +6346, +55925, +56871, +1500, +35840, +45568, +92, +15696, +58938, +13079, +9998, +35657, +42206, +17664, +53, +64990, +520, +192, +768, +31488, +56973, +62746, +33605, +256, +6699, +23866, +31105, +1500, +23866, +42206, +7936, +4363, +58, +2316, +17664, +40, +1563, +28928, +15872, +29492, +41552, +8760, +36097, +122, +28928, +63258, +42206, +10090, +123, +63152, +28928, +35588, +6166, +36098, +17664, +13095, +31238, +256, +6699, +4979, +20496, +17664, +56371, +14854, +768, +30150, +4130, +265, +13100, +1566, +1024, +22264, +42206, +17664, +6923, +256, +47500, +42368, +42206, +2387, +125, +7168, +717, +52727, +20504, +36098, +44101, +56540, +25783, +6699, +31488, +32784, +13329, +7174, +768, +6699, +4070, +55680, +2423, +7786, +4864, +794, +3924, +52727, +8504, +36097, +65280, +49697, +6736, +65082, +56526, +45568, +717, +6736, +36098, +40, +2220, +22018, +28730, +56371, +7168, +26496, +17518, +125, +768, +6699, +6773, +4164, +521, +29747, +124, +51914, +20496, +15012, +22528, +1536, +11016, +18432, +32325, +1280, +97, +60595, +8760, +2529, +28928, +60617, +63258, +2539, +16384, +2110, +4164, +2544, +256, +63258, +31750, +5781, +265, +9073, +30626, +63818, +768, +20915, +56973, +40, +6699, +56973, +4165, +16384, +6699, +34722, +52727, +6212, +266, +17856, +31494, +51726, +1166, +17520, +53061, +256, +416, +4409, +4129, +17664, +55552, +4568, +41, +11013, +6736, +65221, +54069, +51287, +33872, +33861, +16384, +63258, +20496, +36098, +538, +56973, +2048, +13576, +30151, +58, +60781, +3520, +6699, +20496, +2048, +3098, +15524, +17664, +58088, +53, +717, +20496, +42206, +18225, +17965, +6875, +256, +53, +54751, +17520, +56371, +1747, +44058, +51143, +17518, +6213, +40, +120, +1636, +6699, +10356, +51159, +14394, +2672, +56492, +31494, +51167, +17518, +56973, +25707, +1024, +52727, +20504, +56973, +56371, +1706, +3328, +51189, +38268, +17664, +53, +1098, +41474, +24656, +42206, +266, +50757, +125, +113, +11013, +2724, +1349, +1712, +11016, +1954, +46307, +40, +28177, +266, +32006, +28928, +22018, +56973, +2048, +16671, +36097, +123, +20487, +18688, +15012, +64774, +2999, +29952, +17518, +36097, +32006, +6699, +51239, +52727, +2782, +116, +28928, +13576, +63258, +8760, +59489, +61816, +60119, +37189, +96, +1360, +16290, +522, +29747, +2048, +29305, +15012, +63, +6736, +2309, +291, +20496, +5120, +45716, +43554, +15012, +2832, +33533, +2048, +15012, +32006, +768, +53, +32105, +6773, +6736, +7538, +15012, +17664, +16384, +57088, +53, +6699, +33251, +28730, +2861, +256, +2048, +7450, +17520, +36097, +124, +8029, +58, +44288, +256, +302, +6736, +65280, +43776, +2048, +1032, +60288, +31232, +179, +2193, +63258, +53120, +56973, +21371, +32006, +28928, +2048, +56973, +15920, +4148, +1861, +16384, +53, +58113, +11376, +22853, +56344, +124, +36724, +265, +64918, +56973, +267, +628, +16384, +31750, +11016, +612, +56973, +36097, +1562, +2048, +768, +1165, +41552, +42206, +17856, +30726, +30152, +20496, +6212, +36098, +53, +44058, +6798, +56973, +17664, +16384, +59868, +22018, +20496, +2977, +3072, +22665, +56419, +31721, +256, +772, +15012, +2213, +56973, +1500, +2053, +19633, +34373, +256, +28730, +36098, +2241, +2048, +51347, +36098, +31494, +3328, +13991, +57814, +31238, +51716, +6212, +56360, +1024, +56973, +27015, +18919, +256, +9217, +4163, +64518, +639, +44289, +42053, +11268, +37204, +20504, +15012, +34629, +28416, +63927, +65278, +49664, +1590, +40295, +13882, +50757, +13574, +28416, +15012, +30010, +16890, +30470, +222, +62544, +56973, +36097, +8182, +2048, +80, +15646, +3161, +8197, +62329, +17680, +20510, +47162, +4130, +42206, +24431, +124, +42638, +60, +27648, +51748, +17664, +58382, +4420, +56973, +63813, +8760, +30400, +41, +65278, +58, +179, +2193, +60131, +42206, +222, +4130, +17664, +1622, +1039, +52644, +15012, +30470, +1098, +62027, +4129, +42206, +44284, +8960, +17954, +34896, +15012, +36097, +17664, +118, +256, +25773, +31312, +256, +55717, +16384, +1024, +16208, +3318, +256, +6241, +269, +1758, +43776, +508, +118, +5380, +57, +24025, +3365, +3507, +61034, +94, +45893, +1675, +4864, +9160, +15012, +525, +24882, +42206, +269, +1500, +51, +4130, +269, +10320, +1024, +40699, +15012, +19600, +1024, +408, +30123, +36098, +36098, +23844, +36433, +44544, +1361, +42206, +4357, +4864, +22552, +20496, +56973, +16384, +37888, +3924, +42206, +40171, +48896, +56890, +24594, +58, +59717, +256, +61409, +35680, +3509, +32006, +9183, +222, +56973, +10412, +45824, +15788, +3533, +30726, +56973, +16965, +119, +5632, +256, +4727, +26075, +28730, +36097, +58718, +42206, +15012, +628, +33548, +6224, +3574, +16384, +14592, +17664, +54786, +50176, +11034, +29090, +3607, +10460, +12356, +4386, +15012, +270, +1695, +1124, +56951, +36098, +17664, +1601, +4864, +16134, +62464, +15012, +16384, +19626, +1685, +6346, +11782, +52618, +15012, +29446, +34560, +612, +50124, +15012, +31750, +711, +26075, +8760, +56973, +50106, +50124, +56973, +17664, +31750, +39424, +1836, +49325, +20496, +3700, +13568, +8204, +37707, +46661, +40, +29440, +256, +8375, +17390, +36097, +116, +20504, +56973, +17664, +6798, +526, +256, +17623, +42206, +41, +256, +27102, +8513, +17520, +63750, +49446, +36098, +8509, +276, +50929, +38400, +36422, +36098, +30726, +2491, +20496, +3864, +42206, +17664, +5081, +3072, +2309, +56979, +64000, +54032, +44, +6178, +27504, +276, +20496, +3805, +6346, +20496, +15012, +249, +14171, +58871, +256, +32665, +62789, +19402, +526, +19402, +36098, +10089, +51841, +38970, +3832, +256, +5854, +64621, +263, +17664, +6408, +56, +23704, +63546, +1500, +16384, +14598, +10034, +902, +527, +1500, +30214, +15360, +64918, +4872, +3885, +28229, +4864, +31056, +33605, +3884, +5632, +56973, +9450, +6346, +4130, +3890, +256, +38480, +4336, +42206, +17664, +4864, +201, +20480, +59969, +56974, +14598, +4864, +32336, +42206, +28928, +717, +717, +32896, +7257, +31494, +768, +6699, +18978, +63258, +40762, +9417, +56422, +28928, +50459, +51431, +36354, +27904, +45178, +12848, +48565, +4420, +35141, +24424, +17584, +14394, +17664, +30726, +53, +16077, +6736, +42206, +45125, +13238, +1565, +256, +6346, +20496, +15012, +24133, +29747, +1562, +3328, +264, +11144, +17520, +36354, +10477, +1646, +361, +30153, +52727, +106, +10477, +1745, +41474, +20504, +512, +1500, +25602, +1536, +1059, +4164, +36354, +57344, +6699, +25900, +13882, +63813, +16384, +30153, +52727, +36354, +1668, +13312, +63258, +6736, +166, +4353, +1360, +52727, +17518, +17664, +1756, +56885, +41474, +20504, +42206, +48602, +1326, +36354, +1500, +113, +2718, +54278, +4127, +16384, +1024, +41552, +15012, +30464, +42206, +2048, +291, +4164, +1500, +32444, +113, +6699, +15012, +512, +16384, +2220, +37006, +256, +123, +81, +30153, +54606, +19626, +17672, +50699, +256, +46307, +65082, +4164, +8343, +7749, +26501, +31494, +28164, +52727, +6177, +16384, +4352, +6346, +15012, +17664, +63750, +576, +40309, +45882, +60938, +768, +20496, +56974, +29747, +1570, +717, +57199, +56974, +122, +42608, +53840, +15012, +513, +56432, +2048, +63258, +7808, +60940, +194, +717, +42206, +15641, +17664, +16384, +113, +14658, +2105, +63258, +36353, +16384, +6739, +53, +30153, +44962, +4112, +29958, +256, +24025, +8760, +349, +369, +6736, +56974, +42012, +256, +717, +23376, +42206, +124, +54784, +10761, +28730, +56333, +30464, +46581, +63045, +40, +6177, +794, +65525, +17664, +16384, +63488, +51655, +28218, +36026, +10478, +179, +6760, +63258, +56974, +40, +7307, +2048, +16896, +20496, +257, +31750, +1112, +20496, +15012, +47334, +4608, +31105, +15012, +24812, +65024, +11195, +15012, +1500, +59833, +12357, +56546, +8448, +53328, +48, +8280, +7436, +52282, +21057, +620, +42206, +16384, +35610, +19565, +40, +12045, +44949, +17520, +258, +30408, +12288, +4224, +258, +17664, +16384, +1760, +58707, +8760, +12352, +1589, +256, +23267, +45370, +57858, +29190, +11201, +17664, +125, +514, +21076, +1542, +1049, +37023, +17664, +1760, +264, +19626, +36194, +42206, +40, +58118, +7760, +62413, +6699, +48720, +120, +280, +59250, +15012, +83, +256, +18964, +42206, +16384, +58298, +15872, +44189, +56974, +17681, +256, +22455, +752, +24832, +6688, +11366, +15012, +31246, +26192, +259, +17520, +63045, +6688, +23376, +17520, +798, +30726, +6760, +259, +119, +8192, +26915, +64069, +8192, +6178, +824, +14998, +17664, +10448, +6400, +31940, +42206, +1076, +34628, +8685, +17664, +58800, +2048, +848, +62522, +16384, +47939, +20496, +36353, +28906, +8199, +17520, +36353, +57126, +6688, +2562, +15012, +41570, +34560, +47627, +56974, +118, +27951, +13904, +42206, +1500, +16384, +11520, +6408, +36354, +1420, +198, +282, +56974, +1536, +58216, +17520, +259, +16384, +2239, +265, +1013, +28912, +53587, +31750, +2074, +42206, +1280, +6688, +6469, +45370, +64151, +53760, +17664, +1280, +123, +50880, +36353, +16584, +14848, +60162, +30716, +516, +29446, +32512, +1280, +30748, +22782, +47685, +59550, +7694, +3716, +28496, +16384, +1280, +5204, +36353, +16384, +8196, +8080, +36354, +36353, +30982, +1049, +12032, +58216, +260, +516, +52, +1543, +1500, +42206, +1139, +30470, +512, +58448, +10442, +35249, +35588, +14160, +4130, +6204, +119, +256, +1880, +47627, +42206, +41730, +1702, +42206, +16384, +261, +25773, +30726, +35078, +8720, +18944, +11831, +1024, +57017, +4224, +56974, +125, +12032, +657, +8576, +56514, +40, +8574, +516, +56515, +1024, +54751, +50899, +1291, +7936, +261, +68, +32006, +1024, +27005, +48289, +31824, +9657, +1545, +63271, +25940, +20496, +56333, +52, +39150, +20496, +17664, +35704, +256, +21760, +56974, +16384, +43520, +22785, +6212, +35141, +9318, +44949, +28594, +249, +3072, +2415, +14394, +16384, +4864, +6178, +56335, +56, +27102, +62021, +56335, +256, +8760, +56335, +256, +8760, +1500, +32768, +40, +65280, +9955, +4125, +249, +1353, +9235, +64000, +6178, +36354, +14342, +256, +292, +36353, +1675, +8720, +1675, +27102, +6398, +261, +40, +5120, +52654, +20496, +18714, +6178, +40, +57118, +33616, +17856, +24836, +6178, +56335, +353, +27102, +17664, +16384, +10089, +4351, +16384, +26880, +282, +37707, +15012, +16384, +126, +256, +4130, +56389, +27102, +4111, +10089, +3072, +56979, +56974, +30470, +54751, +53657, +256, +9998, +56979, +36353, +16384, +280, +64806, +40809, +3072, +5892, +17664, +9998, +63741, +44, +20224, +9472, +57049, +61, +1477, +20504, +27662, +15012, +57359, +45745, +31813, +26223, +1801, +15012, +1552, +31750, +56974, +52260, +282, +80, +10441, +52889, +6177, +11845, +16384, +6699, +15012, +518, +1536, +3979, +13737, +14394, +648, +2048, +17420, +4224, +24867, +40, +37100, +22552, +56400, +1500, +125, +23040, +3106, +49198, +8760, +33707, +63750, +1319, +18334, +33084, +28730, +17664, +24832, +19843, +4164, +58, +10382, +2048, +11012, +14394, +1500, +5122, +27392, +42206, +36354, +3471, +61035, +47500, +20504, +61, +256, +6823, +15012, +125, +56974, +1804, +55109, +6688, +24897, +519, +1605, +15012, +10490, +1024, +6688, +43967, +15012, +17664, +6400, +256, +31488, +39168, +263, +123, +256, +2718, +46515, +58, +56974, +31750, +92, +34560, +1297, +1857, +125, +15360, +65188, +42223, +37084, +62186, +15012, +196, +2048, +2292, +25100, +16384, +15320, +56974, +56507, +1024, +228, +1920, +21592, +256, +57453, +56420, +58, +20496, +56974, +16384, +42206, +35200, +58, +31750, +3072, +47500, +56974, +3840, +49325, +15012, +1759, +256, +1629, +42080, +17520, +263, +32433, +256, +1314, +20496, +63750, +19403, +56974, +63750, +52155, +519, +27102, +3956, +1836, +6178, +3959, +19403, +58727, +5120, +56979, +53, +52246, +519, +18688, +10089, +263, +16384, +52274, +56389, +256, +56979, +4421, +256, +45461, +20496, +16384, +256, +30541, +6469, +16637, +23621, +4864, +653, +8280, +27569, +35662, +29218, +20496, +10454, +16384, +256, +56103, +44101, +1694, +17426, +19404, +36353, +27973, +1585, +1112, +36353, +16384, +256, +36135, +653, +24912, +25668, +32000, +51463, +2539, +520, +43815, +28730, +10289, +1262, +25089, +520, +1500, +50688, +64080, +42206, +36353, +63750, +5122, +12106, +12368, +62479, +4864, +8760, +520, +13312, +6688, +56161, +20193, +42206, +24836, +23808, +36353, +17664, +22029, +1032, +56656, +1706, +34842, +56974, +46143, +16384, +1739, +78, +36578, +54166, +17664, +16384, +4158, +10240, +36353, +16384, +30174, +1358, +2256, +31238, +10496, +58382, +65278, +57344, +3335, +57458, +56302, +124, +536, +20421, +42206, +52800, +51463, +720, +56974, +15199, +256, +44750, +15012, +31494, +3072, +6699, +36353, +11373, +31246, +8250, +13565, +16529, +6212, +24832, +31105, +16529, +17520, +18757, +56822, +6144, +34033, +42206, +1500, +3840, +8708, +8080, +56974, +18718, +18947, +1222, +120, +295, +26724, +40, +14592, +1024, +4130, +53829, +1288, +256, +34960, +42206, +10260, +10496, +37678, +51452, +2393, +11333, +1611, +256, +58888, +56400, +32006, +27005, +3924, +56161, +17664, +10510, +58077, +55866, +10324, +30726, +6400, +5122, +62544, +56974, +34420, +13056, +11069, +56951, +42206, +36677, +31494, +6869, +17520, +1880, +6211, +96, +2481, +4164, +521, +14478, +2816, +263, +56848, +4130, +521, +4625, +26981, +8250, +92, +23808, +42206, +17664, +36226, +6212, +9808, +42206, +4224, +25157, +96, +6044, +36353, +32006, +2309, +59905, +29264, +56974, +25711, +32006, +53, +22096, +5953, +32429, +256, +51716, +266, +36987, +19404, +10560, +29446, +96, +11017, +13904, +17664, +1629, +40529, +17520, +7680, +9697, +15012, +64518, +508, +4164, +15012, +17664, +1459, +1631, +13294, +36353, +8192, +4666, +10565, +24467, +1372, +43967, +266, +29976, +36354, +7098, +42206, +8714, +21061, +124, +5888, +45, +2722, +125, +45147, +20504, +25157, +117, +1024, +6688, +222, +15012, +57099, +8760, +266, +2048, +56974, +44544, +19223, +48709, +8363, +490, +37289, +1620, +1099, +52383, +17664, +256, +27102, +56974, +249, +1099, +14394, +24462, +27102, +1712, +56979, +1735, +256, +10089, +56335, +1541, +64549, +10347, +51300, +266, +10347, +256, +56979, +36353, +49252, +35636, +5120, +1410, +56974, +124, +19405, +56974, +1631, +18461, +15012, +24460, +10089, +4164, +45137, +56979, +10324, +56951, +4351, +30726, +34048, +20496, +17664, +263, +61175, +8668, +17664, +9984, +61175, +48388, +27607, +10496, +4130, +2816, +1222, +522, +58812, +45824, +12122, +1500, +256, +15012, +16384, +25344, +25773, +6807, +361, +2539, +10320, +52926, +6269, +56463, +34665, +20496, +53336, +42206, +16384, +4130, +676, +5120, +27102, +1571, +52600, +56974, +16384, +1024, +10089, +848, +36353, +56, +256, +51796, +52608, +14394, +56327, +119, +30550, +5840, +12189, +123, +9984, +6869, +32768, +16384, +13568, +47373, +6177, +245, +56055, +4130, +22117, +52, +125, +6144, +20970, +36354, +46917, +16384, +41472, +369, +16529, +30719, +7424, +56974, +15012, +22863, +8192, +60672, +8682, +56974, +13541, +2962, +28060, +267, +17664, +86, +21872, +16794, +523, +16384, +256, +25858, +32826, +3017, +16384, +28928, +9984, +539, +56951, +14394, +41541, +11843, +280, +31056, +120, +292, +17664, +22784, +6212, +1500, +31238, +36354, +40307, +17664, +1280, +32792, +1368, +56974, +31636, +37632, +22096, +36354, +122, +768, +56974, +2309, +42206, +125, +256, +263, +52627, +53306, +17664, +40, +1657, +9984, +3293, +26481, +48, +124, +256, +51, +42206, +17664, +14374, +124, +6580, +14394, +26830, +124, +256, +238, +36354, +16384, +6346, +54096, +65082, +6725, +9984, +5658, +12032, +65082, +39234, +51, +20504, +17664, +30612, +263, +8230, +9040, +36353, +51591, +7024, +23267, +4130, +3203, +29446, +2048, +515, +36354, +22659, +31246, +32784, +524, +3072, +58, +17664, +1759, +256, +2048, +35664, +17664, +1768, +48888, +55632, +3251, +1586, +1273, +52638, +36353, +56340, +11520, +23893, +42206, +16384, +260, +33536, +27102, +42206, +581, +9817, +524, +30976, +8192, +8760, +21317, +16384, +63886, +17664, +256, +8760, +256, +56979, +40, +256, +44090, +58, +16384, +1099, +21328, +268, +249, +56979, +63750, +4130, +16384, +52788, +17664, +16637, +31750, +10089, +33872, +16384, +27102, +3311, +13446, +22844, +3318, +40, +56885, +25424, +57038, +6699, +13136, +120, +39680, +282, +11639, +14394, +8776, +10089, +65278, +63750, +1099, +525, +16384, +256, +658, +8760, +525, +7493, +40, +30982, +63271, +20496, +6645, +25858, +20496, +31750, +5632, +7444, +61193, +6160, +525, +17664, +124, +256, +9776, +57017, +42206, +249, +1083, +20504, +1500, +1675, +35920, +56974, +16384, +2158, +45370, +17358, +256, +6144, +525, +4352, +42206, +16384, +60, +18968, +292, +15012, +119, +6346, +34265, +51463, +24602, +56974, +18176, +37756, +53719, +38059, +40, +16384, +256, +30550, +56974, +3489, +30726, +9754, +57359, +22096, +42565, +50432, +40202, +34860, +525, +40, +1702, +256, +8710, +4164, +525, +2933, +44208, +17664, +125, +2816, +22552, +6212, +50757, +15959, +2640, +28730, +40, +14080, +2558, +42206, +1500, +6346, +20504, +525, +53, +40302, +20504, +44, +295, +6380, +32784, +270, +16384, +256, +30550, +56974, +1024, +37090, +56974, +17664, +538, +6212, +3629, +41984, +6699, +24897, +1500, +3441, +13136, +62522, +16384, +256, +6699, +3325, +55808, +38426, +10780, +15012, +20837, +63750, +256, +42108, +56400, +32262, +24836, +42206, +44101, +8274, +1216, +36353, +40773, +4352, +4130, +56974, +4608, +3925, +42206, +4098, +281, +35397, +19156, +12041, +8760, +27656, +8760, +65093, +4864, +27768, +1674, +57315, +36353, +17664, +5120, +10089, +14405, +13657, +4130, +3701, +14342, +3335, +10089, +17664, +62208, +53011, +526, +35570, +19407, +42206, +27664, +5120, +42206, +15012, +17664, +52331, +16384, +4864, +59906, +32826, +40, +52871, +256, +15226, +28496, +36354, +3740, +5895, +23040, +10089, +17664, +256, +56447, +46026, +42709, +10089, +36354, +31750, +256, +20069, +34874, +56336, +10089, +56974, +4864, +27102, +17520, +3770, +5122, +30550, +42206, +55498, +42752, +263, +21974, +36354, +29446, +37707, +3828, +117, +6688, +6178, +120, +4224, +20430, +17664, +38162, +8250, +2048, +9890, +17664, +20496, +527, +11201, +27264, +48384, +8665, +17664, +29629, +16384, +1215, +20496, +50490, +9754, +51796, +3771, +9552, +32006, +216, +36400, +37968, +36609, +16384, +6400, +282, +6177, +17664, +125, +54016, +1500, +25726, +37888, +14829, +56951, +512, +5304, +13824, +67, +512, +1024, +6736, +29923, +10374, +45, +14394, +512, +31101, +52399, +303, +31949, +6398, +131, +9984, +7983, +11439, +20504, +55621, +40, +43258, +512, +17664, +5120, +37461, +20496, +1545, +1129, +37461, +37278, +4164, +49466, +32006, +6400, +62413, +20496, +17664, +28928, +36609, +29850, +6688, +15270, +6177, +288, +124, +13824, +539, +15909, +44155, +20496, +36610, +44, +13574, +48189, +7077, +5120, +56975, +22022, +64266, +15012, +16384, +46860, +37495, +20504, +257, +13437, +2816, +6699, +15162, +359, +16384, +37707, +11201, +36609, +36771, +20487, +16112, +36609, +15012, +513, +124, +512, +22065, +38882, +16384, +20737, +26693, +16384, +9697, +513, +1731, +972, +2048, +14394, +17664, +52, +56979, +64295, +256, +53148, +36610, +8760, +16384, +4864, +28730, +122, +256, +40082, +36609, +4864, +42206, +16384, +16825, +58, +16384, +5120, +37707, +17664, +2304, +703, +58, +50787, +12439, +6177, +58655, +44024, +36609, +8840, +36610, +36471, +10023, +15012, +29253, +41984, +10089, +513, +124, +256, +31105, +10053, +64518, +3926, +42206, +40, +52224, +1839, +3926, +58939, +2117, +120, +51456, +4363, +2163, +42206, +4864, +1262, +27428, +42206, +32006, +256, +56975, +249, +11047, +1861, +4864, +14394, +31750, +6346, +2474, +257, +31729, +63271, +56975, +56, +24836, +58192, +16384, +11201, +60474, +17884, +26724, +514, +21061, +16384, +1540, +6688, +42206, +42206, +2907, +12800, +6699, +16640, +20496, +37189, +13312, +51723, +20504, +38213, +13482, +13312, +18871, +64581, +31750, +256, +6178, +63750, +42720, +4350, +53351, +2048, +33723, +53324, +36609, +21000, +50681, +563, +44288, +2159, +3926, +15012, +36610, +16384, +18688, +21504, +40960, +63382, +60229, +1760, +27005, +5707, +61765, +73, +1477, +39482, +34751, +5840, +56975, +40, +31105, +8760, +640, +17664, +11520, +8192, +1216, +14394, +36609, +17664, +15386, +7444, +38509, +56975, +47429, +16384, +4096, +256, +1242, +29187, +56975, +31750, +31105, +29815, +53529, +11264, +1086, +56975, +55154, +6688, +8218, +56975, +9541, +280, +58, +30726, +57199, +17664, +120, +21361, +42206, +51013, +14829, +58, +932, +5632, +658, +61008, +56975, +322, +256, +32105, +51, +658, +4130, +56975, +1591, +6400, +42051, +56442, +15012, +38213, +18835, +18423, +15012, +3535, +29952, +260, +16640, +20496, +31750, +192, +6699, +63588, +59786, +64817, +64570, +10576, +19145, +31494, +8760, +40, +19239, +1567, +19408, +259, +4191, +24576, +27102, +64000, +56336, +1911, +10089, +1500, +256, +27102, +24269, +8164, +35623, +515, +8160, +53450, +36610, +32006, +256, +27102, +15012, +14394, +17664, +56979, +56975, +9567, +24836, +16208, +36609, +56497, +38285, +24836, +26724, +886, +84, +353, +20496, +17664, +256, +63271, +19408, +36609, +1536, +256, +5241, +56979, +56975, +56, +4576, +19409, +909, +124, +256, +6699, +25658, +17232, +8672, +28955, +14592, +19409, +9285, +16384, +33041, +2885, +1567, +20263, +36610, +1500, +30726, +49, +53553, +259, +16384, +215, +353, +56975, +40, +29702, +21504, +353, +27951, +53551, +259, +14342, +3072, +46976, +948, +1719, +19798, +4129, +17664, +16384, +63827, +5241, +44950, +56975, +15012, +45862, +58880, +7905, +51269, +28957, +53562, +17520, +8448, +369, +40529, +56975, +24836, +55577, +259, +66, +22530, +259, +24576, +40976, +64000, +10323, +1760, +58192, +260, +124, +256, +20739, +14336, +28730, +1045, +48390, +2560, +46104, +17520, +15012, +56975, +1075, +56416, +16384, +16077, +20496, +56975, +13592, +17199, +42206, +17519, +117, +1727, +57065, +41, +31105, +20538, +1101, +33291, +1682, +2996, +28730, +10270, +124, +4864, +20739, +42910, +1125, +64669, +17025, +65188, +31238, +13056, +51815, +40381, +36610, +17664, +1590, +16896, +15012, +7168, +1368, +56951, +39738, +31870, +13338, +41984, +65201, +20858, +56975, +1500, +13304, +55552, +25759, +59392, +51823, +40529, +42206, +36609, +9436, +16384, +1024, +40556, +56975, +10752, +34602, +6178, +1199, +32262, +4608, +6346, +56951, +56975, +49253, +1500, +58112, +4130, +56975, +1230, +4352, +13136, +55610, +17664, +116, +6912, +43005, +56975, +1247, +15360, +40309, +53562, +42206, +22031, +56133, +78, +61776, +16384, +30550, +53561, +36610, +16384, +3098, +31105, +15012, +6699, +4300, +17664, +256, +3926, +1320, +249, +17688, +25705, +12561, +16384, +5888, +20739, +27400, +4130, +10320, +11034, +14394, +1500, +124, +1536, +4164, +17664, +53523, +2048, +46174, +15012, +256, +12963, +17939, +14049, +51, +36610, +17664, +10340, +282, +24008, +12032, +42206, +24812, +1630, +20496, +1388, +1774, +11008, +24008, +14394, +125, +955, +17520, +517, +17664, +1500, +31750, +1024, +1024, +6465, +8807, +30464, +5658, +8710, +56610, +261, +16384, +353, +23555, +20504, +4386, +2159, +17232, +53306, +16581, +123, +12032, +1024, +58298, +17767, +124, +256, +2128, +261, +256, +31105, +15012, +1500, +3328, +26932, +56975, +1499, +21729, +2816, +1028, +53725, +36610, +50176, +10089, +517, +1536, +1099, +517, +4238, +11264, +56975, +4240, +28607, +34885, +96, +65196, +63750, +56979, +10348, +4864, +20496, +56975, +32718, +29188, +58, +34065, +11264, +55202, +65535, +256, +57199, +47429, +19518, +45856, +1541, +32003, +1567, +53667, +28730, +17664, +8760, +5178, +31494, +4864, +8760, +4864, +6178, +22085, +24594, +56336, +8760, +5120, +10089, +53689, +42206, +7870, +18818, +6687, +11015, +31368, +32768, +27772, +65147, +36610, +33792, +53769, +42206, +249, +4864, +56979, +36677, +17664, +31494, +256, +22871, +36609, +113, +1099, +3463, +1589, +10348, +28928, +5120, +34663, +58298, +42206, +15987, +22393, +262, +49742, +13576, +11125, +1614, +17664, +10449, +2048, +6699, +11017, +64918, +36609, +51525, +19905, +32256, +5632, +717, +20496, +26189, +51200, +56979, +1565, +256, +717, +58298, +28218, +52, +7546, +4864, +6699, +15012, +11333, +120, +57746, +11125, +57017, +64000, +1657, +31750, +30720, +37651, +42, +8692, +23365, +21733, +52736, +51777, +15012, +1666, +17664, +1759, +538, +12032, +20496, +15012, +31494, +768, +263, +1105, +56975, +20504, +56372, +32006, +7424, +18237, +17518, +1622, +97, +6178, +42206, +1500, +123, +2220, +16290, +63741, +42206, +124, +30154, +51783, +20496, +17664, +16497, +2048, +8194, +1059, +17664, +31494, +28999, +34709, +11589, +16384, +28928, +35920, +52279, +40, +6655, +22018, +15012, +1750, +125, +16056, +22352, +17664, +123, +52727, +15012, +518, +16384, +1024, +7450, +17518, +40, +97, +6736, +42206, +16384, +1032, +4164, +40, +369, +42206, +252, +51839, +17680, +65376, +256, +22018, +20496, +14394, +17664, +120, +34816, +13576, +41913, +4130, +56975, +30533, +13382, +13576, +5122, +51, +5896, +56420, +25471, +11264, +18564, +4130, +14394, +36610, +9536, +124, +256, +17298, +4130, +13384, +256, +768, +36253, +41474, +20496, +28928, +41067, +47952, +28730, +13268, +16384, +1577, +4096, +44962, +15012, +1500, +768, +8192, +47010, +14394, +20049, +63233, +52727, +46328, +263, +13396, +19456, +6699, +1422, +20496, +26181, +16384, +53, +58249, +6212, +36609, +16384, +9998, +63258, +17520, +38411, +18432, +53, +290, +56975, +56372, +44058, +63258, +20496, +60692, +3072, +44058, +24602, +42206, +56, +3072, +12696, +8760, +1932, +17664, +33251, +1936, +5186, +1782, +11016, +3808, +28218, +120, +954, +31105, +4676, +628, +123, +20224, +53, +11034, +4350, +13407, +28928, +47105, +8760, +31494, +2048, +8888, +45882, +43904, +15012, +36609, +13412, +56576, +51, +20496, +42206, +17664, +16384, +256, +21504, +47105, +6212, +42206, +48112, +125, +28928, +4576, +50554, +16384, +2048, +51991, +52727, +519, +64774, +27102, +252, +24882, +42206, +1500, +7476, +256, +56979, +1500, +28928, +20011, +28730, +36677, +4864, +42206, +123, +67, +9998, +8760, +17218, +1500, +1099, +36609, +56372, +5120, +848, +42206, +14342, +14394, +2019, +5120, +30155, +58, +31494, +2048, +61175, +15012, +17664, +14342, +44058, +15012, +16384, +256, +263, +2048, +39760, +64518, +16072, +56336, +54055, +36610, +4864, +63718, +36609, +16384, +14394, +256, +27102, +40684, +42206, +53886, +55713, +17664, +26270, +353, +28730, +39749, +58835, +45111, +6760, +32006, +6699, +63271, +57215, +2059, +1623, +2220, +30155, +19410, +46650, +1631, +22257, +56144, +2064, +1500, +31494, +22018, +23866, +2048, +45, +46522, +60288, +9141, +40, +256, +8760, +56336, +19410, +42206, +1571, +10089, +17664, +11520, +56979, +61253, +13576, +12190, +20496, +14394, +36609, +27811, +113, +27102, +63258, +63546, +32387, +20496, +28218, +17664, +31750, +5127, +63258, +6736, +36609, +2124, +17664, +56329, +2220, +31923, +52727, +264, +1599, +7168, +11264, +12272, +36609, +45824, +2560, +256, +27465, +20504, +36609, +16384, +28928, +2048, +2220, +1313, +249, +19411, +6736, +56975, +123, +23296, +1262, +42326, +51329, +17824, +50254, +44058, +44374, +4131, +40773, +1561, +28928, +4864, +42206, +17664, +124, +28928, +11125, +50518, +36326, +62, +63258, +63258, +48664, +16384, +51354, +15757, +8760, +39237, +29748, +32006, +256, +6699, +30155, +717, +8672, +55049, +32006, +266, +62720, +15012, +57396, +1500, +1536, +6400, +11373, +30155, +17518, +520, +1024, +37762, +63258, +62591, +2220, +32442, +45381, +3648, +521, +17664, +56340, +6688, +32171, +41552, +63557, +1699, +58880, +17520, +36610, +44177, +6699, +6736, +15012, +40, +31761, +34473, +6688, +4176, +15012, +123, +9472, +17518, +36609, +40, +6050, +47828, +16568, +538, +8098, +15012, +14569, +41533, +1024, +6736, +15012, +32006, +768, +53, +64806, +40, +30726, +59136, +36610, +123, +256, +64848, +19915, +26268, +1629, +30156, +52727, +265, +125, +34048, +256, +53, +3865, +33872, +32006, +11125, +56979, +4164, +42206, +55877, +61173, +256, +6346, +659, +4164, +42206, +13381, +245, +13058, +52727, +20496, +30158, +40, +32000, +256, +3601, +42206, +14394, +36610, +1500, +50673, +11016, +41474, +20504, +15012, +265, +16384, +263, +303, +42206, +30976, +6400, +6688, +717, +15012, +36609, +1500, +1775, +16077, +521, +249, +58151, +2467, +113, +19411, +249, +26724, +265, +4336, +45568, +19411, +4164, +56975, +1500, +19411, +14394, +63750, +32592, +44869, +1561, +30156, +6178, +36610, +19411, +17520, +46324, +64273, +10496, +1262, +52727, +14394, +27205, +40940, +31855, +265, +4347, +24836, +4164, +1500, +5120, +37144, +19411, +42206, +10752, +23335, +41530, +56, +256, +717, +4351, +64, +34798, +53, +52295, +8603, +50496, +6178, +32006, +64, +30712, +8250, +18963, +35397, +1723, +41474, +31856, +2514, +27838, +6912, +717, +19411, +42206, +628, +35393, +3463, +10348, +11016, +52048, +2528, +16384, +29440, +11317, +4164, +58785, +10496, +30156, +13689, +17664, +7936, +2220, +7288, +56975, +40, +53, +51364, +15012, +16384, +659, +44058, +36610, +256, +14394, +27102, +4373, +1083, +13541, +41552, +65082, +124, +28928, +10089, +6736, +2570, +659, +4164, +266, +56, +7424, +44058, +56979, +20496, +1500, +1662, +10510, +15685, +52727, +42206, +23808, +2220, +12117, +30156, +522, +32006, +6912, +41474, +6212, +56975, +}; Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c Mon Jan 28 01:09:41 2008 @@ -0,0 +1,408 @@ +/* + * search.c - Searching routines for URL switching + * + * This file is a part of the NetBench + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * Everyone is granted permission to copy, modify and redistribute + * this tool set under the following conditions: + * + * Permission is granted to anyone to make or distribute copies + * of this source code, either as received or modified, in any + * medium, provided that all copyright notices, permission and + * nonwarranty notices are preserved, and that the distributor + * grants the recipient permission for further redistribution as + * permitted by this document. + * + * Permission is granted to distribute this file in compiled + * or executable form under the same conditions that apply for + * source code, provied that either: + * + * A. it is accompanied by the corresponding machine-readable + * source code, + * B. it is accompanied by a written offer, with no time limit, + * to give anyone a machine-readable copy of the corresponding + * source code in return for reimbursement of the cost of + * distribution. This written offer must permit verbatim + * duplication by anyone, or + * C. it is distributed by someone who received only the + * executable form, and is accompanied by a copy of the + * written offer of source code that they received concurrently. + * + * In other words, you are welcome to use and share this source file. + * You are forbidden to forbid anyone else to use, share and improve + * what you give them. + */ + +#include +#include +#include +#include +#include "utils.h" +#include "search.h" +#include "url.h" + +#define min(a, b) (a > b ? b : a) + +extern StrTreeNode *tree_head; + +int * +calculate_bm_table (char *pattern, int pattern_length) +{ + int i; + int *returnval = (int *) malloc (sizeof(int) * CHAR_SIZE); + + if (returnval == NULL) + fatal ("Not enough virtual memory \n"); + + for (i = 0; i < CHAR_SIZE; ++i) + returnval[i] = pattern_length; + + for (i = 0; i < pattern_length; ++i) + returnval[(unsigned char)pattern[i]] = pattern_length - i - 1; + + return returnval; +} + + +/********************************************************************\ +* boyer_moore: Implements the Boyer-Moore al;gorithm to search the * +* string x within string x. This is known to be one of * +* the most efficient string search algorithms. * +* * +* Inputs: Large and small pattern information * +* bmBc: the character table used for the algorithm, * +* instead of generating it for every call, we generate the * +* table once in the creation and use it for every search. * +* * +* Returns: The location of the match, -1 if no match * +\********************************************************************/ +int +boyer_moore (char *y, int n, char *x, int m, int *bmBc) +{ + int j, k, shift; + + shift = m - 1; + j = 0; + /* while (j < n) */ + /* Changed while-loop bound to prevent reading off the end of the array. + * -KF 2/2007 */ + while (j + m - 1 < n) + { + k = bmBc[(unsigned char)y[j + m -1]]; + /* while ((k != 0) && (j < n)) */ + /* Changed while-loop bound to prevent reading off the end of the array. + * -KF 2/2007 */ + while ((k != 0) && (j + k + m - 1 < n)) + { + j += k; + k = bmBc[(unsigned char)y[j + m -1]]; + } + + if (memcmp(x, y + j, m - 1) == 0 && (j < n)) + return(j); + j += shift; + } + return -1; +} + +struct rtentry * +find_destination (char *packet, int packet_size) +{ + StrTreeNode *iterator = tree_head; + + while (iterator) + { +#ifdef DEBUG_2 + fprintf (stderr, "Comparing to %s \n", iterator->common_pattern); +#endif + + /* If the packet contains the pattern at the header... */ + if ((boyer_moore (packet, packet_size, iterator->common_pattern, iterator->common_pattern_length, iterator->bm_table) != -1)) + { + /* We found a common substring in the header, so look into the list... */ + PatternNode *list = iterator->list; + while (list) + { + int search_result; +#ifdef DEBUG_2 + fprintf (stderr, "Inside comparing to %s \n", iterator->common_pattern); +#endif + if (list->search_depth == 0) + search_result = boyer_moore (packet, packet_size, list->pattern, list->pattern_length, list->bm_table); + else + search_result = boyer_moore (packet, min(packet_size, list->search_depth), list->pattern, list->pattern_length, list->bm_table); + + if (search_result != -1) + { +#ifdef DEBUG + fprintf (stderr, "Found a packet \n"); +#endif + /* An exact match */ + if (list->type == log) + fprintf (list->logto, "Source: %x Destination %x \n", PACKET_SOURCE(packet), PACKET_DESTINATION(packet)); + return list->destination; + } + list = list->below; + } + } + iterator = iterator->next; + } + + /* No match, no rule can be find for the packet... */ + return NULL; +} + + +/********************************************************************\ +* Procedures to generate empty nodes. * +\********************************************************************/ +PatternNode * +NewPatternNode (int chainno, nodetype type, char *pattern, int pattern_length, int search_depth) +{ + PatternNode *returnval; + + if ((returnval = (PatternNode *) malloc (sizeof (PatternNode))) == NULL) + fatal ("Run out of virtual memory \n"); + + returnval->chain_node_number = chainno; + returnval->type = type; + if ((returnval->pattern = (char *) malloc (pattern_length)) == NULL) + fatal ("Not enough virtual memory \n"); + strncpy (returnval->pattern, pattern, pattern_length); + returnval->pattern_length = pattern_length; + returnval->search_depth = search_depth; + returnval->bm_table = calculate_bm_table (pattern, pattern_length); + + return returnval; +} + +StrTreeNode * +NewStrTreeNode (int chainno, char *pattern, int pattern_length) +{ + StrTreeNode *returnval; + + if ((returnval = (StrTreeNode *) malloc (sizeof (StrTreeNode))) == NULL) + fatal ("Run out of virtual memory \n"); + + returnval->chain_node_number = chainno; + if ((returnval->common_pattern = (char *) malloc (pattern_length)) == NULL) + fatal ("Not enough virtual memory \n"); + strncpy (returnval->common_pattern, pattern, pattern_length); + returnval->common_pattern_length = pattern_length; + returnval->bm_table = calculate_bm_table (returnval->common_pattern, pattern_length); + + return returnval; +} + + +/********************************************************************\ +* Find_lcs: A modified version of the boyer-moore algorithm to find * +* the largest common substring * +* * +* Inputs: Large and small pattern information * +* lcssize: return value of the procedure * +* * +* Returns: The largest substring found * +\********************************************************************/ +char * +find_lcs (char *largepattern, int largepatternsize, char *smallpattern, int smallpatternsize, int *lcssize) +{ + char *sub_pattern = NULL; + char *exchanger; + int sub_pat_size = 0; + int j, k, shift, exchangersize; + int *bmBc; + + /* Make sure the large is larger */ + if (smallpatternsize > largepatternsize) + { + exchanger = smallpattern; + smallpattern = largepattern; + largepattern = exchanger; + exchangersize = smallpatternsize; + smallpatternsize = largepatternsize; + largepatternsize = exchangersize; + } + + bmBc = calculate_bm_table (smallpattern, smallpatternsize); + + shift = 1; + j = 0; + k = bmBc[(unsigned char)largepattern[j + smallpatternsize -1]]; + while (j < largepatternsize) + { + j += k; + k = bmBc[(unsigned char)largepattern[j + smallpatternsize -1]]; + /* Unlike original BM we can not shift the whole subpattern */ + if (k == smallpatternsize) + k = sub_pat_size + 1; + else + { + /* Match in the characters, check how big the substring is */ + int first_char = j + smallpatternsize - 1; + int temp_sub_size = 0; + + /* First move back to find the start of the partial match */ + while ((k < smallpatternsize) && (smallpattern[smallpatternsize - k - 1] == largepattern[first_char])) + { + first_char--; + k++; + } + k--; + first_char++; + + /* Now move forward until there is a mismatch */ + while ((k >= 0) && (smallpattern[smallpatternsize - k - 1] == largepattern[first_char])) + { + temp_sub_size++; + k--; + first_char++; + } + + if (temp_sub_size > sub_pat_size) + { + sub_pat_size = temp_sub_size; + sub_pattern = &largepattern[first_char - temp_sub_size]; + + /* If it is equal to the small pattern, no need to continue */ + if (sub_pat_size == smallpatternsize) + { + *lcssize = sub_pat_size; + return sub_pattern; + } + } + + k = 1; + } + } + *lcssize = sub_pat_size; + return sub_pattern; +} + +void +insert_rule (char *pattern, int pattern_length, int depth) +{ + StrTreeNode *head_iterator = tree_head; + StrTreeNode *found_largestcommon = NULL; + unsigned int largest_common = 0; + char *sub_str; + + /* First traverse all the headers finding the longest common substring */ + while (head_iterator) + { + int temp_common; + char *temp_str = find_lcs (head_iterator->common_pattern, head_iterator->common_pattern_length, pattern, pattern_length, &temp_common); + +#ifdef DEBUG_2 + fprintf (stdout, "Compared %s to %s and found %s with size %d \n", head_iterator->common_pattern, pattern, temp_str, temp_common); +#endif + + if (temp_common > largest_common) + { + largest_common = temp_common; + found_largestcommon = head_iterator; + sub_str = temp_str; + } + head_iterator = head_iterator->next; + } + + if (largest_common < MIN_COMMON_SIZE) + { + /* We have to create a new head */ + PatternNode *new_node; + StrTreeNode *new_head; + + if (tree_head != NULL) + new_head = NewStrTreeNode (tree_head->chain_node_number + 1, pattern, pattern_length); + else + new_head = NewStrTreeNode (0, pattern, pattern_length); + + new_node = NewPatternNode (0, route, pattern, pattern_length, depth); + new_node->below = NULL; + + new_head->list = new_node; + new_head->next = tree_head; + tree_head = new_head; + } + else + { + /* Found a header matching the common value that is large enough */ + PatternNode *new_node; + + /* First change the head pattern (chunk it off) */ + strncpy (found_largestcommon->common_pattern, sub_str, largest_common); + found_largestcommon->common_pattern_length = largest_common; + + /* Add the entry to the head list */ + new_node = NewPatternNode (found_largestcommon->list->chain_node_number + 1, route, pattern, pattern_length, depth); + new_node->below = found_largestcommon->list; + found_largestcommon->list = new_node; + } +} + +void +db_init (char *file_name) +{ + FILE *pattern_file; + char line[BUF_SIZE]; + char *reader; + int i; + char *pattern; + + + if ((pattern_file = fopen (file_name, "r")) == NULL) + fatal ("Can not open the input file\n"); + + /* Initialize the tree structure */ + while (fgets (line, BUF_SIZE, pattern_file) != NULL) + { + int value; + int pattern_length, search_depth; + + reader = line + 1; + switch (line[0]) + { + case '1': + sscanf (reader, "(%d)", &pattern_length); + search_depth = 0; + break; + case '2': + sscanf (reader, "(%d:%d)", &pattern_length, &search_depth); + break; + default: + fatal ("unrecognized input line start: %c \n", line[0]); + } + + if ((pattern = (char *) malloc (pattern_length + 1)) == NULL) + fatal ("Not enough virtual memory \n"); + + for (i = 0; i < pattern_length; i++) + { + while (*reader != ',') + reader++; + reader++; + sscanf (reader, " %d", &value); + pattern[i] = (char)value; +#ifdef DEBUG_2 + fprintf (stdout, "Read value: %d \n", value); +#endif + } + + pattern[pattern_length] = '\0'; + +#ifdef DEBUG_2 + fprintf (stdout, "Pattern: %s, length: %d depth: %d, tree before: %x\n", pattern, pattern_length, search_depth, tree_head); +#endif + + insert_rule (pattern, pattern_length, search_depth); + +#ifdef DEBUG_2 + fprintf (stdout, "Tree after: %x\n", tree_head); +#endif + } +} Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.h?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.h Mon Jan 28 01:09:41 2008 @@ -0,0 +1,89 @@ +/* + * search.h - Searching routines for URL switching + * + * This file is a part of the NetBench + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * Everyone is granted permission to copy, modify and redistribute + * this tool set under the following conditions: + * + * Permission is granted to anyone to make or distribute copies + * of this source code, either as received or modified, in any + * medium, provided that all copyright notices, permission and + * nonwarranty notices are preserved, and that the distributor + * grants the recipient permission for further redistribution as + * permitted by this document. + * + * Permission is granted to distribute this file in compiled + * or executable form under the same conditions that apply for + * source code, provied that either: + * + * A. it is accompanied by the corresponding machine-readable + * source code, + * B. it is accompanied by a written offer, with no time limit, + * to give anyone a machine-readable copy of the corresponding + * source code in return for reimbursement of the cost of + * distribution. This written offer must permit verbatim + * duplication by anyone, or + * C. it is distributed by someone who received only the + * executable form, and is accompanied by a copy of the + * written offer of source code that they received concurrently. + * + * In other words, you are welcome to use and share this source file. + * You are forbidden to forbid anyone else to use, share and improve + * what you give them. + */ + +#ifdef LITTLE_ENDIAN +#define PACKET_LENGTH(packet) (((unsigned char)packet[2] << 8) + (unsigned char)packet[3]) +#else +#define PACKET_LENGTH(packet) (*(unsigned short *)&packet[2]) +#endif + +#define PACKET_SOURCE(packet) (*(unsigned int *)&packet[12]) +#define PACKET_DESTINATION(packet) (*(unsigned int *)&packet[16]) + +#define BUF_SIZE 2048 + +typedef enum _nodetype {log, route} nodetype; + +#define CHAR_SIZE 256 + +/* Patterns are stored in a two-dimensional link. The headers contain + a common substring for all the patterns in the nodes stored in the + link below. The links contain the actual elements to be searched */ + +typedef struct _PatternNode +{ + int chain_node_number; /* Label */ + + nodetype type; /* log and route, or just route */ + int proto; /* protocol, currently not used */ + FILE *logto; /* log file in which to write packets which + match this rule, if the logging is activated. */ + char *pattern; /* pattern to search for */ + int pattern_length; /* Length of the pattern to be searched */ + int search_depth; /* Length of section to be searched */ + int *bm_table; /* BM Table used for searching */ + struct rtentry *destination; /* Where to forward packets falling for the rule */ + struct _PatternNode *below; /* The list ... */ +} PatternNode; + + +typedef struct _StrTreeNode +{ + int chain_node_number; /* Label */ + char *common_pattern; /* pattern to search for */ + int common_pattern_length; /* Length of the pattern to be searched */ + int *bm_table; /* BM Table used for searching */ + struct _StrTreeNode *next; /* Next head in the list */ + struct _PatternNode *list; /* List of patterns for the head (common subpattern) */ +} StrTreeNode; + +int boyer_moore (char *, int, char *, int, int *); +struct rtentry *find_destination (char *, int); +void db_init (char *); Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Mon Jan 28 01:09:41 2008 @@ -0,0 +1,146 @@ +/* + * url.c - Routines for URL switching + * + * This file is a part of the NetBench + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * Everyone is granted permission to copy, modify and redistribute + * this tool set under the following conditions: + * + * + * Permission is granted to anyone to make or distribute copies + * of this source code, either as received or modified, in any + * medium, provided that all copyright notices, permission and + * nonwarranty notices are preserved, and that the distributor + * grants the recipient permission for further redistribution as + * permitted by this document. + * + * Permission is granted to distribute this file in compiled + * or executable form under the same conditions that apply for + * source code, provied that either: + * + * A. it is accompanied by the corresponding machine-readable + * source code, + * B. it is accompanied by a written offer, with no time limit, + * to give anyone a machine-readable copy of the corresponding + * source code in return for reimbursement of the cost of + * distribution. This written offer must permit verbatim + * duplication by anyone, or + * C. it is distributed by someone who received only the + * executable form, and is accompanied by a copy of the + * written offer of source code that they received concurrently. + * + * In other words, you are welcome to use and share this source file. + * You are forbidden to forbid anyone else to use, share and improve + * what you give them. + */ + +#include +#include +#include +#include +#include +#include "packet.h" +#include "utils.h" +#include "search.h" +#include "url.h" + +#define MAX_PACKET_SIZE 1500 + +StrTreeNode *tree_head; + +long +internet_checksum (addr, count) + unsigned short * addr; + int count; +{ + /* + * Compute Internet Checksum for "count" bytes + * beginning at location "addr". + */ + register unsigned long sum = 0; + + while( count > 1 ) + { + sum+= ~((unsigned short)*addr++); + count -= 2; + } + + /* Add left-over byte, if any */ + if( count > 0 ) + sum += * (unsigned char *) addr; + + /* Fold 32-bit sum to 16 bits */ + while (sum>>16) + sum = (sum & 0xffff) + (sum >> 16); + +#ifdef LITTLE_ENDIAN + sum = ((sum >> 8) & 0xFF) + ((sum << 8) & 0xFF00); +#endif + + return sum; +} + +/*************************************************\ +* * +* main: Initializes the string table * +* Reads packets and compares them against * +* the table * +* * +\************************************************/ +int main (int argc, char **argv) +{ + struct rtentry *entry; + unsigned int num_packets, i; + char *packet; + + if (argc != 3) + fatal ("Usage: url inputfilename #numberofpackets"); + + num_packets = atoi (argv[2]); + + /* Read the string information */ + db_init(argv[1]); + + fprintf (stdout, "URL table initialized, reading packets... \n"); + + /* The table is ready, now we get the packets... */ + for (i = 0; i < num_packets; i++) + { + long original_checksum, checksum; + + packet = get_next_packet(); + + /* We only have to check the checksum to make sure nothing is changed.. */ +#ifdef LITTLE_ENDIAN + original_checksum = ((unsigned char)packet[10] << 8) + (unsigned char)packet[11]; +#else + original_checksum = *(unsigned short *)&packet[10]; +#endif + packet[10] = 0; + packet[11] = 0; + checksum = (internet_checksum ((unsigned short*)packet, 20)) & 0xFFFF; + + entry = find_destination (packet, packet_size (i)); + + checksum = (internet_checksum ((unsigned short*)packet, 20)) & 0xFFFF; + packet[10] = (checksum & 0xFF00) >> 8; + packet[11] = checksum & 0xFF; + + /* We actually now have to check whether the entry is NULL and + if so forward the packet to a default destination, but we don't + have any interface anyway and find_destination always return + NULL (from different locations indicating a match for the + packet). So, we don't perform the checking and forwarding. These + are done in route application. */ + + /* Done for the packet... */ + } + + fprintf (stderr, "URL finished for %d packets \n", num_packets); + return 0; +} Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.h?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.h Mon Jan 28 01:09:41 2008 @@ -0,0 +1,43 @@ +/* + * url.h - Routines for URL switching + * + * This file is a part of the NetBench + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * Everyone is granted permission to copy, modify and redistribute + * this tool set under the following conditions: + * + * Permission is granted to anyone to make or distribute copies + * of this source code, either as received or modified, in any + * medium, provided that all copyright notices, permission and + * nonwarranty notices are preserved, and that the distributor + * grants the recipient permission for further redistribution as + * permitted by this document. + * + * Permission is granted to distribute this file in compiled + * or executable form under the same conditions that apply for + * source code, provied that either: + * + * A. it is accompanied by the corresponding machine-readable + * source code, + * B. it is accompanied by a written offer, with no time limit, + * to give anyone a machine-readable copy of the corresponding + * source code in return for reimbursement of the cost of + * distribution. This written offer must permit verbatim + * duplication by anyone, or + * C. it is distributed by someone who received only the + * executable form, and is accompanied by a copy of the + * written offer of source code that they received concurrently. + * + * In other words, you are welcome to use and share this source file. + * You are forbidden to forbid anyone else to use, share and improve + * what you give them. + */ + +#define MIN_COMMON_SIZE 3 + + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.c?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.c Mon Jan 28 01:09:41 2008 @@ -0,0 +1,32 @@ +/* + * utils.c - Some utility functions common to several applications + * + * This file is a part of the NetBench suite by Gokhan Memik + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * You are welcome to use, share and improve this + * source file. You are forbidden to forbid anyone else to use, share + * and improve what you give them. + * + */ + +#include + +#ifdef __GNUC__ +void _fatal(char *file, char *func, int line, char *fmt, ...) +#else +void fatal(char *fmt, ...) +#endif +{ + fprintf(stderr, "fatal: %s", fmt); +#ifdef __GNUC__ + fprintf(stderr, " [%s:%s, line %d]", func, file, line); +#endif + fprintf(stderr, "\n"); + exit(1); +} + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.h?rev=46444&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/utils.h Mon Jan 28 01:09:41 2008 @@ -0,0 +1,29 @@ +/* + * utils.h - Some utility functions common to several applications + * + * This file is a part of the NetBench suite by Gokhan Memik + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * You are welcome to use, share and improve this + * source file. You are forbidden to forbid anyone else to use, share + * and improve what you give them. + * + */ + +#ifdef __GNUC__ +/* declare a fatal run-time error, calls fatal hook function */ +#define fatal(fmt, args...) \ + _fatal(__FILE__, __FUNCTION__, __LINE__, fmt, ## args) + +void +_fatal(char *file, char *func, int line, char *fmt, ...) +__attribute__ ((noreturn)); +#else +void fatal(char *fmt, ...); +#endif + + From nicholas at mxc.ca Mon Jan 28 01:16:22 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 28 Jan 2008 07:16:22 -0000 Subject: [llvm-commits] [test-suite] r46445 - /test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Message-ID: <200801280716.m0S7GMHj007850@zion.cs.uiuc.edu> Author: nicholas Date: Mon Jan 28 01:16:22 2008 New Revision: 46445 URL: http://llvm.org/viewvc/llvm-project?rev=46445&view=rev Log: Make this test a little more forgiving. Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile?rev=46445&r1=46444&r2=46445&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Mon Jan 28 01:16:22 2008 @@ -1,6 +1,7 @@ LEVEL = ../../../.. PROG = beamformer +FP_TOLERANCE = 0.000001 ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = -i 400 else From sabre at nondot.org Mon Jan 28 01:21:49 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 07:21:49 -0000 Subject: [llvm-commits] [test-suite] r46446 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc: ./ Makefile crc32.c headers.h packet.c packet.h packet_lengths.h Message-ID: <200801280721.m0S7Lod6008034@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 01:21:49 2008 New Revision: 46446 URL: http://llvm.org/viewvc/llvm-project?rev=46446&view=rev Log: new benchmark Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/crc32.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/headers.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet_lengths.h Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/Makefile?rev=46446&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/Makefile Mon Jan 28 01:21:49 2008 @@ -0,0 +1,14 @@ +LEVEL = ../../../.. + +PROG = netbench-crc +ifdef LARGE_PROBLEM_SIZE +RUN_OPTIONS = 40000 +else +ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = 1000 +else +RUN_OPTIONS = 12000 +endif +endif +include $(LEVEL)/MultiSource/Makefile.multisrc + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/crc32.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/crc32.c?rev=46446&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/crc32.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/crc32.c Mon Jan 28 01:21:49 2008 @@ -0,0 +1,147 @@ +/* + * crc32.c - Routines for crc calculation + * + * This file is a part of the NetBench suite + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * Everyone is granted permission to copy, modify and redistribute + * this tool set under the following conditions: + * + * Permission is granted to anyone to make or distribute copies + * of this source code, either as received or modified, in any + * medium, provided that all copyright notices, permission and + * nonwarranty notices are preserved, and that the distributor + * grants the recipient permission for further redistribution as + * permitted by this document. + * + * Permission is granted to distribute this file in compiled + * or executable form under the same conditions that apply for + * source code, provied that either: + * + * A. it is accompanied by the corresponding machine-readable + * source code, + * B. it is accompanied by a written offer, with no time limit, + * to give anyone a machine-readable copy of the corresponding + * source code in return for reimbursement of the cost of + * distribution. This written offer must permit verbatim + * duplication by anyone, or + * C. it is distributed by someone who received only the + * executable form, and is accompanied by a copy of the + * written offer of source code that they received concurrently. + * + * In other words, you are welcome to use and share this source file. + * You are forbidden to forbid anyone else to use, share and improve + * what you give them. + * + */ + +/* crc32.c -- package to compute 32-bit CRC one byte at a time */ +/* */ +/* Synopsis: */ +/* gen_crc_table() -- generates a 256-word table containing all CRC */ +/* remainders for every possible 8-bit byte. It */ +/* must be executed (once) before any CRC updates. */ +/* */ +/* unsigned update_crc(crc_accum, data_blk_ptr, data_blk_size) */ +/* unsigned crc_accum; char *data_blk_ptr; int data_blk_size; */ +/* Returns the updated value of the CRC accumulator after */ +/* processing each byte in the addressed block of data. */ +/* */ +/* It is assumed that an unsigned long is at least 32 bits wide and */ +/* that the predefined type char occupies one 8-bit byte of storage. */ +/* */ +/* The generator polynomial used for this version of the package is */ +/* x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x^1+x^0 */ +/* as specified in the Autodin/Ethernet/ADCCP protocol standards. */ +/* Other degree 32 polynomials may be substituted by re-defining the */ +/* symbol POLYNOMIAL below. Lower degree polynomials must first be */ +/* multiplied by an appropriate power of x. The representation used */ +/* is that the coefficient of x^0 is stored in the LSB of the 32-bit */ +/* word and the coefficient of x^31 is stored in the most significant */ +/* bit. The CRC is to be appended to the data most significant byte */ +/* first. For those protocols in which bytes are transmitted MSB */ +/* first and in the same order as they are encountered in the block */ +/* this convention results in the CRC remainder being transmitted with */ +/* the coefficient of x^31 first and with that of x^0 last (just as */ +/* would be done by a hardware shift register mechanization). */ +/* */ +/* The table lookup technique was adapted from the algorithm described */ +/* by Avram Perez, Byte-wise CRC Calculations, IEEE Micro 3, 40 (1983).*/ +/* */ + +#include +#include +#include "packet.h" + +#define POLYNOMIAL 0x04c11db7L + +static unsigned long crc_table[256]; + +/* generate the table of CRC remainders for all possible bytes */ +void +gen_crc_table() +{ + register int i, j; + register unsigned long crc_accum; + + for (i = 0; i < 256; i++) + { + crc_accum = ((unsigned long) i << 24); + for (j = 0; j < 8; j++) + { + if (crc_accum & 0x80000000L) + crc_accum = (crc_accum << 1) ^ POLYNOMIAL; + else + crc_accum = (crc_accum << 1); + } + crc_table[i] = crc_accum; + } + return; +} + +/* update the CRC on the data block one byte at a time */ +unsigned long +update_crc(unsigned long crc_accum, + char *data_blk_ptr, + int data_blk_size) +{ + register int i, j; + for (j = 0; j < data_blk_size; j++) + { + i = ((int)(crc_accum >> 24) ^ *data_blk_ptr++) & 0xff; + crc_accum = (crc_accum << 8) ^ crc_table[i]; + } + return crc_accum; +} + +int main (int argc, char **argv) +{ + unsigned long crc_accum; + int i = 0, numpackets; + char *packet; + + if (argc != 2) + { + fprintf (stderr, "Usage: crc #numpackets"); + exit (0); + } + else + numpackets = atoi (argv[1]); + + gen_crc_table(); + + while (i < numpackets) + { + packet = get_next_packet(i); + crc_accum = update_crc (0, packet, packet_size(i)); + i++; + } + + fprintf (stdout, "CRC completed for %d packets \n", numpackets); + + return crc_accum; +} Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/headers.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/headers.h?rev=46446&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/headers.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/headers.h Mon Jan 28 01:21:49 2008 @@ -0,0 +1,102 @@ +unsigned char headers[100][36] = { +{69, 0, 0, 60, 237, 188, 64, 0, 125, 6, 95, 223, 0, 1, 0, 1, 0, 2, 0, 1, 26, 32, 5, 119, 2, 141, 165, 39, 0, 0, 222, 220, 80, 24, 33, 209}, +{0, 114, 6, 43, 148, 0, 3, 0, 1, 0, 4, 0, 1, 11, 117, 24, 202, 0, 113, 219, 105, 32, 225, 253, 125, 80, 24, 31, 39, 58, 164, 222, 138, 1, 0, 162}, +{5, 0, 1, 18, 29, 26, 43, 14, 223, 211, 56, 0, 0, 228, 228, 80, 24, 254, 254, 58, 164, 222, 138, 1, 0, 164, 173, 69, 0, 0, 77, 18, 227, 64, 0, 123}, +{113, 220, 37, 80, 24, 63, 8, 58, 164, 222, 138, 2, 0, 166, 50, 69, 0, 0, 52, 156, 53, 64, 0, 122, 6, 12, 247, 0, 6, 0, 1, 0, 1, 0, 3, 5}, +{222, 138, 1, 0, 168, 49, 69, 0, 0, 74, 18, 228, 64, 0, 123, 6, 106, 136, 0, 4, 0, 1, 0, 7, 0, 1, 4, 139, 24, 202, 103, 113, 237, 12, 65, 209}, +{0, 5, 220, 142, 37, 64, 0, 124, 6, 117, 154, 0, 8, 0, 1, 0, 9, 0, 1, 26, 32, 13, 30, 132, 240, 181, 176, 41, 224, 24, 115, 128, 24, 68, 32, 58}, +{17, 6, 104, 0, 10, 0, 1, 0, 1, 0, 4, 105, 135, 105, 125, 0, 65, 19, 197, 58, 164, 222, 138, 2, 0, 173, 39, 58, 164, 222, 138, 1, 0, 174, 116, 69}, +{1, 0, 1, 0, 2, 0, 1, 26, 32, 5, 119, 2, 141, 165, 59, 0, 0, 222, 220, 80, 16, 33, 209, 58, 164, 222, 138, 1, 0, 174, 206, 69, 0, 5, 220, 142}, +{0, 1, 26, 32, 13, 30, 132, 240, 187, 88, 41, 224, 24, 115, 128, 16, 68, 32, 58, 164, 222, 138, 1, 0, 175, 149, 69, 0, 5, 220, 35, 112, 64, 0, 124, 6}, +{152, 99, 253, 0, 10, 2, 208, 80, 24, 33, 224, 58, 164, 222, 138, 1, 0, 176, 35, 69, 0, 2, 116, 239, 188, 64, 0, 125, 6, 91, 167, 0, 1, 0, 1, 0}, +{209, 58, 164, 222, 138, 2, 0, 176, 211, 69, 0, 0, 44, 89, 100, 64, 0, 121, 6, 170, 184, 0, 11, 0, 1, 0, 8, 0, 2, 0, 80, 5, 233, 133, 234, 167}, +{123, 6, 200, 231, 0, 8, 0, 2, 0, 11, 0, 1, 5, 233, 0, 80, 114, 12, 101, 163, 133, 234, 167, 179, 80, 16, 68, 112, 58, 164, 222, 138, 2, 0, 183, 194}, +{4, 0, 2, 26, 43, 193, 37, 1, 33, 115, 32, 26, 142, 226, 221, 80, 16, 254, 177, 58, 164, 222, 138, 1, 0, 184, 183, 69, 0, 5, 220, 98, 25, 64, 0, 124}, +{4, 198, 11, 125, 80, 16, 68, 112, 58, 164, 222, 138, 2, 0, 185, 228, 69, 0, 5, 220, 158, 203, 64, 0, 120, 6, 11, 223, 0, 12, 0, 1, 0, 4, 0, 2}, +{64, 0, 124, 6, 10, 243, 0, 1, 0, 5, 0, 13, 0, 1, 39, 14, 5, 254, 31, 143, 191, 155, 4, 198, 11, 125, 80, 24, 68, 112, 58, 164, 222, 138, 2, 0}, +{0, 2, 26, 43, 193, 37, 1, 33, 126, 136, 26, 142, 226, 221, 80, 24, 254, 177, 58, 164, 222, 138, 1, 0, 188, 136, 69, 0, 1, 98, 57, 58, 64, 0, 123, 6}, +{68, 112, 58, 164, 222, 138, 2, 0, 189, 229, 69, 16, 0, 120, 176, 81, 64, 0, 119, 6, 1, 133, 0, 14, 0, 1, 0, 8, 0, 3, 9, 196, 0, 25, 0, 159}, +{0, 192, 67, 69, 0, 0, 40, 17, 198, 64, 0, 122, 6, 19, 112, 0, 15, 0, 1, 0, 1, 0, 6, 4, 123, 18, 116, 1, 247, 207, 93, 231, 52, 1, 202, 80}, +{27, 64, 0, 124, 6, 8, 186, 0, 1, 0, 5, 0, 13, 0, 1, 39, 14, 5, 254, 31, 143, 195, 23, 4, 198, 11, 125, 80, 16, 68, 112, 58, 164, 222, 138, 1}, +{100, 1, 25, 65, 154, 24, 163, 112, 193, 80, 16, 34, 56, 58, 164, 222, 138, 1, 0, 204, 92, 69, 0, 5, 220, 188, 11, 64, 0, 125, 6, 96, 118, 0, 1, 0}, +{202, 1, 247, 207, 93, 80, 16, 68, 112, 58, 164, 222, 138, 1, 0, 205, 79, 69, 0, 5, 140, 187, 144, 64, 0, 125, 6, 24, 189, 0, 1, 0, 9, 0, 18, 0}, +{58, 164, 222, 138, 1, 0, 207, 51, 69, 0, 3, 164, 188, 12, 64, 0, 125, 6, 98, 173, 0, 1, 0, 6, 0, 15, 0, 1, 18, 116, 4, 123, 231, 52, 7, 126}, +{69, 0, 0, 40, 79, 64, 64, 0, 249, 6, 224, 29, 0, 4, 0, 2, 0, 12, 0, 1, 193, 37, 26, 43, 26, 142, 226, 221, 1, 33, 126, 136, 80, 16, 128, 0}, +{155, 0, 1, 0, 8, 0, 17, 0, 1, 4, 100, 26, 43, 24, 163, 118, 117, 1, 25, 65, 154, 80, 24, 254, 254, 58, 164, 222, 138, 1, 0, 213, 55, 69, 0, 5}, +{26, 43, 24, 163, 124, 41, 1, 25, 65, 154, 80, 24, 254, 254, 58, 164, 222, 138, 1, 0, 218, 4, 69, 0, 5, 220, 216, 118, 64, 0, 125, 6, 214, 155, 0, 1}, +{154, 80, 16, 254, 254, 58, 164, 222, 138, 1, 0, 226, 23, 69, 0, 0, 40, 104, 223, 64, 0, 56, 6, 142, 34, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238}, +{171, 64, 0, 118, 6, 60, 191, 0, 21, 0, 1, 0, 1, 0, 10, 241, 12, 206, 190, 129, 60, 126, 158, 251, 108, 252, 146, 128, 16, 68, 112, 58, 164, 222, 138, 2}, +{43, 193, 38, 1, 17, 190, 172, 26, 213, 223, 111, 80, 16, 254, 164, 58, 164, 222, 138, 2, 0, 244, 249, 69, 0, 0, 40, 116, 185, 64, 0, 117, 6, 235, 32, 0}, +{29, 160, 58, 164, 222, 138, 1, 0, 245, 184, 69, 0, 0, 40, 79, 65, 64, 0, 249, 6, 224, 28, 0, 4, 0, 2, 0, 12, 0, 1, 193, 36, 26, 43, 26, 104}, +{0, 5, 220, 161, 203, 64, 0, 120, 6, 8, 223, 0, 12, 0, 1, 0, 4, 0, 2, 26, 43, 193, 38, 1, 17, 196, 96, 26, 213, 223, 111, 80, 16, 254, 164, 58}, +{20, 26, 213, 223, 111, 80, 24, 254, 164, 58, 164, 222, 138, 2, 0, 250, 219, 69, 0, 0, 40, 18, 198, 64, 0, 122, 6, 18, 112, 0, 15, 0, 1, 0, 1, 0}, +{33, 64, 0, 61, 6, 109, 215, 0, 8, 0, 3, 0, 14, 0, 1, 0, 25, 9, 196, 30, 152, 194, 61, 0, 159, 146, 4, 80, 24, 96, 244, 58, 164, 222, 138, 2}, +{169, 0, 23, 0, 1, 0, 1, 0, 11, 0, 20, 7, 47, 9, 177, 105, 101, 2, 25, 246, 43, 128, 16, 68, 112, 58, 164, 222, 138, 1, 1, 6, 238, 69, 0, 5}, +{1, 18, 116, 4, 123, 231, 52, 10, 250, 1, 247, 207, 93, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 8, 80, 69, 0, 0, 40, 79, 66, 64, 0, 249, 6, 224}, +{20, 80, 16, 128, 0, 58, 164, 222, 138, 2, 1, 9, 40, 69, 0, 0, 40, 27, 226, 64, 0, 120, 6, 163, 224, 0, 24, 0, 1, 0, 4, 0, 3, 8, 154, 0}, +{138, 2, 1, 11, 15, 69, 0, 0, 52, 121, 162, 64, 0, 120, 6, 217, 168, 0, 23, 0, 1, 0, 1, 0, 11, 0, 20, 7, 47, 9, 177, 105, 101, 2, 25, 246}, +{69, 0, 0, 52, 84, 91, 64, 0, 120, 6, 127, 8, 0, 25, 0, 1, 0, 1, 0, 11, 0, 20, 7, 44, 109, 47, 0, 51, 2, 142, 167, 191, 128, 16, 68, 112}, +{0, 0, 143, 91, 251, 64, 0, 123, 6, 33, 44, 0, 7, 0, 1, 0, 4, 0, 1, 24, 202, 4, 139, 65, 209, 165, 21, 103, 113, 237, 46, 80, 24, 199, 50, 58}, +{1, 0, 6, 0, 15, 0, 1, 18, 116, 4, 123, 231, 52, 16, 174, 1, 247, 207, 93, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 17, 216, 69, 0, 5, 220, 68}, +{47, 0, 20, 2, 25, 246, 43, 9, 177, 105, 101, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 17, 254, 69, 0, 0, 40, 84, 92, 64, 0, 120, 6, 127, 19, 0}, +{219, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 20, 9, 69, 0, 0, 77, 18, 229, 64, 0, 123, 6, 106, 132, 0, 4, 0, 1, 0, 7, 0, 1, 4, 139, 24}, +{138, 2, 1, 20, 32, 69, 0, 0, 40, 195, 62, 64, 0, 117, 6, 196, 230, 0, 26, 0, 1, 0, 19, 0, 2, 7, 172, 0, 80, 17, 201, 176, 102, 125, 36, 102}, +{0, 1, 7, 47, 0, 20, 2, 26, 7, 71, 9, 177, 105, 101, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 24, 223, 69, 0, 0, 40, 229, 133, 64, 0, 116, 6}, +{32, 164, 222, 185, 140, 4, 58, 123, 13, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 29, 7, 69, 0, 5, 220, 70, 35, 64, 0, 125, 6, 130, 152, 0, 1, 0}, +{184, 219, 109, 47, 0, 51, 80, 24, 34, 56, 58, 164, 222, 138, 1, 1, 33, 141, 69, 0, 5, 220, 151, 94, 64, 0, 124, 6, 29, 148, 0, 1, 0, 13, 0, 28}, +{222, 185, 140, 80, 24, 33, 244, 58, 164, 222, 138, 1, 1, 33, 248, 69, 0, 5, 220, 71, 35, 64, 0, 125, 6, 129, 152, 0, 1, 0, 11, 0, 25, 0, 1, 7}, +{164, 222, 138, 2, 1, 35, 49, 69, 0, 0, 52, 61, 212, 64, 0, 116, 6, 159, 215, 0, 29, 0, 1, 0, 1, 0, 14, 26, 43, 15, 153, 212, 127, 67, 47, 61}, +{38, 69, 69, 0, 5, 220, 152, 94, 64, 0, 124, 6, 28, 148, 0, 1, 0, 13, 0, 28, 0, 1, 26, 32, 7, 119, 4, 58, 128, 193, 164, 222, 185, 140, 80, 16}, +{33, 64, 0, 124, 6, 20, 226, 0, 1, 0, 14, 0, 29, 0, 1, 15, 153, 26, 43, 61, 68, 188, 54, 212, 127, 67, 47, 80, 24, 34, 54, 58, 164, 222, 138, 1}, +{1, 0, 8, 0, 4, 15, 139, 26, 32, 0, 149, 18, 41, 4, 66, 205, 224, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 55, 121, 69, 0, 5, 220, 11, 70, 64}, +{97, 4, 75, 182, 240, 255, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 56, 21, 69, 0, 5, 220, 11, 71, 64, 0, 249, 6, 37, 6, 0, 20}, +{2, 1, 56, 252, 69, 0, 5, 220, 11, 72, 64, 0, 249, 6, 37, 5, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 182, 252, 103, 39, 105, 222, 147}, +{4, 0, 31, 0, 1, 26, 32, 15, 139, 4, 66, 205, 224, 0, 149, 18, 41, 80, 24, 33, 234, 58, 164, 222, 138, 2, 1, 57, 181, 69, 0, 5, 220, 11, 73, 64}, +{75, 183, 2, 27, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 58, 106, 69, 0, 5, 220, 11, 74, 64, 0, 249, 6, 37, 3, 0, 20, 0, 1}, +{56, 58, 164, 222, 138, 2, 1, 58, 242, 69, 0, 5, 220, 11, 75, 64, 0, 249, 6, 37, 2, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 13}, +{64, 0, 249, 6, 37, 1, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 19, 55, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 2, 1}, +{24, 34, 56, 58, 164, 222, 138, 2, 1, 60, 217, 69, 0, 5, 220, 11, 79, 64, 0, 249, 6, 36, 254, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75}, +{69, 0, 5, 220, 11, 80, 64, 0, 249, 6, 36, 253, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 42, 7, 39, 105, 222, 147, 80, 24, 34, 56}, +{1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 47, 187, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 62, 138, 69, 0, 0, 52, 19, 198, 64}, +{1, 247, 207, 93, 231, 52, 10, 250, 128, 16, 34, 56, 58, 164, 222, 138, 1, 1, 62, 191, 69, 0, 5, 220, 220, 107, 64, 0, 124, 6, 74, 24, 0, 8, 0, 4}, +{16, 33, 234, 58, 164, 222, 138, 2, 1, 63, 52, 69, 0, 5, 220, 11, 82, 64, 0, 249, 6, 36, 251, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75}, +{0, 5, 220, 142, 200, 64, 0, 252, 6, 177, 36, 0, 8, 0, 5, 0, 32, 0, 1, 201, 148, 0, 119, 225, 31, 71, 114, 81, 1, 252, 37, 80, 16, 34, 56, 58}, +{31, 77, 38, 81, 1, 252, 37, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 65, 4, 69, 0, 0, 52, 86, 7, 64, 0, 53, 6, 182, 104, 0, 33, 0, 1, 0}, +{112, 58, 164, 222, 138, 2, 1, 67, 146, 69, 0, 0, 40, 211, 16, 64, 0, 120, 6, 144, 214, 0, 34, 0, 1, 0, 1, 0, 16, 8, 110, 160, 230, 0, 93, 217}, +{104, 228, 64, 0, 56, 6, 142, 29, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 182, 252, 103, 80, 16, 192, 0, 58, 164, 222, 138}, +{22, 0, 2, 39, 14, 4, 141, 157, 116, 105, 70, 1, 152, 6, 61, 80, 24, 68, 112, 58, 164, 222, 138, 2, 1, 72, 231, 69, 0, 0, 40, 228, 156, 64, 0, 253}, +{94, 66, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 73, 45, 69, 0, 0, 40, 104, 230, 64, 0, 56, 6, 142, 27, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4}, +{69, 0, 0, 40, 117, 185, 64, 0, 117, 6, 234, 32, 0, 22, 0, 1, 0, 1, 0, 5, 7, 172, 39, 14, 0, 97, 50, 3, 57, 236, 31, 43, 80, 16, 34, 56}, +{64, 0, 56, 6, 142, 26, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 183, 19, 55, 80, 16, 192, 0, 58, 164, 222, 138, 2, 1}, +{179, 114, 12, 102, 221, 80, 24, 32, 254, 58, 164, 222, 138, 2, 1, 74, 8, 69, 0, 0, 40, 228, 157, 64, 0, 253, 6, 96, 3, 0, 32, 0, 1, 0, 8, 0}, +{64, 0, 125, 6, 96, 114, 0, 1, 0, 6, 0, 15, 0, 1, 18, 116, 4, 123, 231, 52, 22, 98, 1, 247, 207, 93, 80, 24, 68, 112, 58, 164, 222, 138, 1, 1}, +{19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 183, 24, 235, 80, 16, 192, 0, 58, 164, 222, 138, 2, 1, 75, 91, 69, 0, 5, 220, 11}, +{35, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 75, 188, 69, 0, 5, 220, 11, 84, 64, 0, 249, 6, 36, 249, 0, 20, 0, 1, 0, 19, 0}, +{1, 1, 76, 81, 69, 0, 5, 220, 142, 202, 64, 0, 252, 6, 177, 34, 0, 8, 0, 5, 0, 32, 0, 1, 201, 148, 0, 119, 225, 31, 94, 66, 81, 1, 252, 37}, +{110, 152, 238, 126, 216, 0, 93, 217, 25, 80, 16, 127, 218, 58, 164, 222, 138, 1, 1, 76, 211, 69, 0, 5, 220, 142, 203, 64, 0, 252, 6, 177, 33, 0, 8, 0}, +{69, 0, 5, 220, 11, 86, 64, 0, 249, 6, 36, 247, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 76, 63, 39, 105, 222, 147, 80, 24, 34, 56}, +{75, 183, 36, 83, 80, 16, 192, 0, 58, 164, 222, 138, 2, 1, 77, 171, 69, 0, 5, 220, 11, 87, 64, 0, 249, 6, 36, 246, 0, 20, 0, 1, 0, 19, 0, 1}, +{6, 36, 244, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 93, 91, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 79, 84, 69}, +{4, 75, 183, 99, 15, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 2, 1, 80, 23, 69, 0, 5, 220, 11, 91, 64, 0, 249, 6, 36, 242, 0, 20, 0}, +{34, 56, 58, 164, 222, 138, 1, 1, 80, 37, 69, 0, 0, 40, 104, 234, 64, 0, 56, 6, 142, 23, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105}, +{80, 207, 69, 0, 5, 220, 11, 92, 64, 0, 249, 6, 36, 241, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 110, 119, 39, 105, 222, 147, 80, 24}, +{6, 200, 60, 0, 35, 0, 1, 0, 4, 0, 4, 7, 110, 17, 80, 0, 238, 77, 101, 4, 141, 76, 110, 128, 16, 250, 0, 58, 164, 222, 138, 2, 1, 81, 107, 69}, +{247, 97, 4, 75, 183, 116, 43, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 1, 1, 81, 112, 69, 0, 5, 220, 13, 37, 64, 0, 124, 6, 77, 14, 0}, +{132, 140, 0, 93, 217, 25, 80, 16, 127, 218, 58, 164, 222, 138, 2, 1, 81, 248, 69, 0, 5, 220, 11, 94, 64, 0, 249, 6, 36, 239, 0, 20, 0, 1, 0, 19}, +{0, 5, 220, 98, 33, 64, 0, 124, 6, 241, 4, 0, 1, 0, 5, 0, 22, 0, 1, 39, 14, 7, 172, 57, 236, 35, 195, 0, 97, 50, 3, 80, 16, 68, 112, 58}, +{97, 4, 75, 183, 127, 147, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 83, 56, 69, 0, 4, 182, 91, 100, 64, 0, 121, 6, 164, 46, 0, 11}, +{168, 4, 114, 12, 102, 221, 80, 25, 32, 254, 58, 164, 222, 138, 2, 1, 83, 150, 69, 0, 5, 220, 11, 96, 64, 0, 249, 6, 36, 237, 0, 20, 0, 1, 0, 19}, +{20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 144, 175, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 2, 1, 85, 85, 69, 0, 5, 220, 11}, +{150, 99, 39, 105, 222, 147, 80, 16, 34, 56, 58, 164, 222, 138, 2, 1, 85, 119, 69, 0, 0, 40, 228, 158, 64, 0, 253, 6, 96, 2, 0, 32, 0, 1, 0, 8}, +{6, 96, 1, 0, 32, 0, 1, 0, 8, 0, 5, 0, 119, 201, 148, 81, 1, 252, 37, 225, 31, 111, 94, 80, 16, 68, 112, 58, 164, 222, 138, 1, 1, 87, 25, 69}, +{119, 0, 97, 50, 3, 80, 16, 68, 112, 58, 164, 222, 138, 2, 1, 87, 40, 69, 0, 5, 220, 11, 101, 64, 0, 249, 6, 36, 232, 0, 20, 0, 1, 0, 19, 0}, +{222, 138, 2, 1, 87, 148, 69, 0, 5, 220, 11, 102, 64, 0, 249, 6, 36, 231, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 167, 127, 39, 105}, +{103, 64, 0, 249, 6, 38, 206, 0, 20, 0, 1, 0, 19, 0, 1, 238, 247, 97, 4, 75, 183, 173, 51, 39, 105, 222, 147, 80, 24, 34, 56, 58, 164, 222, 138, 1}, +{31, 111, 94, 81, 1, 252, 37, 80, 24, 34, 56, 58, 164, 222, 138, 1, 1, 88, 245, 69, 0, 0, 40, 104, 236, 64, 0, 56, 6, 142, 21, 0, 19, 0, 1, 0}, +{89, 154, 69, 0, 0, 48, 44, 68, 64, 0, 119, 6, 194, 118, 0, 36, 0, 1, 0, 4, 0, 1, 6, 188, 24, 202, 3, 34, 61, 114, 0, 0, 0, 0, 112, 2}, +{0, 5, 220, 142, 206, 64, 0, 252, 6, 177, 30, 0, 8, 0, 5, 0, 32, 0, 1, 201, 148, 0, 119, 225, 31, 117, 18, 81, 1, 252, 37, 80, 16, 34, 56, 58}, +{37, 80, 24, 34, 56, 58, 164, 222, 138, 1, 1, 91, 66, 69, 0, 0, 40, 104, 237, 64, 0, 56, 6, 142, 20, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238}, +{238, 64, 0, 56, 6, 142, 19, 0, 19, 0, 1, 0, 20, 0, 1, 97, 4, 238, 247, 39, 105, 222, 147, 75, 183, 93, 91, 80, 16, 136, 224, 58, 164, 222, 138, 2}, +{35, 0, 1, 0, 4, 0, 4, 7, 110, 17, 80, 0, 238, 77, 101, 4, 141, 76, 110, 128, 16, 250, 0, 58, 164, 222, 138, 1, 1, 96, 85, 69, 0, 5, 220, 78}, +{110, 4, 141, 93, 138, 0, 238, 77, 101, 80, 16, 28, 167, 58, 164, 222, 138, 1, 1, 96, 176, 69, 0, 0, 40, 57, 60, 64, 0, 123, 6, 200, 228, 0, 8, 0} +}; Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c?rev=46446&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.c Mon Jan 28 01:21:49 2008 @@ -0,0 +1,71 @@ +/* + * packet.c - Implementation of the packet interface + * + * This file is a part of the NetBench suite by Gokhan Memik + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * You are welcome to use, share and improve this + * source file. You are forbidden to forbid anyone else to use, share + * and improve what you give them. + * + */ + +#include +#include +#include "packet_lengths.h" +#include "headers.h" +#include "packet.h" + +/* Traces automatically drop the TCP checksum and urgent pointer, so header is 36 bytes */ +#define HEADER_SIZE 36 + +#ifdef CONSTANT_PACKET +unsigned int packet_index = 0; +#endif + +char * +get_next_packet (int packet_number) +{ + char *packet; + unsigned int packet_length; + + packet_number = packet_number % MAX_PACKETS; + + packet_length = (packet_lengths[packet_number]); + if (packet_length < 40) + { + /* Should never happen */ + fprintf (stderr, "Packet not large enough, increasing the size\n"); + packet_length = 40; + } + +#ifdef CONSTANT_PACKET + /* Packets are stored in a continuous chunk in the memory, just change the index... */ + packet = &packets[packet_index]; + packet_index += packet_length; +#else + /* Have to call malloc to create packet memory */ + if ((packet = (char *) malloc (packet_length)) == NULL) + { + fprintf (stderr, "Not enough space to create packet data \n"); + exit (1); + } + + /* Copy the header information */ + memcpy ((void *)packet, (void *)headers[packet_number], HEADER_SIZE); +#endif + + return packet; +} + +/* For debugging purposes, to get the size of the packet_numberth packet */ +unsigned int +packet_size (unsigned int packet_number) +{ + packet_number = packet_number % MAX_PACKETS; + return (packet_lengths[packet_number]); +} Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.h?rev=46446&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet.h Mon Jan 28 01:21:49 2008 @@ -0,0 +1,22 @@ +/* + * packet.h - Interface for reading packet information + * + * This file is a part of the NetBench suite by Gokhan Memik + * + * This source file is distributed "as is" in the hope that it will be + * useful. The suite comes with no warranty, and no author or + * distributor accepts any responsibility for the consequences of its + * use. + * + * You are welcome to use, share and improve this + * source file. You are forbidden to forbid anyone else to use, share + * and improve what you give them. + * + */ +#define MAX_PACKETS 100 + +char *get_next_packet (); + +/* For testing...*/ +unsigned int packet_size (unsigned int); + Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet_lengths.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet_lengths.h?rev=46446&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet_lengths.h (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-crc/packet_lengths.h Mon Jan 28 01:21:49 2008 @@ -0,0 +1,10002 @@ +unsigned int packet_lengths[10000] = { +60, +1579, +274, +9552, +256, +56462, +26624, +256, +6688, +64768, +42206, +51431, +538, +2941, +31750, +6699, +15012, +17221, +124, +6465, +63439, +56970, +40, +256, +6307, +4350, +118, +9729, +15012, +56481, +54751, +61, +5888, +29700, +4224, +267, +52, +36699, +1536, +5122, +4164, +276, +1839, +57017, +27951, +35920, +35330, +17664, +124, +2048, +19382, +14588, +7936, +539, +42206, +63750, +14394, +1500, +4864, +53085, +59962, +56462, +9809, +42206, +16384, +551, +20496, +40, +14342, +3174, +32006, +256, +27102, +19537, +61054, +1500, +9299, +62464, +46947, +15012, +17664, +15360, +1099, +93, +56418, +19383, +29196, +256, +10089, +256, +24882, +513, +249, +24145, +17664, +56462, +6178, +56, +256, +36189, +60076, +35329, +40, +63271, +28730, +56462, +1216, +257, +46998, +257, +10440, +4864, +63271, +40, +282, +36563, +20504, +16384, +14394, +16384, +256, +56970, +8654, +47104, +1792, +10089, +17664, +47061, +15012, +56331, +4864, +20496, +36119, +123, +10089, +4128, +14394, +10344, +1262, +21328, +39115, +24655, +56477, +112, +10468, +11013, +26724, +58693, +44933, +35330, +1500, +4576, +1863, +42206, +44608, +12032, +4130, +35329, +38912, +44289, +22096, +47864, +47616, +13294, +14394, +56380, +63103, +62281, +42206, +13441, +37312, +19383, +15012, +31750, +29197, +15012, +1024, +261, +55, +63766, +114, +113, +34117, +43742, +19724, +6409, +52708, +4164, +35329, +17664, +125, +57375, +53064, +24645, +7351, +2120, +953, +2395, +53306, +514, +61, +51557, +222, +6177, +124, +4576, +45370, +56656, +2048, +60427, +514, +35329, +1024, +5127, +39448, +39276, +50787, +260, +35329, +19869, +260, +16794, +56321, +53760, +14080, +65055, +514, +514, +17664, +253, +1912, +2481, +20496, +1574, +8630, +37445, +30982, +282, +39489, +31515, +46405, +64513, +118, +256, +538, +65204, +16384, +12032, +6176, +42206, +1866, +43264, +6212, +304, +57289, +4576, +20521, +11470, +2048, +11834, +1500, +74, +51800, +23888, +697, +16384, +11264, +20485, +4890, +12422, +35330, +54459, +16384, +2048, +263, +222, +50512, +56416, +5137, +42206, +56970, +56951, +28741, +1024, +651, +35329, +5959, +10576, +56418, +2048, +5632, +774, +65297, +2816, +1839, +21140, +56970, +42994, +64133, +16384, +2048, +34560, +23957, +56970, +56370, +56832, +6760, +13518, +65024, +515, +18245, +53, +43008, +11034, +18702, +15012, +14402, +64197, +56489, +50899, +32006, +259, +50899, +42206, +14394, +63750, +48935, +56970, +249, +1099, +8760, +16384, +1099, +8760, +50432, +47180, +56970, +63750, +4864, +7493, +28443, +18768, +259, +32768, +5120, +6178, +40, +56, +27816, +56970, +16384, +12141, +20496, +40, +5120, +27102, +259, +16384, +5120, +26915, +35329, +353, +27951, +56970, +16384, +10089, +15012, +259, +11050, +44716, +4576, +8760, +17664, +5120, +10089, +39046, +56, +5120, +6178, +17664, +1032, +528, +25601, +15012, +17664, +16384, +27102, +15012, +56, +5632, +20504, +30726, +46848, +256, +27102, +14394, +259, +56, +4608, +5122, +56979, +56970, +14592, +5888, +3000, +58077, +52, +6400, +56656, +17664, +48325, +64000, +17218, +975, +16384, +7424, +6798, +37461, +15012, +61253, +16384, +8375, +28928, +8665, +259, +50699, +1012, +256, +3589, +20496, +259, +39106, +1287, +36604, +31856, +125, +1738, +256, +36615, +47917, +32784, +1039, +16468, +12362, +8760, +35329, +49250, +9728, +57004, +4421, +31238, +64000, +30550, +6394, +21061, +3840, +51463, +40381, +9216, +16384, +21313, +8760, +15012, +516, +59504, +1759, +5970, +15012, +56199, +4950, +15012, +576, +31910, +256, +6688, +67, +15012, +56970, +56383, +57358, +1836, +39106, +38970, +42206, +39807, +24912, +16384, +21912, +256, +26481, +20496, +56970, +59102, +17101, +65194, +50268, +16384, +56161, +35330, +35329, +17664, +651, +4157, +47429, +18949, +5221, +35329, +119, +3840, +18946, +17520, +260, +5632, +25547, +1275, +2048, +26981, +29319, +14394, +32512, +2816, +41897, +35330, +4580, +28218, +52, +1615, +3847, +651, +15012, +517, +1784, +263, +26915, +42206, +651, +24539, +19258, +261, +30214, +7312, +19960, +15012, +17664, +37307, +15012, +51918, +250, +6173, +30621, +3847, +56161, +6177, +60, +31750, +512, +26724, +51301, +24912, +35439, +10330, +3840, +2941, +17664, +256, +20504, +261, +1778, +4164, +15012, +17664, +249, +8708, +58596, +27984, +56970, +261, +1550, +11116, +3771, +20504, +10485, +2048, +56970, +32581, +31750, +2048, +13058, +2390, +56970, +256, +2390, +8665, +17664, +46001, +256, +17622, +517, +256, +7444, +127, +38213, +10407, +1032, +36421, +31238, +4950, +21562, +1572, +23993, +47681, +42206, +256, +36949, +44368, +518, +56456, +31245, +39248, +56970, +34629, +22518, +17622, +14160, +22737, +13560, +50843, +4130, +33228, +1681, +80, +29786, +18402, +31719, +1702, +35788, +35330, +1690, +31750, +2048, +51712, +22077, +518, +16384, +256, +1360, +6736, +8760, +17664, +1620, +263, +18968, +13388, +20496, +35329, +1866, +58077, +17664, +8760, +17664, +41, +24025, +42206, +17391, +58, +1769, +30214, +416, +13340, +56970, +118, +18949, +23888, +35329, +16384, +3840, +6760, +20496, +519, +124, +256, +56400, +53562, +17664, +124, +3072, +5146, +52, +1536, +7424, +1222, +263, +3328, +46874, +51, +27951, +4130, +42206, +519, +1500, +21153, +6178, +42206, +119, +16077, +58, +15283, +6144, +4164, +48197, +1024, +222, +22096, +1951, +16384, +26112, +5200, +17664, +53672, +4171, +124, +35608, +24539, +4164, +42206, +13562, +1024, +10496, +6307, +17520, +1500, +125, +5632, +8200, +46149, +5632, +28417, +56970, +20496, +52, +1679, +31845, +65278, +16384, +6346, +39130, +56970, +17680, +119, +2500, +300, +7832, +4171, +35329, +30470, +3584, +256, +43559, +56523, +15012, +22808, +124, +282, +40882, +2993, +42810, +17664, +4497, +10496, +56161, +51, +20496, +15012, +56645, +3840, +6699, +24912, +35329, +124, +20496, +17520, +17664, +31750, +282, +31488, +53880, +35329, +28730, +25951, +24912, +42206, +30726, +274, +520, +10496, +65024, +35329, +8760, +10324, +266, +655, +27951, +13136, +7814, +59311, +256, +9084, +20496, +56970, +17664, +30470, +2560, +56970, +41, +256, +49664, +4130, +521, +256, +10089, +521, +31750, +2048, +7426, +2395, +2384, +14829, +64256, +5381, +47334, +521, +1775, +8760, +1572, +8197, +8760, +39168, +47386, +15012, +62396, +1572, +14394, +56331, +5120, +27102, +36755, +3007, +256, +8760, +4864, +28607, +56970, +14342, +5120, +12032, +1500, +5120, +20970, +15012, +62475, +54, +10089, +47420, +56970, +26927, +7680, +2388, +56979, +13136, +50490, +36303, +256, +60696, +56970, +17664, +47616, +38827, +17664, +263, +45639, +47828, +256, +4130, +4107, +5120, +49878, +63750, +353, +8760, +521, +50432, +19968, +6208, +35329, +56331, +159, +56970, +2511, +48, +5343, +64551, +40, +1207, +22586, +60940, +56970, +16384, +30726, +54864, +17664, +99, +11013, +32730, +17680, +63750, +20496, +15012, +63673, +36578, +49400, +732, +159, +56970, +19428, +30197, +256, +61005, +15012, +266, +64006, +9216, +5122, +22934, +42206, +266, +17664, +80, +35329, +40, +118, +1035, +1058, +15012, +44869, +40, +31750, +50688, +256, +15012, +124, +9984, +8207, +60866, +522, +6699, +57199, +31494, +14030, +8079, +42206, +17664, +16384, +256, +51514, +34824, +32784, +43637, +11520, +7287, +21174, +47584, +256, +31502, +8760, +42206, +119, +20594, +13136, +2765, +120, +4160, +261, +2048, +1082, +32784, +522, +8582, +35608, +47616, +56478, +256, +3106, +46829, +17664, +522, +16384, +512, +4128, +124, +56951, +36154, +35329, +56342, +27904, +1163, +6166, +35329, +57793, +27238, +512, +24212, +56970, +37411, +1662, +256, +18178, +27951, +4130, +23715, +120, +4608, +6699, +655, +48384, +4351, +40, +48128, +263, +11017, +56656, +52480, +59604, +2096, +8464, +35330, +1557, +64065, +40283, +16384, +22914, +14416, +2984, +61238, +42206, +56410, +26297, +256, +5961, +7504, +267, +56970, +17664, +21607, +51716, +35330, +111, +40077, +27205, +6077, +28672, +34665, +2534, +35329, +256, +267, +28730, +59689, +6869, +35330, +17664, +16384, +768, +11780, +4130, +256, +11856, +42206, +43670, +115, +3072, +27951, +60752, +3086, +16384, +38144, +20816, +35329, +16384, +8080, +7931, +14301, +51716, +5325, +51525, +122, +260, +2941, +11482, +51542, +16849, +59216, +37888, +6178, +56901, +2048, +58077, +35330, +65525, +32262, +2816, +18871, +33053, +43, +655, +42206, +119, +15012, +3212, +16384, +58112, +17440, +8684, +2816, +6699, +64771, +15012, +35329, +3237, +256, +22709, +56970, +3262, +48, +252, +21251, +4288, +56970, +69, +52992, +256, +1165, +15283, +4130, +4096, +256, +11022, +42206, +40997, +19978, +15012, +32006, +5310, +42, +42206, +16384, +6912, +9473, +42206, +23365, +5632, +655, +12803, +15622, +50047, +28730, +17664, +11034, +525, +1612, +23376, +20496, +1686, +51, +269, +1500, +9984, +36839, +31245, +42206, +31750, +25858, +6774, +21840, +17664, +1500, +2388, +35329, +56901, +16384, +1642, +1360, +54751, +24561, +3072, +15012, +269, +47660, +87, +18032, +71, +80, +14596, +11017, +27142, +269, +17477, +1662, +25344, +2363, +42206, +5120, +14080, +5127, +65076, +49201, +125, +3328, +13294, +20496, +35329, +25214, +256, +11530, +42206, +1163, +6177, +2048, +58077, +20497, +3558, +1839, +35330, +4096, +63267, +33244, +51719, +40438, +42206, +17856, +59392, +576, +3632, +3637, +12288, +26704, +17446, +1662, +27461, +10446, +256, +42206, +14394, +45332, +31528, +49210, +17664, +29446, +39760, +56331, +1099, +35330, +27648, +8760, +26880, +31245, +51002, +63750, +369, +46976, +3048, +19386, +42206, +11264, +12711, +24752, +16384, +256, +8760, +56970, +1500, +23296, +12809, +27102, +35330, +36404, +494, +56979, +36270, +47734, +15012, +56462, +47751, +42206, +1639, +24836, +27102, +3397, +36266, +256, +336, +16001, +20736, +24836, +54016, +6178, +56970, +40, +1723, +20496, +41728, +6760, +56979, +65201, +16384, +56656, +58880, +6688, +20496, +15012, +10089, +526, +5888, +47785, +35330, +63750, +34599, +4129, +4864, +36524, +17520, +3909, +56, +256, +5122, +20496, +56970, +6869, +13830, +11008, +35330, +1360, +40263, +56420, +17330, +1163, +47819, +1024, +26877, +50501, +63744, +23957, +15012, +122, +1714, +256, +35091, +18757, +37573, +49920, +20496, +17664, +256, +21288, +20496, +256, +44368, +41, +52, +1280, +25773, +256, +32262, +32961, +41285, +1779, +256, +57017, +20504, +78, +17664, +3979, +42206, +44294, +35586, +15984, +33866, +7936, +62457, +15012, +256, +24389, +1539, +1024, +44201, +8011, +30265, +7232, +3840, +1792, +3630, +43870, +56971, +124, +18970, +538, +56971, +14661, +1662, +21504, +8661, +256, +256, +6346, +19728, +10478, +280, +6960, +56971, +30726, +35073, +256, +1024, +32784, +17664, +16384, +41, +58, +17664, +31494, +44544, +4351, +16384, +55552, +8760, +1686, +19761, +12803, +42206, +513, +1648, +27156, +42206, +513, +1653, +6869, +35585, +1500, +31750, +256, +13058, +17406, +16384, +65282, +257, +43008, +256, +11009, +34128, +314, +56432, +27331, +20496, +35585, +8976, +4864, +9478, +2466, +58, +48307, +538, +15012, +1622, +52584, +45294, +43870, +16384, +16640, +34628, +3085, +4130, +23109, +56576, +256, +27102, +56332, +4864, +15012, +31761, +256, +27102, +62021, +33982, +12071, +49862, +9263, +47927, +24645, +10089, +513, +48027, +10089, +513, +37888, +113, +56971, +51399, +31494, +5120, +63271, +56971, +16384, +31855, +20304, +10345, +27207, +24576, +63271, +20504, +257, +10345, +4432, +27102, +42206, +53061, +1024, +11524, +20496, +16896, +10429, +256, +1059, +20496, +489, +4537, +20496, +17664, +4864, +47373, +32069, +1368, +20504, +23598, +62621, +65286, +258, +63813, +49920, +256, +27102, +35586, +29702, +5120, +27102, +35585, +3122, +24576, +6178, +7443, +63750, +44294, +42206, +9603, +16384, +5120, +21504, +56979, +10924, +17664, +31494, +14862, +7620, +42206, +63750, +48053, +45062, +5120, +15012, +38783, +19200, +15757, +15012, +1719, +256, +51716, +33018, +258, +17664, +34560, +2466, +47427, +42206, +49668, +24576, +3072, +49350, +4130, +135, +1638, +1262, +36578, +11498, +51730, +39183, +680, +49152, +1765, +24576, +11290, +18334, +22570, +35586, +27973, +52, +1105, +42, +15012, +5239, +63750, +19387, +39846, +35586, +249, +16032, +56979, +35586, +10496, +59595, +36421, +256, +11017, +27102, +256, +10089, +28730, +120, +1099, +4154, +17664, +249, +289, +15012, +63750, +24836, +8760, +56332, +27102, +35585, +3157, +4864, +4130, +4864, +48235, +35585, +40, +24836, +52867, +14342, +512, +63271, +36078, +36208, +84, +1216, +41808, +733, +123, +353, +27102, +15012, +48197, +16384, +2048, +58298, +32736, +4864, +35585, +96, +841, +47696, +55621, +33828, +4864, +14394, +10746, +114, +353, +10089, +9190, +42239, +125, +512, +353, +37707, +35586, +17664, +1570, +280, +20480, +41770, +820, +13398, +1629, +45544, +43578, +31750, +12032, +20504, +31750, +256, +4327, +51, +15012, +853, +58077, +55866, +5445, +50552, +1755, +57, +10510, +14336, +48698, +17664, +41216, +8201, +11268, +53085, +56511, +48607, +39424, +7789, +4224, +16384, +25600, +43148, +259, +32837, +25242, +46860, +42222, +4164, +40, +16384, +31761, +256, +90, +63, +11119, +14394, +56971, +10264, +13760, +259, +124, +32662, +14336, +17520, +56508, +22272, +19968, +17664, +25626, +4129, +35585, +29446, +38981, +28730, +16384, +4432, +60808, +59042, +1003, +42013, +4129, +28741, +256, +10752, +123, +27951, +720, +1500, +31249, +21504, +11034, +27951, +52558, +42206, +13736, +361, +11008, +20496, +42206, +15012, +1024, +1410, +4164, +21802, +58769, +58962, +58077, +61572, +31750, +11911, +20239, +9285, +2366, +21646, +62522, +124, +27136, +35585, +38252, +3923, +901, +35585, +1362, +38400, +17664, +21639, +45326, +8760, +58539, +222, +1500, +20737, +35585, +47872, +56951, +56462, +2246, +35585, +256, +20496, +11077, +57631, +19678, +25773, +260, +16384, +1500, +1280, +40, +256, +25773, +15012, +8150, +2048, +62690, +44101, +8167, +260, +517, +256, +20504, +6725, +124, +56577, +28674, +42309, +1621, +65063, +8962, +17664, +56418, +2609, +58698, +6159, +64774, +18178, +1222, +118, +1327, +35585, +457, +49563, +252, +35074, +28730, +1333, +37378, +256, +36930, +10468, +508, +16384, +656, +6178, +1280, +64000, +22064, +21316, +10468, +8218, +1715, +2048, +56951, +25294, +1280, +1391, +37946, +31381, +125, +67, +4288, +1422, +121, +21333, +32768, +35586, +1703, +3088, +35585, +20104, +261, +16384, +1453, +517, +35585, +12421, +31750, +256, +2808, +58, +261, +29758, +222, +28730, +51055, +56832, +56971, +17664, +38656, +256, +2388, +39444, +42206, +2539, +124, +778, +6699, +12229, +22750, +35586, +16384, +256, +1360, +503, +6178, +1500, +1709, +4130, +262, +10340, +42206, +1566, +538, +44368, +46661, +8192, +56971, +3397, +1280, +24451, +59188, +15012, +262, +21353, +53187, +16568, +1536, +290, +32826, +1664, +27005, +39943, +65221, +8360, +5888, +31380, +26411, +262, +40, +32448, +25088, +53120, +50385, +12544, +1222, +56971, +47182, +31750, +8249, +24539, +15012, +282, +64212, +6159, +56971, +56518, +30470, +60269, +14394, +17664, +16384, +8704, +3847, +6345, +43600, +35585, +16384, +2048, +652, +65201, +17664, +13754, +15012, +1760, +8798, +28730, +42206, +1615, +256, +6346, +3605, +14394, +124, +29440, +33399, +20816, +1129, +31246, +228, +35586, +1923, +1500, +30726, +1836, +652, +57199, +31238, +1098, +28060, +5712, +42565, +41276, +15910, +1453, +33433, +4130, +35585, +16384, +39680, +80, +25951, +16794, +58181, +31494, +6699, +20496, +16384, +29319, +55990, +3106, +53683, +42206, +16384, +256, +45417, +65194, +17664, +15872, +11034, +10720, +58, +1774, +26724, +656, +7504, +35585, +16384, +1663, +1165, +29818, +35699, +4164, +8760, +135, +256, +42206, +14342, +52, +3589, +14333, +30001, +45970, +2369, +1091, +30080, +35586, +10365, +123, +6688, +1082, +23632, +15012, +2199, +10565, +56520, +49299, +8417, +15012, +56355, +45662, +12032, +80, +14394, +11333, +16384, +13568, +28820, +56971, +30726, +61175, +20496, +139, +42, +264, +2278, +32006, +106, +33796, +42206, +19484, +42206, +6207, +1536, +28496, +17664, +63750, +4864, +16794, +35586, +16384, +27015, +4130, +14394, +1500, +256, +27102, +256, +56979, +56971, +5120, +274, +6204, +53760, +48389, +6177, +52736, +25626, +19388, +7464, +32006, +61175, +15632, +521, +1776, +353, +521, +17664, +9163, +353, +15012, +48140, +61175, +14394, +19200, +256, +48458, +56971, +3211, +56979, +14736, +40, +14342, +256, +1262, +27102, +4164, +16384, +5120, +12041, +31087, +20496, +19489, +125, +45, +538, +44, +15012, +35586, +44, +301, +15012, +35586, +1334, +15012, +249, +4864, +1688, +35586, +1574, +4864, +49950, +256, +56979, +43589, +1574, +1216, +35408, +15012, +1677, +11034, +30550, +56971, +16384, +256, +353, +20857, +42206, +521, +31750, +8960, +13568, +40528, +42206, +17664, +124, +256, +49, +4224, +35586, +45469, +16384, +256, +51723, +28544, +2497, +16384, +14848, +2304, +6869, +265, +97, +11264, +17664, +4171, +35585, +22645, +59648, +1801, +24084, +56971, +27200, +2547, +521, +56971, +7439, +15012, +17664, +1361, +5122, +12329, +2015, +1572, +31750, +6699, +15005, +32080, +2581, +1622, +35952, +4112, +42206, +55552, +2609, +35393, +35585, +58949, +1649, +4888, +2467, +42206, +38144, +1208, +17218, +56971, +2633, +123, +4352, +2048, +656, +47184, +56971, +62208, +6798, +17664, +5248, +25620, +30214, +25601, +51514, +35585, +40, +39680, +25626, +2384, +8760, +31165, +30726, +40308, +15113, +28730, +35586, +30726, +538, +42206, +42206, +2747, +119, +63750, +6918, +6177, +56971, +2773, +45972, +1031, +13058, +42206, +56475, +965, +26724, +2048, +14665, +35585, +249, +2962, +35453, +35408, +35585, +122, +1762, +11034, +49664, +42206, +31750, +2481, +58118, +42206, +30533, +16384, +7351, +41728, +7789, +16223, +4531, +58, +29702, +1280, +6178, +253, +20737, +64518, +16925, +16384, +3584, +8080, +2986, +56418, +2048, +768, +16829, +32080, +1280, +21374, +17664, +1361, +12317, +49240, +2048, +8207, +50142, +20496, +16384, +19975, +6307, +6177, +523, +256, +1897, +6465, +17664, +13732, +2072, +5325, +523, +37278, +5325, +21573, +111, +47836, +56491, +125, +58819, +57567, +13312, +1077, +42206, +3072, +57304, +15012, +17664, +6346, +45417, +42206, +37892, +5781, +41797, +249, +4864, +33070, +3077, +15012, +249, +27005, +56979, +56971, +63750, +1099, +57199, +268, +30726, +31311, +50304, +17664, +120, +63271, +33506, +3101, +1500, +256, +6178, +56979, +5120, +56979, +17664, +4864, +31087, +14394, +6469, +9116, +19390, +11348, +14342, +256, +10846, +8760, +11716, +3254, +1024, +40167, +268, +9797, +6346, +55691, +33605, +1571, +61175, +56122, +22853, +256, +61175, +6175, +268, +57, +256, +48715, +15012, +376, +51712, +43066, +18820, +10345, +36137, +105, +33792, +8760, +17664, +96, +44, +7174, +26167, +13882, +5120, +10089, +8005, +1571, +15143, +56971, +1790, +15012, +43357, +353, +27102, +15012, +36373, +11154, +256, +5961, +20496, +4164, +35586, +24901, +116, +24576, +1091, +6380, +10810, +40, +3335, +901, +42206, +524, +12470, +124, +4608, +256, +56979, +15012, +268, +16384, +80, +19390, +24820, +13398, +3585, +58298, +58, +124, +36318, +55045, +124, +37889, +56971, +124, +2048, +17664, +10249, +44428, +17664, +22570, +5684, +1304, +122, +13568, +8192, +29204, +6177, +525, +15622, +256, +12218, +42206, +16384, +266, +26481, +49210, +31813, +16384, +256, +28999, +7201, +42206, +3373, +3648, +10392, +8758, +13991, +15745, +40859, +44289, +269, +52293, +5120, +20496, +364, +8576, +1500, +53454, +1288, +16829, +19795, +4130, +3430, +16559, +36352, +8197, +20504, +3435, +1500, +45568, +3271, +59255, +56971, +17664, +252, +36578, +1024, +15012, +1617, +63271, +4666, +17664, +15360, +2048, +14658, +35586, +1567, +31744, +10752, +19436, +1242, +32006, +282, +65050, +33070, +20504, +50471, +32000, +14394, +3277, +1099, +15012, +3281, +19390, +42206, +3284, +48829, +35586, +9077, +10089, +35586, +19390, +4164, +3545, +152, +6178, +16384, +45863, +16384, +1262, +15012, +56332, +24836, +37552, +269, +56, +353, +14394, +31750, +56971, +249, +27102, +3051, +20496, +16384, +10089, +55365, +1262, +29312, +40, +19200, +19391, +35586, +353, +58, +256, +28114, +3581, +48955, +3585, +99, +24836, +48967, +15012, +17664, +10089, +58949, +256, +22439, +35586, +62476, +4130, +17664, +9533, +512, +3602, +63750, +1677, +63271, +34874, +24663, +6699, +49152, +17165, +17956, +2048, +8981, +22586, +3840, +1032, +56413, +35585, +52, +6699, +15012, +1500, +124, +52992, +64204, +15012, +35586, +16384, +64071, +47880, +27102, +20504, +270, +16384, +34560, +35408, +62522, +3726, +10258, +7622, +25626, +43077, +31719, +4164, +10401, +35585, +56460, +135, +536, +38912, +19258, +77, +65483, +42055, +512, +526, +56971, +7878, +84, +13568, +18256, +46405, +19477, +14394, +124, +12218, +10136, +16384, +56, +15012, +17664, +25406, +4666, +17664, +15012, +252, +36677, +36578, +31750, +256, +10094, +58, +15012, +17664, +16384, +35586, +44680, +64000, +45568, +30017, +51959, +8424, +125, +11008, +61100, +17664, +120, +902, +63439, +35586, +2048, +17520, +22016, +2562, +42206, +256, +11780, +1059, +40, +125, +512, +24120, +6173, +9649, +1500, +13317, +124, +1654, +38144, +2048, +1024, +17856, +6160, +249, +902, +42206, +63439, +56972, +41, +26724, +96, +46661, +115, +512, +6688, +35997, +20496, +17664, +8192, +20504, +256, +17664, +47647, +35841, +1695, +1024, +7424, +17619, +4224, +15012, +56972, +10319, +1124, +28218, +512, +179, +256, +1597, +65082, +53, +256, +62006, +33920, +42206, +1500, +80, +50402, +1024, +43870, +20504, +124, +4096, +1098, +46112, +11988, +58, +122, +14848, +4096, +6960, +23376, +42206, +137, +1147, +31311, +56972, +60132, +125, +6688, +38162, +56972, +17664, +10086, +56972, +54853, +6699, +56972, +16384, +52, +13440, +20504, +35841, +31750, +8704, +4350, +10317, +16384, +8425, +20504, +16384, +19391, +42206, +71, +56979, +42206, +63750, +8760, +17664, +48719, +56972, +16384, +6178, +5120, +56333, +529, +61859, +35842, +1028, +10346, +19391, +42206, +56333, +1099, +42206, +56333, +256, +56979, +17664, +30470, +9998, +7504, +52172, +14394, +58693, +5120, +1222, +15012, +17664, +120, +24836, +6145, +45370, +31750, +15012, +12357, +14342, +25651, +56972, +20942, +38895, +42352, +43967, +15012, +343, +25343, +11034, +49206, +35842, +357, +249, +16763, +56972, +17664, +4130, +56972, +62208, +49240, +65188, +1573, +13882, +366, +256, +9729, +42042, +37707, +56972, +30464, +4864, +6869, +1283, +6394, +56972, +23350, +1360, +42885, +9631, +6346, +36684, +16472, +55065, +14394, +10346, +2469, +5712, +61545, +1024, +261, +49280, +47669, +30464, +42206, +25580, +56972, +118, +256, +6688, +4111, +15012, +257, +31750, +256, +6409, +11722, +26170, +476, +1500, +301, +6970, +23109, +56545, +31750, +25603, +42206, +256, +20484, +62522, +10372, +1624, +256, +3840, +6346, +20916, +524, +49920, +25626, +4224, +546, +31238, +2816, +51770, +58, +35842, +52, +6021, +256, +51463, +39272, +4351, +16384, +39272, +35842, +252, +512, +15012, +2048, +50000, +48186, +17664, +8304, +514, +56133, +56600, +51777, +47685, +16384, +6688, +4351, +34814, +1024, +14908, +6212, +56972, +7704, +18859, +19392, +19781, +1638, +45417, +6178, +42206, +30982, +1024, +13576, +51823, +29697, +42435, +28730, +32006, +1024, +260, +3328, +14394, +60, +3840, +55270, +58, +57755, +41984, +32031, +514, +56320, +16599, +59912, +56457, +9472, +2941, +124, +256, +6699, +36124, +754, +56614, +56972, +1280, +6869, +17664, +125, +2048, +1500, +15012, +1774, +6400, +64595, +35842, +249, +8760, +56333, +256, +6178, +23552, +56972, +16384, +4864, +8760, +1500, +19392, +35842, +249, +1099, +35841, +52745, +768, +27102, +20496, +17664, +53504, +353, +56979, +2304, +26373, +56979, +56333, +10089, +60741, +12289, +249, +8760, +17664, +159, +10089, +8784, +15012, +14413, +14342, +6346, +32736, +40, +46642, +20483, +42294, +20496, +17664, +1725, +256, +9697, +17664, +58624, +53031, +10346, +25936, +1500, +1642, +42206, +1537, +94, +4130, +20235, +20496, +17664, +36032, +1341, +17218, +56972, +17664, +252, +453, +26981, +58, +886, +4585, +9217, +20496, +892, +56950, +38336, +4164, +35841, +6409, +2452, +10328, +42206, +124, +159, +1165, +14658, +20496, +15012, +28485, +56, +57243, +8888, +40253, +27984, +58, +56972, +1624, +35841, +16384, +56, +417, +1262, +40214, +49494, +959, +1688, +720, +9029, +125, +256, +41434, +27005, +15012, +1291, +28999, +57308, +35842, +1280, +11072, +41434, +1776, +29161, +15012, +16894, +29958, +265, +56972, +19264, +51723, +516, +7453, +106, +8668, +27136, +8926, +42206, +16384, +62134, +282, +6688, +15012, +16384, +10752, +57199, +260, +6869, +17664, +1024, +56972, +18944, +27005, +6667, +19393, +28730, +17664, +47898, +35842, +25925, +16384, +1099, +39991, +43088, +15012, +16384, +61780, +20504, +56348, +5888, +282, +42, +15012, +1500, +256, +16666, +15012, +1500, +2048, +28447, +35842, +34304, +49502, +35842, +1500, +13312, +56979, +1500, +42206, +56333, +4130, +16384, +19393, +516, +256, +14394, +123, +61175, +56144, +256, +14394, +27219, +1098, +327, +1262, +4130, +56333, +256, +56979, +1482, +8918, +63271, +35842, +1557, +56979, +1262, +26724, +261, +22081, +36007, +1024, +60240, +6706, +27229, +50401, +3072, +56979, +8760, +42206, +5120, +55079, +38981, +2905, +56972, +16384, +20720, +35841, +16384, +40960, +6688, +56979, +3942, +56972, +628, +31750, +5120, +30466, +42160, +1099, +17025, +517, +30214, +256, +60473, +39604, +42206, +17664, +4352, +7168, +37892, +42206, +38725, +1538, +256, +20504, +17664, +125, +2560, +35079, +3976, +14394, +30211, +31750, +3051, +1688, +29568, +56972, +125, +78, +57, +6179, +39692, +8829, +282, +6177, +45125, +10402, +31750, +113, +20504, +1462, +56339, +62208, +51463, +11524, +20504, +15012, +124, +2048, +35152, +1500, +13568, +37889, +1518, +8218, +63627, +3840, +20496, +21573, +64204, +11032, +39846, +56972, +63750, +16641, +13882, +29253, +1777, +1285, +33253, +14394, +49221, +1539, +6699, +59392, +6240, +12488, +119, +1777, +1866, +149, +4129, +518, +40, +30981, +256, +56161, +14394, +35841, +1738, +37039, +8364, +41530, +123, +256, +370, +15012, +226, +16384, +6346, +4224, +42206, +34028, +1500, +61, +29568, +1764, +256, +6760, +1718, +10323, +14854, +47908, +51536, +49210, +4432, +30671, +6208, +262, +12357, +56460, +15646, +20496, +35841, +3942, +35841, +10422, +31494, +24416, +28730, +19731, +18949, +56972, +50555, +57519, +592, +212, +7983, +4272, +14978, +32730, +16384, +1612, +1287, +14658, +49210, +1579, +512, +9998, +8188, +17664, +25098, +39805, +84, +2213, +5200, +35842, +1500, +1759, +50459, +61572, +17664, +9728, +479, +15012, +56, +1453, +48175, +28218, +35842, +282, +49485, +16077, +57402, +1893, +1500, +256, +15012, +11264, +42028, +17518, +56972, +10475, +1759, +43507, +28218, +16384, +5120, +10089, +48197, +8894, +25851, +6213, +8890, +49787, +35842, +249, +39719, +519, +63750, +1099, +42206, +16384, +19394, +42206, +249, +56979, +17664, +63750, +19394, +63258, +35842, +1570, +49913, +17664, +35986, +717, +20504, +56972, +256, +36352, +1202, +56979, +6211, +40363, +10346, +1792, +5120, +80, +30145, +20496, +7424, +10089, +20504, +56972, +4864, +9729, +17232, +17664, +35830, +256, +3923, +49924, +57925, +717, +8760, +35842, +1574, +28218, +16384, +49951, +56972, +17664, +16384, +49958, +35841, +16384, +9342, +6380, +13882, +17664, +1601, +1262, +56378, +31238, +53, +61175, +49964, +1991, +29745, +2048, +15130, +20496, +8760, +519, +37445, +35808, +113, +2220, +1024, +49744, +35842, +16384, +10752, +63258, +14394, +59024, +17152, +57359, +63258, +35841, +17664, +20496, +263, +14342, +61175, +22608, +15012, +4677, +256, +9312, +31246, +6398, +2071, +124, +256, +20307, +15012, +119, +256, +3923, +28730, +17664, +6699, +6760, +122, +44032, +15360, +43889, +20496, +17664, +4306, +15104, +13689, +40, +13751, +256, +6688, +2128, +4350, +17664, +768, +4576, +49664, +56972, +40, +1650, +57199, +4350, +17664, +21598, +16566, +47461, +5840, +16384, +14592, +6688, +21402, +7789, +15012, +56493, +32006, +6688, +31901, +2213, +13341, +13568, +63032, +42206, +43883, +30470, +1280, +2222, +7673, +256, +6346, +11856, +1500, +57632, +55610, +49300, +122, +256, +8326, +252, +20496, +8960, +34560, +21407, +16384, +57017, +264, +35841, +2048, +8760, +9984, +19876, +56972, +13340, +37632, +8349, +39680, +33439, +6760, +35841, +20496, +42206, +47872, +4363, +36578, +49920, +31105, +42206, +17664, +512, +67, +265, +7424, +6960, +21306, +2360, +10754, +1556, +20485, +4164, +35842, +2377, +29446, +1629, +23710, +15012, +2386, +13859, +1754, +282, +14481, +720, +56972, +62080, +256, +8064, +15012, +15941, +355, +94, +42206, +29747, +16384, +17664, +20762, +11009, +56700, +33872, +45312, +20748, +62281, +8760, +15012, +40156, +16384, +256, +1024, +38162, +33251, +8250, +17664, +116, +2048, +27374, +20504, +35841, +1801, +15012, +256, +51112, +56576, +124, +256, +26724, +57361, +15012, +48402, +256, +6699, +24882, +15012, +5888, +2120, +19541, +32581, +52480, +50731, +6212, +35841, +117, +96, +652, +15012, +56530, +536, +4130, +29253, +45, +780, +15362, +28690, +124, +33441, +41384, +60474, +52, +1691, +256, +1880, +35841, +16384, +40, +35842, +266, +2048, +59728, +522, +16270, +8192, +22709, +20504, +15012, +17664, +118, +31716, +20496, +40, +1948, +1280, +49785, +2642, +30214, +6688, +30329, +58, +56972, +28216, +266, +31494, +51, +27951, +2668, +15012, +256, +61509, +256, +1839, +59985, +20496, +522, +32006, +56712, +2693, +17664, +31750, +40529, +35841, +20444, +15360, +58077, +60, +120, +1608, +5922, +63656, +522, +2048, +63656, +2395, +39676, +16384, +1723, +370, +55610, +1670, +3130, +29954, +20496, +15012, +16384, +4096, +37497, +8610, +13381, +16450, +8760, +2781, +56381, +2048, +8196, +40, +5658, +58298, +4127, +35841, +354, +96, +20487, +33251, +4164, +267, +17664, +26229, +1839, +52727, +48720, +28218, +56972, +2856, +64382, +2048, +28177, +50214, +28218, +14976, +51253, +62976, +6773, +20504, +64069, +1564, +44058, +33251, +6177, +34885, +16384, +6699, +56972, +17664, +16384, +44973, +52480, +2048, +717, +19395, +56972, +17664, +1098, +25773, +17828, +30145, +3808, +267, +44034, +11264, +65188, +1500, +124, +256, +6869, +27561, +16384, +512, +20496, +2927, +1500, +31750, +538, +62522, +17664, +16384, +2048, +2220, +49661, +4176, +44101, +28160, +27102, +1570, +49975, +16384, +18715, +523, +1567, +4864, +8760, +8842, +10089, +30277, +52727, +15684, +55877, +16384, +8836, +30146, +56972, +249, +40615, +4164, +35842, +1500, +1787, +49685, +19395, +1500, +794, +63271, +523, +31750, +4864, +10911, +16384, +4864, +8760, +40538, +56333, +2048, +52295, +4350, +34373, +19395, +42020, +249, +13576, +24290, +56, +52, +15872, +4130, +56972, +16384, +54528, +62976, +20496, +16384, +53, +1262, +33872, +16384, +18334, +9216, +45584, +2048, +353, +50141, +42206, +2999, +1716, +24832, +37707, +28218, +267, +60317, +45942, +24576, +265, +717, +17518, +523, +40, +57468, +1839, +56979, +3019, +5120, +8760, +16384, +42206, +3021, +42206, +2048, +15702, +267, +10279, +256, +31488, +56979, +35842, +16384, +1024, +27102, +6212, +17664, +51968, +51716, +48732, +35842, +35933, +5120, +63271, +4130, +35841, +10346, +28928, +282, +4164, +3043, +31494, +6175, +41595, +35842, +256, +52727, +27984, +267, +7168, +57375, +15332, +15012, +43772, +54274, +15012, +1617, +94, +45370, +49209, +6346, +94, +10713, +31238, +5325, +63813, +42206, +1759, +26724, +42, +35842, +13867, +10089, +9483, +15012, +17664, +1628, +4576, +370, +15012, +51904, +1964, +46160, +17664, +31238, +1280, +27005, +11008, +6398, +29958, +2816, +8356, +3923, +56972, +56401, +37888, +263, +46829, +4384, +49152, +359, +25850, +4115, +17664, +124, +4692, +4288, +40, +4576, +63258, +56972, +16384, +53, +11125, +6211, +17664, +20992, +35842, +27465, +524, +5640, +11012, +42206, +20452, +282, +4351, +124, +361, +17518, +10302, +39168, +28730, +60354, +2128, +15012, +32006, +31368, +8196, +21641, +3330, +113, +4637, +17518, +26693, +2048, +11201, +6398, +17664, +56972, +525, +1567, +11016, +20658, +58, +3356, +39767, +113, +11800, +22837, +42206, +17664, +27313, +8448, +1024, +12041, +8434, +38956, +35841, +16384, +2048, +20496, +42206, +31045, +2481, +48464, +14661, +123, +6699, +26981, +794, +21459, +28218, +123, +9984, +63258, +15012, +29745, +54, +6773, +924, +256, +30146, +20451, +3564, +256, +14394, +21048, +24064, +2855, +35842, +16384, +61175, +6178, +17664, +16384, +1099, +14394, +16384, +2220, +27102, +17664, +768, +15429, +8780, +525, +1676, +6773, +56972, +56, +56979, +42206, +3428, +16384, +6699, +63271, +6960, +32826, +56972, +14342, +4864, +14394, +56334, +2220, +27102, +42206, +628, +16384, +4864, +20496, +30221, +56458, +256, +49887, +6960, +6212, +35842, +16384, +16640, +21568, +56972, +27330, +256, +52727, +3463, +125, +256, +50409, +269, +16384, +717, +4677, +31761, +8081, +256, +8760, +36968, +63750, +52727, +37296, +1500, +1099, +6736, +56972, +8079, +6699, +49925, +50430, +56972, +3486, +32006, +4864, +15646, +19968, +4164, +269, +123, +20224, +28928, +2290, +717, +6736, +60395, +32863, +256, +49943, +21501, +35841, +17664, +6699, +45370, +12828, +49300, +56335, +17664, +125, +2048, +44058, +63660, +42206, +26110, +302, +20496, +42206, +54872, +56577, +35841, +1500, +31494, +5120, +2092, +6465, +56972, +126, +6918, +20496, +42206, +28928, +6869, +5267, +32006, +282, +41762, +20496, +35841, +17664, +45056, +388, +34798, +3574, +2048, +58298, +58781, +9984, +222, +35842, +124, +1885, +26481, +526, +17664, +56419, +1757, +1035, +36252, +50161, +270, +124, +256, +6145, +42214, +56972, +1760, +5632, +5120, +28730, +3644, +19373, +33624, +8760, +17664, +125, +15012, +21929, +17520, +1500, +1536, +5122, +6721, +65188, +16384, +1024, +59188, +15012, +56972, +256, +4224, +30214, +25936, +31290, +270, +125, +512, +16849, +20496, +526, +16384, +4625, +58596, +14394, +35841, +1720, +3840, +5961, +4130, +17664, +30055, +256, +4352, +11600, +4129, +270, +3772, +256, +28673, +4130, +46661, +48128, +1540, +42206, +256, +3924, +42464, +14394, +2373, +69, +3076, +42878, +21714, +47736, +56972, +1500, +27951, +65043, +1178, +4130, +19525, +1500, +16384, +6699, +2384, +42206, +16384, +1792, +35842, +64001, +15012, +20496, +59133, +6798, +55435, +15012, +25502, +2048, +20496, +3874, +2048, +63439, +527, +1759, +56577, +15012, +17664, +32262, +7168, +14658, +1436, +60051, +57359, +35841, +64518, +24882, +42206, +32006, +57199, +4129, +3902, +16384, +147, +295, +28730, +1500, +16384, +40529, +36729, +17792, +36656, +5781, +8659, +17664, +8760, +4531, +28416, +8400, +36098, +1500, +28416, +508, +1629, +34731, +40036, +4130, +56973, +3840, +55424, +10468, +97, +45240, +22031, +65082, +9925, +48224, +256, +1453, +41384, +65082, +45824, +57632, +56973, +16384, +508, +581, +16384, +13514, +6177, +13551, +6688, +15889, +42051, +52, +42206, +56463, +11008, +16384, +32466, +256, +1723, +56524, +20496, +56973, +60, +27951, +14661, +256, +36671, +1477, +50872, +4130, +8261, +1583, +43589, +16384, +20737, +17664, +8192, +6211, +16384, +256, +902, +30550, +42206, +40, +14238, +252, +44949, +56973, +12510, +1590, +11264, +53085, +47872, +15012, +3611, +8192, +256, +4864, +44949, +512, +50483, +42206, +32827, +8746, +50501, +31557, +24359, +51781, +1280, +36097, +63750, +263, +10089, +56973, +63750, +61175, +14394, +256, +10089, +31813, +35880, +14394, +10468, +24836, +8760, +3640, +8760, +38139, +256, +10089, +27102, +58192, +12613, +256, +63439, +36097, +64518, +20480, +33616, +16384, +31238, +361, +13542, +51258, +11012, +64549, +24084, +8760, +864, +58611, +17664, +8713, +19397, +20496, +1571, +50681, +8285, +42206, +187, +1631, +27102, +36098, +26317, +64549, +30544, +44357, +4864, +26724, +35863, +24836, +6211, +49733, +1032, +6992, +51813, +1024, +902, +15012, +282, +256, +26829, +37984, +14394, +36098, +8594, +216, +1216, +512, +42206, +10259, +13136, +60040, +5049, +1024, +90, +4130, +256, +2560, +201, +49210, +258, +15366, +512, +7148, +3664, +15012, +123, +7424, +51712, +56973, +40, +178, +7940, +28730, +257, +35747, +31750, +6912, +265, +902, +42206, +56973, +40074, +1297, +1193, +56656, +69, +1024, +31528, +36097, +13056, +34842, +17664, +2048, +3979, +27003, +58, +30054, +17664, +26880, +6688, +37090, +4159, +1500, +27398, +36578, +32350, +371, +36864, +1902, +60951, +15012, +10408, +10467, +388, +16384, +6224, +312, +256, +513, +11264, +46978, +35840, +56573, +30470, +25344, +26668, +59450, +16384, +52626, +20504, +4421, +56539, +6699, +260, +257, +40000, +1707, +15012, +124, +280, +513, +256, +1101, +40976, +36097, +16384, +256, +6145, +11600, +36097, +252, +953, +4351, +52, +7789, +58464, +59036, +256, +8192, +28485, +3584, +3075, +8760, +16384, +15685, +42206, +10447, +56973, +249, +10089, +1500, +19398, +27973, +4864, +42206, +13893, +19398, +56389, +1099, +56973, +256, +56979, +17664, +36875, +17664, +19398, +53829, +44175, +64920, +1099, +17664, +25424, +282, +1676, +1360, +37707, +4130, +56466, +35847, +1360, +14394, +56, +6175, +33955, +533, +353, +10534, +50854, +56973, +258, +14336, +50877, +514, +8670, +50983, +5120, +27003, +15012, +252, +1099, +514, +55296, +56979, +21573, +256, +15362, +16384, +1024, +43066, +55085, +7237, +37632, +57199, +249, +40984, +21867, +16384, +1712, +2816, +50436, +29523, +39366, +32826, +258, +1500, +61797, +14394, +36097, +576, +26660, +45922, +1885, +32043, +4130, +685, +56378, +256, +1144, +13032, +47133, +17664, +124, +137, +20485, +44945, +514, +51329, +122, +42, +51754, +1500, +29958, +256, +453, +24882, +36097, +5028, +74, +56656, +56463, +388, +4129, +64769, +11898, +258, +28296, +1248, +1753, +8192, +67, +8760, +799, +29190, +11268, +13058, +17664, +55552, +5122, +259, +32512, +260, +59245, +15012, +42206, +17664, +11520, +41472, +15012, +576, +14351, +3463, +20496, +15012, +10565, +16384, +32006, +42497, +3942, +36097, +256, +11018, +51712, +4227, +515, +13321, +31238, +6699, +40065, +63568, +1612, +282, +20341, +65278, +1500, +15130, +36097, +52, +253, +42829, +16976, +56463, +1280, +56833, +56654, +42206, +92, +50176, +948, +121, +256, +41256, +18178, +12032, +7228, +15012, +49705, +120, +256, +22906, +8760, +259, +29411, +29472, +42206, +2048, +15873, +15012, +17664, +50992, +55827, +1093, +32579, +35277, +1065, +20496, +6699, +6465, +16384, +20496, +57669, +256, +27102, +3714, +8760, +36098, +2048, +28455, +516, +50176, +19519, +2663, +249, +44, +51037, +56973, +1569, +1964, +27102, +36098, +24836, +14394, +56334, +50957, +17664, +10089, +40, +5120, +27102, +5878, +56419, +35819, +256, +353, +24882, +15012, +10347, +56979, +15012, +52, +125, +1262, +35579, +62277, +2048, +256, +353, +51117, +10347, +2220, +611, +31312, +1085, +3741, +19399, +36098, +117, +44032, +10089, +65278, +56339, +44032, +794, +28420, +20496, +42206, +31494, +1280, +1262, +657, +35623, +28218, +40, +43264, +27102, +17664, +65215, +2048, +657, +36354, +42206, +17664, +37153, +50031, +20496, +34555, +30468, +1957, +1130, +17664, +58615, +7168, +11125, +15360, +20496, +22016, +2220, +17518, +42206, +4165, +16384, +7164, +11008, +56973, +36098, +33954, +124, +41552, +55610, +24832, +90, +30147, +13392, +56973, +44058, +50071, +42206, +31494, +63744, +46181, +4154, +45381, +16384, +6699, +50087, +36097, +1500, +5093, +13576, +4422, +23203, +1500, +768, +11016, +31488, +23211, +40, +178, +53, +717, +4979, +42206, +1233, +17664, +41863, +256, +1092, +17218, +36097, +40, +16384, +1091, +6177, +40, +29440, +44058, +24539, +56973, +628, +31750, +1866, +4649, +36098, +17664, +32006, +50135, +63258, +56973, +256, +41552, +1272, +16384, +20496, +31494, +30017, +17520, +1282, +17664, +2048, +453, +20496, +54597, +16384, +94, +50157, +20496, +15012, +36097, +17664, +20790, +1761, +21248, +17408, +55599, +28218, +23406, +178, +50974, +20496, +56973, +17664, +56432, +28928, +1065, +63258, +11405, +28928, +8061, +20496, +56973, +13109, +32848, +1338, +40, +21353, +717, +17520, +42206, +27057, +56, +256, +302, +58, +56973, +36098, +40764, +178, +31488, +18809, +13392, +20241, +16384, +8758, +36097, +23806, +11012, +50205, +64080, +261, +1590, +1092, +15012, +53248, +8704, +63258, +52727, +56973, +32006, +256, +1092, +39366, +4164, +42206, +49989, +64006, +1024, +8322, +59717, +14336, +56577, +42206, +25503, +17518, +17664, +21670, +16384, +6688, +52727, +17520, +36098, +33814, +122, +1092, +17408, +34544, +2048, +30699, +28218, +40, +1603, +90, +52727, +20504, +42206, +11016, +4979, +517, +1024, +2220, +22742, +20496, +20805, +114, +10829, +6177, +4096, +7174, +8888, +4130, +17664, +31494, +17920, +2094, +20496, +15012, +6699, +12803, +53840, +56973, +1469, +1597, +8710, +20496, +56973, +17664, +31494, +2048, +9220, +1500, +20504, +56973, +12928, +6400, +47616, +44058, +1492, +17664, +40, +7095, +23331, +22018, +36097, +116, +6400, +45056, +717, +29492, +17518, +1507, +17664, +16384, +178, +282, +11125, +717, +28730, +31045, +273, +539, +62301, +14395, +24834, +517, +2220, +42206, +6699, +390, +17680, +37707, +1540, +1185, +31238, +42206, +1542, +200, +60527, +34039, +80, +717, +6160, +15012, +123, +17408, +43430, +33616, +36098, +40, +44288, +256, +42206, +52, +257, +717, +27907, +32768, +42206, +24328, +17408, +4979, +56973, +1649, +2048, +2220, +11125, +56477, +42206, +17664, +41472, +30148, +13045, +123, +8608, +30214, +59748, +56334, +5120, +4979, +1500, +256, +2220, +37707, +8665, +32006, +28928, +56973, +16384, +2560, +36115, +15012, +43561, +249, +5120, +6178, +19775, +3766, +14394, +36097, +16384, +123, +32512, +2048, +15303, +518, +17408, +408, +53829, +27444, +14336, +47616, +23377, +42206, +22592, +60547, +36608, +24063, +8589, +26407, +5725, +56973, +262, +40, +7069, +91, +56979, +13392, +20504, +36098, +26963, +10347, +7067, +58710, +518, +56334, +51719, +14394, +60553, +8583, +49152, +22341, +33792, +10089, +17989, +39168, +56, +63258, +1664, +56461, +24576, +1536, +63258, +34283, +256, +1262, +6736, +56973, +56464, +178, +2048, +13312, +36098, +1708, +2048, +717, +17518, +37861, +40, +32006, +15360, +13576, +38162, +30800, +65280, +15573, +45568, +53, +6773, +20496, +17518, +56973, +13354, +46206, +42752, +262, +1500, +8760, +10476, +1569, +16167, +20496, +17664, +3795, +10089, +59450, +53829, +123, +47616, +51238, +48256, +4164, +39749, +56, +113, +19400, +33115, +518, +57925, +2048, +24836, +23379, +17664, +16384, +4864, +6699, +8705, +717, +3942, +1730, +15576, +45, +4979, +56973, +55621, +16384, +256, +2220, +36786, +42206, +1739, +9073, +47917, +28730, +1742, +512, +13964, +36097, +31238, +11125, +25773, +1218, +3072, +42206, +58, +64518, +14336, +15012, +32006, +188, +50485, +45370, +34048, +17520, +14336, +57633, +16384, +188, +6773, +48186, +1775, +16384, +5712, +20496, +44058, +6736, +30789, +1500, +117, +58880, +36097, +15012, +58620, +2220, +23894, +17520, +47685, +252, +5225, +263, +40, +16384, +53, +11201, +23866, +15012, +36098, +7336, +28928, +282, +11012, +20737, +32006, +23443, +3229, +4164, +1830, +16384, +1566, +1024, +508, +10476, +1593, +49664, +8474, +50543, +6736, +14394, +36098, +120, +1024, +36352, +46860, +41474, +20496, +15012, +1853, +30982, +6145, +265, +263, +56832, +216, +11461, +28730, +36097, +13576, +1261, +20504, +42206, +125, +256, +29492, +65278, +17664, +16384, +256, +4350, +10390, +122, +1092, +4979, +56973, +26437, +1563, +12032, +15362, +32784, +14336, +50583, +25249, +1297, +768, +3051, +149, +42206, +50245, +16384, +54016, +13576, +8418, +28730, +37744, +28928, +1092, +30778, +36098, +46149, +17434, +6269, +17664, +31494, +56, +4346, +37035, +29746, +11013, +10839, +50615, +1940, +51269, +16384, +32006, +52224, +48128, +8375, +238, +4118, +42206, +44101, +628, +1245, +9112, +36097, +125, +39090, +40584, +56973, +45893, +32006, +51200, +45568, +11016, +23513, +52727, +17518, +263, +16384, +23808, +53, +15012, +36098, +17664, +31494, +12495, +20496, +43077, +768, +50043, +42206, +41797, +10382, +23515, +29492, +42206, +21760, +3610, +52304, +13927, +36098, +628, +48128, +282, +36097, +16384, +20496, +263, +32006, +1839, +25820, +64183, +256, +46860, +52727, +65410, +63258, +2050, +124, +44, +50693, +58, +3823, +123, +29696, +6688, +20496, +42206, +123, +29696, +38970, +20504, +56973, +10476, +1675, +178, +1092, +841, +6736, +56973, +4165, +62014, +17408, +31105, +42206, +628, +1601, +11008, +5781, +56973, +41474, +45381, +249, +44058, +23579, +54608, +52293, +31494, +74, +17408, +14242, +15012, +52549, +5120, +41474, +520, +1569, +57127, +60997, +63750, +51447, +42206, +42752, +51453, +17518, +27470, +27392, +56979, +36098, +27471, +26880, +92, +18338, +17664, +2053, +56979, +1500, +282, +56979, +27102, +63750, +45778, +8680, +264, +1569, +10089, +36098, +12101, +4864, +1099, +13392, +36098, +5120, +56979, +56973, +16384, +494, +36419, +8760, +3833, +768, +63271, +20496, +42206, +2156, +30150, +32730, +17664, +19864, +29492, +36097, +31494, +17792, +2165, +16514, +16384, +45312, +5120, +4164, +36097, +59248, +44058, +57332, +51584, +15012, +32940, +125, +1650, +41472, +4979, +17520, +36097, +1639, +13576, +50459, +41552, +2189, +49152, +1790, +26481, +42206, +37701, +17434, +30150, +58, +15012, +44493, +17408, +50807, +13392, +2202, +56973, +1500, +119, +25936, +40723, +768, +45904, +40872, +14394, +1024, +8760, +530, +43967, +32768, +17664, +28218, +36098, +16384, +1571, +10089, +44437, +1500, +25825, +1024, +353, +2500, +16077, +17518, +2226, +31494, +8760, +17664, +122, +31238, +1581, +6957, +8025, +6212, +56973, +11159, +44034, +717, +20504, +56973, +50842, +16384, +2246, +47843, +56973, +17664, +7824, +9216, +42914, +28730, +31883, +6346, +55925, +56871, +1500, +35840, +45568, +92, +15696, +58938, +13079, +9998, +35657, +42206, +17664, +53, +64990, +520, +192, +768, +31488, +56973, +62746, +33605, +256, +6699, +23866, +31105, +1500, +23866, +42206, +7936, +4363, +58, +2316, +17664, +40, +1563, +28928, +15872, +29492, +41552, +8760, +36097, +122, +28928, +63258, +42206, +10090, +123, +63152, +28928, +35588, +6166, +36098, +17664, +13095, +31238, +256, +6699, +4979, +20496, +17664, +56371, +14854, +768, +30150, +4130, +265, +13100, +1566, +1024, +22264, +42206, +17664, +6923, +256, +47500, +42368, +42206, +2387, +125, +7168, +717, +52727, +20504, +36098, +44101, +56540, +25783, +6699, +31488, +32784, +13329, +7174, +768, +6699, +4070, +55680, +2423, +7786, +4864, +794, +3924, +52727, +8504, +36097, +65280, +49697, +6736, +65082, +56526, +45568, +717, +6736, +36098, +40, +2220, +22018, +28730, +56371, +7168, +26496, +17518, +125, +768, +6699, +6773, +4164, +521, +29747, +124, +51914, +20496, +15012, +22528, +1536, +11016, +18432, +32325, +1280, +97, +60595, +8760, +2529, +28928, +60617, +63258, +2539, +16384, +2110, +4164, +2544, +256, +63258, +31750, +5781, +265, +9073, +30626, +63818, +768, +20915, +56973, +40, +6699, +56973, +4165, +16384, +6699, +34722, +52727, +6212, +266, +17856, +31494, +51726, +1166, +17520, +53061, +256, +416, +4409, +4129, +17664, +55552, +4568, +41, +11013, +6736, +65221, +54069, +51287, +33872, +33861, +16384, +63258, +20496, +36098, +538, +56973, +2048, +13576, +30151, +58, +60781, +3520, +6699, +20496, +2048, +3098, +15524, +17664, +58088, +53, +717, +20496, +42206, +18225, +17965, +6875, +256, +53, +54751, +17520, +56371, +1747, +44058, +51143, +17518, +6213, +40, +120, +1636, +6699, +10356, +51159, +14394, +2672, +56492, +31494, +51167, +17518, +56973, +25707, +1024, +52727, +20504, +56973, +56371, +1706, +3328, +51189, +38268, +17664, +53, +1098, +41474, +24656, +42206, +266, +50757, +125, +113, +11013, +2724, +1349, +1712, +11016, +1954, +46307, +40, +28177, +266, +32006, +28928, +22018, +56973, +2048, +16671, +36097, +123, +20487, +18688, +15012, +64774, +2999, +29952, +17518, +36097, +32006, +6699, +51239, +52727, +2782, +116, +28928, +13576, +63258, +8760, +59489, +61816, +60119, +37189, +96, +1360, +16290, +522, +29747, +2048, +29305, +15012, +63, +6736, +2309, +291, +20496, +5120, +45716, +43554, +15012, +2832, +33533, +2048, +15012, +32006, +768, +53, +32105, +6773, +6736, +7538, +15012, +17664, +16384, +57088, +53, +6699, +33251, +28730, +2861, +256, +2048, +7450, +17520, +36097, +124, +8029, +58, +44288, +256, +302, +6736, +65280, +43776, +2048, +1032, +60288, +31232, +179, +2193, +63258, +53120, +56973, +21371, +32006, +28928, +2048, +56973, +15920, +4148, +1861, +16384, +53, +58113, +11376, +22853, +56344, +124, +36724, +265, +64918, +56973, +267, +628, +16384, +31750, +11016, +612, +56973, +36097, +1562, +2048, +768, +1165, +41552, +42206, +17856, +30726, +30152, +20496, +6212, +36098, +53, +44058, +6798, +56973, +17664, +16384, +59868, +22018, +20496, +2977, +3072, +22665, +56419, +31721, +256, +772, +15012, +2213, +56973, +1500, +2053, +19633, +34373, +256, +28730, +36098, +2241, +2048, +51347, +36098, +31494, +3328, +13991, +57814, +31238, +51716, +6212, +56360, +1024, +56973, +27015, +18919, +256, +9217, +4163, +64518, +639, +44289, +42053, +11268, +37204, +20504, +15012, +34629, +28416, +63927, +65278, +49664, +1590, +40295, +13882, +50757, +13574, +28416, +15012, +30010, +16890, +30470, +222, +62544, +56973, +36097, +8182, +2048, +80, +15646, +3161, +8197, +62329, +17680, +20510, +47162, +4130, +42206, +24431, +124, +42638, +60, +27648, +51748, +17664, +58382, +4420, +56973, +63813, +8760, +30400, +41, +65278, +58, +179, +2193, +60131, +42206, +222, +4130, +17664, +1622, +1039, +52644, +15012, +30470, +1098, +62027, +4129, +42206, +44284, +8960, +17954, +34896, +15012, +36097, +17664, +118, +256, +25773, +31312, +256, +55717, +16384, +1024, +16208, +3318, +256, +6241, +269, +1758, +43776, +508, +118, +5380, +57, +24025, +3365, +3507, +61034, +94, +45893, +1675, +4864, +9160, +15012, +525, +24882, +42206, +269, +1500, +51, +4130, +269, +10320, +1024, +40699, +15012, +19600, +1024, +408, +30123, +36098, +36098, +23844, +36433, +44544, +1361, +42206, +4357, +4864, +22552, +20496, +56973, +16384, +37888, +3924, +42206, +40171, +48896, +56890, +24594, +58, +59717, +256, +61409, +35680, +3509, +32006, +9183, +222, +56973, +10412, +45824, +15788, +3533, +30726, +56973, +16965, +119, +5632, +256, +4727, +26075, +28730, +36097, +58718, +42206, +15012, +628, +33548, +6224, +3574, +16384, +14592, +17664, +54786, +50176, +11034, +29090, +3607, +10460, +12356, +4386, +15012, +270, +1695, +1124, +56951, +36098, +17664, +1601, +4864, +16134, +62464, +15012, +16384, +19626, +1685, +6346, +11782, +52618, +15012, +29446, +34560, +612, +50124, +15012, +31750, +711, +26075, +8760, +56973, +50106, +50124, +56973, +17664, +31750, +39424, +1836, +49325, +20496, +3700, +13568, +8204, +37707, +46661, +40, +29440, +256, +8375, +17390, +36097, +116, +20504, +56973, +17664, +6798, +526, +256, +17623, +42206, +41, +256, +27102, +8513, +17520, +63750, +49446, +36098, +8509, +276, +50929, +38400, +36422, +36098, +30726, +2491, +20496, +3864, +42206, +17664, +5081, +3072, +2309, +56979, +64000, +54032, +44, +6178, +27504, +276, +20496, +3805, +6346, +20496, +15012, +249, +14171, +58871, +256, +32665, +62789, +19402, +526, +19402, +36098, +10089, +51841, +38970, +3832, +256, +5854, +64621, +263, +17664, +6408, +56, +23704, +63546, +1500, +16384, +14598, +10034, +902, +527, +1500, +30214, +15360, +64918, +4872, +3885, +28229, +4864, +31056, +33605, +3884, +5632, +56973, +9450, +6346, +4130, +3890, +256, +38480, +4336, +42206, +17664, +4864, +201, +20480, +59969, +56974, +14598, +4864, +32336, +42206, +28928, +717, +717, +32896, +7257, +31494, +768, +6699, +18978, +63258, +40762, +9417, +56422, +28928, +50459, +51431, +36354, +27904, +45178, +12848, +48565, +4420, +35141, +24424, +17584, +14394, +17664, +30726, +53, +16077, +6736, +42206, +45125, +13238, +1565, +256, +6346, +20496, +15012, +24133, +29747, +1562, +3328, +264, +11144, +17520, +36354, +10477, +1646, +361, +30153, +52727, +106, +10477, +1745, +41474, +20504, +512, +1500, +25602, +1536, +1059, +4164, +36354, +57344, +6699, +25900, +13882, +63813, +16384, +30153, +52727, +36354, +1668, +13312, +63258, +6736, +166, +4353, +1360, +52727, +17518, +17664, +1756, +56885, +41474, +20504, +42206, +48602, +1326, +36354, +1500, +113, +2718, +54278, +4127, +16384, +1024, +41552, +15012, +30464, +42206, +2048, +291, +4164, +1500, +32444, +113, +6699, +15012, +512, +16384, +2220, +37006, +256, +123, +81, +30153, +54606, +19626, +17672, +50699, +256, +46307, +65082, +4164, +8343, +7749, +26501, +31494, +28164, +52727, +6177, +16384, +4352, +6346, +15012, +17664, +63750, +576, +40309, +45882, +60938, +768, +20496, +56974, +29747, +1570, +717, +57199, +56974, +122, +42608, +53840, +15012, +513, +56432, +2048, +63258, +7808, +60940, +194, +717, +42206, +15641, +17664, +16384, +113, +14658, +2105, +63258, +36353, +16384, +6739, +53, +30153, +44962, +4112, +29958, +256, +24025, +8760, +349, +369, +6736, +56974, +42012, +256, +717, +23376, +42206, +124, +54784, +10761, +28730, +56333, +30464, +46581, +63045, +40, +6177, +794, +65525, +17664, +16384, +63488, +51655, +28218, +36026, +10478, +179, +6760, +63258, +56974, +40, +7307, +2048, +16896, +20496, +257, +31750, +1112, +20496, +15012, +47334, +4608, +31105, +15012, +24812, +65024, +11195, +15012, +1500, +59833, +12357, +56546, +8448, +53328, +48, +8280, +7436, +52282, +21057, +620, +42206, +16384, +35610, +19565, +40, +12045, +44949, +17520, +258, +30408, +12288, +4224, +258, +17664, +16384, +1760, +58707, +8760, +12352, +1589, +256, +23267, +45370, +57858, +29190, +11201, +17664, +125, +514, +21076, +1542, +1049, +37023, +17664, +1760, +264, +19626, +36194, +42206, +40, +58118, +7760, +62413, +6699, +48720, +120, +280, +59250, +15012, +83, +256, +18964, +42206, +16384, +58298, +15872, +44189, +56974, +17681, +256, +22455, +752, +24832, +6688, +11366, +15012, +31246, +26192, +259, +17520, +63045, +6688, +23376, +17520, +798, +30726, +6760, +259, +119, +8192, +26915, +64069, +8192, +6178, +824, +14998, +17664, +10448, +6400, +31940, +42206, +1076, +34628, +8685, +17664, +58800, +2048, +848, +62522, +16384, +47939, +20496, +36353, +28906, +8199, +17520, +36353, +57126, +6688, +2562, +15012, +41570, +34560, +47627, +56974, +118, +27951, +13904, +42206, +1500, +16384, +11520, +6408, +36354, +1420, +198, +282, +56974, +1536, +58216, +17520, +259, +16384, +2239, +265, +1013, +28912, +53587, +31750, +2074, +42206, +1280, +6688, +6469, +45370, +64151, +53760, +17664, +1280, +123, +50880, +36353, +16584, +14848, +60162, +30716, +516, +29446, +32512, +1280, +30748, +22782, +47685, +59550, +7694, +3716, +28496, +16384, +1280, +5204, +36353, +16384, +8196, +8080, +36354, +36353, +30982, +1049, +12032, +58216, +260, +516, +52, +1543, +1500, +42206, +1139, +30470, +512, +58448, +10442, +35249, +35588, +14160, +4130, +6204, +119, +256, +1880, +47627, +42206, +41730, +1702, +42206, +16384, +261, +25773, +30726, +35078, +8720, +18944, +11831, +1024, +57017, +4224, +56974, +125, +12032, +657, +8576, +56514, +40, +8574, +516, +56515, +1024, +54751, +50899, +1291, +7936, +261, +68, +32006, +1024, +27005, +48289, +31824, +9657, +1545, +63271, +25940, +20496, +56333, +52, +39150, +20496, +17664, +35704, +256, +21760, +56974, +16384, +43520, +22785, +6212, +35141, +9318, +44949, +28594, +249, +3072, +2415, +14394, +16384, +4864, +6178, +56335, +56, +27102, +62021, +56335, +256, +8760, +56335, +256, +8760, +1500, +32768, +40, +65280, +9955, +4125, +249, +1353, +9235, +64000, +6178, +36354, +14342, +256, +292, +36353, +1675, +8720, +1675, +27102, +6398, +261, +40, +5120, +52654, +20496, +18714, +6178, +40, +57118, +33616, +17856, +24836, +6178, +56335, +353, +27102, +17664, +16384, +10089, +4351, +16384, +26880, +282, +37707, +15012, +16384, +126, +256, +4130, +56389, +27102, +4111, +10089, +3072, +56979, +56974, +30470, +54751, +53657, +256, +9998, +56979, +36353, +16384, +280, +64806, +40809, +3072, +5892, +17664, +9998, +63741, +44, +20224, +9472, +57049, +61, +1477, +20504, +27662, +15012, +57359, +45745, +31813, +26223, +1801, +15012, +1552, +31750, +56974, +52260, +282, +80, +10441, +52889, +6177, +11845, +16384, +6699, +15012, +518, +1536, +3979, +13737, +14394, +648, +2048, +17420, +4224, +24867, +40, +37100, +22552, +56400, +1500, +125, +23040, +3106, +49198, +8760, +33707, +63750, +1319, +18334, +33084, +28730, +17664, +24832, +19843, +4164, +58, +10382, +2048, +11012, +14394, +1500, +5122, +27392, +42206, +36354, +3471, +61035, +47500, +20504, +61, +256, +6823, +15012, +125, +56974, +1804, +55109, +6688, +24897, +519, +1605, +15012, +10490, +1024, +6688, +43967, +15012, +17664, +6400, +256, +31488, +39168, +263, +123, +256, +2718, +46515, +58, +56974, +31750, +92, +34560, +1297, +1857, +125, +15360, +65188, +42223, +37084, +62186, +15012, +196, +2048, +2292, +25100, +16384, +15320, +56974, +56507, +1024, +228, +1920, +21592, +256, +57453, +56420, +58, +20496, +56974, +16384, +42206, +35200, +58, +31750, +3072, +47500, +56974, +3840, +49325, +15012, +1759, +256, +1629, +42080, +17520, +263, +32433, +256, +1314, +20496, +63750, +19403, +56974, +63750, +52155, +519, +27102, +3956, +1836, +6178, +3959, +19403, +58727, +5120, +56979, +53, +52246, +519, +18688, +10089, +263, +16384, +52274, +56389, +256, +56979, +4421, +256, +45461, +20496, +16384, +256, +30541, +6469, +16637, +23621, +4864, +653, +8280, +27569, +35662, +29218, +20496, +10454, +16384, +256, +56103, +44101, +1694, +17426, +19404, +36353, +27973, +1585, +1112, +36353, +16384, +256, +36135, +653, +24912, +25668, +32000, +51463, +2539, +520, +43815, +28730, +10289, +1262, +25089, +520, +1500, +50688, +64080, +42206, +36353, +63750, +5122, +12106, +12368, +62479, +4864, +8760, +520, +13312, +6688, +56161, +20193, +42206, +24836, +23808, +36353, +17664, +22029, +1032, +56656, +1706, +34842, +56974, +46143, +16384, +1739, +78, +36578, +54166, +17664, +16384, +4158, +10240, +36353, +16384, +30174, +1358, +2256, +31238, +10496, +58382, +65278, +57344, +3335, +57458, +56302, +124, +536, +20421, +42206, +52800, +51463, +720, +56974, +15199, +256, +44750, +15012, +31494, +3072, +6699, +36353, +11373, +31246, +8250, +13565, +16529, +6212, +24832, +31105, +16529, +17520, +18757, +56822, +6144, +34033, +42206, +1500, +3840, +8708, +8080, +56974, +18718, +18947, +1222, +120, +295, +26724, +40, +14592, +1024, +4130, +53829, +1288, +256, +34960, +42206, +10260, +10496, +37678, +51452, +2393, +11333, +1611, +256, +58888, +56400, +32006, +27005, +3924, +56161, +17664, +10510, +58077, +55866, +10324, +30726, +6400, +5122, +62544, +56974, +34420, +13056, +11069, +56951, +42206, +36677, +31494, +6869, +17520, +1880, +6211, +96, +2481, +4164, +521, +14478, +2816, +263, +56848, +4130, +521, +4625, +26981, +8250, +92, +23808, +42206, +17664, +36226, +6212, +9808, +42206, +4224, +25157, +96, +6044, +36353, +32006, +2309, +59905, +29264, +56974, +25711, +32006, +53, +22096, +5953, +32429, +256, +51716, +266, +36987, +19404, +10560, +29446, +96, +11017, +13904, +17664, +1629, +40529, +17520, +7680, +9697, +15012, +64518, +508, +4164, +15012, +17664, +1459, +1631, +13294, +36353, +8192, +4666, +10565, +24467, +1372, +43967, +266, +29976, +36354, +7098, +42206, +8714, +21061, +124, +5888, +45, +2722, +125, +45147, +20504, +25157, +117, +1024, +6688, +222, +15012, +57099, +8760, +266, +2048, +56974, +44544, +19223, +48709, +8363, +490, +37289, +1620, +1099, +52383, +17664, +256, +27102, +56974, +249, +1099, +14394, +24462, +27102, +1712, +56979, +1735, +256, +10089, +56335, +1541, +64549, +10347, +51300, +266, +10347, +256, +56979, +36353, +49252, +35636, +5120, +1410, +56974, +124, +19405, +56974, +1631, +18461, +15012, +24460, +10089, +4164, +45137, +56979, +10324, +56951, +4351, +30726, +34048, +20496, +17664, +263, +61175, +8668, +17664, +9984, +61175, +48388, +27607, +10496, +4130, +2816, +1222, +522, +58812, +45824, +12122, +1500, +256, +15012, +16384, +25344, +25773, +6807, +361, +2539, +10320, +52926, +6269, +56463, +34665, +20496, +53336, +42206, +16384, +4130, +676, +5120, +27102, +1571, +52600, +56974, +16384, +1024, +10089, +848, +36353, +56, +256, +51796, +52608, +14394, +56327, +119, +30550, +5840, +12189, +123, +9984, +6869, +32768, +16384, +13568, +47373, +6177, +245, +56055, +4130, +22117, +52, +125, +6144, +20970, +36354, +46917, +16384, +41472, +369, +16529, +30719, +7424, +56974, +15012, +22863, +8192, +60672, +8682, +56974, +13541, +2962, +28060, +267, +17664, +86, +21872, +16794, +523, +16384, +256, +25858, +32826, +3017, +16384, +28928, +9984, +539, +56951, +14394, +41541, +11843, +280, +31056, +120, +292, +17664, +22784, +6212, +1500, +31238, +36354, +40307, +17664, +1280, +32792, +1368, +56974, +31636, +37632, +22096, +36354, +122, +768, +56974, +2309, +42206, +125, +256, +263, +52627, +53306, +17664, +40, +1657, +9984, +3293, +26481, +48, +124, +256, +51, +42206, +17664, +14374, +124, +6580, +14394, +26830, +124, +256, +238, +36354, +16384, +6346, +54096, +65082, +6725, +9984, +5658, +12032, +65082, +39234, +51, +20504, +17664, +30612, +263, +8230, +9040, +36353, +51591, +7024, +23267, +4130, +3203, +29446, +2048, +515, +36354, +22659, +31246, +32784, +524, +3072, +58, +17664, +1759, +256, +2048, +35664, +17664, +1768, +48888, +55632, +3251, +1586, +1273, +52638, +36353, +56340, +11520, +23893, +42206, +16384, +260, +33536, +27102, +42206, +581, +9817, +524, +30976, +8192, +8760, +21317, +16384, +63886, +17664, +256, +8760, +256, +56979, +40, +256, +44090, +58, +16384, +1099, +21328, +268, +249, +56979, +63750, +4130, +16384, +52788, +17664, +16637, +31750, +10089, +33872, +16384, +27102, +3311, +13446, +22844, +3318, +40, +56885, +25424, +57038, +6699, +13136, +120, +39680, +282, +11639, +14394, +8776, +10089, +65278, +63750, +1099, +525, +16384, +256, +658, +8760, +525, +7493, +40, +30982, +63271, +20496, +6645, +25858, +20496, +31750, +5632, +7444, +61193, +6160, +525, +17664, +124, +256, +9776, +57017, +42206, +249, +1083, +20504, +1500, +1675, +35920, +56974, +16384, +2158, +45370, +17358, +256, +6144, +525, +4352, +42206, +16384, +60, +18968, +292, +15012, +119, +6346, +34265, +51463, +24602, +56974, +18176, +37756, +53719, +38059, +40, +16384, +256, +30550, +56974, +3489, +30726, +9754, +57359, +22096, +42565, +50432, +40202, +34860, +525, +40, +1702, +256, +8710, +4164, +525, +2933, +44208, +17664, +125, +2816, +22552, +6212, +50757, +15959, +2640, +28730, +40, +14080, +2558, +42206, +1500, +6346, +20504, +525, +53, +40302, +20504, +44, +295, +6380, +32784, +270, +16384, +256, +30550, +56974, +1024, +37090, +56974, +17664, +538, +6212, +3629, +41984, +6699, +24897, +1500, +3441, +13136, +62522, +16384, +256, +6699, +3325, +55808, +38426, +10780, +15012, +20837, +63750, +256, +42108, +56400, +32262, +24836, +42206, +44101, +8274, +1216, +36353, +40773, +4352, +4130, +56974, +4608, +3925, +42206, +4098, +281, +35397, +19156, +12041, +8760, +27656, +8760, +65093, +4864, +27768, +1674, +57315, +36353, +17664, +5120, +10089, +14405, +13657, +4130, +3701, +14342, +3335, +10089, +17664, +62208, +53011, +526, +35570, +19407, +42206, +27664, +5120, +42206, +15012, +17664, +52331, +16384, +4864, +59906, +32826, +40, +52871, +256, +15226, +28496, +36354, +3740, +5895, +23040, +10089, +17664, +256, +56447, +46026, +42709, +10089, +36354, +31750, +256, +20069, +34874, +56336, +10089, +56974, +4864, +27102, +17520, +3770, +5122, +30550, +42206, +55498, +42752, +263, +21974, +36354, +29446, +37707, +3828, +117, +6688, +6178, +120, +4224, +20430, +17664, +38162, +8250, +2048, +9890, +17664, +20496, +527, +11201, +27264, +48384, +8665, +17664, +29629, +16384, +1215, +20496, +50490, +9754, +51796, +3771, +9552, +32006, +216, +36400, +37968, +36609, +16384, +6400, +282, +6177, +17664, +125, +54016, +1500, +25726, +37888, +14829, +56951, +512, +5304, +13824, +67, +512, +1024, +6736, +29923, +10374, +45, +14394, +512, +31101, +52399, +303, +31949, +6398, +131, +9984, +7983, +11439, +20504, +55621, +40, +43258, +512, +17664, +5120, +37461, +20496, +1545, +1129, +37461, +37278, +4164, +49466, +32006, +6400, +62413, +20496, +17664, +28928, +36609, +29850, +6688, +15270, +6177, +288, +124, +13824, +539, +15909, +44155, +20496, +36610, +44, +13574, +48189, +7077, +5120, +56975, +22022, +64266, +15012, +16384, +46860, +37495, +20504, +257, +13437, +2816, +6699, +15162, +359, +16384, +37707, +11201, +36609, +36771, +20487, +16112, +36609, +15012, +513, +124, +512, +22065, +38882, +16384, +20737, +26693, +16384, +9697, +513, +1731, +972, +2048, +14394, +17664, +52, +56979, +64295, +256, +53148, +36610, +8760, +16384, +4864, +28730, +122, +256, +40082, +36609, +4864, +42206, +16384, +16825, +58, +16384, +5120, +37707, +17664, +2304, +703, +58, +50787, +12439, +6177, +58655, +44024, +36609, +8840, +36610, +36471, +10023, +15012, +29253, +41984, +10089, +513, +124, +256, +31105, +10053, +64518, +3926, +42206, +40, +52224, +1839, +3926, +58939, +2117, +120, +51456, +4363, +2163, +42206, +4864, +1262, +27428, +42206, +32006, +256, +56975, +249, +11047, +1861, +4864, +14394, +31750, +6346, +2474, +257, +31729, +63271, +56975, +56, +24836, +58192, +16384, +11201, +60474, +17884, +26724, +514, +21061, +16384, +1540, +6688, +42206, +42206, +2907, +12800, +6699, +16640, +20496, +37189, +13312, +51723, +20504, +38213, +13482, +13312, +18871, +64581, +31750, +256, +6178, +63750, +42720, +4350, +53351, +2048, +33723, +53324, +36609, +21000, +50681, +563, +44288, +2159, +3926, +15012, +36610, +16384, +18688, +21504, +40960, +63382, +60229, +1760, +27005, +5707, +61765, +73, +1477, +39482, +34751, +5840, +56975, +40, +31105, +8760, +640, +17664, +11520, +8192, +1216, +14394, +36609, +17664, +15386, +7444, +38509, +56975, +47429, +16384, +4096, +256, +1242, +29187, +56975, +31750, +31105, +29815, +53529, +11264, +1086, +56975, +55154, +6688, +8218, +56975, +9541, +280, +58, +30726, +57199, +17664, +120, +21361, +42206, +51013, +14829, +58, +932, +5632, +658, +61008, +56975, +322, +256, +32105, +51, +658, +4130, +56975, +1591, +6400, +42051, +56442, +15012, +38213, +18835, +18423, +15012, +3535, +29952, +260, +16640, +20496, +31750, +192, +6699, +63588, +59786, +64817, +64570, +10576, +19145, +31494, +8760, +40, +19239, +1567, +19408, +259, +4191, +24576, +27102, +64000, +56336, +1911, +10089, +1500, +256, +27102, +24269, +8164, +35623, +515, +8160, +53450, +36610, +32006, +256, +27102, +15012, +14394, +17664, +56979, +56975, +9567, +24836, +16208, +36609, +56497, +38285, +24836, +26724, +886, +84, +353, +20496, +17664, +256, +63271, +19408, +36609, +1536, +256, +5241, +56979, +56975, +56, +4576, +19409, +909, +124, +256, +6699, +25658, +17232, +8672, +28955, +14592, +19409, +9285, +16384, +33041, +2885, +1567, +20263, +36610, +1500, +30726, +49, +53553, +259, +16384, +215, +353, +56975, +40, +29702, +21504, +353, +27951, +53551, +259, +14342, +3072, +46976, +948, +1719, +19798, +4129, +17664, +16384, +63827, +5241, +44950, +56975, +15012, +45862, +58880, +7905, +51269, +28957, +53562, +17520, +8448, +369, +40529, +56975, +24836, +55577, +259, +66, +22530, +259, +24576, +40976, +64000, +10323, +1760, +58192, +260, +124, +256, +20739, +14336, +28730, +1045, +48390, +2560, +46104, +17520, +15012, +56975, +1075, +56416, +16384, +16077, +20496, +56975, +13592, +17199, +42206, +17519, +117, +1727, +57065, +41, +31105, +20538, +1101, +33291, +1682, +2996, +28730, +10270, +124, +4864, +20739, +42910, +1125, +64669, +17025, +65188, +31238, +13056, +51815, +40381, +36610, +17664, +1590, +16896, +15012, +7168, +1368, +56951, +39738, +31870, +13338, +41984, +65201, +20858, +56975, +1500, +13304, +55552, +25759, +59392, +51823, +40529, +42206, +36609, +9436, +16384, +1024, +40556, +56975, +10752, +34602, +6178, +1199, +32262, +4608, +6346, +56951, +56975, +49253, +1500, +58112, +4130, +56975, +1230, +4352, +13136, +55610, +17664, +116, +6912, +43005, +56975, +1247, +15360, +40309, +53562, +42206, +22031, +56133, +78, +61776, +16384, +30550, +53561, +36610, +16384, +3098, +31105, +15012, +6699, +4300, +17664, +256, +3926, +1320, +249, +17688, +25705, +12561, +16384, +5888, +20739, +27400, +4130, +10320, +11034, +14394, +1500, +124, +1536, +4164, +17664, +53523, +2048, +46174, +15012, +256, +12963, +17939, +14049, +51, +36610, +17664, +10340, +282, +24008, +12032, +42206, +24812, +1630, +20496, +1388, +1774, +11008, +24008, +14394, +125, +955, +17520, +517, +17664, +1500, +31750, +1024, +1024, +6465, +8807, +30464, +5658, +8710, +56610, +261, +16384, +353, +23555, +20504, +4386, +2159, +17232, +53306, +16581, +123, +12032, +1024, +58298, +17767, +124, +256, +2128, +261, +256, +31105, +15012, +1500, +3328, +26932, +56975, +1499, +21729, +2816, +1028, +53725, +36610, +50176, +10089, +517, +1536, +1099, +517, +4238, +11264, +56975, +4240, +28607, +34885, +96, +65196, +63750, +56979, +10348, +4864, +20496, +56975, +32718, +29188, +58, +34065, +11264, +55202, +65535, +256, +57199, +47429, +19518, +45856, +1541, +32003, +1567, +53667, +28730, +17664, +8760, +5178, +31494, +4864, +8760, +4864, +6178, +22085, +24594, +56336, +8760, +5120, +10089, +53689, +42206, +7870, +18818, +6687, +11015, +31368, +32768, +27772, +65147, +36610, +33792, +53769, +42206, +249, +4864, +56979, +36677, +17664, +31494, +256, +22871, +36609, +113, +1099, +3463, +1589, +10348, +28928, +5120, +34663, +58298, +42206, +15987, +22393, +262, +49742, +13576, +11125, +1614, +17664, +10449, +2048, +6699, +11017, +64918, +36609, +51525, +19905, +32256, +5632, +717, +20496, +26189, +51200, +56979, +1565, +256, +717, +58298, +28218, +52, +7546, +4864, +6699, +15012, +11333, +120, +57746, +11125, +57017, +64000, +1657, +31750, +30720, +37651, +42, +8692, +23365, +21733, +52736, +51777, +15012, +1666, +17664, +1759, +538, +12032, +20496, +15012, +31494, +768, +263, +1105, +56975, +20504, +56372, +32006, +7424, +18237, +17518, +1622, +97, +6178, +42206, +1500, +123, +2220, +16290, +63741, +42206, +124, +30154, +51783, +20496, +17664, +16497, +2048, +8194, +1059, +17664, +31494, +28999, +34709, +11589, +16384, +28928, +35920, +52279, +40, +6655, +22018, +15012, +1750, +125, +16056, +22352, +17664, +123, +52727, +15012, +518, +16384, +1024, +7450, +17518, +40, +97, +6736, +42206, +16384, +1032, +4164, +40, +369, +42206, +252, +51839, +17680, +65376, +256, +22018, +20496, +14394, +17664, +120, +34816, +13576, +41913, +4130, +56975, +30533, +13382, +13576, +5122, +51, +5896, +56420, +25471, +11264, +18564, +4130, +14394, +36610, +9536, +124, +256, +17298, +4130, +13384, +256, +768, +36253, +41474, +20496, +28928, +41067, +47952, +28730, +13268, +16384, +1577, +4096, +44962, +15012, +1500, +768, +8192, +47010, +14394, +20049, +63233, +52727, +46328, +263, +13396, +19456, +6699, +1422, +20496, +26181, +16384, +53, +58249, +6212, +36609, +16384, +9998, +63258, +17520, +38411, +18432, +53, +290, +56975, +56372, +44058, +63258, +20496, +60692, +3072, +44058, +24602, +42206, +56, +3072, +12696, +8760, +1932, +17664, +33251, +1936, +5186, +1782, +11016, +3808, +28218, +120, +954, +31105, +4676, +628, +123, +20224, +53, +11034, +4350, +13407, +28928, +47105, +8760, +31494, +2048, +8888, +45882, +43904, +15012, +36609, +13412, +56576, +51, +20496, +42206, +17664, +16384, +256, +21504, +47105, +6212, +42206, +48112, +125, +28928, +4576, +50554, +16384, +2048, +51991, +52727, +519, +64774, +27102, +252, +24882, +42206, +1500, +7476, +256, +56979, +1500, +28928, +20011, +28730, +36677, +4864, +42206, +123, +67, +9998, +8760, +17218, +1500, +1099, +36609, +56372, +5120, +848, +42206, +14342, +14394, +2019, +5120, +30155, +58, +31494, +2048, +61175, +15012, +17664, +14342, +44058, +15012, +16384, +256, +263, +2048, +39760, +64518, +16072, +56336, +54055, +36610, +4864, +63718, +36609, +16384, +14394, +256, +27102, +40684, +42206, +53886, +55713, +17664, +26270, +353, +28730, +39749, +58835, +45111, +6760, +32006, +6699, +63271, +57215, +2059, +1623, +2220, +30155, +19410, +46650, +1631, +22257, +56144, +2064, +1500, +31494, +22018, +23866, +2048, +45, +46522, +60288, +9141, +40, +256, +8760, +56336, +19410, +42206, +1571, +10089, +17664, +11520, +56979, +61253, +13576, +12190, +20496, +14394, +36609, +27811, +113, +27102, +63258, +63546, +32387, +20496, +28218, +17664, +31750, +5127, +63258, +6736, +36609, +2124, +17664, +56329, +2220, +31923, +52727, +264, +1599, +7168, +11264, +12272, +36609, +45824, +2560, +256, +27465, +20504, +36609, +16384, +28928, +2048, +2220, +1313, +249, +19411, +6736, +56975, +123, +23296, +1262, +42326, +51329, +17824, +50254, +44058, +44374, +4131, +40773, +1561, +28928, +4864, +42206, +17664, +124, +28928, +11125, +50518, +36326, +62, +63258, +63258, +48664, +16384, +51354, +15757, +8760, +39237, +29748, +32006, +256, +6699, +30155, +717, +8672, +55049, +32006, +266, +62720, +15012, +57396, +1500, +1536, +6400, +11373, +30155, +17518, +520, +1024, +37762, +63258, +62591, +2220, +32442, +45381, +3648, +521, +17664, +56340, +6688, +32171, +41552, +63557, +1699, +58880, +17520, +36610, +44177, +6699, +6736, +15012, +40, +31761, +34473, +6688, +4176, +15012, +123, +9472, +17518, +36609, +40, +6050, +47828, +16568, +538, +8098, +15012, +14569, +41533, +1024, +6736, +15012, +32006, +768, +53, +64806, +40, +30726, +59136, +36610, +123, +256, +64848, +19915, +26268, +1629, +30156, +52727, +265, +125, +34048, +256, +53, +3865, +33872, +32006, +11125, +56979, +4164, +42206, +55877, +61173, +256, +6346, +659, +4164, +42206, +13381, +245, +13058, +52727, +20496, +30158, +40, +32000, +256, +3601, +42206, +14394, +36610, +1500, +50673, +11016, +41474, +20504, +15012, +265, +16384, +263, +303, +42206, +30976, +6400, +6688, +717, +15012, +36609, +1500, +1775, +16077, +521, +249, +58151, +2467, +113, +19411, +249, +26724, +265, +4336, +45568, +19411, +4164, +56975, +1500, +19411, +14394, +63750, +32592, +44869, +1561, +30156, +6178, +36610, +19411, +17520, +46324, +64273, +10496, +1262, +52727, +14394, +27205, +40940, +31855, +265, +4347, +24836, +4164, +1500, +5120, +37144, +19411, +42206, +10752, +23335, +41530, +56, +256, +717, +4351, +64, +34798, +53, +52295, +8603, +50496, +6178, +32006, +64, +30712, +8250, +18963, +35397, +1723, +41474, +31856, +2514, +27838, +6912, +717, +19411, +42206, +628, +35393, +3463, +10348, +11016, +52048, +2528, +16384, +29440, +11317, +4164, +58785, +10496, +30156, +13689, +17664, +7936, +2220, +7288, +56975, +40, +53, +51364, +15012, +16384, +659, +44058, +36610, +256, +14394, +27102, +4373, +1083, +13541, +41552, +65082, +124, +28928, +10089, +6736, +2570, +659, +4164, +266, +56, +7424, +44058, +56979, +20496, +1500, +1662, +10510, +15685, +52727, +42206, +23808, +2220, +12117, +30156, +522, +32006, +6912, +41474, +6212, +56975, +}; From sabre at nondot.org Mon Jan 28 01:23:41 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 07:23:41 -0000 Subject: [llvm-commits] [test-suite] r46447 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url: packet.c packet.h url.c Message-ID: <200801280723.m0S7NfLq008102@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 01:23:41 2008 New Revision: 46447 URL: http://llvm.org/viewvc/llvm-project?rev=46447&view=rev Log: make this program not read random memory Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c?rev=46447&r1=46446&r2=46447&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.c Mon Jan 28 01:23:41 2008 @@ -22,25 +22,20 @@ /* Traces automatically drop the TCP checksum and urgent pointer, so header is 36 bytes */ #define HEADER_SIZE 36 -int packets_processed = 0; #ifdef CONSTANT_PACKET unsigned int packet_index = 0; #endif char * -get_next_packet () +get_next_packet (int packet_number) { + packet_number %= MAX_PACKETS; char *packet; unsigned int packet_length; - if (packets_processed == MAX_PACKETS) - { - fprintf (stderr, "All packets (%d) processed, recompile with larger MAX_PACKETS \n", MAX_PACKETS); - exit (1); - } - packet_length = (packet_lengths[packets_processed]); + packet_length = (packet_lengths[packet_number]); if (packet_length < 40) { /* Should never happen */ @@ -61,10 +56,9 @@ } /* Copy the header information */ - memcpy ((void *)packet, (void *)headers[packets_processed], HEADER_SIZE); + memcpy ((void *)packet, (void *)headers[packet_number], HEADER_SIZE); #endif - packets_processed ++; return packet; } @@ -72,7 +66,6 @@ unsigned int packet_size (unsigned int packet_number) { - if (packet_number == MAX_PACKETS) - return (packet_lengths[packets_processed]); - else return (packet_lengths[packet_number]); + packet_number %= MAX_PACKETS; + return (packet_lengths[packet_number]); } Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h?rev=46447&r1=46446&r2=46447&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/packet.h Mon Jan 28 01:23:41 2008 @@ -13,9 +13,9 @@ * and improve what you give them. * */ -#define MAX_PACKETS 1500 +#define MAX_PACKETS 100 -char *get_next_packet (); +char *get_next_packet (int); /* For testing...*/ unsigned int packet_size (unsigned int); Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c?rev=46447&r1=46446&r2=46447&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Mon Jan 28 01:23:41 2008 @@ -113,7 +113,7 @@ { long original_checksum, checksum; - packet = get_next_packet(); + packet = get_next_packet(i); /* We only have to check the checksum to make sure nothing is changed.. */ #ifdef LITTLE_ENDIAN From sabre at nondot.org Mon Jan 28 01:26:07 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 07:26:07 -0000 Subject: [llvm-commits] [test-suite] r46448 - in /test-suite/trunk/MultiSource/Benchmarks: Makefile Trimaran/Makefile Trimaran/README.txt Message-ID: <200801280726.m0S7Q8pE008180@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 01:26:07 2008 New Revision: 46448 URL: http://llvm.org/viewvc/llvm-project?rev=46448&view=rev Log: Build trimaran benchmarks by default Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Makefile?rev=46448&r1=46447&r2=46448&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/Makefile Mon Jan 28 01:26:07 2008 @@ -4,6 +4,6 @@ PARALLEL_DIRS := Fhourstones Fhourstones-3.1 \ McCat Olden OptimizerEval Ptrdist llubenchmark \ sim FreeBench MallocBench Prolangs-C Prolangs-C++ SciMark2-C\ - mediabench ASCI_Purple MiBench VersaBench tramp3d-v4 + mediabench ASCI_Purple MiBench Trimaran VersaBench tramp3d-v4 include $(LEVEL)/Makefile.programs Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile?rev=46448&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/Makefile Mon Jan 28 01:26:07 2008 @@ -0,0 +1,7 @@ +# MultiSource/Trimaran Makefile: Build all subdirectories automatically + +LEVEL = ../../.. +PARALLEL_DIRS = enc-3des enc-md5 enc-pc1 enc-rc4 netbench-crc netbench-url + + +include $(LEVEL)/Makefile.programs Added: test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt?rev=46448&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt (added) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/README.txt Mon Jan 28 01:26:07 2008 @@ -0,0 +1,3 @@ +this is obtained from here. One program was elided (ipchains) +because it was linux specific. +http://www.trimaran.org/benchmarks.shtml From baldrick at free.fr Mon Jan 28 03:02:21 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 10:02:21 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp In-Reply-To: <439B17DE-A533-4FEB-9FEB-A4CA9D9B87D4@apple.com> References: <200801260725.03963.baldrick@free.fr> <200801271003.57799.baldrick@free.fr> <439B17DE-A533-4FEB-9FEB-A4CA9D9B87D4@apple.com> Message-ID: <200801281002.21969.baldrick@free.fr> Hi Evan, > I did check in two test cases in a subsequent commit. Those used to > choke llvm-gcc. I'll look at this today. It's obvious not all zero > sized aggregates are not created equal. I guess you mean this: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080121/057572.html I can understand that in function calls you don't want to pass zero-sized structs by copy. What I don't understand is why this requires modifying the way gcc structs are converted to llvm structs. Surely when generating function parameters, you can just skip the zero-sized structs at that point. Best wishes, Duncan. From isanbard at gmail.com Mon Jan 28 03:15:04 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 28 Jan 2008 09:15:04 -0000 Subject: [llvm-commits] [llvm] r46449 - /llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Message-ID: <200801280915.m0S9F4wZ019344@zion.cs.uiuc.edu> Author: void Date: Mon Jan 28 03:15:03 2008 New Revision: 46449 URL: http://llvm.org/viewvc/llvm-project?rev=46449&view=rev Log: If the function has no machine instructions, then emit a "nop" so that the function label isn't associated with something it shouldn't be. Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=46449&r1=46448&r2=46449&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Mon Jan 28 03:15:03 2008 @@ -233,6 +233,16 @@ // Emit pre-function debug information. DW.BeginFunction(&MF); + if (Subtarget->isTargetDarwin()) { + // If the function is empty, then we need to emit *something*. Otherwise, + // the function's label might be associated with something that it wasn't + // meant to be associated with. We emit a noop in this situation. + MachineFunction::iterator I = MF.begin(); + + if (++I == MF.end() && MF.front().empty()) + O << "\tnop\n"; + } + // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) { From evan.cheng at apple.com Mon Jan 28 03:49:52 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 09:49:52 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r46450 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp Message-ID: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jan 28 03:49:51 2008 New Revision: 46450 URL: http://llvm.org/viewvc/llvm-project?rev=46450&view=rev Log: 1. Only skip over zero sized bit fields which just affects layout, not all zero-sized aggregates. 2. Do not pass zero sized struct and union parameters. Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h llvm-gcc-4.2/trunk/gcc/llvm-internal.h llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=46450&r1=46449&r2=46450&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Mon Jan 28 03:49:51 2008 @@ -120,6 +120,14 @@ } } +/// isZeroSizedStructOrUnion - Returns true if this is a struct or union +/// which is zero bits wide. +static bool isZeroSizedStructOrUnion(tree type) { + if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) + return false; + return int_size_in_bytes(type) == 0; +} + // LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR - Return true if this aggregate // value should be passed by value, i.e. passing its address with the byval // attribute bit set. The default is false. @@ -212,6 +220,8 @@ /// their fields. void HandleArgument(tree type, uint16_t *Attributes = NULL) { const Type *Ty = ConvertType(type); + // Figure out if this field is zero bits wide, e.g. {} or [0 x int]. Do + // not include variable sized fields here. std::vector Elts; if (isPassedByInvisibleReference(type)) { // variable size -> by-ref. C.HandleScalarArgument(PointerType::getUnqual(Ty), type); @@ -225,8 +235,8 @@ *Attributes |= ParamAttr::ByVal; } else if (LLVM_SHOULD_PASS_AGGREGATE_IN_INTEGER_REGS(type)) { PassInIntegerRegisters(type, Ty); - } else if (isAggregateOfSizeZero(type)) { - // Zero sized aggregate, just drop it! + } else if (isZeroSizedStructOrUnion(type)) { + // Zero sized struct or union, just drop it! ; } else if (TREE_CODE(type) == RECORD_TYPE) { for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=46450&r1=46449&r2=46450&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Mon Jan 28 03:49:51 2008 @@ -118,10 +118,6 @@ /// element added to match llvm struct type size and gcc struct type size. bool isPaddingElement(const Type *T, unsigned N); -/// isAggregateOfSizeZero - Returns true if this is an aggregate with size zero. -/// -bool isAggregateOfSizeZero(union tree_node*); - /// TypeConverter - Implement the converter from GCC types to LLVM types. /// class TypeConverter { Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46450&r1=46449&r2=46450&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Jan 28 03:49:51 2008 @@ -1612,14 +1612,6 @@ } -/// isAggregateOfSizeZero - Returns true if this is an aggregate with size zero. -/// -bool isAggregateOfSizeZero(tree type) { - if (!isAggregateTreeType(type)) return false; - return int_size_in_bytes(type) == 0; -} - - /// Mapping from type to type-used-as-base-class and back. static DenseMap BaseTypesMap; @@ -2054,9 +2046,6 @@ unsigned FieldOffsetInBits = getFieldOffsetInBits(Field); tree FieldType = getDeclaredType(Field); - if (isAggregateOfSizeZero(FieldType)) - continue; - // If this is a bitfield, we may want to adjust the FieldOffsetInBits to // produce safe code. In particular, bitfields will be loaded/stored as // their *declared* type, not the smallest integer type that contains @@ -2071,6 +2060,11 @@ // because the FieldOffsetInBits can be lower than it was in the // previous iteration. CurFieldNo = 0; + + // Skip 'int:0', which just affects layout. + unsigned FieldSizeInBits = TREE_INT_CST_LOW(DECL_SIZE(Field)); + if (FieldSizeInBits == 0) + continue; } // Figure out if this field is zero bits wide, e.g. {} or [0 x int]. Do From evan.cheng at apple.com Mon Jan 28 03:51:02 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 01:51:02 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r46381 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp In-Reply-To: <200801281002.21969.baldrick@free.fr> References: <200801260725.03963.baldrick@free.fr> <200801271003.57799.baldrick@free.fr> <439B17DE-A533-4FEB-9FEB-A4CA9D9B87D4@apple.com> <200801281002.21969.baldrick@free.fr> Message-ID: <9913B578-3657-4F58-837E-DE572EA7B564@apple.com> Hopefully this patch fixed it: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080128/057665.html Please verify. Thanks. Evan On Jan 28, 2008, at 1:02 AM, Duncan Sands wrote: > Hi Evan, > >> I did check in two test cases in a subsequent commit. Those used to >> choke llvm-gcc. I'll look at this today. It's obvious not all zero >> sized aggregates are not created equal. > > I guess you mean this: > http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080121/057572.html > > I can understand that in function calls you don't want to pass zero- > sized structs > by copy. What I don't understand is why this requires modifying the > way gcc structs > are converted to llvm structs. Surely when generating function > parameters, you can > just skip the zero-sized structs at that point. > > Best wishes, > > Duncan. From baldrick at free.fr Mon Jan 28 04:14:07 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 11:14:07 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r46450 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp In-Reply-To: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> References: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> Message-ID: <200801281114.08002.baldrick@free.fr> Hi Evan, thanks for doing this. > +static bool isZeroSizedStructOrUnion(tree type) { > + if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) You should let QUAL_UNION through here as well. And what about size-zero arrays? Or for that matter, zero size anything? > + // Skip 'int:0', which just affects layout. > + unsigned FieldSizeInBits = TREE_INT_CST_LOW(DECL_SIZE(Field)); > + if (FieldSizeInBits == 0) > + continue; This is probably safe (not completely clear), but why do you need to do it at all? Ciao, Duncan. From baldrick at free.fr Mon Jan 28 04:35:13 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 10:35:13 -0000 Subject: [llvm-commits] [llvm] r46451 - /llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c Message-ID: <200801281035.m0SAZEhI022037@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 28 04:35:11 2008 New Revision: 46451 URL: http://llvm.org/viewvc/llvm-project?rev=46451&view=rev Log: Make this more likely to be passed byval. Modified: llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c Modified: llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c?rev=46451&r1=46450&r2=46451&view=diff ============================================================================== --- llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c (original) +++ llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c Mon Jan 28 04:35:11 2008 @@ -1,6 +1,6 @@ // RUN: %llvmgcc %s -S -O1 -o - | llvm-as | opt -std-compile-opts | llvm-dis | not grep add -struct S { int A; int B; int C; int D; }; +struct S { int A; int B; char C[1000]; }; int f(struct S x) __attribute__ ((const)); From baldrick at free.fr Mon Jan 28 07:48:09 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 14:48:09 +0100 Subject: [llvm-commits] [llvm] r46432 - /llvm/trunk/Makefile.rules Message-ID: <200801281448.10531.baldrick@free.fr> > Author: lattner > Date: Sun Jan 27 22:18:41 2008 > New Revision: 46432 > > URL: http://llvm.org/viewvc/llvm-project?rev=46432&view=rev > Log: > reduce duplicate -I flags passed to the compiler, cleaning up the VERBOSE > output. Patch contributed by Sam Bishop! This breaks the build when the objects directory is different to the source directory. Ciao, Duncan. In file included from llvm/lib/Target/X86/X86AsmPrinter.h:19, from llvm/lib/Target/X86/X86ATTAsmPrinter.h:17, from llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:17: llvm/lib/Target/X86/X86.h:60:35: error: X86GenRegisterNames.inc: No such file or directory llvm/lib/Target/X86/X86.h:64:32: error: X86GenInstrNames.inc: No such file or directory From sam at bishop.dhs.org Mon Jan 28 10:14:04 2008 From: sam at bishop.dhs.org (Sam Bishop) Date: Mon, 28 Jan 2008 09:14:04 -0700 (MST) Subject: [llvm-commits] [llvm] r46432 - /llvm/trunk/Makefile.rules In-Reply-To: <200801281448.10531.baldrick@free.fr> References: <200801281448.10531.baldrick@free.fr> Message-ID: <46593.137.201.242.130.1201536844.squirrel@webmail.nwind.net> Hi, Duncan. On Mon, January 28, 2008 6:48 am, Duncan Sands wrote: > This breaks the build when the objects directory is different to the > source directory. I'm very sorry about this. The attached patch will fix it. Thanks, Sam Bishop -------------- next part -------------- A non-text attachment was scrubbed... Name: Makefile.rules.patch Type: application/octet-stream Size: 674 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080128/fb0ebd12/attachment.obj From dpatel at apple.com Mon Jan 28 10:59:49 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 28 Jan 2008 16:59:49 -0000 Subject: [llvm-commits] [llvm] r46452 - /llvm/tags/Apple/llvmCore-2012/ Message-ID: <200801281659.m0SGxnCk002389@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 28 10:59:48 2008 New Revision: 46452 URL: http://llvm.org/viewvc/llvm-project?rev=46452&view=rev Log: Tag llvmCore-2012 Added: llvm/tags/Apple/llvmCore-2012/ - copied from r46439, llvm/trunk/ From dpatel at apple.com Mon Jan 28 11:21:05 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 28 Jan 2008 09:21:05 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r46450 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp In-Reply-To: <200801281114.08002.baldrick@free.fr> References: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> <200801281114.08002.baldrick@free.fr> Message-ID: <7D01D734-B990-4123-B8EF-9E5EC54941A3@apple.com> Hi Duncan, On Jan 28, 2008, at 2:14 AM, Duncan Sands wrote: >> + // Skip 'int:0', which just affects layout. >> + unsigned FieldSizeInBits = >> TREE_INT_CST_LOW(DECL_SIZE(Field)); >> + if (FieldSizeInBits == 0) >> + continue; > > This is probably safe (not completely clear), but why do you need to > do it at all? getLLVMFieldFor() does not handle zero-sized bit-fields. - Devang -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080128/8a5c8099/attachment.html From baldrick at free.fr Mon Jan 28 11:38:30 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 17:38:30 -0000 Subject: [llvm-commits] [llvm] r46453 - /llvm/trunk/Makefile.rules Message-ID: <200801281738.m0SHcU9g003769@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 28 11:38:30 2008 New Revision: 46453 URL: http://llvm.org/viewvc/llvm-project?rev=46453&view=rev Log: Unbreak builds with differing object and source directories. Patch by Sam Bishop. Modified: llvm/trunk/Makefile.rules Modified: llvm/trunk/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=46453&r1=46452&r2=46453&view=diff ============================================================================== --- llvm/trunk/Makefile.rules (original) +++ llvm/trunk/Makefile.rules Mon Jan 28 11:38:30 2008 @@ -454,8 +454,8 @@ LD.Flags += -L$(LibDir) -L$(LLVMLibDir) CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS # All -I flags should go here, so that they don't confuse llvm-config. -CPP.Flags += $(patsubst %,-I%/include,$(sort \ - $(PROJ_OBJ_DIR) $(PROJ_SRC_DIR) \ +CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ + $(patsubst %,-I%/include,\ $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \ $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \ $(CPP.BaseFlags) From sabre at nondot.org Mon Jan 28 11:38:46 2008 From: sabre at nondot.org (Chris Lattner) Date: Mon, 28 Jan 2008 17:38:46 -0000 Subject: [llvm-commits] [llvm] r46454 - /llvm/trunk/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll Message-ID: <200801281738.m0SHckab003790@zion.cs.uiuc.edu> Author: lattner Date: Mon Jan 28 11:38:46 2008 New Revision: 46454 URL: http://llvm.org/viewvc/llvm-project?rev=46454&view=rev Log: this test is now compiled into the right thing. Modified: llvm/trunk/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll Modified: llvm/trunk/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll?rev=46454&r1=46453&r2=46454&view=diff ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll (original) +++ llvm/trunk/test/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll Mon Jan 28 11:38:46 2008 @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zext +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep {icmp ugt} ; PR1107 +; PR1940 define i1 @test(i8 %A, i8 %B) { %a = zext i8 %A to i32 From baldrick at free.fr Mon Jan 28 11:44:31 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 18:44:31 +0100 Subject: [llvm-commits] [llvm] r46432 - /llvm/trunk/Makefile.rules In-Reply-To: <46593.137.201.242.130.1201536844.squirrel@webmail.nwind.net> References: <200801281448.10531.baldrick@free.fr> <46593.137.201.242.130.1201536844.squirrel@webmail.nwind.net> Message-ID: <200801281844.39354.baldrick@free.fr> > > This breaks the build when the objects directory is different to the > > source directory. > > I'm very sorry about this. The attached patch will fix it. Indeed it does, so I've applied it. Thanks for the quick fix! Best wishes, Duncan. From lauro.venancio at gmail.com Mon Jan 28 12:23:23 2008 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 28 Jan 2008 18:23:23 -0000 Subject: [llvm-commits] [llvm] r46455 - /llvm/trunk/lib/Support/FileUtilities.cpp Message-ID: <200801281823.m0SINNJI005287@zion.cs.uiuc.edu> Author: laurov Date: Mon Jan 28 12:23:23 2008 New Revision: 46455 URL: http://llvm.org/viewvc/llvm-project?rev=46455&view=rev Log: Fix fpcmp infinite loop when comparing "29-266" with "29-268". Modified: llvm/trunk/lib/Support/FileUtilities.cpp Modified: llvm/trunk/lib/Support/FileUtilities.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileUtilities.cpp?rev=46455&r1=46454&r2=46455&view=diff ============================================================================== --- llvm/trunk/lib/Support/FileUtilities.cpp (original) +++ llvm/trunk/lib/Support/FileUtilities.cpp Mon Jan 28 12:23:23 2008 @@ -20,11 +20,15 @@ #include using namespace llvm; -static bool isNumberChar(char C) { +static bool isSignedChar(char C) { + if (C == '+' || C == '-') + return true; + else + return false; +} + +static bool isExpoentChar(char C) { switch (C) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case '.': case '+': case '-': case 'D': // Strange exponential notation. case 'd': // Strange exponential notation. case 'e': @@ -33,13 +37,25 @@ } } +static bool isNumberChar(char C) { + switch (C) { + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case '.': return true; + default: return isSignedChar(C) || isExpoentChar(C); + } +} + static char *BackupNumber(char *Pos, char *FirstChar) { // If we didn't stop in the middle of a number, don't backup. if (!isNumberChar(*Pos)) return Pos; // Otherwise, return to the start of the number. - while (Pos > FirstChar && isNumberChar(Pos[-1])) + while (Pos > FirstChar && isNumberChar(Pos[-1])) { --Pos; + if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExpoentChar(Pos[-1])) + break; + } return Pos; } From evan.cheng at apple.com Mon Jan 28 12:56:58 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 10:56:58 -0800 Subject: [llvm-commits] [llvm] r46455 - /llvm/trunk/lib/Support/FileUtilities.cpp In-Reply-To: <200801281823.m0SINNJI005287@zion.cs.uiuc.edu> References: <200801281823.m0SINNJI005287@zion.cs.uiuc.edu> Message-ID: On Jan 28, 2008, at 10:23 AM, Lauro Ramos Venancio wrote: > Author: laurov > Date: Mon Jan 28 12:23:23 2008 > New Revision: 46455 > > URL: http://llvm.org/viewvc/llvm-project?rev=46455&view=rev > Log: > Fix fpcmp infinite loop when comparing "29-266" with "29-268". > > > Modified: > llvm/trunk/lib/Support/FileUtilities.cpp > > Modified: llvm/trunk/lib/Support/FileUtilities.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileUtilities.cpp?rev=46455&r1=46454&r2=46455&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Support/FileUtilities.cpp (original) > +++ llvm/trunk/lib/Support/FileUtilities.cpp Mon Jan 28 12:23:23 2008 > @@ -20,11 +20,15 @@ > #include > using namespace llvm; > > -static bool isNumberChar(char C) { > +static bool isSignedChar(char C) { > + if (C == '+' || C == '-') > + return true; > + else > + return false; > +} How about just return (C == '+' || C == '-'); Thanks. Evan > > + > +static bool isExpoentChar(char C) { > switch (C) { > - case '0': case '1': case '2': case '3': case '4': > - case '5': case '6': case '7': case '8': case '9': > - case '.': case '+': case '-': > case 'D': // Strange exponential notation. > case 'd': // Strange exponential notation. > case 'e': > @@ -33,13 +37,25 @@ > } > } > > +static bool isNumberChar(char C) { > + switch (C) { > + case '0': case '1': case '2': case '3': case '4': > + case '5': case '6': case '7': case '8': case '9': > + case '.': return true; > + default: return isSignedChar(C) || isExpoentChar(C); > + } > +} > + > static char *BackupNumber(char *Pos, char *FirstChar) { > // If we didn't stop in the middle of a number, don't backup. > if (!isNumberChar(*Pos)) return Pos; > > // Otherwise, return to the start of the number. > - while (Pos > FirstChar && isNumberChar(Pos[-1])) > + while (Pos > FirstChar && isNumberChar(Pos[-1])) { > --Pos; > + if (Pos > FirstChar && isSignedChar(Pos[0]) && ! > isExpoentChar(Pos[-1])) > + break; > + } > return Pos; > } > > > > _______________________________________________ > 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 Mon Jan 28 13:00:46 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 11:00:46 -0800 Subject: [llvm-commits] [llvm] r46419 - /llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h In-Reply-To: <200801271951.m0RJp3Ku019529@zion.cs.uiuc.edu> References: <200801271951.m0RJp3Ku019529@zion.cs.uiuc.edu> Message-ID: <5B88E83E-331A-4CEA-AF6C-05E611FFDE0F@apple.com> On Jan 27, 2008, at 11:51 AM, Owen Anderson wrote: > Author: resistor > Date: Sun Jan 27 13:51:03 2008 > New Revision: 46419 > > URL: http://llvm.org/viewvc/llvm-project?rev=46419&view=rev > Log: > Fixes for BreakCriticalMachineCodeEdge by Fernando. > > Modified: > llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h > > Modified: llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h?rev=46419&r1=46418&r2=46419&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h > (original) > +++ llvm/trunk/include/llvm/CodeGen/BreakCriticalMachineEdge.h Sun > Jan 27 13:51:03 2008 > @@ -33,13 +33,14 @@ > > // insert the new block into the machine function. > src->getParent()->getBasicBlockList().insert(src->getParent()- > >end(), > - crit_mbb); > + crit_mbb); > > // insert a unconditional branch linking the new block to dst > const TargetMachine& TM = src->getParent()->getTarget(); > const TargetInstrInfo* TII = TM.getInstrInfo(); > std::vector emptyConditions; > - TII->InsertBranch(*crit_mbb, dst, (MachineBasicBlock*)0, > emptyConditions); > + TII->InsertBranch(*crit_mbb, dst, (MachineBasicBlock*)0, > + emptyConditions); > > // modify every branch in src that points to dst to point to the new > // machine basic block instead: > @@ -48,18 +49,18 @@ > while (mii != src->begin()) { > mii--; > // if there are no more branches, finish the loop > - if (!TII->isTerminatorInstr(mii->getOpcode())) { > + if (!mii->getDesc().isTerminator()) { > break; > } Perhaps it's safer to use TII->isUnpredicatedTerminator()? Evan > > - > + > // Scan the operands of this branch, replacing any uses of dst > with > // crit_mbb. > for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) { > MachineOperand & mo = mii->getOperand(i); > if (mo.isMachineBasicBlock() && > - mo.getMachineBasicBlock() == dst) { > + mo.getMBB() == dst) { > found_branch = true; > - mo.setMachineBasicBlock(crit_mbb); > + mo.setMBB(crit_mbb); > } > } > } > @@ -68,7 +69,8 @@ > // I am inserting too many gotos, but I am trusting that the asm > printer > // will optimize the unnecessary gotos. > if(!found_branch) { > - TII->InsertBranch(*src, crit_mbb, (MachineBasicBlock*)0, > emptyConditions); > + TII->InsertBranch(*src, crit_mbb, (MachineBasicBlock*)0, > + emptyConditions); > } > > /// Change all the phi functions in dst, so that the incoming > block be > @@ -77,29 +79,28 @@ > /// the first instructions are always phi functions. > if(mii->getOpcode() != TargetInstrInfo::PHI) > break; > - > + > // Find the operands corresponding to the source block > std::vector toRemove; > unsigned reg = 0; > for (unsigned u = 0; u != mii->getNumOperands(); ++u) > if (mii->getOperand(u).isMachineBasicBlock() && > - mii->getOperand(u).getMachineBasicBlock() == src) { > + mii->getOperand(u).getMBB() == src) { > reg = mii->getOperand(u-1).getReg(); > toRemove.push_back(u-1); > } > - > // Remove all uses of this MBB > for (std::vector::reverse_iterator I = > toRemove.rbegin(), > E = toRemove.rend(); I != E; ++I) { > mii->RemoveOperand(*I+1); > mii->RemoveOperand(*I); > } > - > + > // Add a single use corresponding to the new MBB > - mii->addRegOperand(reg, false); > - mii->addMachineBasicBlockOperand(crit_mbb); > + mii->addOperand(MachineOperand::CreateReg(reg, false)); > + mii->addOperand(MachineOperand::CreateMBB(crit_mbb)); > } > - > + > return crit_mbb; > } > > > > _______________________________________________ > 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 Mon Jan 28 13:08:47 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 11:08:47 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r46450 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp In-Reply-To: <200801281114.08002.baldrick@free.fr> References: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> <200801281114.08002.baldrick@free.fr> Message-ID: On Jan 28, 2008, at 2:14 AM, Duncan Sands wrote: > Hi Evan, thanks for doing this. > >> +static bool isZeroSizedStructOrUnion(tree type) { >> + if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != >> UNION_TYPE) > > You should let QUAL_UNION through here as well. And what about size- > zero > arrays? Or for that matter, zero size anything? What exactly is QUAL_UNION? I am pretty sure other cases (especially zero sized arrays) are handled differently. > > >> + // Skip 'int:0', which just affects layout. >> + unsigned FieldSizeInBits = >> TREE_INT_CST_LOW(DECL_SIZE(Field)); >> + if (FieldSizeInBits == 0) >> + continue; > > This is probably safe (not completely clear), but why do you need to > do it at all? Because they are skipped earlier when we did the type translation. Evan > > > Ciao, > > Duncan. From lattner at apple.com Mon Jan 28 13:13:15 2008 From: lattner at apple.com (Tanya Lattner) Date: Mon, 28 Jan 2008 11:13:15 -0800 Subject: [llvm-commits] [llvm] r46451 - /llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c In-Reply-To: <200801281035.m0SAZEhI022037@zion.cs.uiuc.edu> References: <200801281035.m0SAZEhI022037@zion.cs.uiuc.edu> Message-ID: <04B7156C-2861-459B-8A41-2BF82C9DCA08@apple.com> This fails with 4.0 on darwin x86. -Tanya On Jan 28, 2008, at 2:35 AM, Duncan Sands wrote: > Author: baldrick > Date: Mon Jan 28 04:35:11 2008 > New Revision: 46451 > > URL: http://llvm.org/viewvc/llvm-project?rev=46451&view=rev > Log: > Make this more likely to be passed byval. > > Modified: > llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c > > Modified: llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/ > 2008-01-26-ReadOnlyByVal.c?rev=46451&r1=46450&r2=46451&view=diff > > ====================================================================== > ======== > --- llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c (original) > +++ llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c Mon Jan 28 > 04:35:11 2008 > @@ -1,6 +1,6 @@ > // RUN: %llvmgcc %s -S -O1 -o - | llvm-as | opt -std-compile-opts > | llvm-dis | not grep add > > -struct S { int A; int B; int C; int D; }; > +struct S { int A; int B; char C[1000]; }; > > int f(struct S x) __attribute__ ((const)); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From lattner at apple.com Mon Jan 28 13:14:41 2008 From: lattner at apple.com (Tanya Lattner) Date: Mon, 28 Jan 2008 11:14:41 -0800 Subject: [llvm-commits] [llvm] r46372 - /llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c In-Reply-To: <200801252236.m0PMaP3H025489@zion.cs.uiuc.edu> References: <200801252236.m0PMaP3H025489@zion.cs.uiuc.edu> Message-ID: This test is failing for me. llvm-gcc-4.0, x86 darwin8. -Tanya On Jan 25, 2008, at 2:36 PM, Chris Lattner wrote: > Author: lattner > Date: Fri Jan 25 16:36:24 2008 > New Revision: 46372 > > URL: http://llvm.org/viewvc/llvm-project?rev=46372&view=rev > Log: > add a testcase for a bug Duncan pointed out. > > Added: > llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c > > Added: llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/ > 2008-01-25-ByValReadNone.c?rev=46372&view=auto > > ====================================================================== > ======== > --- llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c (added) > +++ llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c Fri Jan 25 > 16:36:24 2008 > @@ -0,0 +1,10 @@ > +// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep readonly > +// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readnone > + > + > +// The struct being passed byval means that we need to mark the > +// function readonly instead of readnone. Readnone would allow > +// stores to the arg to be deleted in the caller. > +struct S { int A[1000]; }; > +int __attribute__ ((const)) f(struct S x) { return x.A[0]; } > + > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From lattner at apple.com Mon Jan 28 13:15:42 2008 From: lattner at apple.com (Tanya Lattner) Date: Mon, 28 Jan 2008 11:15:42 -0800 Subject: [llvm-commits] [llvm] r46382 - /llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c In-Reply-To: <200801260035.m0Q0ZimO029138@zion.cs.uiuc.edu> References: <200801260035.m0Q0ZimO029138@zion.cs.uiuc.edu> Message-ID: <165E3689-D1BD-4523-9084-92CE220B47EF@apple.com> This test is failing for me. llvm-gcc-4.0 on x86/darwin8. ../../src/gcc/llvm-types.cpp:1426: failed assertion `0 && "Could not find field!"' -Tanya On Jan 25, 2008, at 4:35 PM, Evan Cheng wrote: > Author: evancheng > Date: Fri Jan 25 18:35:43 2008 > New Revision: 46382 > > URL: http://llvm.org/viewvc/llvm-project?rev=46382&view=rev > Log: > New test case. > > Added: > llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c > > Added: llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/ > 2008-01-25-ZeroSizedAggregate.c?rev=46382&view=auto > > ====================================================================== > ======== > --- llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c (added) > +++ llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c Fri > Jan 25 18:35:43 2008 > @@ -0,0 +1,23 @@ > +// RUN: %llvmgcc %s -S -o - > + > +// Aggregates of size zero should be dropped from argument list. > +typedef long int Tlong; > +struct S2411 { > + __attribute__((aligned)) Tlong:0; > +}; > + > +extern struct S2411 a2411[5]; > +extern void checkx2411(struct S2411); > +void test2411(void) { > + checkx2411(a2411[0]); > +} > + > +// A field that is an aggregates of size zero should be dropped > during > +// type conversion. > +typedef unsigned long long int Tal2ullong __attribute__((aligned > (2))); > +struct S2525 { > + Tal2ullong: 0; > + struct { > + } e; > +}; > +struct S2525 s2525; > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Mon Jan 28 13:19:58 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 20:19:58 +0100 Subject: [llvm-commits] =?iso-8859-6?q?=5Bllvm-gcc-4=2E2=5D_r46450_-_in=09?= =?iso-8859-6?q?/llvm-gcc-4=2E2/trunk/gcc=3A_llvm-abi=2Eh_llvm-internal=2E?= =?iso-8859-6?q?h_llvm-types=2Ecpp?= In-Reply-To: <7D01D734-B990-4123-B8EF-9E5EC54941A3@apple.com> References: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> <200801281114.08002.baldrick@free.fr> <7D01D734-B990-4123-B8EF-9E5EC54941A3@apple.com> Message-ID: <200801282019.59986.baldrick@free.fr> Hi Devang, > >> + // Skip 'int:0', which just affects layout. > >> + unsigned FieldSizeInBits = > >> TREE_INT_CST_LOW(DECL_SIZE(Field)); > >> + if (FieldSizeInBits == 0) > >> + continue; > > > > This is probably safe (not completely clear), but why do you need to > > do it at all? > > getLLVMFieldFor() does not handle zero-sized bit-fields. so this is fixing a getLLVMFieldFor crash noticed while working on struct passing? I have a patch somewhere that causes zero-sized bit-fields to be indexed properly (I thought it had been applied at some point, but I guess it fell through a crack...). I will dig it out and apply it, since I think it is better if you can always rely on every gcc field having an LLVM field index (except for variable offset fields, for which that is impossible). Ciao, Duncan. From baldrick at free.fr Mon Jan 28 13:25:48 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 19:25:48 -0000 Subject: [llvm-commits] [llvm] r46456 - /llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c Message-ID: <200801281925.m0SJPmGg007436@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 28 13:25:47 2008 New Revision: 46456 URL: http://llvm.org/viewvc/llvm-project?rev=46456&view=rev Log: Pure/const functions with ByVal parameters cannot be marked readonly either. Modified: llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c Modified: llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c?rev=46456&r1=46455&r2=46456&view=diff ============================================================================== --- llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c (original) +++ llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c Mon Jan 28 13:25:47 2008 @@ -1,10 +1,15 @@ -// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep readonly +// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readonly // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | not grep readnone -// The struct being passed byval means that we need to mark the -// function readonly instead of readnone. Readnone would allow -// stores to the arg to be deleted in the caller. +// The struct being passed byval means that we cannot mark the +// function readnone. Readnone would allow stores to the arg to +// be deleted in the caller. We also don't allow readonly since +// the callee might write to the byval parameter. The inliner +// would have to assume the worse and introduce an explicit +// temporary when inlining such a function, which is costly for +// the common case in which the byval argument is not written. struct S { int A[1000]; }; int __attribute__ ((const)) f(struct S x) { return x.A[0]; } - +int g(struct S x) __attribute__ ((pure)); +int h(struct S x) { return g(x); } From clattner at apple.com Mon Jan 28 13:35:59 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 11:35:59 -0800 Subject: [llvm-commits] [llvm] r46382 - /llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c In-Reply-To: <165E3689-D1BD-4523-9084-92CE220B47EF@apple.com> References: <200801260035.m0Q0ZimO029138@zion.cs.uiuc.edu> <165E3689-D1BD-4523-9084-92CE220B47EF@apple.com> Message-ID: <5A4762C5-2DEE-41D2-A393-C7A498243ECA@apple.com> On Jan 28, 2008, at 11:15 AM, Tanya Lattner wrote: > This test is failing for me. llvm-gcc-4.0 on x86/darwin8. > > ../../src/gcc/llvm-types.cpp:1426: failed assertion `0 && "Could not > find field!"' How long should we continue to support 4.0? I thought 2.2 was the last release for it? -Chris From clattner at apple.com Mon Jan 28 13:37:18 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 11:37:18 -0800 Subject: [llvm-commits] [llvm] r46455 - /llvm/trunk/lib/Support/FileUtilities.cpp In-Reply-To: References: <200801281823.m0SINNJI005287@zion.cs.uiuc.edu> Message-ID: <1B69F89A-4C34-493F-836E-1EA94A528744@apple.com> On Jan 28, 2008, at 10:56 AM, Evan Cheng wrote: >> URL: http://llvm.org/viewvc/llvm-project?rev=46455&view=rev >> Log: >> Fix fpcmp infinite loop when comparing "29-266" with "29-268". >> +static bool isExpoentChar(char C) { Also, typo: Expoent -> Exponent. Thanks Lauro, -Chris From evan.cheng at apple.com Mon Jan 28 13:48:05 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 11:48:05 -0800 Subject: [llvm-commits] [llvm] r46382 - /llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c In-Reply-To: <165E3689-D1BD-4523-9084-92CE220B47EF@apple.com> References: <200801260035.m0Q0ZimO029138@zion.cs.uiuc.edu> <165E3689-D1BD-4523-9084-92CE220B47EF@apple.com> Message-ID: I'll merge in all the ABI related changes from 4.2. Evan On Jan 28, 2008, at 11:15 AM, Tanya Lattner wrote: > This test is failing for me. llvm-gcc-4.0 on x86/darwin8. > > ../../src/gcc/llvm-types.cpp:1426: failed assertion `0 && "Could not > find field!"' > > -Tanya > > On Jan 25, 2008, at 4:35 PM, Evan Cheng wrote: > >> Author: evancheng >> Date: Fri Jan 25 18:35:43 2008 >> New Revision: 46382 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=46382&view=rev >> Log: >> New test case. >> >> Added: >> llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c >> >> Added: llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c >> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/ >> 2008-01-25-ZeroSizedAggregate.c?rev=46382&view=auto >> >> = >> ===================================================================== >> ======== >> --- llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c (added) >> +++ llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c Fri >> Jan 25 18:35:43 2008 >> @@ -0,0 +1,23 @@ >> +// RUN: %llvmgcc %s -S -o - >> + >> +// Aggregates of size zero should be dropped from argument list. >> +typedef long int Tlong; >> +struct S2411 { >> + __attribute__((aligned)) Tlong:0; >> +}; >> + >> +extern struct S2411 a2411[5]; >> +extern void checkx2411(struct S2411); >> +void test2411(void) { >> + checkx2411(a2411[0]); >> +} >> + >> +// A field that is an aggregates of size zero should be dropped >> during >> +// type conversion. >> +typedef unsigned long long int Tal2ullong __attribute__((aligned >> (2))); >> +struct S2525 { >> + Tal2ullong: 0; >> + struct { >> + } e; >> +}; >> +struct S2525 s2525; >> >> >> _______________________________________________ >> llvm-commits mailing list >> llvm-commits at cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From baldrick at free.fr Mon Jan 28 13:54:57 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 20:54:57 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r46450 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp In-Reply-To: References: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> <200801281114.08002.baldrick@free.fr> Message-ID: <200801282055.07334.baldrick@free.fr> Hi Evan, > > This is probably safe (not completely clear), but why do you need to > > do it at all? > > Because they are skipped earlier when we did the type translation. I see - this was orthogonal to the rest of your patch. I have a different fix for this issue which I like better, but that's my problem :) Ciao, Duncan. From baldrick at free.fr Mon Jan 28 13:57:01 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 19:57:01 -0000 Subject: [llvm-commits] [llvm-gcc-4.0] r46457 - /llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Message-ID: <200801281957.m0SJv1Gn008415@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 28 13:57:01 2008 New Revision: 46457 URL: http://llvm.org/viewvc/llvm-project?rev=46457&view=rev Log: Backport the patch turning off readnone/readonly when there is a byval parameter from 4.2. Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=46457&r1=46456&r2=46457&view=diff ============================================================================== --- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Mon Jan 28 13:57:01 2008 @@ -1043,17 +1043,16 @@ // Check for 'readnone' function attribute. if (flags & ECF_CONST) - // Since they write the return value through a pointer, - // 'sret' functions cannot be 'readnone'. - if (!ABIConverter.isStructReturn()) - RAttributes |= ParamAttr::ReadNone; + RAttributes |= ParamAttr::ReadNone; // Check for 'readonly' function attribute. - if (flags & ECF_PURE) - // Since they write the return value through a pointer, - // 'sret' functions cannot be 'readonly'. - if (!ABIConverter.isStructReturn()) - RAttributes |= ParamAttr::ReadOnly; + if (flags & ECF_PURE && !(flags & ECF_CONST)) + RAttributes |= ParamAttr::ReadOnly; + + // Since they write the return value through a pointer, + // 'sret' functions cannot be 'readnone' or 'readonly'. + if (ABIConverter.isStructReturn()) + RAttributes &= ~(ParamAttr::ReadNone|ParamAttr::ReadOnly); // Compute whether the result needs to be zext or sext'd. RAttributes |= HandleArgumentExtension(TREE_TYPE(type)); @@ -1082,6 +1081,9 @@ LLVM_TARGET_INIT_REGPARM(local_regparam, type); #endif // LLVM_TARGET_ENABLE_REGPARM + // Keep track of whether we see a byval argument. + bool HasByVal = false; + // Check if we have a corresponding decl to inspect. tree DeclArgs = (decl) ? DECL_ARGUMENTS(decl) : NULL; // Loop over all of the arguments, adding them as we go. @@ -1128,13 +1130,27 @@ local_regparam); #endif // LLVM_TARGET_ENABLE_REGPARM - if (Attributes != ParamAttr::None) + if (Attributes != ParamAttr::None) { + HasByVal |= Attributes & ParamAttr::ByVal; Attrs.push_back(ParamAttrsWithIndex::get(ArgTypes.size(), Attributes)); + } if (DeclArgs) DeclArgs = TREE_CHAIN(DeclArgs); } + // If there is a byval argument then it is not safe to mark the function + // 'readnone' or 'readonly': gcc permits a 'const' or 'pure' function to + // write to struct arguments passed by value, but in LLVM this becomes a + // write through the byval pointer argument, which LLVM does not allow for + // readonly/readnone functions. + if (HasByVal && Attrs[0].index == 0) { + uint16_t &RAttrs = Attrs[0].attrs; + RAttrs &= ~(ParamAttr::ReadNone | ParamAttr::ReadOnly); + if (RAttrs == ParamAttr::None) + Attrs.erase(Attrs.begin()); + } + // If the argument list ends with a void type node, it isn't vararg. isVarArg = (Args == 0); assert(RetTy && "Return type not specified!"); From baldrick at free.fr Mon Jan 28 13:57:15 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 20:57:15 +0100 Subject: [llvm-commits] [llvm] r46372 - /llvm/trunk/test/CFrontend/2008-01-25-ByValReadNone.c In-Reply-To: References: <200801252236.m0PMaP3H025489@zion.cs.uiuc.edu> Message-ID: <200801282057.18631.baldrick@free.fr> Hi Tanya, > This test is failing for me. llvm-gcc-4.0, x86 darwin8. it should be better now. It needed tweaking for a policy change on byval+const/pure. Also, a patch had not been backported from 4.2 to 4.0. Ciao, Duncan. From baldrick at free.fr Mon Jan 28 14:02:18 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 21:02:18 +0100 Subject: [llvm-commits] [llvm-gcc-4.2] r46450 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h llvm-types.cpp In-Reply-To: References: <200801280949.m0S9nqLD020320@zion.cs.uiuc.edu> <200801281114.08002.baldrick@free.fr> Message-ID: <200801282102.19983.baldrick@free.fr> Hi Evan, > > You should let QUAL_UNION through here as well. And what about size- > > zero > > arrays? Or for that matter, zero size anything? > > What exactly is QUAL_UNION? I am pretty sure other cases (especially > zero sized arrays) are handled differently. QUAL_UNION is a union with an associated variable saying which of the union fields you can use (so this is only known at runtime in general). It is not used by the C-like languages. It is used by Ada to implement variant records, which I think Ada inherited from Pascal. You can mostly treat a QUAL_UNION the same as a union. Ciao, Duncan. From lauro.venancio at gmail.com Mon Jan 28 14:02:51 2008 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Mon, 28 Jan 2008 20:02:51 -0000 Subject: [llvm-commits] [llvm] r46458 - /llvm/trunk/lib/Support/FileUtilities.cpp Message-ID: <200801282002.m0SK2q5B008581@zion.cs.uiuc.edu> Author: laurov Date: Mon Jan 28 14:02:51 2008 New Revision: 46458 URL: http://llvm.org/viewvc/llvm-project?rev=46458&view=rev Log: Simplify the code and fix a typo. Modified: llvm/trunk/lib/Support/FileUtilities.cpp Modified: llvm/trunk/lib/Support/FileUtilities.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/FileUtilities.cpp?rev=46458&r1=46457&r2=46458&view=diff ============================================================================== --- llvm/trunk/lib/Support/FileUtilities.cpp (original) +++ llvm/trunk/lib/Support/FileUtilities.cpp Mon Jan 28 14:02:51 2008 @@ -21,13 +21,10 @@ using namespace llvm; static bool isSignedChar(char C) { - if (C == '+' || C == '-') - return true; - else - return false; + return (C == '+' || C == '-'); } -static bool isExpoentChar(char C) { +static bool isExponentChar(char C) { switch (C) { case 'D': // Strange exponential notation. case 'd': // Strange exponential notation. @@ -42,7 +39,7 @@ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '.': return true; - default: return isSignedChar(C) || isExpoentChar(C); + default: return isSignedChar(C) || isExponentChar(C); } } @@ -53,7 +50,7 @@ // Otherwise, return to the start of the number. while (Pos > FirstChar && isNumberChar(Pos[-1])) { --Pos; - if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExpoentChar(Pos[-1])) + if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExponentChar(Pos[-1])) break; } return Pos; From evan.cheng at apple.com Mon Jan 28 14:55:32 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 20:55:32 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r46459 - /llvm-gcc-4.2/trunk/gcc/llvm-abi.h Message-ID: <200801282055.m0SKtW7s010214@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jan 28 14:55:32 2008 New Revision: 46459 URL: http://llvm.org/viewvc/llvm-project?rev=46459&view=rev Log: QUAL_UNION_TYPE is just like UNION_TYPE. Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=46459&r1=46458&r2=46459&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Mon Jan 28 14:55:32 2008 @@ -123,7 +123,9 @@ /// isZeroSizedStructOrUnion - Returns true if this is a struct or union /// which is zero bits wide. static bool isZeroSizedStructOrUnion(tree type) { - if (TREE_CODE(type) != RECORD_TYPE && TREE_CODE(type) != UNION_TYPE) + if (TREE_CODE(type) != RECORD_TYPE && + TREE_CODE(type) != UNION_TYPE && + TREE_CODE(type) != QUAL_UNION_TYPE) return false; return int_size_in_bytes(type) == 0; } From baldrick at free.fr Mon Jan 28 14:57:25 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 20:57:25 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r46460 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h Message-ID: <200801282057.m0SKvPkE010311@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 28 14:57:24 2008 New Revision: 46460 URL: http://llvm.org/viewvc/llvm-project?rev=46460&view=rev Log: Fix PR1942 differently, by having the caller take care of making a copy of the aggregate return value rather than the callee (the previous fix). This is better adapted for optimization (though the optimizations needed don't exist yet...) and is also the way gcc does it, so is needed for interoperability with gcc compiled code. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp llvm-gcc-4.2/trunk/gcc/llvm-internal.h Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46460&r1=46459&r2=46460&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jan 28 14:57:24 2008 @@ -367,8 +367,6 @@ AllocaInsertionPoint = 0; - UsedSRetBuffer = false; - ExceptionValue = 0; ExceptionSelectorValue = 0; FuncEHException = 0; @@ -413,12 +411,10 @@ LLVMBuilder Builder; std::vector LocStack; std::vector NameStack; - bool &UsedSRetBuffer; FunctionPrologArgumentConversion(tree FnDecl, Function::arg_iterator &ai, - const LLVMBuilder &B, - bool &SRetBuffer) - : FunctionDecl(FnDecl), AI(ai), Builder(B), UsedSRetBuffer(SRetBuffer) {} + const LLVMBuilder &B) + : FunctionDecl(FnDecl), AI(ai), Builder(B) {} void setName(const std::string &Name) { NameStack.push_back(Name); @@ -446,11 +442,7 @@ tree ResultDecl = DECL_RESULT(FunctionDecl); tree RetTy = TREE_TYPE(TREE_TYPE(FunctionDecl)); if (TREE_CODE(RetTy) == TREE_CODE(TREE_TYPE(ResultDecl))) { - // Use a buffer for the return result. This ensures that writes to the - // return value do not interfere with reads from parameters: the same - // aggregate might be used for the return value and as a parameter. - TheTreeToLLVM->EmitAutomaticVariableDecl(DECL_RESULT(FunctionDecl)); - UsedSRetBuffer = true; + SET_DECL_LLVM(ResultDecl, AI); ++AI; return; } @@ -666,7 +658,7 @@ Function::arg_iterator AI = Fn->arg_begin(); // Rename and alloca'ify real arguments. - FunctionPrologArgumentConversion Client(FnDecl, AI, Builder, UsedSRetBuffer); + FunctionPrologArgumentConversion Client(FnDecl, AI, Builder); TheLLVMABI ABIConverter(Client); // Handle the DECL_RESULT. @@ -766,14 +758,6 @@ PointerType::getUnqual(Fn->getReturnType())); RetVal = Builder.CreateLoad(RetVal, "retval"); } - } else if (UsedSRetBuffer) { - // A buffer was used for the aggregate return result. Copy it out now. - assert(Fn->arg_begin() != Fn->arg_end() && "No struct return value?"); - unsigned Alignment = expr_align(DECL_RESULT(FnDecl))/8; - bool Volatile = TREE_THIS_VOLATILE(DECL_RESULT(FnDecl)); - MemRef BufLoc(DECL_LLVM(DECL_RESULT(FnDecl)), Alignment, false); - MemRef RetLoc(Fn->arg_begin(), Alignment, Volatile); - EmitAggregateCopy(RetLoc, BufLoc, TREE_TYPE(DECL_RESULT(FnDecl))); } if (TheDebugInfo) TheDebugInfo->EmitRegionEnd(Fn, Builder.GetInsertBlock()); Builder.CreateRet(RetVal); @@ -2321,6 +2305,7 @@ CallingConv::ID &CallingConvention; LLVMBuilder &Builder; const MemRef *DestLoc; + MemRef BufLoc; std::vector LocStack; FunctionCallArgumentConversion(tree exp, SmallVector &ops, @@ -2352,7 +2337,19 @@ assert(LocStack.size() == 1 && "Imbalance!"); LocStack.clear(); } - + + // CopyOutResult - If the (aggregate) return result was redirected to a + // buffer, copy it to the final destination. + void CopyOutResult(tree result_type) { + if (BufLoc.Ptr && DestLoc) { + // A buffer was used for the aggregate return result. Copy it out now. + assert(ConvertType(result_type) == + cast(BufLoc.Ptr->getType())->getElementType() && + "Inconsistent result types!"); + TheTreeToLLVM->EmitAggregateCopy(*DestLoc, BufLoc, result_type); + } + } + /// HandleScalarResult - This callback is invoked if the function returns a /// simple scalar result value. void HandleScalarResult(const Type *RetTy) { @@ -2367,7 +2364,7 @@ void HandleAggregateResultAsScalar(const Type *ScalarTy) { // There is nothing to do here. } - + /// HandleAggregateShadowArgument - This callback is invoked if the function /// returns an aggregate value by using a "shadow" first parameter. If /// RetPtr is set to true, the pointer argument itself is returned from the @@ -2375,19 +2372,15 @@ void HandleAggregateShadowArgument(const PointerType *PtrArgTy, bool RetPtr) { // We need to pass a buffer to return into. If the caller uses the - // result, DestLoc will be set. If it ignores it, it could be unset, - // in which case we need to create a dummy buffer. - // FIXME: The alignment and volatility of the buffer are being ignored! - Value *DestPtr; - if (DestLoc == 0) { - DestPtr = TheTreeToLLVM->CreateTemporary(PtrArgTy->getElementType()); - } else { - DestPtr = DestLoc->Ptr; - assert(PtrArgTy == DestPtr->getType()); - } - CallOperands.push_back(DestPtr); + // result, DestLoc will be set. Since DestLoc may alias a parameter, + // the result needs to be stored in a buffer then copied to DestLoc + // after the call. If DestLoc is not set then the result is unused, + // in which case we need to create a dummy buffer but not copy it out. + assert(!DestLoc || PtrArgTy == DestLoc->Ptr->getType()); + BufLoc = TheTreeToLLVM->CreateTempLoc(PtrArgTy->getElementType()); + CallOperands.push_back(BufLoc.Ptr); } - + void HandleScalarArgument(const llvm::Type *LLVMTy, tree type) { assert(!LocStack.empty()); Value *Loc = LocStack.back(); @@ -2556,7 +2549,9 @@ cast(Call)->setParamAttrs(PAL); EmitBlock(NextBlock); } - + + Client.CopyOutResult(TREE_TYPE(exp)); + if (Call->getType() == Type::VoidTy) return 0; Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=46460&r1=46459&r2=46460&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Mon Jan 28 14:57:24 2008 @@ -286,10 +286,6 @@ // and managed by CreateTemporary. Instruction *AllocaInsertionPoint; - // UsedSRetBuffer - Whether a buffer was used for an aggregate return value. - // If so, it needs copying out when the function returns. - bool UsedSRetBuffer; - //===---------------------- Exception Handling --------------------------===// /// LandingPads - The landing pad for a given EH region. @@ -390,7 +386,12 @@ /// instruction's type is a pointer to the specified type. AllocaInst *CreateTemporary(const Type *Ty); - void EmitAutomaticVariableDecl(tree_node *decl); + /// CreateTempLoc - Like CreateTemporary, but returns a MemRef. + MemRef CreateTempLoc(const Type *Ty); + + /// EmitAggregateCopy - Copy the elements from SrcLoc to DestLoc, using the + /// GCC type specified by GCCType to know which elements to copy. + void EmitAggregateCopy(MemRef DestLoc, MemRef SrcLoc, tree_node *GCCType); private: // Helper functions. @@ -412,10 +413,6 @@ /// the previous block falls through into it, add an explicit branch. void EmitBlock(BasicBlock *BB); - /// EmitAggregateCopy - Copy the elements from SrcLoc to DestLoc, using the - /// GCC type specified by GCCType to know which elements to copy. - void EmitAggregateCopy(MemRef DestLoc, MemRef SrcLoc, tree_node *GCCType); - /// EmitAggregateZero - Zero the elements of DestLoc. /// void EmitAggregateZero(MemRef DestLoc, tree_node *GCCType); @@ -449,8 +446,7 @@ BasicBlock *getPostPad(unsigned RegionNo); private: - /// CreateTempLoc - Like CreateTemporary, but returns a MemRef. - MemRef CreateTempLoc(const Type *Ty); + void EmitAutomaticVariableDecl(tree_node *decl); /// isNoopCast - Return true if a cast from V to Ty does not change any bits. /// From dpatel at apple.com Mon Jan 28 15:01:05 2008 From: dpatel at apple.com (Devang Patel) Date: Mon, 28 Jan 2008 21:01:05 -0000 Subject: [llvm-commits] [llvm] r46461 - /llvm/tags/Apple/llvmCore-2012/Makefile.rules Message-ID: <200801282101.m0SL15aD010454@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 28 15:01:04 2008 New Revision: 46461 URL: http://llvm.org/viewvc/llvm-project?rev=46461&view=rev Log: Fix build failure. Backport patch from trunk. Modified: llvm/tags/Apple/llvmCore-2012/Makefile.rules Modified: llvm/tags/Apple/llvmCore-2012/Makefile.rules URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2012/Makefile.rules?rev=46461&r1=46460&r2=46461&view=diff ============================================================================== --- llvm/tags/Apple/llvmCore-2012/Makefile.rules (original) +++ llvm/tags/Apple/llvmCore-2012/Makefile.rules Mon Jan 28 15:01:04 2008 @@ -454,8 +454,8 @@ LD.Flags += -L$(LibDir) -L$(LLVMLibDir) CPP.BaseFlags += -D_GNU_SOURCE -D__STDC_LIMIT_MACROS # All -I flags should go here, so that they don't confuse llvm-config. -CPP.Flags += $(patsubst %,-I%/include,$(sort \ - $(PROJ_OBJ_DIR) $(PROJ_SRC_DIR) \ +CPP.Flags += $(sort -I$(PROJ_OBJ_DIR) -I$(PROJ_SRC_DIR) \ + $(patsubst %,-I%/include,\ $(PROJ_OBJ_ROOT) $(PROJ_SRC_ROOT) \ $(LLVM_OBJ_ROOT) $(LLVM_SRC_ROOT))) \ $(CPP.BaseFlags) From baldrick at free.fr Mon Jan 28 15:02:37 2008 From: baldrick at free.fr (Duncan Sands) Date: Mon, 28 Jan 2008 22:02:37 +0100 Subject: [llvm-commits] [llvm] r46382 - /llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c In-Reply-To: <5A4762C5-2DEE-41D2-A393-C7A498243ECA@apple.com> References: <200801260035.m0Q0ZimO029138@zion.cs.uiuc.edu> <165E3689-D1BD-4523-9084-92CE220B47EF@apple.com> <5A4762C5-2DEE-41D2-A393-C7A498243ECA@apple.com> Message-ID: <200801282202.39817.baldrick@free.fr> > How long should we continue to support 4.0? I thought 2.2 was the > last release for it? Does 4.0 do anything better than 4.2? I'm all for dropping it like a hot potato if not. Ciao, Duncan. From isanbard at gmail.com Mon Jan 28 15:47:12 2008 From: isanbard at gmail.com (Bill Wendling) Date: Mon, 28 Jan 2008 21:47:12 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r46463 - in /llvm-gcc-4.2/trunk: gcc/config/darwin.h libcpp/directives.c libcpp/internal.h libcpp/lex.c Message-ID: <200801282147.m0SLlDZM011834@zion.cs.uiuc.edu> Author: void Date: Mon Jan 28 15:47:12 2008 New Revision: 46463 URL: http://llvm.org/viewvc/llvm-project?rev=46463&view=rev Log: This program: $ cat testcase.c #pragma mark Mike's world #ifdef DO_ERROR #error Mike's world #endif int i; Gives us these warnings: pragma-2.c:1:18: warning: missing terminating ' character pragma-2.c:3:12: warning: missing terminating ' character We should ignore unbalanced quotes in these pragmas. Porting fixes from Apple GCC. Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h llvm-gcc-4.2/trunk/libcpp/directives.c llvm-gcc-4.2/trunk/libcpp/internal.h llvm-gcc-4.2/trunk/libcpp/lex.c Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.h?rev=46463&r1=46462&r2=46463&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/config/darwin.h (original) +++ llvm-gcc-4.2/trunk/gcc/config/darwin.h Mon Jan 28 15:47:12 2008 @@ -1162,10 +1162,9 @@ #define DARWIN_REGISTER_TARGET_PRAGMAS() \ do { \ - /* APPLE LOCAL begin mainline 2007-10-10 5497482 */ \ - cpp_register_pragma (parse_in, NULL, "mark", \ - darwin_pragma_ignore, false); \ - /* APPLE LOCAL end mainline 2007-10-10 5497482 */ \ + /* APPLE LOCAL begin pragma mark 5614511 */ \ + /* Removed mark. */ \ + /* APPLE LOCAL end pragma mark 5614511 */ \ c_register_pragma (0, "options", darwin_pragma_options); \ c_register_pragma (0, "segment", darwin_pragma_ignore); \ /* APPLE LOCAL pragma fenv */ \ Modified: llvm-gcc-4.2/trunk/libcpp/directives.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/directives.c?rev=46463&r1=46462&r2=46463&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/directives.c (original) +++ llvm-gcc-4.2/trunk/libcpp/directives.c Mon Jan 28 15:47:12 2008 @@ -1073,7 +1073,11 @@ if (print_dir) fprintf (stderr, "#%s ", pfile->directive->name); pfile->state.prevent_expansion++; + /* APPLE LOCAL #error with unmatched quotes 5607574 */ + pfile->state.in_diagnostic++; cpp_output_line (pfile, stderr); + /* APPLE LOCAL #error with unmatched quotes 5607574 */ + pfile->state.in_diagnostic--; pfile->state.prevent_expansion--; } } @@ -1262,12 +1266,25 @@ } } +/* APPLE LOCAL begin pragma mark 5614511 */ +/* Handle #pragma mark. */ +static void +do_pragma_mark (cpp_reader *pfile) +{ + ++pfile->state.skipping; + skip_rest_of_line (pfile); + --pfile->state.skipping; +} +/* APPLE LOCAL end pragma mark 5614511 */ + /* Register the pragmas the preprocessor itself handles. */ void _cpp_init_internal_pragmas (cpp_reader *pfile) { /* Pragmas in the global namespace. */ register_pragma_internal (pfile, 0, "once", do_pragma_once); + /* APPLE LOCAL pragma mark 5614511 */ + register_pragma_internal (pfile, 0, "mark", do_pragma_mark); /* New GCC-specific pragmas should be put in the GCC namespace. */ register_pragma_internal (pfile, "GCC", "poison", do_pragma_poison); Modified: llvm-gcc-4.2/trunk/libcpp/internal.h URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/internal.h?rev=46463&r1=46462&r2=46463&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/internal.h (original) +++ llvm-gcc-4.2/trunk/libcpp/internal.h Mon Jan 28 15:47:12 2008 @@ -226,6 +226,11 @@ /* Nonzero if the deferred pragma being handled allows macro expansion. */ unsigned char pragma_allow_expansion; + + /* APPLE LOCAL begin #error with unmatched quotes 5607574 */ + /* Nonzero when handling #error and #warning to allow unmatched quotes. */ + unsigned char in_diagnostic; + /* APPLE LOCAL end #error with unmatched quotes 5607574 */ }; /* Special nodes - identifiers with predefined significance. */ Modified: llvm-gcc-4.2/trunk/libcpp/lex.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libcpp/lex.c?rev=46463&r1=46462&r2=46463&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/libcpp/lex.c (original) +++ llvm-gcc-4.2/trunk/libcpp/lex.c Mon Jan 28 15:47:12 2008 @@ -665,7 +665,12 @@ cpp_error (pfile, CPP_DL_WARNING, "null character(s) preserved in literal"); - if (type == CPP_OTHER && CPP_OPTION (pfile, lang) != CLK_ASM) + /* APPLE LOCAL begin #error with unmatched quotes 5607574 */ + if (type == CPP_OTHER + && CPP_OPTION (pfile, lang) != CLK_ASM + && !pfile->state.in_diagnostic + && !pfile->state.skipping) + /* APPLE LOCAL end #error with unmatched quotes 5607574 */ cpp_error (pfile, CPP_DL_PEDWARN, "missing terminating %c character", (int) terminator); From kremenek at apple.com Mon Jan 28 16:05:23 2008 From: kremenek at apple.com (Ted Kremenek) Date: Mon, 28 Jan 2008 22:05:23 -0000 Subject: [llvm-commits] [llvm] r46465 - /llvm/trunk/include/llvm/ADT/FoldingSet.h Message-ID: <200801282205.m0SM5NNi012341@zion.cs.uiuc.edu> Author: kremenek Date: Mon Jan 28 16:05:23 2008 New Revision: 46465 URL: http://llvm.org/viewvc/llvm-project?rev=46465&view=rev Log: Added destructor for template class FoldingSetNodeWrapper. Added getValue() to FoldingSetNodeWrapper. Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=46465&r1=46464&r2=46465&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/FoldingSet.h (original) +++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Jan 28 16:05:23 2008 @@ -329,7 +329,7 @@ T data; public: FoldingSetNodeWrapper(const T& x) : data(x) {} - virtual ~FoldingSetNodeWrapper(); + virtual ~FoldingSetNodeWrapper() {} template explicit FoldingSetNodeWrapper(const A1& a1) @@ -356,6 +356,9 @@ void Profile(FoldingSetNodeID& ID) { FoldingSetTrait::Profile(data, ID); } + T& getValue() { return data; } + const T& getValue() const { return data; } + operator T&() { return data; } operator const T&() const { return data; } }; From evan.cheng at apple.com Mon Jan 28 16:28:50 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Mon, 28 Jan 2008 22:28:50 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r46469 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Message-ID: <200801282228.m0SMSpJp013084@zion.cs.uiuc.edu> Author: evancheng Date: Mon Jan 28 16:28:50 2008 New Revision: 46469 URL: http://llvm.org/viewvc/llvm-project?rev=46469&view=rev Log: Debug info for byval parameter. First attempt, unclear if it is right. But at least it tells gdb there is a parameter. Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46469&r1=46468&r2=46469&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jan 28 16:28:50 2008 @@ -672,13 +672,22 @@ if (DECL_NAME(Args)) Name = IDENTIFIER_POINTER(DECL_NAME(Args)); const Type *ArgTy = ConvertType(TREE_TYPE(Args)); - if (isPassedByInvisibleReference(TREE_TYPE(Args)) || + bool isInvRef = isPassedByInvisibleReference(TREE_TYPE(Args)); + if (isInvRef || (!ArgTy->isFirstClassType() && LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(TREE_TYPE(Args), ArgTy))) { // If the value is passed by 'invisible reference' or 'byval reference', // the l-value for the argument IS the argument itself. - SET_DECL_LLVM(Args, AI); AI->setName(Name); + SET_DECL_LLVM(Args, AI); + if (!isInvRef && TheDebugInfo) { + Value *Tmp = CreateTemporary(PointerType::getUnqual(ArgTy)); + Tmp->setName(std::string(Name)+"_addr"); + TheDebugInfo->EmitDeclare(Args, llvm::dwarf::DW_TAG_arg_variable, + Name, TREE_TYPE(Args), Tmp, + Builder.GetInsertBlock()); + Builder.CreateStore(AI, Tmp); + } ++AI; } else { // Otherwise, we create an alloca to hold the argument value and provide From lattner at apple.com Mon Jan 28 17:00:18 2008 From: lattner at apple.com (Tanya Lattner) Date: Mon, 28 Jan 2008 15:00:18 -0800 Subject: [llvm-commits] [llvm] r46382 - /llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c In-Reply-To: <5A4762C5-2DEE-41D2-A393-C7A498243ECA@apple.com> References: <200801260035.m0Q0ZimO029138@zion.cs.uiuc.edu> <165E3689-D1BD-4523-9084-92CE220B47EF@apple.com> <5A4762C5-2DEE-41D2-A393-C7A498243ECA@apple.com> Message-ID: <10387F24-B69B-42F5-93D1-3CC949F06BBF@apple.com> On Jan 28, 2008, at 11:35 AM, Chris Lattner wrote: > On Jan 28, 2008, at 11:15 AM, Tanya Lattner wrote: >> This test is failing for me. llvm-gcc-4.0 on x86/darwin8. >> >> ../../src/gcc/llvm-types.cpp:1426: failed assertion `0 && "Could not >> find field!"' > > How long should we continue to support 4.0? I thought 2.2 was the > last release for it? > There are 2 things that we should be doing to drop 4.0. 1) Are there less tests in llvm-test that are failing for 4.0 versus 4.2? 2) We have to communicate to people who are using svn for LLVM and llvm-gcc that we are moving to supporting only llvm-gcc-4.2 and when that cutoff date is. We can't just start dropping 4.0 and letting make check fail, without the 2 above steps. -Tanya From isanbard at gmail.com Mon Jan 28 18:18:43 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jan 2008 00:18:43 -0000 Subject: [llvm-commits] [llvm] r46473 - /llvm/tags/Apple/llvmCore-2013/ Message-ID: <200801290018.m0T0IhH1016286@zion.cs.uiuc.edu> Author: void Date: Mon Jan 28 18:18:43 2008 New Revision: 46473 URL: http://llvm.org/viewvc/llvm-project?rev=46473&view=rev Log: Creating llvmCore-2013 branch Added: llvm/tags/Apple/llvmCore-2013/ - copied from r46472, llvm/trunk/ From isanbard at gmail.com Mon Jan 28 18:18:49 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jan 2008 00:18:49 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r46474 - /llvm-gcc-4.2/tags/Apple/llvmgcc42-2013/ Message-ID: <200801290018.m0T0InKI016298@zion.cs.uiuc.edu> Author: void Date: Mon Jan 28 18:18:49 2008 New Revision: 46474 URL: http://llvm.org/viewvc/llvm-project?rev=46474&view=rev Log: Creating llvmgcc42-2013 branch Added: llvm-gcc-4.2/tags/Apple/llvmgcc42-2013/ - copied from r46473, llvm-gcc-4.2/trunk/ From isanbard at gmail.com Mon Jan 28 18:41:29 2008 From: isanbard at gmail.com (Bill Wendling) Date: Tue, 29 Jan 2008 00:41:29 -0000 Subject: [llvm-commits] [llvm] r46476 - /llvm/trunk/test/CFrontend/2008-01-28-PragmaMark.c Message-ID: <200801290041.m0T0fTR7017190@zion.cs.uiuc.edu> Author: void Date: Mon Jan 28 18:41:29 2008 New Revision: 46476 URL: http://llvm.org/viewvc/llvm-project?rev=46476&view=rev Log: Add test to make sure that #pragma mark/error doesn't error if there are unbalanced quotes. Added: llvm/trunk/test/CFrontend/2008-01-28-PragmaMark.c Added: llvm/trunk/test/CFrontend/2008-01-28-PragmaMark.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-01-28-PragmaMark.c?rev=46476&view=auto ============================================================================== --- llvm/trunk/test/CFrontend/2008-01-28-PragmaMark.c (added) +++ llvm/trunk/test/CFrontend/2008-01-28-PragmaMark.c Mon Jan 28 18:41:29 2008 @@ -0,0 +1,6 @@ +// RUN: %llvmgcc -Werror -c %s -o /dev/null +#pragma mark LLVM's world +#ifdef DO_ERROR +#error LLVM's world +#endif +int i; From dpatel at apple.com Mon Jan 28 19:09:18 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 29 Jan 2008 01:09:18 -0000 Subject: [llvm-commits] [llvm-gcc-4.2] r46478 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Message-ID: <200801290109.m0T19Ie0018351@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 28 19:09:18 2008 New Revision: 46478 URL: http://llvm.org/viewvc/llvm-project?rev=46478&view=rev Log: Fix PR1861 While selecting union size, select larger field size irrespective of whether field is packed or not. Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=46478&r1=46477&r2=46478&view=diff ============================================================================== --- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original) +++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Jan 28 19:09:18 2008 @@ -2160,12 +2160,8 @@ continue; const Type *TheTy = ConvertType(TREE_TYPE(Field)); - bool isPacked = false; unsigned Size = TD.getABITypeSize(TheTy); unsigned Align = TD.getABITypeAlignment(TheTy); - if (const StructType *STy = dyn_cast(TheTy)) - if (STy->isPacked()) - isPacked = true; adjustPaddingElement(UnionTy, TheTy); @@ -2181,7 +2177,7 @@ useTheTy = true; else if (MaxAlign == Align && Size > MaxSize) useTheTy = true; - else if (isPacked && Size > MaxSize) + else if (Size > MaxSize) useTheTy = true; if (useTheTy) { From dpatel at apple.com Mon Jan 28 19:10:04 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 29 Jan 2008 01:10:04 -0000 Subject: [llvm-commits] [llvm] r46479 - /llvm/trunk/test/CFrontend/2008-01-28-UnionSize.c Message-ID: <200801290110.m0T1A4mo018385@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 28 19:10:04 2008 New Revision: 46479 URL: http://llvm.org/viewvc/llvm-project?rev=46479&view=rev Log: New test. Added: llvm/trunk/test/CFrontend/2008-01-28-UnionSize.c Added: llvm/trunk/test/CFrontend/2008-01-28-UnionSize.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-01-28-UnionSize.c?rev=46479&view=auto ============================================================================== --- llvm/trunk/test/CFrontend/2008-01-28-UnionSize.c (added) +++ llvm/trunk/test/CFrontend/2008-01-28-UnionSize.c Mon Jan 28 19:10:04 2008 @@ -0,0 +1,24 @@ +// RUN: %llvmgcc %s -S -o - +// PR 1861 + +typedef unsigned char __u8; +typedef unsigned int __u32; +typedef unsigned short u16; +typedef __u32 __le32; +struct bcm43xx_plcp_hdr6 { + union { + __le32 data; + __u8 raw[6]; + } + __attribute__((__packed__)); +} + __attribute__((__packed__)); +struct bcm43xx_txhdr { + union { + struct { + struct bcm43xx_plcp_hdr6 plcp; + }; + }; +} + __attribute__((__packed__)); +static void bcm43xx_generate_rts(struct bcm43xx_txhdr *txhdr ) { } From scottm at aero.org Mon Jan 28 20:16:57 2008 From: scottm at aero.org (Scott Michel) Date: Tue, 29 Jan 2008 02:16:57 -0000 Subject: [llvm-commits] [llvm] r46483 - in /llvm/trunk: lib/Target/CellSPU/ test/CodeGen/CellSPU/ Message-ID: <200801290216.m0T2Gw8o020585@zion.cs.uiuc.edu> Author: pingbak Date: Mon Jan 28 20:16:57 2008 New Revision: 46483 URL: http://llvm.org/viewvc/llvm-project?rev=46483&view=rev Log: Overhaul Cell SPU's addressing mode internals so that there are now only two addressing mode nodes, SPUaform and SPUindirect (vice the three previous ones, SPUaform, SPUdform and SPUxform). This improves code somewhat because we now avoid using reg+reg addressing when it can be avoided. It also simplifies the address selection logic, which was the main point for doing this. Also, for various global variables that would be loaded using SPU's A-form addressing, prefer D-form offs[reg] addressing, keeping the base in a register if the variable is used more than once. Removed: llvm/trunk/test/CodeGen/CellSPU/struct_2.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/lib/Target/CellSPU/SPUNodes.td llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll llvm/trunk/test/CodeGen/CellSPU/fcmp.ll llvm/trunk/test/CodeGen/CellSPU/struct_1.ll llvm/trunk/test/CodeGen/CellSPU/vec_const.ll Modified: llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp Mon Jan 28 20:16:57 2008 @@ -195,12 +195,18 @@ void printAddr256K(const MachineInstr *MI, unsigned OpNo) { - /* Note: operand 1 is an offset or symbol name. Operand 2 is - ignored. */ + /* Note: operand 1 is an offset or symbol name. */ if (MI->getOperand(OpNo).isImmediate()) { printS16ImmOperand(MI, OpNo); } else { printOp(MI->getOperand(OpNo)); + if (MI->getOperand(OpNo+1).isImmediate()) { + int displ = int(MI->getOperand(OpNo+1).getImm()); + if (displ > 0) + O << "+" << displ; + else if (displ < 0) + O << displ; + } } } @@ -309,7 +315,6 @@ case MachineOperand::MO_JumpTableIndex: O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() << '_' << MO.getIndex(); - // FIXME: PIC relocation model return; case MachineOperand::MO_ConstantPoolIndex: O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() @@ -521,7 +526,8 @@ O << "\t.zero\t" << Size; } else if (I->hasInternalLinkage()) { SwitchToDataSection("\t.data", I); - O << TAI->getLCOMMDirective() << name << "," << Size << "," << Align; + O << ".local " << name << "\n"; + O << TAI->getCOMMDirective() << name << "," << Size << "," << Align << "\n"; } else { SwitchToDataSection("\t.data", I); O << ".comm " << name << "," << Size; Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Mon Jan 28 20:16:57 2008 @@ -150,6 +150,16 @@ return false; } + bool + isHighLow(const SDOperand &Op) + { + return (Op.getOpcode() == SPUISD::IndirectAddr + && ((Op.getOperand(0).getOpcode() == SPUISD::Hi + && Op.getOperand(1).getOpcode() == SPUISD::Lo) + || (Op.getOperand(0).getOpcode() == SPUISD::Lo + && Op.getOperand(1).getOpcode() == SPUISD::Hi))); + } + //===------------------------------------------------------------------===// //! MVT::ValueType to "useful stuff" mapping structure: @@ -157,40 +167,24 @@ MVT::ValueType VT; unsigned ldresult_ins; /// LDRESULT instruction (0 = undefined) int prefslot_byte; /// Byte offset of the "preferred" slot - unsigned brcc_eq_ins; /// br_cc equal instruction - unsigned brcc_neq_ins; /// br_cc not equal instruction - unsigned load_aform; /// A-form load instruction for this VT - unsigned store_aform; /// A-form store instruction for this VT + unsigned insmask_ins; /// Insert mask instruction for a-form }; const valtype_map_s valtype_map[] = { - { MVT::i1, 0, 3, 0, 0, 0, - 0 }, - { MVT::i8, SPU::ORBIr8, 3, 0, 0, SPU::LQAr8, - SPU::STQAr8 }, - { MVT::i16, SPU::ORHIr16, 2, SPU::BRHZ, SPU::BRHNZ, SPU::LQAr16, - SPU::STQAr16 }, - { MVT::i32, SPU::ORIr32, 0, SPU::BRZ, SPU::BRNZ, SPU::LQAr32, - SPU::STQAr32 }, - { MVT::i64, SPU::ORIr64, 0, 0, 0, SPU::LQAr64, - SPU::STQAr64 }, - { MVT::f32, 0, 0, 0, 0, SPU::LQAf32, - SPU::STQAf32 }, - { MVT::f64, 0, 0, 0, 0, SPU::LQAf64, - SPU::STQAf64 }, + { MVT::i1, 0, 3, 0 }, + { MVT::i8, SPU::ORBIr8, 3, 0 }, + { MVT::i16, SPU::ORHIr16, 2, 0 }, + { MVT::i32, SPU::ORIr32, 0, 0 }, + { MVT::i64, SPU::ORIr64, 0, 0 }, + { MVT::f32, 0, 0, 0 }, + { MVT::f64, 0, 0, 0 }, // vector types... (sigh!) - { MVT::v16i8, 0, 0, 0, 0, SPU::LQAv16i8, - SPU::STQAv16i8 }, - { MVT::v8i16, 0, 0, 0, 0, SPU::LQAv8i16, - SPU::STQAv8i16 }, - { MVT::v4i32, 0, 0, 0, 0, SPU::LQAv4i32, - SPU::STQAv4i32 }, - { MVT::v2i64, 0, 0, 0, 0, SPU::LQAv2i64, - SPU::STQAv2i64 }, - { MVT::v4f32, 0, 0, 0, 0, SPU::LQAv4f32, - SPU::STQAv4f32 }, - { MVT::v2f64, 0, 0, 0, 0, SPU::LQAv2f64, - SPU::STQAv2f64 }, + { MVT::v16i8, 0, 0, SPU::CBD }, + { MVT::v8i16, 0, 0, SPU::CHD }, + { MVT::v4i32, 0, 0, SPU::CWD }, + { MVT::v2i64, 0, 0, 0 }, + { MVT::v4f32, 0, 0, SPU::CWD }, + { MVT::v2f64, 0, 0, 0 } }; const size_t n_valtype_map = sizeof(valtype_map) / sizeof(valtype_map[0]); @@ -381,18 +375,20 @@ Disp = CurDAG->getTargetConstant(0, VT); Base = N; return true; - } else if (Opc == SPUISD::DFormAddr) { - // D-Form address: This is pretty straightforward, naturally... - CN = cast(N.getOperand(1)); - assert(CN != 0 && "SelectDFormAddr/SPUISD::DForm2Addr expecting constant"); - Imm = unsigned(CN->getValue()); - if (Imm < 0xff) { - Disp = CurDAG->getTargetConstant(CN->getValue(), PtrVT); - Base = N.getOperand(0); - return true; + } else if (Opc == SPUISD::IndirectAddr) { + SDOperand Op1 = N.getOperand(1); + if (Op1.getOpcode() == ISD::TargetConstant + || Op1.getOpcode() == ISD::Constant) { + CN = cast(N.getOperand(1)); + assert(CN != 0 && "SelectIndirectAddr/SPUISD::DForm2Addr expecting constant"); + Imm = unsigned(CN->getValue()); + if (Imm < 0xff) { + Disp = CurDAG->getTargetConstant(CN->getValue(), PtrVT); + Base = N.getOperand(0); + return true; + } } } - return false; } @@ -407,7 +403,7 @@ SDOperand &Index) { // These match the addr256k operand type: MVT::ValueType OffsVT = MVT::i16; - MVT::ValueType PtrVT = SPUtli.getPointerTy(); + SDOperand Zero = CurDAG->getTargetConstant(0, OffsVT); switch (N.getOpcode()) { case ISD::Constant: @@ -417,28 +413,40 @@ abort(); /*NOTREACHED*/ - case ISD::TargetConstant: { - // Loading from a constant address. - ConstantSDNode *CN = dyn_cast(N); - int Imm = (int)CN->getValue(); - if (Imm < 0x3ffff && (Imm & 0x3) == 0) { - Base = CurDAG->getTargetConstant(Imm, PtrVT); - // Note that this operand will be ignored by the assembly printer... - Index = CurDAG->getTargetConstant(0, OffsVT); - return true; - } - } + case ISD::TargetConstant: case ISD::TargetGlobalAddress: - case ISD::TargetConstantPool: - case SPUISD::AFormAddr: { - // The address is in Base. N is a dummy that will be ignored by - // the assembly printer. - Base = N; - Index = CurDAG->getTargetConstant(0, OffsVT); - return true; - } - } + case ISD::TargetJumpTable: + cerr << "SPUSelectAFormAddr: Target Constant/Pool/Global not wrapped as " + << "A-form address.\n"; + abort(); + /*NOTREACHED*/ + case SPUISD::AFormAddr: + // Just load from memory if there's only a single use of the location, + // otherwise, this will get handled below with D-form offset addresses + if (N.hasOneUse()) { + SDOperand Op0 = N.getOperand(0); + switch (Op0.getOpcode()) { + case ISD::TargetConstantPool: + case ISD::TargetJumpTable: + Base = Op0; + Index = Zero; + return true; + + case ISD::TargetGlobalAddress: { + GlobalAddressSDNode *GSDN = cast(Op0); + GlobalValue *GV = GSDN->getGlobal(); + if (GV->getAlignment() == 16) { + Base = Op0; + Index = Zero; + return true; + } + break; + } + } + } + break; + } return false; } @@ -460,14 +468,11 @@ unsigned Opc = N.getOpcode(); unsigned PtrTy = SPUtli.getPointerTy(); - if (Opc == ISD::Register) { - Base = N; - Index = CurDAG->getTargetConstant(0, PtrTy); - return true; - } else if (Opc == ISD::FrameIndex) { + if (Opc == ISD::FrameIndex) { + // Stack frame index must be less than 512 (divided by 16): FrameIndexSDNode *FI = dyn_cast(N); DEBUG(cerr << "SelectDFormAddr: ISD::FrameIndex = " - << FI->getIndex() << "\n"); + << FI->getIndex() << "\n"); if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { Base = CurDAG->getTargetConstant(0, PtrTy); Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); @@ -475,19 +480,20 @@ } } else if (Opc == ISD::ADD) { // Generated by getelementptr - const SDOperand Op0 = N.getOperand(0); // Frame index/base - const SDOperand Op1 = N.getOperand(1); // Offset within base + const SDOperand Op0 = N.getOperand(0); + const SDOperand Op1 = N.getOperand(1); - if ((Op1.getOpcode() == ISD::Constant - || Op1.getOpcode() == ISD::TargetConstant) - && Op0.getOpcode() != SPUISD::XFormAddr) { + if ((Op0.getOpcode() == SPUISD::Hi && Op1.getOpcode() == SPUISD::Lo) + || (Op1.getOpcode() == SPUISD::Hi && Op0.getOpcode() == SPUISD::Lo)) { + Base = CurDAG->getTargetConstant(0, PtrTy); + Index = N; + return true; + } else if (Op1.getOpcode() == ISD::Constant + || Op1.getOpcode() == ISD::TargetConstant) { ConstantSDNode *CN = dyn_cast(Op1); - assert(CN != 0 && "SelectDFormAddr: Expected a constant"); - - int32_t offset = (int32_t) CN->getSignExtended(); - unsigned Opc0 = Op0.getOpcode(); + int32_t offset = int32_t(CN->getSignExtended()); - if (Opc0 == ISD::FrameIndex) { + if (Op0.getOpcode() == ISD::FrameIndex) { FrameIndexSDNode *FI = dyn_cast(Op0); DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset << " frame index = " << FI->getIndex() << "\n"); @@ -500,51 +506,69 @@ } else if (offset > SPUFrameInfo::minFrameOffset() && offset < SPUFrameInfo::maxFrameOffset()) { Base = CurDAG->getTargetConstant(offset, PtrTy); - if (Opc0 == ISD::GlobalAddress) { - // Convert global address to target global address - GlobalAddressSDNode *GV = dyn_cast(Op0); - Index = CurDAG->getTargetGlobalAddress(GV->getGlobal(), PtrTy); - return true; - } else { - // Otherwise, just take operand 0 - Index = Op0; + Index = Op0; + return true; + } + } else if (Op0.getOpcode() == ISD::Constant + || Op0.getOpcode() == ISD::TargetConstant) { + ConstantSDNode *CN = dyn_cast(Op0); + int32_t offset = int32_t(CN->getSignExtended()); + + if (Op1.getOpcode() == ISD::FrameIndex) { + FrameIndexSDNode *FI = dyn_cast(Op1); + DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset + << " frame index = " << FI->getIndex() << "\n"); + + if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { + Base = CurDAG->getTargetConstant(offset, PtrTy); + Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); return true; } + } else if (offset > SPUFrameInfo::minFrameOffset() + && offset < SPUFrameInfo::maxFrameOffset()) { + Base = CurDAG->getTargetConstant(offset, PtrTy); + Index = Op1; + return true; } - } else - return false; - } else if (Opc == SPUISD::DFormAddr) { - // D-Form address: This is pretty straightforward, - // naturally... but make sure that this isn't a D-form address - // with a X-form address embedded within: - const SDOperand Op0 = N.getOperand(0); // Frame index/base - const SDOperand Op1 = N.getOperand(1); // Offset within base + } + } else if (Opc == SPUISD::IndirectAddr) { + // Indirect with constant offset -> D-Form address + const SDOperand Op0 = N.getOperand(0); + const SDOperand Op1 = N.getOperand(1); + SDOperand Zero = CurDAG->getTargetConstant(0, N.getValueType()); - if (Op0.getOpcode() == ISD::Constant - || Op0.getOpcode() == ISD::TargetConstant) { + if (Op1.getOpcode() == ISD::Constant + || Op1.getOpcode() == ISD::TargetConstant) { ConstantSDNode *CN = cast(Op1); - assert(CN != 0 && "SelectDFormAddr/SPUISD::DFormAddr expecting constant"); - Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); - Index = Op0; - return true; - } - } else if (Opc == ISD::FrameIndex) { - // Stack frame index must be less than 512 (divided by 16): - FrameIndexSDNode *FI = dyn_cast(N); - DEBUG(cerr << "SelectDFormAddr: ISD::FrameIndex = " - << FI->getIndex() << "\n"); - if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { + int32_t offset = int32_t(CN->getSignExtended()); + if (offset > SPUFrameInfo::minFrameOffset() + && offset < SPUFrameInfo::maxFrameOffset()) { + Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); + Index = Op0; + return true; + } + } else if (Op0.getOpcode() == ISD::Constant + || Op0.getOpcode() == ISD::TargetConstant) { + ConstantSDNode *CN = cast(Op0); + int32_t offset = int32_t(CN->getSignExtended()); + if (offset > SPUFrameInfo::minFrameOffset() + && offset < SPUFrameInfo::maxFrameOffset()) { + Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); + Index = Op1; + return true; + } + } else if (Op0.getOpcode() == SPUISD::Hi + && Op1.getOpcode() == SPUISD::Lo) { + // (SPUindirect (SPUhi , 0), (SPUlo , 0)) Base = CurDAG->getTargetConstant(0, PtrTy); - Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); + Index = N; return true; } - } else if (Opc == SPUISD::LDRESULT) { - // It's a load result dereference - Base = CurDAG->getTargetConstant(0, PtrTy); - Index = N.getOperand(0); + } else if (Opc == SPUISD::AFormAddr) { + Base = CurDAG->getTargetConstant(0, N.getValueType()); + Index = N; return true; } - return false; } @@ -565,108 +589,10 @@ || SelectDFormAddr(Op, N, Base, Index)) return false; - unsigned Opc = N.getOpcode(); - - if (Opc == ISD::ADD) { - SDOperand N1 = N.getOperand(0); - SDOperand N2 = N.getOperand(1); - Base = N.getOperand(0); - Index = N.getOperand(1); - return true; - } else if (Opc == SPUISD::XFormAddr) { - Base = N; - Index = N.getOperand(1); - return true; - } else if (Opc == SPUISD::DFormAddr) { - // Must be a D-form address with an X-form address embedded - // within: - Base = N.getOperand(0); - Index = N.getOperand(1); - return true; - } else if (N.getNumOperands() == 2) { - SDOperand N1 = N.getOperand(0); - SDOperand N2 = N.getOperand(1); - unsigned N1Opc = N1.getOpcode(); - unsigned N2Opc = N2.getOpcode(); - - if ((N1Opc == ISD::CopyToReg || N1Opc == ISD::Register) - && (N2Opc == ISD::CopyToReg || N2Opc == ISD::Register)) { - Base = N.getOperand(0); - Index = N.getOperand(1); - return true; - /*UNREACHED*/ - } else { - cerr << "SelectXFormAddr: 2-operand unhandled operand:\n"; - N.Val->dump(CurDAG); - cerr << "\n"; - abort(); - /*UNREACHED*/ - } - } else { - cerr << "SelectXFormAddr: Unhandled operand type:\n"; - N.Val->dump(CurDAG); - cerr << "\n"; - abort(); - /*UNREACHED*/ - } - - return false; -} - -//! Emit load for A-form addresses -/* - */ -SDNode * -Emit_LOAD_AFormAddr(SDOperand Op, SelectionDAG &CurDAG, SPUDAGToDAGISel &ISel) -{ - SDNode *Result; - MVT::ValueType OpVT = Op.getValueType(); - SDOperand Chain = Op.getOperand(0); - SDOperand Ptr = Op.getOperand(1); - SDOperand PtrArg = Ptr.getOperand(0); - SDOperand PtrOffs = Ptr.getOperand(1); - const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); - - if (PtrOffs.getOpcode() == ISD::Constant) { - ConstantSDNode *CN = cast(PtrOffs); - MVT::ValueType PVT = PtrOffs.getValueType(); - PtrOffs = CurDAG.getTargetConstant(CN->getValue(), PVT); - } - ISel.AddToISelQueue(PtrArg); - ISel.AddToISelQueue(PtrOffs); - ISel.AddToISelQueue(Chain); - Result = CurDAG.getTargetNode(vtm->load_aform, OpVT, MVT::Other, PtrArg, PtrOffs, Chain); - Chain = SDOperand(Result, 1); - return Result; -} - -//! Emit store for A-form addresses -/* - */ -SDNode * -Emit_STORE_AFormAddr(SDOperand Op, SelectionDAG &CurDAG, SPUDAGToDAGISel &ISel) -{ - SDNode *Result; - SDOperand Chain = Op.getOperand(0); - SDOperand Val = Op.getOperand(1); - SDOperand Ptr = Op.getOperand(2); - SDOperand PtrArg = Ptr.getOperand(0); - SDOperand PtrOffs = Ptr.getOperand(1); - const valtype_map_s *vtm = getValueTypeMapEntry(Val.getValueType()); - - if (PtrOffs.getOpcode() == ISD::Constant) { - ConstantSDNode *CN = cast(PtrOffs); - MVT::ValueType PVT = PtrOffs.getValueType(); - PtrOffs = CurDAG.getTargetConstant(CN->getValue(), PVT); - } - ISel.AddToISelQueue(Val); - ISel.AddToISelQueue(PtrArg); - ISel.AddToISelQueue(PtrOffs); - ISel.AddToISelQueue(Chain); - SDOperand Ops[4] = { Val, PtrArg, PtrOffs, Chain }; - Result = CurDAG.getTargetNode(vtm->store_aform, MVT::Other, Ops, 4); - Chain = SDOperand(Result, 1); - return Result; + // All else fails, punt and use an X-form address: + Base = N.getOperand(0); + Index = N.getOperand(1); + return true; } //! Convert the operand from a target-independent to a target-specific node @@ -695,12 +621,6 @@ Ops[0] = TFI; Ops[1] = Zero; n_ops = 2; - } else if (Opc == ISD::LOAD - && Op.getOperand(1).getOpcode() == SPUISD::AFormAddr) { - return Emit_LOAD_AFormAddr(Op, *CurDAG, *this); - } else if (Opc == ISD::STORE - && Op.getOperand(2).getOpcode() == SPUISD::AFormAddr) { - return Emit_STORE_AFormAddr(Op, *CurDAG, *this); } else if (Opc == ISD::ZERO_EXTEND) { // (zero_extend:i16 (and:i8 , )) const SDOperand &Op1 = N->getOperand(0); @@ -717,6 +637,38 @@ n_ops = 2; } } + } else if (Opc == SPUISD::INSERT_MASK) { + SDOperand Op0 = Op.getOperand(0); + if (Op0.getOpcode() == SPUISD::AFormAddr) { + // (SPUvecinsmask (SPUaform , 0)) -> + // (CBD|CHD|CWD 0, arg) + const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); + ConstantSDNode *CN = cast(Op0.getOperand(1)); + assert(vtm->insmask_ins != 0 && "missing insert mask instruction"); + NewOpc = vtm->insmask_ins; + Ops[0] = CurDAG->getTargetConstant(CN->getValue(), Op0.getValueType()); + Ops[1] = Op0; + n_ops = 2; + + AddToISelQueue(Op0); + } else if (Op0.getOpcode() == ISD::FrameIndex) { + // (SPUvecinsmask ) -> + // (CBD|CHD|CWD 0, ) + const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); + NewOpc = vtm->insmask_ins; + Ops[0] = CurDAG->getTargetConstant(0, Op0.getValueType()); + Ops[1] = Op0; + n_ops = 2; + } else if (isHighLow(Op0)) { + // (SPUvecinsmask (SPUindirect (SPUhi , 0), (SPUlow , 0))) -> + // (CBD|CHD|CWD 0, arg) + const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); + NewOpc = vtm->insmask_ins; + Ops[0] = CurDAG->getTargetConstant(0, Op0.getValueType()); + Ops[1] = Op0; + n_ops = 2; + AddToISelQueue(Op0); + } } else if (Opc == SPUISD::LDRESULT) { // Custom select instructions for LDRESULT unsigned VT = N->getValueType(0); @@ -748,19 +700,19 @@ AddToISelQueue(Chain); return Result; - } else if (Opc == SPUISD::XFormAddr) { + } else if (Opc == SPUISD::IndirectAddr) { SDOperand Op0 = Op.getOperand(0); if (Op0.getOpcode() == SPUISD::LDRESULT || Op0.getOpcode() == SPUISD::AFormAddr) { - // (XFormAddr (LDRESULT|AFormAddr, imm)) + // (IndirectAddr (LDRESULT|AFormAddr, imm)) SDOperand Op1 = Op.getOperand(1); MVT::ValueType VT = Op.getValueType(); - DEBUG(cerr << "CellSPU: XFormAddr(" - << (Op0.getOpcode() == SPUISD::LDRESULT - ? "LDRESULT" - : "AFormAddr") - << ", imm):\nOp0 = "); + DEBUG(cerr << "CellSPU: IndirectAddr(" + << (Op0.getOpcode() == SPUISD::LDRESULT + ? "LDRESULT" + : "AFormAddr") + << ", imm):\nOp0 = "); DEBUG(Op.getOperand(0).Val->dump(CurDAG)); DEBUG(cerr << "\nOp1 = "); DEBUG(Op.getOperand(1).Val->dump(CurDAG)); Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jan 28 20:16:57 2008 @@ -289,14 +289,12 @@ // We want to legalize GlobalAddress and ConstantPool nodes into the // appropriate instructions to materialize the address. - setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); - setOperationAction(ISD::ConstantPool, MVT::i32, Custom); - setOperationAction(ISD::ConstantPool, MVT::f32, Custom); - setOperationAction(ISD::JumpTable, MVT::i32, Custom); - setOperationAction(ISD::GlobalAddress, MVT::i64, Custom); - setOperationAction(ISD::ConstantPool, MVT::i64, Custom); - setOperationAction(ISD::ConstantPool, MVT::f64, Custom); - setOperationAction(ISD::JumpTable, MVT::i64, Custom); + for (unsigned sctype = (unsigned) MVT::i1; sctype < (unsigned) MVT::f128; + ++sctype) { + setOperationAction(ISD::GlobalAddress, sctype, Custom); + setOperationAction(ISD::ConstantPool, sctype, Custom); + setOperationAction(ISD::JumpTable, sctype, Custom); + } // RET must be custom lowered, to meet ABI requirements setOperationAction(ISD::RET, MVT::Other, Custom); @@ -377,7 +375,7 @@ setStackPointerRegisterToSaveRestore(SPU::R1); // We have target-specific dag combine patterns for the following nodes: - // e.g., setTargetDAGCombine(ISD::SUB); + setTargetDAGCombine(ISD::ADD); computeRegisterProperties(); } @@ -391,8 +389,7 @@ node_names[(unsigned) SPUISD::Lo] = "SPUISD::Lo"; node_names[(unsigned) SPUISD::PCRelAddr] = "SPUISD::PCRelAddr"; node_names[(unsigned) SPUISD::AFormAddr] = "SPUISD::AFormAddr"; - node_names[(unsigned) SPUISD::DFormAddr] = "SPUISD::DFormAddr"; - node_names[(unsigned) SPUISD::XFormAddr] = "SPUISD::XFormAddr"; + node_names[(unsigned) SPUISD::IndirectAddr] = "SPUISD::IndirectAddr"; node_names[(unsigned) SPUISD::LDRESULT] = "SPUISD::LDRESULT"; node_names[(unsigned) SPUISD::CALL] = "SPUISD::CALL"; node_names[(unsigned) SPUISD::SHUFB] = "SPUISD::SHUFB"; @@ -524,11 +521,12 @@ // Unaligned load or we're using the "large memory" model, which means that // we have to be very pessimistic: if (isMemoryOperand(basePtr) || isIndirectOperand(basePtr)) { - basePtr = DAG.getNode(SPUISD::XFormAddr, PtrVT, basePtr, DAG.getConstant(0, PtrVT)); + basePtr = DAG.getNode(SPUISD::IndirectAddr, PtrVT, basePtr, DAG.getConstant(0, PtrVT)); } // Add the offset - basePtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, DAG.getConstant(alignOffs, PtrVT)); + basePtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, + DAG.getConstant((alignOffs & ~0xf), PtrVT)); was16aligned = false; return DAG.getLoad(MVT::v16i8, chain, basePtr, LSN->getSrcValue(), LSN->getSrcValueOffset(), @@ -706,21 +704,20 @@ DEBUG(basePtr.Val->dump(&DAG)); DEBUG(cerr << "\n"); - if (basePtr.getOpcode() == SPUISD::DFormAddr) { - // Hmmmm... do we ever actually hit this code? - insertEltPtr = DAG.getNode(SPUISD::DFormAddr, PtrVT, - basePtr.getOperand(0), - insertEltOffs); - } else if (basePtr.getOpcode() == SPUISD::XFormAddr || - (basePtr.getOpcode() == ISD::ADD - && basePtr.getOperand(0).getOpcode() == SPUISD::XFormAddr)) { + if (basePtr.getOpcode() == SPUISD::IndirectAddr || + (basePtr.getOpcode() == ISD::ADD + && basePtr.getOperand(0).getOpcode() == SPUISD::IndirectAddr)) { insertEltPtr = basePtr; } else { - // $sp is always aligned, so use it instead of potentially loading an - // address into a new register: - insertEltPtr = DAG.getNode(SPUISD::DFormAddr, PtrVT, - DAG.getRegister(SPU::R1, PtrVT), - insertEltOffs); +#if 0 + // $sp is always aligned, so use it when necessary to avoid loading + // an address + SDOperand ptrP = + basePtr.Val->hasOneUse() ? DAG.getRegister(SPU::R1, PtrVT) : basePtr; + insertEltPtr = DAG.getNode(ISD::ADD, PtrVT, ptrP, insertEltOffs); +#else + insertEltPtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, insertEltOffs); +#endif } insertEltOp = DAG.getNode(SPUISD::INSERT_MASK, stVecVT, insertEltPtr); @@ -772,7 +769,7 @@ return DAG.getNode(ISD::ADD, PtrVT, Lo, Hi); #else - return DAG.getNode(SPUISD::XFormAddr, PtrVT, CPI, Zero); + return DAG.getNode(SPUISD::IndirectAddr, PtrVT, CPI, Zero); #endif } } @@ -791,9 +788,10 @@ const TargetMachine &TM = DAG.getTarget(); if (TM.getRelocationModel() == Reloc::Static) { + SDOperand JmpAForm = DAG.getNode(SPUISD::AFormAddr, PtrVT, JTI, Zero); return (!ST->usingLargeMem() - ? DAG.getNode(SPUISD::AFormAddr, PtrVT, JTI, Zero) - : DAG.getNode(SPUISD::XFormAddr, PtrVT, JTI, Zero)); + ? JmpAForm + : DAG.getNode(SPUISD::IndirectAddr, PtrVT, JmpAForm, Zero)); } assert(0 && @@ -811,9 +809,13 @@ SDOperand Zero = DAG.getConstant(0, PtrVT); if (TM.getRelocationModel() == Reloc::Static) { - return (!ST->usingLargeMem() - ? DAG.getNode(SPUISD::AFormAddr, PtrVT, GA, Zero) - : DAG.getNode(SPUISD::XFormAddr, PtrVT, GA, Zero)); + if (!ST->usingLargeMem()) { + return DAG.getNode(SPUISD::AFormAddr, PtrVT, GA, Zero); + } else { + SDOperand Hi = DAG.getNode(SPUISD::Hi, PtrVT, GA, Zero); + SDOperand Lo = DAG.getNode(SPUISD::Lo, PtrVT, GA, Zero); + return DAG.getNode(SPUISD::IndirectAddr, PtrVT, Hi, Lo); + } } else { cerr << "LowerGlobalAddress: Relocation model other than static not " << "supported.\n"; @@ -1202,7 +1204,7 @@ } else { // "Large memory" mode: Turn all calls into indirect calls with a X-form // address pairs: - Callee = DAG.getNode(SPUISD::XFormAddr, PtrVT, GA, Zero); + Callee = DAG.getNode(SPUISD::IndirectAddr, PtrVT, GA, Zero); } } else if (ExternalSymbolSDNode *S = dyn_cast(Callee)) Callee = DAG.getExternalSymbol(S->getSymbol(), Callee.getValueType()); @@ -2553,16 +2555,80 @@ { #if 0 TargetMachine &TM = getTargetMachine(); +#endif + const SPUSubtarget *ST = SPUTM.getSubtargetImpl(); SelectionDAG &DAG = DCI.DAG; SDOperand N0 = N->getOperand(0); // everything has at least one operand switch (N->getOpcode()) { default: break; - // Do something creative here for ISD nodes that can be coalesced in unique - // ways. + case SPUISD::IndirectAddr: { + if (!ST->usingLargeMem() && N0.getOpcode() == SPUISD::AFormAddr) { + ConstantSDNode *CN = cast(N->getOperand(1)); + if (CN->getValue() == 0) { + // (SPUindirect (SPUaform , 0), 0) -> + // (SPUaform , 0) + + DEBUG(cerr << "Replace: "); + DEBUG(N->dump(&DAG)); + DEBUG(cerr << "\nWith: "); + DEBUG(N0.Val->dump(&DAG)); + DEBUG(cerr << "\n"); + + return N0; + } + } + } + case ISD::ADD: { + SDOperand Op0 = N->getOperand(0); + SDOperand Op1 = N->getOperand(1); + + if ((Op1.getOpcode() == ISD::Constant + || Op1.getOpcode() == ISD::TargetConstant) + && Op0.getOpcode() == SPUISD::IndirectAddr) { + SDOperand Op01 = Op0.getOperand(1); + if (Op01.getOpcode() == ISD::Constant + || Op01.getOpcode() == ISD::TargetConstant) { + // (add , (SPUindirect , )) -> + // (SPUindirect , ) + ConstantSDNode *CN0 = cast(Op1); + ConstantSDNode *CN1 = cast(Op01); + SDOperand combinedConst = + DAG.getConstant(CN0->getValue() + CN1->getValue(), + Op0.getValueType()); + + DEBUG(cerr << "Replace: (add " << CN0->getValue() << ", " + << "(SPUindirect , " << CN1->getValue() << "))\n"); + DEBUG(cerr << "With: (SPUindirect , " + << CN0->getValue() + CN1->getValue() << ")\n"); + return DAG.getNode(SPUISD::IndirectAddr, Op0.getValueType(), + Op0.getOperand(0), combinedConst); + } + } else if ((Op0.getOpcode() == ISD::Constant + || Op0.getOpcode() == ISD::TargetConstant) + && Op1.getOpcode() == SPUISD::IndirectAddr) { + SDOperand Op11 = Op1.getOperand(1); + if (Op11.getOpcode() == ISD::Constant + || Op11.getOpcode() == ISD::TargetConstant) { + // (add (SPUindirect , ), ) -> + // (SPUindirect , ) + ConstantSDNode *CN0 = cast(Op0); + ConstantSDNode *CN1 = cast(Op11); + SDOperand combinedConst = + DAG.getConstant(CN0->getValue() + CN1->getValue(), + Op0.getValueType()); + + DEBUG(cerr << "Replace: (add " << CN0->getValue() << ", " + << "(SPUindirect , " << CN1->getValue() << "))\n"); + DEBUG(cerr << "With: (SPUindirect , " + << CN0->getValue() + CN1->getValue() << ")\n"); + + return DAG.getNode(SPUISD::IndirectAddr, Op1.getValueType(), + Op1.getOperand(0), combinedConst); + } + } + } } -#endif - // Otherwise, return unchanged. return SDOperand(); } Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h Mon Jan 28 20:16:57 2008 @@ -32,8 +32,7 @@ Lo, ///< Low address component (lower 16) PCRelAddr, ///< Program counter relative address AFormAddr, ///< A-form address (local store) - DFormAddr, ///< D-Form address "imm($r)" - XFormAddr, ///< X-Form address "$r($r)" + IndirectAddr, ///< D-Form "imm($r)" and X-form "$r($r)" LDRESULT, ///< Load result (value, chain) CALL, ///< CALL instruction Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td Mon Jan 28 20:16:57 2008 @@ -247,6 +247,10 @@ { } } +//===----------------------------------------------------------------------===// +// Specialized versions of RI16: +//===----------------------------------------------------------------------===// + // RI18 Format class RI18Form opcode, dag OOL, dag IOL, string asmstr, InstrItinClass itin, list pattern> Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Mon Jan 28 20:16:57 2008 @@ -48,205 +48,109 @@ //===----------------------------------------------------------------------===// let isSimpleLoad = 1 in { - def LQDv16i8: - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set (v16i8 VECREG:$rT), (load dform_addr:$src))]>; - - def LQDv8i16: - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set (v8i16 VECREG:$rT), (load dform_addr:$src))]>; - - def LQDv4i32: - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set (v4i32 VECREG:$rT), (load dform_addr:$src))]>; - - def LQDv2i64: - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set (v2i64 VECREG:$rT), (load dform_addr:$src))]>; - - def LQDv4f32: - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set (v4f32 VECREG:$rT), (load dform_addr:$src))]>; - - def LQDv2f64: - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set (v2f64 VECREG:$rT), (load dform_addr:$src))]>; - - def LQDr128: - RI10Form<0b00101100, (outs GPRC:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set GPRC:$rT, (load dform_addr:$src))]>; - - def LQDr64: - RI10Form<0b00101100, (outs R64C:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set R64C:$rT, (load dform_addr:$src))]>; - - def LQDr32: - RI10Form<0b00101100, (outs R32C:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set R32C:$rT, (load dform_addr:$src))]>; - - // Floating Point - def LQDf32: - RI10Form<0b00101100, (outs R32FP:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set R32FP:$rT, (load dform_addr:$src))]>; - - def LQDf64: - RI10Form<0b00101100, (outs R64FP:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set R64FP:$rT, (load dform_addr:$src))]>; - // END Floating Point - - def LQDr16: - RI10Form<0b00101100, (outs R16C:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set R16C:$rT, (load dform_addr:$src))]>; - - def LQDr8: - RI10Form<0b00101100, (outs R8C:$rT), (ins memri10:$src), - "lqd\t$rT, $src", LoadStore, - [(set R8C:$rT, (load dform_addr:$src))]>; - - def LQAv16i8: - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set (v16i8 VECREG:$rT), (load aform_addr:$src))]>; - - def LQAv8i16: - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set (v8i16 VECREG:$rT), (load aform_addr:$src))]>; - - def LQAv4i32: - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set (v4i32 VECREG:$rT), (load aform_addr:$src))]>; - - def LQAv2i64: - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set (v2i64 VECREG:$rT), (load aform_addr:$src))]>; - - def LQAv4f32: - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set (v4f32 VECREG:$rT), (load aform_addr:$src))]>; - - def LQAv2f64: - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set (v2f64 VECREG:$rT), (load aform_addr:$src))]>; - - def LQAr128: - RI16Form<0b100001100, (outs GPRC:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set GPRC:$rT, (load aform_addr:$src))]>; - - def LQAr64: - RI16Form<0b100001100, (outs R64C:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set R64C:$rT, (load aform_addr:$src))]>; - - def LQAr32: - RI16Form<0b100001100, (outs R32C:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set R32C:$rT, (load aform_addr:$src))]>; - - def LQAf32: - RI16Form<0b100001100, (outs R32FP:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set R32FP:$rT, (load aform_addr:$src))]>; - - def LQAf64: - RI16Form<0b100001100, (outs R64FP:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set R64FP:$rT, (load aform_addr:$src))]>; - - def LQAr16: - RI16Form<0b100001100, (outs R16C:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set R16C:$rT, (load aform_addr:$src))]>; - - def LQAr8: - RI16Form<0b100001100, (outs R8C:$rT), (ins addr256k:$src), - "lqa\t$rT, $src", LoadStore, - [(set R8C:$rT, (load aform_addr:$src))]>; - - def LQXv16i8: - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set (v16i8 VECREG:$rT), (load xform_addr:$src))]>; - - def LQXv8i16: - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set (v8i16 VECREG:$rT), (load xform_addr:$src))]>; - - def LQXv4i32: - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set (v4i32 VECREG:$rT), (load xform_addr:$src))]>; - - def LQXv2i64: - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set (v2i64 VECREG:$rT), (load xform_addr:$src))]>; - - def LQXv4f32: - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set (v4f32 VECREG:$rT), (load xform_addr:$src))]>; - - def LQXv2f64: - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set (v2f64 VECREG:$rT), (load xform_addr:$src))]>; - - def LQXr128: - RRForm<0b00100011100, (outs GPRC:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set GPRC:$rT, (load xform_addr:$src))]>; - - def LQXr64: - RRForm<0b00100011100, (outs R64C:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set R64C:$rT, (load xform_addr:$src))]>; - - def LQXr32: - RRForm<0b00100011100, (outs R32C:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set R32C:$rT, (load xform_addr:$src))]>; - - def LQXf32: - RRForm<0b00100011100, (outs R32FP:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set R32FP:$rT, (load xform_addr:$src))]>; - - def LQXf64: - RRForm<0b00100011100, (outs R64FP:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set R64FP:$rT, (load xform_addr:$src))]>; - - def LQXr16: - RRForm<0b00100011100, (outs R16C:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set R16C:$rT, (load xform_addr:$src))]>; - - def LQXr8: - RRForm<0b00100011100, (outs R8C:$rT), (ins memrr:$src), - "lqx\t$rT, $src", LoadStore, - [(set R8C:$rT, (load xform_addr:$src))]>; + class LoadDFormVec + : RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), + "lqd\t$rT, $src", + LoadStore, + [(set (vectype VECREG:$rT), (load dform_addr:$src))]> + { } + + class LoadDForm + : RI10Form<0b00101100, (outs rclass:$rT), (ins memri10:$src), + "lqd\t$rT, $src", + LoadStore, + [(set rclass:$rT, (load dform_addr:$src))]> + { } + + multiclass LoadDForms + { + def v16i8: LoadDFormVec; + def v8i16: LoadDFormVec; + def v4i32: LoadDFormVec; + def v2i64: LoadDFormVec; + def v4f32: LoadDFormVec; + def v2f64: LoadDFormVec; + + def r128: LoadDForm; + def r64: LoadDForm; + def r32: LoadDForm; + def f32: LoadDForm; + def f64: LoadDForm; + def r16: LoadDForm; + def r8: LoadDForm; + } + + class LoadAFormVec + : RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), + "lqa\t$rT, $src", + LoadStore, + [(set (vectype VECREG:$rT), (load aform_addr:$src))]> + { } + + class LoadAForm + : RI16Form<0b100001100, (outs rclass:$rT), (ins addr256k:$src), + "lqa\t$rT, $src", + LoadStore, + [(set rclass:$rT, (load aform_addr:$src))]> + { } + + multiclass LoadAForms + { + def v16i8: LoadAFormVec; + def v8i16: LoadAFormVec; + def v4i32: LoadAFormVec; + def v2i64: LoadAFormVec; + def v4f32: LoadAFormVec; + def v2f64: LoadAFormVec; + + def r128: LoadAForm; + def r64: LoadAForm; + def r32: LoadAForm; + def f32: LoadAForm; + def f64: LoadAForm; + def r16: LoadAForm; + def r8: LoadAForm; + } + + class LoadXFormVec + : RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), + "lqx\t$rT, $src", + LoadStore, + [(set (vectype VECREG:$rT), (load xform_addr:$src))]> + { } + + class LoadXForm + : RRForm<0b00100011100, (outs rclass:$rT), (ins memrr:$src), + "lqx\t$rT, $src", + LoadStore, + [(set rclass:$rT, (load xform_addr:$src))]> + { } + + multiclass LoadXForms + { + def v16i8: LoadXFormVec; + def v8i16: LoadXFormVec; + def v4i32: LoadXFormVec; + def v2i64: LoadXFormVec; + def v4f32: LoadXFormVec; + def v2f64: LoadXFormVec; + + def r128: LoadXForm; + def r64: LoadXForm; + def r32: LoadXForm; + def f32: LoadXForm; + def f64: LoadXForm; + def r16: LoadXForm; + def r8: LoadXForm; + } + + defm LQA : LoadAForms; + defm LQD : LoadDForms; + defm LQX : LoadXForms; /* Load quadword, PC relative: Not much use at this point in time. - Might be of use later for relocatable code. + Might be of use later for relocatable code. It's effectively the + same as LQA, but uses PC-relative addressing. def LQR : RI16Form<0b111001100, (outs VECREG:$rT), (ins s16imm:$disp), "lqr\t$rT, $disp", LoadStore, [(set VECREG:$rT, (load iaddr:$disp))]>; @@ -256,174 +160,108 @@ //===----------------------------------------------------------------------===// // Stores: //===----------------------------------------------------------------------===// +class StoreDFormVec + : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), + "stqd\t$rT, $src", + LoadStore, + [(store (vectype VECREG:$rT), dform_addr:$src)]> +{ } + +class StoreDForm + : RI10Form<0b00100100, (outs), (ins rclass:$rT, memri10:$src), + "stqd\t$rT, $src", + LoadStore, + [(store rclass:$rT, dform_addr:$src)]> +{ } + +multiclass StoreDForms +{ + def v16i8: StoreDFormVec; + def v8i16: StoreDFormVec; + def v4i32: StoreDFormVec; + def v2i64: StoreDFormVec; + def v4f32: StoreDFormVec; + def v2f64: StoreDFormVec; + + def r128: StoreDForm; + def r64: StoreDForm; + def r32: StoreDForm; + def f32: StoreDForm; + def f64: StoreDForm; + def r16: StoreDForm; + def r8: StoreDForm; +} + +class StoreAFormVec + : RI16Form<0b0010010, (outs), (ins VECREG:$rT, addr256k:$src), + "stqa\t$rT, $src", + LoadStore, + [(store (vectype VECREG:$rT), aform_addr:$src)]> +{ } + +class StoreAForm + : RI16Form<0b001001, (outs), (ins rclass:$rT, addr256k:$src), + "stqa\t$rT, $src", + LoadStore, + [(store rclass:$rT, aform_addr:$src)]> +{ } + +multiclass StoreAForms +{ + def v16i8: StoreAFormVec; + def v8i16: StoreAFormVec; + def v4i32: StoreAFormVec; + def v2i64: StoreAFormVec; + def v4f32: StoreAFormVec; + def v2f64: StoreAFormVec; + + def r128: StoreAForm; + def r64: StoreAForm; + def r32: StoreAForm; + def f32: StoreAForm; + def f64: StoreAForm; + def r16: StoreAForm; + def r8: StoreAForm; +} + +class StoreXFormVec + : RRForm<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), + "stqx\t$rT, $src", + LoadStore, + [(store (vectype VECREG:$rT), xform_addr:$src)]> +{ } + +class StoreXForm + : RRForm<0b00100100, (outs), (ins rclass:$rT, memrr:$src), + "stqx\t$rT, $src", + LoadStore, + [(store rclass:$rT, xform_addr:$src)]> +{ } + +multiclass StoreXForms +{ + def v16i8: StoreXFormVec; + def v8i16: StoreXFormVec; + def v4i32: StoreXFormVec; + def v2i64: StoreXFormVec; + def v4f32: StoreXFormVec; + def v2f64: StoreXFormVec; + + def r128: StoreXForm; + def r64: StoreXForm; + def r32: StoreXForm; + def f32: StoreXForm; + def f64: StoreXForm; + def r16: StoreXForm; + def r8: StoreXForm; +} -def STQDv16i8 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store (v16i8 VECREG:$rT), dform_addr:$src)]>; - -def STQDv8i16 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store (v8i16 VECREG:$rT), dform_addr:$src)]>; - -def STQDv4i32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store (v4i32 VECREG:$rT), dform_addr:$src)]>; - -def STQDv2i64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store (v2i64 VECREG:$rT), dform_addr:$src)]>; - -def STQDv4f32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store (v4f32 VECREG:$rT), dform_addr:$src)]>; - -def STQDv2f64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store (v2f64 VECREG:$rT), dform_addr:$src)]>; - -def STQDr128 : RI10Form<0b00100100, (outs), (ins GPRC:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store GPRC:$rT, dform_addr:$src)]>; - -def STQDr64 : RI10Form<0b00100100, (outs), (ins R64C:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store R64C:$rT, dform_addr:$src)]>; - -def STQDr32 : RI10Form<0b00100100, (outs), (ins R32C:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store R32C:$rT, dform_addr:$src)]>; - -// Floating Point -def STQDf32 : RI10Form<0b00100100, (outs), (ins R32FP:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store R32FP:$rT, dform_addr:$src)]>; - -def STQDf64 : RI10Form<0b00100100, (outs), (ins R64FP:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store R64FP:$rT, dform_addr:$src)]>; - -def STQDr16 : RI10Form<0b00100100, (outs), (ins R16C:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store R16C:$rT, dform_addr:$src)]>; - -def STQDr8 : RI10Form<0b00100100, (outs), (ins R8C:$rT, memri10:$src), - "stqd\t$rT, $src", LoadStore, - [(store R8C:$rT, dform_addr:$src)]>; - -def STQAv16i8 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store (v16i8 VECREG:$rT), aform_addr:$src)]>; - -def STQAv8i16 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store (v8i16 VECREG:$rT), aform_addr:$src)]>; - -def STQAv4i32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store (v4i32 VECREG:$rT), aform_addr:$src)]>; - -def STQAv2i64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store (v2i64 VECREG:$rT), aform_addr:$src)]>; - -def STQAv4f32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store (v4f32 VECREG:$rT), aform_addr:$src)]>; - -def STQAv2f64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store (v2f64 VECREG:$rT), aform_addr:$src)]>; - -def STQAr128 : RI10Form<0b00100100, (outs), (ins GPRC:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store GPRC:$rT, aform_addr:$src)]>; - -def STQAr64 : RI10Form<0b00100100, (outs), (ins R64C:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store R64C:$rT, aform_addr:$src)]>; - -def STQAr32 : RI10Form<0b00100100, (outs), (ins R32C:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store R32C:$rT, aform_addr:$src)]>; - -// Floating Point -def STQAf32 : RI10Form<0b00100100, (outs), (ins R32FP:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store R32FP:$rT, aform_addr:$src)]>; - -def STQAf64 : RI10Form<0b00100100, (outs), (ins R64FP:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store R64FP:$rT, aform_addr:$src)]>; - -def STQAr16 : RI10Form<0b00100100, (outs), (ins R16C:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store R16C:$rT, aform_addr:$src)]>; - -def STQAr8 : RI10Form<0b00100100, (outs), (ins R8C:$rT, addr256k:$src), - "stqa\t$rT, $src", LoadStore, - [(store R8C:$rT, aform_addr:$src)]>; - -def STQXv16i8 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store (v16i8 VECREG:$rT), xform_addr:$src)]>; - -def STQXv8i16 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store (v8i16 VECREG:$rT), xform_addr:$src)]>; - -def STQXv4i32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store (v4i32 VECREG:$rT), xform_addr:$src)]>; - -def STQXv2i64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store (v2i64 VECREG:$rT), xform_addr:$src)]>; - -def STQXv4f32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store (v4f32 VECREG:$rT), xform_addr:$src)]>; - -def STQXv2f64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store (v2f64 VECREG:$rT), xform_addr:$src)]>; - -def STQXr128 : RI10Form<0b00100100, (outs), (ins GPRC:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store GPRC:$rT, xform_addr:$src)]>; - -def STQXr64: - RI10Form<0b00100100, (outs), (ins R64C:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store R64C:$rT, xform_addr:$src)]>; - -def STQXr32: - RI10Form<0b00100100, (outs), (ins R32C:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store R32C:$rT, xform_addr:$src)]>; - -// Floating Point -def STQXf32: - RI10Form<0b00100100, (outs), (ins R32FP:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store R32FP:$rT, xform_addr:$src)]>; - -def STQXf64: - RI10Form<0b00100100, (outs), (ins R64FP:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store R64FP:$rT, xform_addr:$src)]>; - -def STQXr16: - RI10Form<0b00100100, (outs), (ins R16C:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store R16C:$rT, xform_addr:$src)]>; - -def STQXr8: - RI10Form<0b00100100, (outs), (ins R8C:$rT, memrr:$src), - "stqx\t$rT, $src", LoadStore, - [(store R8C:$rT, xform_addr:$src)]>; +defm STQD : StoreDForms; +defm STQA : StoreAForms; +defm STQX : StoreXForms; /* Store quadword, PC relative: Not much use at this point in time. Might - be useful for relocatable code. + be useful for relocatable code. def STQR : RI16Form<0b111000100, (outs), (ins VECREG:$rT, s16imm:$disp), "stqr\t$rT, $disp", LoadStore, [(store VECREG:$rT, iaddr:$disp)]>; @@ -620,17 +458,22 @@ // Form select mask for bytes using immediate, used in conjunction with the // SELB instruction: -def FSMBIv16i8 : RI16Form<0b101001100, (outs VECREG:$rT), (ins u16imm:$val), - "fsmbi\t$rT, $val", SelectOp, - [(set (v16i8 VECREG:$rT), (SPUfsmbi_v16i8 immU16:$val))]>; - -def FSMBIv8i16 : RI16Form<0b101001100, (outs VECREG:$rT), (ins u16imm:$val), - "fsmbi\t$rT, $val", SelectOp, - [(set (v8i16 VECREG:$rT), (SPUfsmbi_v8i16 immU16:$val))]>; - -def FSMBIvecv4i32 : RI16Form<0b101001100, (outs VECREG:$rT), (ins u16imm:$val), - "fsmbi\t$rT, $val", SelectOp, - [(set (v4i32 VECREG:$rT), (SPUfsmbi_v4i32 immU16:$val))]>; +class FSMBIVec + : RI16Form<0b101001100, (outs VECREG:$rT), (ins u16imm:$val), + "fsmbi\t$rT, $val", + SelectOp, + [(set (vectype VECREG:$rT), (SPUfsmbi immU16:$val))]> +{ } + +multiclass FSMBIs +{ + def v16i8: FSMBIVec; + def v8i16: FSMBIVec; + def v4i32: FSMBIVec; + def v2i64: FSMBIVec; +} + +defm FSMBI : FSMBIs; //===----------------------------------------------------------------------===// // Integer and Logical Operations: @@ -2762,17 +2605,17 @@ def CEQr32: RRForm<0b00000011110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB), "ceq\t$rT, $rA, $rB", ByteOp, - [/* no pattern to match: intrinsic */]>; + [(set R32C:$rT, (seteq R32C:$rA, R32C:$rB))]>; def CEQv4i32: RRForm<0b00000011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG:$rB), "ceq\t$rT, $rA, $rB", ByteOp, - [/* no pattern to match: intrinsic */]>; + [(set (v4i32 VECREG:$rT), (seteq (v4i32 VECREG:$rA), (v4i32 VECREG:$rB)))]>; def CEQIr32: - RI10Form<0b00111110, (outs R32C:$rT), (ins R32C:$rA, s10imm:$val), + RI10Form<0b00111110, (outs R32C:$rT), (ins R32C:$rA, s10imm_i32:$val), "ceqi\t$rT, $rA, $val", ByteOp, - [/* no pattern to match: intrinsic */]>; + [(set R32C:$rT, (seteq R32C:$rA, i32ImmSExt10:$val))]>; def CEQIv4i32: RI10Form<0b00111110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm:$val), @@ -2872,18 +2715,29 @@ } //===----------------------------------------------------------------------===// -// brcond predicates: +// setcc and brcond patterns: //===----------------------------------------------------------------------===// + def : Pat<(brcond (i16 (seteq R16C:$rA, 0)), bb:$dest), (BRHZ R16C:$rA, bb:$dest)>; -def : Pat<(brcond (i16 (setne R16C:$rA, 0)), bb:$dest), - (BRHNZ R16C:$rA, bb:$dest)>; - def : Pat<(brcond (i32 (seteq R32C:$rA, 0)), bb:$dest), (BRZ R32C:$rA, bb:$dest)>; + +def : Pat<(brcond (i16 (setne R16C:$rA, 0)), bb:$dest), + (BRHNZ R16C:$rA, bb:$dest)>; def : Pat<(brcond (i32 (setne R32C:$rA, 0)), bb:$dest), (BRNZ R32C:$rA, bb:$dest)>; +def : Pat<(brcond (i16 (setne R16C:$rA, i16ImmSExt10:$val)), bb:$dest), + (BRHNZ (CEQHIr16 R16C:$rA, i16ImmSExt10:$val), bb:$dest)>; +def : Pat<(brcond (i32 (setne R32C:$rA, i32ImmSExt10:$val)), bb:$dest), + (BRNZ (CEQIr32 R32C:$rA, i32ImmSExt10:$val), bb:$dest)>; + +def : Pat<(brcond (i16 (setne R16C:$rA, R16C:$rB)), bb:$dest), + (BRHNZ (CEQHr16 R16C:$rA, R16:$rB), bb:$dest)>; +def : Pat<(brcond (i32 (setne R32C:$rA, R32C:$rB)), bb:$dest), + (BRNZ (CEQr32 R32C:$rA, R32C:$rB), bb:$dest)>; + let isTerminator = 1, isBarrier = 1 in { let isReturn = 1 in { def RET: @@ -3460,24 +3314,42 @@ (ORI2To4 R16C:$rSrc, 0)>; //===----------------------------------------------------------------------===// -// Address translation: SPU, like PPC, has to split addresses into high and +// Address generation: SPU, like PPC, has to split addresses into high and // low parts in order to load them into a register. //===----------------------------------------------------------------------===// -def : Pat<(SPUaform tglobaladdr:$in, 0), (ILAlsa tglobaladdr:$in)>; -def : Pat<(SPUxform tglobaladdr:$in, 0), +def : Pat<(SPUaform tglobaladdr:$in, 0), (ILAlsa tglobaladdr:$in)>; +def : Pat<(SPUaform texternalsym:$in, 0), (ILAlsa texternalsym:$in)>; +def : Pat<(SPUaform tjumptable:$in, 0), (ILAlsa tjumptable:$in)>; +def : Pat<(SPUaform tconstpool:$in, 0), (ILAlsa tconstpool:$in)>; + +def : Pat<(SPUindirect (SPUhi tglobaladdr:$in, 0), + (SPUlo tglobaladdr:$in, 0)), + (IOHLlo (ILHUhi tglobaladdr:$in), tglobaladdr:$in)>; + +def : Pat<(SPUindirect (SPUhi texternalsym:$in, 0), + (SPUlo texternalsym:$in, 0)), + (IOHLlo (ILHUhi texternalsym:$in), texternalsym:$in)>; + +def : Pat<(SPUindirect (SPUhi tjumptable:$in, 0), + (SPUlo tjumptable:$in, 0)), + (IOHLlo (ILHUhi tjumptable:$in), tjumptable:$in)>; + +def : Pat<(SPUindirect (SPUhi tconstpool:$in, 0), + (SPUlo tconstpool:$in, 0)), + (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>; + +def : Pat<(add (SPUhi tglobaladdr:$in, 0), (SPUlo tglobaladdr:$in, 0)), (IOHLlo (ILHUhi tglobaladdr:$in), tglobaladdr:$in)>; -def : Pat<(SPUaform tjumptable:$in, 0), (ILAlsa tjumptable:$in)>; -def : Pat<(SPUxform tjumptable:$in, 0), +def : Pat<(add (SPUhi texternalsym:$in, 0), (SPUlo texternalsym:$in, 0)), + (IOHLlo (ILHUhi texternalsym:$in), texternalsym:$in)>; + +def : Pat<(add (SPUhi tjumptable:$in, 0), (SPUlo tjumptable:$in, 0)), (IOHLlo (ILHUhi tjumptable:$in), tjumptable:$in)>; -def : Pat<(SPUhi tconstpool:$in , 0), (ILHUhi tconstpool:$in)>; -def : Pat<(SPUlo tconstpool:$in , 0), (ILAlsa tconstpool:$in)>; -def : Pat<(SPUaform tconstpool:$in, 0), (ILAlsa tconstpool:$in)>; -// tblgen bug prevents this from working. -// def : Pat<(SPUxform tconstpool:$in, 0), -// (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>; +def : Pat<(add (SPUhi tconstpool:$in, 0), (SPUlo tconstpool:$in, 0)), + (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>; // Instrinsics: include "CellSDKIntrinsics.td" Modified: llvm/trunk/lib/Target/CellSPU/SPUNodes.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUNodes.td?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUNodes.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUNodes.td Mon Jan 28 20:16:57 2008 @@ -58,14 +58,8 @@ // FSMBI type constraints: There are several variations for the various // vector types (this avoids having to bit_convert all over the place.) -def SPUfsmbi_type_v16i8: SDTypeProfile<1, 1, [ - SDTCisVT<0, v16i8>, SDTCisVT<1, i32>]>; - -def SPUfsmbi_type_v8i16: SDTypeProfile<1, 1, [ - SDTCisVT<0, v8i16>, SDTCisVT<1, i32>]>; - -def SPUfsmbi_type_v4i32: SDTypeProfile<1, 1, [ - SDTCisVT<0, v4i32>, SDTCisVT<1, i32>]>; +def SPUfsmbi_type: SDTypeProfile<1, 1, [ + SDTCisVT<1, i32>]>; // SELB type constraints: def SPUselb_type_v16i8: SDTypeProfile<1, 3, [ @@ -148,9 +142,7 @@ SPUvecshift_type_v16i8, [SDNPHasChain]>; // SPU form select mask for bytes, immediate -def SPUfsmbi_v16i8: SDNode<"SPUISD::FSMBI", SPUfsmbi_type_v16i8, []>; -def SPUfsmbi_v8i16: SDNode<"SPUISD::FSMBI", SPUfsmbi_type_v8i16, []>; -def SPUfsmbi_v4i32: SDNode<"SPUISD::FSMBI", SPUfsmbi_type_v4i32, []>; +def SPUfsmbi: SDNode<"SPUISD::FSMBI", SPUfsmbi_type, []>; // SPU select bits instruction def SPUselb_v16i8: SDNode<"SPUISD::SELB", SPUselb_type_v16i8, []>; @@ -189,11 +181,8 @@ // A-Form local store addresses def SPUaform : SDNode<"SPUISD::AFormAddr", SDTIntBinOp, []>; -// D-Form "imm($reg)" addresses -def SPUdform : SDNode<"SPUISD::DFormAddr", SDTIntBinOp, []>; - -// X-Form "$reg($reg)" addresses -def SPUxform : SDNode<"SPUISD::XFormAddr", SDTIntBinOp, []>; +// Indirect [D-Form "imm($reg)" and X-Form "$reg($reg)"] addresses +def SPUindirect : SDNode<"SPUISD::IndirectAddr", SDTIntBinOp, []>; // Load result node def SPUload_result : SDTypeProfile<1, 3, []>; Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp Mon Jan 28 20:16:57 2008 @@ -17,6 +17,7 @@ using namespace llvm; SPUTargetAsmInfo::SPUTargetAsmInfo(const SPUTargetMachine &TM) { + PCSymbol = "."; CommentString = "#"; GlobalPrefix = ""; PrivateGlobalPrefix = ".L"; @@ -24,17 +25,14 @@ SetDirective = "\t.set"; Data64bitsDirective = "\t.quad\t"; AlignmentIsInBytes = false; - SwitchToSectionDirective = "\t.section\t"; + SwitchToSectionDirective = ".section\t"; ConstantPoolSection = "\t.const\t"; JumpTableDataSection = ".const"; CStringSection = "\t.cstring"; - LCOMMDirective = "\t.lcomm\t"; StaticCtorsSection = ".mod_init_func"; StaticDtorsSection = ".mod_term_func"; FourByteConstantSection = ".const"; SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM\", at progbits,16"; - UsedDirective = "\t.no_dead_strip\t"; - WeakRefDirective = "\t.weak_reference\t"; InlineAsmStart = "# InlineAsm Start"; InlineAsmEnd = "# InlineAsm End"; Modified: llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll Mon Jan 28 20:16:57 2008 @@ -1,19 +1,18 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s -; RUN: grep bisl %t1.s | count 7 +; RUN: grep bisl %t1.s | count 7 ; RUN: grep ila %t1.s | count 1 ; RUN: grep rotqbyi %t1.s | count 4 -; RUN: grep lqa %t1.s | count 5 -; RUN: grep lqd %t1.s | count 6 -; RUN: grep dispatch_tab %t1.s | count 10 +; RUN: grep lqa %t1.s | count 1 +; RUN: grep lqd %t1.s | count 11 +; RUN: grep dispatch_tab %t1.s | count 6 ; RUN: grep bisl %t2.s | count 7 ; RUN: grep ilhu %t2.s | count 2 ; RUN: grep iohl %t2.s | count 2 ; RUN: grep rotqby %t2.s | count 6 -; RUN: grep lqd %t2.s | count 12 -; RUN: grep lqx %t2.s | count 8 -; RUN: grep il %t2.s | count 9 -; RUN: grep ai %t2.s | count 5 +; RUN: grep lqd %t2.s | count 17 +; RUN: grep il %t2.s | count 2 +; RUN: grep ai %t2.s | count 7 ; RUN: grep dispatch_tab %t2.s | count 7 ; ModuleID = 'call_indirect.bc' Modified: llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll Mon Jan 28 20:16:57 2008 @@ -2,7 +2,7 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s ; RUN: grep shufb %t1.s | count 27 ; RUN: grep lqa %t1.s | count 27 -; RUN: grep lqx %t2.s | count 27 +; RUN: grep lqd %t2.s | count 27 ; RUN: grep space %t1.s | count 8 ; RUN: grep byte %t1.s | count 424 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" Modified: llvm/trunk/test/CodeGen/CellSPU/fcmp.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/fcmp.ll?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/fcmp.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/fcmp.ll Mon Jan 28 20:16:57 2008 @@ -1,5 +1,5 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep fceq %t1.s | count 1 && +; RUN: grep fceq %t1.s | count 1 ; RUN: grep fcmeq %t1.s | count 1 ; ; This file includes standard floating point arithmetic instructions Modified: llvm/trunk/test/CodeGen/CellSPU/struct_1.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/struct_1.ll?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/struct_1.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/struct_1.ll Mon Jan 28 20:16:57 2008 @@ -1,27 +1,26 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s -; RUN: grep lqa %t1.s | count 10 -; RUN: grep lqd %t1.s | count 4 -; RUN: grep rotqbyi %t1.s | count 5 +; RUN: grep lqa %t1.s | count 5 +; RUN: grep lqd %t1.s | count 11 +; RUN: grep rotqbyi %t1.s | count 7 ; RUN: grep xshw %t1.s | count 1 -; RUN: grep andi %t1.s | count 4 +; RUN: grep andi %t1.s | count 5 ; RUN: grep cbd %t1.s | count 3 ; RUN: grep chd %t1.s | count 1 ; RUN: grep cwd %t1.s | count 3 ; RUN: grep shufb %t1.s | count 7 -; RUN: grep stqa %t1.s | count 5 -; RUN: grep iohl %t2.s | count 14 -; RUN: grep ilhu %t2.s | count 14 -; RUN: grep lqx %t2.s | count 14 -; RUN: grep rotqbyi %t2.s | count 5 +; RUN: grep stqd %t1.s | count 7 +; RUN: grep iohl %t2.s | count 16 +; RUN: grep ilhu %t2.s | count 16 +; RUN: grep lqd %t2.s | count 16 +; RUN: grep rotqbyi %t2.s | count 7 ; RUN: grep xshw %t2.s | count 1 -; RUN: grep andi %t2.s | count 4 -; RUN: grep cbx %t2.s | count 3 -; RUN: grep chx %t2.s | count 1 -; RUN: grep cwx %t2.s | count 1 -; RUN: grep cwd %t2.s | count 2 +; RUN: grep andi %t2.s | count 5 +; RUN: grep cbd %t2.s | count 3 +; RUN: grep chd %t2.s | count 1 +; RUN: grep cwd %t2.s | count 3 ; RUN: grep shufb %t2.s | count 7 -; RUN: grep stqx %t2.s | count 7 +; RUN: grep stqd %t2.s | count 7 ; ModuleID = 'struct_1.bc' target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" @@ -48,88 +47,98 @@ ; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } @state = global %struct.hackstate zeroinitializer, align 16 -define i8 @get_hackstate_c1() zeroext { +define i8 @get_hackstate_c1() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 + ret i8 %tmp2 } -define i8 @get_hackstate_c2() zeroext { +define i8 @get_hackstate_c2() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 + ret i8 %tmp2 } -define i8 @get_hackstate_c3() zeroext { +define i8 @get_hackstate_c3() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 + ret i8 %tmp2 } -define i32 @get_hackstate_i1() { +define i32 @get_hackstate_i1() nounwind { entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 - ret i32 %tmp2 + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 + ret i32 %tmp2 } -define i16 @get_hackstate_s1() signext { +define i16 @get_hackstate_s1() signext nounwind { entry: - %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 - ret i16 %tmp2 + %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 + ret i16 %tmp2 } -define i8 @get_hackstate_c7() zeroext { +define i8 @get_hackstate_c6() zeroext nounwind { entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 16 - ret i8 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 8), align 16 + ret i8 %tmp2 } -define i32 @get_hackstate_i6() zeroext { +define i8 @get_hackstate_c7() zeroext nounwind { entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 - ret i32 %tmp2 + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 16 + ret i8 %tmp2 } -define void @set_hackstate_c1(i8 zeroext %c) { +define i32 @get_hackstate_i3() nounwind { entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 - ret void + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16 + ret i32 %tmp2 } -define void @set_hackstate_c2(i8 zeroext %c) { +define i32 @get_hackstate_i6() nounwind { entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 - ret void + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 + ret i32 %tmp2 } -define void @set_hackstate_c3(i8 zeroext %c) { +define void @set_hackstate_c1(i8 zeroext %c) nounwind { entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 - ret void + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 16 + ret void } -define void @set_hackstate_i1(i32 %i) { +define void @set_hackstate_c2(i8 zeroext %c) nounwind { entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 - ret void + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 16 + ret void } -define void @set_hackstate_s1(i16 signext %s) { +define void @set_hackstate_c3(i8 zeroext %c) nounwind { entry: - store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 - ret void + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 16 + ret void } -define void @set_hackstate_i3(i32 %i) { +define void @set_hackstate_i1(i32 %i) nounwind { entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 11), align 16 - ret void + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 16 + ret void } +define void @set_hackstate_s1(i16 signext %s) nounwind { +entry: + store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 16 + ret void +} -define void @set_hackstate_i6(i32 %i) { +define void @set_hackstate_i3(i32 %i) nounwind { entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 - ret void + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 10), align 16 + ret void } +define void @set_hackstate_i6(i32 %i) nounwind { +entry: + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 16 + ret void +} Removed: llvm/trunk/test/CodeGen/CellSPU/struct_2.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/struct_2.ll?rev=46482&view=auto ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/struct_2.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/struct_2.ll (removed) @@ -1,122 +0,0 @@ -; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s -; RUN: grep lqx %t1.s | count 14 -; RUN: grep rotqby %t1.s | count 7 -; RUN: grep xshw %t1.s | count 1 -; RUN: grep andi %t1.s | count 4 -; RUN: grep cbx %t1.s | count 1 -; RUN: grep cbd %t1.s | count 2 -; RUN: grep chd %t1.s | count 1 -; RUN: grep cwd %t1.s | count 3 -; RUN: grep shufb %t1.s | count 7 -; RUN: grep stqx %t1.s | count 7 - -; ModuleID = 'struct_1.bc' -target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" -target triple = "spu" - -; struct hackstate { -; unsigned char c1; // offset 0 (rotate left by 13 bytes to byte 3) -; unsigned char c2; // offset 1 (rotate left by 14 bytes to byte 3) -; unsigned char c3; // offset 2 (rotate left by 15 bytes to byte 3) -; int i1; // offset 4 (rotate left by 4 bytes to byte 0) -; short s1; // offset 8 (rotate left by 6 bytes to byte 2) -; int i2; // offset 12 [ignored] -; unsigned char c4; // offset 16 [ignored] -; unsigned char c5; // offset 17 [ignored] -; unsigned char c6; // offset 18 [ignored] -; unsigned char c7; // offset 19 (no rotate, in preferred slot) -; int i3; // offset 20 [ignored] -; int i4; // offset 24 [ignored] -; int i5; // offset 28 [ignored] -; int i6; // offset 32 (no rotate, in preferred slot) -; } -%struct.hackstate = type { i8, i8, i8, i32, i16, i32, i8, i8, i8, i8, i32, i32, i32, i32 } - -; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - at state = global %struct.hackstate zeroinitializer, align 4 - -define i8 @get_hackstate_c1() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 4 - ret i8 %tmp2 -} - -define i8 @get_hackstate_c2() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 4 - ret i8 %tmp2 -} - -define i8 @get_hackstate_c3() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 4 - ret i8 %tmp2 -} - -define i32 @get_hackstate_i1() { -entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 4 - ret i32 %tmp2 -} - -define i16 @get_hackstate_s1() signext { -entry: - %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 4 - ret i16 %tmp2 -} - -define i8 @get_hackstate_c7() zeroext { -entry: - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, i32 9), align 4 - ret i8 %tmp2 -} - -define i32 @get_hackstate_i6() zeroext { -entry: - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 4 - ret i32 %tmp2 -} - -define void @set_hackstate_c1(i8 zeroext %c) { -entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 0), align 4 - ret void -} - -define void @set_hackstate_c2(i8 zeroext %c) { -entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 1), align 4 - ret void -} - -define void @set_hackstate_c3(i8 zeroext %c) { -entry: - store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, i32 2), align 4 - ret void -} - -define void @set_hackstate_i1(i32 %i) { -entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 3), align 4 - ret void -} - -define void @set_hackstate_s1(i16 signext %s) { -entry: - store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 0, i32 4), align 4 - ret void -} - -define void @set_hackstate_i3(i32 %i) { -entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 11), align 4 - ret void -} - - -define void @set_hackstate_i6(i32 %i) { -entry: - store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 0, i32 13), align 4 - ret void -} - Modified: llvm/trunk/test/CodeGen/CellSPU/vec_const.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/vec_const.ll?rev=46483&r1=46482&r2=46483&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/CellSPU/vec_const.ll (original) +++ llvm/trunk/test/CodeGen/CellSPU/vec_const.ll Mon Jan 28 20:16:57 2008 @@ -1,11 +1,11 @@ ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s -; RUN: grep il %t1.s | count 16 -; RUN: grep ilhu %t1.s | count 8 +; RUN: grep il %t1.s | count 16 +; RUN: grep ilhu %t1.s | count 8 ; RUN: grep ilh %t1.s | count 13 ; RUN: grep iohl %t1.s | count 7 ; RUN: grep lqa %t1.s | count 6 -; RUN: grep 24672 %t1.s | count 2 +; RUN: grep 24672 %t1.s | count 2 ; RUN: grep 16429 %t1.s | count 1 ; RUN: grep 63572 %t1.s | count 1 ; RUN: grep 4660 %t1.s | count 1 @@ -17,8 +17,7 @@ ; RUN: grep 21572 %t1.s | count 1 ; RUN: grep 11544 %t1.s | count 1 ; RUN: grep 1311768467750121234 %t1.s | count 1 -; RUN: grep lqx %t2.s | count 6 -; RUN: grep ila %t2.s | count 6 +; RUN: grep lqd %t2.s | count 6 target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128" target triple = "spu-unknown-elf" From dpatel at apple.com Mon Jan 28 20:20:41 2008 From: dpatel at apple.com (Devang Patel) Date: Tue, 29 Jan 2008 02:20:41 -0000 Subject: [llvm-commits] [llvm] r46484 - in /llvm/trunk: lib/Transforms/Scalar/LoopIndexSplit.cpp test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll Message-ID: <200801290220.m0T2KfMv020706@zion.cs.uiuc.edu> Author: dpatel Date: Mon Jan 28 20:20:41 2008 New Revision: 46484 URL: http://llvm.org/viewvc/llvm-project?rev=46484&view=rev Log: Filter loops that subtract induction variables. These loops are not yet handled. Fix PR 1912. Added: llvm/trunk/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp?rev=46484&r1=46483&r2=46484&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Mon Jan 28 20:20:41 2008 @@ -301,23 +301,23 @@ Value *Op0 = I->getOperand(0); Value *Op1 = I->getOperand(1); - if (PHINode *PN = dyn_cast(Op0)) { - if (PN->getParent() == L->getHeader() - && isa(Op1)) { - IndVar = PN; - IndVarIncrement = I; - return; - } - } - - if (PHINode *PN = dyn_cast(Op1)) { - if (PN->getParent() == L->getHeader() - && isa(Op0)) { - IndVar = PN; - IndVarIncrement = I; - return; - } - } + if (PHINode *PN = dyn_cast(Op0)) + if (PN->getParent() == L->getHeader()) + if (ConstantInt *CI = dyn_cast(Op1)) + if (CI->isOne()) { + IndVar = PN; + IndVarIncrement = I; + return; + } + + if (PHINode *PN = dyn_cast(Op1)) + if (PN->getParent() == L->getHeader()) + if (ConstantInt *CI = dyn_cast(Op0)) + if (CI->isOne()) { + IndVar = PN; + IndVarIncrement = I; + return; + } return; } Added: llvm/trunk/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll?rev=46484&view=auto ============================================================================== --- llvm/trunk/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll (added) +++ llvm/trunk/test/Transforms/LoopIndexSplit/2008-01-28-IndDecrement.ll Mon Jan 28 20:20:41 2008 @@ -0,0 +1,46 @@ +; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \ +; RUN: not grep "loop-index-split" + +; Induction variable decrement is not yet handled. +; pr1912.bc +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin9" + %struct.cset = type { i8*, i8, i8, i32, i8* } + %struct.parse = type { i8*, i8*, i32, i32*, i32, i32, i32, %struct.re_guts*, [10 x i32], [10 x i32] } + %struct.re_guts = type { i32, i32*, i32, i32, %struct.cset*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, [1 x i8] } + +define fastcc void @p_bracket(%struct.parse* %p) { +entry: + br i1 false, label %bb160, label %bb195 + +bb160: ; preds = %entry + br i1 false, label %bb.i169, label %bb9.i + +bb195: ; preds = %entry + ret void + +bb.i169: ; preds = %bb160 + br i1 false, label %bb372, label %bb565 + +bb9.i: ; preds = %bb160 + ret void + +bb372: ; preds = %bb418, %bb.i169 + %i1.0.reg2mem.0 = phi i32 [ %i1.0, %bb418 ], [ 0, %bb.i169 ] ; [#uses=2] + %tmp3.i.i.i170 = icmp ult i32 %i1.0.reg2mem.0, 128 ; [#uses=1] + br i1 %tmp3.i.i.i170, label %bb.i.i173, label %bb13.i.i + +bb.i.i173: ; preds = %bb372 + br label %bb418 + +bb13.i.i: ; preds = %bb372 + br label %bb418 + +bb418: ; preds = %bb13.i.i, %bb.i.i173 + %i1.0 = add i32 %i1.0.reg2mem.0, -1 ; [#uses=2] + %tmp420 = icmp sgt i32 %i1.0, -1 ; [#uses=1] + br i1 %tmp420, label %bb372, label %bb565 + +bb565: ; preds = %bb418, %bb.i169 + ret void +} From dalej at apple.com Mon Jan 28 20:21:22 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 29 Jan 2008 02:21:22 -0000 Subject: [llvm-commits] [llvm] r46485 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/AsmPrinter.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h Message-ID: <200801290221.m0T2LMBX020763@zion.cs.uiuc.edu> Author: johannes Date: Mon Jan 28 20:21:21 2008 New Revision: 46485 URL: http://llvm.org/viewvc/llvm-project?rev=46485&view=rev Log: Handle 'X' constraint in asm's better. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/AsmPrinter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=46485&r1=46484&r2=46485&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Mon Jan 28 20:21:21 2008 @@ -1006,6 +1006,11 @@ getRegForInlineAsmConstraint(const std::string &Constraint, MVT::ValueType VT) const; + /// LowerXConstraint - try to replace an X constraint, which matches anything, + /// with another that has more specific requirements based on the type of the + /// corresponding operand. + virtual void lowerXConstraint(MVT::ValueType ConstraintVT, + std::string&) const; /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=46485&r1=46484&r2=46485&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Mon Jan 28 20:21:21 2008 @@ -1108,9 +1108,10 @@ // Disassemble the AsmStr, printing out the literal pieces, the operands, etc. const char *AsmStr = MI->getOperand(NumDefs).getSymbolName(); - // If this asmstr is empty, don't bother printing the #APP/#NOAPP markers. + // If this asmstr is empty, just print the #APP/#NOAPP markers. + // These are useful to see where empty asm's wound up. if (AsmStr[0] == 0) { - O << "\n"; // Tab already printed, avoid double indenting next instr. + O << TAI->getInlineAsmStart() << "\n\t" << TAI->getInlineAsmEnd() << "\n"; return; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=46485&r1=46484&r2=46485&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Jan 28 20:21:21 2008 @@ -3250,27 +3250,41 @@ if (Codes.size() == 1) { // Single-letter constraints ('r') are very common. ConstraintCode = *Current; ConstraintType = CurType; - return; + } else { + unsigned CurGenerality = getConstraintGenerality(CurType); + + // If we have multiple constraints, try to pick the most general one ahead + // of time. This isn't a wonderful solution, but handles common cases. + for (unsigned j = 1, e = Codes.size(); j != e; ++j) { + TargetLowering::ConstraintType ThisType = TLI.getConstraintType(Codes[j]); + unsigned ThisGenerality = getConstraintGenerality(ThisType); + if (ThisGenerality > CurGenerality) { + // This constraint letter is more general than the previous one, + // use it. + CurType = ThisType; + Current = &Codes[j]; + CurGenerality = ThisGenerality; + } + } + + ConstraintCode = *Current; + ConstraintType = CurType; } - - unsigned CurGenerality = getConstraintGenerality(CurType); - - // If we have multiple constraints, try to pick the most general one ahead - // of time. This isn't a wonderful solution, but handles common cases. - for (unsigned j = 1, e = Codes.size(); j != e; ++j) { - TargetLowering::ConstraintType ThisType = TLI.getConstraintType(Codes[j]); - unsigned ThisGenerality = getConstraintGenerality(ThisType); - if (ThisGenerality > CurGenerality) { - // This constraint letter is more general than the previous one, - // use it. - CurType = ThisType; - Current = &Codes[j]; - CurGenerality = ThisGenerality; + + if (ConstraintCode == "X") { + if (isa(CallOperandVal) || isa(CallOperandVal)) + return; + // This matches anything. Labels and constants we handle elsewhere + // ('X' is the only thing that matches labels). Otherwise, try to + // resolve it to something we know about by looking at the actual + // operand type. + std::string s = ""; + TLI.lowerXConstraint(ConstraintVT, s); + if (s!="") { + ConstraintCode = s; + ConstraintType = TLI.getConstraintType(ConstraintCode); } } - - ConstraintCode = *Current; - ConstraintType = CurType; } @@ -3492,7 +3506,8 @@ if (OpInfo.CallOperandVal) { if (isa(OpInfo.CallOperandVal)) OpInfo.CallOperand = - DAG.getBasicBlock(FuncInfo.MBBMap[cast(OpInfo.CallOperandVal)]); + DAG.getBasicBlock(FuncInfo.MBBMap[cast( + OpInfo.CallOperandVal)]); else { OpInfo.CallOperand = getValue(OpInfo.CallOperandVal); const Type *OpTy = OpInfo.CallOperandVal->getType(); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=46485&r1=46484&r2=46485&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Jan 28 20:21:21 2008 @@ -1525,6 +1525,19 @@ return C_Unknown; } +/// LowerXConstraint - try to replace an X constraint, which matches anything, +/// with another that has more specific requirements based on the type of the +/// corresponding operand. +void TargetLowering::lowerXConstraint(MVT::ValueType ConstraintVT, + std::string& s) const { + if (MVT::isInteger(ConstraintVT)) + s = "r"; + else if (MVT::isFloatingPoint(ConstraintVT)) + s = "f"; // works for many targets + else + s = ""; +} + /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. void TargetLowering::LowerAsmOperandForConstraint(SDOperand Op, Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46485&r1=46484&r2=46485&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jan 28 20:21:21 2008 @@ -5701,6 +5701,22 @@ return TargetLowering::getConstraintType(Constraint); } +/// LowerXConstraint - try to replace an X constraint, which matches anything, +/// with another that has more specific requirements based on the type of the +/// corresponding operand. +void X86TargetLowering::lowerXConstraint(MVT::ValueType ConstraintVT, + std::string& s) const { + if (MVT::isFloatingPoint(ConstraintVT)) { + if (Subtarget->hasSSE2()) + s = "Y"; + else if (Subtarget->hasSSE1()) + s = "x"; + else + s = "f"; + } else + return TargetLowering::lowerXConstraint(ConstraintVT, s); +} + /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. void X86TargetLowering::LowerAsmOperandForConstraint(SDOperand Op, Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=46485&r1=46484&r2=46485&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Mon Jan 28 20:21:21 2008 @@ -366,6 +366,9 @@ getRegClassForInlineAsmConstraint(const std::string &Constraint, MVT::ValueType VT) const; + virtual void lowerXConstraint(MVT::ValueType ConstraintVT, + std::string&) const; + /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops /// vector. If it is invalid, don't add anything to Ops. virtual void LowerAsmOperandForConstraint(SDOperand Op, From natebegeman at mac.com Mon Jan 28 20:24:00 2008 From: natebegeman at mac.com (Nate Begeman) Date: Tue, 29 Jan 2008 02:24:00 -0000 Subject: [llvm-commits] [llvm] r46486 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Message-ID: <200801290224.m0T2O0qM020836@zion.cs.uiuc.edu> Author: sampo Date: Mon Jan 28 20:24:00 2008 New Revision: 46486 URL: http://llvm.org/viewvc/llvm-project?rev=46486&view=rev Log: Properly expand extract-element for non-power-of-2 codegen Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=46486&r1=46485&r2=46486&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Jan 28 20:24:00 2008 @@ -4405,14 +4405,15 @@ // This must be an access of the only element. Return it. Op = ScalarizeVectorOp(Vec); } else if (!TLI.isTypeLegal(TVT) && isa(Idx)) { + unsigned NumLoElts = 1 << Log2_32(NumElems-1); ConstantSDNode *CIdx = cast(Idx); SDOperand Lo, Hi; SplitVectorOp(Vec, Lo, Hi); - if (CIdx->getValue() < NumElems/2) { + if (CIdx->getValue() < NumLoElts) { Vec = Lo; } else { Vec = Hi; - Idx = DAG.getConstant(CIdx->getValue() - NumElems/2, + Idx = DAG.getConstant(CIdx->getValue() - NumLoElts, Idx.getValueType()); } From scottm at aero.org Mon Jan 28 20:29:32 2008 From: scottm at aero.org (Scott Michel) Date: Tue, 29 Jan 2008 02:29:32 -0000 Subject: [llvm-commits] [llvm] r46487 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200801290229.m0T2TWHH021000@zion.cs.uiuc.edu> Author: pingbak Date: Mon Jan 28 20:29:31 2008 New Revision: 46487 URL: http://llvm.org/viewvc/llvm-project?rev=46487&view=rev Log: Fix to bug 1951: tblgen gratuitously renames variables when no temporary was generated. This feature would only show up in fairly complex patterns, such as this one in CellSPU: def : Pat<(add (SPUhi tconstpool:$in, 0), (SPUlo tconstpool:$in, 0)), (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>; which generated the following emit code: SDNode *Emit_0(const SDOperand &N, unsigned Opc0, unsigned Opc1, MVT::ValueType VT0, MVT::ValueType VT1) DISABLE_INLINE { SDOperand N0 = N.getOperand(0); SDOperand N00 = N0.getOperand(0); SDOperand N01 = N0.getOperand(1); SDOperand N1 = N.getOperand(1); SDOperand N10 = N1.getOperand(0); SDOperand N11 = N1.getOperand(1); SDOperand Tmp3(CurDAG->getTargetNode(Opc0, VT0, N00), 0); return CurDAG->SelectNodeTo(N.Val, Opc1, VT1, Tmp3, Tmp2); /* Tmp2 s/b N00 */ } Tested against the test suites without incident. Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=46487&r1=46486&r2=46487&view=diff ============================================================================== --- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original) +++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Mon Jan 28 20:29:31 2008 @@ -694,7 +694,9 @@ std::vector NodeOps; // This is something selected from the pattern we matched. if (!N->getName().empty()) { - std::string &Val = VariableMap[N->getName()]; + const std::string &VarName = N->getName(); + std::string Val = VariableMap[VarName]; + bool ModifiedVal = false; assert(!Val.empty() && "Variable referenced but not defined and not caught earlier!"); if (Val[0] == 'T' && Val[1] == 'm' && Val[2] == 'p') { @@ -708,6 +710,7 @@ if (!N->isLeaf() && N->getOperator()->getName() == "imm") { assert(N->getExtTypes().size() == 1 && "Multiple types not handled!"); std::string CastType; + std::string TmpVar = "Tmp" + utostr(ResNo); switch (N->getTypeNum(0)) { default: cerr << "Cannot handle " << getEnumName(N->getTypeNum(0)) @@ -719,56 +722,53 @@ case MVT::i32: CastType = "unsigned"; break; case MVT::i64: CastType = "uint64_t"; break; } - emitCode("SDOperand Tmp" + utostr(ResNo) + + emitCode("SDOperand " + TmpVar + " = CurDAG->getTargetConstant(((" + CastType + ") cast(" + Val + ")->getValue()), " + getEnumName(N->getTypeNum(0)) + ");"); - NodeOps.push_back("Tmp" + utostr(ResNo)); // Add Tmp to VariableMap, so that we don't multiply select this // value if used multiple times by this pattern result. - Val = "Tmp"+utostr(ResNo); + Val = TmpVar; + ModifiedVal = true; + NodeOps.push_back(Val); } else if (!N->isLeaf() && N->getOperator()->getName() == "texternalsym"){ Record *Op = OperatorMap[N->getName()]; // Transform ExternalSymbol to TargetExternalSymbol if (Op && Op->getName() == "externalsym") { - emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getTarget" + std::string TmpVar = "Tmp"+utostr(ResNo); + emitCode("SDOperand " + TmpVar + " = CurDAG->getTarget" "ExternalSymbol(cast(" + Val + ")->getSymbol(), " + getEnumName(N->getTypeNum(0)) + ");"); - NodeOps.push_back("Tmp" + utostr(ResNo)); // Add Tmp to VariableMap, so that we don't multiply select // this value if used multiple times by this pattern result. - Val = "Tmp"+utostr(ResNo); - } else { - NodeOps.push_back(Val); + Val = TmpVar; + ModifiedVal = true; } + NodeOps.push_back(Val); } else if (!N->isLeaf() && (N->getOperator()->getName() == "tglobaladdr" || N->getOperator()->getName() == "tglobaltlsaddr")) { Record *Op = OperatorMap[N->getName()]; // Transform GlobalAddress to TargetGlobalAddress if (Op && (Op->getName() == "globaladdr" || Op->getName() == "globaltlsaddr")) { - emitCode("SDOperand Tmp" + utostr(ResNo) + " = CurDAG->getTarget" + std::string TmpVar = "Tmp" + utostr(ResNo); + emitCode("SDOperand " + TmpVar + " = CurDAG->getTarget" "GlobalAddress(cast(" + Val + ")->getGlobal(), " + getEnumName(N->getTypeNum(0)) + ");"); - NodeOps.push_back("Tmp" + utostr(ResNo)); // Add Tmp to VariableMap, so that we don't multiply select // this value if used multiple times by this pattern result. - Val = "Tmp"+utostr(ResNo); - } else { - NodeOps.push_back(Val); + Val = TmpVar; + ModifiedVal = true; } - } else if (!N->isLeaf() && N->getOperator()->getName() == "texternalsym"){ NodeOps.push_back(Val); - // Add Tmp to VariableMap, so that we don't multiply select this - // value if used multiple times by this pattern result. - Val = "Tmp"+utostr(ResNo); - } else if (!N->isLeaf() && N->getOperator()->getName() == "tconstpool") { + } else if (!N->isLeaf() + && (N->getOperator()->getName() == "texternalsym" + || N->getOperator()->getName() == "tconstpool")) { + // Do not rewrite the variable name, since we don't generate a new + // temporary. NodeOps.push_back(Val); - // Add Tmp to VariableMap, so that we don't multiply select this - // value if used multiple times by this pattern result. - Val = "Tmp"+utostr(ResNo); } else if (N->isLeaf() && (CP = NodeGetComplexPattern(N, CGP))) { for (unsigned i = 0; i < CP->getNumOperands(); ++i) { emitCode("AddToISelQueue(CPTmp" + utostr(i) + ");"); @@ -786,6 +786,10 @@ } NodeOps.push_back(Val); } + + if (ModifiedVal) { + VariableMap[VarName] = Val; + } return NodeOps; } if (N->isLeaf()) { From resistor at mac.com Mon Jan 28 20:31:45 2008 From: resistor at mac.com (Owen Anderson) Date: Mon, 28 Jan 2008 20:31:45 -0600 Subject: [llvm-commits] [llvm] r46483 - in /llvm/trunk: lib/Target/CellSPU/ test/CodeGen/CellSPU/ In-Reply-To: <200801290216.m0T2Gw8o020585@zion.cs.uiuc.edu> References: <200801290216.m0T2Gw8o020585@zion.cs.uiuc.edu> Message-ID: <0129AF7E-6145-4110-A32F-12BB14A69DA7@mac.com> I'm getting a build failure after this commit: llvm[3]: Compiling SPUISelDAGToDAG.cpp for Release build SPUGenDAGISel.inc: In member function ?llvm::SDNode* SPUDAGToDAGISel::Emit_5(const llvm::SDOperand&, unsigned int, unsigned int, llvm::MVT::ValueType, llvm::MVT::ValueType)?: SPUGenDAGISel.inc:948: error: ?Tmp2? was not declared in this scope --Owen On Jan 28, 2008, at 8:16 PM, Scott Michel wrote: > Author: pingbak > Date: Mon Jan 28 20:16:57 2008 > New Revision: 46483 > > URL: http://llvm.org/viewvc/llvm-project?rev=46483&view=rev > Log: > Overhaul Cell SPU's addressing mode internals so that there are now > only two addressing mode nodes, SPUaform and SPUindirect (vice the > three previous ones, SPUaform, SPUdform and SPUxform). This improves > code somewhat because we now avoid using reg+reg addressing when > it can be avoided. It also simplifies the address selection logic, > which was the main point for doing this. > > Also, for various global variables that would be loaded using SPU's > A-form addressing, prefer D-form offs[reg] addressing, keeping the > base in a register if the variable is used more than once. > > Removed: > llvm/trunk/test/CodeGen/CellSPU/struct_2.ll > Modified: > llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp > llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp > llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp > llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h > llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td > llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td > llvm/trunk/lib/Target/CellSPU/SPUNodes.td > llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp > llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll > llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll > llvm/trunk/test/CodeGen/CellSPU/fcmp.ll > llvm/trunk/test/CodeGen/CellSPU/struct_1.ll > llvm/trunk/test/CodeGen/CellSPU/vec_const.ll > > Modified: llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp Mon Jan 28 > 20:16:57 2008 > @@ -195,12 +195,18 @@ > void > printAddr256K(const MachineInstr *MI, unsigned OpNo) > { > - /* Note: operand 1 is an offset or symbol name. Operand 2 is > - ignored. */ > + /* Note: operand 1 is an offset or symbol name. */ > if (MI->getOperand(OpNo).isImmediate()) { > printS16ImmOperand(MI, OpNo); > } else { > printOp(MI->getOperand(OpNo)); > + if (MI->getOperand(OpNo+1).isImmediate()) { > + int displ = int(MI->getOperand(OpNo+1).getImm()); > + if (displ > 0) > + O << "+" << displ; > + else if (displ < 0) > + O << displ; > + } > } > } > > @@ -309,7 +315,6 @@ > case MachineOperand::MO_JumpTableIndex: > O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() > << '_' << MO.getIndex(); > - // FIXME: PIC relocation model > return; > case MachineOperand::MO_ConstantPoolIndex: > O << TAI->getPrivateGlobalPrefix() << "CPI" << getFunctionNumber() > @@ -521,7 +526,8 @@ > O << "\t.zero\t" << Size; > } else if (I->hasInternalLinkage()) { > SwitchToDataSection("\t.data", I); > - O << TAI->getLCOMMDirective() << name << "," << Size << "," > << Align; > + O << ".local " << name << "\n"; > + O << TAI->getCOMMDirective() << name << "," << Size << "," > << Align << "\n"; > } else { > SwitchToDataSection("\t.data", I); > O << ".comm " << name << "," << Size; > > Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Mon Jan 28 > 20:16:57 2008 > @@ -150,6 +150,16 @@ > return false; > } > > + bool > + isHighLow(const SDOperand &Op) > + { > + return (Op.getOpcode() == SPUISD::IndirectAddr > + && ((Op.getOperand(0).getOpcode() == SPUISD::Hi > + && Op.getOperand(1).getOpcode() == SPUISD::Lo) > + || (Op.getOperand(0).getOpcode() == SPUISD::Lo > + && Op.getOperand(1).getOpcode() == SPUISD::Hi))); > + } > + > // > ===------------------------------------------------------------------ > ===// > //! MVT::ValueType to "useful stuff" mapping structure: > > @@ -157,40 +167,24 @@ > MVT::ValueType VT; > unsigned ldresult_ins; /// LDRESULT instruction (0 = undefined) > int prefslot_byte; /// Byte offset of the "preferred" slot > - unsigned brcc_eq_ins; /// br_cc equal instruction > - unsigned brcc_neq_ins; /// br_cc not equal instruction > - unsigned load_aform; /// A-form load instruction for > this VT > - unsigned store_aform; /// A-form store instruction for > this VT > + unsigned insmask_ins; /// Insert mask instruction for a- > form > }; > > const valtype_map_s valtype_map[] = { > - { MVT::i1, 0, 3, 0, 0, 0, > - 0 }, > - { MVT::i8, SPU::ORBIr8, 3, 0, 0, SPU::LQAr8, > - SPU::STQAr8 }, > - { MVT::i16, SPU::ORHIr16, 2, SPU::BRHZ, SPU::BRHNZ, > SPU::LQAr16, > - SPU::STQAr16 }, > - { MVT::i32, SPU::ORIr32, 0, SPU::BRZ, SPU::BRNZ, > SPU::LQAr32, > - SPU::STQAr32 }, > - { MVT::i64, SPU::ORIr64, 0, 0, 0, > SPU::LQAr64, > - SPU::STQAr64 }, > - { MVT::f32, 0, 0, 0, 0, > SPU::LQAf32, > - SPU::STQAf32 }, > - { MVT::f64, 0, 0, 0, 0, > SPU::LQAf64, > - SPU::STQAf64 }, > + { MVT::i1, 0, 3, 0 }, > + { MVT::i8, SPU::ORBIr8, 3, 0 }, > + { MVT::i16, SPU::ORHIr16, 2, 0 }, > + { MVT::i32, SPU::ORIr32, 0, 0 }, > + { MVT::i64, SPU::ORIr64, 0, 0 }, > + { MVT::f32, 0, 0, 0 }, > + { MVT::f64, 0, 0, 0 }, > // vector types... (sigh!) > - { MVT::v16i8, 0, 0, 0, 0, > SPU::LQAv16i8, > - SPU::STQAv16i8 }, > - { MVT::v8i16, 0, 0, 0, 0, > SPU::LQAv8i16, > - SPU::STQAv8i16 }, > - { MVT::v4i32, 0, 0, 0, 0, > SPU::LQAv4i32, > - SPU::STQAv4i32 }, > - { MVT::v2i64, 0, 0, 0, 0, > SPU::LQAv2i64, > - SPU::STQAv2i64 }, > - { MVT::v4f32, 0, 0, 0, 0, > SPU::LQAv4f32, > - SPU::STQAv4f32 }, > - { MVT::v2f64, 0, 0, 0, 0, > SPU::LQAv2f64, > - SPU::STQAv2f64 }, > + { MVT::v16i8, 0, 0, SPU::CBD }, > + { MVT::v8i16, 0, 0, SPU::CHD }, > + { MVT::v4i32, 0, 0, SPU::CWD }, > + { MVT::v2i64, 0, 0, 0 }, > + { MVT::v4f32, 0, 0, SPU::CWD }, > + { MVT::v2f64, 0, 0, 0 } > }; > > const size_t n_valtype_map = sizeof(valtype_map) / > sizeof(valtype_map[0]); > @@ -381,18 +375,20 @@ > Disp = CurDAG->getTargetConstant(0, VT); > Base = N; > return true; > - } else if (Opc == SPUISD::DFormAddr) { > - // D-Form address: This is pretty straightforward, naturally... > - CN = cast(N.getOperand(1)); > - assert(CN != 0 && "SelectDFormAddr/SPUISD::DForm2Addr expecting > constant"); > - Imm = unsigned(CN->getValue()); > - if (Imm < 0xff) { > - Disp = CurDAG->getTargetConstant(CN->getValue(), PtrVT); > - Base = N.getOperand(0); > - return true; > + } else if (Opc == SPUISD::IndirectAddr) { > + SDOperand Op1 = N.getOperand(1); > + if (Op1.getOpcode() == ISD::TargetConstant > + || Op1.getOpcode() == ISD::Constant) { > + CN = cast(N.getOperand(1)); > + assert(CN != 0 && "SelectIndirectAddr/SPUISD::DForm2Addr > expecting constant"); > + Imm = unsigned(CN->getValue()); > + if (Imm < 0xff) { > + Disp = CurDAG->getTargetConstant(CN->getValue(), PtrVT); > + Base = N.getOperand(0); > + return true; > + } > } > } > - > return false; > } > > @@ -407,7 +403,7 @@ > SDOperand &Index) { > // These match the addr256k operand type: > MVT::ValueType OffsVT = MVT::i16; > - MVT::ValueType PtrVT = SPUtli.getPointerTy(); > + SDOperand Zero = CurDAG->getTargetConstant(0, OffsVT); > > switch (N.getOpcode()) { > case ISD::Constant: > @@ -417,28 +413,40 @@ > abort(); > /*NOTREACHED*/ > > - case ISD::TargetConstant: { > - // Loading from a constant address. > - ConstantSDNode *CN = dyn_cast(N); > - int Imm = (int)CN->getValue(); > - if (Imm < 0x3ffff && (Imm & 0x3) == 0) { > - Base = CurDAG->getTargetConstant(Imm, PtrVT); > - // Note that this operand will be ignored by the assembly > printer... > - Index = CurDAG->getTargetConstant(0, OffsVT); > - return true; > - } > - } > + case ISD::TargetConstant: > case ISD::TargetGlobalAddress: > - case ISD::TargetConstantPool: > - case SPUISD::AFormAddr: { > - // The address is in Base. N is a dummy that will be ignored by > - // the assembly printer. > - Base = N; > - Index = CurDAG->getTargetConstant(0, OffsVT); > - return true; > - } > - } > + case ISD::TargetJumpTable: > + cerr << "SPUSelectAFormAddr: Target Constant/Pool/Global not > wrapped as " > + << "A-form address.\n"; > + abort(); > + /*NOTREACHED*/ > > + case SPUISD::AFormAddr: > + // Just load from memory if there's only a single use of the > location, > + // otherwise, this will get handled below with D-form offset > addresses > + if (N.hasOneUse()) { > + SDOperand Op0 = N.getOperand(0); > + switch (Op0.getOpcode()) { > + case ISD::TargetConstantPool: > + case ISD::TargetJumpTable: > + Base = Op0; > + Index = Zero; > + return true; > + > + case ISD::TargetGlobalAddress: { > + GlobalAddressSDNode *GSDN = cast(Op0); > + GlobalValue *GV = GSDN->getGlobal(); > + if (GV->getAlignment() == 16) { > + Base = Op0; > + Index = Zero; > + return true; > + } > + break; > + } > + } > + } > + break; > + } > return false; > } > > @@ -460,14 +468,11 @@ > unsigned Opc = N.getOpcode(); > unsigned PtrTy = SPUtli.getPointerTy(); > > - if (Opc == ISD::Register) { > - Base = N; > - Index = CurDAG->getTargetConstant(0, PtrTy); > - return true; > - } else if (Opc == ISD::FrameIndex) { > + if (Opc == ISD::FrameIndex) { > + // Stack frame index must be less than 512 (divided by 16): > FrameIndexSDNode *FI = dyn_cast(N); > DEBUG(cerr << "SelectDFormAddr: ISD::FrameIndex = " > - << FI->getIndex() << "\n"); > + << FI->getIndex() << "\n"); > if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { > Base = CurDAG->getTargetConstant(0, PtrTy); > Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); > @@ -475,19 +480,20 @@ > } > } else if (Opc == ISD::ADD) { > // Generated by getelementptr > - const SDOperand Op0 = N.getOperand(0); // Frame index/base > - const SDOperand Op1 = N.getOperand(1); // Offset within base > + const SDOperand Op0 = N.getOperand(0); > + const SDOperand Op1 = N.getOperand(1); > > - if ((Op1.getOpcode() == ISD::Constant > - || Op1.getOpcode() == ISD::TargetConstant) > - && Op0.getOpcode() != SPUISD::XFormAddr) { > + if ((Op0.getOpcode() == SPUISD::Hi && Op1.getOpcode() == > SPUISD::Lo) > + || (Op1.getOpcode() == SPUISD::Hi && Op0.getOpcode() == > SPUISD::Lo)) { > + Base = CurDAG->getTargetConstant(0, PtrTy); > + Index = N; > + return true; > + } else if (Op1.getOpcode() == ISD::Constant > + || Op1.getOpcode() == ISD::TargetConstant) { > ConstantSDNode *CN = dyn_cast(Op1); > - assert(CN != 0 && "SelectDFormAddr: Expected a constant"); > - > - int32_t offset = (int32_t) CN->getSignExtended(); > - unsigned Opc0 = Op0.getOpcode(); > + int32_t offset = int32_t(CN->getSignExtended()); > > - if (Opc0 == ISD::FrameIndex) { > + if (Op0.getOpcode() == ISD::FrameIndex) { > FrameIndexSDNode *FI = dyn_cast(Op0); > DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset > << " frame index = " << FI->getIndex() << "\n"); > @@ -500,51 +506,69 @@ > } else if (offset > SPUFrameInfo::minFrameOffset() > && offset < SPUFrameInfo::maxFrameOffset()) { > Base = CurDAG->getTargetConstant(offset, PtrTy); > - if (Opc0 == ISD::GlobalAddress) { > - // Convert global address to target global address > - GlobalAddressSDNode *GV = > dyn_cast(Op0); > - Index = CurDAG->getTargetGlobalAddress(GV->getGlobal(), > PtrTy); > - return true; > - } else { > - // Otherwise, just take operand 0 > - Index = Op0; > + Index = Op0; > + return true; > + } > + } else if (Op0.getOpcode() == ISD::Constant > + || Op0.getOpcode() == ISD::TargetConstant) { > + ConstantSDNode *CN = dyn_cast(Op0); > + int32_t offset = int32_t(CN->getSignExtended()); > + > + if (Op1.getOpcode() == ISD::FrameIndex) { > + FrameIndexSDNode *FI = dyn_cast(Op1); > + DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset > + << " frame index = " << FI->getIndex() << "\n"); > + > + if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { > + Base = CurDAG->getTargetConstant(offset, PtrTy); > + Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); > return true; > } > + } else if (offset > SPUFrameInfo::minFrameOffset() > + && offset < SPUFrameInfo::maxFrameOffset()) { > + Base = CurDAG->getTargetConstant(offset, PtrTy); > + Index = Op1; > + return true; > } > - } else > - return false; > - } else if (Opc == SPUISD::DFormAddr) { > - // D-Form address: This is pretty straightforward, > - // naturally... but make sure that this isn't a D-form address > - // with a X-form address embedded within: > - const SDOperand Op0 = N.getOperand(0); // Frame index/base > - const SDOperand Op1 = N.getOperand(1); // Offset within base > + } > + } else if (Opc == SPUISD::IndirectAddr) { > + // Indirect with constant offset -> D-Form address > + const SDOperand Op0 = N.getOperand(0); > + const SDOperand Op1 = N.getOperand(1); > + SDOperand Zero = CurDAG->getTargetConstant(0, N.getValueType()); > > - if (Op0.getOpcode() == ISD::Constant > - || Op0.getOpcode() == ISD::TargetConstant) { > + if (Op1.getOpcode() == ISD::Constant > + || Op1.getOpcode() == ISD::TargetConstant) { > ConstantSDNode *CN = cast(Op1); > - assert(CN != 0 && "SelectDFormAddr/SPUISD::DFormAddr > expecting constant"); > - Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); > - Index = Op0; > - return true; > - } > - } else if (Opc == ISD::FrameIndex) { > - // Stack frame index must be less than 512 (divided by 16): > - FrameIndexSDNode *FI = dyn_cast(N); > - DEBUG(cerr << "SelectDFormAddr: ISD::FrameIndex = " > - << FI->getIndex() << "\n"); > - if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { > + int32_t offset = int32_t(CN->getSignExtended()); > + if (offset > SPUFrameInfo::minFrameOffset() > + && offset < SPUFrameInfo::maxFrameOffset()) { > + Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); > + Index = Op0; > + return true; > + } > + } else if (Op0.getOpcode() == ISD::Constant > + || Op0.getOpcode() == ISD::TargetConstant) { > + ConstantSDNode *CN = cast(Op0); > + int32_t offset = int32_t(CN->getSignExtended()); > + if (offset > SPUFrameInfo::minFrameOffset() > + && offset < SPUFrameInfo::maxFrameOffset()) { > + Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); > + Index = Op1; > + return true; > + } > + } else if (Op0.getOpcode() == SPUISD::Hi > + && Op1.getOpcode() == SPUISD::Lo) { > + // (SPUindirect (SPUhi , 0), (SPUlo , 0)) > Base = CurDAG->getTargetConstant(0, PtrTy); > - Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); > + Index = N; > return true; > } > - } else if (Opc == SPUISD::LDRESULT) { > - // It's a load result dereference > - Base = CurDAG->getTargetConstant(0, PtrTy); > - Index = N.getOperand(0); > + } else if (Opc == SPUISD::AFormAddr) { > + Base = CurDAG->getTargetConstant(0, N.getValueType()); > + Index = N; > return true; > } > - > return false; > } > > @@ -565,108 +589,10 @@ > || SelectDFormAddr(Op, N, Base, Index)) > return false; > > - unsigned Opc = N.getOpcode(); > - > - if (Opc == ISD::ADD) { > - SDOperand N1 = N.getOperand(0); > - SDOperand N2 = N.getOperand(1); > - Base = N.getOperand(0); > - Index = N.getOperand(1); > - return true; > - } else if (Opc == SPUISD::XFormAddr) { > - Base = N; > - Index = N.getOperand(1); > - return true; > - } else if (Opc == SPUISD::DFormAddr) { > - // Must be a D-form address with an X-form address embedded > - // within: > - Base = N.getOperand(0); > - Index = N.getOperand(1); > - return true; > - } else if (N.getNumOperands() == 2) { > - SDOperand N1 = N.getOperand(0); > - SDOperand N2 = N.getOperand(1); > - unsigned N1Opc = N1.getOpcode(); > - unsigned N2Opc = N2.getOpcode(); > - > - if ((N1Opc == ISD::CopyToReg || N1Opc == ISD::Register) > - && (N2Opc == ISD::CopyToReg || N2Opc == ISD::Register)) { > - Base = N.getOperand(0); > - Index = N.getOperand(1); > - return true; > - /*UNREACHED*/ > - } else { > - cerr << "SelectXFormAddr: 2-operand unhandled operand:\n"; > - N.Val->dump(CurDAG); > - cerr << "\n"; > - abort(); > - /*UNREACHED*/ > - } > - } else { > - cerr << "SelectXFormAddr: Unhandled operand type:\n"; > - N.Val->dump(CurDAG); > - cerr << "\n"; > - abort(); > - /*UNREACHED*/ > - } > - > - return false; > -} > - > -//! Emit load for A-form addresses > -/* > - */ > -SDNode * > -Emit_LOAD_AFormAddr(SDOperand Op, SelectionDAG &CurDAG, > SPUDAGToDAGISel &ISel) > -{ > - SDNode *Result; > - MVT::ValueType OpVT = Op.getValueType(); > - SDOperand Chain = Op.getOperand(0); > - SDOperand Ptr = Op.getOperand(1); > - SDOperand PtrArg = Ptr.getOperand(0); > - SDOperand PtrOffs = Ptr.getOperand(1); > - const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); > - > - if (PtrOffs.getOpcode() == ISD::Constant) { > - ConstantSDNode *CN = cast(PtrOffs); > - MVT::ValueType PVT = PtrOffs.getValueType(); > - PtrOffs = CurDAG.getTargetConstant(CN->getValue(), PVT); > - } > - ISel.AddToISelQueue(PtrArg); > - ISel.AddToISelQueue(PtrOffs); > - ISel.AddToISelQueue(Chain); > - Result = CurDAG.getTargetNode(vtm->load_aform, OpVT, MVT::Other, > PtrArg, PtrOffs, Chain); > - Chain = SDOperand(Result, 1); > - return Result; > -} > - > -//! Emit store for A-form addresses > -/* > - */ > -SDNode * > -Emit_STORE_AFormAddr(SDOperand Op, SelectionDAG &CurDAG, > SPUDAGToDAGISel &ISel) > -{ > - SDNode *Result; > - SDOperand Chain = Op.getOperand(0); > - SDOperand Val = Op.getOperand(1); > - SDOperand Ptr = Op.getOperand(2); > - SDOperand PtrArg = Ptr.getOperand(0); > - SDOperand PtrOffs = Ptr.getOperand(1); > - const valtype_map_s *vtm = > getValueTypeMapEntry(Val.getValueType()); > - > - if (PtrOffs.getOpcode() == ISD::Constant) { > - ConstantSDNode *CN = cast(PtrOffs); > - MVT::ValueType PVT = PtrOffs.getValueType(); > - PtrOffs = CurDAG.getTargetConstant(CN->getValue(), PVT); > - } > - ISel.AddToISelQueue(Val); > - ISel.AddToISelQueue(PtrArg); > - ISel.AddToISelQueue(PtrOffs); > - ISel.AddToISelQueue(Chain); > - SDOperand Ops[4] = { Val, PtrArg, PtrOffs, Chain }; > - Result = CurDAG.getTargetNode(vtm->store_aform, MVT::Other, Ops, > 4); > - Chain = SDOperand(Result, 1); > - return Result; > + // All else fails, punt and use an X-form address: > + Base = N.getOperand(0); > + Index = N.getOperand(1); > + return true; > } > > //! Convert the operand from a target-independent to a target- > specific node > @@ -695,12 +621,6 @@ > Ops[0] = TFI; > Ops[1] = Zero; > n_ops = 2; > - } else if (Opc == ISD::LOAD > - && Op.getOperand(1).getOpcode() == SPUISD::AFormAddr) { > - return Emit_LOAD_AFormAddr(Op, *CurDAG, *this); > - } else if (Opc == ISD::STORE > - && Op.getOperand(2).getOpcode() == SPUISD::AFormAddr) { > - return Emit_STORE_AFormAddr(Op, *CurDAG, *this); > } else if (Opc == ISD::ZERO_EXTEND) { > // (zero_extend:i16 (and:i8 , )) > const SDOperand &Op1 = N->getOperand(0); > @@ -717,6 +637,38 @@ > n_ops = 2; > } > } > + } else if (Opc == SPUISD::INSERT_MASK) { > + SDOperand Op0 = Op.getOperand(0); > + if (Op0.getOpcode() == SPUISD::AFormAddr) { > + // (SPUvecinsmask (SPUaform , 0)) -> > + // (CBD|CHD|CWD 0, arg) > + const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); > + ConstantSDNode *CN = cast(Op0.getOperand(1)); > + assert(vtm->insmask_ins != 0 && "missing insert mask > instruction"); > + NewOpc = vtm->insmask_ins; > + Ops[0] = CurDAG->getTargetConstant(CN->getValue(), > Op0.getValueType()); > + Ops[1] = Op0; > + n_ops = 2; > + > + AddToISelQueue(Op0); > + } else if (Op0.getOpcode() == ISD::FrameIndex) { > + // (SPUvecinsmask ) -> > + // (CBD|CHD|CWD 0, ) > + const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); > + NewOpc = vtm->insmask_ins; > + Ops[0] = CurDAG->getTargetConstant(0, Op0.getValueType()); > + Ops[1] = Op0; > + n_ops = 2; > + } else if (isHighLow(Op0)) { > + // (SPUvecinsmask (SPUindirect (SPUhi , 0), (SPUlow > , 0))) -> > + // (CBD|CHD|CWD 0, arg) > + const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); > + NewOpc = vtm->insmask_ins; > + Ops[0] = CurDAG->getTargetConstant(0, Op0.getValueType()); > + Ops[1] = Op0; > + n_ops = 2; > + AddToISelQueue(Op0); > + } > } else if (Opc == SPUISD::LDRESULT) { > // Custom select instructions for LDRESULT > unsigned VT = N->getValueType(0); > @@ -748,19 +700,19 @@ > AddToISelQueue(Chain); > > return Result; > - } else if (Opc == SPUISD::XFormAddr) { > + } else if (Opc == SPUISD::IndirectAddr) { > SDOperand Op0 = Op.getOperand(0); > if (Op0.getOpcode() == SPUISD::LDRESULT > || Op0.getOpcode() == SPUISD::AFormAddr) { > - // (XFormAddr (LDRESULT|AFormAddr, imm)) > + // (IndirectAddr (LDRESULT|AFormAddr, imm)) > SDOperand Op1 = Op.getOperand(1); > MVT::ValueType VT = Op.getValueType(); > > - DEBUG(cerr << "CellSPU: XFormAddr(" > - << (Op0.getOpcode() == SPUISD::LDRESULT > - ? "LDRESULT" > - : "AFormAddr") > - << ", imm):\nOp0 = "); > + DEBUG(cerr << "CellSPU: IndirectAddr(" > + << (Op0.getOpcode() == SPUISD::LDRESULT > + ? "LDRESULT" > + : "AFormAddr") > + << ", imm):\nOp0 = "); > DEBUG(Op.getOperand(0).Val->dump(CurDAG)); > DEBUG(cerr << "\nOp1 = "); > DEBUG(Op.getOperand(1).Val->dump(CurDAG)); > > Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Mon Jan 28 > 20:16:57 2008 > @@ -289,14 +289,12 @@ > > // We want to legalize GlobalAddress and ConstantPool nodes into the > // appropriate instructions to materialize the address. > - setOperationAction(ISD::GlobalAddress, MVT::i32, Custom); > - setOperationAction(ISD::ConstantPool, MVT::i32, Custom); > - setOperationAction(ISD::ConstantPool, MVT::f32, Custom); > - setOperationAction(ISD::JumpTable, MVT::i32, Custom); > - setOperationAction(ISD::GlobalAddress, MVT::i64, Custom); > - setOperationAction(ISD::ConstantPool, MVT::i64, Custom); > - setOperationAction(ISD::ConstantPool, MVT::f64, Custom); > - setOperationAction(ISD::JumpTable, MVT::i64, Custom); > + for (unsigned sctype = (unsigned) MVT::i1; sctype < (unsigned) > MVT::f128; > + ++sctype) { > + setOperationAction(ISD::GlobalAddress, sctype, Custom); > + setOperationAction(ISD::ConstantPool, sctype, Custom); > + setOperationAction(ISD::JumpTable, sctype, Custom); > + } > > // RET must be custom lowered, to meet ABI requirements > setOperationAction(ISD::RET, MVT::Other, Custom); > @@ -377,7 +375,7 @@ > setStackPointerRegisterToSaveRestore(SPU::R1); > > // We have target-specific dag combine patterns for the following > nodes: > - // e.g., setTargetDAGCombine(ISD::SUB); > + setTargetDAGCombine(ISD::ADD); > > computeRegisterProperties(); > } > @@ -391,8 +389,7 @@ > node_names[(unsigned) SPUISD::Lo] = "SPUISD::Lo"; > node_names[(unsigned) SPUISD::PCRelAddr] = "SPUISD::PCRelAddr"; > node_names[(unsigned) SPUISD::AFormAddr] = "SPUISD::AFormAddr"; > - node_names[(unsigned) SPUISD::DFormAddr] = "SPUISD::DFormAddr"; > - node_names[(unsigned) SPUISD::XFormAddr] = "SPUISD::XFormAddr"; > + node_names[(unsigned) SPUISD::IndirectAddr] = > "SPUISD::IndirectAddr"; > node_names[(unsigned) SPUISD::LDRESULT] = "SPUISD::LDRESULT"; > node_names[(unsigned) SPUISD::CALL] = "SPUISD::CALL"; > node_names[(unsigned) SPUISD::SHUFB] = "SPUISD::SHUFB"; > @@ -524,11 +521,12 @@ > // Unaligned load or we're using the "large memory" model, which > means that > // we have to be very pessimistic: > if (isMemoryOperand(basePtr) || isIndirectOperand(basePtr)) { > - basePtr = DAG.getNode(SPUISD::XFormAddr, PtrVT, basePtr, > DAG.getConstant(0, PtrVT)); > + basePtr = DAG.getNode(SPUISD::IndirectAddr, PtrVT, basePtr, > DAG.getConstant(0, PtrVT)); > } > > // Add the offset > - basePtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, > DAG.getConstant(alignOffs, PtrVT)); > + basePtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, > + DAG.getConstant((alignOffs & ~0xf), PtrVT)); > was16aligned = false; > return DAG.getLoad(MVT::v16i8, chain, basePtr, > LSN->getSrcValue(), LSN->getSrcValueOffset(), > @@ -706,21 +704,20 @@ > DEBUG(basePtr.Val->dump(&DAG)); > DEBUG(cerr << "\n"); > > - if (basePtr.getOpcode() == SPUISD::DFormAddr) { > - // Hmmmm... do we ever actually hit this code? > - insertEltPtr = DAG.getNode(SPUISD::DFormAddr, PtrVT, > - basePtr.getOperand(0), > - insertEltOffs); > - } else if (basePtr.getOpcode() == SPUISD::XFormAddr || > - (basePtr.getOpcode() == ISD::ADD > - && basePtr.getOperand(0).getOpcode() == SPUISD::XFormAddr)) { > + if (basePtr.getOpcode() == SPUISD::IndirectAddr || > + (basePtr.getOpcode() == ISD::ADD > + && basePtr.getOperand(0).getOpcode() == > SPUISD::IndirectAddr)) { > insertEltPtr = basePtr; > } else { > - // $sp is always aligned, so use it instead of potentially > loading an > - // address into a new register: > - insertEltPtr = DAG.getNode(SPUISD::DFormAddr, PtrVT, > - DAG.getRegister(SPU::R1, PtrVT), > - insertEltOffs); > +#if 0 > + // $sp is always aligned, so use it when necessary to avoid > loading > + // an address > + SDOperand ptrP = > + basePtr.Val->hasOneUse() ? DAG.getRegister(SPU::R1, > PtrVT) : basePtr; > + insertEltPtr = DAG.getNode(ISD::ADD, PtrVT, ptrP, > insertEltOffs); > +#else > + insertEltPtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, > insertEltOffs); > +#endif > } > > insertEltOp = DAG.getNode(SPUISD::INSERT_MASK, stVecVT, > insertEltPtr); > @@ -772,7 +769,7 @@ > > return DAG.getNode(ISD::ADD, PtrVT, Lo, Hi); > #else > - return DAG.getNode(SPUISD::XFormAddr, PtrVT, CPI, Zero); > + return DAG.getNode(SPUISD::IndirectAddr, PtrVT, CPI, Zero); > #endif > } > } > @@ -791,9 +788,10 @@ > const TargetMachine &TM = DAG.getTarget(); > > if (TM.getRelocationModel() == Reloc::Static) { > + SDOperand JmpAForm = DAG.getNode(SPUISD::AFormAddr, PtrVT, JTI, > Zero); > return (!ST->usingLargeMem() > - ? DAG.getNode(SPUISD::AFormAddr, PtrVT, JTI, Zero) > - : DAG.getNode(SPUISD::XFormAddr, PtrVT, JTI, Zero)); > + ? JmpAForm > + : DAG.getNode(SPUISD::IndirectAddr, PtrVT, JmpAForm, > Zero)); > } > > assert(0 && > @@ -811,9 +809,13 @@ > SDOperand Zero = DAG.getConstant(0, PtrVT); > > if (TM.getRelocationModel() == Reloc::Static) { > - return (!ST->usingLargeMem() > - ? DAG.getNode(SPUISD::AFormAddr, PtrVT, GA, Zero) > - : DAG.getNode(SPUISD::XFormAddr, PtrVT, GA, Zero)); > + if (!ST->usingLargeMem()) { > + return DAG.getNode(SPUISD::AFormAddr, PtrVT, GA, Zero); > + } else { > + SDOperand Hi = DAG.getNode(SPUISD::Hi, PtrVT, GA, Zero); > + SDOperand Lo = DAG.getNode(SPUISD::Lo, PtrVT, GA, Zero); > + return DAG.getNode(SPUISD::IndirectAddr, PtrVT, Hi, Lo); > + } > } else { > cerr << "LowerGlobalAddress: Relocation model other than static > not " > << "supported.\n"; > @@ -1202,7 +1204,7 @@ > } else { > // "Large memory" mode: Turn all calls into indirect calls > with a X-form > // address pairs: > - Callee = DAG.getNode(SPUISD::XFormAddr, PtrVT, GA, Zero); > + Callee = DAG.getNode(SPUISD::IndirectAddr, PtrVT, GA, Zero); > } > } else if (ExternalSymbolSDNode *S = > dyn_cast(Callee)) > Callee = DAG.getExternalSymbol(S->getSymbol(), > Callee.getValueType()); > @@ -2553,16 +2555,80 @@ > { > #if 0 > TargetMachine &TM = getTargetMachine(); > +#endif > + const SPUSubtarget *ST = SPUTM.getSubtargetImpl(); > SelectionDAG &DAG = DCI.DAG; > SDOperand N0 = N->getOperand(0); // everything has at least one > operand > > switch (N->getOpcode()) { > default: break; > - // Do something creative here for ISD nodes that can be > coalesced in unique > - // ways. > + case SPUISD::IndirectAddr: { > + if (!ST->usingLargeMem() && N0.getOpcode() == > SPUISD::AFormAddr) { > + ConstantSDNode *CN = cast(N->getOperand(1)); > + if (CN->getValue() == 0) { > + // (SPUindirect (SPUaform , 0), 0) -> > + // (SPUaform , 0) > + > + DEBUG(cerr << "Replace: "); > + DEBUG(N->dump(&DAG)); > + DEBUG(cerr << "\nWith: "); > + DEBUG(N0.Val->dump(&DAG)); > + DEBUG(cerr << "\n"); > + > + return N0; > + } > + } > + } > + case ISD::ADD: { > + SDOperand Op0 = N->getOperand(0); > + SDOperand Op1 = N->getOperand(1); > + > + if ((Op1.getOpcode() == ISD::Constant > + || Op1.getOpcode() == ISD::TargetConstant) > + && Op0.getOpcode() == SPUISD::IndirectAddr) { > + SDOperand Op01 = Op0.getOperand(1); > + if (Op01.getOpcode() == ISD::Constant > + || Op01.getOpcode() == ISD::TargetConstant) { > + // (add , (SPUindirect , )) -> > + // (SPUindirect , ) > + ConstantSDNode *CN0 = cast(Op1); > + ConstantSDNode *CN1 = cast(Op01); > + SDOperand combinedConst = > + DAG.getConstant(CN0->getValue() + CN1->getValue(), > + Op0.getValueType()); > + > + DEBUG(cerr << "Replace: (add " << CN0->getValue() << ", " > + << "(SPUindirect , " << CN1->getValue() << > "))\n"); > + DEBUG(cerr << "With: (SPUindirect , " > + << CN0->getValue() + CN1->getValue() << ")\n"); > + return DAG.getNode(SPUISD::IndirectAddr, Op0.getValueType(), > + Op0.getOperand(0), combinedConst); > + } > + } else if ((Op0.getOpcode() == ISD::Constant > + || Op0.getOpcode() == ISD::TargetConstant) > + && Op1.getOpcode() == SPUISD::IndirectAddr) { > + SDOperand Op11 = Op1.getOperand(1); > + if (Op11.getOpcode() == ISD::Constant > + || Op11.getOpcode() == ISD::TargetConstant) { > + // (add (SPUindirect , ), ) -> > + // (SPUindirect , ) > + ConstantSDNode *CN0 = cast(Op0); > + ConstantSDNode *CN1 = cast(Op11); > + SDOperand combinedConst = > + DAG.getConstant(CN0->getValue() + CN1->getValue(), > + Op0.getValueType()); > + > + DEBUG(cerr << "Replace: (add " << CN0->getValue() << ", " > + << "(SPUindirect , " << CN1->getValue() << > "))\n"); > + DEBUG(cerr << "With: (SPUindirect , " > + << CN0->getValue() + CN1->getValue() << ")\n"); > + > + return DAG.getNode(SPUISD::IndirectAddr, Op1.getValueType(), > + Op1.getOperand(0), combinedConst); > + } > + } > + } > } > -#endif > - > // Otherwise, return unchanged. > return SDOperand(); > } > > Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h Mon Jan 28 > 20:16:57 2008 > @@ -32,8 +32,7 @@ > Lo, ///< Low address component (lower 16) > PCRelAddr, ///< Program counter relative address > AFormAddr, ///< A-form address (local store) > - DFormAddr, ///< D-Form address "imm($r)" > - XFormAddr, ///< X-Form address "$r($r)" > + IndirectAddr, ///< D-Form "imm($r)" and X-form > "$r($r)" > > LDRESULT, ///< Load result (value, chain) > CALL, ///< CALL instruction > > Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUInstrFormats.td Mon Jan 28 > 20:16:57 2008 > @@ -247,6 +247,10 @@ > { } > } > > +// > = > = > = > ----------------------------------------------------------------------= > ==// > +// Specialized versions of RI16: > +// > = > = > = > ----------------------------------------------------------------------= > ==// > + > // RI18 Format > class RI18Form opcode, dag OOL, dag IOL, string asmstr, > InstrItinClass itin, list pattern> > > Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Mon Jan 28 > 20:16:57 2008 > @@ -48,205 +48,109 @@ > // > = > = > = > ----------------------------------------------------------------------= > ==// > > let isSimpleLoad = 1 in { > - def LQDv16i8: > - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set (v16i8 VECREG:$rT), (load dform_addr:$src))]>; > - > - def LQDv8i16: > - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set (v8i16 VECREG:$rT), (load dform_addr:$src))]>; > - > - def LQDv4i32: > - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set (v4i32 VECREG:$rT), (load dform_addr:$src))]>; > - > - def LQDv2i64: > - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set (v2i64 VECREG:$rT), (load dform_addr:$src))]>; > - > - def LQDv4f32: > - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set (v4f32 VECREG:$rT), (load dform_addr:$src))]>; > - > - def LQDv2f64: > - RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set (v2f64 VECREG:$rT), (load dform_addr:$src))]>; > - > - def LQDr128: > - RI10Form<0b00101100, (outs GPRC:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set GPRC:$rT, (load dform_addr:$src))]>; > - > - def LQDr64: > - RI10Form<0b00101100, (outs R64C:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set R64C:$rT, (load dform_addr:$src))]>; > - > - def LQDr32: > - RI10Form<0b00101100, (outs R32C:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set R32C:$rT, (load dform_addr:$src))]>; > - > - // Floating Point > - def LQDf32: > - RI10Form<0b00101100, (outs R32FP:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set R32FP:$rT, (load dform_addr:$src))]>; > - > - def LQDf64: > - RI10Form<0b00101100, (outs R64FP:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set R64FP:$rT, (load dform_addr:$src))]>; > - // END Floating Point > - > - def LQDr16: > - RI10Form<0b00101100, (outs R16C:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set R16C:$rT, (load dform_addr:$src))]>; > - > - def LQDr8: > - RI10Form<0b00101100, (outs R8C:$rT), (ins memri10:$src), > - "lqd\t$rT, $src", LoadStore, > - [(set R8C:$rT, (load dform_addr:$src))]>; > - > - def LQAv16i8: > - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set (v16i8 VECREG:$rT), (load aform_addr:$src))]>; > - > - def LQAv8i16: > - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set (v8i16 VECREG:$rT), (load aform_addr:$src))]>; > - > - def LQAv4i32: > - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set (v4i32 VECREG:$rT), (load aform_addr:$src))]>; > - > - def LQAv2i64: > - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set (v2i64 VECREG:$rT), (load aform_addr:$src))]>; > - > - def LQAv4f32: > - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set (v4f32 VECREG:$rT), (load aform_addr:$src))]>; > - > - def LQAv2f64: > - RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set (v2f64 VECREG:$rT), (load aform_addr:$src))]>; > - > - def LQAr128: > - RI16Form<0b100001100, (outs GPRC:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set GPRC:$rT, (load aform_addr:$src))]>; > - > - def LQAr64: > - RI16Form<0b100001100, (outs R64C:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set R64C:$rT, (load aform_addr:$src))]>; > - > - def LQAr32: > - RI16Form<0b100001100, (outs R32C:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set R32C:$rT, (load aform_addr:$src))]>; > - > - def LQAf32: > - RI16Form<0b100001100, (outs R32FP:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set R32FP:$rT, (load aform_addr:$src))]>; > - > - def LQAf64: > - RI16Form<0b100001100, (outs R64FP:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set R64FP:$rT, (load aform_addr:$src))]>; > - > - def LQAr16: > - RI16Form<0b100001100, (outs R16C:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set R16C:$rT, (load aform_addr:$src))]>; > - > - def LQAr8: > - RI16Form<0b100001100, (outs R8C:$rT), (ins addr256k:$src), > - "lqa\t$rT, $src", LoadStore, > - [(set R8C:$rT, (load aform_addr:$src))]>; > - > - def LQXv16i8: > - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set (v16i8 VECREG:$rT), (load xform_addr:$src))]>; > - > - def LQXv8i16: > - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set (v8i16 VECREG:$rT), (load xform_addr:$src))]>; > - > - def LQXv4i32: > - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set (v4i32 VECREG:$rT), (load xform_addr:$src))]>; > - > - def LQXv2i64: > - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set (v2i64 VECREG:$rT), (load xform_addr:$src))]>; > - > - def LQXv4f32: > - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set (v4f32 VECREG:$rT), (load xform_addr:$src))]>; > - > - def LQXv2f64: > - RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set (v2f64 VECREG:$rT), (load xform_addr:$src))]>; > - > - def LQXr128: > - RRForm<0b00100011100, (outs GPRC:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set GPRC:$rT, (load xform_addr:$src))]>; > - > - def LQXr64: > - RRForm<0b00100011100, (outs R64C:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set R64C:$rT, (load xform_addr:$src))]>; > - > - def LQXr32: > - RRForm<0b00100011100, (outs R32C:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set R32C:$rT, (load xform_addr:$src))]>; > - > - def LQXf32: > - RRForm<0b00100011100, (outs R32FP:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set R32FP:$rT, (load xform_addr:$src))]>; > - > - def LQXf64: > - RRForm<0b00100011100, (outs R64FP:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set R64FP:$rT, (load xform_addr:$src))]>; > - > - def LQXr16: > - RRForm<0b00100011100, (outs R16C:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set R16C:$rT, (load xform_addr:$src))]>; > - > - def LQXr8: > - RRForm<0b00100011100, (outs R8C:$rT), (ins memrr:$src), > - "lqx\t$rT, $src", LoadStore, > - [(set R8C:$rT, (load xform_addr:$src))]>; > + class LoadDFormVec > + : RI10Form<0b00101100, (outs VECREG:$rT), (ins memri10:$src), > + "lqd\t$rT, $src", > + LoadStore, > + [(set (vectype VECREG:$rT), (load dform_addr:$src))]> > + { } > + > + class LoadDForm > + : RI10Form<0b00101100, (outs rclass:$rT), (ins memri10:$src), > + "lqd\t$rT, $src", > + LoadStore, > + [(set rclass:$rT, (load dform_addr:$src))]> > + { } > + > + multiclass LoadDForms > + { > + def v16i8: LoadDFormVec; > + def v8i16: LoadDFormVec; > + def v4i32: LoadDFormVec; > + def v2i64: LoadDFormVec; > + def v4f32: LoadDFormVec; > + def v2f64: LoadDFormVec; > + > + def r128: LoadDForm; > + def r64: LoadDForm; > + def r32: LoadDForm; > + def f32: LoadDForm; > + def f64: LoadDForm; > + def r16: LoadDForm; > + def r8: LoadDForm; > + } > + > + class LoadAFormVec > + : RI16Form<0b100001100, (outs VECREG:$rT), (ins addr256k:$src), > + "lqa\t$rT, $src", > + LoadStore, > + [(set (vectype VECREG:$rT), (load aform_addr:$src))]> > + { } > + > + class LoadAForm > + : RI16Form<0b100001100, (outs rclass:$rT), (ins addr256k:$src), > + "lqa\t$rT, $src", > + LoadStore, > + [(set rclass:$rT, (load aform_addr:$src))]> > + { } > + > + multiclass LoadAForms > + { > + def v16i8: LoadAFormVec; > + def v8i16: LoadAFormVec; > + def v4i32: LoadAFormVec; > + def v2i64: LoadAFormVec; > + def v4f32: LoadAFormVec; > + def v2f64: LoadAFormVec; > + > + def r128: LoadAForm; > + def r64: LoadAForm; > + def r32: LoadAForm; > + def f32: LoadAForm; > + def f64: LoadAForm; > + def r16: LoadAForm; > + def r8: LoadAForm; > + } > + > + class LoadXFormVec > + : RRForm<0b00100011100, (outs VECREG:$rT), (ins memrr:$src), > + "lqx\t$rT, $src", > + LoadStore, > + [(set (vectype VECREG:$rT), (load xform_addr:$src))]> > + { } > + > + class LoadXForm > + : RRForm<0b00100011100, (outs rclass:$rT), (ins memrr:$src), > + "lqx\t$rT, $src", > + LoadStore, > + [(set rclass:$rT, (load xform_addr:$src))]> > + { } > + > + multiclass LoadXForms > + { > + def v16i8: LoadXFormVec; > + def v8i16: LoadXFormVec; > + def v4i32: LoadXFormVec; > + def v2i64: LoadXFormVec; > + def v4f32: LoadXFormVec; > + def v2f64: LoadXFormVec; > + > + def r128: LoadXForm; > + def r64: LoadXForm; > + def r32: LoadXForm; > + def f32: LoadXForm; > + def f64: LoadXForm; > + def r16: LoadXForm; > + def r8: LoadXForm; > + } > + > + defm LQA : LoadAForms; > + defm LQD : LoadDForms; > + defm LQX : LoadXForms; > > /* Load quadword, PC relative: Not much use at this point in time. > - Might be of use later for relocatable code. > + Might be of use later for relocatable code. It's effectively the > + same as LQA, but uses PC-relative addressing. > def LQR : RI16Form<0b111001100, (outs VECREG:$rT), (ins s16imm: > $disp), > "lqr\t$rT, $disp", LoadStore, > [(set VECREG:$rT, (load iaddr:$disp))]>; > @@ -256,174 +160,108 @@ > // > = > = > = > ----------------------------------------------------------------------= > ==// > // Stores: > // > = > = > = > ----------------------------------------------------------------------= > ==// > +class StoreDFormVec > + : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memri10:$src), > + "stqd\t$rT, $src", > + LoadStore, > + [(store (vectype VECREG:$rT), dform_addr:$src)]> > +{ } > + > +class StoreDForm > + : RI10Form<0b00100100, (outs), (ins rclass:$rT, memri10:$src), > + "stqd\t$rT, $src", > + LoadStore, > + [(store rclass:$rT, dform_addr:$src)]> > +{ } > + > +multiclass StoreDForms > +{ > + def v16i8: StoreDFormVec; > + def v8i16: StoreDFormVec; > + def v4i32: StoreDFormVec; > + def v2i64: StoreDFormVec; > + def v4f32: StoreDFormVec; > + def v2f64: StoreDFormVec; > + > + def r128: StoreDForm; > + def r64: StoreDForm; > + def r32: StoreDForm; > + def f32: StoreDForm; > + def f64: StoreDForm; > + def r16: StoreDForm; > + def r8: StoreDForm; > +} > + > +class StoreAFormVec > + : RI16Form<0b0010010, (outs), (ins VECREG:$rT, addr256k:$src), > + "stqa\t$rT, $src", > + LoadStore, > + [(store (vectype VECREG:$rT), aform_addr:$src)]> > +{ } > + > +class StoreAForm > + : RI16Form<0b001001, (outs), (ins rclass:$rT, addr256k:$src), > + "stqa\t$rT, $src", > + LoadStore, > + [(store rclass:$rT, aform_addr:$src)]> > +{ } > + > +multiclass StoreAForms > +{ > + def v16i8: StoreAFormVec; > + def v8i16: StoreAFormVec; > + def v4i32: StoreAFormVec; > + def v2i64: StoreAFormVec; > + def v4f32: StoreAFormVec; > + def v2f64: StoreAFormVec; > + > + def r128: StoreAForm; > + def r64: StoreAForm; > + def r32: StoreAForm; > + def f32: StoreAForm; > + def f64: StoreAForm; > + def r16: StoreAForm; > + def r8: StoreAForm; > +} > + > +class StoreXFormVec > + : RRForm<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), > + "stqx\t$rT, $src", > + LoadStore, > + [(store (vectype VECREG:$rT), xform_addr:$src)]> > +{ } > + > +class StoreXForm > + : RRForm<0b00100100, (outs), (ins rclass:$rT, memrr:$src), > + "stqx\t$rT, $src", > + LoadStore, > + [(store rclass:$rT, xform_addr:$src)]> > +{ } > + > +multiclass StoreXForms > +{ > + def v16i8: StoreXFormVec; > + def v8i16: StoreXFormVec; > + def v4i32: StoreXFormVec; > + def v2i64: StoreXFormVec; > + def v4f32: StoreXFormVec; > + def v2f64: StoreXFormVec; > + > + def r128: StoreXForm; > + def r64: StoreXForm; > + def r32: StoreXForm; > + def f32: StoreXForm; > + def f64: StoreXForm; > + def r16: StoreXForm; > + def r8: StoreXForm; > +} > > -def STQDv16i8 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store (v16i8 VECREG:$rT), dform_addr:$src)]>; > - > -def STQDv8i16 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store (v8i16 VECREG:$rT), dform_addr:$src)]>; > - > -def STQDv4i32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store (v4i32 VECREG:$rT), dform_addr:$src)]>; > - > -def STQDv2i64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store (v2i64 VECREG:$rT), dform_addr:$src)]>; > - > -def STQDv4f32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store (v4f32 VECREG:$rT), dform_addr:$src)]>; > - > -def STQDv2f64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store (v2f64 VECREG:$rT), dform_addr:$src)]>; > - > -def STQDr128 : RI10Form<0b00100100, (outs), (ins GPRC:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store GPRC:$rT, dform_addr:$src)]>; > - > -def STQDr64 : RI10Form<0b00100100, (outs), (ins R64C:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store R64C:$rT, dform_addr:$src)]>; > - > -def STQDr32 : RI10Form<0b00100100, (outs), (ins R32C:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store R32C:$rT, dform_addr:$src)]>; > - > -// Floating Point > -def STQDf32 : RI10Form<0b00100100, (outs), (ins R32FP:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store R32FP:$rT, dform_addr:$src)]>; > - > -def STQDf64 : RI10Form<0b00100100, (outs), (ins R64FP:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store R64FP:$rT, dform_addr:$src)]>; > - > -def STQDr16 : RI10Form<0b00100100, (outs), (ins R16C:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store R16C:$rT, dform_addr:$src)]>; > - > -def STQDr8 : RI10Form<0b00100100, (outs), (ins R8C:$rT, > memri10:$src), > - "stqd\t$rT, $src", LoadStore, > - [(store R8C:$rT, dform_addr:$src)]>; > - > -def STQAv16i8 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > addr256k:$src), > - "stqa\t$rT, $src", LoadStore, > - [(store (v16i8 VECREG:$rT), aform_addr:$src)]>; > - > -def STQAv8i16 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > addr256k:$src), > - "stqa\t$rT, $src", LoadStore, > - [(store (v8i16 VECREG:$rT), aform_addr:$src)]>; > - > -def STQAv4i32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > addr256k:$src), > - "stqa\t$rT, $src", LoadStore, > - [(store (v4i32 VECREG:$rT), aform_addr:$src)]>; > - > -def STQAv2i64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > addr256k:$src), > - "stqa\t$rT, $src", LoadStore, > - [(store (v2i64 VECREG:$rT), aform_addr:$src)]>; > - > -def STQAv4f32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > addr256k:$src), > - "stqa\t$rT, $src", LoadStore, > - [(store (v4f32 VECREG:$rT), aform_addr:$src)]>; > - > -def STQAv2f64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, > addr256k:$src), > - "stqa\t$rT, $src", LoadStore, > - [(store (v2f64 VECREG:$rT), aform_addr:$src)]>; > - > -def STQAr128 : RI10Form<0b00100100, (outs), (ins GPRC:$rT, addr256k: > $src), > - "stqa\t$rT, $src", LoadStore, > - [(store GPRC:$rT, aform_addr:$src)]>; > - > -def STQAr64 : RI10Form<0b00100100, (outs), (ins R64C:$rT, addr256k: > $src), > - "stqa\t$rT, $src", LoadStore, > - [(store R64C:$rT, aform_addr:$src)]>; > - > -def STQAr32 : RI10Form<0b00100100, (outs), (ins R32C:$rT, addr256k: > $src), > - "stqa\t$rT, $src", LoadStore, > - [(store R32C:$rT, aform_addr:$src)]>; > - > -// Floating Point > -def STQAf32 : RI10Form<0b00100100, (outs), (ins R32FP:$rT, addr256k: > $src), > - "stqa\t$rT, $src", LoadStore, > - [(store R32FP:$rT, aform_addr:$src)]>; > - > -def STQAf64 : RI10Form<0b00100100, (outs), (ins R64FP:$rT, addr256k: > $src), > - "stqa\t$rT, $src", LoadStore, > - [(store R64FP:$rT, aform_addr:$src)]>; > - > -def STQAr16 : RI10Form<0b00100100, (outs), (ins R16C:$rT, addr256k: > $src), > - "stqa\t$rT, $src", LoadStore, > - [(store R16C:$rT, aform_addr:$src)]>; > - > -def STQAr8 : RI10Form<0b00100100, (outs), (ins R8C:$rT, addr256k: > $src), > - "stqa\t$rT, $src", LoadStore, > - [(store R8C:$rT, aform_addr:$src)]>; > - > -def STQXv16i8 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr: > $src), > - "stqx\t$rT, $src", LoadStore, > - [(store (v16i8 VECREG:$rT), xform_addr:$src)]>; > - > -def STQXv8i16 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr: > $src), > - "stqx\t$rT, $src", LoadStore, > - [(store (v8i16 VECREG:$rT), xform_addr:$src)]>; > - > -def STQXv4i32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr: > $src), > - "stqx\t$rT, $src", LoadStore, > - [(store (v4i32 VECREG:$rT), xform_addr:$src)]>; > - > -def STQXv2i64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr: > $src), > - "stqx\t$rT, $src", LoadStore, > - [(store (v2i64 VECREG:$rT), xform_addr:$src)]>; > - > -def STQXv4f32 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr: > $src), > - "stqx\t$rT, $src", LoadStore, > - [(store (v4f32 VECREG:$rT), xform_addr:$src)]>; > - > -def STQXv2f64 : RI10Form<0b00100100, (outs), (ins VECREG:$rT, memrr: > $src), > - "stqx\t$rT, $src", LoadStore, > - [(store (v2f64 VECREG:$rT), xform_addr:$src)]>; > - > -def STQXr128 : RI10Form<0b00100100, (outs), (ins GPRC:$rT, memrr: > $src), > - "stqx\t$rT, $src", LoadStore, > - [(store GPRC:$rT, xform_addr:$src)]>; > - > -def STQXr64: > - RI10Form<0b00100100, (outs), (ins R64C:$rT, memrr:$src), > - "stqx\t$rT, $src", LoadStore, > - [(store R64C:$rT, xform_addr:$src)]>; > - > -def STQXr32: > - RI10Form<0b00100100, (outs), (ins R32C:$rT, memrr:$src), > - "stqx\t$rT, $src", LoadStore, > - [(store R32C:$rT, xform_addr:$src)]>; > - > -// Floating Point > -def STQXf32: > - RI10Form<0b00100100, (outs), (ins R32FP:$rT, memrr:$src), > - "stqx\t$rT, $src", LoadStore, > - [(store R32FP:$rT, xform_addr:$src)]>; > - > -def STQXf64: > - RI10Form<0b00100100, (outs), (ins R64FP:$rT, memrr:$src), > - "stqx\t$rT, $src", LoadStore, > - [(store R64FP:$rT, xform_addr:$src)]>; > - > -def STQXr16: > - RI10Form<0b00100100, (outs), (ins R16C:$rT, memrr:$src), > - "stqx\t$rT, $src", LoadStore, > - [(store R16C:$rT, xform_addr:$src)]>; > - > -def STQXr8: > - RI10Form<0b00100100, (outs), (ins R8C:$rT, memrr:$src), > - "stqx\t$rT, $src", LoadStore, > - [(store R8C:$rT, xform_addr:$src)]>; > +defm STQD : StoreDForms; > +defm STQA : StoreAForms; > +defm STQX : StoreXForms; > > /* Store quadword, PC relative: Not much use at this point in time. > Might > - be useful for relocatable code. > + be useful for relocatable code. > def STQR : RI16Form<0b111000100, (outs), (ins VECREG:$rT, s16imm: > $disp), > "stqr\t$rT, $disp", LoadStore, > [(store VECREG:$rT, iaddr:$disp)]>; > @@ -620,17 +458,22 @@ > // Form select mask for bytes using immediate, used in conjunction > with the > // SELB instruction: > > -def FSMBIv16i8 : RI16Form<0b101001100, (outs VECREG:$rT), (ins > u16imm:$val), > - "fsmbi\t$rT, $val", SelectOp, > - [(set (v16i8 VECREG:$rT), (SPUfsmbi_v16i8 immU16:$val))]>; > - > -def FSMBIv8i16 : RI16Form<0b101001100, (outs VECREG:$rT), (ins > u16imm:$val), > - "fsmbi\t$rT, $val", SelectOp, > - [(set (v8i16 VECREG:$rT), (SPUfsmbi_v8i16 immU16:$val))]>; > - > -def FSMBIvecv4i32 : RI16Form<0b101001100, (outs VECREG:$rT), (ins > u16imm:$val), > - "fsmbi\t$rT, $val", SelectOp, > - [(set (v4i32 VECREG:$rT), (SPUfsmbi_v4i32 immU16:$val))]>; > +class FSMBIVec > + : RI16Form<0b101001100, (outs VECREG:$rT), (ins u16imm:$val), > + "fsmbi\t$rT, $val", > + SelectOp, > + [(set (vectype VECREG:$rT), (SPUfsmbi immU16:$val))]> > +{ } > + > +multiclass FSMBIs > +{ > + def v16i8: FSMBIVec; > + def v8i16: FSMBIVec; > + def v4i32: FSMBIVec; > + def v2i64: FSMBIVec; > +} > + > +defm FSMBI : FSMBIs; > > // > = > = > = > ----------------------------------------------------------------------= > ==// > // Integer and Logical Operations: > @@ -2762,17 +2605,17 @@ > def CEQr32: > RRForm<0b00000011110, (outs R32C:$rT), (ins R32C:$rA, R32C:$rB), > "ceq\t$rT, $rA, $rB", ByteOp, > - [/* no pattern to match: intrinsic */]>; > + [(set R32C:$rT, (seteq R32C:$rA, R32C:$rB))]>; > > def CEQv4i32: > RRForm<0b00000011110, (outs VECREG:$rT), (ins VECREG:$rA, VECREG: > $rB), > "ceq\t$rT, $rA, $rB", ByteOp, > - [/* no pattern to match: intrinsic */]>; > + [(set (v4i32 VECREG:$rT), (seteq (v4i32 VECREG:$rA), (v4i32 > VECREG:$rB)))]>; > > def CEQIr32: > - RI10Form<0b00111110, (outs R32C:$rT), (ins R32C:$rA, s10imm:$val), > + RI10Form<0b00111110, (outs R32C:$rT), (ins R32C:$rA, > s10imm_i32:$val), > "ceqi\t$rT, $rA, $val", ByteOp, > - [/* no pattern to match: intrinsic */]>; > + [(set R32C:$rT, (seteq R32C:$rA, i32ImmSExt10:$val))]>; > > def CEQIv4i32: > RI10Form<0b00111110, (outs VECREG:$rT), (ins VECREG:$rA, s10imm: > $val), > @@ -2872,18 +2715,29 @@ > } > > // > = > = > = > ----------------------------------------------------------------------= > ==// > -// brcond predicates: > +// setcc and brcond patterns: > // > = > = > = > ----------------------------------------------------------------------= > ==// > + > def : Pat<(brcond (i16 (seteq R16C:$rA, 0)), bb:$dest), > (BRHZ R16C:$rA, bb:$dest)>; > -def : Pat<(brcond (i16 (setne R16C:$rA, 0)), bb:$dest), > - (BRHNZ R16C:$rA, bb:$dest)>; > - > def : Pat<(brcond (i32 (seteq R32C:$rA, 0)), bb:$dest), > (BRZ R32C:$rA, bb:$dest)>; > + > +def : Pat<(brcond (i16 (setne R16C:$rA, 0)), bb:$dest), > + (BRHNZ R16C:$rA, bb:$dest)>; > def : Pat<(brcond (i32 (setne R32C:$rA, 0)), bb:$dest), > (BRNZ R32C:$rA, bb:$dest)>; > > +def : Pat<(brcond (i16 (setne R16C:$rA, i16ImmSExt10:$val)), bb: > $dest), > + (BRHNZ (CEQHIr16 R16C:$rA, i16ImmSExt10:$val), bb:$dest)>; > +def : Pat<(brcond (i32 (setne R32C:$rA, i32ImmSExt10:$val)), bb: > $dest), > + (BRNZ (CEQIr32 R32C:$rA, i32ImmSExt10:$val), bb:$dest)>; > + > +def : Pat<(brcond (i16 (setne R16C:$rA, R16C:$rB)), bb:$dest), > + (BRHNZ (CEQHr16 R16C:$rA, R16:$rB), bb:$dest)>; > +def : Pat<(brcond (i32 (setne R32C:$rA, R32C:$rB)), bb:$dest), > + (BRNZ (CEQr32 R32C:$rA, R32C:$rB), bb:$dest)>; > + > let isTerminator = 1, isBarrier = 1 in { > let isReturn = 1 in { > def RET: > @@ -3460,24 +3314,42 @@ > (ORI2To4 R16C:$rSrc, 0)>; > > // > = > = > = > ----------------------------------------------------------------------= > ==// > -// Address translation: SPU, like PPC, has to split addresses into > high and > +// Address generation: SPU, like PPC, has to split addresses into > high and > // low parts in order to load them into a register. > // > = > = > = > ----------------------------------------------------------------------= > ==// > > -def : Pat<(SPUaform tglobaladdr:$in, 0), (ILAlsa tglobaladdr: > $in)>; > -def : Pat<(SPUxform tglobaladdr:$in, 0), > +def : Pat<(SPUaform tglobaladdr:$in, 0), (ILAlsa tglobaladdr:$in)>; > +def : Pat<(SPUaform texternalsym:$in, 0), (ILAlsa texternalsym:$in)>; > +def : Pat<(SPUaform tjumptable:$in, 0), (ILAlsa tjumptable:$in)>; > +def : Pat<(SPUaform tconstpool:$in, 0), (ILAlsa tconstpool:$in)>; > + > +def : Pat<(SPUindirect (SPUhi tglobaladdr:$in, 0), > + (SPUlo tglobaladdr:$in, 0)), > + (IOHLlo (ILHUhi tglobaladdr:$in), tglobaladdr:$in)>; > + > +def : Pat<(SPUindirect (SPUhi texternalsym:$in, 0), > + (SPUlo texternalsym:$in, 0)), > + (IOHLlo (ILHUhi texternalsym:$in), texternalsym:$in)>; > + > +def : Pat<(SPUindirect (SPUhi tjumptable:$in, 0), > + (SPUlo tjumptable:$in, 0)), > + (IOHLlo (ILHUhi tjumptable:$in), tjumptable:$in)>; > + > +def : Pat<(SPUindirect (SPUhi tconstpool:$in, 0), > + (SPUlo tconstpool:$in, 0)), > + (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>; > + > +def : Pat<(add (SPUhi tglobaladdr:$in, 0), (SPUlo tglobaladdr:$in, > 0)), > (IOHLlo (ILHUhi tglobaladdr:$in), tglobaladdr:$in)>; > > -def : Pat<(SPUaform tjumptable:$in, 0), (ILAlsa tjumptable: > $in)>; > -def : Pat<(SPUxform tjumptable:$in, 0), > +def : Pat<(add (SPUhi texternalsym:$in, 0), (SPUlo texternalsym: > $in, 0)), > + (IOHLlo (ILHUhi texternalsym:$in), texternalsym:$in)>; > + > +def : Pat<(add (SPUhi tjumptable:$in, 0), (SPUlo tjumptable:$in, 0)), > (IOHLlo (ILHUhi tjumptable:$in), tjumptable:$in)>; > > -def : Pat<(SPUhi tconstpool:$in , 0), (ILHUhi tconstpool: > $in)>; > -def : Pat<(SPUlo tconstpool:$in , 0), (ILAlsa tconstpool: > $in)>; > -def : Pat<(SPUaform tconstpool:$in, 0), (ILAlsa tconstpool: > $in)>; > -// tblgen bug prevents this from working. > -// def : Pat<(SPUxform tconstpool:$in, 0), > -// (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>; > +def : Pat<(add (SPUhi tconstpool:$in, 0), (SPUlo tconstpool:$in, 0)), > + (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>; > > // Instrinsics: > include "CellSDKIntrinsics.td" > > Modified: llvm/trunk/lib/Target/CellSPU/SPUNodes.td > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUNodes.td?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUNodes.td (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUNodes.td Mon Jan 28 20:16:57 2008 > @@ -58,14 +58,8 @@ > > // FSMBI type constraints: There are several variations for the > various > // vector types (this avoids having to bit_convert all over the > place.) > -def SPUfsmbi_type_v16i8: SDTypeProfile<1, 1, [ > - SDTCisVT<0, v16i8>, SDTCisVT<1, i32>]>; > - > -def SPUfsmbi_type_v8i16: SDTypeProfile<1, 1, [ > - SDTCisVT<0, v8i16>, SDTCisVT<1, i32>]>; > - > -def SPUfsmbi_type_v4i32: SDTypeProfile<1, 1, [ > - SDTCisVT<0, v4i32>, SDTCisVT<1, i32>]>; > +def SPUfsmbi_type: SDTypeProfile<1, 1, [ > + SDTCisVT<1, i32>]>; > > // SELB type constraints: > def SPUselb_type_v16i8: SDTypeProfile<1, 3, [ > @@ -148,9 +142,7 @@ > SPUvecshift_type_v16i8, > [SDNPHasChain]>; > > // SPU form select mask for bytes, immediate > -def SPUfsmbi_v16i8: SDNode<"SPUISD::FSMBI", SPUfsmbi_type_v16i8, []>; > -def SPUfsmbi_v8i16: SDNode<"SPUISD::FSMBI", SPUfsmbi_type_v8i16, []>; > -def SPUfsmbi_v4i32: SDNode<"SPUISD::FSMBI", SPUfsmbi_type_v4i32, []>; > +def SPUfsmbi: SDNode<"SPUISD::FSMBI", SPUfsmbi_type, []>; > > // SPU select bits instruction > def SPUselb_v16i8: SDNode<"SPUISD::SELB", SPUselb_type_v16i8, []>; > @@ -189,11 +181,8 @@ > // A-Form local store addresses > def SPUaform : SDNode<"SPUISD::AFormAddr", SDTIntBinOp, []>; > > -// D-Form "imm($reg)" addresses > -def SPUdform : SDNode<"SPUISD::DFormAddr", SDTIntBinOp, []>; > - > -// X-Form "$reg($reg)" addresses > -def SPUxform : SDNode<"SPUISD::XFormAddr", SDTIntBinOp, []>; > +// Indirect [D-Form "imm($reg)" and X-Form "$reg($reg)"] addresses > +def SPUindirect : SDNode<"SPUISD::IndirectAddr", SDTIntBinOp, []>; > > // Load result node > def SPUload_result : SDTypeProfile<1, 3, []>; > > Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp (original) > +++ llvm/trunk/lib/Target/CellSPU/SPUTargetAsmInfo.cpp Mon Jan 28 > 20:16:57 2008 > @@ -17,6 +17,7 @@ > using namespace llvm; > > SPUTargetAsmInfo::SPUTargetAsmInfo(const SPUTargetMachine &TM) { > + PCSymbol = "."; > CommentString = "#"; > GlobalPrefix = ""; > PrivateGlobalPrefix = ".L"; > @@ -24,17 +25,14 @@ > SetDirective = "\t.set"; > Data64bitsDirective = "\t.quad\t"; > AlignmentIsInBytes = false; > - SwitchToSectionDirective = "\t.section\t"; > + SwitchToSectionDirective = ".section\t"; > ConstantPoolSection = "\t.const\t"; > JumpTableDataSection = ".const"; > CStringSection = "\t.cstring"; > - LCOMMDirective = "\t.lcomm\t"; > StaticCtorsSection = ".mod_init_func"; > StaticDtorsSection = ".mod_term_func"; > FourByteConstantSection = ".const"; > SixteenByteConstantSection = "\t.section\t.rodata.cst16,\"aM > \", at progbits,16"; > - UsedDirective = "\t.no_dead_strip\t"; > - WeakRefDirective = "\t.weak_reference\t"; > InlineAsmStart = "# InlineAsm Start"; > InlineAsmEnd = "# InlineAsm End"; > > > Modified: llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll (original) > +++ llvm/trunk/test/CodeGen/CellSPU/call_indirect.ll Mon Jan 28 > 20:16:57 2008 > @@ -1,19 +1,18 @@ > ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s > ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s > -; RUN: grep bisl %t1.s | count 7 > +; RUN: grep bisl %t1.s | count 7 > ; RUN: grep ila %t1.s | count 1 > ; RUN: grep rotqbyi %t1.s | count 4 > -; RUN: grep lqa %t1.s | count 5 > -; RUN: grep lqd %t1.s | count 6 > -; RUN: grep dispatch_tab %t1.s | count 10 > +; RUN: grep lqa %t1.s | count 1 > +; RUN: grep lqd %t1.s | count 11 > +; RUN: grep dispatch_tab %t1.s | count 6 > ; RUN: grep bisl %t2.s | count 7 > ; RUN: grep ilhu %t2.s | count 2 > ; RUN: grep iohl %t2.s | count 2 > ; RUN: grep rotqby %t2.s | count 6 > -; RUN: grep lqd %t2.s | count 12 > -; RUN: grep lqx %t2.s | count 8 > -; RUN: grep il %t2.s | count 9 > -; RUN: grep ai %t2.s | count 5 > +; RUN: grep lqd %t2.s | count 17 > +; RUN: grep il %t2.s | count 2 > +; RUN: grep ai %t2.s | count 7 > ; RUN: grep dispatch_tab %t2.s | count 7 > > ; ModuleID = 'call_indirect.bc' > > Modified: llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll (original) > +++ llvm/trunk/test/CodeGen/CellSPU/extract_elt.ll Mon Jan 28 > 20:16:57 2008 > @@ -2,7 +2,7 @@ > ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s > ; RUN: grep shufb %t1.s | count 27 > ; RUN: grep lqa %t1.s | count 27 > -; RUN: grep lqx %t2.s | count 27 > +; RUN: grep lqd %t2.s | count 27 > ; RUN: grep space %t1.s | count 8 > ; RUN: grep byte %t1.s | count 424 > target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128- > i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128- > s0:128:128" > > Modified: llvm/trunk/test/CodeGen/CellSPU/fcmp.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/fcmp.ll?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/fcmp.ll (original) > +++ llvm/trunk/test/CodeGen/CellSPU/fcmp.ll Mon Jan 28 20:16:57 2008 > @@ -1,5 +1,5 @@ > ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s > -; RUN: grep fceq %t1.s | count 1 && > +; RUN: grep fceq %t1.s | count 1 > ; RUN: grep fcmeq %t1.s | count 1 > ; > ; This file includes standard floating point arithmetic instructions > > Modified: llvm/trunk/test/CodeGen/CellSPU/struct_1.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/struct_1.ll?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/struct_1.ll (original) > +++ llvm/trunk/test/CodeGen/CellSPU/struct_1.ll Mon Jan 28 20:16:57 > 2008 > @@ -1,27 +1,26 @@ > ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s > ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s > -; RUN: grep lqa %t1.s | count 10 > -; RUN: grep lqd %t1.s | count 4 > -; RUN: grep rotqbyi %t1.s | count 5 > +; RUN: grep lqa %t1.s | count 5 > +; RUN: grep lqd %t1.s | count 11 > +; RUN: grep rotqbyi %t1.s | count 7 > ; RUN: grep xshw %t1.s | count 1 > -; RUN: grep andi %t1.s | count 4 > +; RUN: grep andi %t1.s | count 5 > ; RUN: grep cbd %t1.s | count 3 > ; RUN: grep chd %t1.s | count 1 > ; RUN: grep cwd %t1.s | count 3 > ; RUN: grep shufb %t1.s | count 7 > -; RUN: grep stqa %t1.s | count 5 > -; RUN: grep iohl %t2.s | count 14 > -; RUN: grep ilhu %t2.s | count 14 > -; RUN: grep lqx %t2.s | count 14 > -; RUN: grep rotqbyi %t2.s | count 5 > +; RUN: grep stqd %t1.s | count 7 > +; RUN: grep iohl %t2.s | count 16 > +; RUN: grep ilhu %t2.s | count 16 > +; RUN: grep lqd %t2.s | count 16 > +; RUN: grep rotqbyi %t2.s | count 7 > ; RUN: grep xshw %t2.s | count 1 > -; RUN: grep andi %t2.s | count 4 > -; RUN: grep cbx %t2.s | count 3 > -; RUN: grep chx %t2.s | count 1 > -; RUN: grep cwx %t2.s | count 1 > -; RUN: grep cwd %t2.s | count 2 > +; RUN: grep andi %t2.s | count 5 > +; RUN: grep cbd %t2.s | count 3 > +; RUN: grep chd %t2.s | count 1 > +; RUN: grep cwd %t2.s | count 3 > ; RUN: grep shufb %t2.s | count 7 > -; RUN: grep stqx %t2.s | count 7 > +; RUN: grep stqd %t2.s | count 7 > > ; ModuleID = 'struct_1.bc' > target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128- > i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128- > s0:128:128" > @@ -48,88 +47,98 @@ > ; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } > @state = global %struct.hackstate zeroinitializer, align 16 > > -define i8 @get_hackstate_c1() zeroext { > +define i8 @get_hackstate_c1() zeroext nounwind { > entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 0), align 16 > - ret i8 %tmp2 > + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 0), align 16 > + ret i8 %tmp2 > } > > -define i8 @get_hackstate_c2() zeroext { > +define i8 @get_hackstate_c2() zeroext nounwind { > entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 1), align 16 > - ret i8 %tmp2 > + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 1), align 16 > + ret i8 %tmp2 > } > > -define i8 @get_hackstate_c3() zeroext { > +define i8 @get_hackstate_c3() zeroext nounwind { > entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 2), align 16 > - ret i8 %tmp2 > + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 2), align 16 > + ret i8 %tmp2 > } > > -define i32 @get_hackstate_i1() { > +define i32 @get_hackstate_i1() nounwind { > entry: > - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, > i32 0, i32 3), align 16 > - ret i32 %tmp2 > + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, > i32 3), align 16 > + ret i32 %tmp2 > } > > -define i16 @get_hackstate_s1() signext { > +define i16 @get_hackstate_s1() signext nounwind { > entry: > - %tmp2 = load i16* getelementptr (%struct.hackstate* @state, > i32 0, i32 4), align 16 > - ret i16 %tmp2 > + %tmp2 = load i16* getelementptr (%struct.hackstate* @state, i32 0, > i32 4), align 16 > + ret i16 %tmp2 > } > > -define i8 @get_hackstate_c7() zeroext { > +define i8 @get_hackstate_c6() zeroext nounwind { > entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 9), align 16 > - ret i8 %tmp2 > + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 8), align 16 > + ret i8 %tmp2 > } > > -define i32 @get_hackstate_i6() zeroext { > +define i8 @get_hackstate_c7() zeroext nounwind { > entry: > - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, > i32 0, i32 13), align 16 > - ret i32 %tmp2 > + %tmp2 = load i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 9), align 16 > + ret i8 %tmp2 > } > > -define void @set_hackstate_c1(i8 zeroext %c) { > +define i32 @get_hackstate_i3() nounwind { > entry: > - store i8 %c, i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 0), align 16 > - ret void > + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, > i32 10), align 16 > + ret i32 %tmp2 > } > > -define void @set_hackstate_c2(i8 zeroext %c) { > +define i32 @get_hackstate_i6() nounwind { > entry: > - store i8 %c, i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 1), align 16 > - ret void > + %tmp2 = load i32* getelementptr (%struct.hackstate* @state, i32 0, > i32 13), align 16 > + ret i32 %tmp2 > } > > -define void @set_hackstate_c3(i8 zeroext %c) { > +define void @set_hackstate_c1(i8 zeroext %c) nounwind { > entry: > - store i8 %c, i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 2), align 16 > - ret void > + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 0), align 16 > + ret void > } > > -define void @set_hackstate_i1(i32 %i) { > +define void @set_hackstate_c2(i8 zeroext %c) nounwind { > entry: > - store i32 %i, i32* getelementptr (%struct.hackstate* > @state, i32 0, i32 3), align 16 > - ret void > + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 1), align 16 > + ret void > } > > -define void @set_hackstate_s1(i16 signext %s) { > +define void @set_hackstate_c3(i8 zeroext %c) nounwind { > entry: > - store i16 %s, i16* getelementptr (%struct.hackstate* > @state, i32 0, i32 4), align 16 > - ret void > + store i8 %c, i8* getelementptr (%struct.hackstate* @state, i32 0, > i32 2), align 16 > + ret void > } > > -define void @set_hackstate_i3(i32 %i) { > +define void @set_hackstate_i1(i32 %i) nounwind { > entry: > - store i32 %i, i32* getelementptr (%struct.hackstate* > @state, i32 0, i32 11), align 16 > - ret void > + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 > 0, i32 3), align 16 > + ret void > } > > +define void @set_hackstate_s1(i16 signext %s) nounwind { > +entry: > + store i16 %s, i16* getelementptr (%struct.hackstate* @state, i32 > 0, i32 4), align 16 > + ret void > +} > > -define void @set_hackstate_i6(i32 %i) { > +define void @set_hackstate_i3(i32 %i) nounwind { > entry: > - store i32 %i, i32* getelementptr (%struct.hackstate* > @state, i32 0, i32 13), align 16 > - ret void > + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 > 0, i32 10), align 16 > + ret void > } > > +define void @set_hackstate_i6(i32 %i) nounwind { > +entry: > + store i32 %i, i32* getelementptr (%struct.hackstate* @state, i32 > 0, i32 13), align 16 > + ret void > +} > > Removed: llvm/trunk/test/CodeGen/CellSPU/struct_2.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/struct_2.ll?rev=46482&view=auto > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/struct_2.ll (original) > +++ llvm/trunk/test/CodeGen/CellSPU/struct_2.ll (removed) > @@ -1,122 +0,0 @@ > -; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s > -; RUN: grep lqx %t1.s | count 14 > -; RUN: grep rotqby %t1.s | count 7 > -; RUN: grep xshw %t1.s | count 1 > -; RUN: grep andi %t1.s | count 4 > -; RUN: grep cbx %t1.s | count 1 > -; RUN: grep cbd %t1.s | count 2 > -; RUN: grep chd %t1.s | count 1 > -; RUN: grep cwd %t1.s | count 3 > -; RUN: grep shufb %t1.s | count 7 > -; RUN: grep stqx %t1.s | count 7 > - > -; ModuleID = 'struct_1.bc' > -target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128- > i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128- > s0:128:128" > -target triple = "spu" > - > -; struct hackstate { > -; unsigned char c1; // offset 0 (rotate left by 13 bytes to > byte 3) > -; unsigned char c2; // offset 1 (rotate left by 14 bytes to > byte 3) > -; unsigned char c3; // offset 2 (rotate left by 15 bytes to > byte 3) > -; int i1; // offset 4 (rotate left by 4 bytes to byte > 0) > -; short s1; // offset 8 (rotate left by 6 bytes to byte > 2) > -; int i2; // offset 12 [ignored] > -; unsigned char c4; // offset 16 [ignored] > -; unsigned char c5; // offset 17 [ignored] > -; unsigned char c6; // offset 18 [ignored] > -; unsigned char c7; // offset 19 (no rotate, in preferred slot) > -; int i3; // offset 20 [ignored] > -; int i4; // offset 24 [ignored] > -; int i5; // offset 28 [ignored] > -; int i6; // offset 32 (no rotate, in preferred slot) > -; } > -%struct.hackstate = type { i8, i8, i8, i32, i16, i32, i8, i8, i8, > i8, i32, i32, i32, i32 } > - > -; struct hackstate state = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } > - at state = global %struct.hackstate zeroinitializer, align 4 > - > -define i8 @get_hackstate_c1() zeroext { > -entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 0), align 4 > - ret i8 %tmp2 > -} > - > -define i8 @get_hackstate_c2() zeroext { > -entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 1), align 4 > - ret i8 %tmp2 > -} > - > -define i8 @get_hackstate_c3() zeroext { > -entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 2), align 4 > - ret i8 %tmp2 > -} > - > -define i32 @get_hackstate_i1() { > -entry: > - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, > i32 0, i32 3), align 4 > - ret i32 %tmp2 > -} > - > -define i16 @get_hackstate_s1() signext { > -entry: > - %tmp2 = load i16* getelementptr (%struct.hackstate* @state, > i32 0, i32 4), align 4 > - ret i16 %tmp2 > -} > - > -define i8 @get_hackstate_c7() zeroext { > -entry: > - %tmp2 = load i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 9), align 4 > - ret i8 %tmp2 > -} > - > -define i32 @get_hackstate_i6() zeroext { > -entry: > - %tmp2 = load i32* getelementptr (%struct.hackstate* @state, > i32 0, i32 13), align 4 > - ret i32 %tmp2 > -} > - > -define void @set_hackstate_c1(i8 zeroext %c) { > -entry: > - store i8 %c, i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 0), align 4 > - ret void > -} > - > -define void @set_hackstate_c2(i8 zeroext %c) { > -entry: > - store i8 %c, i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 1), align 4 > - ret void > -} > - > -define void @set_hackstate_c3(i8 zeroext %c) { > -entry: > - store i8 %c, i8* getelementptr (%struct.hackstate* @state, > i32 0, i32 2), align 4 > - ret void > -} > - > -define void @set_hackstate_i1(i32 %i) { > -entry: > - store i32 %i, i32* getelementptr (%struct.hackstate* > @state, i32 0, i32 3), align 4 > - ret void > -} > - > -define void @set_hackstate_s1(i16 signext %s) { > -entry: > - store i16 %s, i16* getelementptr (%struct.hackstate* > @state, i32 0, i32 4), align 4 > - ret void > -} > - > -define void @set_hackstate_i3(i32 %i) { > -entry: > - store i32 %i, i32* getelementptr (%struct.hackstate* > @state, i32 0, i32 11), align 4 > - ret void > -} > - > - > -define void @set_hackstate_i6(i32 %i) { > -entry: > - store i32 %i, i32* getelementptr (%struct.hackstate* > @state, i32 0, i32 13), align 4 > - ret void > -} > - > > Modified: llvm/trunk/test/CodeGen/CellSPU/vec_const.ll > URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CellSPU/vec_const.ll?rev=46483&r1=46482&r2=46483&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- llvm/trunk/test/CodeGen/CellSPU/vec_const.ll (original) > +++ llvm/trunk/test/CodeGen/CellSPU/vec_const.ll Mon Jan 28 20:16:57 > 2008 > @@ -1,11 +1,11 @@ > ; RUN: llvm-as -o - %s | llc -march=cellspu > %t1.s > ; RUN: llvm-as -o - %s | llc -march=cellspu -mattr=large_mem > %t2.s > -; RUN: grep il %t1.s | count 16 > -; RUN: grep ilhu %t1.s | count 8 > +; RUN: grep il %t1.s | count 16 > +; RUN: grep ilhu %t1.s | count 8 > ; RUN: grep ilh %t1.s | count 13 > ; RUN: grep iohl %t1.s | count 7 > ; RUN: grep lqa %t1.s | count 6 > -; RUN: grep 24672 %t1.s | count 2 > +; RUN: grep 24672 %t1.s | count 2 > ; RUN: grep 16429 %t1.s | count 1 > ; RUN: grep 63572 %t1.s | count 1 > ; RUN: grep 4660 %t1.s | count 1 > @@ -17,8 +17,7 @@ > ; RUN: grep 21572 %t1.s | count 1 > ; RUN: grep 11544 %t1.s | count 1 > ; RUN: grep 1311768467750121234 %t1.s | count 1 > -; RUN: grep lqx %t2.s | count 6 > -; RUN: grep ila %t2.s | count 6 > +; RUN: grep lqd %t2.s | count 6 > > target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128- > i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128" > target triple = "spu-unknown-elf" > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2555 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080128/29909674/attachment.bin From resistor at mac.com Mon Jan 28 20:32:14 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 29 Jan 2008 02:32:14 -0000 Subject: [llvm-commits] [llvm] r46488 - /llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp Message-ID: <200801290232.m0T2WE1a021089@zion.cs.uiuc.edu> Author: resistor Date: Mon Jan 28 20:32:13 2008 New Revision: 46488 URL: http://llvm.org/viewvc/llvm-project?rev=46488&view=rev Log: RegAllocBigBlock doesn't need LiveVariables either. Modified: llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp Modified: llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp?rev=46488&r1=46487&r2=46488&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp (original) +++ llvm/trunk/lib/CodeGen/RegAllocBigBlock.cpp Mon Jan 28 20:32:13 2008 @@ -97,10 +97,6 @@ /// etc) const MRegisterInfo *RegInfo; - /// LV - Our generic LiveVariables pointer - /// - LiveVariables *LV; - typedef SmallVector VRegTimes; /// VRegReadTable - maps VRegs in a BB to the set of times they are read @@ -182,7 +178,6 @@ /// getAnalaysisUsage - declares the required analyses /// virtual void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); AU.addRequiredID(PHIEliminationID); AU.addRequiredID(TwoAddressInstructionPassID); MachineFunctionPass::getAnalysisUsage(AU); @@ -528,9 +523,7 @@ Ops.push_back(OpNum); if(MachineInstr* FMI = TII->foldMemoryOperand(MI, Ops, FrameIndex)) { ++NumFolded; - // Since we changed the address of MI, make sure to update live variables - // to know that the new instruction has the properties of the old one. - LV->instructionChanged(MI, FMI); + FMI->copyKillDeadInfo(MI); return MBB.insert(MBB.erase(MI), FMI); } @@ -832,11 +825,8 @@ // Finally, if this is a noop copy instruction, zap it. unsigned SrcReg, DstReg; - if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg) { - LV->removeVirtualRegistersKilled(MI); - LV->removeVirtualRegistersDead(MI); + if (TII.isMoveInstr(*MI, SrcReg, DstReg) && SrcReg == DstReg) MBB.erase(MI); - } } MachineBasicBlock::iterator MI = MBB.getFirstTerminator(); @@ -857,7 +847,6 @@ MF = &Fn; TM = &Fn.getTarget(); RegInfo = TM->getRegisterInfo(); - LV = &getAnalysis(); PhysRegsUsed.assign(RegInfo->getNumRegs(), -1); From clattner at apple.com Mon Jan 28 22:29:50 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 20:29:50 -0800 Subject: [llvm-commits] [llvm] r46485 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/AsmPrinter.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h In-Reply-To: <200801290221.m0T2LMBX020763@zion.cs.uiuc.edu> References: <200801290221.m0T2LMBX020763@zion.cs.uiuc.edu> Message-ID: <41B41054-0851-4CA0-9898-9DE8F42D0FEB@apple.com> On Jan 28, 2008, at 6:21 PM, Dale Johannesen wrote: > Author: johannes > Date: Mon Jan 28 20:21:21 2008 > New Revision: 46485 > > URL: http://llvm.org/viewvc/llvm-project?rev=46485&view=rev > Log: > Handle 'X' constraint in asm's better. Hey Dale, Can this be done in llvm-gcc? It seems better to only expose 'simplified' constraints to the llvm code generator. This means the target hooks would become wonderful macros in i386.h for example, but that seems tolerable. It also might be possible to iterate over the constraint letters somehow in GCC, which would make it possible to implement this in a target independent way. What do you think? -Chris From clattner at apple.com Mon Jan 28 22:37:43 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 20:37:43 -0800 Subject: [llvm-commits] [llvm] r46483 - in /llvm/trunk: lib/Target/CellSPU/ test/CodeGen/CellSPU/ In-Reply-To: <0129AF7E-6145-4110-A32F-12BB14A69DA7@mac.com> References: <200801290216.m0T2Gw8o020585@zion.cs.uiuc.edu> <0129AF7E-6145-4110-A32F-12BB14A69DA7@mac.com> Message-ID: <0FC815BA-EF75-4814-9635-18B2F2EEE684@apple.com> On Jan 28, 2008, at 6:31 PM, Owen Anderson wrote: > I'm getting a build failure after this commit: > > llvm[3]: Compiling SPUISelDAGToDAG.cpp for Release build > SPUGenDAGISel.inc: In member function ?llvm::SDNode* > SPUDAGToDAGISel::Emit_5(const llvm::SDOperand&, unsigned int, > unsigned int, llvm::MVT::ValueType, llvm::MVT::ValueType)?: > SPUGenDAGISel.inc:948: error: ?Tmp2? was not declared in this scope Works for me, is your tree fully up to date? -Chris From dalej at apple.com Mon Jan 28 23:24:23 2008 From: dalej at apple.com (Dale Johannesen) Date: Mon, 28 Jan 2008 21:24:23 -0800 Subject: [llvm-commits] [llvm] r46485 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/AsmPrinter.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h In-Reply-To: <41B41054-0851-4CA0-9898-9DE8F42D0FEB@apple.com> References: <200801290221.m0T2LMBX020763@zion.cs.uiuc.edu> <41B41054-0851-4CA0-9898-9DE8F42D0FEB@apple.com> Message-ID: <905A2FA9-B216-4886-8CA4-8ECB3A29EF03@apple.com> On Jan 28, 2008, at 8:29 PM, Chris Lattner wrote: > > On Jan 28, 2008, at 6:21 PM, Dale Johannesen wrote: > >> Author: johannes >> Date: Mon Jan 28 20:21:21 2008 >> New Revision: 46485 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=46485&view=rev >> Log: >> Handle 'X' constraint in asm's better. > > Hey Dale, > > Can this be done in llvm-gcc? It seems better to only expose > 'simplified' constraints to the llvm code generator. This means the > target hooks would become wonderful macros in i386.h for example, but > that seems tolerable. Sure, but you'd have to reimplement it in clang (etc). I think it's better to have it in one place. (If you're thinking we don't need to support this in clang eventually, I don't believe it, alas.) > It also might be possible to iterate over the constraint letters > somehow in GCC, which would make it possible to implement this in a > target independent way. In llvm you mean maybe? Could be, I didn't look at that closely. I know there are some collisions between targets of machine-dependent constraint letters, but the semantics can't be too different or reload would screw up; it might be doable. That said, I'm not particularly happy with the implementation I wound up with, not neat-looking at all and there's probably cases that aren't handled the same as gcc. I don't think there's a silver bullet though. From clattner at apple.com Mon Jan 28 23:57:06 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 21:57:06 -0800 Subject: [llvm-commits] [llvm] r46485 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/AsmPrinter.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h In-Reply-To: <905A2FA9-B216-4886-8CA4-8ECB3A29EF03@apple.com> References: <200801290221.m0T2LMBX020763@zion.cs.uiuc.edu> <41B41054-0851-4CA0-9898-9DE8F42D0FEB@apple.com> <905A2FA9-B216-4886-8CA4-8ECB3A29EF03@apple.com> Message-ID: <61719AB0-C398-4812-8587-8388EAF38132@apple.com> On Jan 28, 2008, at 9:24 PM, Dale Johannesen wrote: >> Can this be done in llvm-gcc? It seems better to only expose >> 'simplified' constraints to the llvm code generator. This means the >> target hooks would become wonderful macros in i386.h for example, but >> that seems tolerable. > > Sure, but you'd have to reimplement it in clang (etc). I think it's > better to have it in one place. (If you're thinking we don't need to > support this in clang eventually, I don't believe it, alas.) Right, clang eventually needs full inline asm support, but it also needs a lot of other stuff (such as better target parameterization of constraints etc) that baking this stuff into the LLVM codegen's don't help with. When we go for full clang inline asm handling, I'm hoping that we'll have much better abstractions that GCC does, so this functionality won't be hard to support. >> It also might be possible to iterate over the constraint letters >> somehow in GCC, which would make it possible to implement this in a >> target independent way. > > In llvm you mean maybe? Could be, I didn't look at that closely. I > know there are some collisions between targets of machine-dependent > constraint letters, but the semantics can't be too different or reload > would screw up; it might be doable. Nope, I meant in GCC. GCC "knows" the current target (because all the #defines are baked in), I don't know if it provides a good way to iterate over the target-specific letters though. > That said, I'm not particularly happy with the implementation I wound > up with, not neat-looking at all and there's probably cases that > aren't handled the same as gcc. I don't think there's a silver bullet > though. I agree that there is unlikely to be a silver bullet, -Chris From baldrick at free.fr Mon Jan 28 23:57:23 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jan 2008 05:57:23 -0000 Subject: [llvm-commits] [llvm] r46492 - /llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c Message-ID: <200801290557.m0T5vNoO028313@zion.cs.uiuc.edu> Author: baldrick Date: Mon Jan 28 23:57:23 2008 New Revision: 46492 URL: http://llvm.org/viewvc/llvm-project?rev=46492&view=rev Log: After recent changes we fail to optimize this test sufficiently to have it pass. I'm removing it from the testsuite and adding it to PR452 instead. Removed: llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c Removed: llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c?rev=46491&view=auto ============================================================================== --- llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c (original) +++ llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c (removed) @@ -1,19 +0,0 @@ -// RUN: %llvmgcc %s -S -O1 -o - | llvm-as | opt -std-compile-opts | llvm-dis | not grep add - -struct S { int A; int B; char C[1000]; }; - -int f(struct S x) __attribute__ ((const)); - -static int __attribute__ ((const)) g(struct S x) { - x.A = x.B; - return f(x); -} - -int h(void) { - struct S x; - int r; - x.A = 0; - x.B = 9; - r = g(x); - return r + x.A; -} From baldrick at free.fr Mon Jan 28 23:59:10 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jan 2008 06:59:10 +0100 Subject: [llvm-commits] [llvm] r46451 - /llvm/trunk/test/CFrontend/2008-01-26-ReadOnlyByVal.c In-Reply-To: <04B7156C-2861-459B-8A41-2BF82C9DCA08@apple.com> References: <200801281035.m0SAZEhI022037@zion.cs.uiuc.edu> <04B7156C-2861-459B-8A41-2BF82C9DCA08@apple.com> Message-ID: <200801290659.10886.baldrick@free.fr> > This fails with 4.0 on darwin x86. I've removed it. With recent changes needed for byval correctness, it became too hard for the optimizers. I've added it to PR452 instead. Ciao, Duncan. From baldrick at free.fr Tue Jan 29 00:04:54 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jan 2008 06:04:54 -0000 Subject: [llvm-commits] [llvm] r46493 - /llvm/trunk/test/C++Frontend/2008-01-25-ResultIsParam.cpp Message-ID: <200801290604.m0T64sZp028574@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 29 00:04:54 2008 New Revision: 46493 URL: http://llvm.org/viewvc/llvm-project?rev=46493&view=rev Log: This would be better done as an executable test. Removed: llvm/trunk/test/C++Frontend/2008-01-25-ResultIsParam.cpp Removed: llvm/trunk/test/C++Frontend/2008-01-25-ResultIsParam.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/C%2B%2BFrontend/2008-01-25-ResultIsParam.cpp?rev=46492&view=auto ============================================================================== --- llvm/trunk/test/C++Frontend/2008-01-25-ResultIsParam.cpp (original) +++ llvm/trunk/test/C++Frontend/2008-01-25-ResultIsParam.cpp (removed) @@ -1,23 +0,0 @@ -// RUN: %llvmgcc %s -S -o - | not grep {@_ZN3fooC1Ev.*result} -// PR1942 - -class foo -{ -public: - int a; - int b; - - foo(void) : a(0), b(0) {} - - foo(int aa, int bb) : a(aa), b(bb) {} - - const foo operator+(const foo& in) const; - -}; - -const foo foo::operator+(const foo& in) const { - foo Out; - Out.a = a + in.a; - Out.b = b + in.b; - return Out; -} From resistor at mac.com Tue Jan 29 00:18:36 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 29 Jan 2008 06:18:36 -0000 Subject: [llvm-commits] [llvm] r46494 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Message-ID: <200801290618.m0T6IajW028996@zion.cs.uiuc.edu> Author: resistor Date: Tue Jan 29 00:18:36 2008 New Revision: 46494 URL: http://llvm.org/viewvc/llvm-project?rev=46494&view=rev Log: Add support for eliminating memcpy's at the end of functions. Also fix some errors I noticed in the handling of eliminating stores to byval arguments. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46494&r1=46493&r2=46494&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Jan 29 00:18:36 2008 @@ -20,6 +20,7 @@ #include "llvm/Constants.h" #include "llvm/Function.h" #include "llvm/Instructions.h" +#include "llvm/IntrinsicInst.h" #include "llvm/Pass.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/SmallPtrSet.h" @@ -53,7 +54,7 @@ bool handleEndBlock(BasicBlock& BB, SetVector& possiblyDead); bool RemoveUndeadPointers(Value* pointer, BasicBlock::iterator& BBI, - SmallPtrSet& deadPointers, + SmallPtrSet& deadPointers, SetVector& possiblyDead); void DeleteDeadInstructionChains(Instruction *I, SetVector &DeadInsts); @@ -249,13 +250,17 @@ bool MadeChange = false; // Pointers alloca'd in this function are dead in the end block - SmallPtrSet deadPointers; + SmallPtrSet deadPointers; // Find all of the alloca'd pointers in the entry block BasicBlock *Entry = BB.getParent()->begin(); for (BasicBlock::iterator I = Entry->begin(), E = Entry->end(); I != E; ++I) if (AllocaInst *AI = dyn_cast(I)) deadPointers.insert(AI); + for (Function::arg_iterator AI = BB.getParent()->arg_begin(), + AE = BB.getParent()->arg_end(); AI != AE; ++AI) + if (AI->hasByValAttr()) + deadPointers.insert(AI); // Scan the basic block backwards for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ){ @@ -270,10 +275,7 @@ // Alloca'd pointers or byval arguments (which are functionally like // alloca's) are valid candidates for removal. - if ( (isa(pointerOperand) && - deadPointers.count(cast(pointerOperand))) || - (isa(pointerOperand) && - cast(pointerOperand)->hasByValAttr())) { + if (deadPointers.count(pointerOperand)) { // Remove it! MD.removeInstruction(S); @@ -291,6 +293,32 @@ } continue; + + // We can also remove memcpy's to local variables at the end of a function + } else if (MemCpyInst* M = dyn_cast(BBI)) { + Value* dest = M->getDest(); + TranslatePointerBitCasts(dest); + + if (deadPointers.count(dest)) { + MD.removeInstruction(M); + + // DCE instructions only used to calculate that memcpy + if (Instruction* D = dyn_cast(M->getSource())) + possiblyDead.insert(D); + if (Instruction* D = dyn_cast(M->getLength())) + possiblyDead.insert(D); + if (Instruction* D = dyn_cast(M->getRawDest())) + possiblyDead.insert(D); + + BBI++; + M->eraseFromParent(); + NumFastOther++; + MadeChange = true; + + continue; + } + + // Because a memcpy is also a load, we can't skip it if we didn't remove it } Value* killPointer = 0; @@ -314,8 +342,8 @@ unsigned other = 0; // Remove any pointers made undead by the call from the dead set - std::vector dead; - for (SmallPtrSet::iterator I = deadPointers.begin(), + std::vector dead; + for (SmallPtrSet::iterator I = deadPointers.begin(), E = deadPointers.end(); I != E; ++I) { // HACK: if we detect that our AA is imprecise, it's not // worth it to scan the rest of the deadPointers set. Just @@ -328,9 +356,15 @@ // Get size information for the alloca unsigned pointerSize = ~0U; - if (ConstantInt* C = dyn_cast((*I)->getArraySize())) - pointerSize = C->getZExtValue() * \ - TD.getABITypeSize((*I)->getAllocatedType()); + if (AllocaInst* A = dyn_cast(*I)) { + if (ConstantInt* C = dyn_cast(A->getArraySize())) + pointerSize = C->getZExtValue() * \ + TD.getABITypeSize(A->getAllocatedType()); + } else { + const PointerType* PT = cast( + cast(*I)->getType()); + pointerSize = TD.getABITypeSize(PT->getElementType()); + } // See if the call site touches it AliasAnalysis::ModRefResult A = AA.getModRefInfo(CS, *I, pointerSize); @@ -344,10 +378,9 @@ dead.push_back(*I); } - for (std::vector::iterator I = dead.begin(), E = dead.end(); + for (std::vector::iterator I = dead.begin(), E = dead.end(); I != E; ++I) - if (AllocaInst *AI = dyn_cast(*I)) - deadPointers.erase(AI); + deadPointers.erase(*I); continue; } @@ -369,7 +402,7 @@ /// undead when scanning for dead stores to alloca's. bool DSE::RemoveUndeadPointers(Value* killPointer, BasicBlock::iterator& BBI, - SmallPtrSet& deadPointers, + SmallPtrSet& deadPointers, SetVector& possiblyDead) { TargetData &TD = getAnalysis(); AliasAnalysis &AA = getAnalysis(); @@ -377,9 +410,8 @@ // If the kill pointer can be easily reduced to an alloca, // don't bother doing extraneous AA queries - if (AllocaInst* A = dyn_cast(killPointer)) { - if (deadPointers.count(A)) - deadPointers.erase(A); + if (deadPointers.count(killPointer)) { + deadPointers.erase(killPointer); return false; } else if (isa(killPointer)) { // A global can't be in the dead pointer set @@ -388,15 +420,21 @@ bool MadeChange = false; - std::vector undead; + std::vector undead; - for (SmallPtrSet::iterator I = deadPointers.begin(), + for (SmallPtrSet::iterator I = deadPointers.begin(), E = deadPointers.end(); I != E; ++I) { // Get size information for the alloca unsigned pointerSize = ~0U; - if (ConstantInt* C = dyn_cast((*I)->getArraySize())) - pointerSize = C->getZExtValue() * \ - TD.getABITypeSize((*I)->getAllocatedType()); + if (AllocaInst* A = dyn_cast(*I)) { + if (ConstantInt* C = dyn_cast(A->getArraySize())) + pointerSize = C->getZExtValue() * \ + TD.getABITypeSize(A->getAllocatedType()); + } else { + const PointerType* PT = cast( + cast(*I)->getType()); + pointerSize = TD.getABITypeSize(PT->getElementType()); + } // See if this pointer could alias it AliasAnalysis::AliasResult A = AA.alias(*I, pointerSize, @@ -427,10 +465,9 @@ undead.push_back(*I); } - for (std::vector::iterator I = undead.begin(), E = undead.end(); + for (std::vector::iterator I = undead.begin(), E = undead.end(); I != E; ++I) - if (AllocaInst *AI = dyn_cast(*I)) - deadPointers.erase(AI); + deadPointers.erase(*I); return MadeChange; } From baldrick at free.fr Tue Jan 29 00:23:44 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jan 2008 06:23:44 -0000 Subject: [llvm-commits] [llvm] r46495 - in /llvm/trunk: include/llvm/Target/TargetData.h lib/CodeGen/ELFWriter.cpp lib/CodeGen/MachOWriter.cpp lib/ExecutionEngine/JIT/JIT.cpp lib/Target/IA64/IA64AsmPrinter.cpp lib/Target/Sparc/SparcAsmPrinter.cpp lib/Target/TargetData.cpp Message-ID: <200801290623.m0T6Ni6t029188@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 29 00:23:44 2008 New Revision: 46495 URL: http://llvm.org/viewvc/llvm-project?rev=46495&view=rev Log: Use getPreferredAlignmentLog or getPreferredAlignment to get the alignment of global variables, rather than using hand-made versions. Modified: llvm/trunk/include/llvm/Target/TargetData.h llvm/trunk/lib/CodeGen/ELFWriter.cpp llvm/trunk/lib/CodeGen/MachOWriter.cpp llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp llvm/trunk/lib/Target/TargetData.cpp Modified: llvm/trunk/include/llvm/Target/TargetData.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetData.h?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetData.h (original) +++ llvm/trunk/include/llvm/Target/TargetData.h Tue Jan 29 00:23:44 2008 @@ -200,7 +200,7 @@ /// getPrefTypeAlignment - Return the preferred stack/global alignment for - /// the specified type. + /// the specified type. This is always at least as good as the ABI alignment. unsigned char getPrefTypeAlignment(const Type *Ty) const; /// getPreferredTypeAlignmentShift - Return the preferred alignment for the @@ -230,6 +230,11 @@ /// avoid a dangling pointer in this cache. void InvalidateStructLayoutInfo(const StructType *Ty) const; + /// getPreferredAlignment - Return the preferred alignment of the specified + /// global. This includes an explicitly requested alignment (if the global + /// has one). + unsigned getPreferredAlignment(const GlobalVariable *GV) const; + /// getPreferredAlignmentLog - Return the preferred alignment of the /// specified global, returned in log form. This includes an explicitly /// requested alignment (if the global has one). Modified: llvm/trunk/lib/CodeGen/ELFWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ELFWriter.cpp?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/ELFWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/ELFWriter.cpp Tue Jan 29 00:23:44 2008 @@ -257,7 +257,7 @@ } const Type *GVType = (const Type*)GV->getType(); - unsigned Align = TM.getTargetData()->getPrefTypeAlignment(GVType); + unsigned Align = TM.getTargetData()->getPreferredAlignment(GV); unsigned Size = TM.getTargetData()->getABITypeSize(GVType); // If this global has a zero initializer, it is part of the .bss or common Modified: llvm/trunk/lib/CodeGen/MachOWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachOWriter.cpp?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachOWriter.cpp (original) +++ llvm/trunk/lib/CodeGen/MachOWriter.cpp Tue Jan 29 00:23:44 2008 @@ -334,10 +334,8 @@ void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) { const Type *Ty = GV->getType()->getElementType(); unsigned Size = TM.getTargetData()->getABITypeSize(Ty); - unsigned Align = GV->getAlignment(); - if (Align == 0) - Align = TM.getTargetData()->getPrefTypeAlignment(Ty); - + unsigned Align = TM.getTargetData()->getPreferredAlignment(GV); + // Reserve space in the .bss section for this symbol while maintaining the // desired section alignment, which must be at least as much as required by // this symbol. Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Tue Jan 29 00:23:44 2008 @@ -355,7 +355,7 @@ // compilation. const Type *GlobalType = GV->getType()->getElementType(); size_t S = getTargetData()->getABITypeSize(GlobalType); - size_t A = getTargetData()->getPrefTypeAlignment(GlobalType); + size_t A = getTargetData()->getPreferredAlignment(GV); if (A <= 8) { Ptr = malloc(S); } else { Modified: llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64AsmPrinter.cpp Tue Jan 29 00:23:44 2008 @@ -271,8 +271,8 @@ std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); unsigned Size = TD->getABITypeSize(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 */)) { Modified: llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcAsmPrinter.cpp Tue Jan 29 00:23:44 2008 @@ -229,7 +229,7 @@ std::string name = Mang->getValueName(I); Constant *C = I->getInitializer(); unsigned Size = TD->getABITypeSize(C->getType()); - unsigned Align = TD->getPrefTypeAlignment(C->getType()); + unsigned Align = TD->getPreferredAlignment(I); if (C->isNullValue() && (I->hasLinkOnceLinkage() || I->hasInternalLinkage() || Modified: llvm/trunk/lib/Target/TargetData.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=46495&r1=46494&r2=46495&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetData.cpp (original) +++ llvm/trunk/lib/Target/TargetData.cpp Tue Jan 29 00:23:44 2008 @@ -101,6 +101,7 @@ TargetAlignElem TargetAlignElem::get(AlignTypeEnum align_type, unsigned char abi_align, unsigned char pref_align, uint32_t bit_width) { + assert(abi_align <= pref_align && "Preferred alignment worse than ABI!"); TargetAlignElem retval; retval.AlignType = align_type; retval.ABIAlign = abi_align; @@ -242,6 +243,7 @@ void TargetData::setAlignment(AlignTypeEnum align_type, unsigned char abi_align, unsigned char pref_align, uint32_t bit_width) { + assert(abi_align <= pref_align && "Preferred alignment worse than ABI!"); for (unsigned i = 0, e = Alignments.size(); i != e; ++i) { if (Alignments[i].AlignType == align_type && Alignments[i].TypeBitWidth == bit_width) { @@ -576,22 +578,29 @@ return Result; } -/// getPreferredAlignmentLog - Return the preferred alignment of the -/// specified global, returned in log form. This includes an explicitly -/// requested alignment (if the global has one). -unsigned TargetData::getPreferredAlignmentLog(const GlobalVariable *GV) const { +/// getPreferredAlignment - Return the preferred alignment of the specified +/// global. This includes an explicitly requested alignment (if the global +/// has one). +unsigned TargetData::getPreferredAlignment(const GlobalVariable *GV) const { const Type *ElemType = GV->getType()->getElementType(); - unsigned Alignment = getPreferredTypeAlignmentShift(ElemType); - if (GV->getAlignment() > (1U << Alignment)) - Alignment = Log2_32(GV->getAlignment()); - + unsigned Alignment = getPrefTypeAlignment(ElemType); + if (GV->getAlignment() > Alignment) + Alignment = GV->getAlignment(); + if (GV->hasInitializer()) { - if (Alignment < 4) { + if (Alignment < 16) { // If the global is not external, see if it is large. If so, give it a // larger alignment. if (getTypeSizeInBits(ElemType) > 128) - Alignment = 4; // 16-byte alignment. + Alignment = 16; // 16-byte alignment. } } return Alignment; } + +/// getPreferredAlignmentLog - Return the preferred alignment of the +/// specified global, returned in log form. This includes an explicitly +/// requested alignment (if the global has one). +unsigned TargetData::getPreferredAlignmentLog(const GlobalVariable *GV) const { + return Log2_32(getPreferredAlignment(GV)); +} From sabre at nondot.org Tue Jan 29 00:26:07 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 29 Jan 2008 06:26:07 -0000 Subject: [llvm-commits] [llvm] r46496 - in /llvm/trunk/test/CodeGen: PowerPC/2008-01-25-EmptyFunction.ll X86/2008-01-25-EmptyFunction.ll Message-ID: <200801290626.m0T6Q7bp029255@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 29 00:26:07 2008 New Revision: 46496 URL: http://llvm.org/viewvc/llvm-project?rev=46496&view=rev Log: Add target triples to these so they don't fail on linux. Modified: llvm/trunk/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll llvm/trunk/test/CodeGen/X86/2008-01-25-EmptyFunction.ll Modified: llvm/trunk/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll?rev=46496&r1=46495&r2=46496&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll (original) +++ llvm/trunk/test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll Tue Jan 29 00:26:07 2008 @@ -1,4 +1,6 @@ ; RUN: llvm-as < %s | llc -march=ppc32 | grep nop +target triple = "powerpc-apple-darwin8" + define void @bork() noreturn nounwind { entry: Modified: llvm/trunk/test/CodeGen/X86/2008-01-25-EmptyFunction.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-01-25-EmptyFunction.ll?rev=46496&r1=46495&r2=46496&view=diff ============================================================================== --- llvm/trunk/test/CodeGen/X86/2008-01-25-EmptyFunction.ll (original) +++ llvm/trunk/test/CodeGen/X86/2008-01-25-EmptyFunction.ll Tue Jan 29 00:26:07 2008 @@ -1,4 +1,6 @@ ; RUN: llvm-as < %s | llc -march=x86 | grep nop +target triple = "i686-apple-darwin8" + define void @bork() noreturn nounwind { entry: From clattner at apple.com Tue Jan 29 00:30:57 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 22:30:57 -0800 Subject: [llvm-commits] [llvm] r46494 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp In-Reply-To: <200801290618.m0T6IajW028996@zion.cs.uiuc.edu> References: <200801290618.m0T6IajW028996@zion.cs.uiuc.edu> Message-ID: <4ECEDFC5-99FE-4B34-894D-7E272E2A1EB5@apple.com> On Jan 28, 2008, at 10:18 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Jan 29 00:18:36 2008 > New Revision: 46494 > URL: http://llvm.org/viewvc/llvm-project?rev=46494&view=rev > Log: > Add support for eliminating memcpy's at the end of functions. Also > fix some errors I noticed in > the handling of eliminating stores to byval arguments. Ooh, coolness. Testcase please :) -Chris From resistor at mac.com Tue Jan 29 00:40:32 2008 From: resistor at mac.com (Owen Anderson) Date: Tue, 29 Jan 2008 06:40:32 -0000 Subject: [llvm-commits] [llvm] r46497 - /llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll Message-ID: <200801290640.m0T6eWiv029633@zion.cs.uiuc.edu> Author: resistor Date: Tue Jan 29 00:40:32 2008 New Revision: 46497 URL: http://llvm.org/viewvc/llvm-project?rev=46497&view=rev Log: Add a testcase for eliminating memcpy's at the end of functions. Forgot to commit this with my last commit. Added: llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll Added: llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll?rev=46497&view=auto ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll (added) +++ llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll Tue Jan 29 00:40:32 2008 @@ -0,0 +1,52 @@ +; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep tmp180 +; ModuleID = 'placeholder.adb' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" +target triple = "i686-pc-linux-gnu" + %struct.placeholder__T5b = type { i32, [1 x i32] } + %struct.placeholder__an_interval___PAD = type { %struct.placeholder__interval, [4 x i32] } + %struct.placeholder__interval = type { i32, i32 } + %struct.placeholder__s__s__the_interval___PAD = type { %struct.placeholder__interval } + +define void @_ada_placeholder() nounwind { +entry: + %an_interval = alloca %struct.placeholder__an_interval___PAD ; <%struct.placeholder__an_interval___PAD*> [#uses=3] + %tmp34 = bitcast %struct.placeholder__an_interval___PAD* %an_interval to %struct.placeholder__T5b* ; <%struct.placeholder__T5b*> [#uses=1] + %tmp5 = getelementptr %struct.placeholder__an_interval___PAD* %an_interval, i32 0, i32 0, i32 0 ; [#uses=2] + store i32 1, i32* %tmp5, align 8 + %tmp10 = getelementptr %struct.placeholder__T5b* %tmp34, i32 0, i32 1, i32 0 ; [#uses=1] + store i32 1, i32* %tmp10, align 4 + %tmp82 = load i32* %tmp5, align 8 ; [#uses=5] + %tmp83 = icmp slt i32 %tmp82, 6 ; [#uses=1] + %min84 = select i1 %tmp83, i32 %tmp82, i32 5 ; [#uses=3] + %tmp85 = icmp sgt i32 %min84, -1 ; [#uses=2] + %min84.cast193 = zext i32 %min84 to i64 ; [#uses=1] + %min84.cast193.op = shl i64 %min84.cast193, 33 ; [#uses=1] + %tmp104 = icmp sgt i32 %tmp82, -1 ; [#uses=2] + %tmp103.cast192 = zext i32 %tmp82 to i64 ; [#uses=1] + %tmp103.cast192.op = shl i64 %tmp103.cast192, 33 ; [#uses=1] + %min84.cast193.op.op = ashr i64 %min84.cast193.op, 28 ; [#uses=1] + %sextr121 = select i1 %tmp85, i64 %min84.cast193.op.op, i64 0 ; [#uses=2] + %tmp103.cast192.op.op = ashr i64 %tmp103.cast192.op, 28 ; [#uses=1] + %sextr123 = select i1 %tmp104, i64 %tmp103.cast192.op.op, i64 0 ; [#uses=2] + %tmp124 = icmp sle i64 %sextr121, %sextr123 ; [#uses=1] + %min125 = select i1 %tmp124, i64 %sextr121, i64 %sextr123 ; [#uses=1] + %sextr131194 = and i64 %min125, 34359738336 ; [#uses=1] + %tmp134 = add i64 %sextr131194, 63 ; [#uses=1] + lshr i64 %tmp134, 3 ; :0 [#uses=1] + %tmp150188.shrunk = trunc i64 %0 to i32 ; [#uses=1] + %tmp159 = and i32 %tmp150188.shrunk, -4 ; [#uses=1] + %tmp161 = alloca i8, i32 %tmp159 ; [#uses=1] + %min167.op = shl i32 %min84, 2 ; [#uses=1] + %tmp170 = select i1 %tmp85, i32 %min167.op, i32 0 ; [#uses=2] + %tmp173.op = shl i32 %tmp82, 2 ; [#uses=1] + %tmp176 = select i1 %tmp104, i32 %tmp173.op, i32 0 ; [#uses=2] + %tmp177 = icmp sle i32 %tmp170, %tmp176 ; [#uses=1] + %min178 = select i1 %tmp177, i32 %tmp170, i32 %tmp176 ; [#uses=1] + %tmp179 = add i32 %min178, 7 ; [#uses=1] + %tmp180 = and i32 %tmp179, -4 ; [#uses=1] + %tmp183185 = bitcast %struct.placeholder__an_interval___PAD* %an_interval to i8* ; [#uses=1] + call void @llvm.memcpy.i32( i8* %tmp161, i8* %tmp183185, i32 %tmp180, i32 4 ) + ret void +} + +declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind From baldrick at free.fr Tue Jan 29 00:46:44 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jan 2008 06:46:44 -0000 Subject: [llvm-commits] [test-suite] r46498 - /test-suite/trunk/SingleSource/Regression/C++/2008-01-29-ParamAliasesReturn.cpp Message-ID: <200801290646.m0T6ki5N029819@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 29 00:46:44 2008 New Revision: 46498 URL: http://llvm.org/viewvc/llvm-project?rev=46498&view=rev Log: Test for PR1942. Added: test-suite/trunk/SingleSource/Regression/C++/2008-01-29-ParamAliasesReturn.cpp Added: test-suite/trunk/SingleSource/Regression/C++/2008-01-29-ParamAliasesReturn.cpp URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Regression/C%2B%2B/2008-01-29-ParamAliasesReturn.cpp?rev=46498&view=auto ============================================================================== --- test-suite/trunk/SingleSource/Regression/C++/2008-01-29-ParamAliasesReturn.cpp (added) +++ test-suite/trunk/SingleSource/Regression/C++/2008-01-29-ParamAliasesReturn.cpp Tue Jan 29 00:46:44 2008 @@ -0,0 +1,38 @@ +#include + +class foo +{ +public: + int a; + int b; + int c; + int d; + + foo(void) : a(0), b(0) {} + + foo(int aa, int bb) : a(aa), b(bb) {} + + const foo operator+(const foo& in) const; + + foo operator+=(const foo& in); +}; + +const foo foo::operator+(const foo& in) const { + foo Out; + Out.a = a + in.a; + Out.b = b + in.b; + return Out; +} + +foo foo::operator+=(const foo& in) { + *this = *this + in; + return *this; +} + +int main() { + foo x(1, 2); + foo y(3, 4); + x += y; + printf("%d %d\n", x.a, x.b); + return 0; +} From sabre at nondot.org Tue Jan 29 00:52:46 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 29 Jan 2008 06:52:46 -0000 Subject: [llvm-commits] [llvm] r46499 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/zero-point-zero-add.ll Message-ID: <200801290652.m0T6qkIw029986@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 29 00:52:45 2008 New Revision: 46499 URL: http://llvm.org/viewvc/llvm-project?rev=46499&view=rev Log: eliminate additions of 0.0 when they are obviously dead. This has to be careful to avoid turning -0.0 + 0.0 -> -0.0 which is incorrect. Added: llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=46499&r1=46498&r2=46499&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Tue Jan 29 00:52:45 2008 @@ -1943,6 +1943,48 @@ return ReplaceInstUsesWith(I, NewPN); } + +/// CannotBeNegativeZero - Return true if we can prove that the specified FP +/// value is never equal to -0.0. +/// +/// Note that this function will need to be revisited when we support nondefault +/// rounding modes! +/// +static bool CannotBeNegativeZero(const Value *V) { + if (const ConstantFP *CFP = dyn_cast(V)) + return !CFP->getValueAPF().isNegZero(); + + // (add x, 0.0) is guaranteed to return +0.0, not -0.0. + if (const Instruction *I = dyn_cast(V)) { + if (I->getOpcode() == Instruction::Add && + isa(I->getOperand(1)) && + cast(I->getOperand(1))->isNullValue()) + return true; + + if (const IntrinsicInst *II = dyn_cast(I)) + if (II->getIntrinsicID() == Intrinsic::sqrt) + return CannotBeNegativeZero(II->getOperand(1)); + + if (const CallInst *CI = dyn_cast(I)) + if (const Function *F = CI->getCalledFunction()) { + if (F->isDeclaration()) { + switch (F->getNameLen()) { + case 3: // abs(x) != -0.0 + if (!strcmp(F->getNameStart(), "abs")) return true; + break; + case 4: // abs[lf](x) != -0.0 + if (!strcmp(F->getNameStart(), "absf")) return true; + if (!strcmp(F->getNameStart(), "absl")) return true; + break; + } + } + } + } + + return false; +} + + Instruction *InstCombiner::visitAdd(BinaryOperator &I) { bool Changed = SimplifyCommutative(I); Value *LHS = I.getOperand(0), *RHS = I.getOperand(1); @@ -2160,6 +2202,11 @@ return new SelectInst(SI->getCondition(), A, N); } } + + // Check for X+0.0. Simplify it to X if we know X is not -0.0. + if (ConstantFP *CFP = dyn_cast(RHS)) + if (CFP->getValueAPF().isPosZero() && CannotBeNegativeZero(LHS)) + return ReplaceInstUsesWith(I, LHS); return Changed ? &I : 0; } Added: llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll?rev=46499&view=auto ============================================================================== --- llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll (added) +++ llvm/trunk/test/Transforms/InstCombine/zero-point-zero-add.ll Tue Jan 29 00:52:45 2008 @@ -0,0 +1,15 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 0.0 | count 1 + +declare double @abs(double) + +define double @test(double %X) { + %Y = add double %X, 0.0 ;; Should be a single add x, 0.0 + %Z = add double %Y, 0.0 + ret double %Z +} + +define double @test1(double %X) { + %Y = call double @abs(double %X) + %Z = add double %Y, 0.0 + ret double %Z +} From nicholas at mxc.ca Tue Jan 29 00:56:40 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Mon, 28 Jan 2008 22:56:40 -0800 Subject: [llvm-commits] [llvm] r46499 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/zero-point-zero-add.ll In-Reply-To: <200801290652.m0T6qkIw029986@zion.cs.uiuc.edu> References: <200801290652.m0T6qkIw029986@zion.cs.uiuc.edu> Message-ID: <479ECE28.8010302@mxc.ca> Chris Lattner wrote: > + if (const IntrinsicInst *II = dyn_cast(I)) > + if (II->getIntrinsicID() == Intrinsic::sqrt) > + return CannotBeNegativeZero(II->getOperand(1)); "Unlike sqrt in libm, however, llvm.sqrt has undefined behavior for negative numbers (which allows for better optimization)." I think you can safely return true here. Nick From clattner at apple.com Tue Jan 29 00:57:40 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 22:57:40 -0800 Subject: [llvm-commits] [llvm] r46497 - /llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll In-Reply-To: <200801290640.m0T6eWiv029633@zion.cs.uiuc.edu> References: <200801290640.m0T6eWiv029633@zion.cs.uiuc.edu> Message-ID: On Jan 28, 2008, at 10:40 PM, Owen Anderson wrote: > Author: resistor > Date: Tue Jan 29 00:40:32 2008 > New Revision: 46497 > > URL: http://llvm.org/viewvc/llvm-project?rev=46497&view=rev > Log: > Add a testcase for eliminating memcpy's at the end of functions. > Forgot to commit this with my last commit. Nice, this is definitely progress. However, 'opt -dse' reduces this testcase down to: define void @_ada_placeholder() nounwind { entry: %an_interval = alloca %struct.placeholder__an_interval___PAD ; < %struct.placeholder__an_interval___PAD*> [#uses=3] %tmp34 = bitcast %struct.placeholder__an_interval___PAD* %an_interval to %struct.placeholder__T5b* ; <%struct.placeholder__T5b*> [#uses=1] %tmp5 = getelementptr %struct.placeholder__an_interval___PAD* %an_interval, i32 0, i32 0, i32 0 ; [#uses=1] store i32 1, i32* %tmp5, align 8 %tmp10 = getelementptr %struct.placeholder__T5b* %tmp34, i32 0, i32 1, i32 0 ; [#uses=1] store i32 1, i32* %tmp10, align 4 %tmp183185 = bitcast %struct.placeholder__an_interval___PAD* %an_interval to i8* ; [#uses=0] ret void } Why is DSE leaving around dead stores to the stack? :) Also, it seems that DSE would eliminate the trivially dead bitcast at the end as well. -Chris From clattner at apple.com Tue Jan 29 00:58:35 2008 From: clattner at apple.com (Chris Lattner) Date: Mon, 28 Jan 2008 22:58:35 -0800 Subject: [llvm-commits] [llvm] r46499 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/zero-point-zero-add.ll In-Reply-To: <479ECE28.8010302@mxc.ca> References: <200801290652.m0T6qkIw029986@zion.cs.uiuc.edu> <479ECE28.8010302@mxc.ca> Message-ID: <479CB3A3-09BD-4B57-A74F-DBEF01486759@apple.com> On Jan 28, 2008, at 10:56 PM, Nick Lewycky wrote: > Chris Lattner wrote: >> + if (const IntrinsicInst *II = dyn_cast(I)) >> + if (II->getIntrinsicID() == Intrinsic::sqrt) >> + return CannotBeNegativeZero(II->getOperand(1)); > > "Unlike sqrt in libm, however, llvm.sqrt has undefined behavior for > negative numbers (which allows for better optimization)." > > I think you can safely return true here. I will clarify LangRef: llvm.sqrt is defined for -0.0. Thanks! -Chris From sabre at nondot.org Tue Jan 29 01:00:44 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 29 Jan 2008 07:00:44 -0000 Subject: [llvm-commits] [llvm] r46500 - /llvm/trunk/docs/LangRef.html Message-ID: <200801290700.m0T70iPg030205@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 29 01:00:44 2008 New Revision: 46500 URL: http://llvm.org/viewvc/llvm-project?rev=46500&view=rev Log: llvm.sqrt(-0.0) is defined. Modified: llvm/trunk/docs/LangRef.html Modified: llvm/trunk/docs/LangRef.html URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=46500&r1=46499&r2=46500&view=diff ============================================================================== --- llvm/trunk/docs/LangRef.html (original) +++ llvm/trunk/docs/LangRef.html Tue Jan 29 01:00:44 2008 @@ -4677,7 +4677,9 @@ The 'llvm.sqrt' intrinsics return the sqrt of the specified operand, returning the same value as the libm 'sqrt' functions would. Unlike sqrt in libm, however, llvm.sqrt has undefined behavior for -negative numbers (which allows for better optimization). +negative numbers other than -0.0 (which allows for better optimization, because +there is no need to worry about errno being set). llvm.sqrt(-0.0) is +defined to return -0.0 like IEEE sqrt.

Arguments:
From djg at cray.com Tue Jan 29 05:36:13 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 11:36:13 -0000 Subject: [llvm-commits] [llvm] r46506 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h include/llvm/CodeGen/MachineRegisterInfo.h include/llvm/PassSupport.h lib/VMCore/AsmWriter.cpp Message-ID: <200801291136.m0TBaDLo013688@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 05:36:12 2008 New Revision: 46506 URL: http://llvm.org/viewvc/llvm-project?rev=46506&view=rev Log: Add explicit keywords. Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h llvm/trunk/include/llvm/PassSupport.h llvm/trunk/lib/VMCore/AsmWriter.cpp Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=46506&r1=46505&r2=46506&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Tue Jan 29 05:36:12 2008 @@ -97,7 +97,7 @@ } OffsetedInfo; } Contents; - MachineOperand(MachineOperandType K) : OpKind(K), ParentMI(0) {} + explicit MachineOperand(MachineOperandType K) : OpKind(K), ParentMI(0) {} public: MachineOperand(const MachineOperand &M) { *this = M; Modified: llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h?rev=46506&r1=46505&r2=46506&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h (original) +++ llvm/trunk/include/llvm/CodeGen/MachineRegisterInfo.h Tue Jan 29 05:36:12 2008 @@ -54,7 +54,7 @@ MachineRegisterInfo(const MachineRegisterInfo&); // DO NOT IMPLEMENT void operator=(const MachineRegisterInfo&); // DO NOT IMPLEMENT public: - MachineRegisterInfo(const MRegisterInfo &MRI); + explicit MachineRegisterInfo(const MRegisterInfo &MRI); ~MachineRegisterInfo(); //===--------------------------------------------------------------------===// @@ -203,7 +203,7 @@ class defusechain_iterator : public forward_iterator { MachineOperand *Op; - defusechain_iterator(MachineOperand *op) : Op(op) { + explicit defusechain_iterator(MachineOperand *op) : Op(op) { // If the first node isn't one we're interested in, advance to one that // we are interested in. if (op) { Modified: llvm/trunk/include/llvm/PassSupport.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassSupport.h?rev=46506&r1=46505&r2=46506&view=diff ============================================================================== --- llvm/trunk/include/llvm/PassSupport.h (original) +++ llvm/trunk/include/llvm/PassSupport.h Tue Jan 29 05:36:12 2008 @@ -144,7 +144,7 @@ : PIObj(Name, Arg, TI, NormalCtor, CFGOnly) { registerPass(); } - RegisterPassBase(intptr_t TI) + explicit RegisterPassBase(intptr_t TI) : PIObj("", "", TI) { // This ctor may only be used for analysis groups: it does not auto-register // the pass. Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=46506&r1=46505&r2=46506&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/AsmWriter.cpp (original) +++ llvm/trunk/lib/VMCore/AsmWriter.cpp Tue Jan 29 05:36:12 2008 @@ -57,10 +57,10 @@ /// @{ public: /// @brief Construct from a module - SlotMachine(const Module *M); + explicit SlotMachine(const Module *M); /// @brief Construct from a function, starting out in incorp state. - SlotMachine(const Function *F); + explicit SlotMachine(const Function *F); /// @} /// @name Accessors From djg at cray.com Tue Jan 29 06:06:34 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 12:06:34 -0000 Subject: [llvm-commits] [llvm] r46507 - /llvm/trunk/include/llvm/CodeGen/LiveVariables.h Message-ID: <200801291206.m0TC6ZkM014538@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 06:06:33 2008 New Revision: 46507 URL: http://llvm.org/viewvc/llvm-project?rev=46507&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h Modified: llvm/trunk/include/llvm/CodeGen/LiveVariables.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveVariables.h?rev=46507&r1=46506&r2=46507&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/LiveVariables.h (original) +++ llvm/trunk/include/llvm/CodeGen/LiveVariables.h Tue Jan 29 06:06:33 2008 @@ -14,7 +14,7 @@ // the instruction, but are never used after the instruction (i.e., they are // killed). // -// This class computes live variables using are sparse implementation based on +// This class computes live variables using a sparse implementation based on // the machine code SSA form. This class computes live variable information for // each virtual and _register allocatable_ physical register in a function. It // uses the dominance properties of SSA form to efficiently compute live From djg at cray.com Tue Jan 29 06:07:11 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 12:07:11 -0000 Subject: [llvm-commits] [llvm] r46508 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Message-ID: <200801291207.m0TC7BPg014563@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 06:07:11 2008 New Revision: 46508 URL: http://llvm.org/viewvc/llvm-project?rev=46508&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=46508&r1=46507&r2=46508&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Jan 29 06:07:11 2008 @@ -58,7 +58,6 @@ bool isBottomUp; /// AvailableQueue - The priority queue to use for the available SUnits. - ///a SchedulingPriorityQueue *AvailableQueue; /// LiveRegs / LiveRegDefs - A set of physical registers and their definition From djg at cray.com Tue Jan 29 06:08:20 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 12:08:20 -0000 Subject: [llvm-commits] [llvm] r46509 - /llvm/trunk/lib/Support/APFloat.cpp Message-ID: <200801291208.m0TC8KHY014608@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 06:08:20 2008 New Revision: 46509 URL: http://llvm.org/viewvc/llvm-project?rev=46509&view=rev Log: Remove top-level const qualifiers from casts, avoiding associated compiler warnings. Modified: llvm/trunk/lib/Support/APFloat.cpp Modified: llvm/trunk/lib/Support/APFloat.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=46509&r1=46508&r2=46509&view=diff ============================================================================== --- llvm/trunk/lib/Support/APFloat.cpp (original) +++ llvm/trunk/lib/Support/APFloat.cpp Tue Jan 29 06:08:20 2008 @@ -627,14 +627,14 @@ category != rhs.category || sign != rhs.sign) return false; - if (semantics==(const llvm::fltSemantics* const)&PPCDoubleDouble && + if (semantics==(const llvm::fltSemantics*)&PPCDoubleDouble && sign2 != rhs.sign2) return false; if (category==fcZero || category==fcInfinity) return true; else if (category==fcNormal && exponent!=rhs.exponent) return false; - else if (semantics==(const llvm::fltSemantics* const)&PPCDoubleDouble && + else if (semantics==(const llvm::fltSemantics*)&PPCDoubleDouble && exponent2!=rhs.exponent2) return false; else { @@ -2435,7 +2435,7 @@ APInt APFloat::convertF80LongDoubleAPFloatToAPInt() const { - assert(semantics == (const llvm::fltSemantics* const)&x87DoubleExtended); + assert(semantics == (const llvm::fltSemantics*)&x87DoubleExtended); assert (partCount()==2); uint64_t myexponent, mysignificand; @@ -2468,7 +2468,7 @@ APInt APFloat::convertPPCDoubleDoubleAPFloatToAPInt() const { - assert(semantics == (const llvm::fltSemantics* const)&PPCDoubleDouble); + assert(semantics == (const llvm::fltSemantics*)&PPCDoubleDouble); assert (partCount()==2); uint64_t myexponent, mysignificand, myexponent2, mysignificand2; @@ -2576,16 +2576,16 @@ APInt APFloat::convertToAPInt() const { - if (semantics == (const llvm::fltSemantics* const)&IEEEsingle) + if (semantics == (const llvm::fltSemantics*)&IEEEsingle) return convertFloatAPFloatToAPInt(); - if (semantics == (const llvm::fltSemantics* const)&IEEEdouble) + if (semantics == (const llvm::fltSemantics*)&IEEEdouble) return convertDoubleAPFloatToAPInt(); - if (semantics == (const llvm::fltSemantics* const)&PPCDoubleDouble) + if (semantics == (const llvm::fltSemantics*)&PPCDoubleDouble) return convertPPCDoubleDoubleAPFloatToAPInt(); - assert(semantics == (const llvm::fltSemantics* const)&x87DoubleExtended && + assert(semantics == (const llvm::fltSemantics*)&x87DoubleExtended && "unknown format!"); return convertF80LongDoubleAPFloatToAPInt(); } @@ -2593,7 +2593,7 @@ float APFloat::convertToFloat() const { - assert(semantics == (const llvm::fltSemantics* const)&IEEEsingle); + assert(semantics == (const llvm::fltSemantics*)&IEEEsingle); APInt api = convertToAPInt(); return api.bitsToFloat(); } @@ -2601,7 +2601,7 @@ double APFloat::convertToDouble() const { - assert(semantics == (const llvm::fltSemantics* const)&IEEEdouble); + assert(semantics == (const llvm::fltSemantics*)&IEEEdouble); APInt api = convertToAPInt(); return api.bitsToDouble(); } From djg at cray.com Tue Jan 29 06:09:56 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 12:09:56 -0000 Subject: [llvm-commits] [llvm] r46510 - in /llvm/trunk/lib/VMCore: Module.cpp Pass.cpp PassManager.cpp Message-ID: <200801291209.m0TC9uUG014665@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 06:09:55 2008 New Revision: 46510 URL: http://llvm.org/viewvc/llvm-project?rev=46510&view=rev Log: Fix 80-col violations. Modified: llvm/trunk/lib/VMCore/Module.cpp llvm/trunk/lib/VMCore/Pass.cpp llvm/trunk/lib/VMCore/PassManager.cpp Modified: llvm/trunk/lib/VMCore/Module.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=46510&r1=46509&r2=46510&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Module.cpp (original) +++ llvm/trunk/lib/VMCore/Module.cpp Tue Jan 29 06:09:55 2008 @@ -46,7 +46,8 @@ return Ret; } GlobalAlias *ilist_traits::createSentinel() { - GlobalAlias *Ret = new GlobalAlias(Type::Int32Ty, GlobalValue::ExternalLinkage); + GlobalAlias *Ret = new GlobalAlias(Type::Int32Ty, + GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); return Ret; Modified: llvm/trunk/lib/VMCore/Pass.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Pass.cpp?rev=46510&r1=46509&r2=46510&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/Pass.cpp (original) +++ llvm/trunk/lib/VMCore/Pass.cpp Tue Jan 29 06:09:55 2008 @@ -90,7 +90,8 @@ // run - On a function, we simply initialize, run the function, then finalize. // bool FunctionPass::run(Function &F) { - if (F.isDeclaration()) return false;// Passes are not run on external functions! + // Passes are not run on external functions! + if (F.isDeclaration()) return false; bool Changed = doInitialization(*F.getParent()); Changed |= runOnFunction(F); Modified: llvm/trunk/lib/VMCore/PassManager.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=46510&r1=46509&r2=46510&view=diff ============================================================================== --- llvm/trunk/lib/VMCore/PassManager.cpp (original) +++ llvm/trunk/lib/VMCore/PassManager.cpp Tue Jan 29 06:09:55 2008 @@ -475,7 +475,8 @@ // If Pass not found then check the interfaces implemented by Immutable Pass if (!P) { - const std::vector &ImmPI = PI->getInterfacesImplemented(); + const std::vector &ImmPI = + PI->getInterfacesImplemented(); if (std::find(ImmPI.begin(), ImmPI.end(), AID) != ImmPI.end()) P = *I; } @@ -588,8 +589,9 @@ for (std::vector::iterator I = HigherLevelAnalysis.begin(), E = HigherLevelAnalysis.end(); I != E; ++I) { Pass *P1 = *I; - if (!dynamic_cast(P1) - && std::find(PreservedSet.begin(), PreservedSet.end(), P1->getPassInfo()) == + if (!dynamic_cast(P1) && + std::find(PreservedSet.begin(), PreservedSet.end(), + P1->getPassInfo()) == PreservedSet.end()) return false; } @@ -642,8 +644,8 @@ I = InheritedAnalysis[Index]->begin(), E = InheritedAnalysis[Index]->end(); I != E; ) { std::map::iterator Info = I++; - if (!dynamic_cast(Info->second) - && std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == + if (!dynamic_cast(Info->second) && + std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) == PreservedSet.end()) // Remove this analysis InheritedAnalysis[Index]->erase(Info); @@ -974,7 +976,8 @@ if (TheTimeInfo) TheTimeInfo->passEnded(BP); if (Changed) - dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, I->getNameStart()); + dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, + I->getNameStart()); dumpAnalysisSetInfo("Preserved", BP, AnUsage.getPreservedSet()); verifyPreservedAnalysis(BP); @@ -1231,7 +1234,8 @@ AnalysisUsage AnUsage; MP->getAnalysisUsage(AnUsage); - dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str()); + dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, + M.getModuleIdentifier().c_str()); dumpAnalysisSetInfo("Required", MP, AnUsage.getRequiredSet()); initializeAnalysisImpl(MP); @@ -1241,7 +1245,8 @@ if (TheTimeInfo) TheTimeInfo->passEnded(MP); if (Changed) - dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str()); + dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG, + M.getModuleIdentifier().c_str()); dumpAnalysisSetInfo("Preserved", MP, AnUsage.getPreservedSet()); verifyPreservedAnalysis(MP); From djg at cray.com Tue Jan 29 06:12:40 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 12:12:40 -0000 Subject: [llvm-commits] [llvm] r46511 - /llvm/trunk/include/llvm/Analysis/LoopInfo.h Message-ID: <200801291212.m0TCCehK014753@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 06:12:40 2008 New Revision: 46511 URL: http://llvm.org/viewvc/llvm-project?rev=46511&view=rev Log: Add comments describing what the loop depth values mean. Also, make a minor simplification to the loop depth calculation code. Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=46511&r1=46510&r2=46511&view=diff ============================================================================== --- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original) +++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Jan 29 06:12:40 2008 @@ -84,9 +84,12 @@ delete SubLoops[i]; } + /// getLoopDepth - Return the nesting level of this loop. An outer-most + /// loop has depth 1, for consistency with loop depth values used for basic + /// blocks, where depth 0 is used for blocks not inside any loops. unsigned getLoopDepth() const { - unsigned D = 0; - for (const LoopBase *CurLoop = this; CurLoop; + unsigned D = 1; + for (const LoopBase *CurLoop = ParentLoop; CurLoop; CurLoop = CurLoop->ParentLoop) ++D; return D; @@ -603,7 +606,8 @@ return getLoopFor(BB); } - /// getLoopDepth - Return the loop nesting level of the specified block... + /// getLoopDepth - Return the loop nesting level of the specified block. A + /// depth of 0 means the block is not inside any loop. /// unsigned getLoopDepth(const BlockT *BB) const { const LoopBase *L = getLoopFor(BB); @@ -898,7 +902,8 @@ return LI->getLoopFor(BB); } - /// getLoopDepth - Return the loop nesting level of the specified block... + /// getLoopDepth - Return the loop nesting level of the specified block. A + /// depth of 0 means the block is not inside any loop. /// inline unsigned getLoopDepth(const BasicBlock *BB) const { return LI->getLoopDepth(BB); From djg at cray.com Tue Jan 29 06:35:51 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 12:35:51 -0000 Subject: [llvm-commits] [llvm] r46512 - /llvm/trunk/utils/vim/llvm.vim Message-ID: <200801291235.m0TCZppG015400@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 06:35:50 2008 New Revision: 46512 URL: http://llvm.org/viewvc/llvm-project?rev=46512&view=rev Log: Update this file for 2.0 syntax. Modified: llvm/trunk/utils/vim/llvm.vim Modified: llvm/trunk/utils/vim/llvm.vim URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/vim/llvm.vim?rev=46512&r1=46511&r2=46512&view=diff ============================================================================== --- llvm/trunk/utils/vim/llvm.vim (original) +++ llvm/trunk/utils/vim/llvm.vim Tue Jan 29 06:35:50 2008 @@ -11,25 +11,33 @@ syn case match -syn keyword llvmType void bool sbyte ubyte -syn keyword llvmType short ushort int uint -syn keyword llvmType long ulong float double +syn keyword llvmType void float double +syn keyword llvmType x86_fp80 fp128 ppc_fp128 syn keyword llvmType type label opaque +syn match llvmType /\/ -syn keyword llvmStatement add sub mul div rem +syn keyword llvmStatement add sub mul sdiv udiv fdiv srem urem frem syn keyword llvmStatement and or xor -syn keyword llvmStatement setne seteq setlt setgt setle setge - -syn keyword llvmStatement phi tail call cast to select shl shr vaarg vanext +syn keyword llvmStatement icmp fcmp +syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle +syn keyword llvmStatement false oeq ogt oge olt ole one ord ueq ugt uge +syn keyword llvmStatement ult ule une uno true + +syn keyword llvmStatement phi tail call to select shl lshr ashr va_arg +syn keyword llvmStatement trunc zext sext +syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp +syn keyword llvmStatement ptrtoint inttoptr bitcast syn keyword llvmStatement ret br switch invoke unwind unreachable syn keyword llvmStatement malloc alloca free load store getelementptr -syn keyword llvmStatement begin end true false zeroinitializer -syn keyword llvmStatement declare global constant const +syn keyword llvmStatement true false zeroinitializer +syn keyword llvmStatement define declare global constant const syn keyword llvmStatement internal uninitialized external implementation syn keyword llvmStatement linkonce weak appending -syn keyword llvmStatement undef null to except target endian pointersize deplibs +syn keyword llvmStatement undef null to except target datalayout triple deplibs syn keyword llvmStatement big little volatile fastcc coldcc cc +syn keyword llvmStatement extractelement insertelement shufflevector +syn keyword llvmStatement module asm align "syn match llvmFunction /%[a-zA-Z\$._\-][a-zA-Z\$._\-0-9]*/ syn match llvmNumber /\<\d\+\>/ From djg at cray.com Tue Jan 29 06:43:51 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 12:43:51 -0000 Subject: [llvm-commits] [llvm] r46513 - /llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Message-ID: <200801291243.m0TChp6H015632@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 06:43:50 2008 New Revision: 46513 URL: http://llvm.org/viewvc/llvm-project?rev=46513&view=rev Log: Fix a typo in a comment. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=46513&r1=46512&r2=46513&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Jan 29 06:43:50 2008 @@ -1386,7 +1386,7 @@ if (!SuccSU->Node || !SuccSU->Node->isTargetOpcode()) continue; // Don't constrain nodes with physical register defs if the - // predecessor can cloober them. + // predecessor can clobber them. if (SuccSU->hasPhysRegDefs) { if (canClobberPhysRegDefs(SuccSU, SU, TII, MRI)) continue; From djg at cray.com Tue Jan 29 07:02:09 2008 From: djg at cray.com (Dan Gohman) Date: Tue, 29 Jan 2008 13:02:09 -0000 Subject: [llvm-commits] [llvm] r46514 - in /llvm/trunk/lib: Archive/ Bitcode/Reader/ CodeGen/ CodeGen/SelectionDAG/ ExecutionEngine/Interpreter/ System/Win32/ Transforms/IPO/ Transforms/Scalar/ Message-ID: <200801291302.m0TD2Ah3016205@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 07:02:09 2008 New Revision: 46514 URL: http://llvm.org/viewvc/llvm-project?rev=46514&view=rev Log: Use empty() instead of comparing size() with zero. Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp llvm/trunk/lib/CodeGen/BranchFolding.cpp llvm/trunk/lib/CodeGen/IfConversion.cpp llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp llvm/trunk/lib/System/Win32/Path.inc llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp llvm/trunk/lib/Transforms/Scalar/LICM.cpp llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/Archive/ArchiveReader.cpp (original) +++ llvm/trunk/lib/Archive/ArchiveReader.cpp Tue Jan 29 07:02:09 2008 @@ -588,7 +588,7 @@ bool Archive::isBitcodeArchive() { // Make sure the symTab has been loaded. In most cases this should have been // done when the archive was constructed, but still, this is just in case. - if (!symTab.size()) + if (symTab.empty()) if (!loadSymbolTable(0)) return false; Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Tue Jan 29 07:02:09 2008 @@ -1327,7 +1327,7 @@ } case bitc::FUNC_CODE_INST_RET: // RET: [opty,opval] - if (Record.size() == 0) { + if (Record.empty()) { I = new ReturnInst(); break; } else { Modified: llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp (original) +++ llvm/trunk/lib/Bitcode/Reader/Deserialize.cpp Tue Jan 29 07:02:09 2008 @@ -115,7 +115,7 @@ if (Stream.AtEndOfStream()) return; - assert (Record.size() == 0); + assert (Record.empty()); assert (AbbrevNo >= bitc::UNABBREV_RECORD); RecordCode = Stream.ReadRecord(AbbrevNo,Record); assert (Record.size() > 0); Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original) +++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Tue Jan 29 07:02:09 2008 @@ -646,7 +646,7 @@ } else if (FBB) { if (TBB!=IBB && FBB!=IBB) // cbr then ubr continue; - } else if (Cond.size() == 0) { + } else if (Cond.empty()) { if (TBB!=IBB) // ubr continue; } else { Modified: llvm/trunk/lib/CodeGen/IfConversion.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IfConversion.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/IfConversion.cpp (original) +++ llvm/trunk/lib/CodeGen/IfConversion.cpp Tue Jan 29 07:02:09 2008 @@ -237,7 +237,7 @@ // Look for root nodes, i.e. blocks without successors. for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) - if (I->succ_size() == 0) + if (I->succ_empty()) Roots.push_back(I); std::vector Tokens; @@ -428,7 +428,7 @@ unsigned Size = TrueBBI.NonPredSize; if (TrueBBI.IsBrAnalyzable) { - if (TrueBBI.TrueBB && TrueBBI.BrCond.size() == 0) + if (TrueBBI.TrueBB && TrueBBI.BrCond.empty()) // End with an unconditional branch. It will be removed. --Size; else { @@ -646,7 +646,7 @@ ScanInstructions(BBI); // Unanalyable or ends with fallthrough or unconditional branch. - if (!BBI.IsBrAnalyzable || BBI.BrCond.size() == 0) { + if (!BBI.IsBrAnalyzable || BBI.BrCond.empty()) { BBI.IsBeingAnalyzed = false; BBI.IsAnalyzed = true; return BBI; Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Tue Jan 29 07:02:09 2008 @@ -1784,7 +1784,7 @@ } // Remove landing pads with no try-ranges. - if (!LandingPads[i].BeginLabels.size()) { + if (LandingPads[i].BeginLabels.empty()) { LandingPads.erase(LandingPads.begin() + i); continue; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Jan 29 07:02:09 2008 @@ -801,7 +801,7 @@ // If we've change things around then replace token factor. if (Changed) { - if (Ops.size() == 0) { + if (Ops.empty()) { // The entry token is the only possible outcome. Result = DAG.getEntryNode(); } else { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Tue Jan 29 07:02:09 2008 @@ -230,7 +230,7 @@ void ScheduleDAG::CalculateDepths() { std::vector > WorkList; for (unsigned i = 0, e = SUnits.size(); i != e; ++i) - if (SUnits[i].Preds.size() == 0) + if (SUnits[i].Preds.empty()) WorkList.push_back(std::make_pair(&SUnits[i], 0U)); while (!WorkList.empty()) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Tue Jan 29 07:02:09 2008 @@ -169,7 +169,7 @@ // All leaves to Available queue. for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { // It is available if it has no predecessors. - if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) { + if (SUnits[i].Preds.empty() && &SUnits[i] != Entry) { AvailableQueue->push(&SUnits[i]); SUnits[i].isAvailable = SUnits[i].isPending = true; } @@ -477,7 +477,7 @@ std::vector > WorkList; for (unsigned i = 0, e = SUnits->size(); i != e; ++i) { const SUnit *SU = &(*SUnits)[i]; - if (SU->Succs.size() == 0) + if (SU->Succs.empty()) WorkList.push_back(std::make_pair(SU, 0U)); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Tue Jan 29 07:02:09 2008 @@ -898,7 +898,7 @@ // All leaves to Available queue. for (unsigned i = 0, e = SUnits.size(); i != e; ++i) { // It is available if it has no predecessors. - if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) { + if (SUnits[i].Preds.empty() && &SUnits[i] != Entry) { AvailableQueue->push(&SUnits[i]); SUnits[i].isAvailable = true; } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jan 29 07:02:09 2008 @@ -3497,7 +3497,7 @@ bool SDNode::hasAnyUseOfValue(unsigned Value) const { assert(Value < getNumValues() && "Bad value!"); - if (use_size() == 0) return false; + if (use_empty()) return false; SDOperand TheValue(const_cast(this), Value); Modified: llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp (original) +++ llvm/trunk/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Tue Jan 29 07:02:09 2008 @@ -257,7 +257,7 @@ // double drand48() GenericValue lle_X_drand48(FunctionType *FT, const vector &Args) { - assert(Args.size() == 0); + assert(Args.empty()); GenericValue GV; GV.DoubleVal = drand48(); return GV; @@ -265,7 +265,7 @@ // long lrand48() GenericValue lle_X_lrand48(FunctionType *FT, const vector &Args) { - assert(Args.size() == 0); + assert(Args.empty()); GenericValue GV; GV.IntVal = APInt(32, lrand48()); return GV; @@ -282,7 +282,7 @@ // int rand() GenericValue lle_X_rand(FunctionType *FT, const vector &Args) { - assert(Args.size() == 0); + assert(Args.empty()); GenericValue GV; GV.IntVal = APInt(32, rand()); return GV; Modified: llvm/trunk/lib/System/Win32/Path.inc URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/System/Win32/Path.inc (original) +++ llvm/trunk/lib/System/Win32/Path.inc Tue Jan 29 07:02:09 2008 @@ -418,7 +418,7 @@ bool Path::set(const std::string& a_path) { - if (a_path.size() == 0) + if (a_path.empty()) return false; std::string save(path); path = a_path; Modified: llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/SimplifyLibCalls.cpp Tue Jan 29 07:02:09 2008 @@ -740,7 +740,7 @@ // If the constant string's length is zero we can optimize this by just // doing a store of 0 at the first byte of the destination - if (SrcStr.size() == 0) { + if (SrcStr.empty()) { new StoreInst(ConstantInt::get(Type::Int8Ty, 0), Dst, CI); return ReplaceCallWith(CI, Dst); } Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Tue Jan 29 07:02:09 2008 @@ -476,7 +476,7 @@ while (isa(InsertPt)) ++InsertPt; ExitBlocks[0]->getInstList().insert(InsertPt, &I); } - } else if (ExitBlocks.size() == 0) { + } else if (ExitBlocks.empty()) { // The instruction is actually dead if there ARE NO exit blocks. CurAST->deleteValue(&I); if (!I.use_empty()) // If I has users in unreachable blocks, eliminate. Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Jan 29 07:02:09 2008 @@ -1214,7 +1214,7 @@ Loop *L, bool isOnlyStride) { // If all the users are moved to another stride, then there is nothing to do. - if (Uses.Users.size() == 0) + if (Uses.Users.empty()) return; // Keep track if every use in UsersToProcess is an address. If they all are, Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=46514&r1=46513&r2=46514&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Tue Jan 29 07:02:09 2008 @@ -722,7 +722,7 @@ ++NumFactor; - if (Ops.size() == 0) + if (Ops.empty()) return V2; // Add the new value to the list of things being added. From lauro.venancio at gmail.com Tue Jan 29 11:25:20 2008 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 29 Jan 2008 17:25:20 -0000 Subject: [llvm-commits] [test-suite] r46516 - in /test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url: search.c url.c Message-ID: <200801291725.m0THPKmJ023965@zion.cs.uiuc.edu> Author: laurov Date: Tue Jan 29 11:25:20 2008 New Revision: 46516 URL: http://llvm.org/viewvc/llvm-project?rev=46516&view=rev Log: Fix memory leaks. Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c?rev=46516&r1=46515&r2=46516&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/search.c Tue Jan 29 11:25:20 2008 @@ -281,6 +281,7 @@ } } *lcssize = sub_pat_size; + free(bmBc); return sub_pattern; } Modified: test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c?rev=46516&r1=46515&r2=46516&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c (original) +++ test-suite/trunk/MultiSource/Benchmarks/Trimaran/netbench-url/url.c Tue Jan 29 11:25:20 2008 @@ -139,6 +139,7 @@ are done in route application. */ /* Done for the packet... */ + free(packet); } fprintf (stderr, "URL finished for %d packets \n", num_packets); From lauro.venancio at gmail.com Tue Jan 29 12:09:04 2008 From: lauro.venancio at gmail.com (Lauro Ramos Venancio) Date: Tue, 29 Jan 2008 18:09:04 -0000 Subject: [llvm-commits] [test-suite] r46518 - /test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Message-ID: <200801291809.m0TI949Q025186@zion.cs.uiuc.edu> Author: laurov Date: Tue Jan 29 12:09:04 2008 New Revision: 46518 URL: http://llvm.org/viewvc/llvm-project?rev=46518&view=rev Log: Define SMALL_PROBLEM_SIZE and add "-lm" to LDFLAGS. Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Modified: test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile?rev=46518&r1=46517&r2=46518&view=diff ============================================================================== --- test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile (original) +++ test-suite/trunk/MultiSource/Benchmarks/VersaBench/beamformer/Makefile Tue Jan 29 12:09:04 2008 @@ -1,9 +1,12 @@ LEVEL = ../../../.. +LDFLAGS += -lm PROG = beamformer FP_TOLERANCE = 0.000001 ifdef LARGE_PROBLEM_SIZE RUN_OPTIONS = -i 400 +else ifdef SMALL_PROBLEM_SIZE +RUN_OPTIONS = -i 25 else RUN_OPTIONS = -i 140 endif From kremenek at apple.com Tue Jan 29 12:55:15 2008 From: kremenek at apple.com (Ted Kremenek) Date: Tue, 29 Jan 2008 18:55:15 -0000 Subject: [llvm-commits] [llvm] r46521 - /llvm/trunk/include/llvm/ADT/APSInt.h Message-ID: <200801291855.m0TItFMB026470@zion.cs.uiuc.edu> Author: kremenek Date: Tue Jan 29 12:55:14 2008 New Revision: 46521 URL: http://llvm.org/viewvc/llvm-project?rev=46521&view=rev Log: Altered ctor for APSInt to accept an optional "isUnsigned" flag. Default behavior is unchanged. Modified: llvm/trunk/include/llvm/ADT/APSInt.h Modified: llvm/trunk/include/llvm/ADT/APSInt.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APSInt.h?rev=46521&r1=46520&r2=46521&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/APSInt.h (original) +++ llvm/trunk/include/llvm/ADT/APSInt.h Tue Jan 29 12:55:14 2008 @@ -25,7 +25,8 @@ public: /// APSInt ctor - Create an APSInt with the specified width, default to /// unsigned. - explicit APSInt(uint32_t BitWidth) : APInt(BitWidth, 0), IsUnsigned(true) {} + explicit APSInt(uint32_t BitWidth, bool isUnsigned = true) + : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {} explicit APSInt(const APInt &I, bool isUnsigned = true) : APInt(I), IsUnsigned(isUnsigned) {} From sabre at nondot.org Tue Jan 29 13:01:37 2008 From: sabre at nondot.org (Chris Lattner) Date: Tue, 29 Jan 2008 19:01:37 -0000 Subject: [llvm-commits] [llvm] r46523 - in /llvm/trunk: lib/Transforms/IPO/GlobalOpt.cpp test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll Message-ID: <200801291901.m0TJ1bu3026671@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 29 13:01:37 2008 New Revision: 46523 URL: http://llvm.org/viewvc/llvm-project?rev=46523&view=rev Log: Don't let globalopt hack on volatile loads or stores. Added: llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Modified: llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp?rev=46523&r1=46522&r2=46523&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp (original) +++ llvm/trunk/lib/Transforms/IPO/GlobalOpt.cpp Tue Jan 29 13:01:37 2008 @@ -163,12 +163,15 @@ else if (GS.AccessingFunction != F) GS.HasMultipleAccessingFunctions = true; } - if (isa(I)) { + if (LoadInst *LI = dyn_cast(I)) { GS.isLoaded = true; + if (LI->isVolatile()) return true; // Don't hack on volatile loads. } else if (StoreInst *SI = dyn_cast(I)) { // Don't allow a store OF the address, only stores TO the address. if (SI->getOperand(0) == V) return true; + if (SI->isVolatile()) return true; // Don't hack on volatile stores. + // If this is a direct store to the global (i.e., the global is a scalar // value, not an aggregate), keep more specific information about // stores. Added: llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll?rev=46523&view=auto ============================================================================== --- llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll (added) +++ llvm/trunk/test/Transforms/GlobalOpt/2008-01-29-VolatileGlobal.ll Tue Jan 29 13:01:37 2008 @@ -0,0 +1,9 @@ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | grep {volatile load} + at t0.1441 = internal global double 0x3FD5555555555555, align 8 ; [#uses=1] + +define double @foo() nounwind { +entry: + %tmp1 = volatile load double* @t0.1441, align 8 ; [#uses=2] + %tmp4 = mul double %tmp1, %tmp1 ; [#uses=1] + ret double %tmp4 +} From baldrick at free.fr Tue Jan 29 13:29:08 2008 From: baldrick at free.fr (Duncan Sands) Date: Tue, 29 Jan 2008 19:29:08 -0000 Subject: [llvm-commits] [llvm] r46525 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Message-ID: <200801291929.m0TJT8wS027589@zion.cs.uiuc.edu> Author: baldrick Date: Tue Jan 29 13:29:08 2008 New Revision: 46525 URL: http://llvm.org/viewvc/llvm-project?rev=46525&view=rev Log: When expanding an operand, it's not the result value type that matters but the operand type. This fixes 2008-01-08-IllegalCMP.ll which crashed with the new legalize infrastructure because SETCC with result type i8 and operand type i64 was being custom expanded by the X86 backend. With this fix, the gcc build gets as far as the first libcall. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=46525&r1=46524&r2=46525&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Tue Jan 29 13:29:08 2008 @@ -747,8 +747,8 @@ DEBUG(cerr << "Expand node operand: "; N->dump(&DAG); cerr << "\n"); SDOperand Res(0, 0); - if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) == - TargetLowering::Custom) + if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType()) + == TargetLowering::Custom) Res = TLI.LowerOperation(SDOperand(N, 0), DAG); if (Res.Val == 0) { From evan.cheng at apple.com Tue Jan 29 13:30:05 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 29 Jan 2008 19:30:05 -0000 Subject: [llvm-commits] [llvm] r46526 - /llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c Message-ID: <200801291930.m0TJU50l027629@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jan 29 13:30:05 2008 New Revision: 46526 URL: http://llvm.org/viewvc/llvm-project?rev=46526&view=rev Log: Update this test case. Modified: llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c Modified: llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c?rev=46526&r1=46525&r2=46526&view=diff ============================================================================== --- llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c (original) +++ llvm/trunk/test/CFrontend/2008-01-25-ZeroSizedAggregate.c Tue Jan 29 13:30:05 2008 @@ -12,8 +12,7 @@ checkx2411(a2411[0]); } -// A field that is an aggregates of size zero should be dropped during -// type conversion. +// Proper handling of zero sized fields during type conversion. typedef unsigned long long int Tal2ullong __attribute__((aligned(2))); struct S2525 { Tal2ullong: 0; @@ -29,3 +28,12 @@ char * i[5]; } data; +// Taking address of a zero sized field. +struct Z {}; +struct Y { + int i; + struct Z z; +}; +void *f(struct Y *y) { + return &y->z; +} From evan.cheng at apple.com Tue Jan 29 13:34:22 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Tue, 29 Jan 2008 19:34:22 -0000 Subject: [llvm-commits] [llvm] r46527 - in /llvm/trunk/lib/Target/X86: X86FloatingPoint.cpp X86ISelDAGToDAG.cpp X86ISelLowering.cpp X86ISelLowering.h X86Instr64bit.td X86InstrFPStack.td Message-ID: <200801291934.m0TJYN5V027842@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jan 29 13:34:22 2008 New Revision: 46527 URL: http://llvm.org/viewvc/llvm-project?rev=46527&view=rev Log: Work in progress. This patch *fixes* x86-64 calls which are modelled as StructRet but really should be return in registers, e.g. _Complex long double, some 128-bit aggregates. This is a short term solution that is necessary only because llvm, for now, cannot model i128 nor call's with multiple results. Status: This only works for direct calls, and only the caller side is done. Disabled for now. Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h llvm/trunk/lib/Target/X86/X86Instr64bit.td llvm/trunk/lib/Target/X86/X86InstrFPStack.td Modified: llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp?rev=46527&r1=46526&r2=46527&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp (original) +++ llvm/trunk/lib/Target/X86/X86FloatingPoint.cpp Tue Jan 29 13:34:22 2008 @@ -935,6 +935,11 @@ assert(StackTop == 0 && "Stack should be empty after a call!"); pushReg(getFPReg(MI->getOperand(0))); break; + case X86::FpGETRESULT80x2: + assert(StackTop == 0 && "Stack should be empty after a call!"); + pushReg(getFPReg(MI->getOperand(0))); + pushReg(getFPReg(MI->getOperand(1))); + break; case X86::FpSETRESULT32: case X86::FpSETRESULT64: case X86::FpSETRESULT80: Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=46527&r1=46526&r2=46527&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Jan 29 13:34:22 2008 @@ -1152,6 +1152,26 @@ case X86ISD::GlobalBaseReg: return getGlobalBaseReg(); + case X86ISD::FP_GET_RESULT2: { + SDOperand Chain = N.getOperand(0); + SDOperand InFlag = N.getOperand(1); + AddToISelQueue(Chain); + AddToISelQueue(InFlag); + std::vector Tys; + Tys.push_back(MVT::f80); + Tys.push_back(MVT::f80); + Tys.push_back(MVT::Other); + Tys.push_back(MVT::Flag); + SDOperand Ops[] = { Chain, InFlag }; + SDNode *ResNode = CurDAG->getTargetNode(X86::FpGETRESULT80x2, Tys, + Ops, 2); + Chain = SDOperand(ResNode, 2); + InFlag = SDOperand(ResNode, 3); + ReplaceUses(SDOperand(N.Val, 2), Chain); + ReplaceUses(SDOperand(N.Val, 3), InFlag); + return ResNode; + } + case ISD::ADD: { // Turn ADD X, c to MOV32ri X+c. This cannot be done with tblgen'd // code and is matched first so to prevent it from being turned into Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46527&r1=46526&r2=46527&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Tue Jan 29 13:34:22 2008 @@ -907,6 +907,44 @@ &ResultVals[0], ResultVals.size()).Val; } +/// LowerCallResultToTwo64BitRegs - Lower the result values of an x86-64 +/// ISD::CALL where the results are known to be in two 64-bit registers, +/// e.g. XMM0 and XMM1. This simplify store the two values back to the +/// fixed stack slot allocated for StructRet. +SDNode *X86TargetLowering:: +LowerCallResultToTwo64BitRegs(SDOperand Chain, SDOperand InFlag, + SDNode *TheCall, unsigned Reg1, unsigned Reg2, + MVT::ValueType VT, SelectionDAG &DAG) { + SDOperand RetVal1 = DAG.getCopyFromReg(Chain, Reg1, VT, InFlag); + Chain = RetVal1.getValue(1); + InFlag = RetVal1.getValue(2); + SDOperand RetVal2 = DAG.getCopyFromReg(Chain, Reg2, VT, InFlag); + Chain = RetVal2.getValue(1); + InFlag = RetVal2.getValue(2); + SDOperand FIN = TheCall->getOperand(5); + Chain = DAG.getStore(Chain, RetVal1, FIN, NULL, 0); + FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(8)); + Chain = DAG.getStore(Chain, RetVal2, FIN, NULL, 0); + return Chain.Val; +} + +/// LowerCallResultToTwoX87Regs - Lower the result values of an x86-64 ISD::CALL +/// where the results are known to be in ST0 and ST1. +SDNode *X86TargetLowering:: +LowerCallResultToTwoX87Regs(SDOperand Chain, SDOperand InFlag, + SDNode *TheCall, SelectionDAG &DAG) { + SmallVector ResultVals; + const MVT::ValueType VTs[] = { MVT::f80, MVT::f80, MVT::Other, MVT::Flag }; + SDVTList Tys = DAG.getVTList(VTs, 4); + SDOperand Ops[] = { Chain, InFlag }; + SDOperand RetVal = DAG.getNode(X86ISD::FP_GET_RESULT2, Tys, Ops, 2); + Chain = RetVal.getValue(2); + SDOperand FIN = TheCall->getOperand(5); + Chain = DAG.getStore(Chain, RetVal.getValue(1), FIN, NULL, 0); + FIN = DAG.getNode(ISD::ADD, getPointerTy(), FIN, DAG.getIntPtrConstant(16)); + Chain = DAG.getStore(Chain, RetVal, FIN, NULL, 0); + return Chain.Val; +} //===----------------------------------------------------------------------===// // C & StdCall & Fast Calling Convention implementation @@ -1253,6 +1291,64 @@ return DAG.getStore(Chain, Arg, PtrOff, NULL, 0); } +/// ClassifyX86_64SRetCallReturn - Classify how to implement a x86-64 +/// struct return call to the specified function. X86-64 ABI specifies +/// some SRet calls are actually returned in registers. Since current +/// LLVM cannot represent multi-value calls, they are represent as +/// calls where the results are passed in a hidden struct provided by +/// the caller. This function examines the type of the struct to +/// determine the correct way to implement the call. +X86::X86_64SRet +X86TargetLowering::ClassifyX86_64SRetCallReturn(const Function *Fn) { + // FIXME: Disabled for now. + return X86::InMemory; + + const PointerType *PTy = cast(Fn->arg_begin()->getType()); + const Type *RTy = PTy->getElementType(); + unsigned Size = getTargetData()->getABITypeSize(RTy); + if (Size != 16 && Size != 32) + return X86::InMemory; + + if (Size == 32) { + const StructType *STy = dyn_cast(RTy); + if (!STy) return X86::InMemory; + if (STy->getNumElements() == 2 && + STy->getElementType(0) == Type::X86_FP80Ty && + STy->getElementType(1) == Type::X86_FP80Ty) + return X86::InX87; + } + + bool AllFP = true; + for (Type::subtype_iterator I = RTy->subtype_begin(), E = RTy->subtype_end(); + I != E; ++I) { + const Type *STy = I->get(); + if (!STy->isFPOrFPVector()) { + AllFP = false; + break; + } + } + + if (AllFP) + return X86::InSSE; + return X86::InGPR64; +} + +void X86TargetLowering::X86_64AnalyzeSRetCallOperands(SDNode *TheCall, + CCAssignFn *Fn, + CCState &CCInfo) { + unsigned NumOps = (TheCall->getNumOperands() - 5) / 2; + for (unsigned i = 1; i != NumOps; ++i) { + MVT::ValueType ArgVT = TheCall->getOperand(5+2*i).getValueType(); + SDOperand FlagOp = TheCall->getOperand(5+2*i+1); + unsigned ArgFlags =cast(FlagOp)->getValue(); + if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, CCInfo)) { + cerr << "Call operand #" << i << " has unhandled type " + << MVT::getValueTypeString(ArgVT) << "\n"; + abort(); + } + } +} + SDOperand X86TargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG) { MachineFunction &MF = DAG.getMachineFunction(); SDOperand Chain = Op.getOperand(0); @@ -1262,6 +1358,7 @@ && CC == CallingConv::Fast && PerformTailCallOpt; SDOperand Callee = Op.getOperand(4); bool Is64Bit = Subtarget->is64Bit(); + bool IsStructRet = CallIsStructReturn(Op); assert(!(isVarArg && CC == CallingConv::Fast) && "Var args not supported with calling convention fastcc"); @@ -1269,7 +1366,24 @@ // Analyze operands of the call, assigning locations to each operand. SmallVector ArgLocs; CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs); - CCInfo.AnalyzeCallOperands(Op.Val, CCAssignFnForNode(Op)); + CCAssignFn *CCFn = CCAssignFnForNode(Op); + + X86::X86_64SRet SRetMethod = X86::InMemory; + if (Is64Bit && IsStructRet) + // FIXME: We can't figure out type of the sret structure for indirect + // calls. We need to copy more information from CallSite to the ISD::CALL + // node. + if (GlobalAddressSDNode *G = dyn_cast(Callee)) + SRetMethod = + ClassifyX86_64SRetCallReturn(dyn_cast(G->getGlobal())); + + // UGLY HACK! For x86-64, some 128-bit aggregates are returns in a pair of + // registers. Unfortunately, llvm does not support i128 yet so we pretend it's + // a sret call. + if (SRetMethod != X86::InMemory) + X86_64AnalyzeSRetCallOperands(Op.Val, CCFn, CCInfo); + else + CCInfo.AnalyzeCallOperands(Op.Val, CCFn); // Get a count of how many bytes are to be pushed on the stack. unsigned NumBytes = CCInfo.getNextStackOffset(); @@ -1540,7 +1654,7 @@ unsigned NumBytesForCalleeToPush; if (IsCalleePop(Op)) NumBytesForCalleeToPush = NumBytes; // Callee pops everything - else if (!Is64Bit && CallIsStructReturn(Op)) + else if (!Is64Bit && IsStructRet) // If this is is a call to a struct-return function, the callee // pops the hidden struct pointer, so we have to push it back. // This is common for Darwin/X86, Linux & Mingw32 targets. @@ -1557,7 +1671,21 @@ // Handle result values, copying them out of physregs into vregs that we // return. - return SDOperand(LowerCallResult(Chain, InFlag, Op.Val, CC, DAG), Op.ResNo); + switch (SRetMethod) { + default: + return SDOperand(LowerCallResult(Chain, InFlag, Op.Val, CC, DAG), Op.ResNo); + case X86::InGPR64: + return SDOperand(LowerCallResultToTwo64BitRegs(Chain, InFlag, Op.Val, + X86::RAX, X86::RDX, + MVT::i64, DAG), Op.ResNo); + case X86::InSSE: + return SDOperand(LowerCallResultToTwo64BitRegs(Chain, InFlag, Op.Val, + X86::XMM0, X86::XMM1, + MVT::f64, DAG), Op.ResNo); + case X86::InX87: + return SDOperand(LowerCallResultToTwoX87Regs(Chain, InFlag, Op.Val, DAG), + Op.ResNo); + } } @@ -5114,6 +5242,7 @@ case X86ISD::FLD: return "X86ISD::FLD"; case X86ISD::FST: return "X86ISD::FST"; case X86ISD::FP_GET_RESULT: return "X86ISD::FP_GET_RESULT"; + case X86ISD::FP_GET_RESULT2: return "X86ISD::FP_GET_RESULT2"; case X86ISD::FP_SET_RESULT: return "X86ISD::FP_SET_RESULT"; case X86ISD::CALL: return "X86ISD::CALL"; case X86ISD::TAILCALL: return "X86ISD::TAILCALL"; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=46527&r1=46526&r2=46527&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Tue Jan 29 13:34:22 2008 @@ -89,6 +89,10 @@ /// writes a RFP result and a chain. FP_GET_RESULT, + /// FP_GET_RESULT2 - Same as FP_GET_RESULT except it copies two values + /// ST(0) and ST(1). + FP_GET_RESULT2, + /// FP_SET_RESULT - This corresponds to FpSETRESULT pseudo instruction /// which copies the source operand to ST(0). It takes a chain+value and /// returns a chain and a flag. @@ -201,96 +205,107 @@ }; } - /// Define some predicates that are used for node matching. - namespace X86 { - /// isPSHUFDMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to PSHUFD. - bool isPSHUFDMask(SDNode *N); - - /// isPSHUFHWMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to PSHUFD. - bool isPSHUFHWMask(SDNode *N); - - /// isPSHUFLWMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to PSHUFD. - bool isPSHUFLWMask(SDNode *N); - - /// isSHUFPMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to SHUFP*. - bool isSHUFPMask(SDNode *N); - - /// isMOVHLPSMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to MOVHLPS. - bool isMOVHLPSMask(SDNode *N); - - /// isMOVHLPS_v_undef_Mask - Special case of isMOVHLPSMask for canonical form - /// of vector_shuffle v, v, <2, 3, 2, 3>, i.e. vector_shuffle v, undef, - /// <2, 3, 2, 3> - bool isMOVHLPS_v_undef_Mask(SDNode *N); - - /// isMOVLPMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to MOVLP{S|D}. - bool isMOVLPMask(SDNode *N); - - /// isMOVHPMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to MOVHP{S|D} - /// as well as MOVLHPS. - bool isMOVHPMask(SDNode *N); - - /// isUNPCKLMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to UNPCKL. - bool isUNPCKLMask(SDNode *N, bool V2IsSplat = false); - - /// isUNPCKHMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to UNPCKH. - bool isUNPCKHMask(SDNode *N, bool V2IsSplat = false); - - /// isUNPCKL_v_undef_Mask - Special case of isUNPCKLMask for canonical form - /// of vector_shuffle v, v, <0, 4, 1, 5>, i.e. vector_shuffle v, undef, - /// <0, 0, 1, 1> - bool isUNPCKL_v_undef_Mask(SDNode *N); - - /// isUNPCKH_v_undef_Mask - Special case of isUNPCKHMask for canonical form - /// of vector_shuffle v, v, <2, 6, 3, 7>, i.e. vector_shuffle v, undef, - /// <2, 2, 3, 3> - bool isUNPCKH_v_undef_Mask(SDNode *N); - - /// isMOVLMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to MOVSS, - /// MOVSD, and MOVD, i.e. setting the lowest element. - bool isMOVLMask(SDNode *N); - - /// isMOVSHDUPMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to MOVSHDUP. - bool isMOVSHDUPMask(SDNode *N); - - /// isMOVSLDUPMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a shuffle of elements that is suitable for input to MOVSLDUP. - bool isMOVSLDUPMask(SDNode *N); - - /// isSplatMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a splat of a single element. - bool isSplatMask(SDNode *N); - - /// isSplatLoMask - Return true if the specified VECTOR_SHUFFLE operand - /// specifies a splat of zero element. - bool isSplatLoMask(SDNode *N); - - /// getShuffleSHUFImmediate - Return the appropriate immediate to shuffle - /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUF* and SHUFP* - /// instructions. - unsigned getShuffleSHUFImmediate(SDNode *N); - - /// getShufflePSHUFHWImmediate - Return the appropriate immediate to shuffle - /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFHW - /// instructions. - unsigned getShufflePSHUFHWImmediate(SDNode *N); - - /// getShufflePSHUFKWImmediate - Return the appropriate immediate to shuffle - /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFLW - /// instructions. - unsigned getShufflePSHUFLWImmediate(SDNode *N); - } + /// Define some predicates that are used for node matching. + namespace X86 { + /// isPSHUFDMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to PSHUFD. + bool isPSHUFDMask(SDNode *N); + + /// isPSHUFHWMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to PSHUFD. + bool isPSHUFHWMask(SDNode *N); + + /// isPSHUFLWMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to PSHUFD. + bool isPSHUFLWMask(SDNode *N); + + /// isSHUFPMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to SHUFP*. + bool isSHUFPMask(SDNode *N); + + /// isMOVHLPSMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to MOVHLPS. + bool isMOVHLPSMask(SDNode *N); + + /// isMOVHLPS_v_undef_Mask - Special case of isMOVHLPSMask for canonical form + /// of vector_shuffle v, v, <2, 3, 2, 3>, i.e. vector_shuffle v, undef, + /// <2, 3, 2, 3> + bool isMOVHLPS_v_undef_Mask(SDNode *N); + + /// isMOVLPMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to MOVLP{S|D}. + bool isMOVLPMask(SDNode *N); + + /// isMOVHPMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to MOVHP{S|D} + /// as well as MOVLHPS. + bool isMOVHPMask(SDNode *N); + + /// isUNPCKLMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to UNPCKL. + bool isUNPCKLMask(SDNode *N, bool V2IsSplat = false); + + /// isUNPCKHMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to UNPCKH. + bool isUNPCKHMask(SDNode *N, bool V2IsSplat = false); + + /// isUNPCKL_v_undef_Mask - Special case of isUNPCKLMask for canonical form + /// of vector_shuffle v, v, <0, 4, 1, 5>, i.e. vector_shuffle v, undef, + /// <0, 0, 1, 1> + bool isUNPCKL_v_undef_Mask(SDNode *N); + + /// isUNPCKH_v_undef_Mask - Special case of isUNPCKHMask for canonical form + /// of vector_shuffle v, v, <2, 6, 3, 7>, i.e. vector_shuffle v, undef, + /// <2, 2, 3, 3> + bool isUNPCKH_v_undef_Mask(SDNode *N); + + /// isMOVLMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to MOVSS, + /// MOVSD, and MOVD, i.e. setting the lowest element. + bool isMOVLMask(SDNode *N); + + /// isMOVSHDUPMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to MOVSHDUP. + bool isMOVSHDUPMask(SDNode *N); + + /// isMOVSLDUPMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a shuffle of elements that is suitable for input to MOVSLDUP. + bool isMOVSLDUPMask(SDNode *N); + + /// isSplatMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a splat of a single element. + bool isSplatMask(SDNode *N); + + /// isSplatLoMask - Return true if the specified VECTOR_SHUFFLE operand + /// specifies a splat of zero element. + bool isSplatLoMask(SDNode *N); + + /// getShuffleSHUFImmediate - Return the appropriate immediate to shuffle + /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUF* and SHUFP* + /// instructions. + unsigned getShuffleSHUFImmediate(SDNode *N); + + /// getShufflePSHUFHWImmediate - Return the appropriate immediate to shuffle + /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFHW + /// instructions. + unsigned getShufflePSHUFHWImmediate(SDNode *N); + + /// getShufflePSHUFKWImmediate - Return the appropriate immediate to shuffle + /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUFLW + /// instructions. + unsigned getShufflePSHUFLWImmediate(SDNode *N); + } + + namespace X86 { + /// X86_64SRet - These represent different ways to implement x86_64 struct + /// returns call results. + enum X86_64SRet { + InMemory, // Really is sret, returns in memory. + InGPR64, // Returns in a pair of 64-bit integer registers. + InSSE, // Returns in a pair of SSE registers. + InX87 // Returns in a pair of f80 X87 registers. + }; + } //===--------------------------------------------------------------------===// // X86TargetLowering - X86 Implementation of the TargetLowering interface @@ -441,10 +456,21 @@ /// When SSE2 is available, use it for f64 operations. bool X86ScalarSSEf32; bool X86ScalarSSEf64; - + + X86::X86_64SRet ClassifyX86_64SRetCallReturn(const Function *Fn); + + void X86_64AnalyzeSRetCallOperands(SDNode*, CCAssignFn*, CCState&); + SDNode *LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode*TheCall, unsigned CallingConv, SelectionDAG &DAG); - + + SDNode *LowerCallResultToTwo64BitRegs(SDOperand Chain, SDOperand InFlag, + SDNode *TheCall, unsigned Reg1, + unsigned Reg2, MVT::ValueType VT, + SelectionDAG &DAG); + + SDNode *LowerCallResultToTwoX87Regs(SDOperand Chain, SDOperand InFlag, + SDNode *TheCall, SelectionDAG &DAG); SDOperand LowerMemArgument(SDOperand Op, SelectionDAG &DAG, const CCValAssign &VA, MachineFrameInfo *MFI, Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=46527&r1=46526&r2=46527&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original) +++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Tue Jan 29 13:34:22 2008 @@ -90,7 +90,7 @@ let isCall = 1 in // All calls clobber the non-callee saved registers... let Defs = [RAX, RCX, RDX, RSI, RDI, R8, R9, R10, R11, - FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, + FP0, FP1, FP2, FP3, FP4, FP5, FP6, ST0, ST1, MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, EFLAGS] in { Modified: llvm/trunk/lib/Target/X86/X86InstrFPStack.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrFPStack.td?rev=46527&r1=46526&r2=46527&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86InstrFPStack.td (original) +++ llvm/trunk/lib/Target/X86/X86InstrFPStack.td Tue Jan 29 13:34:22 2008 @@ -18,6 +18,7 @@ //===----------------------------------------------------------------------===// def SDTX86FpGet : SDTypeProfile<1, 0, [SDTCisFP<0>]>; +def SDTX86FpGet2 : SDTypeProfile<2, 0, [SDTCisFP<0>, SDTCisSameAs<0, 1>]>; def SDTX86FpSet : SDTypeProfile<0, 1, [SDTCisFP<0>]>; def SDTX86Fld : SDTypeProfile<1, 2, [SDTCisFP<0>, SDTCisPtrTy<1>, @@ -33,6 +34,8 @@ def X86fpget : SDNode<"X86ISD::FP_GET_RESULT", SDTX86FpGet, [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>; +def X86fpget2 : SDNode<"X86ISD::FP_GET_RESULT2", SDTX86FpGet2, + [SDNPHasChain, SDNPInFlag, SDNPOutFlag]>; def X86fpset : SDNode<"X86ISD::FP_SET_RESULT", SDTX86FpSet, [SDNPHasChain, SDNPOutFlag]>; def X86fld : SDNode<"X86ISD::FLD", SDTX86Fld, @@ -145,6 +148,10 @@ def FpGETRESULT80 : FpI_<(outs RFP80:$dst), (ins), SpecialFP, [(set RFP80:$dst, X86fpget)]>; // FPR = ST(0) +def FpGETRESULT80x2 : FpI_<(outs RFP80:$dst1, RFP80:$dst2), (ins), SpecialFP, + []>; // FPR = ST(0), FPR = ST(1) + + let Defs = [ST0] in { def FpSETRESULT32 : FpI_<(outs), (ins RFP32:$src), SpecialFP, [(X86fpset RFP32:$src)]>;// ST(0) = FPR From djg at cray.com Tue Jan 29 18:15:11 2008 From: djg at cray.com (Dan Gohman) Date: Wed, 30 Jan 2008 00:15:11 -0000 Subject: [llvm-commits] [llvm] r46538 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/PowerPC/ Message-ID: <200801300015.m0U0FBLh004970@zion.cs.uiuc.edu> Author: djg Date: Tue Jan 29 18:15:11 2008 New Revision: 46538 URL: http://llvm.org/viewvc/llvm-project?rev=46538&view=rev Log: Factor the addressing mode and the load/store VT out of LoadSDNode and StoreSDNode into their common base class LSBaseSDNode. Member functions getLoadedVT and getStoredVT are replaced with the common getMemoryVT to simplify code that will handle both loads and stores. Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/TargetSelectionDAG.td Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original) +++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Tue Jan 29 18:15:11 2008 @@ -1477,6 +1477,12 @@ /// class LSBaseSDNode : public SDNode { private: + // AddrMode - unindexed, pre-indexed, post-indexed. + ISD::MemIndexedMode AddrMode; + + // MemoryVT - VT of in-memory value. + MVT::ValueType MemoryVT; + //! SrcValue - Memory location for alias analysis. const Value *SrcValue; @@ -1497,11 +1503,20 @@ */ SDOperand Ops[4]; public: - LSBaseSDNode(ISD::NodeType NodeTy, SDVTList VTs, const Value *SV, int SVO, - unsigned Align, bool Vol) + LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned NumOperands, + SDVTList VTs, ISD::MemIndexedMode AM, MVT::ValueType VT, + const Value *SV, int SVO, unsigned Align, bool Vol) : SDNode(NodeTy, VTs), + AddrMode(AM), MemoryVT(VT), SrcValue(SV), SVOffset(SVO), Alignment(Align), IsVolatile(Vol) - { } + { + for (unsigned i = 0; i != NumOperands; ++i) + Ops[i] = Operands[i]; + InitOperands(Ops, NumOperands); + assert(Align != 0 && "Loads and stores should have non-zero aligment"); + assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) && + "Only indexed loads and stores have a non-undef offset operand"); + } const SDOperand getChain() const { return getOperand(0); @@ -1520,10 +1535,22 @@ const Value *getSrcValue() const { return SrcValue; } int getSrcValueOffset() const { return SVOffset; } unsigned getAlignment() const { return Alignment; } + MVT::ValueType getMemoryVT() const { return MemoryVT; } bool isVolatile() const { return IsVolatile; } + ISD::MemIndexedMode getAddressingMode() const { return AddrMode; } + + /// isIndexed - Return true if this is a pre/post inc/dec load/store. + bool isIndexed() const { return AddrMode != ISD::UNINDEXED; } + + /// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store. + bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; } + static bool classof(const LSBaseSDNode *N) { return true; } - static bool classof(const SDNode *N) { return true; } + static bool classof(const SDNode *N) { + return N->getOpcode() == ISD::LOAD || + N->getOpcode() == ISD::STORE; + } }; /// LoadSDNode - This class is used to represent ISD::LOAD nodes. @@ -1531,41 +1558,20 @@ class LoadSDNode : public LSBaseSDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - // AddrMode - unindexed, pre-indexed, post-indexed. - ISD::MemIndexedMode AddrMode; - // ExtType - non-ext, anyext, sext, zext. ISD::LoadExtType ExtType; - // LoadedVT - VT of loaded value before extension. - MVT::ValueType LoadedVT; protected: friend class SelectionDAG; LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT::ValueType LVT, const Value *SV, int O=0, unsigned Align=0, bool Vol=false) - : LSBaseSDNode(ISD::LOAD, VTs, SV, O, Align, Vol), - AddrMode(AM), ExtType(ETy), LoadedVT(LVT) { - Ops[0] = ChainPtrOff[0]; // Chain - Ops[1] = ChainPtrOff[1]; // Ptr - Ops[2] = ChainPtrOff[2]; // Off - InitOperands(Ops, 3); - assert(Align != 0 && "Loads should have non-zero aligment"); - assert((getOffset().getOpcode() == ISD::UNDEF || - AddrMode != ISD::UNINDEXED) && - "Only indexed load has a non-undef offset operand"); - } + : LSBaseSDNode(ISD::LOAD, ChainPtrOff, 3, + VTs, AM, LVT, SV, O, Align, Vol), + ExtType(ETy) { } public: - ISD::MemIndexedMode getAddressingMode() const { return AddrMode; } ISD::LoadExtType getExtensionType() const { return ExtType; } - MVT::ValueType getLoadedVT() const { return LoadedVT; } - - /// isIndexed - Return true if this is a pre/post inc/dec load. - bool isIndexed() const { return AddrMode != ISD::UNINDEXED; } - - /// isUnindexed - Return true if this is NOT a pre/post inc/dec load. - bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; } static bool classof(const LoadSDNode *) { return true; } static bool classof(const SDNode *N) { @@ -1578,41 +1584,19 @@ class StoreSDNode : public LSBaseSDNode { virtual void ANCHOR(); // Out-of-line virtual method to give class a home. - // AddrMode - unindexed, pre-indexed, post-indexed. - ISD::MemIndexedMode AddrMode; - // IsTruncStore - True if the op does a truncation before store. bool IsTruncStore; - - // StoredVT - VT of the value after truncation. - MVT::ValueType StoredVT; protected: friend class SelectionDAG; StoreSDNode(SDOperand *ChainValuePtrOff, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, MVT::ValueType SVT, const Value *SV, int O=0, unsigned Align=0, bool Vol=false) - : LSBaseSDNode(ISD::STORE, VTs, SV, O, Align, Vol), - AddrMode(AM), IsTruncStore(isTrunc), StoredVT(SVT) { - Ops[0] = ChainValuePtrOff[0]; // Chain - Ops[1] = ChainValuePtrOff[1]; // Value - Ops[2] = ChainValuePtrOff[2]; // Ptr - Ops[3] = ChainValuePtrOff[3]; // Off - InitOperands(Ops, 4); - assert(Align != 0 && "Stores should have non-zero aligment"); - assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) && - "Only indexed store has a non-undef offset operand"); - } + : LSBaseSDNode(ISD::STORE, ChainValuePtrOff, 4, + VTs, AM, SVT, SV, O, Align, Vol), + IsTruncStore(isTrunc) { } public: bool isTruncatingStore() const { return IsTruncStore; } - MVT::ValueType getStoredVT() const { return StoredVT; } - ISD::MemIndexedMode getAddressingMode() const { return AddrMode; } - - /// isIndexed - Return true if this is a pre/post inc/dec store. - bool isIndexed() const { return AddrMode != ISD::UNINDEXED; } - - /// isUnindexed - Return true if this is NOT a pre/post inc/dec store. - bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; } static bool classof(const StoreSDNode *) { return true; } static bool classof(const SDNode *N) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Jan 29 18:15:11 2008 @@ -1655,7 +1655,7 @@ // fold (zext_inreg (extload x)) -> (zextload x) if (ISD::isEXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val)) { LoadSDNode *LN0 = cast(N0); - MVT::ValueType EVT = LN0->getLoadedVT(); + MVT::ValueType EVT = LN0->getMemoryVT(); // If we zero all the possible extended bits, then we can turn this into // a zextload if we are running before legalize or the operation is legal. if (DAG.MaskedValueIsZero(N1, ~0ULL << MVT::getSizeInBits(EVT)) && @@ -1674,7 +1674,7 @@ if (ISD::isSEXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val) && N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); - MVT::ValueType EVT = LN0->getLoadedVT(); + MVT::ValueType EVT = LN0->getMemoryVT(); // If we zero all the possible extended bits, then we can turn this into // a zextload if we are running before legalize or the operation is legal. if (DAG.MaskedValueIsZero(N1, ~0ULL << MVT::getSizeInBits(EVT)) && @@ -1706,7 +1706,7 @@ else EVT = MVT::Other; - LoadedVT = LN0->getLoadedVT(); + LoadedVT = LN0->getMemoryVT(); if (EVT != MVT::Other && LoadedVT > EVT && (!AfterLegalize || TLI.isLoadXLegal(ISD::ZEXTLOAD, EVT))) { MVT::ValueType PtrType = N0.getOperand(1).getValueType(); @@ -2744,7 +2744,7 @@ if ((ISD::isSEXTLoad(N0.Val) || ISD::isEXTLoad(N0.Val)) && ISD::isUNINDEXEDLoad(N0.Val) && N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); - MVT::ValueType EVT = LN0->getLoadedVT(); + MVT::ValueType EVT = LN0->getMemoryVT(); if (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT)) { SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), @@ -2861,7 +2861,7 @@ if ((ISD::isZEXTLoad(N0.Val) || ISD::isEXTLoad(N0.Val)) && ISD::isUNINDEXEDLoad(N0.Val) && N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); - MVT::ValueType EVT = LN0->getLoadedVT(); + MVT::ValueType EVT = LN0->getMemoryVT(); SDOperand ExtLoad = DAG.getExtLoad(ISD::ZEXTLOAD, VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), LN0->getSrcValueOffset(), EVT, @@ -2958,7 +2958,7 @@ !ISD::isNON_EXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val) && N0.hasOneUse()) { LoadSDNode *LN0 = cast(N0); - MVT::ValueType EVT = LN0->getLoadedVT(); + MVT::ValueType EVT = LN0->getMemoryVT(); SDOperand ExtLoad = DAG.getExtLoad(LN0->getExtensionType(), VT, LN0->getChain(), LN0->getBasePtr(), LN0->getSrcValue(), @@ -3154,7 +3154,7 @@ // fold (sext_inreg (extload x)) -> (sextload x) if (ISD::isEXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val) && - EVT == cast(N0)->getLoadedVT() && + EVT == cast(N0)->getMemoryVT() && (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT))) { LoadSDNode *LN0 = cast(N0); SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), @@ -3169,7 +3169,7 @@ // fold (sext_inreg (zextload x)) -> (sextload x) iff load has one use if (ISD::isZEXTLoad(N0.Val) && ISD::isUNINDEXEDLoad(N0.Val) && N0.hasOneUse() && - EVT == cast(N0)->getLoadedVT() && + EVT == cast(N0)->getMemoryVT() && (!AfterLegalize || TLI.isLoadXLegal(ISD::SEXTLOAD, EVT))) { LoadSDNode *LN0 = cast(N0); SDOperand ExtLoad = DAG.getExtLoad(ISD::SEXTLOAD, VT, LN0->getChain(), @@ -3907,7 +3907,7 @@ if (LoadSDNode *LD = dyn_cast(N)) { if (LD->isIndexed()) return false; - VT = LD->getLoadedVT(); + VT = LD->getMemoryVT(); if (!TLI.isIndexedLoadLegal(ISD::PRE_INC, VT) && !TLI.isIndexedLoadLegal(ISD::PRE_DEC, VT)) return false; @@ -3915,7 +3915,7 @@ } else if (StoreSDNode *ST = dyn_cast(N)) { if (ST->isIndexed()) return false; - VT = ST->getStoredVT(); + VT = ST->getMemoryVT(); if (!TLI.isIndexedStoreLegal(ISD::PRE_INC, VT) && !TLI.isIndexedStoreLegal(ISD::PRE_DEC, VT)) return false; @@ -4034,7 +4034,7 @@ if (LoadSDNode *LD = dyn_cast(N)) { if (LD->isIndexed()) return false; - VT = LD->getLoadedVT(); + VT = LD->getMemoryVT(); if (!TLI.isIndexedLoadLegal(ISD::POST_INC, VT) && !TLI.isIndexedLoadLegal(ISD::POST_DEC, VT)) return false; @@ -4042,7 +4042,7 @@ } else if (StoreSDNode *ST = dyn_cast(N)) { if (ST->isIndexed()) return false; - VT = ST->getStoredVT(); + VT = ST->getMemoryVT(); if (!TLI.isIndexedStoreLegal(ISD::POST_INC, VT) && !TLI.isIndexedStoreLegal(ISD::POST_DEC, VT)) return false; @@ -4209,7 +4209,7 @@ if (Align > LD->getAlignment()) return DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0), Chain, Ptr, LD->getSrcValue(), - LD->getSrcValueOffset(), LD->getLoadedVT(), + LD->getSrcValueOffset(), LD->getMemoryVT(), LD->isVolatile(), Align); } } @@ -4295,7 +4295,7 @@ LD->getValueType(0), BetterChain, Ptr, LD->getSrcValue(), LD->getSrcValueOffset(), - LD->getLoadedVT(), + LD->getMemoryVT(), LD->isVolatile(), LD->getAlignment()); } @@ -4329,7 +4329,7 @@ if (unsigned Align = InferAlignment(Ptr, DAG)) { if (Align > ST->getAlignment()) return DAG.getTruncStore(Chain, Value, Ptr, ST->getSrcValue(), - ST->getSrcValueOffset(), ST->getStoredVT(), + ST->getSrcValueOffset(), ST->getMemoryVT(), ST->isVolatile(), Align); } } @@ -4413,7 +4413,7 @@ if (ST->isTruncatingStore()) { ReplStore = DAG.getTruncStore(BetterChain, Value, Ptr, ST->getSrcValue(),ST->getSrcValueOffset(), - ST->getStoredVT(), + ST->getMemoryVT(), ST->isVolatile(), ST->getAlignment()); } else { ReplStore = DAG.getStore(BetterChain, Value, Ptr, @@ -4441,23 +4441,23 @@ // only the low bits are being used. For example: // "truncstore (or (shl x, 8), y), i8" -> "truncstore y, i8" SDOperand Shorter = - GetDemandedBits(Value, MVT::getIntVTBitMask(ST->getStoredVT())); + GetDemandedBits(Value, MVT::getIntVTBitMask(ST->getMemoryVT())); AddToWorkList(Value.Val); if (Shorter.Val) return DAG.getTruncStore(Chain, Shorter, Ptr, ST->getSrcValue(), - ST->getSrcValueOffset(), ST->getStoredVT(), + ST->getSrcValueOffset(), ST->getMemoryVT(), ST->isVolatile(), ST->getAlignment()); // Otherwise, see if we can simplify the operation with // SimplifyDemandedBits, which only works if the value has a single use. - if (SimplifyDemandedBits(Value, MVT::getIntVTBitMask(ST->getStoredVT()))) + if (SimplifyDemandedBits(Value, MVT::getIntVTBitMask(ST->getMemoryVT()))) return SDOperand(N, 0); } // If this is a load followed by a store to the same location, then the store // is dead/noop. if (LoadSDNode *Ld = dyn_cast(Value)) { - if (Ld->getBasePtr() == Ptr && ST->getStoredVT() == Ld->getLoadedVT() && + if (Ld->getBasePtr() == Ptr && ST->getMemoryVT() == Ld->getMemoryVT() && ST->isUnindexed() && !ST->isVolatile() && // There can't be any side effects between the load and store, such as // a call or store. @@ -4473,9 +4473,9 @@ && TLI.isTypeLegal(Value.getOperand(0).getValueType()) && Value.Val->hasOneUse() && ST->isUnindexed() && TLI.isTruncStoreLegal(Value.getOperand(0).getValueType(), - ST->getStoredVT())) { + ST->getMemoryVT())) { return DAG.getTruncStore(Chain, Value.getOperand(0), Ptr, ST->getSrcValue(), - ST->getSrcValueOffset(), ST->getStoredVT(), + ST->getSrcValueOffset(), ST->getMemoryVT(), ST->isVolatile(), ST->getAlignment()); } @@ -4939,7 +4939,7 @@ LoadSDNode *RLD = cast(RHS); // If this is an EXTLOAD, the VT's must match. - if (LLD->getLoadedVT() == RLD->getLoadedVT()) { + if (LLD->getMemoryVT() == RLD->getMemoryVT()) { // FIXME: this conflates two src values, discarding one. This is not // the right thing to do, but nothing uses srcvalues now. When they do, // turn SrcValue into a list of locations. @@ -4981,7 +4981,7 @@ TheSelect->getValueType(0), LLD->getChain(), Addr, LLD->getSrcValue(), LLD->getSrcValueOffset(), - LLD->getLoadedVT(), + LLD->getMemoryVT(), LLD->isVolatile(), LLD->getAlignment()); } @@ -5290,13 +5290,13 @@ const Value *&SrcValue, int &SrcValueOffset) { if (LoadSDNode *LD = dyn_cast(N)) { Ptr = LD->getBasePtr(); - Size = MVT::getSizeInBits(LD->getLoadedVT()) >> 3; + Size = MVT::getSizeInBits(LD->getMemoryVT()) >> 3; SrcValue = LD->getSrcValue(); SrcValueOffset = LD->getSrcValueOffset(); return true; } else if (StoreSDNode *ST = dyn_cast(N)) { Ptr = ST->getBasePtr(); - Size = MVT::getSizeInBits(ST->getStoredVT()) >> 3; + Size = MVT::getSizeInBits(ST->getMemoryVT()) >> 3; SrcValue = ST->getSrcValue(); SrcValueOffset = ST->getSrcValueOffset(); } else { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue Jan 29 18:15:11 2008 @@ -566,7 +566,7 @@ MVT::ValueType VT = Val.getValueType(); int Alignment = ST->getAlignment(); int SVOffset = ST->getSrcValueOffset(); - if (MVT::isFloatingPoint(ST->getStoredVT())) { + if (MVT::isFloatingPoint(ST->getMemoryVT())) { // Expand to a bitconvert of the value to the integer type of the // same size, then a (misaligned) int store. MVT::ValueType intVT; @@ -581,10 +581,10 @@ return DAG.getStore(Chain, Result, Ptr, ST->getSrcValue(), SVOffset, ST->isVolatile(), Alignment); } - assert(MVT::isInteger(ST->getStoredVT()) && + assert(MVT::isInteger(ST->getMemoryVT()) && "Unaligned store of unknown type."); // Get the half-size VT - MVT::ValueType NewStoredVT = ST->getStoredVT() - 1; + MVT::ValueType NewStoredVT = ST->getMemoryVT() - 1; int NumBits = MVT::getSizeInBits(NewStoredVT); int IncrementSize = NumBits / 8; @@ -616,7 +616,7 @@ SDOperand Chain = LD->getChain(); SDOperand Ptr = LD->getBasePtr(); MVT::ValueType VT = LD->getValueType(0); - MVT::ValueType LoadedVT = LD->getLoadedVT(); + MVT::ValueType LoadedVT = LD->getMemoryVT(); if (MVT::isFloatingPoint(VT) && !MVT::isVector(VT)) { // Expand to a (misaligned) integer load of the same size, // then bitconvert to floating point. @@ -1781,7 +1781,7 @@ // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(MVT::getTypeForValueType(LD->getLoadedVT())); + getABITypeAlignment(MVT::getTypeForValueType(LD->getMemoryVT())); if (LD->getAlignment() < ABIAlignment){ Result = ExpandUnalignedLoad(cast(Result.Val), DAG, TLI); @@ -1819,7 +1819,7 @@ AddLegalizedOperand(SDOperand(Node, 1), Tmp4); return Op.ResNo ? Tmp4 : Tmp3; } else { - MVT::ValueType SrcVT = LD->getLoadedVT(); + MVT::ValueType SrcVT = LD->getMemoryVT(); unsigned SrcWidth = MVT::getSizeInBits(SrcVT); int SVOffset = LD->getSrcValueOffset(); unsigned Alignment = LD->getAlignment(); @@ -1960,7 +1960,7 @@ // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(MVT::getTypeForValueType(LD->getLoadedVT())); + getABITypeAlignment(MVT::getTypeForValueType(LD->getMemoryVT())); if (LD->getAlignment() < ABIAlignment){ Result = ExpandUnalignedLoad(cast(Result.Val), DAG, TLI); @@ -2241,7 +2241,7 @@ } } - switch (getTypeAction(ST->getStoredVT())) { + switch (getTypeAction(ST->getMemoryVT())) { case Legal: { Tmp3 = LegalizeOp(ST->getValue()); Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp3, Tmp2, @@ -2255,7 +2255,7 @@ // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(MVT::getTypeForValueType(ST->getStoredVT())); + getABITypeAlignment(MVT::getTypeForValueType(ST->getMemoryVT())); if (ST->getAlignment() < ABIAlignment) Result = ExpandUnalignedStore(cast(Result.Val), DAG, TLI); @@ -2280,7 +2280,7 @@ // Truncate the value and store the result. Tmp3 = PromoteOp(ST->getValue()); Result = DAG.getTruncStore(Tmp1, Tmp3, Tmp2, ST->getSrcValue(), - SVOffset, ST->getStoredVT(), + SVOffset, ST->getMemoryVT(), isVolatile, Alignment); break; @@ -2367,7 +2367,7 @@ SVOffset, MVT::i8, isVolatile, Alignment); } - MVT::ValueType StVT = ST->getStoredVT(); + MVT::ValueType StVT = ST->getMemoryVT(); unsigned StWidth = MVT::getSizeInBits(StVT); if (StWidth != MVT::getStoreSizeInBits(StVT)) { @@ -2442,7 +2442,7 @@ // expand it. if (!TLI.allowsUnalignedMemoryAccesses()) { unsigned ABIAlignment = TLI.getTargetData()-> - getABITypeAlignment(MVT::getTypeForValueType(ST->getStoredVT())); + getABITypeAlignment(MVT::getTypeForValueType(ST->getMemoryVT())); if (ST->getAlignment() < ABIAlignment) Result = ExpandUnalignedStore(cast(Result.Val), DAG, TLI); @@ -4294,7 +4294,7 @@ Result = DAG.getExtLoad(ExtType, NVT, LD->getChain(), LD->getBasePtr(), LD->getSrcValue(), LD->getSrcValueOffset(), - LD->getLoadedVT(), + LD->getMemoryVT(), LD->isVolatile(), LD->getAlignment()); // Remember that we legalized the chain. @@ -5767,7 +5767,7 @@ if (!TLI.isLittleEndian()) std::swap(Lo, Hi); } else { - MVT::ValueType EVT = LD->getLoadedVT(); + MVT::ValueType EVT = LD->getMemoryVT(); if ((VT == MVT::f64 && EVT == MVT::f32) || (VT == MVT::ppcf128 && (EVT==MVT::f64 || EVT==MVT::f32))) { Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp Tue Jan 29 18:15:11 2008 @@ -265,8 +265,8 @@ // Handle endianness of the load. if (!TLI.isLittleEndian()) std::swap(Lo, Hi); - } else if (MVT::getSizeInBits(N->getLoadedVT()) <= MVT::getSizeInBits(NVT)) { - MVT::ValueType EVT = N->getLoadedVT(); + } else if (MVT::getSizeInBits(N->getMemoryVT()) <= MVT::getSizeInBits(NVT)) { + MVT::ValueType EVT = N->getMemoryVT(); Lo = DAG.getExtLoad(ExtType, NVT, Ch, Ptr, N->getSrcValue(), SVOffset, EVT, isVolatile, Alignment); @@ -294,7 +294,7 @@ isVolatile, Alignment); unsigned ExcessBits = - MVT::getSizeInBits(N->getLoadedVT()) - MVT::getSizeInBits(NVT); + MVT::getSizeInBits(N->getMemoryVT()) - MVT::getSizeInBits(NVT); MVT::ValueType NEVT = MVT::getIntegerType(ExcessBits); // Increment the pointer to the other half. @@ -312,7 +312,7 @@ } else { // Big-endian - high bits are at low addresses. Favor aligned loads at // the cost of some bit-fiddling. - MVT::ValueType EVT = N->getLoadedVT(); + MVT::ValueType EVT = N->getMemoryVT(); unsigned EBytes = MVT::getStoreSizeInBits(EVT)/8; unsigned IncrementSize = MVT::getSizeInBits(NVT)/8; unsigned ExcessBits = (EBytes - IncrementSize)*8; @@ -1058,10 +1058,10 @@ Hi = DAG.getStore(Ch, Hi, Ptr, N->getSrcValue(), SVOffset+IncrementSize, isVolatile, MinAlign(Alignment, IncrementSize)); return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi); - } else if (MVT::getSizeInBits(N->getStoredVT()) <= MVT::getSizeInBits(NVT)) { + } else if (MVT::getSizeInBits(N->getMemoryVT()) <= MVT::getSizeInBits(NVT)) { GetExpandedOp(N->getValue(), Lo, Hi); return DAG.getTruncStore(Ch, Lo, Ptr, N->getSrcValue(), SVOffset, - N->getStoredVT(), isVolatile, Alignment); + N->getMemoryVT(), isVolatile, Alignment); } else if (TLI.isLittleEndian()) { // Little-endian - low bits are at low addresses. GetExpandedOp(N->getValue(), Lo, Hi); @@ -1070,7 +1070,7 @@ isVolatile, Alignment); unsigned ExcessBits = - MVT::getSizeInBits(N->getStoredVT()) - MVT::getSizeInBits(NVT); + MVT::getSizeInBits(N->getMemoryVT()) - MVT::getSizeInBits(NVT); MVT::ValueType NEVT = MVT::getIntegerType(ExcessBits); // Increment the pointer to the other half. @@ -1086,7 +1086,7 @@ // the cost of some bit-fiddling. GetExpandedOp(N->getValue(), Lo, Hi); - MVT::ValueType EVT = N->getStoredVT(); + MVT::ValueType EVT = N->getMemoryVT(); unsigned EBytes = MVT::getStoreSizeInBits(EVT)/8; unsigned IncrementSize = MVT::getSizeInBits(NVT)/8; unsigned ExcessBits = (EBytes - IncrementSize)*8; Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypesPromote.cpp Tue Jan 29 18:15:11 2008 @@ -188,7 +188,7 @@ ISD::isNON_EXTLoad(N) ? ISD::EXTLOAD : N->getExtensionType(); SDOperand Res = DAG.getExtLoad(ExtType, NVT, N->getChain(), N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(), - N->getLoadedVT(), N->isVolatile(), + N->getMemoryVT(), N->isVolatile(), N->getAlignment()); // Legalized the chain result - switch anything that used the old chain to @@ -486,6 +486,6 @@ // Truncate the value and store the result. return DAG.getTruncStore(Ch, Val, Ptr, N->getSrcValue(), - SVOffset, N->getStoredVT(), + SVOffset, N->getMemoryVT(), isVolatile, Alignment); } Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Jan 29 18:15:11 2008 @@ -371,7 +371,7 @@ LoadSDNode *LD = cast(N); ID.AddInteger(LD->getAddressingMode()); ID.AddInteger(LD->getExtensionType()); - ID.AddInteger((unsigned int)(LD->getLoadedVT())); + ID.AddInteger((unsigned int)(LD->getMemoryVT())); ID.AddInteger(LD->getAlignment()); ID.AddInteger(LD->isVolatile()); break; @@ -380,7 +380,7 @@ StoreSDNode *ST = cast(N); ID.AddInteger(ST->getAddressingMode()); ID.AddInteger(ST->isTruncatingStore()); - ID.AddInteger((unsigned int)(ST->getStoredVT())); + ID.AddInteger((unsigned int)(ST->getMemoryVT())); ID.AddInteger(ST->getAlignment()); ID.AddInteger(ST->isVolatile()); break; @@ -634,13 +634,13 @@ if (const LoadSDNode *LD = dyn_cast(N)) { ID.AddInteger(LD->getAddressingMode()); ID.AddInteger(LD->getExtensionType()); - ID.AddInteger((unsigned int)(LD->getLoadedVT())); + ID.AddInteger((unsigned int)(LD->getMemoryVT())); ID.AddInteger(LD->getAlignment()); ID.AddInteger(LD->isVolatile()); } else if (const StoreSDNode *ST = dyn_cast(N)) { ID.AddInteger(ST->getAddressingMode()); ID.AddInteger(ST->isTruncatingStore()); - ID.AddInteger((unsigned int)(ST->getStoredVT())); + ID.AddInteger((unsigned int)(ST->getMemoryVT())); ID.AddInteger(ST->getAlignment()); ID.AddInteger(ST->isVolatile()); } @@ -1264,7 +1264,7 @@ case ISD::LOAD: { if (ISD::isZEXTLoad(Op.Val)) { LoadSDNode *LD = cast(Op); - MVT::ValueType VT = LD->getLoadedVT(); + MVT::ValueType VT = LD->getMemoryVT(); KnownZero |= ~MVT::getIntVTBitMask(VT) & Mask; } return; @@ -1561,10 +1561,10 @@ switch (ExtType) { default: break; case ISD::SEXTLOAD: // '17' bits known - Tmp = MVT::getSizeInBits(LD->getLoadedVT()); + Tmp = MVT::getSizeInBits(LD->getMemoryVT()); return VTBits-Tmp+1; case ISD::ZEXTLOAD: // '16' bits known - Tmp = MVT::getSizeInBits(LD->getLoadedVT()); + Tmp = MVT::getSizeInBits(LD->getMemoryVT()); return VTBits-Tmp; } } @@ -2391,14 +2391,14 @@ AddNodeIDNode(ID, ISD::LOAD, VTs, Ops, 3); ID.AddInteger(AM); ID.AddInteger(LD->getExtensionType()); - ID.AddInteger((unsigned int)(LD->getLoadedVT())); + ID.AddInteger((unsigned int)(LD->getMemoryVT())); ID.AddInteger(LD->getAlignment()); ID.AddInteger(LD->isVolatile()); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); SDNode *N = new LoadSDNode(Ops, VTs, AM, - LD->getExtensionType(), LD->getLoadedVT(), + LD->getExtensionType(), LD->getMemoryVT(), LD->getSrcValue(), LD->getSrcValueOffset(), LD->getAlignment(), LD->isVolatile()); CSEMap.InsertNode(N, IP); @@ -2501,14 +2501,14 @@ AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4); ID.AddInteger(AM); ID.AddInteger(ST->isTruncatingStore()); - ID.AddInteger((unsigned int)(ST->getStoredVT())); + ID.AddInteger((unsigned int)(ST->getMemoryVT())); ID.AddInteger(ST->getAlignment()); ID.AddInteger(ST->isVolatile()); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); SDNode *N = new StoreSDNode(Ops, VTs, AM, - ST->isTruncatingStore(), ST->getStoredVT(), + ST->isTruncatingStore(), ST->getMemoryVT(), ST->getSrcValue(), ST->getSrcValueOffset(), ST->getAlignment(), ST->isVolatile()); CSEMap.InsertNode(N, IP); @@ -3966,7 +3966,7 @@ break; } if (doExt) - cerr << MVT::getValueTypeString(LD->getLoadedVT()) << ">"; + cerr << MVT::getValueTypeString(LD->getMemoryVT()) << ">"; const char *AM = getIndexedModeName(LD->getAddressingMode()); if (*AM) @@ -3986,7 +3986,7 @@ if (ST->isTruncatingStore()) cerr << " getStoredVT()) << ">"; + << MVT::getValueTypeString(ST->getMemoryVT()) << ">"; const char *AM = getIndexedModeName(ST->getAddressingMode()); if (*AM) Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp Tue Jan 29 18:15:11 2008 @@ -164,7 +164,7 @@ break; } if (doExt) - Op += MVT::getValueTypeString(LD->getLoadedVT()) + ">"; + Op += MVT::getValueTypeString(LD->getMemoryVT()) + ">"; if (LD->isVolatile()) Op += ""; Op += LD->getIndexedModeName(LD->getAddressingMode()); @@ -172,7 +172,7 @@ Op += " A=" + utostr(LD->getAlignment()); } else if (const StoreSDNode *ST = dyn_cast(Node)) { if (ST->isTruncatingStore()) - Op += "getStoredVT()) + ">"; + Op += "getMemoryVT()) + ">"; if (ST->isVolatile()) Op += ""; Op += ST->getIndexedModeName(ST->getAddressingMode()); Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Jan 29 18:15:11 2008 @@ -842,7 +842,7 @@ case ISD::LOAD: { if (ISD::isZEXTLoad(Op.Val)) { LoadSDNode *LD = cast(Op); - MVT::ValueType VT = LD->getLoadedVT(); + MVT::ValueType VT = LD->getMemoryVT(); KnownZero |= ~MVT::getIntVTBitMask(VT) & DemandedMask; } break; Modified: llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelDAGToDAG.cpp Tue Jan 29 18:15:11 2008 @@ -659,7 +659,7 @@ case ISD::LOAD: { LoadSDNode *LD = cast(Op); ISD::MemIndexedMode AM = LD->getAddressingMode(); - MVT::ValueType LoadedVT = LD->getLoadedVT(); + MVT::ValueType LoadedVT = LD->getMemoryVT(); if (AM != ISD::UNINDEXED) { SDOperand Offset, AMOpc; bool isPre = (AM == ISD::PRE_INC) || (AM == ISD::PRE_DEC); Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Jan 29 18:15:11 2008 @@ -1729,11 +1729,11 @@ bool isSEXTLoad = false; if (LoadSDNode *LD = dyn_cast(N)) { Ptr = LD->getBasePtr(); - VT = LD->getLoadedVT(); + VT = LD->getMemoryVT(); isSEXTLoad = LD->getExtensionType() == ISD::SEXTLOAD; } else if (StoreSDNode *ST = dyn_cast(N)) { Ptr = ST->getBasePtr(); - VT = ST->getStoredVT(); + VT = ST->getMemoryVT(); } else return false; @@ -1762,10 +1762,10 @@ SDOperand Ptr; bool isSEXTLoad = false; if (LoadSDNode *LD = dyn_cast(N)) { - VT = LD->getLoadedVT(); + VT = LD->getMemoryVT(); isSEXTLoad = LD->getExtensionType() == ISD::SEXTLOAD; } else if (StoreSDNode *ST = dyn_cast(N)) { - VT = ST->getStoredVT(); + VT = ST->getMemoryVT(); } else return false; Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Jan 29 18:15:11 2008 @@ -542,7 +542,7 @@ LowerLOAD(SDOperand Op, SelectionDAG &DAG, const SPUSubtarget *ST) { LoadSDNode *LN = cast(Op); SDOperand the_chain = LN->getChain(); - MVT::ValueType VT = LN->getLoadedVT(); + MVT::ValueType VT = LN->getMemoryVT(); MVT::ValueType OpVT = Op.Val->getValueType(0); ISD::LoadExtType ExtType = LN->getExtensionType(); unsigned alignment = LN->getAlignment(); @@ -652,7 +652,7 @@ StoreSDNode *SN = cast(Op); SDOperand Value = SN->getValue(); MVT::ValueType VT = Value.getValueType(); - MVT::ValueType StVT = (!SN->isTruncatingStore() ? VT : SN->getStoredVT()); + MVT::ValueType StVT = (!SN->isTruncatingStore() ? VT : SN->getMemoryVT()); MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); unsigned alignment = SN->getAlignment(); Modified: llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/IA64/IA64ISelDAGToDAG.cpp Tue Jan 29 18:15:11 2008 @@ -466,7 +466,7 @@ AddToISelQueue(Chain); AddToISelQueue(Address); - MVT::ValueType TypeBeingLoaded = LD->getLoadedVT(); + MVT::ValueType TypeBeingLoaded = LD->getMemoryVT(); unsigned Opc; switch (TypeBeingLoaded) { default: @@ -528,7 +528,7 @@ case MVT::f64: Opc = IA64::STF8; break; } } else { // Truncating store - switch(ST->getStoredVT()) { + switch(ST->getMemoryVT()) { default: assert(0 && "unknown type in truncstore"); case MVT::i8: Opc = IA64::ST1; break; case MVT::i16: Opc = IA64::ST2; break; Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Jan 29 18:15:11 2008 @@ -921,7 +921,7 @@ case ISD::LOAD: { // Handle preincrement loads. LoadSDNode *LD = cast(Op); - MVT::ValueType LoadedVT = LD->getLoadedVT(); + MVT::ValueType LoadedVT = LD->getMemoryVT(); // Normal loads are handled by code generated from the .td file. if (LD->getAddressingMode() != ISD::PRE_INC) Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Tue Jan 29 18:15:11 2008 @@ -963,12 +963,12 @@ MVT::ValueType VT; if (LoadSDNode *LD = dyn_cast(N)) { Ptr = LD->getBasePtr(); - VT = LD->getLoadedVT(); + VT = LD->getMemoryVT(); } else if (StoreSDNode *ST = dyn_cast(N)) { ST = ST; Ptr = ST->getBasePtr(); - VT = ST->getStoredVT(); + VT = ST->getMemoryVT(); } else return false; @@ -992,7 +992,7 @@ if (LoadSDNode *LD = dyn_cast(N)) { // PPC64 doesn't have lwau, but it does have lwaux. Reject preinc load of // sext i32 to i64 when addr mode is r+i. - if (LD->getValueType(0) == MVT::i64 && LD->getLoadedVT() == MVT::i32 && + if (LD->getValueType(0) == MVT::i64 && LD->getMemoryVT() == MVT::i32 && LD->getExtensionType() == ISD::SEXTLOAD && isa(Offset)) return false; Modified: llvm/trunk/lib/Target/TargetSelectionDAG.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetSelectionDAG.td?rev=46538&r1=46537&r2=46538&view=diff ============================================================================== --- llvm/trunk/lib/Target/TargetSelectionDAG.td (original) +++ llvm/trunk/lib/Target/TargetSelectionDAG.td Tue Jan 29 18:15:11 2008 @@ -444,42 +444,42 @@ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::EXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i1; + LD->getMemoryVT() == MVT::i1; return false; }]>; def extloadi8 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::EXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i8; + LD->getMemoryVT() == MVT::i8; return false; }]>; def extloadi16 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::EXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i16; + LD->getMemoryVT() == MVT::i16; return false; }]>; def extloadi32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::EXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i32; + LD->getMemoryVT() == MVT::i32; return false; }]>; def extloadf32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::EXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::f32; + LD->getMemoryVT() == MVT::f32; return false; }]>; def extloadf64 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::EXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::f64; + LD->getMemoryVT() == MVT::f64; return false; }]>; @@ -487,28 +487,28 @@ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::SEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i1; + LD->getMemoryVT() == MVT::i1; return false; }]>; def sextloadi8 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::SEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i8; + LD->getMemoryVT() == MVT::i8; return false; }]>; def sextloadi16 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::SEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i16; + LD->getMemoryVT() == MVT::i16; return false; }]>; def sextloadi32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::SEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i32; + LD->getMemoryVT() == MVT::i32; return false; }]>; @@ -516,28 +516,28 @@ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::ZEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i1; + LD->getMemoryVT() == MVT::i1; return false; }]>; def zextloadi8 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::ZEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i8; + LD->getMemoryVT() == MVT::i8; return false; }]>; def zextloadi16 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::ZEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i16; + LD->getMemoryVT() == MVT::i16; return false; }]>; def zextloadi32 : PatFrag<(ops node:$ptr), (ld node:$ptr), [{ if (LoadSDNode *LD = dyn_cast(N)) return LD->getExtensionType() == ISD::ZEXTLOAD && LD->getAddressingMode() == ISD::UNINDEXED && - LD->getLoadedVT() == MVT::i32; + LD->getMemoryVT() == MVT::i32; return false; }]>; @@ -554,35 +554,35 @@ def truncstorei8 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ if (StoreSDNode *ST = dyn_cast(N)) - return ST->isTruncatingStore() && ST->getStoredVT() == MVT::i8 && + return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i8 && ST->getAddressingMode() == ISD::UNINDEXED; return false; }]>; def truncstorei16 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ if (StoreSDNode *ST = dyn_cast(N)) - return ST->isTruncatingStore() && ST->getStoredVT() == MVT::i16 && + return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i16 && ST->getAddressingMode() == ISD::UNINDEXED; return false; }]>; def truncstorei32 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ if (StoreSDNode *ST = dyn_cast(N)) - return ST->isTruncatingStore() && ST->getStoredVT() == MVT::i32 && + return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i32 && ST->getAddressingMode() == ISD::UNINDEXED; return false; }]>; def truncstoref32 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ if (StoreSDNode *ST = dyn_cast(N)) - return ST->isTruncatingStore() && ST->getStoredVT() == MVT::f32 && + return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f32 && ST->getAddressingMode() == ISD::UNINDEXED; return false; }]>; def truncstoref64 : PatFrag<(ops node:$val, node:$ptr), (st node:$val, node:$ptr), [{ if (StoreSDNode *ST = dyn_cast(N)) - return ST->isTruncatingStore() && ST->getStoredVT() == MVT::f64 && + return ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f64 && ST->getAddressingMode() == ISD::UNINDEXED; return false; }]>; @@ -603,7 +603,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i1; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i1; } return false; }]>; @@ -612,7 +612,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i8; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i8; } return false; }]>; @@ -621,7 +621,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i16; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i16; } return false; }]>; @@ -630,7 +630,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i32; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i32; } return false; }]>; @@ -639,7 +639,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::PRE_INC || AM == ISD::PRE_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::f32; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f32; } return false; }]>; @@ -659,7 +659,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::POST_INC || AM == ISD::POST_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i1; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i1; } return false; }]>; @@ -668,7 +668,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::POST_INC || AM == ISD::POST_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i8; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i8; } return false; }]>; @@ -677,7 +677,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::POST_INC || AM == ISD::POST_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i16; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i16; } return false; }]>; @@ -686,7 +686,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::POST_INC || AM == ISD::POST_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::i32; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::i32; } return false; }]>; @@ -695,7 +695,7 @@ if (StoreSDNode *ST = dyn_cast(N)) { ISD::MemIndexedMode AM = ST->getAddressingMode(); return (AM == ISD::POST_INC || AM == ISD::POST_DEC) && - ST->isTruncatingStore() && ST->getStoredVT() == MVT::f32; + ST->isTruncatingStore() && ST->getMemoryVT() == MVT::f32; } return false; }]>; From sabre at nondot.org Tue Jan 29 18:39:15 2008 From: sabre at nondot.org (Chris Lattner) Date: Wed, 30 Jan 2008 00:39:15 -0000 Subject: [llvm-commits] [llvm] r46539 - in /llvm/trunk: lib/Transforms/Scalar/ScalarReplAggregates.cpp test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll Message-ID: <200801300039.m0U0dFEU005701@zion.cs.uiuc.edu> Author: lattner Date: Tue Jan 29 18:39:15 2008 New Revision: 46539 URL: http://llvm.org/viewvc/llvm-project?rev=46539&view=rev Log: Fix a bug where scalarrepl would discard offset if type would match. In practice this can only happen on code with already undefined behavior, but this is still a good thing to handle correctly. Added: llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Modified: llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp?rev=46539&r1=46538&r2=46539&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/ScalarReplAggregates.cpp Tue Jan 29 18:39:15 2008 @@ -1078,7 +1078,7 @@ if (LoadInst *LI = dyn_cast(User)) { // 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 (NV->getType() == LI->getType() && Offset == 0) { // We win, no conversion needed. } else if (const VectorType *PTy = dyn_cast(NV->getType())) { // If the result alloca is a vector type, this is either an element @@ -1232,7 +1232,7 @@ SI->eraseFromParent(); } else if (BitCastInst *CI = dyn_cast(User)) { - ConvertUsesToScalar(CI, NewAI, Offset); + ConvertUsesToScalar(CI, NewAI, Offset); CI->eraseFromParent(); } else if (GetElementPtrInst *GEP = dyn_cast(User)) { const PointerType *AggPtrTy = Added: llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll?rev=46539&view=auto ============================================================================== --- llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll (added) +++ llvm/trunk/test/Transforms/ScalarRepl/2008-01-29-PromoteBug.ll Tue Jan 29 18:39:15 2008 @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | opt -scalarrepl -instcombine | llvm-dis | grep {ret i8 17} +; rdar://5707076 +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin9.1.0" + %struct.T = type <{ i8, [3 x i8] }> + +define i8 @f() { +entry: + %s = alloca [1 x %struct.T], align 4 ; <[1 x %struct.T]*> [#uses=2] + %T3 = bitcast [1 x %struct.T]* %s to i32* + store i32 -61184, i32* %T3 + + %tmp16 = getelementptr [1 x %struct.T]* %s, i32 0, i32 0 ; <%struct.T*> [#uses=1] + %tmp17 = getelementptr %struct.T* %tmp16, i32 0, i32 1 ; <[3 x i8]*> [#uses=1] + %tmp1718 = bitcast [3 x i8]* %tmp17 to i32* ; [#uses=1] + %tmp19 = load i32* %tmp1718, align 4 ; [#uses=1] + %mask = and i32 %tmp19, 16777215 ; [#uses=2] + %mask2324 = trunc i32 %mask to i8 ; [#uses=1] + ret i8 %mask2324 +} + From resistor at mac.com Tue Jan 29 19:24:05 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 30 Jan 2008 01:24:05 -0000 Subject: [llvm-commits] [llvm] r46541 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Message-ID: <200801300124.m0U1O5Eu007244@zion.cs.uiuc.edu> Author: resistor Date: Tue Jan 29 19:24:05 2008 New Revision: 46541 URL: http://llvm.org/viewvc/llvm-project?rev=46541&view=rev Log: Fix an issue where, under very specific circumstances, memdep could end up dereferencing the end of one of its internal maps. Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46541&r1=46540&r2=46541&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jan 29 19:24:05 2008 @@ -451,8 +451,6 @@ // Figure out the new dep for things that currently depend on rem Instruction* newDep = NonLocal; - reverseDep[depGraphLocal[rem].first].erase(rem); - for (DenseMap::iterator DI = depGraphNonLocal[rem].begin(), DE = depGraphNonLocal[rem].end(); DI != DE; ++DI) @@ -462,6 +460,8 @@ depMapType::iterator depGraphEntry = depGraphLocal.find(rem); if (depGraphEntry != depGraphLocal.end()) { + reverseDep[depGraphLocal[rem].first].erase(rem); + if (depGraphEntry->second.first != NonLocal && depGraphEntry->second.second) { // If we have dep info for rem, set them to it From resistor at mac.com Tue Jan 29 19:24:47 2008 From: resistor at mac.com (Owen Anderson) Date: Wed, 30 Jan 2008 01:24:47 -0000 Subject: [llvm-commits] [llvm] r46542 - in /llvm/trunk: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/memcpy.ll Message-ID: <200801300124.m0U1Olfr007280@zion.cs.uiuc.edu> Author: resistor Date: Tue Jan 29 19:24:47 2008 New Revision: 46542 URL: http://llvm.org/viewvc/llvm-project?rev=46542&view=rev Log: Make DSE much more aggressive by performing DCE earlier. Update a testcase to reflect this increased aggressiveness. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46542&r1=46541&r2=46542&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Jan 29 19:24:47 2008 @@ -152,7 +152,7 @@ possiblyDead.insert(D); if (Instruction* D = dyn_cast(last->getOperand(1))) possiblyDead.insert(D); - + last->eraseFromParent(); NumFastStores++; deletedStore = true; @@ -303,7 +303,7 @@ MD.removeInstruction(M); // DCE instructions only used to calculate that memcpy - if (Instruction* D = dyn_cast(M->getSource())) + if (Instruction* D = dyn_cast(M->getRawSource())) possiblyDead.insert(D); if (Instruction* D = dyn_cast(M->getLength())) possiblyDead.insert(D); @@ -325,11 +325,45 @@ // If we encounter a use of the pointer, it is no longer considered dead if (LoadInst* L = dyn_cast(BBI)) { + // However, if this load is unused, we can go ahead and remove it, and + // not have to worry about it making our pointer undead! + if (L->getNumUses() == 0) { + MD.removeInstruction(L); + + // DCE instructions only used to calculate that load + if (Instruction* D = dyn_cast(L->getPointerOperand())) + possiblyDead.insert(D); + + BBI++; + L->eraseFromParent(); + NumFastOther++; + MadeChange = true; + possiblyDead.remove(L); + + continue; + } + killPointer = L->getPointerOperand(); } else if (VAArgInst* V = dyn_cast(BBI)) { killPointer = V->getOperand(0); } else if (AllocaInst* A = dyn_cast(BBI)) { deadPointers.erase(A); + + // Dead alloca's can be DCE'd when we reach them + if (A->getNumUses() == 0) { + MD.removeInstruction(A); + + // DCE instructions only used to calculate that load + if (Instruction* D = dyn_cast(A->getArraySize())) + possiblyDead.insert(D); + + BBI++; + A->eraseFromParent(); + NumFastOther++; + MadeChange = true; + possiblyDead.remove(A); + } + continue; } else if (CallSite::get(BBI).getInstruction() != 0) { // If this call does not access memory, it can't @@ -383,6 +417,25 @@ deadPointers.erase(*I); continue; + } else { + // For any non-memory-affecting non-terminators, DCE them as we reach them + Instruction *CI = BBI; + if (!CI->isTerminator() && CI->getNumUses() == 0) { + + // DCE instructions only used to calculate that load + for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end(); + OI != OE; ++OI) + if (Instruction* D = dyn_cast(OI)) + possiblyDead.insert(D); + + BBI++; + CI->eraseFromParent(); + NumFastOther++; + MadeChange = true; + possiblyDead.remove(CI); + + continue; + } } if (!killPointer) Modified: llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll?rev=46542&r1=46541&r2=46542&view=diff ============================================================================== --- llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll (original) +++ llvm/trunk/test/Transforms/DeadStoreElimination/memcpy.ll Tue Jan 29 19:24:47 2008 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep tmp180 +; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep alloca ; ModuleID = 'placeholder.adb' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i686-pc-linux-gnu" From dalej at apple.com Tue Jan 29 19:52:50 2008 From: dalej at apple.com (Dale Johannesen) Date: Tue, 29 Jan 2008 17:52:50 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r46164 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp In-Reply-To: <3EB2CFA9-DD79-4A55-8CE9-DA6B4A731541@apple.com> References: <200801181835.m0IIZJMU009764@zion.cs.uiuc.edu> <200801230703.12134.baldrick@free.fr> <1AAE637E-DBCA-4331-BB6C-B8D1D76CC322@apple.com> <200801230823.54902.baldrick@free.fr> <3EB2CFA9-DD79-4A55-8CE9-DA6B4A731541@apple.com> Message-ID: <68E9E037-6FBA-41F5-B068-C970443B159E@apple.com> On Jan 23, 2008, at 7:05 PM, Evan Cheng wrote: > > On Jan 22, 2008, at 11:23 PM, Duncan Sands wrote: >> >> Can you please clarify the roles of llvm-gcc and the code generators >> in getting ABI compatibility. When generating IR for x86-64, llvm- >> gcc >> sometimes chops by-value structs into pieces, and sometimes passes >> the >> struct as a byval parameter. Since it chops up all-integer structs, >> and this corresponds more or less to what the ABI says, I assumed >> this >> was an attempt to get ABI correctness. Especially as the code >> generators >> don't seem to bother themselves with following the details of the >> ABI (yet), >> and just push byval parameters onto the stack. Since you say > > If ABI specifies the aggregate should be passed in memory, then llvm- > gcc passes it byval. Otherwise, it chops up in pieces following the > ABI specification (only x86-64 uses a mixture of integer and non- > integer registers). Just noticed this...Darwin ppc64 also uses a mix of registers. The same struct can use int, float, vector registers and memory in extreme cases. >>>> This is an optimization, not a correctness issue >> >> I guess this means that the plan is to teach the codegenerators how >> to >> pass any aggregate byval in an ABI conformant way (not the case >> right now), >> but still do some chopping up in the front-end to help the >> optimizers. >> Of course this chopping up needs to be done carefully so the final >> result >> squirted out by the codegenerators (once they are ABI conformant) >> is the >> same as if the chopping had not been done... Is this chopping >> really a >> big win? Is it not possible to get an equivalent level of >> optimization >> by enhancing alias analysis? > > We are only doing thise for small integer aggregates that are not > passed through registers. This guarantees ABI compliance. Chopping it > up into small integer pieces ensure the code generator does not make > a copy of the object (among other potential benefits). One day when > the code generator is smarter about it then perhaps we can eliminate > this optimization. > > Evan > >> >> Ciao, >> >> Duncan. > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits From scottm at aero.org Tue Jan 29 20:55:46 2008 From: scottm at aero.org (Scott Michel) Date: Wed, 30 Jan 2008 02:55:46 -0000 Subject: [llvm-commits] [llvm] r46544 - in /llvm/trunk/lib: AsmParser/ Target/CellSPU/ Message-ID: <200801300255.m0U2tl5o010527@zion.cs.uiuc.edu> Author: pingbak Date: Tue Jan 29 20:55:46 2008 New Revision: 46544 URL: http://llvm.org/viewvc/llvm-project?rev=46544&view=rev Log: More cleanups for CellSPU: - Expand tabs... (poss 80-col violations, will get them later...) - Consolidate logic for SelectDFormAddr and SelectDForm2Addr into a single function, simplifying maintenance. Also reduced custom instruction generation for SPUvecinsert/INSERT_MASK. Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs llvm/trunk/lib/Target/CellSPU/Makefile llvm/trunk/lib/Target/CellSPU/README.txt llvm/trunk/lib/Target/CellSPU/SPU.h llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td llvm/trunk/lib/Target/CellSPU/SPUNodes.td llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h llvm/trunk/lib/Target/CellSPU/SPUSubtarget.h llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Jan 29 20:55:46 2008 @@ -1,165 +1,382 @@ +/* A Bison parser, made by GNU Bison 2.3. */ -/* A Bison parser, made from /Users/clamb/Documents/llvm/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 ESAPINTVAL 259 -#define EUAPINTVAL 260 -#define LOCALVAL_ID 261 -#define GLOBALVAL_ID 262 -#define FPVAL 263 -#define VOID 264 -#define INTTYPE 265 -#define FLOAT 266 -#define DOUBLE 267 -#define X86_FP80 268 -#define FP128 269 -#define PPC_FP128 270 -#define LABEL 271 -#define TYPE 272 -#define LOCALVAR 273 -#define GLOBALVAR 274 -#define LABELSTR 275 -#define STRINGCONSTANT 276 -#define ATSTRINGCONSTANT 277 -#define PCTSTRINGCONSTANT 278 -#define ZEROINITIALIZER 279 -#define TRUETOK 280 -#define FALSETOK 281 -#define BEGINTOK 282 -#define ENDTOK 283 -#define DECLARE 284 -#define DEFINE 285 -#define GLOBAL 286 -#define CONSTANT 287 -#define SECTION 288 -#define ALIAS 289 -#define VOLATILE 290 -#define THREAD_LOCAL 291 -#define TO 292 -#define DOTDOTDOT 293 -#define NULL_TOK 294 -#define UNDEF 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 EXTERNAL 304 -#define TARGET 305 -#define TRIPLE 306 -#define ALIGN 307 -#define ADDRSPACE 308 -#define DEPLIBS 309 -#define CALL 310 -#define TAIL 311 -#define ASM_TOK 312 -#define MODULE 313 -#define SIDEEFFECT 314 -#define CC_TOK 315 -#define CCC_TOK 316 -#define FASTCC_TOK 317 -#define COLDCC_TOK 318 -#define X86_STDCALLCC_TOK 319 -#define X86_FASTCALLCC_TOK 320 -#define DATALAYOUT 321 -#define RET 322 -#define BR 323 -#define SWITCH 324 -#define INVOKE 325 -#define UNWIND 326 -#define UNREACHABLE 327 -#define ADD 328 -#define SUB 329 -#define MUL 330 -#define UDIV 331 -#define SDIV 332 -#define FDIV 333 -#define UREM 334 -#define SREM 335 -#define FREM 336 -#define AND 337 -#define OR 338 -#define XOR 339 -#define SHL 340 -#define LSHR 341 -#define ASHR 342 -#define ICMP 343 -#define FCMP 344 -#define EQ 345 -#define NE 346 -#define SLT 347 -#define SGT 348 -#define SLE 349 -#define SGE 350 -#define ULT 351 -#define UGT 352 -#define ULE 353 -#define UGE 354 -#define OEQ 355 -#define ONE 356 -#define OLT 357 -#define OGT 358 -#define OLE 359 -#define OGE 360 -#define ORD 361 -#define UNO 362 -#define UEQ 363 -#define UNE 364 -#define MALLOC 365 -#define ALLOCA 366 -#define FREE 367 -#define LOAD 368 -#define STORE 369 -#define GETELEMENTPTR 370 -#define TRUNC 371 -#define ZEXT 372 -#define SEXT 373 -#define FPTRUNC 374 -#define FPEXT 375 -#define BITCAST 376 -#define UITOFP 377 -#define SITOFP 378 -#define FPTOUI 379 -#define FPTOSI 380 -#define INTTOPTR 381 -#define PTRTOINT 382 -#define PHI_TOK 383 -#define SELECT 384 -#define VAARG 385 -#define EXTRACTELEMENT 386 -#define INSERTELEMENT 387 -#define SHUFFLEVECTOR 388 -#define SIGNEXT 389 -#define ZEROEXT 390 -#define NORETURN 391 -#define INREG 392 -#define SRET 393 -#define NOUNWIND 394 -#define NOALIAS 395 -#define BYVAL 396 -#define NEST 397 -#define READNONE 398 -#define READONLY 399 -#define GC 400 -#define DEFAULT 401 -#define HIDDEN 402 -#define PROTECTED 403 -#line 14 "/Users/clamb/Documents/llvm/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, + ESAPINTVAL = 260, + EUAPINTVAL = 261, + LOCALVAL_ID = 262, + GLOBALVAL_ID = 263, + FPVAL = 264, + VOID = 265, + INTTYPE = 266, + FLOAT = 267, + DOUBLE = 268, + X86_FP80 = 269, + FP128 = 270, + PPC_FP128 = 271, + LABEL = 272, + TYPE = 273, + LOCALVAR = 274, + GLOBALVAR = 275, + LABELSTR = 276, + STRINGCONSTANT = 277, + ATSTRINGCONSTANT = 278, + PCTSTRINGCONSTANT = 279, + ZEROINITIALIZER = 280, + TRUETOK = 281, + FALSETOK = 282, + BEGINTOK = 283, + ENDTOK = 284, + DECLARE = 285, + DEFINE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + ALIAS = 290, + VOLATILE = 291, + THREAD_LOCAL = 292, + TO = 293, + DOTDOTDOT = 294, + NULL_TOK = 295, + UNDEF = 296, + INTERNAL = 297, + LINKONCE = 298, + WEAK = 299, + APPENDING = 300, + DLLIMPORT = 301, + DLLEXPORT = 302, + EXTERN_WEAK = 303, + OPAQUE = 304, + EXTERNAL = 305, + TARGET = 306, + TRIPLE = 307, + ALIGN = 308, + ADDRSPACE = 309, + DEPLIBS = 310, + CALL = 311, + TAIL = 312, + ASM_TOK = 313, + MODULE = 314, + SIDEEFFECT = 315, + CC_TOK = 316, + CCC_TOK = 317, + FASTCC_TOK = 318, + COLDCC_TOK = 319, + X86_STDCALLCC_TOK = 320, + X86_FASTCALLCC_TOK = 321, + DATALAYOUT = 322, + RET = 323, + BR = 324, + SWITCH = 325, + INVOKE = 326, + UNWIND = 327, + UNREACHABLE = 328, + ADD = 329, + SUB = 330, + MUL = 331, + UDIV = 332, + SDIV = 333, + FDIV = 334, + UREM = 335, + SREM = 336, + FREM = 337, + AND = 338, + OR = 339, + XOR = 340, + SHL = 341, + LSHR = 342, + ASHR = 343, + ICMP = 344, + FCMP = 345, + EQ = 346, + NE = 347, + SLT = 348, + SGT = 349, + SLE = 350, + SGE = 351, + ULT = 352, + UGT = 353, + ULE = 354, + UGE = 355, + OEQ = 356, + ONE = 357, + OLT = 358, + OGT = 359, + OLE = 360, + OGE = 361, + ORD = 362, + UNO = 363, + UEQ = 364, + UNE = 365, + MALLOC = 366, + ALLOCA = 367, + FREE = 368, + LOAD = 369, + STORE = 370, + GETELEMENTPTR = 371, + TRUNC = 372, + ZEXT = 373, + SEXT = 374, + FPTRUNC = 375, + FPEXT = 376, + BITCAST = 377, + UITOFP = 378, + SITOFP = 379, + FPTOUI = 380, + FPTOSI = 381, + INTTOPTR = 382, + PTRTOINT = 383, + PHI_TOK = 384, + SELECT = 385, + VAARG = 386, + EXTRACTELEMENT = 387, + INSERTELEMENT = 388, + SHUFFLEVECTOR = 389, + SIGNEXT = 390, + ZEROEXT = 391, + NORETURN = 392, + INREG = 393, + SRET = 394, + NOUNWIND = 395, + NOALIAS = 396, + BYVAL = 397, + NEST = 398, + READNONE = 399, + READONLY = 400, + GC = 401, + DEFAULT = 402, + HIDDEN = 403, + PROTECTED = 404 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define ESAPINTVAL 260 +#define EUAPINTVAL 261 +#define LOCALVAL_ID 262 +#define GLOBALVAL_ID 263 +#define FPVAL 264 +#define VOID 265 +#define INTTYPE 266 +#define FLOAT 267 +#define DOUBLE 268 +#define X86_FP80 269 +#define FP128 270 +#define PPC_FP128 271 +#define LABEL 272 +#define TYPE 273 +#define LOCALVAR 274 +#define GLOBALVAR 275 +#define LABELSTR 276 +#define STRINGCONSTANT 277 +#define ATSTRINGCONSTANT 278 +#define PCTSTRINGCONSTANT 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define DEFINE 286 +#define GLOBAL 287 +#define CONSTANT 288 +#define SECTION 289 +#define ALIAS 290 +#define VOLATILE 291 +#define THREAD_LOCAL 292 +#define TO 293 +#define DOTDOTDOT 294 +#define NULL_TOK 295 +#define UNDEF 296 +#define INTERNAL 297 +#define LINKONCE 298 +#define WEAK 299 +#define APPENDING 300 +#define DLLIMPORT 301 +#define DLLEXPORT 302 +#define EXTERN_WEAK 303 +#define OPAQUE 304 +#define EXTERNAL 305 +#define TARGET 306 +#define TRIPLE 307 +#define ALIGN 308 +#define ADDRSPACE 309 +#define DEPLIBS 310 +#define CALL 311 +#define TAIL 312 +#define ASM_TOK 313 +#define MODULE 314 +#define SIDEEFFECT 315 +#define CC_TOK 316 +#define CCC_TOK 317 +#define FASTCC_TOK 318 +#define COLDCC_TOK 319 +#define X86_STDCALLCC_TOK 320 +#define X86_FASTCALLCC_TOK 321 +#define DATALAYOUT 322 +#define RET 323 +#define BR 324 +#define SWITCH 325 +#define INVOKE 326 +#define UNWIND 327 +#define UNREACHABLE 328 +#define ADD 329 +#define SUB 330 +#define MUL 331 +#define UDIV 332 +#define SDIV 333 +#define FDIV 334 +#define UREM 335 +#define SREM 336 +#define FREM 337 +#define AND 338 +#define OR 339 +#define XOR 340 +#define SHL 341 +#define LSHR 342 +#define ASHR 343 +#define ICMP 344 +#define FCMP 345 +#define EQ 346 +#define NE 347 +#define SLT 348 +#define SGT 349 +#define SLE 350 +#define SGE 351 +#define ULT 352 +#define UGT 353 +#define ULE 354 +#define UGE 355 +#define OEQ 356 +#define ONE 357 +#define OLT 358 +#define OGT 359 +#define OLE 360 +#define OGE 361 +#define ORD 362 +#define UNO 363 +#define UEQ 364 +#define UNE 365 +#define MALLOC 366 +#define ALLOCA 367 +#define FREE 368 +#define LOAD 369 +#define STORE 370 +#define GETELEMENTPTR 371 +#define TRUNC 372 +#define ZEXT 373 +#define SEXT 374 +#define FPTRUNC 375 +#define FPEXT 376 +#define BITCAST 377 +#define UITOFP 378 +#define SITOFP 379 +#define FPTOUI 380 +#define FPTOSI 381 +#define INTTOPTR 382 +#define PTRTOINT 383 +#define PHI_TOK 384 +#define SELECT 385 +#define VAARG 386 +#define EXTRACTELEMENT 387 +#define INSERTELEMENT 388 +#define SHUFFLEVECTOR 389 +#define SIGNEXT 390 +#define ZEROEXT 391 +#define NORETURN 392 +#define INREG 393 +#define SRET 394 +#define NOUNWIND 395 +#define NOALIAS 396 +#define BYVAL 397 +#define NEST 398 +#define READNONE 399 +#define READONLY 400 +#define GC 401 +#define DEFAULT 402 +#define HIDDEN 403 +#define PROTECTED 404 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1092,8 +1309,29 @@ } -#line 947 "/Users/clamb/Documents/llvm/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 947 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" +{ llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1138,1209 +1376,1894 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} YYSTYPE; -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif +} +/* Line 187 of yacc.c. */ +#line 1382 "llvmAsmParser.tab.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -#define YYFINAL 619 -#define YYFLAG -32768 -#define YYNTBASE 164 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 403 ? yytranslate[x] : 247) - -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, 150, - 151, 154, 2, 153, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 159, - 152, 160, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 156, 155, 158, 2, 2, 2, 2, 2, 163, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 157, - 2, 2, 161, 2, 162, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 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 -}; +/* 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, 127, 132, 133, 136, 137, 139, - 141, 143, 144, 147, 149, 151, 153, 155, 157, 159, - 161, 163, 164, 166, 168, 170, 171, 173, 175, 176, - 178, 180, 182, 184, 185, 187, 189, 190, 192, 194, - 196, 198, 200, 203, 205, 207, 209, 211, 213, 215, - 217, 219, 221, 222, 225, 227, 229, 231, 233, 235, - 237, 238, 241, 242, 245, 246, 249, 250, 254, 257, - 258, 260, 261, 265, 267, 270, 272, 274, 276, 278, - 280, 282, 284, 286, 288, 292, 294, 297, 303, 309, - 315, 321, 325, 328, 334, 339, 342, 344, 346, 348, - 352, 354, 358, 360, 361, 363, 367, 372, 376, 380, - 385, 390, 394, 401, 407, 410, 413, 416, 419, 422, - 425, 428, 431, 434, 437, 440, 443, 450, 456, 465, - 472, 479, 487, 495, 502, 511, 520, 524, 526, 528, - 530, 532, 533, 536, 543, 545, 546, 548, 551, 552, - 556, 557, 561, 565, 569, 573, 574, 583, 584, 594, - 595, 605, 611, 614, 618, 620, 624, 628, 632, 636, - 638, 639, 645, 649, 651, 655, 657, 658, 669, 671, - 673, 678, 680, 682, 685, 689, 690, 692, 694, 696, - 698, 700, 702, 704, 706, 708, 712, 714, 720, 722, - 724, 726, 728, 730, 732, 735, 738, 741, 745, 748, - 749, 751, 754, 757, 761, 771, 781, 790, 805, 807, - 809, 816, 822, 825, 832, 840, 845, 850, 857, 864, - 865, 866, 870, 873, 875, 881, 887, 894, 901, 906, - 913, 918, 923, 930, 937, 940, 949, 951, 953, 954, - 958, 965, 969, 976, 979, 985, 993 -}; -static const short yyrhs[] = { 74, - 0, 75, 0, 76, 0, 77, 0, 78, 0, 79, - 0, 80, 0, 81, 0, 82, 0, 86, 0, 87, - 0, 88, 0, 83, 0, 84, 0, 85, 0, 117, - 0, 118, 0, 119, 0, 120, 0, 121, 0, 122, - 0, 123, 0, 124, 0, 125, 0, 126, 0, 127, - 0, 128, 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, 103, 0, 104, - 0, 105, 0, 106, 0, 107, 0, 108, 0, 109, - 0, 110, 0, 97, 0, 98, 0, 99, 0, 100, - 0, 26, 0, 27, 0, 11, 0, 12, 0, 13, - 0, 16, 0, 15, 0, 14, 0, 19, 0, 22, - 0, 24, 0, 171, 0, 0, 54, 150, 4, 151, - 0, 0, 171, 152, 0, 0, 20, 0, 23, 0, - 177, 0, 0, 175, 152, 0, 42, 0, 44, 0, - 43, 0, 45, 0, 47, 0, 46, 0, 48, 0, - 50, 0, 0, 147, 0, 148, 0, 149, 0, 0, - 46, 0, 48, 0, 0, 42, 0, 43, 0, 44, - 0, 47, 0, 0, 44, 0, 42, 0, 0, 62, - 0, 63, 0, 64, 0, 65, 0, 66, 0, 61, - 4, 0, 136, 0, 118, 0, 135, 0, 119, 0, - 138, 0, 139, 0, 141, 0, 142, 0, 143, 0, - 0, 186, 185, 0, 137, 0, 140, 0, 136, 0, - 135, 0, 144, 0, 145, 0, 0, 188, 187, 0, - 0, 146, 22, 0, 0, 53, 4, 0, 0, 153, - 53, 4, 0, 34, 22, 0, 0, 192, 0, 0, - 153, 195, 194, 0, 192, 0, 53, 4, 0, 11, - 0, 12, 0, 13, 0, 16, 0, 15, 0, 14, - 0, 17, 0, 49, 0, 196, 0, 197, 173, 154, - 0, 231, 0, 155, 4, 0, 197, 150, 201, 151, - 188, 0, 10, 150, 201, 151, 188, 0, 156, 4, - 157, 197, 158, 0, 159, 4, 157, 197, 160, 0, - 161, 202, 162, 0, 161, 162, 0, 159, 161, 202, - 162, 160, 0, 159, 161, 162, 160, 0, 197, 186, - 0, 197, 0, 10, 0, 198, 0, 200, 153, 198, - 0, 200, 0, 200, 153, 39, 0, 39, 0, 0, - 197, 0, 202, 153, 197, 0, 197, 156, 205, 158, - 0, 197, 156, 158, 0, 197, 163, 22, 0, 197, - 159, 205, 160, 0, 197, 161, 205, 162, 0, 197, - 161, 162, 0, 197, 159, 161, 205, 162, 160, 0, - 197, 159, 161, 162, 160, 0, 197, 40, 0, 197, - 41, 0, 197, 231, 0, 197, 204, 0, 197, 25, - 0, 169, 3, 0, 169, 5, 0, 169, 4, 0, - 169, 6, 0, 11, 26, 0, 11, 27, 0, 170, - 9, 0, 166, 150, 203, 38, 197, 151, 0, 116, - 150, 203, 242, 151, 0, 130, 150, 203, 153, 203, - 153, 203, 151, 0, 164, 150, 203, 153, 203, 151, - 0, 165, 150, 203, 153, 203, 151, 0, 89, 167, - 150, 203, 153, 203, 151, 0, 90, 168, 150, 203, - 153, 203, 151, 0, 132, 150, 203, 153, 203, 151, - 0, 133, 150, 203, 153, 203, 153, 203, 151, 0, - 134, 150, 203, 153, 203, 153, 203, 151, 0, 205, - 153, 203, 0, 203, 0, 32, 0, 33, 0, 37, - 0, 0, 199, 231, 0, 122, 150, 208, 38, 197, - 151, 0, 210, 0, 0, 211, 0, 210, 211, 0, - 0, 31, 212, 227, 0, 0, 30, 213, 228, 0, - 59, 58, 217, 0, 174, 18, 197, 0, 174, 18, - 10, 0, 0, 176, 180, 207, 206, 203, 173, 214, - 194, 0, 0, 176, 178, 180, 207, 206, 203, 173, - 215, 194, 0, 0, 176, 179, 180, 207, 206, 197, - 173, 216, 194, 0, 176, 180, 35, 183, 208, 0, - 51, 218, 0, 55, 152, 219, 0, 22, 0, 52, - 152, 22, 0, 67, 152, 22, 0, 156, 220, 158, - 0, 220, 153, 22, 0, 22, 0, 0, 221, 153, - 197, 186, 172, 0, 197, 186, 172, 0, 221, 0, - 221, 153, 39, 0, 39, 0, 0, 184, 199, 175, - 150, 222, 151, 188, 193, 190, 189, 0, 28, 0, - 161, 0, 182, 180, 223, 224, 0, 29, 0, 162, - 0, 234, 226, 0, 181, 180, 223, 0, 0, 60, - 0, 3, 0, 4, 0, 9, 0, 26, 0, 27, - 0, 40, 0, 41, 0, 25, 0, 159, 205, 160, - 0, 204, 0, 58, 229, 22, 153, 22, 0, 7, - 0, 8, 0, 171, 0, 175, 0, 231, 0, 230, - 0, 197, 232, 0, 234, 235, 0, 225, 235, 0, - 236, 174, 237, 0, 236, 239, 0, 0, 21, 0, - 68, 233, 0, 68, 10, 0, 69, 17, 232, 0, - 69, 11, 232, 153, 17, 232, 153, 17, 232, 0, - 70, 169, 232, 153, 17, 232, 156, 238, 158, 0, - 70, 169, 232, 153, 17, 232, 156, 158, 0, 71, - 184, 199, 232, 150, 241, 151, 188, 38, 17, 232, - 72, 17, 232, 0, 72, 0, 73, 0, 238, 169, - 230, 153, 17, 232, 0, 169, 230, 153, 17, 232, - 0, 174, 244, 0, 197, 156, 232, 153, 232, 158, - 0, 240, 153, 156, 232, 153, 232, 158, 0, 197, - 186, 232, 186, 0, 17, 186, 232, 186, 0, 241, - 153, 197, 186, 232, 186, 0, 241, 153, 17, 186, - 232, 186, 0, 0, 0, 242, 153, 233, 0, 57, - 56, 0, 56, 0, 164, 197, 232, 153, 232, 0, - 165, 197, 232, 153, 232, 0, 89, 167, 197, 232, - 153, 232, 0, 90, 168, 197, 232, 153, 232, 0, - 166, 233, 38, 197, 0, 130, 233, 153, 233, 153, - 233, 0, 131, 233, 153, 197, 0, 132, 233, 153, - 233, 0, 133, 233, 153, 233, 153, 233, 0, 134, - 233, 153, 233, 153, 233, 0, 129, 240, 0, 243, - 184, 199, 232, 150, 241, 151, 188, 0, 246, 0, - 36, 0, 0, 111, 197, 191, 0, 111, 197, 153, - 11, 232, 191, 0, 112, 197, 191, 0, 112, 197, - 153, 11, 232, 191, 0, 113, 233, 0, 245, 114, - 197, 232, 191, 0, 245, 115, 233, 153, 197, 232, - 191, 0, 116, 197, 232, 242, 0 -}; +/* Line 216 of yacc.c. */ +#line 1395 "llvmAsmParser.tab.c" +#ifdef short +# undef short #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1108, - 1108, 1108, 1108, 1108, 1108, 1109, 1109, 1109, 1109, 1109, - 1109, 1109, 1110, 1110, 1110, 1110, 1110, 1113, 1113, 1114, - 1114, 1115, 1115, 1116, 1116, 1117, 1117, 1121, 1121, 1122, - 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1126, 1126, 1127, - 1127, 1128, 1129, 1134, 1135, 1135, 1135, 1135, 1135, 1137, - 1137, 1137, 1138, 1138, 1140, 1141, 1145, 1149, 1154, 1154, - 1156, 1157, 1162, 1168, 1169, 1170, 1171, 1172, 1176, 1177, - 1178, 1182, 1183, 1184, 1185, 1189, 1190, 1191, 1195, 1196, - 1197, 1198, 1199, 1203, 1204, 1205, 1208, 1208, 1209, 1210, - 1211, 1212, 1213, 1221, 1222, 1223, 1224, 1225, 1226, 1227, - 1228, 1229, 1232, 1233, 1238, 1239, 1240, 1241, 1242, 1243, - 1246, 1247, 1252, 1253, 1260, 1260, 1267, 1267, 1277, 1285, - 1285, 1291, 1291, 1293, 1298, 1311, 1311, 1311, 1311, 1311, - 1311, 1311, 1314, 1318, 1322, 1329, 1334, 1342, 1372, 1397, - 1402, 1412, 1422, 1426, 1436, 1443, 1452, 1459, 1464, 1469, - 1476, 1477, 1484, 1491, 1499, 1505, 1517, 1545, 1561, 1588, - 1616, 1642, 1662, 1688, 1708, 1720, 1727, 1793, 1803, 1813, - 1819, 1829, 1835, 1845, 1850, 1855, 1868, 1880, 1902, 1910, - 1916, 1927, 1932, 1937, 1943, 1949, 1958, 1962, 1970, 1970, - 1973, 1973, 1976, 1988, 2009, 2014, 2022, 2023, 2027, 2027, - 2031, 2031, 2034, 2037, 2061, 2072, 2080, 2083, 2089, 2092, - 2099, 2103, 2143, 2146, 2152, 2162, 2166, 2171, 2173, 2178, - 2183, 2192, 2202, 2213, 2217, 2226, 2235, 2240, 2374, 2374, - 2376, 2385, 2385, 2387, 2392, 2404, 2408, 2413, 2417, 2421, - 2425, 2429, 2433, 2437, 2441, 2445, 2470, 2474, 2484, 2488, - 2492, 2497, 2504, 2504, 2510, 2519, 2523, 2532, 2541, 2550, - 2554, 2561, 2565, 2569, 2574, 2584, 2603, 2612, 2696, 2700, - 2707, 2718, 2731, 2741, 2752, 2762, 2773, 2781, 2791, 2798, - 2801, 2802, 2809, 2813, 2818, 2834, 2851, 2865, 2879, 2891, - 2899, 2906, 2912, 2918, 2924, 2939, 3030, 3035, 3039, 3046, - 3053, 3061, 3068, 3076, 3084, 3098, 3115 -}; +#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","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL", -"VOID","INTTYPE","FLOAT","DOUBLE","X86_FP80","FP128","PPC_FP128","LABEL","TYPE", -"LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT","PCTSTRINGCONSTANT", -"ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK","DECLARE","DEFINE", -"GLOBAL","CONSTANT","SECTION","ALIAS","VOLATILE","THREAD_LOCAL","TO","DOTDOTDOT", -"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", -"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","ADDRSPACE","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","SIGNEXT","ZEROEXT","NORETURN","INREG","SRET", -"NOUNWIND","NOALIAS","BYVAL","NEST","READNONE","READONLY","GC","DEFAULT","HIDDEN", -"PROTECTED","'('","')'","'='","','","'*'","'\\\\'","'['","'x'","']'","'<'","'>'", -"'{'","'}'","'c'","ArithmeticOps","LogicalOps","CastOps","IPredicates","FPredicates", -"IntType","FPType","LocalName","OptLocalName","OptAddrSpace","OptLocalAssign", -"GlobalName","OptGlobalAssign","GlobalAssign","GVInternalLinkage","GVExternalLinkage", -"GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage","AliasLinkage", -"OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs","OptGC", -"OptAlign","OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", -"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI", -"ConstVal","ConstExpr","ConstVector","GlobalType","ThreadLocal","AliaseeRef", -"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","ParamList","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, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 165, - 165, 165, 165, 165, 165, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 167, 167, 167, - 167, 167, 167, 167, 167, 167, 167, 168, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, - 168, 168, 168, 169, 170, 170, 170, 170, 170, 171, - 171, 171, 172, 172, 173, 173, 174, 174, 175, 175, - 176, 176, 177, 178, 178, 178, 178, 178, 179, 179, - 179, 180, 180, 180, 180, 181, 181, 181, 182, 182, - 182, 182, 182, 183, 183, 183, 184, 184, 184, 184, - 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 186, 186, 187, 187, 187, 187, 187, 187, - 188, 188, 189, 189, 190, 190, 191, 191, 192, 193, - 193, 194, 194, 195, 195, 196, 196, 196, 196, 196, - 196, 196, 197, 197, 197, 197, 197, 197, 197, 197, - 197, 197, 197, 197, 197, 198, 199, 199, 200, 200, - 201, 201, 201, 201, 202, 202, 203, 203, 203, 203, - 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, - 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, - 204, 204, 204, 204, 204, 204, 205, 205, 206, 206, - 207, 207, 208, 208, 209, 209, 210, 210, 212, 211, - 213, 211, 211, 211, 211, 214, 211, 215, 211, 216, - 211, 211, 211, 211, 217, 218, 218, 219, 220, 220, - 220, 221, 221, 222, 222, 222, 222, 223, 224, 224, - 225, 226, 226, 227, 228, 229, 229, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, - 231, 231, 232, 232, 233, 234, 234, 235, 236, 236, - 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 238, 238, 239, 240, 240, 241, 241, 241, 241, 241, - 242, 242, 243, 243, 244, 244, 244, 244, 244, 244, - 244, 244, 244, 244, 244, 244, 244, 245, 245, 246, - 246, 246, 246, 246, 246, 246, 246 -}; +#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, 0, 4, 0, 2, 0, 1, 1, - 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, - 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, - 0, 2, 0, 2, 0, 2, 0, 3, 2, 0, - 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 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, 2, 2, 6, 5, 8, 6, - 6, 7, 7, 6, 8, 8, 3, 1, 1, 1, - 1, 0, 2, 6, 1, 0, 1, 2, 0, 3, - 0, 3, 3, 3, 3, 0, 8, 0, 9, 0, - 9, 5, 2, 3, 1, 3, 3, 3, 3, 1, - 0, 5, 3, 1, 3, 1, 0, 10, 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, 4, 4, 6, 6, 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, 5, 7, 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[] = { 72, - 60, 69, 61, 70, 62, 211, 209, 0, 0, 0, - 0, 0, 0, 82, 71, 72, 207, 86, 89, 0, - 0, 223, 0, 0, 67, 0, 73, 74, 76, 75, - 77, 79, 78, 80, 81, 83, 84, 85, 82, 82, - 202, 208, 87, 88, 82, 212, 90, 91, 92, 93, - 82, 270, 210, 270, 0, 0, 231, 224, 225, 213, - 259, 260, 215, 136, 137, 138, 141, 140, 139, 142, - 143, 0, 0, 0, 0, 261, 262, 144, 214, 146, - 202, 202, 94, 201, 0, 97, 97, 271, 267, 68, - 242, 243, 244, 266, 226, 227, 230, 0, 164, 147, - 0, 0, 0, 0, 153, 165, 0, 0, 164, 0, - 0, 0, 96, 95, 0, 199, 200, 0, 0, 98, - 99, 100, 101, 102, 0, 245, 0, 309, 269, 0, - 228, 163, 113, 159, 161, 0, 0, 0, 0, 0, - 0, 152, 0, 0, 145, 0, 0, 158, 0, 157, - 0, 222, 136, 137, 138, 141, 140, 139, 0, 0, - 66, 66, 103, 0, 239, 240, 241, 308, 294, 0, - 0, 0, 0, 97, 279, 280, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 13, 14, 15, 10, 11, - 12, 0, 0, 0, 0, 0, 0, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 268, 97, - 283, 0, 307, 229, 156, 0, 121, 66, 66, 155, - 0, 166, 0, 121, 66, 66, 0, 203, 184, 185, - 180, 182, 181, 183, 186, 179, 175, 176, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 178, 177, 216, 0, 293, 273, 66, 272, - 0, 0, 54, 0, 0, 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, 127, 127, 314, 66, 66, 305, 0, - 0, 0, 0, 0, 66, 66, 0, 0, 0, 0, - 105, 107, 106, 104, 108, 109, 110, 111, 112, 114, - 162, 160, 149, 150, 151, 154, 65, 148, 218, 220, - 0, 0, 0, 0, 0, 0, 0, 0, 168, 198, - 0, 0, 0, 172, 0, 169, 0, 0, 0, 132, - 237, 248, 249, 250, 255, 251, 252, 253, 254, 246, - 0, 257, 264, 263, 265, 0, 274, 0, 0, 66, - 66, 0, 310, 0, 312, 291, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 66, 0, 118, - 117, 115, 116, 119, 120, 122, 132, 132, 0, 0, - 0, 291, 0, 0, 0, 0, 0, 167, 153, 165, - 0, 170, 171, 0, 0, 0, 0, 217, 236, 113, - 234, 0, 247, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 317, 0, 0, 0, 301, 302, 0, - 0, 0, 0, 299, 0, 127, 0, 219, 221, 66, - 0, 0, 0, 0, 0, 0, 0, 197, 174, 0, - 0, 0, 0, 0, 0, 134, 132, 64, 0, 121, - 0, 256, 0, 0, 290, 0, 0, 127, 128, 127, - 0, 0, 0, 0, 0, 0, 295, 296, 290, 0, - 315, 66, 204, 0, 0, 188, 0, 0, 0, 0, - 173, 0, 0, 66, 129, 135, 133, 63, 233, 235, - 113, 130, 0, 0, 0, 113, 113, 0, 297, 298, - 311, 313, 292, 0, 0, 300, 303, 304, 0, 127, - 0, 0, 0, 194, 0, 0, 190, 191, 187, 64, - 131, 125, 258, 0, 0, 0, 0, 121, 0, 284, - 0, 121, 316, 192, 193, 0, 0, 0, 232, 0, - 123, 0, 277, 0, 0, 105, 107, 113, 113, 0, - 113, 113, 285, 306, 189, 195, 196, 126, 0, 238, - 275, 0, 276, 0, 287, 286, 0, 0, 0, 124, - 0, 0, 0, 113, 113, 0, 0, 0, 289, 288, - 282, 0, 0, 281, 0, 278, 0, 0, 0 -}; +#if ! defined yyoverflow || YYERROR_VERBOSE -static const short yydefgoto[] = { 260, - 261, 262, 286, 303, 159, 160, 76, 519, 110, 12, - 77, 14, 15, 39, 40, 41, 45, 51, 115, 125, - 330, 225, 406, 333, 590, 571, 383, 476, 552, 428, - 477, 78, 161, 134, 151, 135, 136, 107, 350, 372, - 351, 118, 85, 152, 617, 16, 17, 19, 18, 360, - 407, 408, 60, 22, 58, 98, 431, 432, 126, 167, - 52, 93, 53, 46, 434, 373, 80, 375, 270, 54, - 89, 90, 219, 575, 129, 309, 528, 444, 220, 221, - 222, 223 +/* 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 43 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1988 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 164 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 84 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 318 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 619 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 404 + +#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, + 150, 151, 154, 2, 153, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 159, 152, 160, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 156, 155, 158, 2, 2, 2, 2, 2, 163, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 157, 2, 2, 161, 2, 162, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 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 }; -static const short yypact[] = { 253, --32768,-32768,-32768,-32768,-32768,-32768,-32768, -4, -114, -16, - -103, 46, -78, 12,-32768, 392,-32768, 149, 177, -44, - -31,-32768, -1, 154,-32768, 1529,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -37, -37, - 203,-32768,-32768,-32768, -37,-32768,-32768,-32768,-32768,-32768, - -37, 190,-32768, 2, 195, 217, 245,-32768,-32768,-32768, --32768,-32768, 124,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 274, 278, 1, 505,-32768,-32768,-32768, 62,-32768, - 256, 256, 200,-32768, 119, 224, 224,-32768,-32768, 100, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 57, 1052,-32768, - 140, 148, 604, 124,-32768, 62, -69, 157, 1052, 155, - 119, 119,-32768,-32768, 1295,-32768,-32768, 1569, 306,-32768, --32768,-32768,-32768,-32768, 1627,-32768, -17, 1851,-32768, 289, --32768,-32768, 62,-32768, 163, 166, 1645, 1645, 158, -58, - 1645,-32768, 315, 171,-32768, 1569, 1645, 124, 170, 62, - 58,-32768, 41, 314, 318, 320, 321, 329, 226, 330, - 1107, 270,-32768, 30,-32768,-32768,-32768,-32768,-32768, 288, - 1685, 137, 336, 224,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 388, 781, 1645, 1645, 1645, 1645,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1645, - 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,-32768, 224, --32768, 70,-32768,-32768, 207, 1374,-32768, -15, -14,-32768, - 197, 62, 208,-32768, 270, -13, 1295,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 388, 781, - 212, 213, 214, 220, 221, 1414, 1725, 782, 351, 228, - 229, 231,-32768,-32768,-32768, 232,-32768, 124, 696,-32768, - 834, 834,-32768, 834, 1627,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 1645,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 1645, 15, 29,-32768, 696, 7, 205, 223, - 235, 236, 237, 238, 696, 696, 346, 1627, 1645, 1645, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 120,-32768,-32768,-32768,-32768, 120,-32768, 155, - 358, 248, 249, 1569, 1569, 1569, 1569, 1569,-32768,-32768, - 69, 1007, -61,-32768, -56,-32768, 1569, 1569, 1569, 251, - 1454,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 341, - 1569,-32768,-32768,-32768,-32768, 252,-32768, 255, 834, 696, - 696, 19,-32768, 23,-32768,-32768, 834, 246, 1645, 1645, - 1645, 1645, 1645, 260, 266, 1645, 834, 696, 271,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 251, 251, 1645, 1569, - 1569,-32768, 272, 275, 276, 277, 1569,-32768, 267, 962, - -55,-32768,-32768, 286, 291, 371, 18,-32768,-32768, 62, - 292, 280,-32768, 420, -57, 431, 433, 302, 300, 301, - 834, 453, 834, 305, 307, 834, 309, 62,-32768, 310, - 311, 834, 834, 62, 316, 312, 1645,-32768,-32768, -18, - 323, 324, 92, 1569, 1569, 1569, 1569,-32768,-32768, 299, - 1569, 1569, 1645, 446, 469,-32768, 251, 729, 1472,-32768, - 339,-32768, 834, 834, 1743, 834, 834, 312,-32768, 312, - 1645, 834, 340, 1645, 1645, 1645,-32768,-32768, 1743, 421, --32768, 696,-32768, 1569, 1569,-32768, 342, 343, 344, 345, --32768, 348, 349, 16,-32768,-32768,-32768,-32768,-32768,-32768, - 62, -6, 474, 350, 352, 64, 62, 101,-32768,-32768, --32768,-32768,-32768, 347, 834,-32768,-32768,-32768, 115, 312, - 353, 356, 1569,-32768, 1569, 1569,-32768,-32768,-32768, 729, --32768, 448,-32768, 485, -5, 555, 555,-32768, 1800,-32768, - 365,-32768,-32768,-32768,-32768, 363, 379, 380,-32768, 530, - 390, 834,-32768, 1246, -2, 359, 389,-32768,-32768, 5, - 64, 62,-32768, 120,-32768,-32768,-32768,-32768, 516,-32768, --32768, 391,-32768, 1246, 207, 207, 524, 555, 555,-32768, - 525, 394, 834,-32768,-32768, 834, 526, 473, 207, 207, --32768, 834, 531,-32768, 834,-32768, 551, 556,-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, 130, 135, 136, 139, + 140, 142, 144, 146, 147, 150, 152, 154, 156, 158, + 160, 162, 164, 166, 167, 169, 171, 173, 174, 176, + 178, 179, 181, 183, 185, 187, 188, 190, 192, 193, + 195, 197, 199, 201, 203, 206, 208, 210, 212, 214, + 216, 218, 220, 222, 224, 225, 228, 230, 232, 234, + 236, 238, 240, 241, 244, 245, 248, 249, 252, 253, + 257, 260, 261, 263, 264, 268, 270, 273, 275, 277, + 279, 281, 283, 285, 287, 289, 291, 295, 297, 300, + 306, 312, 318, 324, 328, 331, 337, 342, 345, 347, + 349, 351, 355, 357, 361, 363, 364, 366, 370, 375, + 379, 383, 388, 393, 397, 404, 410, 413, 416, 419, + 422, 425, 428, 431, 434, 437, 440, 443, 446, 453, + 459, 468, 475, 482, 490, 498, 505, 514, 523, 527, + 529, 531, 533, 535, 536, 539, 546, 548, 549, 551, + 554, 555, 559, 560, 564, 568, 572, 576, 577, 586, + 587, 597, 598, 608, 614, 617, 621, 623, 627, 631, + 635, 639, 641, 642, 648, 652, 654, 658, 660, 661, + 672, 674, 676, 681, 683, 685, 688, 692, 693, 695, + 697, 699, 701, 703, 705, 707, 709, 711, 715, 717, + 723, 725, 727, 729, 731, 733, 735, 738, 741, 744, + 748, 751, 752, 754, 757, 760, 764, 774, 784, 793, + 808, 810, 812, 819, 825, 828, 835, 843, 848, 853, + 860, 867, 868, 869, 873, 876, 878, 884, 890, 897, + 904, 909, 916, 921, 926, 933, 940, 943, 952, 954, + 956, 957, 961, 968, 972, 979, 982, 988, 996 }; -static const short yypgoto[] = { 427, - 437, 439, 319, 322, -172,-32768, 0, 11, -149, 480, - 10,-32768,-32768,-32768,-32768, 49,-32768,-32768,-32768, -147, --32768, -401,-32768, -222,-32768,-32768, -281, 51,-32768, -375, --32768,-32768, -24, 357, -117,-32768, 462, 481, -111, -157, - -243, 169, 210, 354,-32768,-32768, 560,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 498,-32768, --32768,-32768,-32768,-32768,-32768, -557, -46, -66, -193,-32768, - 532,-32768,-32768,-32768,-32768,-32768, 88, 176,-32768,-32768, --32768,-32768 +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 210, 0, -1, 74, -1, 75, -1, 76, -1, 77, + -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, + -1, 86, -1, 87, -1, 88, -1, 83, -1, 84, + -1, 85, -1, 117, -1, 118, -1, 119, -1, 120, + -1, 121, -1, 122, -1, 123, -1, 124, -1, 125, + -1, 126, -1, 127, -1, 128, -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, 103, -1, 104, -1, 105, -1, 106, -1, 107, + -1, 108, -1, 109, -1, 110, -1, 97, -1, 98, + -1, 99, -1, 100, -1, 26, -1, 27, -1, 11, + -1, 12, -1, 13, -1, 16, -1, 15, -1, 14, + -1, 19, -1, 22, -1, 24, -1, 172, -1, -1, + 54, 150, 4, 151, -1, -1, 172, 152, -1, -1, + 20, -1, 23, -1, 178, -1, -1, 176, 152, -1, + 42, -1, 44, -1, 43, -1, 45, -1, 47, -1, + 46, -1, 48, -1, 50, -1, -1, 147, -1, 148, + -1, 149, -1, -1, 46, -1, 48, -1, -1, 42, + -1, 43, -1, 44, -1, 47, -1, -1, 44, -1, + 42, -1, -1, 62, -1, 63, -1, 64, -1, 65, + -1, 66, -1, 61, 4, -1, 136, -1, 118, -1, + 135, -1, 119, -1, 138, -1, 139, -1, 141, -1, + 142, -1, 143, -1, -1, 187, 186, -1, 137, -1, + 140, -1, 136, -1, 135, -1, 144, -1, 145, -1, + -1, 189, 188, -1, -1, 146, 22, -1, -1, 53, + 4, -1, -1, 153, 53, 4, -1, 34, 22, -1, + -1, 193, -1, -1, 153, 196, 195, -1, 193, -1, + 53, 4, -1, 11, -1, 12, -1, 13, -1, 16, + -1, 15, -1, 14, -1, 17, -1, 49, -1, 197, + -1, 198, 174, 154, -1, 232, -1, 155, 4, -1, + 198, 150, 202, 151, 189, -1, 10, 150, 202, 151, + 189, -1, 156, 4, 157, 198, 158, -1, 159, 4, + 157, 198, 160, -1, 161, 203, 162, -1, 161, 162, + -1, 159, 161, 203, 162, 160, -1, 159, 161, 162, + 160, -1, 198, 187, -1, 198, -1, 10, -1, 199, + -1, 201, 153, 199, -1, 201, -1, 201, 153, 39, + -1, 39, -1, -1, 198, -1, 203, 153, 198, -1, + 198, 156, 206, 158, -1, 198, 156, 158, -1, 198, + 163, 22, -1, 198, 159, 206, 160, -1, 198, 161, + 206, 162, -1, 198, 161, 162, -1, 198, 159, 161, + 206, 162, 160, -1, 198, 159, 161, 162, 160, -1, + 198, 40, -1, 198, 41, -1, 198, 232, -1, 198, + 205, -1, 198, 25, -1, 170, 3, -1, 170, 5, + -1, 170, 4, -1, 170, 6, -1, 11, 26, -1, + 11, 27, -1, 171, 9, -1, 167, 150, 204, 38, + 198, 151, -1, 116, 150, 204, 243, 151, -1, 130, + 150, 204, 153, 204, 153, 204, 151, -1, 165, 150, + 204, 153, 204, 151, -1, 166, 150, 204, 153, 204, + 151, -1, 89, 168, 150, 204, 153, 204, 151, -1, + 90, 169, 150, 204, 153, 204, 151, -1, 132, 150, + 204, 153, 204, 151, -1, 133, 150, 204, 153, 204, + 153, 204, 151, -1, 134, 150, 204, 153, 204, 153, + 204, 151, -1, 206, 153, 204, -1, 204, -1, 32, + -1, 33, -1, 37, -1, -1, 200, 232, -1, 122, + 150, 209, 38, 198, 151, -1, 211, -1, -1, 212, + -1, 211, 212, -1, -1, 31, 213, 228, -1, -1, + 30, 214, 229, -1, 59, 58, 218, -1, 175, 18, + 198, -1, 175, 18, 10, -1, -1, 177, 181, 208, + 207, 204, 174, 215, 195, -1, -1, 177, 179, 181, + 208, 207, 204, 174, 216, 195, -1, -1, 177, 180, + 181, 208, 207, 198, 174, 217, 195, -1, 177, 181, + 35, 184, 209, -1, 51, 219, -1, 55, 152, 220, + -1, 22, -1, 52, 152, 22, -1, 67, 152, 22, + -1, 156, 221, 158, -1, 221, 153, 22, -1, 22, + -1, -1, 222, 153, 198, 187, 173, -1, 198, 187, + 173, -1, 222, -1, 222, 153, 39, -1, 39, -1, + -1, 185, 200, 176, 150, 223, 151, 189, 194, 191, + 190, -1, 28, -1, 161, -1, 183, 181, 224, 225, + -1, 29, -1, 162, -1, 235, 227, -1, 182, 181, + 224, -1, -1, 60, -1, 3, -1, 4, -1, 9, + -1, 26, -1, 27, -1, 40, -1, 41, -1, 25, + -1, 159, 206, 160, -1, 205, -1, 58, 230, 22, + 153, 22, -1, 7, -1, 8, -1, 172, -1, 176, + -1, 232, -1, 231, -1, 198, 233, -1, 235, 236, + -1, 226, 236, -1, 237, 175, 238, -1, 237, 240, + -1, -1, 21, -1, 68, 234, -1, 68, 10, -1, + 69, 17, 233, -1, 69, 11, 233, 153, 17, 233, + 153, 17, 233, -1, 70, 170, 233, 153, 17, 233, + 156, 239, 158, -1, 70, 170, 233, 153, 17, 233, + 156, 158, -1, 71, 185, 200, 233, 150, 242, 151, + 189, 38, 17, 233, 72, 17, 233, -1, 72, -1, + 73, -1, 239, 170, 231, 153, 17, 233, -1, 170, + 231, 153, 17, 233, -1, 175, 245, -1, 198, 156, + 233, 153, 233, 158, -1, 241, 153, 156, 233, 153, + 233, 158, -1, 198, 187, 233, 187, -1, 17, 187, + 233, 187, -1, 242, 153, 198, 187, 233, 187, -1, + 242, 153, 17, 187, 233, 187, -1, -1, -1, 243, + 153, 234, -1, 57, 56, -1, 56, -1, 165, 198, + 233, 153, 233, -1, 166, 198, 233, 153, 233, -1, + 89, 168, 198, 233, 153, 233, -1, 90, 169, 198, + 233, 153, 233, -1, 167, 234, 38, 198, -1, 130, + 234, 153, 234, 153, 234, -1, 131, 234, 153, 198, + -1, 132, 234, 153, 234, -1, 133, 234, 153, 234, + 153, 234, -1, 134, 234, 153, 234, 153, 234, -1, + 129, 241, -1, 244, 185, 200, 233, 150, 242, 151, + 189, -1, 247, -1, 36, -1, -1, 111, 198, 192, + -1, 111, 198, 153, 11, 233, 192, -1, 112, 198, + 192, -1, 112, 198, 153, 11, 233, 192, -1, 113, + 234, -1, 246, 114, 198, 233, 192, -1, 246, 115, + 234, 153, 198, 233, 192, -1, 116, 198, 233, 243, + -1 }; +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, + 1107, 1108, 1108, 1108, 1108, 1108, 1108, 1109, 1109, 1109, + 1109, 1109, 1109, 1110, 1110, 1110, 1110, 1110, 1110, 1113, + 1113, 1114, 1114, 1115, 1115, 1116, 1116, 1117, 1117, 1121, + 1121, 1122, 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1126, + 1126, 1127, 1127, 1128, 1129, 1134, 1135, 1135, 1135, 1135, + 1135, 1137, 1137, 1137, 1138, 1138, 1140, 1141, 1145, 1149, + 1154, 1154, 1156, 1157, 1162, 1168, 1169, 1170, 1171, 1172, + 1176, 1177, 1178, 1182, 1183, 1184, 1185, 1189, 1190, 1191, + 1195, 1196, 1197, 1198, 1199, 1203, 1204, 1205, 1208, 1209, + 1210, 1211, 1212, 1213, 1214, 1221, 1222, 1223, 1224, 1225, + 1226, 1227, 1228, 1229, 1232, 1233, 1238, 1239, 1240, 1241, + 1242, 1243, 1246, 1247, 1252, 1253, 1260, 1261, 1267, 1268, + 1277, 1285, 1286, 1291, 1292, 1293, 1298, 1311, 1311, 1311, + 1311, 1311, 1311, 1311, 1314, 1318, 1322, 1329, 1334, 1342, + 1372, 1397, 1402, 1412, 1422, 1426, 1436, 1443, 1452, 1459, + 1464, 1469, 1476, 1477, 1484, 1491, 1499, 1505, 1517, 1545, + 1561, 1588, 1616, 1642, 1662, 1688, 1708, 1720, 1727, 1793, + 1803, 1813, 1819, 1829, 1835, 1845, 1850, 1855, 1868, 1880, + 1902, 1910, 1916, 1927, 1932, 1937, 1943, 1949, 1958, 1962, + 1970, 1970, 1973, 1973, 1976, 1988, 2009, 2014, 2022, 2023, + 2027, 2027, 2031, 2031, 2034, 2037, 2061, 2073, 2072, 2084, + 2083, 2093, 2092, 2103, 2143, 2146, 2152, 2162, 2166, 2171, + 2173, 2178, 2183, 2192, 2202, 2213, 2217, 2226, 2235, 2240, + 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404, 2408, 2413, + 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2470, 2474, + 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519, 2523, 2532, + 2541, 2550, 2554, 2561, 2565, 2569, 2574, 2584, 2603, 2612, + 2703, 2707, 2714, 2725, 2738, 2748, 2759, 2769, 2780, 2788, + 2798, 2805, 2808, 2809, 2816, 2820, 2825, 2841, 2858, 2872, + 2886, 2898, 2906, 2913, 2919, 2925, 2931, 2946, 3044, 3049, + 3053, 3060, 3067, 3075, 3082, 3090, 3098, 3112, 3129 +}; +#endif -#define YYLAST 1985 +#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", "ESAPINTVAL", + "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", + "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE", + "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT", + "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK", + "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", + "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", + "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", + "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "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", "SIGNEXT", "ZEROEXT", + "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST", + "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", "'('", + "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", + "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps", + "IPredicates", "FPredicates", "IntType", "FPType", "LocalName", + "OptLocalName", "OptAddrSpace", "OptLocalAssign", "GlobalName", + "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage", + "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage", + "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr", + "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign", + "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", + "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes", + "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr", + "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "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", "ParamList", "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, 387, 388, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 40, 41, 61, 44, 42, 92, 91, 120, 93, 60, + 62, 123, 125, 99 +}; +# endif -static const short yytable[] = { 11, - 274, 79, 306, 263, 102, 273, 162, 164, 273, 13, - 165, 338, 265, 353, 355, 11, 592, 310, 311, 312, - 313, 314, 88, 385, 317, 13, 275, 474, 478, 441, - 91, 458, 459, 443, 235, 108, 602, 23, 108, 108, - 108, 24, 597, -54, -54, -54, -54, 20, 25, 2, - 106, 474, 4, 28, 29, 30, 31, 32, 33, 34, - 108, 35, 21, 26, 61, 62, 239, 240, 108, 108, - 475, 442, 318, 27, 133, 442, 1, 2, 106, 3, - 4, 5, 108, 141, 133, 339, 340, 81, 82, 11, - 150, 417, 142, 86, 141, 417, 417, 417, 422, 87, - 150, 517, 482, 231, 238, 423, 470, 55, 421, 36, - 37, 38, 228, 229, 264, 108, 232, -142, 1, 550, - 56, 3, 236, 5, 556, 557, 399, 435, 400, 401, - 402, 109, 503, 403, 109, 109, 109, 404, 405, 400, - 401, 402, 334, 166, 403, 335, 269, 271, 404, 405, - 116, 117, 573, 272, 57, 593, 109, 379, 36, 37, - 38, 103, 387, 92, 109, 109, 549, 382, -66, 304, - 305, 269, 307, 266, 501, 59, 595, 596, 109, 598, - 599, 384, -66, 319, 320, 308, 269, 269, 269, 269, - 269, 315, 316, 269, 43, 447, 44, 449, 450, 451, - 397, 133, 609, 610, 376, 377, 531, 378, 532, 130, - 88, 109, 150, -142, 131, -66, 95, -142, 47, 48, - 49, 417, 374, 50, 374, 374, 418, 374, 241, 242, - 243, 244, 412, 413, 414, 415, 416, 83, 96, 84, - 386, 113, 506, 114, 491, 424, 425, 426, 394, 395, - 150, 558, -206, 559, 400, 401, 402, 522, 563, 403, - 374, 380, 263, 404, 405, 562, 97, 559, 374, 374, - -68, 1, 2, 99, 3, 4, 5, 100, 381, 146, - 147, 101, 6, 7, 119, 120, 121, 122, 123, 124, - 111, 112, 84, 150, 398, 269, 137, 533, 461, 462, - 536, 537, 538, 8, 138, 468, 143, 9, 145, 163, - 224, 10, 438, 439, 440, 226, 227, 230, 233, 237, - 445, 234, -55, 108, 321, 322, -56, 420, -59, -58, - 455, 456, 374, 374, 374, 580, 430, -57, 245, 584, - 374, 323, 324, 267, 325, 326, 273, 327, 328, 329, - 374, 374, 507, 508, 509, 510, 336, 388, 337, 512, - 513, 344, 345, 346, 269, 448, 269, 269, 269, 347, - 348, 454, 356, 264, 488, 389, 490, 357, 358, 493, - 359, 361, 574, 396, 460, 497, 498, 390, 391, 392, - 393, -205, 541, 542, 374, 409, 374, 410, 411, 374, - 433, 446, 594, 427, 436, 374, 374, 437, 473, -68, - 1, 2, 452, 3, 4, 5, 524, 525, 453, 529, - 530, 6, 7, 457, 464, 534, 469, 465, 466, 467, - 480, 566, 502, 567, 568, 540, 374, 374, 471, 374, - 374, 481, 8, 472, 479, 374, 9, 483, 514, 484, - 10, 485, 486, 487, 521, 374, 489, 491, 511, 492, - 527, 494, 495, 496, 500, 499, 269, 515, 561, 269, - 269, 269, 516, 442, 527, 504, 505, 518, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 374, 578, - 579, 523, 535, 544, 543, 553, 545, 546, 547, 548, - 570, 572, 554, 564, 560, 591, 565, 555, -17, 374, - 374, 61, 62, 585, 104, 64, 65, 66, 67, 68, - 69, 70, 583, 1, 2, 374, 3, 4, 5, 586, - 587, 604, 605, 588, 582, 589, 608, 600, -18, 611, - 603, 606, 612, 601, 613, 614, 607, 615, 616, 518, - 618, 374, 374, 71, 216, 619, 374, 362, 363, 374, - 569, 61, 62, 364, 217, 374, 218, 342, 374, 128, - 144, 343, 551, 1, 2, 42, 3, 4, 5, 365, - 366, 367, 332, 140, 127, 94, 539, 463, 0, 0, - 341, 0, 0, 0, 368, 369, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 62, 370, 104, 64, 65, 66, 67, 68, 69, - 70, 0, 1, 2, 0, 3, 4, 5, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 249, 250, 0, 0, 0, 0, 0, - 0, 0, 71, 0, 0, 0, 0, 0, 0, 72, - 73, 0, 0, 74, 0, 75, 105, 0, 0, 0, - 251, 198, 576, 577, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 0, 252, 0, 253, 254, 255, 323, - 324, 0, 325, 326, 0, 327, 328, 329, 362, 363, - 0, 0, 61, 62, 364, 0, 0, 0, 0, 0, - 0, 0, 0, 371, 1, 2, 0, 3, 4, 5, - 365, 366, 367, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 0, 108, - 3, 0, 5, 370, 0, 0, 0, 0, 72, 73, - 0, 0, 74, 0, 75, 139, 0, 0, 0, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 249, 250, 0, 0, 61, 62, - 0, 104, 153, 154, 155, 156, 157, 158, 70, 0, - 1, 2, 0, 3, 4, 5, 287, 288, 0, 0, - 0, 251, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 0, 252, 0, 253, 254, 255, - 71, 0, 0, 0, 0, 0, 362, 363, 0, 0, - 61, 62, 364, 0, 0, 109, 321, 322, 0, 0, - 0, 0, 1, 2, 371, 3, 4, 5, 365, 366, - 367, 0, 0, 323, 324, 0, 325, 326, 0, 327, - 328, 329, 0, 368, 369, 0, 0, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 370, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 249, 250, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 354, 0, 0, 0, 0, 0, 251, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 0, 252, 0, 253, 254, 255, 61, 62, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 3, 4, 5, 246, 0, 0, 0, - 0, 0, 371, 0, 0, 0, 0, 0, 0, 0, - 0, 247, 248, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 61, 62, 108, 104, 153, 154, 155, - 156, 157, 158, 70, 0, 1, 2, 0, 3, 4, - 5, 0, 0, 0, 0, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 249, 250, 0, 0, 0, 71, 0, 0, 61, 62, - 0, 104, 64, 65, 66, 67, 68, 69, 70, 0, - 1, 2, 0, 3, 4, 5, 0, 251, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 132, 252, 0, 253, 254, 255, 0, 0, 0, 0, - 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 109, 0, 61, 62, -66, 0, 256, 0, 0, - 257, 0, 258, 0, 259, 1, 2, 0, 3, 4, - 5, 246, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 247, 248, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 108, 72, 73, 0, 0, 74, 0, 75, 419, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 249, 250, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 251, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 0, 252, 0, 253, 254, - 255, 0, 0, 0, 0, 0, 0, 0, 362, 363, - 0, 0, 0, 0, 364, 0, 109, 0, 0, 0, - 0, 0, 256, 0, 0, 257, 0, 258, 0, 259, - 365, 366, 367, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 61, 62, 370, 148, 64, 65, 66, 67, 68, - 69, 70, 0, 1, 2, 0, 3, 4, 5, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 249, 250, 0, 0, 0, 0, - 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 251, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 0, 252, 0, 253, 254, 255, - 61, 62, 0, 104, 64, 65, 66, 67, 68, 69, - 70, 0, 1, 2, 0, 3, 4, 5, 0, 0, - 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, - 0, 0, 331, 0, 0, 0, 149, 0, 0, 0, - 61, 62, 71, 104, 153, 154, 155, 156, 157, 158, - 70, 0, 1, 2, 0, 3, 4, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, - 73, 0, 0, 74, 0, 75, 0, 0, 0, 0, - 61, 62, 71, 104, 64, 65, 66, 67, 68, 69, - 70, 0, 1, 2, 0, 3, 4, 5, 61, 62, - 0, 104, 64, 65, 66, 67, 68, 69, 70, 0, - 1, 2, 429, 3, 4, 5, 0, 0, 0, 0, - 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, - 520, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 71, 0, 0, 0, 0, 0, 0, 0, 72, 73, - 0, 0, 74, 0, 75, 61, 62, 0, 63, 64, - 65, 66, 67, 68, 69, 70, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 72, 73, - 0, 349, 74, 0, 75, 61, 62, 71, 104, 153, - 154, 155, 156, 157, 158, 70, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 72, 73, - 0, 0, 74, 0, 75, 0, 0, 71, 0, 0, - 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, - 74, 0, 75, 61, 62, 0, 148, 64, 65, 66, - 67, 68, 69, 70, 0, 1, 2, 0, 3, 4, - 5, 61, 62, 0, 104, 64, 65, 66, 67, 68, - 69, 70, 0, 1, 2, 0, 3, 4, 5, 0, - 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, - 0, 0, 0, 72, 73, 0, 0, 74, 0, 75, - 0, 61, 62, 71, 268, 64, 65, 66, 67, 68, - 69, 70, 0, 1, 2, 0, 3, 4, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 72, 73, 0, 0, 74, 0, 75, - 0, 61, 62, 71, 104, 153, 154, 155, 156, 157, - 158, 70, 0, 1, 2, 0, 3, 4, 5, 61, - 62, 0, 104, 64, 65, 66, 67, 68, 69, 526, - 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, - 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, - 0, 72, 73, 0, 0, 74, 0, 75, 0, 0, - 0, 71, 0, 0, 0, 0, 0, 0, 0, 72, - 73, 0, 0, 74, 0, 75, 61, 62, 0, 104, - 64, 65, 66, 67, 68, 69, 581, 0, 1, 2, - 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, - 73, 0, 0, 74, 0, 75, 0, 0, 71, 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, 72, - 73, 0, 0, 74, 0, 352, 168, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 72, 73, 0, - 0, 74, 0, 75, 0, 0, 169, 170, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 72, 73, 0, 0, 74, 0, - 75, 194, 195, 196, 0, 0, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 164, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 166, 166, 166, 166, 166, 166, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, + 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, + 169, 169, 169, 169, 169, 170, 171, 171, 171, 171, + 171, 172, 172, 172, 173, 173, 174, 174, 175, 175, + 176, 176, 177, 177, 178, 179, 179, 179, 179, 179, + 180, 180, 180, 181, 181, 181, 181, 182, 182, 182, + 183, 183, 183, 183, 183, 184, 184, 184, 185, 185, + 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 187, 187, 188, 188, 188, 188, + 188, 188, 189, 189, 190, 190, 191, 191, 192, 192, + 193, 194, 194, 195, 195, 196, 196, 197, 197, 197, + 197, 197, 197, 197, 198, 198, 198, 198, 198, 198, + 198, 198, 198, 198, 198, 198, 198, 199, 200, 200, + 201, 201, 202, 202, 202, 202, 203, 203, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 205, 205, + 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, + 207, 207, 208, 208, 209, 209, 210, 210, 211, 211, + 213, 212, 214, 212, 212, 212, 212, 215, 212, 216, + 212, 217, 212, 212, 212, 212, 218, 219, 219, 220, + 221, 221, 221, 222, 222, 223, 223, 223, 223, 224, + 225, 225, 226, 227, 227, 228, 229, 230, 230, 231, + 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, + 232, 232, 232, 232, 233, 233, 234, 235, 235, 236, + 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, + 238, 238, 239, 239, 240, 241, 241, 242, 242, 242, + 242, 242, 243, 243, 244, 244, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, + 246, 247, 247, 247, 247, 247, 247, 247, 247 }; -static const short yycheck[] = { 0, - 173, 26, 196, 161, 4, 11, 118, 125, 11, 0, - 28, 234, 162, 257, 258, 16, 574, 211, 212, 213, - 214, 215, 21, 305, 218, 16, 174, 34, 430, 11, - 29, 407, 408, 11, 146, 54, 594, 152, 54, 54, - 54, 58, 38, 3, 4, 5, 6, 52, 152, 20, - 75, 34, 23, 42, 43, 44, 45, 46, 47, 48, - 54, 50, 67, 18, 7, 8, 26, 27, 54, 54, - 53, 53, 220, 152, 99, 53, 19, 20, 103, 22, - 23, 24, 54, 153, 109, 235, 236, 39, 40, 90, - 115, 153, 162, 45, 153, 153, 153, 153, 160, 51, - 125, 477, 160, 162, 151, 162, 162, 152, 352, 147, - 148, 149, 137, 138, 161, 54, 141, 54, 19, 521, - 152, 22, 147, 24, 526, 527, 320, 371, 135, 136, - 137, 150, 151, 140, 150, 150, 150, 144, 145, 135, - 136, 137, 158, 161, 140, 160, 171, 11, 144, 145, - 32, 33, 158, 17, 156, 158, 150, 275, 147, 148, - 149, 161, 156, 162, 150, 150, 151, 153, 154, 194, - 195, 196, 197, 164, 456, 22, 578, 579, 150, 581, - 582, 153, 154, 114, 115, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 46, 389, 48, 391, 392, 393, - 318, 226, 604, 605, 271, 272, 488, 274, 490, 153, - 21, 150, 237, 150, 158, 154, 22, 154, 42, 43, - 44, 153, 269, 47, 271, 272, 158, 274, 3, 4, - 5, 6, 344, 345, 346, 347, 348, 35, 22, 37, - 307, 42, 151, 44, 153, 357, 358, 359, 315, 316, - 275, 151, 0, 153, 135, 136, 137, 480, 540, 140, - 307, 286, 420, 144, 145, 151, 22, 153, 315, 316, - 18, 19, 20, 150, 22, 23, 24, 4, 303, 111, - 112, 4, 30, 31, 61, 62, 63, 64, 65, 66, - 81, 82, 37, 318, 319, 320, 157, 491, 410, 411, - 494, 495, 496, 51, 157, 417, 150, 55, 154, 4, - 22, 59, 379, 380, 381, 153, 151, 160, 4, 150, - 387, 151, 9, 54, 118, 119, 9, 352, 9, 9, - 397, 398, 379, 380, 381, 558, 361, 9, 9, 562, - 387, 135, 136, 56, 138, 139, 11, 141, 142, 143, - 397, 398, 464, 465, 466, 467, 160, 153, 151, 471, - 472, 150, 150, 150, 389, 390, 391, 392, 393, 150, - 150, 396, 22, 420, 441, 153, 443, 150, 150, 446, - 150, 150, 555, 38, 409, 452, 453, 153, 153, 153, - 153, 0, 504, 505, 441, 38, 443, 150, 150, 446, - 60, 156, 575, 153, 153, 452, 453, 153, 38, 18, - 19, 20, 153, 22, 23, 24, 483, 484, 153, 486, - 487, 30, 31, 153, 153, 492, 160, 153, 153, 153, - 151, 543, 457, 545, 546, 502, 483, 484, 153, 486, - 487, 22, 51, 153, 153, 492, 55, 17, 473, 17, - 59, 150, 153, 153, 479, 502, 4, 153, 160, 153, - 485, 153, 153, 153, 153, 150, 491, 22, 535, 494, - 495, 496, 4, 53, 499, 153, 153, 478, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 535, 556, - 557, 153, 153, 151, 153, 22, 153, 153, 151, 151, - 53, 17, 153, 151, 158, 572, 151, 156, 150, 556, - 557, 7, 8, 151, 10, 11, 12, 13, 14, 15, - 16, 17, 158, 19, 20, 572, 22, 23, 24, 151, - 151, 598, 599, 4, 559, 146, 603, 22, 150, 606, - 17, 17, 17, 153, 72, 612, 153, 17, 615, 550, - 0, 598, 599, 49, 128, 0, 603, 3, 4, 606, - 550, 7, 8, 9, 128, 612, 128, 249, 615, 90, - 109, 250, 522, 19, 20, 16, 22, 23, 24, 25, - 26, 27, 226, 103, 87, 54, 499, 412, -1, -1, - 237, -1, -1, -1, 40, 41, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 7, 8, 58, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, -1, -1, -1, -1, -1, - -1, -1, 49, -1, -1, -1, -1, -1, -1, 155, - 156, -1, -1, 159, -1, 161, 162, -1, -1, -1, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, -1, 130, -1, 132, 133, 134, 135, - 136, -1, 138, 139, -1, 141, 142, 143, 3, 4, - -1, -1, 7, 8, 9, -1, -1, -1, -1, -1, - -1, -1, -1, 159, 19, 20, -1, 22, 23, 24, - 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 19, -1, 54, - 22, -1, 24, 58, -1, -1, -1, -1, 155, 156, - -1, -1, 159, -1, 161, 162, -1, -1, -1, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, -1, -1, 7, 8, - -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, -1, 22, 23, 24, 26, 27, -1, -1, - -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, -1, 130, -1, 132, 133, 134, - 49, -1, -1, -1, -1, -1, 3, 4, -1, -1, - 7, 8, 9, -1, -1, 150, 118, 119, -1, -1, - -1, -1, 19, 20, 159, 22, 23, 24, 25, 26, - 27, -1, -1, 135, 136, -1, 138, 139, -1, 141, - 142, 143, -1, 40, 41, -1, -1, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 58, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 155, 156, -1, -1, - 159, -1, 161, 162, -1, -1, -1, -1, -1, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, -1, 130, -1, 132, 133, 134, 7, 8, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 19, 20, -1, 22, 23, 24, 25, -1, -1, -1, - -1, -1, 159, -1, -1, -1, -1, -1, -1, -1, - -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 7, 8, 54, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, -1, -1, -1, -1, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, -1, -1, -1, 49, -1, -1, 7, 8, - -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, -1, 22, 23, 24, -1, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 39, 130, -1, 132, 133, 134, -1, -1, -1, -1, - 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 150, -1, 7, 8, 154, -1, 156, -1, -1, - 159, -1, 161, -1, 163, 19, 20, -1, 22, 23, - 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 54, 155, 156, -1, -1, 159, -1, 161, 162, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 155, 156, -1, -1, - 159, -1, 161, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, -1, 130, -1, 132, 133, - 134, -1, -1, -1, -1, -1, -1, -1, 3, 4, - -1, -1, -1, -1, 9, -1, 150, -1, -1, -1, - -1, -1, 156, -1, -1, 159, -1, 161, -1, 163, - 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 7, 8, 58, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, -1, 22, 23, 24, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, - -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, -1, 130, -1, 132, 133, 134, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, - -1, -1, -1, -1, 159, -1, -1, -1, -1, -1, - -1, -1, 39, -1, -1, -1, 122, -1, -1, -1, - 7, 8, 49, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 155, - 156, -1, -1, 159, -1, 161, -1, -1, -1, -1, - 7, 8, 49, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, 7, 8, - -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, - 19, 20, 39, 22, 23, 24, -1, -1, -1, -1, - -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, - 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 49, -1, -1, -1, -1, -1, -1, -1, 155, 156, - -1, -1, 159, -1, 161, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 155, 156, - -1, 158, 159, -1, 161, 7, 8, 49, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 155, 156, - -1, -1, 159, -1, 161, -1, -1, 49, -1, -1, - -1, -1, -1, -1, -1, -1, 155, 156, -1, -1, - 159, -1, 161, 7, 8, -1, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, 7, 8, -1, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, - -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - -1, 7, 8, 49, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - -1, 7, 8, 49, 10, 11, 12, 13, 14, 15, - 16, 17, -1, 19, 20, -1, 22, 23, 24, 7, - 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, - -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, - -1, 155, 156, -1, -1, 159, -1, 161, -1, -1, - -1, 49, -1, -1, -1, -1, -1, -1, -1, 155, - 156, -1, -1, 159, -1, 161, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, - -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 155, - 156, -1, -1, 159, -1, 161, -1, -1, 49, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 155, - 156, -1, -1, 159, -1, 161, 36, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 155, 156, -1, - -1, 159, -1, 161, -1, -1, 56, 57, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 155, 156, -1, -1, 159, -1, - 161, 111, 112, 113, -1, -1, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134 +/* 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, 0, 4, 0, 2, 0, + 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, + 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, + 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, + 1, 1, 0, 2, 0, 2, 0, 2, 0, 3, + 2, 0, 1, 0, 3, 1, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 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, 2, 2, 6, 5, + 8, 6, 6, 7, 7, 6, 8, 8, 3, 1, + 1, 1, 1, 0, 2, 6, 1, 0, 1, 2, + 0, 3, 0, 3, 3, 3, 3, 0, 8, 0, + 9, 0, 9, 5, 2, 3, 1, 3, 3, 3, + 3, 1, 0, 5, 3, 1, 3, 1, 0, 10, + 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, 4, 4, 6, + 6, 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, 5, 7, 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[] = +{ + 73, 61, 70, 62, 71, 63, 212, 210, 0, 0, + 0, 0, 0, 0, 83, 72, 0, 73, 208, 87, + 90, 0, 0, 224, 0, 0, 68, 0, 74, 75, + 77, 76, 78, 80, 79, 81, 82, 84, 85, 86, + 83, 83, 203, 1, 209, 88, 89, 83, 213, 91, + 92, 93, 94, 83, 271, 211, 271, 0, 0, 232, + 225, 226, 214, 260, 261, 216, 137, 138, 139, 142, + 141, 140, 143, 144, 0, 0, 0, 0, 262, 263, + 145, 215, 147, 203, 203, 95, 202, 0, 98, 98, + 272, 268, 69, 243, 244, 245, 267, 227, 228, 231, + 0, 165, 148, 0, 0, 0, 0, 154, 166, 0, + 0, 165, 0, 0, 0, 97, 96, 0, 200, 201, + 0, 0, 99, 100, 101, 102, 103, 0, 246, 0, + 310, 270, 0, 229, 164, 114, 160, 162, 0, 0, + 0, 0, 0, 0, 153, 0, 0, 146, 0, 0, + 159, 0, 158, 0, 223, 137, 138, 139, 142, 141, + 140, 0, 0, 67, 67, 104, 0, 240, 241, 242, + 309, 295, 0, 0, 0, 0, 98, 280, 281, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, + 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 269, 98, 284, 0, 308, 230, 157, 0, 122, + 67, 67, 156, 0, 167, 0, 122, 67, 67, 0, + 204, 185, 186, 181, 183, 182, 184, 187, 180, 176, + 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 179, 178, 217, 0, 294, + 274, 67, 273, 0, 0, 55, 0, 0, 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, 128, 128, 315, 67, + 67, 306, 0, 0, 0, 0, 0, 67, 67, 0, + 0, 0, 0, 106, 108, 107, 105, 109, 110, 111, + 112, 113, 115, 163, 161, 150, 151, 152, 155, 66, + 149, 219, 221, 0, 0, 0, 0, 0, 0, 0, + 0, 169, 199, 0, 0, 0, 173, 0, 170, 0, + 0, 0, 133, 238, 249, 250, 251, 256, 252, 253, + 254, 255, 247, 0, 258, 265, 264, 266, 0, 275, + 0, 0, 67, 67, 0, 311, 0, 313, 292, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 67, 0, 119, 118, 116, 117, 120, 121, 123, 133, + 133, 0, 0, 0, 292, 0, 0, 0, 0, 0, + 168, 154, 166, 0, 171, 172, 0, 0, 0, 0, + 218, 237, 114, 235, 0, 248, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 318, 0, 0, 0, + 302, 303, 0, 0, 0, 0, 300, 0, 128, 0, + 220, 222, 67, 0, 0, 0, 0, 0, 0, 0, + 198, 175, 0, 0, 0, 0, 0, 0, 135, 133, + 65, 0, 122, 0, 257, 0, 0, 291, 0, 0, + 128, 129, 128, 0, 0, 0, 0, 0, 0, 296, + 297, 291, 0, 316, 67, 205, 0, 0, 189, 0, + 0, 0, 0, 174, 0, 0, 67, 130, 136, 134, + 64, 234, 236, 114, 131, 0, 0, 0, 114, 114, + 0, 298, 299, 312, 314, 293, 0, 0, 301, 304, + 305, 0, 128, 0, 0, 0, 195, 0, 0, 191, + 192, 188, 65, 132, 126, 259, 0, 0, 0, 0, + 122, 0, 285, 0, 122, 317, 193, 194, 0, 0, + 0, 233, 0, 124, 0, 278, 0, 0, 106, 108, + 114, 114, 0, 114, 114, 286, 307, 190, 196, 197, + 127, 0, 239, 276, 0, 277, 0, 288, 287, 0, + 0, 0, 125, 0, 0, 0, 114, 114, 0, 0, + 0, 290, 289, 283, 0, 0, 282, 0, 279 +}; - 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, 262, 263, 264, 288, 305, 161, 162, 78, 521, + 112, 12, 79, 14, 15, 40, 41, 42, 47, 53, + 117, 127, 332, 227, 408, 335, 592, 573, 385, 478, + 554, 430, 479, 80, 163, 136, 153, 137, 138, 109, + 352, 374, 353, 120, 87, 154, 16, 17, 18, 20, + 19, 362, 409, 410, 62, 23, 60, 100, 433, 434, + 128, 169, 54, 95, 55, 48, 436, 375, 82, 377, + 272, 56, 91, 92, 221, 577, 131, 311, 530, 446, + 222, 223, 224, 225 +}; - 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 -544 +static const yytype_int16 yypact[] = +{ + 291, -544, -544, -544, -544, -544, -544, -544, -9, -121, + -14, -80, 72, -50, 19, -544, 110, 423, -544, 113, + 13, -37, -33, -544, -16, 121, -544, 1532, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + 128, 128, 160, -544, -544, -544, -544, 128, -544, -544, + -544, -544, -544, 128, 133, -544, 3, 183, 189, 192, + -544, -544, -544, -544, -544, 32, -544, -544, -544, -544, + -544, -544, -544, -544, 215, 218, 1, 509, -544, -544, + -544, -18, -544, 190, 190, 184, -544, 260, 219, 219, + -544, -544, 199, -544, -544, -544, -544, -544, -544, -544, + -53, 1055, -544, 86, 102, 748, 32, -544, -18, -108, + 118, 1055, 109, 260, 260, -544, -544, 1298, -544, -544, + 1572, 267, -544, -544, -544, -544, -544, 1630, -544, -17, + 1854, -544, 256, -544, -544, -18, -544, 136, 135, 1648, + 1648, 137, -85, 1648, -544, 300, 157, -544, 1572, 1648, + 32, 162, -18, 74, -544, 44, 307, 311, 324, 334, + 335, 236, 336, 1110, 293, -544, 101, -544, -544, -544, + -544, -544, 292, 1688, 63, 338, 219, -544, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, 392, 1194, 1648, 1648, 1648, 1648, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, + 1648, -544, 219, -544, 49, -544, -544, 269, 1377, -544, + -42, -38, -544, 197, -18, 200, -544, 293, -13, 1298, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, 392, 1194, 202, 209, 212, 213, 214, 1417, 1728, + 788, 348, 221, 223, 224, -544, -544, -544, 226, -544, + 32, 699, -544, 837, 837, -544, 837, 1630, -544, -544, + -544, -544, -544, -544, -544, -544, -544, -544, 1648, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, 1648, -8, -2, -544, 699, + -15, 222, 227, 229, 230, 239, 245, 699, 699, 339, + 1630, 1648, 1648, -544, -544, -544, -544, -544, -544, -544, + -544, -544, -544, -544, -544, 120, -544, -544, -544, -544, + 120, -544, 109, 340, 249, 250, 1572, 1572, 1572, 1572, + 1572, -544, -544, -47, 1010, -4, -544, -75, -544, 1572, + 1572, 1572, 248, 1457, -544, -544, -544, -544, -544, -544, + -544, -544, 329, 1572, -544, -544, -544, -544, 262, -544, + 263, 837, 699, 699, 23, -544, 31, -544, -544, 837, + 246, 1648, 1648, 1648, 1648, 1648, 264, 265, 1648, 837, + 699, 266, -544, -544, -544, -544, -544, -544, -544, 248, + 248, 1648, 1572, 1572, -544, 273, 274, 275, 276, 1572, + -544, 271, 965, -67, -544, -544, 283, 284, 371, 6, + -544, -544, -18, 285, 288, -544, 398, 16, 427, 431, + 301, 297, 299, 837, 452, 837, 305, 310, 837, 312, + -18, -544, 313, 323, 837, 837, -18, 314, 326, 1648, + -544, -544, 34, 328, 343, 154, 1572, 1572, 1572, 1572, + -544, -544, 317, 1572, 1572, 1648, 438, 489, -544, 248, + 131, 1475, -544, 344, -544, 837, 837, 1746, 837, 837, + 326, -544, 326, 1648, 837, 345, 1648, 1648, 1648, -544, + -544, 1746, 448, -544, 699, -544, 1572, 1572, -544, 351, + 354, 353, 356, -544, 360, 361, 79, -544, -544, -544, + -544, -544, -544, -18, -6, 485, 362, 357, 29, -18, + 173, -544, -544, -544, -544, -544, 369, 837, -544, -544, + -544, 176, 326, 363, 379, 1572, -544, 1572, 1572, -544, + -544, -544, 131, -544, 481, -544, 521, -1, 558, 558, + -544, 1803, -544, 381, -544, -544, -544, -544, 389, 391, + 394, -544, 539, 400, 837, -544, 1249, 2, 397, 399, + -544, -544, 80, 29, -18, -544, 120, -544, -544, -544, + -544, 526, -544, -544, 401, -544, 1249, 269, 269, 538, + 558, 558, -544, 540, 403, 837, -544, -544, 837, 542, + 488, 269, 269, -544, 837, 546, -544, 837, -544 +}; - 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[] = +{ + -544, 434, 439, 440, 320, 316, -171, -544, 0, 22, + -134, 483, 9, -544, -544, -544, -544, 191, -544, -544, + -544, -149, -544, -403, -544, -230, -544, -544, -284, 52, + -544, -372, -544, -544, -26, 358, -119, -544, 468, 482, + -113, -161, -245, 225, 257, 350, -544, -544, 573, -544, + -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, + 502, -544, -544, -544, -544, -544, -544, -543, -64, 14, + -195, -544, 536, -544, -544, -544, -544, -544, 92, 180, + -544, -544, -544, -544 +}; -/* 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 -208 +static const yytype_int16 yytable[] = +{ + 11, 81, 265, 308, 276, 104, 340, 164, 166, 13, + 275, 167, 110, 275, 355, 357, 110, 11, 312, 313, + 314, 315, 316, 387, 90, 319, 13, 277, 476, 480, + 267, 24, 93, 594, 443, 237, 110, 460, 461, 110, + 476, 110, 445, 21, 25, 143, 110, -55, -55, -55, + -55, 108, 110, 604, 144, 49, 50, 51, 22, 477, + 52, 29, 30, 31, 32, 33, 34, 35, 143, 36, + 241, 242, 26, 320, 273, 135, 444, 233, 419, 108, + 274, 63, 64, -143, 444, 135, 419, 425, 110, 240, + 27, 152, 11, 1, 2, 472, 3, 4, 5, 266, + 132, 152, 28, 341, 342, 133, 419, 519, 111, 423, + 43, 420, 111, 230, 231, 57, 336, 234, 599, 58, + 552, 2, 337, 238, 4, 558, 559, 401, 437, 402, + 403, 404, 111, 110, 405, 111, -67, 111, 406, 407, + 59, 389, 111, 61, 168, 384, -67, 271, 111, 419, + 1, 386, -67, 3, 90, 5, 424, 575, 381, 45, + 595, 46, 105, 321, 322, 94, 37, 38, 39, 419, + 306, 307, 271, 309, 503, 268, 484, 597, 598, -143, + 600, 601, 101, -143, 111, 505, 310, 271, 271, 271, + 271, 271, 317, 318, 271, 85, 449, 86, 451, 452, + 453, 399, 135, 611, 612, 97, 533, 376, 534, 376, + 376, 98, 376, 152, 99, 402, 403, 404, 1, 102, + 405, 3, 103, 5, 406, 407, 115, 86, 116, 111, + 551, 83, 84, 414, 415, 416, 417, 418, 88, 243, + 244, 245, 246, 139, 89, 376, 426, 427, 428, 323, + 324, 152, 524, 376, 376, 402, 403, 404, 565, 140, + 405, 265, 382, 147, 406, 407, 325, 326, 145, 327, + 328, 165, 329, 330, 331, 37, 38, 39, 226, 383, + 121, 122, 123, 124, 125, 126, 229, 378, 379, 228, + 380, -207, 118, 119, 152, 400, 271, 232, 535, 463, + 464, 538, 539, 540, 235, 508, 470, 493, 236, -69, + 1, 2, 239, 3, 4, 5, -56, 376, 376, 376, + -57, 6, 7, 388, 560, 376, 561, 564, 422, 561, + 582, 396, 397, -60, 586, 376, 376, 432, 148, 149, + 113, 114, 8, -59, -58, 247, 9, 110, 269, 275, + 10, 339, 346, 509, 510, 511, 512, 338, 266, 347, + 514, 515, 348, 349, 350, 271, 450, 271, 271, 271, + 358, 359, 456, 360, 361, 390, 363, 398, 411, 376, + 391, 376, 392, 393, 376, 462, 576, 323, 324, 435, + 376, 376, 394, 543, 544, 440, 441, 442, 395, 412, + 413, 429, 448, 447, 325, 326, 596, 327, 328, 475, + 329, 330, 331, 457, 458, 438, 439, 454, 455, 459, + 483, 376, 376, -206, 376, 376, 466, 467, 468, 469, + 376, 471, 568, 504, 569, 570, 473, 474, 481, 482, + 376, -69, 1, 2, 485, 3, 4, 5, 486, 516, + 488, 487, 489, 6, 7, 523, 491, 490, 493, 492, + 517, 529, 495, 494, 501, 496, 497, 271, 499, 500, + 271, 271, 271, 376, 8, 529, 498, 513, 9, 502, + 520, 506, 10, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 518, 376, 376, 507, 525, 537, 526, + 527, 444, 531, 532, 545, 546, 547, 555, 536, 548, + 376, 549, 550, 557, 566, 556, 63, 64, 542, 106, + 66, 67, 68, 69, 70, 71, 72, 562, 1, 2, + 567, 3, 4, 5, 572, 584, 376, 376, 574, 585, + 587, 376, 588, 590, 376, 589, 591, -18, 602, -19, + 376, 563, 520, 376, 603, 605, 609, 608, 73, 614, + 615, 364, 365, 617, 218, 63, 64, 366, 345, 219, + 220, 344, 580, 581, 571, 130, 553, 1, 2, 146, + 3, 4, 5, 367, 368, 369, 334, 142, 593, 343, + 44, 129, 96, 541, 465, 0, 0, 0, 370, 371, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 606, 607, 372, 0, 0, 610, + 0, 0, 613, 0, 0, 0, 0, 0, 616, 0, + 0, 618, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 251, 252, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 74, 75, 0, 0, 76, 0, + 77, 107, 0, 0, 253, 200, 578, 579, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 0, 254, 0, + 255, 256, 257, 325, 326, 0, 327, 328, 0, 329, + 330, 331, 364, 365, 0, 0, 63, 64, 366, 0, + 0, 0, 0, 0, 0, 0, 0, 373, 1, 2, + 0, 3, 4, 5, 367, 368, 369, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 370, + 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 110, 0, 63, 64, 372, 106, 66, + 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, + 3, 4, 5, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 251, 252, + 0, 0, 0, 0, 0, 63, 64, 73, 106, 155, + 156, 157, 158, 159, 160, 72, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 253, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 0, 254, + 0, 255, 256, 257, 0, 0, 0, 73, 0, 0, + 364, 365, 0, 0, 63, 64, 366, 0, 0, 111, + 0, 0, 0, 0, 0, 0, 1, 2, 373, 3, + 4, 5, 367, 368, 369, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 370, 371, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 372, 0, 0, 0, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, + 141, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 251, 252, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, + 356, 0, 0, 253, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 0, 254, 0, 255, + 256, 257, 63, 64, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 2, 0, 3, 4, 5, + 248, 0, 0, 0, 0, 0, 373, 0, 0, 0, + 0, 0, 0, 0, 0, 249, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 63, 64, 110, + 106, 155, 156, 157, 158, 159, 160, 72, 0, 1, + 2, 0, 3, 4, 5, 0, 0, 0, 0, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 251, 252, 0, 0, 0, 73, + 0, 0, 63, 64, 0, 106, 66, 67, 68, 69, + 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, + 0, 253, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 134, 254, 0, 255, 256, 257, + 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 111, 0, 63, 64, -67, + 0, 258, 0, 0, 259, 0, 260, 0, 261, 1, + 2, 0, 3, 4, 5, 248, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 249, 250, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 110, 74, 75, 0, 0, 76, + 0, 77, 421, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 251, + 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 74, 75, 0, 0, 76, 0, 77, 0, 0, 0, + 289, 290, 0, 0, 0, 0, 253, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 0, + 254, 0, 255, 256, 257, 0, 0, 0, 0, 0, + 0, 0, 364, 365, 0, 0, 0, 0, 366, 0, + 111, 0, 0, 0, 0, 0, 258, 0, 0, 259, + 0, 260, 0, 261, 367, 368, 369, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 370, + 371, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 63, 64, 372, 150, 66, + 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, + 3, 4, 5, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 251, 252, + 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 253, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 0, 254, + 0, 255, 256, 257, 63, 64, 0, 106, 66, 67, + 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, + 4, 5, 0, 0, 0, 0, 0, 0, 373, 0, + 0, 0, 0, 0, 0, 0, 333, 0, 0, 0, + 151, 0, 0, 0, 63, 64, 73, 106, 155, 156, + 157, 158, 159, 160, 72, 0, 1, 2, 0, 3, + 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, + 0, 0, 0, 0, 63, 64, 73, 106, 66, 67, + 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, + 4, 5, 63, 64, 0, 106, 66, 67, 68, 69, + 70, 71, 72, 0, 1, 2, 431, 3, 4, 5, + 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, + 0, 0, 0, 0, 522, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, + 0, 0, 74, 75, 0, 0, 76, 0, 77, 63, + 64, 0, 65, 66, 67, 68, 69, 70, 71, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 74, 75, 0, 351, 76, 0, 77, 63, + 64, 73, 106, 155, 156, 157, 158, 159, 160, 72, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 74, 75, 0, 0, 76, 0, 77, 0, + 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, + 74, 75, 0, 0, 76, 0, 77, 63, 64, 0, + 150, 66, 67, 68, 69, 70, 71, 72, 0, 1, + 2, 0, 3, 4, 5, 63, 64, 0, 106, 66, + 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 73, + 0, 0, 0, 0, 0, 0, 0, 74, 75, 0, + 0, 76, 0, 77, 0, 63, 64, 73, 270, 66, + 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 74, 75, 0, + 0, 76, 0, 77, 0, 63, 64, 73, 106, 155, + 156, 157, 158, 159, 160, 72, 0, 1, 2, 0, + 3, 4, 5, 63, 64, 0, 106, 66, 67, 68, + 69, 70, 71, 528, 0, 1, 2, 0, 3, 4, + 5, 0, 0, 0, 0, 0, 0, 73, 0, 0, + 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, + 0, 77, 0, 0, 0, 73, 0, 0, 0, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, + 63, 64, 0, 106, 66, 67, 68, 69, 70, 71, + 583, 0, 1, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, + 0, 0, 73, 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, 74, 75, 0, 0, 76, 0, 354, + 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 74, 75, 0, 0, 76, 0, 77, 0, 0, + 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, + 0, 0, 76, 0, 77, 196, 197, 198, 0, 0, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217 +}; -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +static const yytype_int16 yycheck[] = +{ + 0, 27, 163, 198, 175, 4, 236, 120, 127, 0, + 11, 28, 54, 11, 259, 260, 54, 17, 213, 214, + 215, 216, 217, 307, 21, 220, 17, 176, 34, 432, + 164, 152, 29, 576, 11, 148, 54, 409, 410, 54, + 34, 54, 11, 52, 58, 153, 54, 3, 4, 5, + 6, 77, 54, 596, 162, 42, 43, 44, 67, 53, + 47, 42, 43, 44, 45, 46, 47, 48, 153, 50, + 26, 27, 152, 222, 11, 101, 53, 162, 153, 105, + 17, 7, 8, 54, 53, 111, 153, 162, 54, 153, + 18, 117, 92, 19, 20, 162, 22, 23, 24, 163, + 153, 127, 152, 237, 238, 158, 153, 479, 150, 354, + 0, 158, 150, 139, 140, 152, 158, 143, 38, 152, + 523, 20, 160, 149, 23, 528, 529, 322, 373, 135, + 136, 137, 150, 54, 140, 150, 154, 150, 144, 145, + 156, 156, 150, 22, 161, 153, 154, 173, 150, 153, + 19, 153, 154, 22, 21, 24, 160, 158, 277, 46, + 158, 48, 161, 114, 115, 162, 147, 148, 149, 153, + 196, 197, 198, 199, 458, 166, 160, 580, 581, 150, + 583, 584, 150, 154, 150, 151, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 35, 391, 37, 393, 394, + 395, 320, 228, 606, 607, 22, 490, 271, 492, 273, + 274, 22, 276, 239, 22, 135, 136, 137, 19, 4, + 140, 22, 4, 24, 144, 145, 42, 37, 44, 150, + 151, 40, 41, 346, 347, 348, 349, 350, 47, 3, + 4, 5, 6, 157, 53, 309, 359, 360, 361, 118, + 119, 277, 482, 317, 318, 135, 136, 137, 542, 157, + 140, 422, 288, 154, 144, 145, 135, 136, 150, 138, + 139, 4, 141, 142, 143, 147, 148, 149, 22, 305, + 61, 62, 63, 64, 65, 66, 151, 273, 274, 153, + 276, 0, 32, 33, 320, 321, 322, 160, 493, 412, + 413, 496, 497, 498, 4, 151, 419, 153, 151, 18, + 19, 20, 150, 22, 23, 24, 9, 381, 382, 383, + 9, 30, 31, 309, 151, 389, 153, 151, 354, 153, + 560, 317, 318, 9, 564, 399, 400, 363, 113, 114, + 83, 84, 51, 9, 9, 9, 55, 54, 56, 11, + 59, 151, 150, 466, 467, 468, 469, 160, 422, 150, + 473, 474, 150, 150, 150, 391, 392, 393, 394, 395, + 22, 150, 398, 150, 150, 153, 150, 38, 38, 443, + 153, 445, 153, 153, 448, 411, 557, 118, 119, 60, + 454, 455, 153, 506, 507, 381, 382, 383, 153, 150, + 150, 153, 156, 389, 135, 136, 577, 138, 139, 38, + 141, 142, 143, 399, 400, 153, 153, 153, 153, 153, + 22, 485, 486, 0, 488, 489, 153, 153, 153, 153, + 494, 160, 545, 459, 547, 548, 153, 153, 153, 151, + 504, 18, 19, 20, 17, 22, 23, 24, 17, 475, + 153, 150, 153, 30, 31, 481, 4, 443, 153, 445, + 22, 487, 448, 153, 150, 153, 153, 493, 454, 455, + 496, 497, 498, 537, 51, 501, 153, 160, 55, 153, + 480, 153, 59, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 4, 558, 559, 153, 153, 153, 485, + 486, 53, 488, 489, 153, 151, 153, 22, 494, 153, + 574, 151, 151, 156, 151, 153, 7, 8, 504, 10, + 11, 12, 13, 14, 15, 16, 17, 158, 19, 20, + 151, 22, 23, 24, 53, 561, 600, 601, 17, 158, + 151, 605, 151, 4, 608, 151, 146, 150, 22, 150, + 614, 537, 552, 617, 153, 17, 153, 17, 49, 17, + 72, 3, 4, 17, 130, 7, 8, 9, 252, 130, + 130, 251, 558, 559, 552, 92, 524, 19, 20, 111, + 22, 23, 24, 25, 26, 27, 228, 105, 574, 239, + 17, 89, 56, 501, 414, -1, -1, -1, 40, 41, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 600, 601, 58, -1, -1, 605, + -1, -1, 608, -1, -1, -1, -1, -1, 614, -1, + -1, 617, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 155, 156, -1, -1, 159, -1, + 161, 162, -1, -1, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, -1, 130, -1, + 132, 133, 134, 135, 136, -1, 138, 139, -1, 141, + 142, 143, 3, 4, -1, -1, 7, 8, 9, -1, + -1, -1, -1, -1, -1, -1, -1, 159, 19, 20, + -1, 22, 23, 24, 25, 26, 27, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, + 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 54, -1, 7, 8, 58, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, 7, 8, 49, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, -1, 130, + -1, 132, 133, 134, -1, -1, -1, 49, -1, -1, + 3, 4, -1, -1, 7, 8, 9, -1, -1, 150, + -1, -1, -1, -1, -1, -1, 19, 20, 159, 22, + 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 58, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + 162, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + 162, -1, -1, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, -1, 130, -1, 132, + 133, 134, 7, 8, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 19, 20, -1, 22, 23, 24, + 25, -1, -1, -1, -1, -1, 159, -1, -1, -1, + -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 7, 8, 54, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, -1, -1, -1, -1, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, 49, + -1, -1, 7, 8, -1, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, + -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 39, 130, -1, 132, 133, 134, + -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 150, -1, 7, 8, 154, + -1, 156, -1, -1, 159, -1, 161, -1, 163, 19, + 20, -1, 22, 23, 24, 25, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 54, 155, 156, -1, -1, 159, + -1, 161, 162, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 155, 156, -1, -1, 159, -1, 161, -1, -1, -1, + 26, 27, -1, -1, -1, -1, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, -1, + 130, -1, 132, 133, 134, -1, -1, -1, -1, -1, + -1, -1, 3, 4, -1, -1, -1, -1, 9, -1, + 150, -1, -1, -1, -1, -1, 156, -1, -1, 159, + -1, 161, -1, 163, 25, 26, 27, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, + 41, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 7, 8, 58, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, -1, 130, + -1, 132, 133, 134, 7, 8, -1, 10, 11, 12, + 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, + 23, 24, -1, -1, -1, -1, -1, -1, 159, -1, + -1, -1, -1, -1, -1, -1, 39, -1, -1, -1, + 122, -1, -1, -1, 7, 8, 49, 10, 11, 12, + 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, + 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + -1, -1, -1, -1, 7, 8, 49, 10, 11, 12, + 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, + 23, 24, 7, 8, -1, 10, 11, 12, 13, 14, + 15, 16, 17, -1, 19, 20, 39, 22, 23, 24, + -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, + -1, -1, -1, -1, 39, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, + -1, -1, 155, 156, -1, -1, 159, -1, 161, 7, + 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 155, 156, -1, 158, 159, -1, 161, 7, + 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 155, 156, -1, -1, 159, -1, 161, -1, + -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, + 155, 156, -1, -1, 159, -1, 161, 7, 8, -1, + 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, + 20, -1, 22, 23, 24, 7, 8, -1, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, 49, + -1, -1, -1, -1, -1, -1, -1, 155, 156, -1, + -1, 159, -1, 161, -1, 7, 8, 49, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 155, 156, -1, + -1, 159, -1, 161, -1, 7, 8, 49, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, 7, 8, -1, 10, 11, 12, 13, + 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, + 24, -1, -1, -1, -1, -1, -1, 49, -1, -1, + -1, -1, -1, -1, -1, 155, 156, -1, -1, 159, + -1, 161, -1, -1, -1, 49, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 155, 156, -1, -1, 159, -1, 161, -1, -1, + 56, 57, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 155, 156, + -1, -1, 159, -1, 161, 111, 112, 113, -1, -1, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134 +}; -/* 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, 19, 20, 22, 23, 24, 30, 31, 51, 55, + 59, 172, 175, 176, 177, 178, 210, 211, 212, 214, + 213, 52, 67, 219, 152, 58, 152, 18, 152, 42, + 43, 44, 45, 46, 47, 48, 50, 147, 148, 149, + 179, 180, 181, 0, 212, 46, 48, 182, 229, 42, + 43, 44, 47, 183, 226, 228, 235, 152, 152, 156, + 220, 22, 218, 7, 8, 10, 11, 12, 13, 14, + 15, 16, 17, 49, 155, 156, 159, 161, 172, 176, + 197, 198, 232, 181, 181, 35, 37, 208, 181, 181, + 21, 236, 237, 29, 162, 227, 236, 22, 22, 22, + 221, 150, 4, 4, 4, 161, 10, 162, 198, 203, + 54, 150, 174, 208, 208, 42, 44, 184, 32, 33, + 207, 61, 62, 63, 64, 65, 66, 185, 224, 224, + 175, 240, 153, 158, 39, 198, 199, 201, 202, 157, + 157, 162, 203, 153, 162, 150, 202, 154, 207, 207, + 10, 122, 198, 200, 209, 11, 12, 13, 14, 15, + 16, 170, 171, 198, 204, 4, 200, 28, 161, 225, + 36, 56, 57, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 111, 112, 113, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 165, 166, + 167, 238, 244, 245, 246, 247, 22, 187, 153, 151, + 198, 198, 160, 162, 198, 4, 151, 204, 198, 150, + 232, 26, 27, 3, 4, 5, 6, 9, 25, 40, + 41, 89, 90, 116, 130, 132, 133, 134, 156, 159, + 161, 163, 165, 166, 167, 205, 232, 174, 176, 56, + 10, 198, 234, 11, 17, 11, 170, 185, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 168, 26, + 27, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 169, 198, 198, 234, 198, + 198, 241, 234, 234, 234, 234, 234, 198, 198, 234, + 185, 114, 115, 118, 119, 135, 136, 138, 139, 141, + 142, 143, 186, 39, 199, 189, 158, 160, 160, 151, + 189, 174, 174, 209, 168, 169, 150, 150, 150, 150, + 150, 158, 204, 206, 161, 206, 162, 206, 22, 150, + 150, 150, 215, 150, 3, 4, 9, 25, 26, 27, + 40, 41, 58, 159, 205, 231, 232, 233, 233, 233, + 233, 200, 198, 198, 153, 192, 153, 192, 233, 156, + 153, 153, 153, 153, 153, 153, 233, 233, 38, 200, + 198, 234, 135, 136, 137, 140, 144, 145, 188, 216, + 217, 38, 150, 150, 204, 204, 204, 204, 204, 153, + 158, 162, 198, 206, 160, 162, 204, 204, 204, 153, + 195, 39, 198, 222, 223, 60, 230, 206, 153, 153, + 233, 233, 233, 11, 53, 11, 243, 233, 156, 234, + 198, 234, 234, 234, 153, 153, 198, 233, 233, 153, + 195, 195, 198, 204, 204, 243, 153, 153, 153, 153, + 204, 160, 162, 153, 153, 38, 34, 53, 193, 196, + 187, 153, 151, 22, 160, 17, 17, 150, 153, 153, + 233, 4, 233, 153, 153, 233, 153, 153, 153, 233, + 233, 150, 153, 192, 198, 151, 153, 153, 151, 204, + 204, 204, 204, 160, 204, 204, 198, 22, 4, 195, + 172, 173, 39, 198, 189, 153, 233, 233, 17, 198, + 242, 233, 233, 192, 192, 234, 233, 153, 234, 234, + 234, 242, 233, 204, 204, 153, 151, 153, 153, 151, + 151, 151, 187, 193, 194, 22, 153, 156, 187, 187, + 151, 153, 158, 233, 151, 192, 151, 151, 204, 204, + 204, 173, 53, 191, 17, 158, 170, 239, 118, 119, + 233, 233, 189, 17, 198, 158, 189, 151, 151, 151, + 4, 146, 190, 233, 231, 158, 170, 187, 187, 38, + 187, 187, 22, 153, 231, 17, 233, 233, 17, 153, + 233, 187, 187, 233, 17, 72, 233, 17, 233 +}; #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; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ -/* If nonreentrant, generate the variables here */ +#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"); +} -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) -#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"); + } +} -/* 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 + +# 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; -#else /* __cplusplus */ + 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: ; + } -/* 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) + 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. */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + /* 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; + + + /* 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; @@ -2352,727 +3275,773 @@ 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) { - int i; + case 29: +#line 1113 "/Users/scottm/play/llvm-trunk/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 1113 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; - break;} -case 29: -#line 1113 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_NE; ; - break;} -case 30: -#line 1114 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; - break;} -case 31: -#line 1114 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; - break;} -case 32: -#line 1115 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; - break;} -case 33: -#line 1115 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; - break;} -case 34: -#line 1116 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; - break;} -case 35: -#line 1116 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; - break;} -case 36: -#line 1117 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; - break;} -case 37: -#line 1117 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; - break;} -case 38: -#line 1121 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; - break;} -case 39: -#line 1121 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; - break;} -case 40: -#line 1122 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; - break;} -case 41: -#line 1122 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; - break;} -case 42: -#line 1123 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; - break;} -case 43: -#line 1123 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; - break;} -case 44: -#line 1124 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; - break;} -case 45: -#line 1124 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; - break;} -case 46: -#line 1125 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; - break;} -case 47: -#line 1125 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; - break;} -case 48: -#line 1126 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; - break;} -case 49: -#line 1126 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; - break;} -case 50: -#line 1127 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; - break;} -case 51: -#line 1127 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; - break;} -case 52: -#line 1128 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; - break;} -case 53: -#line 1129 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; - break;} -case 64: -#line 1138 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 65: -#line 1140 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal=yyvsp[-1].UInt64Val; ; - break;} -case 66: -#line 1141 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal=0; ; - break;} -case 67: -#line 1145 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; + case 30: +#line 1113 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} + break; + + case 31: +#line 1114 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} + break; + + case 32: +#line 1114 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} + break; + + case 33: +#line 1115 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} + break; + + case 34: +#line 1115 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} + break; + + case 35: +#line 1116 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} + break; + + case 36: +#line 1116 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} + break; + + case 37: +#line 1117 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} + break; + + case 38: +#line 1117 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} + break; + + case 39: +#line 1121 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} + break; + + case 40: +#line 1121 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} + break; + + case 41: +#line 1122 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} + break; + + case 42: +#line 1122 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} + break; + + case 43: +#line 1123 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} + break; + + case 44: +#line 1123 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} + break; + + case 45: +#line 1124 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} + break; + + case 46: +#line 1124 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} + break; + + case 47: +#line 1125 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} + break; + + case 48: +#line 1125 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} + break; + + case 49: +#line 1126 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} + break; + + case 50: +#line 1126 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} + break; + + case 51: +#line 1127 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} + break; + + case 52: +#line 1127 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} + break; + + case 53: +#line 1128 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} + break; + + case 54: +#line 1129 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} + break; + + case 65: +#line 1138 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 66: +#line 1140 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} + break; + + case 67: +#line 1141 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal)=0; ;} + break; + + case 68: +#line 1145 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 68: -#line 1149 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; + ;} + break; + + case 69: +#line 1149 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; CHECK_FOR_ERROR - ; - break;} -case 72: -#line 1157 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; + ;} + break; + + case 73: +#line 1157 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; CHECK_FOR_ERROR - ; - break;} -case 73: -#line 1162 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; + ;} + break; + + case 74: +#line 1162 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 74: -#line 1168 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 75: -#line 1169 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 76: -#line 1170 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 77: -#line 1171 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::AppendingLinkage; ; - break;} -case 78: -#line 1172 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 79: -#line 1176 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 80: -#line 1177 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 81: -#line 1178 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 82: -#line 1182 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::DefaultVisibility; ; - break;} -case 83: -#line 1183 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::DefaultVisibility; ; - break;} -case 84: -#line 1184 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::HiddenVisibility; ; - break;} -case 85: -#line 1185 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Visibility = GlobalValue::ProtectedVisibility; ; - break;} -case 86: -#line 1189 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 87: -#line 1190 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; - break;} -case 88: -#line 1191 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; - break;} -case 89: -#line 1195 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 90: -#line 1196 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 91: -#line 1197 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 92: -#line 1198 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 93: -#line 1199 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; - break;} -case 94: -#line 1203 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 95: -#line 1204 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 96: -#line 1205 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 97: -#line 1208 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 98: -#line 1209 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 99: -#line 1210 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Fast; ; - break;} -case 100: -#line 1211 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Cold; ; - break;} -case 101: -#line 1212 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_StdCall; ; - break;} -case 102: -#line 1213 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::X86_FastCall; ; - break;} -case 103: -#line 1214 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) + ;} + break; + + case 75: +#line 1168 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 76: +#line 1169 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 77: +#line 1170 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 78: +#line 1171 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} + break; + + case 79: +#line 1172 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 80: +#line 1176 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 81: +#line 1177 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 82: +#line 1178 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 83: +#line 1182 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} + break; + + case 84: +#line 1183 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} + break; + + case 85: +#line 1184 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} + break; + + case 86: +#line 1185 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} + break; + + case 87: +#line 1189 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 88: +#line 1190 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} + break; + + case 89: +#line 1191 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} + break; + + case 90: +#line 1195 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 91: +#line 1196 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 92: +#line 1197 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 93: +#line 1198 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 94: +#line 1199 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} + break; + + case 95: +#line 1203 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 96: +#line 1204 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 97: +#line 1205 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; + + case 98: +#line 1208 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 99: +#line 1209 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 100: +#line 1210 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Fast; ;} + break; + + case 101: +#line 1211 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Cold; ;} + break; + + case 102: +#line 1212 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} + break; + + case 103: +#line 1213 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} + break; + + case 104: +#line 1214 "/Users/scottm/play/llvm-trunk/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 104: -#line 1221 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ZExt; ; - break;} -case 105: -#line 1222 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ZExt; ; - break;} -case 106: -#line 1223 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::SExt; ; - break;} -case 107: -#line 1224 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::SExt; ; - break;} -case 108: -#line 1225 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::InReg; ; - break;} -case 109: -#line 1226 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::StructRet; ; - break;} -case 110: -#line 1227 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoAlias; ; - break;} -case 111: -#line 1228 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ByVal; ; - break;} -case 112: -#line 1229 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::Nest; ; - break;} -case 113: -#line 1232 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::None; ; - break;} -case 114: -#line 1233 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; - ; - break;} -case 115: -#line 1238 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoReturn; ; - break;} -case 116: -#line 1239 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::NoUnwind; ; - break;} -case 117: -#line 1240 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ZExt; ; - break;} -case 118: -#line 1241 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::SExt; ; - break;} -case 119: -#line 1242 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ReadNone; ; - break;} -case 120: -#line 1243 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::ReadOnly; ; - break;} -case 121: -#line 1246 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamAttrs = ParamAttr::None; ; - break;} -case 122: -#line 1247 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; - ; - break;} -case 123: -#line 1252 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 124: -#line 1253 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[0].StrVal; - ; - break;} -case 125: -#line 1260 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 126: -#line 1261 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) + ;} + break; + + case 105: +#line 1221 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} + break; + + case 106: +#line 1222 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} + break; + + case 107: +#line 1223 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} + break; + + case 108: +#line 1224 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} + break; + + case 109: +#line 1225 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::InReg; ;} + break; + + case 110: +#line 1226 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} + break; + + case 111: +#line 1227 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} + break; + + case 112: +#line 1228 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} + break; + + case 113: +#line 1229 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::Nest; ;} + break; + + case 114: +#line 1232 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::None; ;} + break; + + case 115: +#line 1233 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); + ;} + break; + + case 116: +#line 1238 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} + break; + + case 117: +#line 1239 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} + break; + + case 118: +#line 1240 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} + break; + + case 119: +#line 1241 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::SExt; ;} + break; + + case 120: +#line 1242 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} + break; + + case 121: +#line 1243 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} + break; + + case 122: +#line 1246 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamAttrs) = ParamAttr::None; ;} + break; + + case 123: +#line 1247 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); + ;} + break; + + case 124: +#line 1252 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 125: +#line 1253 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); + ;} + break; + + case 126: +#line 1260 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 127: +#line 1261 "/Users/scottm/play/llvm-trunk/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 127: -#line 1267 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 128: -#line 1268 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) +;} + break; + + case 128: +#line 1267 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 129: +#line 1268 "/Users/scottm/play/llvm-trunk/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 129: -#line 1277 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - for (unsigned i = 0, e = yyvsp[0].StrVal->length(); i != e; ++i) - if ((*yyvsp[0].StrVal)[i] == '"' || (*yyvsp[0].StrVal)[i] == '\\') +;} + break; + + case 130: +#line 1277 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); 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 130: -#line 1285 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 131: -#line 1286 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = yyvsp[0].StrVal; ; - break;} -case 132: -#line 1291 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 133: -#line 1292 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 134: -#line 1293 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurGV->setSection(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; +;} + break; + + case 131: +#line 1285 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 132: +#line 1286 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} + break; + + case 133: +#line 1291 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 134: +#line 1292 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 135: +#line 1293 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 135: -#line 1298 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) + ;} + break; + + case 136: +#line 1298 "/Users/scottm/play/llvm-trunk/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 143: -#line 1314 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(OpaqueType::get()); + ;} + break; + + case 144: +#line 1314 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ; - break;} -case 144: -#line 1318 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); + ;} + break; + + case 145: +#line 1318 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); CHECK_FOR_ERROR - ; - break;} -case 145: -#line 1322 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Pointer type? - if (*yyvsp[-2].TypeVal == Type::LabelTy) + ;} + break; + + case 146: +#line 1322 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Pointer type? + if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-2].TypeVal, yyvsp[-1].UIntVal))); - delete yyvsp[-2].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal)))); + delete (yyvsp[(1) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 147: +#line 1329 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Named types are also simple types... + const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 146: -#line 1329 "/Users/clamb/Documents/llvm/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 147: -#line 1334 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Type UpReference - if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range"); + (yyval.TypeVal) = new PATypeHolder(tmp); + ;} + break; + + case 148: +#line 1334 "/Users/scottm/play/llvm-trunk/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 148: -#line 1342 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 149: +#line 1342 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. - const Type* RetTy = *yyvsp[-4].TypeVal; + const Type* RetTy = *(yyvsp[(1) - (5)].TypeVal); if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy || isa(RetTy))) GEN_ERROR("LLVM Functions cannot return aggregates"); std::vector Params; - TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); + TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); for (; I != E; ++I ) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -3088,19 +4057,20 @@ CHECK_FOR_ERROR FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg); - 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 149: -#line 1372 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + 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 150: +#line 1372 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. std::vector Params; - TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); + TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); for ( ; I != E; ++I ) { const Type* Ty = I->Ty->get(); Params.push_back(Ty); @@ -3115,282 +4085,303 @@ CHECK_FOR_ERROR - FunctionType *FT = FunctionType::get(yyvsp[-4].PrimType, Params, isVarArg); - delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ; - break;} -case 150: -#line 1397 "/Users/clamb/Documents/llvm/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 151: -#line 1402 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Vector 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); + delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ;} + break; + + case 151: +#line 1397 "/Users/scottm/play/llvm-trunk/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 152: +#line 1402 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Vector 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 VectorType must be primitive"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); + delete (yyvsp[(4) - (5)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 152: -#line 1412 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Structure type? + ;} + break; + + case 153: +#line 1412 "/Users/scottm/play/llvm-trunk/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 153: -#line 1422 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ; - break;} -case 154: -#line 1426 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 154: +#line 1422 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ;} + break; + + case 155: +#line 1426 "/Users/scottm/play/llvm-trunk/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 155: -#line 1436 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); - CHECK_FOR_ERROR - ; - break;} -case 156: -#line 1443 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 156: +#line 1436 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ;} + break; + + case 157: +#line 1443 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. - yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; - yyval.TypeWithAttrs.Attrs = ParamAttr::None; - ; - break;} -case 157: -#line 1452 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); + (yyval.TypeWithAttrs).Attrs = ParamAttr::None; + ;} + break; + + case 158: +#line 1452 "/Users/scottm/play/llvm-trunk/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 158: -#line 1459 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(Type::VoidTy); - ; - break;} -case 159: -#line 1464 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); - yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); + (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal); + ;} + break; + + case 159: +#line 1459 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); + ;} + break; + + case 160: +#line 1464 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 160: -#line 1469 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); + ;} + break; + + case 161: +#line 1469 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); CHECK_FOR_ERROR - ; - break;} -case 162: -#line 1477 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; + ;} + break; + + case 163: +#line 1477 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 163: -#line 1484 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList; + ;} + break; + + case 164: +#line 1484 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - yyval.TypeWithAttrsList->push_back(TWA); + (yyval.TypeWithAttrsList)->push_back(TWA); CHECK_FOR_ERROR - ; - break;} -case 164: -#line 1491 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeWithAttrsList = new TypeWithAttrsList(); + ;} + break; + + case 165: +#line 1491 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); CHECK_FOR_ERROR - ; - break;} -case 165: -#line 1499 "/Users/clamb/Documents/llvm/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 166: -#line 1505 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; + ;} + break; + + case 166: +#line 1499 "/Users/scottm/play/llvm-trunk/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 167: -#line 1517 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + ;} + break; + + case 167: +#line 1505 "/Users/scottm/play/llvm-trunk/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 168: +#line 1517 "/Users/scottm/play/llvm-trunk/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 168: -#line 1545 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 169: +#line 1545 "/Users/scottm/play/llvm-trunk/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 169: -#line 1561 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 170: +#line 1561 "/Users/scottm/play/llvm-trunk/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(); - if (NumElements != -1 && NumElements != int(yyvsp[0].StrVal->length())) + if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length())) GEN_ERROR("Can't build string constant of size " + - itostr((int)(yyvsp[0].StrVal->length())) + + itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned i = 0; i < yyvsp[0].StrVal->length(); ++i) - Vals.push_back(ConstantInt::get(ETy, (*yyvsp[0].StrVal)[i])); + for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i) + Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i])); } else { - delete yyvsp[0].StrVal; + delete (yyvsp[(3) - (3)].StrVal); GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - delete yyvsp[0].StrVal; - yyval.ConstVal = ConstantArray::get(ATy, Vals); - delete yyvsp[-2].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 170: -#line 1588 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr + delete (yyvsp[(3) - (3)].StrVal); + (yyval.ConstVal) = ConstantArray::get(ATy, Vals); + delete (yyvsp[(1) - (3)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 171: +#line 1588 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - const VectorType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); + const VectorType *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 = ConstantVector::get(PTy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; + (yyval.ConstVal) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); + delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 171: -#line 1616 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); + ;} + break; + + case 172: +#line 1616 "/Users/scottm/play/llvm-trunk/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) + @@ -3401,20 +4392,21 @@ GEN_ERROR("Unpacked Initializer to vector 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 172: -#line 1642 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 173: +#line 1642 "/Users/scottm/play/llvm-trunk/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"); @@ -3424,25 +4416,26 @@ GEN_ERROR("Unpacked Initializer to vector 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 173: -#line 1662 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-5].TypeVal->get()); + ;} + break; + + case 174: +#line 1662 "/Users/scottm/play/llvm-trunk/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) + @@ -3453,20 +4446,21 @@ GEN_ERROR("Vector initializer to non-vector 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 174: -#line 1688 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 175: +#line 1688 "/Users/scottm/play/llvm-trunk/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"); @@ -3476,42 +4470,45 @@ GEN_ERROR("Vector initializer to non-vector 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 175: -#line 1708 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 176: +#line 1708 "/Users/scottm/play/llvm-trunk/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 176: -#line 1720 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 177: +#line 1720 "/Users/scottm/play/llvm-trunk/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 177: -#line 1727 "/Users/clamb/Documents/llvm/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 178: +#line 1727 "/Users/scottm/play/llvm-trunk/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"); @@ -3525,7 +4522,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal); + Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal)); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -3540,16 +4537,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.getName(); - else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) + if ((yyvsp[(2) - (2)].ValIDVal).Type == ValID::GlobalName) + Name = (yyvsp[(2) - (2)].ValIDVal).getName(); + else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -3565,342 +4562,377 @@ } // 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 178: -#line 1793 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 179: +#line 1793 "/Users/scottm/play/llvm-trunk/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 179: -#line 1803 "/Users/clamb/Documents/llvm/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 180: +#line 1803 "/Users/scottm/play/llvm-trunk/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 180: -#line 1813 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) + ;} + break; + + case 181: +#line 1813 "/Users/scottm/play/llvm-trunk/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, true); + (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val), true); CHECK_FOR_ERROR - ; - break;} -case 181: -#line 1819 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // arbitrary precision integer constants - uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); - if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { + ;} + break; + + case 182: +#line 1819 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // arbitrary precision integer constants + uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); + if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - yyvsp[0].APIntVal->sextOrTrunc(BitWidth); - yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); - delete yyvsp[0].APIntVal; - CHECK_FOR_ERROR - ; - break;} -case 182: -#line 1829 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) + (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); + delete (yyvsp[(2) - (2)].APIntVal); + CHECK_FOR_ERROR + ;} + break; + + case 183: +#line 1829 "/Users/scottm/play/llvm-trunk/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, false); + (yyval.ConstVal) = ConstantInt::get((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val), false); CHECK_FOR_ERROR - ; - break;} -case 183: -#line 1835 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // arbitrary precision integer constants - uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); - if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { + ;} + break; + + case 184: +#line 1835 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // arbitrary precision integer constants + uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); + if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - yyvsp[0].APIntVal->zextOrTrunc(BitWidth); - yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); - delete yyvsp[0].APIntVal; - CHECK_FOR_ERROR - ; - break;} -case 184: -#line 1845 "/Users/clamb/Documents/llvm/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 185: -#line 1850 "/Users/clamb/Documents/llvm/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 186: -#line 1855 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Floating point constants - if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, *yyvsp[0].FPVal)) + (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth); + (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); + delete (yyvsp[(2) - (2)].APIntVal); + CHECK_FOR_ERROR + ;} + break; + + case 185: +#line 1845 "/Users/scottm/play/llvm-trunk/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 186: +#line 1850 "/Users/scottm/play/llvm-trunk/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 187: +#line 1855 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Floating point constants + if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) GEN_ERROR("Floating point constant invalid for type"); // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double is done right. - if (&yyvsp[0].FPVal->getSemantics()==&APFloat::IEEEdouble && yyvsp[-1].PrimType==Type::FloatTy) - yyvsp[0].FPVal->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); - yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, *yyvsp[0].FPVal); - delete yyvsp[0].FPVal; - CHECK_FOR_ERROR - ; - break;} -case 187: -#line 1868 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy) + (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)); + delete (yyvsp[(2) - (2)].FPVal); + CHECK_FOR_ERROR + ;} + break; + + case 188: +#line 1868 "/Users/scottm/play/llvm-trunk/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 188: -#line 1880 "/Users/clamb/Documents/llvm/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 189: +#line 1880 "/Users/scottm/play/llvm-trunk/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->begin(), yyvsp[-1].ValueList->end(), + GetElementPtrInst::getIndexedType((yyvsp[(3) - (5)].ConstVal)->getType(), (yyvsp[(4) - (5)].ValueList)->begin(), (yyvsp[(4) - (5)].ValueList)->end(), 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 189: -#line 1902 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-5].ConstVal->getType() != Type::Int1Ty) + ;} + break; + + case 190: +#line 1902 "/Users/scottm/play/llvm-trunk/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 190: -#line 1910 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 191: +#line 1910 "/Users/scottm/play/llvm-trunk/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 191: -#line 1916 "/Users/clamb/Documents/llvm/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 192: +#line 1916 "/Users/scottm/play/llvm-trunk/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 192: -#line 1927 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) + ;} + break; + + case 193: +#line 1927 "/Users/scottm/play/llvm-trunk/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 193: -#line 1932 "/Users/clamb/Documents/llvm/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 194: +#line 1932 "/Users/scottm/play/llvm-trunk/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 194: -#line 1937 "/Users/clamb/Documents/llvm/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 195: +#line 1937 "/Users/scottm/play/llvm-trunk/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 195: -#line 1943 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 196: +#line 1943 "/Users/scottm/play/llvm-trunk/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 196: -#line 1949 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) + ;} + break; + + case 197: +#line 1949 "/Users/scottm/play/llvm-trunk/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 197: -#line 1958 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 198: +#line 1958 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 198: -#line 1962 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ConstVector = new std::vector(); - yyval.ConstVector->push_back(yyvsp[0].ConstVal); + ;} + break; + + case 199: +#line 1962 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstVector) = new std::vector(); + (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); CHECK_FOR_ERROR - ; - break;} -case 199: -#line 1970 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 200: -#line 1970 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 201: -#line 1973 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 202: -#line 1973 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 203: -#line 1976 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const Type* VTy = yyvsp[-1].TypeVal->get(); - Value *V = getVal(VTy, yyvsp[0].ValIDVal); + ;} + break; + + case 200: +#line 1970 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 201: +#line 1970 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 202: +#line 1973 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 203: +#line 1973 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 204: +#line 1976 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); + Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); CHECK_FOR_ERROR GlobalValue* Aliasee = dyn_cast(V); if (!Aliasee) GEN_ERROR("Aliases can be created only to global values"); - yyval.ConstVal = Aliasee; + (yyval.ConstVal) = Aliasee; CHECK_FOR_ERROR - delete yyvsp[-1].TypeVal; - ; - break;} -case 204: -#line 1988 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Constant *Val = yyvsp[-3].ConstVal; - const Type *DestTy = yyvsp[-1].TypeVal->get(); - if (!CastInst::castIsValid(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy)) + delete (yyvsp[(1) - (2)].TypeVal); + ;} + break; + + case 205: +#line 1988 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + 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); + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[(1) - (6)].CastOpVal), (yyvsp[(3) - (6)].ConstVal), DestTy); CHECK_FOR_ERROR - delete yyvsp[-1].TypeVal; - ; - break;} -case 205: -#line 2009 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + delete (yyvsp[(5) - (6)].TypeVal); + ;} + break; + + case 206: +#line 2009 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 206: -#line 2014 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = CurModule.CurrentModule; + ;} + break; + + case 207: +#line 2014 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ; - break;} -case 209: -#line 2027 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = false; ; - break;} -case 210: -#line 2027 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 210: +#line 2027 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = false; ;} + break; + + case 211: +#line 2027 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CurFun.FunctionDone(); CHECK_FOR_ERROR - ; - break;} -case 211: -#line 2031 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = true; ; - break;} -case 212: -#line 2031 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 212: +#line 2031 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = true; ;} + break; + + case 213: +#line 2031 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 213: -#line 2034 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 214: +#line 2034 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 214: -#line 2037 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 215: +#line 2037 "/Users/scottm/play/llvm-trunk/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: // @@ -3910,100 +4942,108 @@ // 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 215: -#line 2061 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ResolveTypeTo(yyvsp[-2].StrVal, yyvsp[0].PrimType); + ;} + break; - if (!setTypeName(yyvsp[0].PrimType, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + case 216: +#line 2061 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); + + 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 216: -#line 2073 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 217: +#line 2073 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { /* "Externally Visible" Linkage */ - if (yyvsp[-1].ConstVal == 0) + if ((yyvsp[(5) - (6)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, GlobalValue::ExternalLinkage, - yyvsp[-4].Visibility, yyvsp[-2].BoolVal, yyvsp[-1].ConstVal->getType(), yyvsp[-1].ConstVal, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); + CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[(2) - (6)].Visibility), (yyvsp[(4) - (6)].BoolVal), (yyvsp[(5) - (6)].ConstVal)->getType(), (yyvsp[(5) - (6)].ConstVal), (yyvsp[(3) - (6)].BoolVal), (yyvsp[(6) - (6)].UIntVal)); CHECK_FOR_ERROR - ; - break;} -case 217: -#line 2080 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 218: +#line 2080 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 218: -#line 2084 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-1].ConstVal == 0) + ;} + break; + + case 219: +#line 2084 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[(6) - (7)].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable(yyvsp[-6].StrVal, yyvsp[-5].Linkage, yyvsp[-4].Visibility, yyvsp[-2].BoolVal, yyvsp[-1].ConstVal->getType(), yyvsp[-1].ConstVal, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); + CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), (yyvsp[(6) - (7)].ConstVal)->getType(), (yyvsp[(6) - (7)].ConstVal), (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); CHECK_FOR_ERROR - ; - break;} -case 219: -#line 2089 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 220: +#line 2089 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 220: -#line 2093 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 221: +#line 2093 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); - CurGV = ParseGlobalVariable(yyvsp[-6].StrVal, yyvsp[-5].Linkage, yyvsp[-4].Visibility, yyvsp[-2].BoolVal, *yyvsp[-1].TypeVal, 0, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); + CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), *(yyvsp[(6) - (7)].TypeVal), 0, (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); CHECK_FOR_ERROR - delete yyvsp[-1].TypeVal; - ; - break;} -case 221: -#line 2099 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(6) - (7)].TypeVal); + ;} + break; + + case 222: +#line 2099 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; CHECK_FOR_ERROR - ; - break;} -case 222: -#line 2103 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 223: +#line 2103 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { std::string Name; - if (yyvsp[-4].StrVal) { - Name = *yyvsp[-4].StrVal; - delete yyvsp[-4].StrVal; + if ((yyvsp[(1) - (5)].StrVal)) { + Name = *(yyvsp[(1) - (5)].StrVal); + delete (yyvsp[(1) - (5)].StrVal); } if (Name.empty()) GEN_ERROR("Alias name cannot be empty"); - Constant* Aliasee = yyvsp[0].ConstVal; + Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal); if (Aliasee == 0) GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name); - GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), yyvsp[-1].Linkage, Name, Aliasee, + GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee, CurModule.CurrentModule); - GA->setVisibility(yyvsp[-3].Visibility); + GA->setVisibility((yyvsp[(2) - (5)].Visibility)); InsertValue(GA, CurModule.Values); @@ -4027,154 +5067,169 @@ ID.destroy(); CHECK_FOR_ERROR - ; - break;} -case 223: -#line 2143 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CHECK_FOR_ERROR - ; - break;} -case 224: -#line 2146 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 224: +#line 2143 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 225: -#line 2152 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 225: +#line 2146 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + CHECK_FOR_ERROR + ;} + break; + + case 226: +#line 2152 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) - CurModule.CurrentModule->setModuleInlineAsm(*yyvsp[0].StrVal); + CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal)); else - CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; + CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); CHECK_FOR_ERROR -; - break;} -case 226: -#line 2162 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setTargetTriple(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - ; - break;} -case 227: -#line 2166 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setDataLayout(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - ; - break;} -case 229: -#line 2173 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; +;} + break; + + case 227: +#line 2162 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); + delete (yyvsp[(3) - (3)].StrVal); + ;} + break; + + case 228: +#line 2166 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); + delete (yyvsp[(3) - (3)].StrVal); + ;} + break; + + case 230: +#line 2173 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); + delete (yyvsp[(3) - (3)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 230: -#line 2178 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; + ;} + break; + + case 231: +#line 2178 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); CHECK_FOR_ERROR - ; - break;} -case 231: -#line 2183 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 232: +#line 2183 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { CHECK_FOR_ERROR - ; - break;} -case 232: -#line 2192 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 233: +#line 2192 "/Users/scottm/play/llvm-trunk/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 233: -#line 2202 "/Users/clamb/Documents/llvm/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 234: +#line 2202 "/Users/scottm/play/llvm-trunk/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 234: -#line 2213 "/Users/clamb/Documents/llvm/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 235: -#line 2217 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; + ;} + break; + + case 235: +#line 2213 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (1)].ArgList); + CHECK_FOR_ERROR + ;} + break; + + case 236: +#line 2217 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 236: -#line 2226 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = new ArgListType; + ;} + break; + + case 237: +#line 2226 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - yyval.ArgList->push_back(E); + (yyval.ArgList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 237: -#line 2235 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = 0; + ;} + break; + + case 238: +#line 2235 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = 0; CHECK_FOR_ERROR - ; - break;} -case 238: -#line 2241 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - std::string FunctionName(*yyvsp[-7].StrVal); - delete yyvsp[-7].StrVal; // Free strdup'd memory! + ;} + break; + + case 239: +#line 2241 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); + delete (yyvsp[(3) - (10)].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[-8].TypeVal)) - GEN_ERROR("Reference to abstract result: "+ yyvsp[-8].TypeVal->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved((yyvsp[(2) - (10)].TypeVal))) + GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription()); std::vector ParamTypeList; ParamAttrsVector Attrs; - if (yyvsp[-3].ParamAttrs != ParamAttr::None) { + if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) { ParamAttrsWithIndex PAWI; PAWI.index = 0; - PAWI.attrs = yyvsp[-3].ParamAttrs; + PAWI.attrs = (yyvsp[(7) - (10)].ParamAttrs); Attrs.push_back(PAWI); } - if (yyvsp[-5].ArgList) { // If there are arguments... + if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = yyvsp[-5].ArgList->begin(); I != yyvsp[-5].ArgList->end(); ++I, ++index) { + for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -4196,9 +5251,9 @@ if (!Attrs.empty()) PAL = ParamAttrsList::get(Attrs); - FunctionType *FT = FunctionType::get(*yyvsp[-8].TypeVal, ParamTypeList, isVarArg); + FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg); const PointerType *PFT = PointerType::getUnqual(FT); - delete yyvsp[-8].TypeVal; + delete (yyvsp[(2) - (10)].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -4251,31 +5306,31 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv(yyvsp[-9].UIntVal); + Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal)); Fn->setParamAttrs(PAL); - Fn->setAlignment(yyvsp[-1].UIntVal); - if (yyvsp[-2].StrVal) { - Fn->setSection(*yyvsp[-2].StrVal); - delete yyvsp[-2].StrVal; - } - if (yyvsp[0].StrVal) { - Fn->setCollector(yyvsp[0].StrVal->c_str()); - delete yyvsp[0].StrVal; + Fn->setAlignment((yyvsp[(9) - (10)].UIntVal)); + if ((yyvsp[(8) - (10)].StrVal)) { + Fn->setSection(*(yyvsp[(8) - (10)].StrVal)); + delete (yyvsp[(8) - (10)].StrVal); + } + if ((yyvsp[(10) - (10)].StrVal)) { + Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str()); + delete (yyvsp[(10) - (10)].StrVal); } // Add all of the arguments we parsed to the function... - if (yyvsp[-5].ArgList) { // Is null if empty... + if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert(yyvsp[-5].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-5].ArgList->back().Name == 0 && + assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 && "Not a varargs marker!"); - delete yyvsp[-5].ArgList->back().Ty; - yyvsp[-5].ArgList->pop_back(); // Delete the last entry + delete (yyvsp[(5) - (10)].ArgList)->back().Ty; + (yyvsp[(5) - (10)].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].ArgList->begin(); - I != yyvsp[-5].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); + I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -4283,114 +5338,128 @@ Idx++; } - delete yyvsp[-5].ArgList; // We're now done with the argument list + delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list } CHECK_FOR_ERROR -; - break;} -case 241: -#line 2376 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = CurFun.CurrentFunction; +;} + break; + + case 242: +#line 2376 "/Users/scottm/play/llvm-trunk/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 244: -#line 2387 "/Users/clamb/Documents/llvm/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 245: +#line 2387 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); CHECK_FOR_ERROR -; - break;} -case 245: -#line 2392 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurFun.CurrentFunction->setLinkage(yyvsp[-2].Linkage); - CurFun.CurrentFunction->setVisibility(yyvsp[-1].Visibility); - yyval.FunctionVal = CurFun.CurrentFunction; +;} + break; + + case 246: +#line 2392 "/Users/scottm/play/llvm-trunk/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 246: -#line 2404 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 247: +#line 2404 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; CHECK_FOR_ERROR - ; - break;} -case 247: -#line 2408 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 248: +#line 2408 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 248: -#line 2413 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A reference to a direct constant - yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); - CHECK_FOR_ERROR - ; - break;} -case 249: -#line 2417 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); + ;} + break; + + case 249: +#line 2413 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // A reference to a direct constant + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 250: -#line 2421 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Perhaps it's an FP constant? - yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); - CHECK_FOR_ERROR - ; - break;} -case 251: -#line 2425 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); + ;} + break; + + case 250: +#line 2417 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); CHECK_FOR_ERROR - ; - break;} -case 252: -#line 2429 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); + ;} + break; + + case 251: +#line 2421 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Perhaps it's an FP constant? + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); CHECK_FOR_ERROR - ; - break;} -case 253: -#line 2433 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createNull(); + ;} + break; + + case 252: +#line 2425 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ; - break;} -case 254: -#line 2437 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createUndef(); + ;} + break; + + case 253: +#line 2429 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); + CHECK_FOR_ERROR + ;} + break; + + case 254: +#line 2433 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createNull(); + CHECK_FOR_ERROR + ;} + break; + + case 255: +#line 2437 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createUndef(); + CHECK_FOR_ERROR + ;} + break; + + case 256: +#line 2441 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // A vector zero constant. + (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR - ; - break;} -case 255: -#line 2441 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A vector zero constant. - yyval.ValIDVal = ValID::createZeroInit(); - CHECK_FOR_ERROR - ; - break;} -case 256: -#line 2445 "/Users/clamb/Documents/llvm/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 257: +#line 2445 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized packed vector + const Type *ETy = (*(yyvsp[(2) - (3)].ConstVector))[0]->getType(); + int NumElements = (yyvsp[(2) - (3)].ConstVector)->size(); VectorType* pt = VectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -4402,236 +5471,256 @@ ); // 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(ConstantVector::get(pt, *yyvsp[-1].ConstVector)); - delete PTy; delete yyvsp[-1].ConstVector; + (yyval.ValIDVal) = ValID::create(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector))); + delete PTy; delete (yyvsp[(2) - (3)].ConstVector); CHECK_FOR_ERROR - ; - break;} -case 257: -#line 2470 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); + ;} + break; + + case 258: +#line 2470 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 259: +#line 2474 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); + delete (yyvsp[(3) - (5)].StrVal); + delete (yyvsp[(5) - (5)].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 260: +#line 2484 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Is it an integer reference...? + (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); + CHECK_FOR_ERROR + ;} + break; + + case 261: +#line 2488 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); + CHECK_FOR_ERROR + ;} + break; + + case 262: +#line 2492 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Is it a named reference...? + (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 263: +#line 2497 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Is it a named reference...? + (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); + delete (yyvsp[(1) - (1)].StrVal); + CHECK_FOR_ERROR + ;} + break; + + case 266: +#line 2510 "/Users/scottm/play/llvm-trunk/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 267: +#line 2519 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + CHECK_FOR_ERROR + ;} + break; + + case 268: +#line 2523 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Do not allow functions with 0 basic blocks + (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + CHECK_FOR_ERROR + ;} + break; + + case 269: +#line 2532 "/Users/scottm/play/llvm-trunk/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)); + (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); + CHECK_FOR_ERROR + ;} + break; + + case 270: +#line 2541 "/Users/scottm/play/llvm-trunk/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) - (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 271: +#line 2550 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Empty space between instruction lists + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); + CHECK_FOR_ERROR + ;} + break; + + case 272: +#line 2554 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Labelled (named) basic block + (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); + delete (yyvsp[(1) - (1)].StrVal); + CHECK_FOR_ERROR + + ;} + break; + + case 273: +#line 2561 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Return with a result... + (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 274: +#line 2565 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Return with no result... + (yyval.TermInstVal) = new ReturnInst(); + CHECK_FOR_ERROR + ;} + break; + + case 275: +#line 2569 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // Unconditional Branch... + BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 258: -#line 2474 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createInlineAsm(*yyvsp[-2].StrVal, *yyvsp[0].StrVal, yyvsp[-3].BoolVal); - delete yyvsp[-2].StrVal; - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 259: -#line 2484 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it an integer reference...? - yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); - CHECK_FOR_ERROR - ; - break;} -case 260: -#line 2488 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); + (yyval.TermInstVal) = new BranchInst(tmpBB); + ;} + break; + + case 276: +#line 2574 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); + BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 261: -#line 2492 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it a named reference...? - yyval.ValIDVal = ValID::createLocalName(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 262: -#line 2497 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it a named reference...? - yyval.ValIDVal = ValID::createGlobalName(*yyvsp[0].StrVal); - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - ; - break;} -case 265: -#line 2510 "/Users/clamb/Documents/llvm/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 266: -#line 2519 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; + BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); CHECK_FOR_ERROR - ; - break;} -case 267: -#line 2523 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Do not allow functions with 0 basic blocks - yyval.FunctionVal = yyvsp[-1].FunctionVal; - CHECK_FOR_ERROR - ; - break;} -case 268: -#line 2532 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); + Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR - InsertValue(yyvsp[0].TermInstVal); - yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); - yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; - CHECK_FOR_ERROR - ; - break;} -case 269: -#line 2541 "/Users/clamb/Documents/llvm/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].BasicBlockVal->getInstList().push_back(CI2); - yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); - yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; - CHECK_FOR_ERROR - ; - break;} -case 270: -#line 2550 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty space between instruction lists - yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); - CHECK_FOR_ERROR - ; - break;} -case 271: -#line 2554 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Labelled (named) basic block - yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(*yyvsp[0].StrVal)); - delete yyvsp[0].StrVal; - CHECK_FOR_ERROR - - ; - break;} -case 272: -#line 2561 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with a result... - yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); - CHECK_FOR_ERROR - ; - break;} -case 273: -#line 2565 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with no result... - yyval.TermInstVal = new ReturnInst(); - CHECK_FOR_ERROR - ; - break;} -case 274: -#line 2569 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Unconditional Branch... - BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); - CHECK_FOR_ERROR - yyval.TermInstVal = new BranchInst(tmpBB); - ; - break;} -case 275: -#line 2574 "/Users/clamb/Documents/llvm/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 276: -#line 2584 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Value* tmpVal = getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal); + (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); + ;} + break; + + case 277: +#line 2584 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); CHECK_FOR_ERROR - BasicBlock* tmpBB = getBBVal(yyvsp[-3].ValIDVal); + BasicBlock* tmpBB = getBBVal((yyvsp[(6) - (9)].ValIDVal)); CHECK_FOR_ERROR - SwitchInst *S = new SwitchInst(tmpVal, tmpBB, yyvsp[-1].JumpTable->size()); - yyval.TermInstVal = S; + 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 277: -#line 2603 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - Value* tmpVal = getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal); + ;} + break; + + case 278: +#line 2603 "/Users/scottm/play/llvm-trunk/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 278: -#line 2613 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 279: +#line 2613 "/Users/scottm/play/llvm-trunk/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; - ParamList::iterator I = yyvsp[-8].ParamList->begin(), E = yyvsp[-8].ParamList->end(); + ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end(); for (; I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); } - Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false); + Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false); PFTy = PointerType::getUnqual(Ty); } - delete yyvsp[-11].TypeVal; + delete (yyvsp[(3) - (14)].TypeVal); - 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 ParamAttrsVector Attrs; - if (yyvsp[-6].ParamAttrs != ParamAttr::None) { - ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-6].ParamAttrs; + if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) { + ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs); Attrs.push_back(PAWI); } // Check the arguments ValueList Args; - if (yyvsp[-8].ParamList->empty()) { // Has no arguments? + if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -4641,7 +5730,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ParamList::iterator ArgI = yyvsp[-8].ParamList->begin(), ArgE = yyvsp[-8].ParamList->end(); + ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end(); unsigned index = 1; for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) { @@ -4659,8 +5748,15 @@ if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI) + for (; ArgI != ArgE; ++ArgI, ++index) { Args.push_back(ArgI->Val); // push the remaining varargs + if (ArgI->Attrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; + PAWI.index = index; + PAWI.attrs = ArgI->Attrs; + Attrs.push_back(PAWI); + } + } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } @@ -4671,347 +5767,375 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end()); - II->setCallingConv(yyvsp[-12].UIntVal); + II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); II->setParamAttrs(PAL); - yyval.TermInstVal = II; - delete yyvsp[-8].ParamList; + (yyval.TermInstVal) = II; + delete (yyvsp[(6) - (14)].ParamList); CHECK_FOR_ERROR - ; - break;} -case 279: -#line 2696 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnwindInst(); + ;} + break; + + case 280: +#line 2703 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR - ; - break;} -case 280: -#line 2700 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnreachableInst(); + ;} + break; + + case 281: +#line 2707 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR - ; - break;} -case 281: -#line 2707 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = yyvsp[-5].JumpTable; - Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + ;} + break; + + case 282: +#line 2714 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); + Constant *V = cast(getExistingVal((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 282: -#line 2718 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = new std::vector >(); - Constant *V = cast(getExistingVal(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 283: +#line 2725 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = new std::vector >(); + Constant *V = cast(getExistingVal((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 283: -#line 2731 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.JumpTable)->push_back(std::make_pair(V, tmpBB)); + ;} + break; + + case 284: +#line 2738 "/Users/scottm/play/llvm-trunk/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 284: -#line 2741 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Used for PHI nodes + ;} + break; + + case 285: +#line 2748 "/Users/scottm/play/llvm-trunk/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 285: -#line 2752 "/Users/clamb/Documents/llvm/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 286: +#line 2759 "/Users/scottm/play/llvm-trunk/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 286: -#line 2762 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyvsp[(1) - (7)].PHIList)->push_back(std::make_pair(tmpVal, tmpBB)); + ;} + break; + + case 287: +#line 2769 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); // Used for call and invoke instructions - yyval.ParamList = new ParamList(); - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-3].TypeVal->get(), yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - delete yyvsp[-3].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 287: -#line 2773 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.ParamList) = new ParamList(); + ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal)); + (yyval.ParamList)->push_back(E); + delete (yyvsp[(1) - (4)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 288: +#line 2780 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs - yyval.ParamList = new ParamList(); - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 288: -#line 2781 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.ParamList) = new ParamList(); + ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal)); + (yyval.ParamList)->push_back(E); + CHECK_FOR_ERROR + ;} + break; + + case 289: +#line 2788 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - yyval.ParamList = yyvsp[-5].ParamList; - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-3].TypeVal->get(), yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - delete yyvsp[-3].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 289: -#line 2791 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); + (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); + ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal)); + (yyval.ParamList)->push_back(E); + delete (yyvsp[(3) - (6)].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 290: +#line 2798 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 - yyval.ParamList = yyvsp[-5].ParamList; - ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); - yyval.ParamList->push_back(E); - CHECK_FOR_ERROR - ; - break;} -case 290: -#line 2798 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ParamList = new ParamList(); ; - break;} -case 291: -#line 2801 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ValueList = new std::vector(); ; - break;} -case 292: -#line 2802 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueList = yyvsp[-2].ValueList; - yyval.ValueList->push_back(yyvsp[0].ValueVal); + (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); + ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal)); + (yyval.ParamList)->push_back(E); CHECK_FOR_ERROR - ; - break;} -case 293: -#line 2809 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 291: +#line 2805 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ParamList) = new ParamList(); ;} + break; + + case 292: +#line 2808 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { (yyval.ValueList) = new std::vector(); ;} + break; + + case 293: +#line 2809 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); + (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); CHECK_FOR_ERROR - ; - break;} -case 294: -#line 2813 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 294: +#line 2816 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 295: -#line 2818 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 295: +#line 2820 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 296: +#line 2825 "/Users/scottm/play/llvm-trunk/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"); - 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 296: -#line 2834 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(2) - (5)].TypeVal); + ;} + break; + + case 297: +#line 2841 "/Users/scottm/play/llvm-trunk/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 297: -#line 2851 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(2) - (5)].TypeVal); + ;} + break; + + case 298: +#line 2858 "/Users/scottm/play/llvm-trunk/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("Vector 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"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 298: -#line 2865 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(3) - (6)].TypeVal); + ;} + break; + + case 299: +#line 2872 "/Users/scottm/play/llvm-trunk/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("Vector 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"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 299: -#line 2879 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[(3) - (6)].TypeVal); + ;} + break; + + case 300: +#line 2886 "/Users/scottm/play/llvm-trunk/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 300: -#line 2891 "/Users/clamb/Documents/llvm/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 301: +#line 2898 "/Users/scottm/play/llvm-trunk/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 301: -#line 2899 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 302: +#line 2906 "/Users/scottm/play/llvm-trunk/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 302: -#line 2906 "/Users/clamb/Documents/llvm/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 303: +#line 2913 "/Users/scottm/play/llvm-trunk/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 303: -#line 2912 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + ;} + break; + + case 304: +#line 2919 "/Users/scottm/play/llvm-trunk/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 304: -#line 2918 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) + ;} + break; + + case 305: +#line 2925 "/Users/scottm/play/llvm-trunk/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 305: -#line 2924 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const Type *Ty = yyvsp[0].PHIList->front().first->getType(); + ;} + break; + + case 306: +#line 2931 "/Users/scottm/play/llvm-trunk/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 306: -#line 2940 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 307: +#line 2947 "/Users/scottm/play/llvm-trunk/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; - ParamList::iterator I = yyvsp[-2].ParamList->begin(), E = yyvsp[-2].ParamList->end(); + ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end(); for (; I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); } - Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false); + Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false); PFTy = PointerType::getUnqual(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 for call to invalid intrinsic to avoid crashing later. @@ -5025,15 +6149,15 @@ // Set up the ParamAttrs for the function ParamAttrsVector Attrs; - if (yyvsp[0].ParamAttrs != ParamAttr::None) { + if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) { ParamAttrsWithIndex PAWI; PAWI.index = 0; - PAWI.attrs = yyvsp[0].ParamAttrs; + PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs); Attrs.push_back(PAWI); } // Check the arguments ValueList Args; - if (yyvsp[-2].ParamList->empty()) { // Has no arguments? + if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5043,7 +6167,7 @@ // correctly. Also, gather any parameter attributes. FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ParamList::iterator ArgI = yyvsp[-2].ParamList->begin(), ArgE = yyvsp[-2].ParamList->end(); + ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end(); unsigned index = 1; for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) { @@ -5060,8 +6184,15 @@ } if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI) + for (; ArgI != ArgE; ++ArgI, ++index) { Args.push_back(ArgI->Val); // push the remaining varargs + if (ArgI->Attrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; + PAWI.index = index; + PAWI.attrs = ArgI->Attrs; + Attrs.push_back(PAWI); + } + } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } @@ -5073,366 +6204,372 @@ // Create the call node CallInst *CI = new CallInst(V, Args.begin(), Args.end()); - CI->setTailCall(yyvsp[-7].BoolVal); - CI->setCallingConv(yyvsp[-6].UIntVal); + CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); + CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); CI->setParamAttrs(PAL); - yyval.InstVal = CI; - delete yyvsp[-2].ParamList; - delete yyvsp[-5].TypeVal; - CHECK_FOR_ERROR - ; - break;} -case 307: -#line 3030 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = yyvsp[0].InstVal; + (yyval.InstVal) = CI; + delete (yyvsp[(6) - (8)].ParamList); + delete (yyvsp[(3) - (8)].TypeVal); CHECK_FOR_ERROR - ; - break;} -case 308: -#line 3035 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; + ;} + break; + + case 308: +#line 3044 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); CHECK_FOR_ERROR - ; - break;} -case 309: -#line 3039 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; + ;} + break; + + case 309: +#line 3049 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; CHECK_FOR_ERROR - ; - break;} -case 310: -#line 3046 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 310: +#line 3053 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 311: +#line 3060 "/Users/scottm/play/llvm-trunk/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 311: -#line 3053 "/Users/clamb/Documents/llvm/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 312: +#line 3067 "/Users/scottm/play/llvm-trunk/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 312: -#line 3061 "/Users/clamb/Documents/llvm/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 313: +#line 3075 "/Users/scottm/play/llvm-trunk/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 313: -#line 3068 "/Users/clamb/Documents/llvm/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 314: +#line 3082 "/Users/scottm/play/llvm-trunk/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 314: -#line 3076 "/Users/clamb/Documents/llvm/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 315: +#line 3090 "/Users/scottm/play/llvm-trunk/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 315: -#line 3084 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + ;} + break; + + case 316: +#line 3098 "/Users/scottm/play/llvm-trunk/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[(3) - (5)].TypeVal))->getDescription()); + if (!isa((yyvsp[(3) - (5)].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*yyvsp[-2].TypeVal)->getDescription()); - if (!cast(yyvsp[-2].TypeVal->get())->getElementType()->isFirstClassType()) + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + if (!cast((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*yyvsp[-2].TypeVal)->getDescription()); - Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); + Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-4].BoolVal, yyvsp[0].UIntVal); - delete yyvsp[-2].TypeVal; - ; - break;} -case 316: -#line 3098 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal)); + delete (yyvsp[(3) - (5)].TypeVal); + ;} + break; + + case 317: +#line 3112 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); - const PointerType *PT = dyn_cast(yyvsp[-2].TypeVal->get()); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); + const PointerType *PT = dyn_cast((yyvsp[(5) - (7)].TypeVal)->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*yyvsp[-2].TypeVal)->getDescription()); + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != yyvsp[-4].ValueVal->getType()) - GEN_ERROR("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() + + if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); + Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal)); CHECK_FOR_ERROR - yyval.InstVal = new StoreInst(yyvsp[-4].ValueVal, tmpVal, yyvsp[-6].BoolVal, yyvsp[0].UIntVal); - delete yyvsp[-2].TypeVal; - ; - break;} -case 317: -#line 3115 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); + delete (yyvsp[(5) - (7)].TypeVal); + ;} + break; + + case 318: +#line 3129 "/Users/scottm/play/llvm-trunk/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->begin(), yyvsp[0].ValueList->end(), true)) + if (!GetElementPtrInst::getIndexedType(*(yyvsp[(2) - (4)].TypeVal), (yyvsp[(4) - (4)].ValueList)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), 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->begin(), yyvsp[0].ValueList->end()); - 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)->begin(), (yyvsp[(4) - (4)].ValueList)->end()); + 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 6359 "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 3132 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + + +#line 3146 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -5507,3 +6644,4 @@ GenerateError(errMsg); return 0; } + Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Tue Jan 29 20:55:46 2008 @@ -342,7 +342,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 947 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" +#line 947 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -389,7 +389,7 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } -/* Line 1529 of yacc.c. */ +/* Line 1489 of yacc.c. */ #line 394 "llvmAsmParser.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Tue Jan 29 20:55:46 2008 @@ -2675,8 +2675,15 @@ if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI) + for (; ArgI != ArgE; ++ArgI, ++index) { Args.push_back(ArgI->Val); // push the remaining varargs + if (ArgI->Attrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; + PAWI.index = index; + PAWI.attrs = ArgI->Attrs; + Attrs.push_back(PAWI); + } + } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } @@ -3006,8 +3013,15 @@ } if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI) + for (; ArgI != ArgE; ++ArgI, ++index) { Args.push_back(ArgI->Val); // push the remaining varargs + if (ArgI->Attrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; + PAWI.index = index; + PAWI.attrs = ArgI->Attrs; + Attrs.push_back(PAWI); + } + } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } Modified: llvm/trunk/lib/Target/CellSPU/Makefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/Makefile?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/Makefile (original) +++ llvm/trunk/lib/Target/CellSPU/Makefile Tue Jan 29 20:55:46 2008 @@ -13,7 +13,7 @@ BUILT_SOURCES = SPUGenInstrNames.inc SPUGenRegisterNames.inc \ SPUGenAsmWriter.inc SPUGenCodeEmitter.inc \ - SPUGenRegisterInfo.h.inc SPUGenRegisterInfo.inc \ + SPUGenRegisterInfo.h.inc SPUGenRegisterInfo.inc \ SPUGenInstrInfo.inc SPUGenDAGISel.inc \ SPUGenSubtarget.inc SPUGenCallingConv.inc Modified: llvm/trunk/lib/Target/CellSPU/README.txt URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/README.txt?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/README.txt (original) +++ llvm/trunk/lib/Target/CellSPU/README.txt Tue Jan 29 20:55:46 2008 @@ -28,8 +28,8 @@ If you are brave enough to try this code or help to hack on it, be sure to add 'spu' to configure's --enable-targets option, e.g.: - ./configure \ - --enable-targets=x86,x86_64,powerpc,spu + ./configure \ + --enable-targets=x86,x86_64,powerpc,spu --------------------------------------------------------------------------- Modified: llvm/trunk/lib/Target/CellSPU/SPU.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPU.h?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPU.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPU.h Tue Jan 29 20:55:46 2008 @@ -35,7 +35,7 @@ inline bool isS10Constant(short Value) { int SExtValue = ((int) Value << (32 - 10)) >> (32 - 10); return ((Value > 0 && Value <= (1 << 9) - 1) - || (Value < 0 && (short) SExtValue == Value)); + || (Value < 0 && (short) SExtValue == Value)); } inline bool isS10Constant(int Value) { Modified: llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUAsmPrinter.cpp Tue Jan 29 20:55:46 2008 @@ -102,7 +102,7 @@ value = (value << (32 - 7)) >> (32 - 7); assert((value >= -(1 << 8) && value <= (1 << 7) - 1) - && "Invalid s7 argument"); + && "Invalid s7 argument"); O << value; } @@ -185,7 +185,7 @@ { const MachineOperand &MO = MI->getOperand(OpNo); assert(MO.isImmediate() - && "printMemRegImmS10 first operand is not immedate"); + && "printMemRegImmS10 first operand is not immedate"); printS10ImmOperand(MI, OpNo); O << "("; printOperand(MI, OpNo+1); @@ -246,7 +246,7 @@ if (MI->getOperand(OpNo).isImmediate()) { int value = (int) MI->getOperand(OpNo).getImm(); assert((value >= 0 && value < 16) - && "Invalid negated immediate rotate 7-bit argument"); + && "Invalid negated immediate rotate 7-bit argument"); O << -value; } else { assert(0 &&"Invalid/non-immediate rotate amount in printRotateNeg7Imm"); @@ -257,7 +257,7 @@ if (MI->getOperand(OpNo).isImmediate()) { int value = (int) MI->getOperand(OpNo).getImm(); assert((value >= 0 && value < 32) - && "Invalid negated immediate rotate 7-bit argument"); + && "Invalid negated immediate rotate 7-bit argument"); O << -value; } else { assert(0 &&"Invalid/non-immediate rotate amount in printRotateNeg7Imm"); @@ -385,7 +385,7 @@ } bool SPUAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, - unsigned OpNo, + unsigned OpNo, unsigned AsmVariant, const char *ExtraCode) { if (ExtraCode && ExtraCode[0]) Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Tue Jan 29 20:55:46 2008 @@ -165,26 +165,25 @@ struct valtype_map_s { MVT::ValueType VT; - unsigned ldresult_ins; /// LDRESULT instruction (0 = undefined) - int prefslot_byte; /// Byte offset of the "preferred" slot - unsigned insmask_ins; /// Insert mask instruction for a-form + unsigned ldresult_ins; /// LDRESULT instruction (0 = undefined) + int prefslot_byte; /// Byte offset of the "preferred" slot }; const valtype_map_s valtype_map[] = { - { MVT::i1, 0, 3, 0 }, - { MVT::i8, SPU::ORBIr8, 3, 0 }, - { MVT::i16, SPU::ORHIr16, 2, 0 }, - { MVT::i32, SPU::ORIr32, 0, 0 }, - { MVT::i64, SPU::ORIr64, 0, 0 }, - { MVT::f32, 0, 0, 0 }, - { MVT::f64, 0, 0, 0 }, + { MVT::i1, 0, 3 }, + { MVT::i8, SPU::ORBIr8, 3 }, + { MVT::i16, SPU::ORHIr16, 2 }, + { MVT::i32, SPU::ORIr32, 0 }, + { MVT::i64, SPU::ORIr64, 0 }, + { MVT::f32, 0, 0 }, + { MVT::f64, 0, 0 }, // vector types... (sigh!) - { MVT::v16i8, 0, 0, SPU::CBD }, - { MVT::v8i16, 0, 0, SPU::CHD }, - { MVT::v4i32, 0, 0, SPU::CWD }, - { MVT::v2i64, 0, 0, 0 }, - { MVT::v4f32, 0, 0, SPU::CWD }, - { MVT::v2f64, 0, 0, 0 } + { MVT::v16i8, 0, 0 }, + { MVT::v8i16, 0, 0 }, + { MVT::v4i32, 0, 0 }, + { MVT::v2i64, 0, 0 }, + { MVT::v4f32, 0, 0 }, + { MVT::v2f64, 0, 0 } }; const size_t n_valtype_map = sizeof(valtype_map) / sizeof(valtype_map[0]); @@ -194,8 +193,8 @@ const valtype_map_s *retval = 0; for (size_t i = 0; i < n_valtype_map; ++i) { if (valtype_map[i].VT == VT) { - retval = valtype_map + i; - break; + retval = valtype_map + i; + break; } } @@ -203,8 +202,8 @@ #ifndef NDEBUG if (retval == 0) { cerr << "SPUISelDAGToDAG.cpp: getValueTypeMapEntry returns NULL for " - << MVT::getValueTypeString(VT) - << "\n"; + << MVT::getValueTypeString(VT) + << "\n"; abort(); } #endif @@ -259,42 +258,46 @@ /// target-specific node if it hasn't already been changed. SDNode *Select(SDOperand Op); - /// Return true if the address N is a RI7 format address [r+imm] - bool SelectDForm2Addr(SDOperand Op, SDOperand N, SDOperand &Disp, - SDOperand &Base); - //! Returns true if the address N is an A-form (local store) address bool SelectAFormAddr(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Index); + SDOperand &Index); //! D-form address predicate bool SelectDFormAddr(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Index); + SDOperand &Index); + + /// Alternate D-form address using i7 offset predicate + bool SelectDForm2Addr(SDOperand Op, SDOperand N, SDOperand &Disp, + SDOperand &Base); + + /// D-form address selection workhorse + bool DFormAddressPredicate(SDOperand Op, SDOperand N, SDOperand &Disp, + SDOperand &Base, int minOffset, int maxOffset); //! Address predicate if N can be expressed as an indexed [r+r] operation. bool SelectXFormAddr(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Index); + SDOperand &Index); /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for /// inline asm expressions. virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op, - char ConstraintCode, - std::vector &OutOps, - SelectionDAG &DAG) { + char ConstraintCode, + std::vector &OutOps, + SelectionDAG &DAG) { SDOperand Op0, Op1; switch (ConstraintCode) { default: return true; case 'm': // memory if (!SelectDFormAddr(Op, Op, Op0, Op1) - && !SelectAFormAddr(Op, Op, Op0, Op1)) - SelectXFormAddr(Op, Op, Op0, Op1); + && !SelectAFormAddr(Op, Op, Op0, Op1)) + SelectXFormAddr(Op, Op, Op0, Op1); break; case 'o': // offsetable if (!SelectDFormAddr(Op, Op, Op0, Op1) - && !SelectAFormAddr(Op, Op, Op0, Op1)) { - Op0 = Op; - AddToISelQueue(Op0); // r+0. - Op1 = getSmallIPtrImm(0); + && !SelectAFormAddr(Op, Op, Op0, Op1)) { + Op0 = Op; + AddToISelQueue(Op0); // r+0. + Op1 = getSmallIPtrImm(0); } break; case 'v': // not offsetable @@ -346,52 +349,6 @@ ScheduleAndEmitDAG(DAG); } -bool -SPUDAGToDAGISel::SelectDForm2Addr(SDOperand Op, SDOperand N, SDOperand &Disp, - SDOperand &Base) { - unsigned Opc = N.getOpcode(); - unsigned VT = N.getValueType(); - MVT::ValueType PtrVT = SPUtli.getPointerTy(); - ConstantSDNode *CN = 0; - int Imm; - - if (Opc == ISD::ADD) { - SDOperand Op0 = N.getOperand(0); - SDOperand Op1 = N.getOperand(1); - if (Op1.getOpcode() == ISD::Constant || - Op1.getOpcode() == ISD::TargetConstant) { - CN = cast(Op1); - Imm = int(CN->getValue()); - if (Imm <= 0xff) { - Disp = CurDAG->getTargetConstant(Imm, SPUtli.getPointerTy()); - Base = Op0; - return true; - } - } - } else if (Opc == ISD::GlobalAddress - || Opc == ISD::TargetGlobalAddress - || Opc == ISD::Register) { - // Plain old local store address: - Disp = CurDAG->getTargetConstant(0, VT); - Base = N; - return true; - } else if (Opc == SPUISD::IndirectAddr) { - SDOperand Op1 = N.getOperand(1); - if (Op1.getOpcode() == ISD::TargetConstant - || Op1.getOpcode() == ISD::Constant) { - CN = cast(N.getOperand(1)); - assert(CN != 0 && "SelectIndirectAddr/SPUISD::DForm2Addr expecting constant"); - Imm = unsigned(CN->getValue()); - if (Imm < 0xff) { - Disp = CurDAG->getTargetConstant(CN->getValue(), PtrVT); - Base = N.getOperand(0); - return true; - } - } - } - return false; -} - /*! \arg Op The ISD instructio operand \arg N The address to be tested @@ -400,7 +357,7 @@ */ bool SPUDAGToDAGISel::SelectAFormAddr(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Index) { + SDOperand &Index) { // These match the addr256k operand type: MVT::ValueType OffsVT = MVT::i16; SDOperand Zero = CurDAG->getTargetConstant(0, OffsVT); @@ -450,6 +407,12 @@ return false; } +bool +SPUDAGToDAGISel::SelectDForm2Addr(SDOperand Op, SDOperand N, SDOperand &Disp, + SDOperand &Base) { + return DFormAddressPredicate(Op, N, Disp, Base, -(1 << 7), (1 << 7) - 1); +} + /*! \arg Op The ISD instruction (ignored) \arg N The address to be tested @@ -464,7 +427,16 @@ */ bool SPUDAGToDAGISel::SelectDFormAddr(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Index) { + SDOperand &Index) { + return DFormAddressPredicate(Op, N, Base, Index, + SPUFrameInfo::minFrameOffset(), + SPUFrameInfo::maxFrameOffset()); +} + +bool +SPUDAGToDAGISel::DFormAddressPredicate(SDOperand Op, SDOperand N, SDOperand &Base, + SDOperand &Index, int minOffset, + int maxOffset) { unsigned Opc = N.getOpcode(); unsigned PtrTy = SPUtli.getPointerTy(); @@ -472,8 +444,8 @@ // Stack frame index must be less than 512 (divided by 16): FrameIndexSDNode *FI = dyn_cast(N); DEBUG(cerr << "SelectDFormAddr: ISD::FrameIndex = " - << FI->getIndex() << "\n"); - if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { + << FI->getIndex() << "\n"); + if (FI->getIndex() < maxOffset) { Base = CurDAG->getTargetConstant(0, PtrTy); Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); return true; @@ -498,13 +470,12 @@ DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset << " frame index = " << FI->getIndex() << "\n"); - if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { + if (FI->getIndex() < maxOffset) { Base = CurDAG->getTargetConstant(offset, PtrTy); Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); return true; } - } else if (offset > SPUFrameInfo::minFrameOffset() - && offset < SPUFrameInfo::maxFrameOffset()) { + } else if (offset > minOffset && offset < maxOffset) { Base = CurDAG->getTargetConstant(offset, PtrTy); Index = Op0; return true; @@ -519,13 +490,12 @@ DEBUG(cerr << "SelectDFormAddr: ISD::ADD offset = " << offset << " frame index = " << FI->getIndex() << "\n"); - if (FI->getIndex() < SPUFrameInfo::maxFrameOffset()) { + if (FI->getIndex() < maxOffset) { Base = CurDAG->getTargetConstant(offset, PtrTy); Index = CurDAG->getTargetFrameIndex(FI->getIndex(), PtrTy); return true; } - } else if (offset > SPUFrameInfo::minFrameOffset() - && offset < SPUFrameInfo::maxFrameOffset()) { + } else if (offset > minOffset && offset < maxOffset) { Base = CurDAG->getTargetConstant(offset, PtrTy); Index = Op1; return true; @@ -535,39 +505,41 @@ // Indirect with constant offset -> D-Form address const SDOperand Op0 = N.getOperand(0); const SDOperand Op1 = N.getOperand(1); - SDOperand Zero = CurDAG->getTargetConstant(0, N.getValueType()); - if (Op1.getOpcode() == ISD::Constant - || Op1.getOpcode() == ISD::TargetConstant) { - ConstantSDNode *CN = cast(Op1); - int32_t offset = int32_t(CN->getSignExtended()); - if (offset > SPUFrameInfo::minFrameOffset() - && offset < SPUFrameInfo::maxFrameOffset()) { - Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); - Index = Op0; - return true; - } - } else if (Op0.getOpcode() == ISD::Constant - || Op0.getOpcode() == ISD::TargetConstant) { - ConstantSDNode *CN = cast(Op0); - int32_t offset = int32_t(CN->getSignExtended()); - if (offset > SPUFrameInfo::minFrameOffset() - && offset < SPUFrameInfo::maxFrameOffset()) { - Base = CurDAG->getTargetConstant(CN->getValue(), PtrTy); - Index = Op1; - return true; - } - } else if (Op0.getOpcode() == SPUISD::Hi - && Op1.getOpcode() == SPUISD::Lo) { + if (Op0.getOpcode() == SPUISD::Hi + && Op1.getOpcode() == SPUISD::Lo) { // (SPUindirect (SPUhi , 0), (SPUlo , 0)) Base = CurDAG->getTargetConstant(0, PtrTy); Index = N; return true; + } else if (isa(Op0) || isa(Op1)) { + int32_t offset = 0; + SDOperand idxOp; + + if (isa(Op1)) { + ConstantSDNode *CN = cast(Op1); + offset = int32_t(CN->getSignExtended()); + idxOp = Op0; + } else if (isa(Op0)) { + ConstantSDNode *CN = cast(Op0); + offset = int32_t(CN->getSignExtended()); + idxOp = Op1; + } + + if (offset >= minOffset && offset <= maxOffset) { + Base = CurDAG->getTargetConstant(offset, PtrTy); + Index = idxOp; + return true; + } } } else if (Opc == SPUISD::AFormAddr) { Base = CurDAG->getTargetConstant(0, N.getValueType()); Index = N; return true; + } else if (Opc == SPUISD::LDRESULT) { + Base = CurDAG->getTargetConstant(0, N.getValueType()); + Index = N; + return true; } return false; } @@ -584,7 +556,7 @@ */ bool SPUDAGToDAGISel::SelectXFormAddr(SDOperand Op, SDOperand N, SDOperand &Base, - SDOperand &Index) { + SDOperand &Index) { if (SelectAFormAddr(Op, N, Base, Index) || SelectDFormAddr(Op, N, Base, Index)) return false; @@ -637,38 +609,6 @@ n_ops = 2; } } - } else if (Opc == SPUISD::INSERT_MASK) { - SDOperand Op0 = Op.getOperand(0); - if (Op0.getOpcode() == SPUISD::AFormAddr) { - // (SPUvecinsmask (SPUaform , 0)) -> - // (CBD|CHD|CWD 0, arg) - const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); - ConstantSDNode *CN = cast(Op0.getOperand(1)); - assert(vtm->insmask_ins != 0 && "missing insert mask instruction"); - NewOpc = vtm->insmask_ins; - Ops[0] = CurDAG->getTargetConstant(CN->getValue(), Op0.getValueType()); - Ops[1] = Op0; - n_ops = 2; - - AddToISelQueue(Op0); - } else if (Op0.getOpcode() == ISD::FrameIndex) { - // (SPUvecinsmask ) -> - // (CBD|CHD|CWD 0, ) - const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); - NewOpc = vtm->insmask_ins; - Ops[0] = CurDAG->getTargetConstant(0, Op0.getValueType()); - Ops[1] = Op0; - n_ops = 2; - } else if (isHighLow(Op0)) { - // (SPUvecinsmask (SPUindirect (SPUhi , 0), (SPUlow , 0))) -> - // (CBD|CHD|CWD 0, arg) - const valtype_map_s *vtm = getValueTypeMapEntry(OpVT); - NewOpc = vtm->insmask_ins; - Ops[0] = CurDAG->getTargetConstant(0, Op0.getValueType()); - Ops[1] = Op0; - n_ops = 2; - AddToISelQueue(Op0); - } } else if (Opc == SPUISD::LDRESULT) { // Custom select instructions for LDRESULT unsigned VT = N->getValueType(0); @@ -682,12 +622,12 @@ const valtype_map_s *vtm = getValueTypeMapEntry(VT); if (vtm->ldresult_ins == 0) { - cerr << "LDRESULT for unsupported type: " - << MVT::getValueTypeString(VT) - << "\n"; - abort(); + cerr << "LDRESULT for unsupported type: " + << MVT::getValueTypeString(VT) + << "\n"; + abort(); } else - Opc = vtm->ldresult_ins; + Opc = vtm->ldresult_ins; AddToISelQueue(Zero); Result = CurDAG->getTargetNode(Opc, VT, MVT::Other, Arg, Zero, Chain); @@ -702,17 +642,13 @@ return Result; } else if (Opc == SPUISD::IndirectAddr) { SDOperand Op0 = Op.getOperand(0); - if (Op0.getOpcode() == SPUISD::LDRESULT - || Op0.getOpcode() == SPUISD::AFormAddr) { - // (IndirectAddr (LDRESULT|AFormAddr, imm)) + if (Op0.getOpcode() == SPUISD::LDRESULT) { + /* || Op0.getOpcode() == SPUISD::AFormAddr) */ + // (IndirectAddr (LDRESULT, imm)) SDOperand Op1 = Op.getOperand(1); MVT::ValueType VT = Op.getValueType(); - DEBUG(cerr << "CellSPU: IndirectAddr(" - << (Op0.getOpcode() == SPUISD::LDRESULT - ? "LDRESULT" - : "AFormAddr") - << ", imm):\nOp0 = "); + DEBUG(cerr << "CellSPU: IndirectAddr(LDRESULT, imm):\nOp0 = "); DEBUG(Op.getOperand(0).Val->dump(CurDAG)); DEBUG(cerr << "\nOp1 = "); DEBUG(Op.getOperand(1).Val->dump(CurDAG)); @@ -721,13 +657,13 @@ if (Op1.getOpcode() == ISD::Constant) { ConstantSDNode *CN = cast(Op1); Op1 = CurDAG->getTargetConstant(CN->getValue(), VT); + NewOpc = (isI32IntS10Immediate(CN) ? SPU::AIr32 : SPU::Ar32); + AddToISelQueue(Op0); + AddToISelQueue(Op1); + Ops[0] = Op0; + Ops[1] = Op1; + n_ops = 2; } - AddToISelQueue(Op0); - AddToISelQueue(Op1); - NewOpc = SPU::AIr32; - Ops[0] = Op0; - Ops[1] = Op1; - n_ops = 2; } } Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Tue Jan 29 20:55:46 2008 @@ -39,8 +39,8 @@ //! MVT::ValueType mapping to useful data for Cell SPU struct valtype_map_s { - const MVT::ValueType valtype; - const int prefslot_byte; + const MVT::ValueType valtype; + const int prefslot_byte; }; const valtype_map_s valtype_map[] = { @@ -61,16 +61,16 @@ for (size_t i = 0; i < n_valtype_map; ++i) { if (valtype_map[i].valtype == VT) { - retval = valtype_map + i; - break; + retval = valtype_map + i; + break; } } #ifndef NDEBUG if (retval == 0) { cerr << "getValueTypeMapEntry returns NULL for " - << MVT::getValueTypeString(VT) - << "\n"; + << MVT::getValueTypeString(VT) + << "\n"; abort(); } #endif @@ -106,7 +106,7 @@ { const unsigned Opc = Op.getOpcode(); return (Opc == ISD::Register - || Opc == SPUISD::LDRESULT); + || Opc == SPUISD::LDRESULT); } } @@ -508,7 +508,7 @@ if (!isMemoryOperand(basePtr) || (alignOffs & ~0xf) != 0) { basePtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, - DAG.getConstant((alignOffs & ~0xf), PtrVT)); + DAG.getConstant((alignOffs & ~0xf), PtrVT)); } // Emit the vector load: @@ -526,7 +526,7 @@ // Add the offset basePtr = DAG.getNode(ISD::ADD, PtrVT, basePtr, - DAG.getConstant((alignOffs & ~0xf), PtrVT)); + DAG.getConstant((alignOffs & ~0xf), PtrVT)); was16aligned = false; return DAG.getLoad(MVT::v16i8, chain, basePtr, LSN->getSrcValue(), LSN->getSrcValueOffset(), @@ -570,10 +570,10 @@ if (was16aligned) { Ops[2] = DAG.getConstant(rotamt, MVT::i16); } else { - MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); + MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); LoadSDNode *LN1 = cast(result); Ops[2] = DAG.getNode(ISD::ADD, PtrVT, LN1->getBasePtr(), - DAG.getConstant(rotamt, PtrVT)); + DAG.getConstant(rotamt, PtrVT)); } result = DAG.getNode(SPUISD::ROTBYTES_LEFT_CHAINED, vecvts, Ops, 3); @@ -616,10 +616,9 @@ } SDVTList retvts = DAG.getVTList(OpVT, MVT::Other); - SDOperand retops[3] = { + SDOperand retops[2] = { result, - the_chain, - DAG.getConstant(alignment, MVT::i32) + the_chain }; result = DAG.getNode(SPUISD::LDRESULT, retvts, @@ -683,8 +682,8 @@ SDOperand result; if (StVT != VT - && (theValue.getOpcode() == ISD::AssertZext - || theValue.getOpcode() == ISD::AssertSext)) { + && (theValue.getOpcode() == ISD::AssertZext + || theValue.getOpcode() == ISD::AssertSext)) { // Drill down and get the value for zero- and sign-extended // quantities theValue = theValue.getOperand(0); @@ -722,9 +721,9 @@ insertEltOp = DAG.getNode(SPUISD::INSERT_MASK, stVecVT, insertEltPtr); result = DAG.getNode(SPUISD::SHUFB, vecVT, - DAG.getNode(ISD::SCALAR_TO_VECTOR, vecVT, theValue), - alignLoadVec, - DAG.getNode(ISD::BIT_CONVERT, vecVT, insertEltOp)); + DAG.getNode(ISD::SCALAR_TO_VECTOR, vecVT, theValue), + alignLoadVec, + DAG.getNode(ISD::BIT_CONVERT, vecVT, insertEltOp)); result = DAG.getStore(the_chain, result, basePtr, LN->getSrcValue(), LN->getSrcValueOffset(), @@ -818,7 +817,7 @@ } } else { cerr << "LowerGlobalAddress: Relocation model other than static not " - << "supported.\n"; + << "supported.\n"; abort(); /*NOTREACHED*/ } @@ -839,12 +838,12 @@ if (VT == MVT::i64) { SDOperand T = DAG.getConstant(CN->getValue(), MVT::i64); return DAG.getNode(SPUISD::EXTRACT_ELT0, VT, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i64, T, T)); + DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i64, T, T)); } else { cerr << "LowerConstant: unhandled constant type " - << MVT::getValueTypeString(VT) - << "\n"; + << MVT::getValueTypeString(VT) + << "\n"; abort(); /*NOTREACHED*/ } @@ -864,16 +863,16 @@ ConstantFPSDNode *FP = cast(Op.Val); assert((FP != 0) && - "LowerConstantFP: Node is not ConstantFPSDNode"); + "LowerConstantFP: Node is not ConstantFPSDNode"); if (VT == MVT::f32) { float targetConst = FP->getValueAPF().convertToFloat(); return DAG.getNode(SPUISD::SFPConstant, VT, - DAG.getTargetConstantFP(targetConst, VT)); + DAG.getTargetConstantFP(targetConst, VT)); } else if (VT == MVT::f64) { uint64_t dbits = DoubleToBits(FP->getValueAPF().convertToDouble()); return DAG.getNode(ISD::BIT_CONVERT, VT, - LowerConstant(DAG.getConstant(dbits, MVT::i64), DAG)); + LowerConstant(DAG.getConstant(dbits, MVT::i64), DAG)); } return SDOperand(); @@ -926,7 +925,7 @@ switch (ObjectVT) { default: { cerr << "LowerFORMAL_ARGUMENTS Unhandled argument type: " - << MVT::getValueTypeString(ObjectVT) + << MVT::getValueTypeString(ObjectVT) << "\n"; abort(); } @@ -1126,7 +1125,7 @@ RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg)); } else { MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0)); - ArgOffset += StackSlotSize; + ArgOffset += StackSlotSize; } break; case MVT::f32: @@ -1135,7 +1134,7 @@ RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg)); } else { MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0)); - ArgOffset += StackSlotSize; + ArgOffset += StackSlotSize; } break; case MVT::v4f32: @@ -1146,7 +1145,7 @@ RegsToPass.push_back(std::make_pair(ArgRegs[ArgRegIdx++], Arg)); } else { MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0)); - ArgOffset += StackSlotSize; + ArgOffset += StackSlotSize; } break; } @@ -1378,19 +1377,19 @@ int SExtValue = ((Value & 0xffff) << 16) >> 16; if (Value == SExtValue) - return DAG.getConstant(Value, ValueType); + return DAG.getConstant(Value, ValueType); } else if (ValueType == MVT::i16) { short Value = (short) CN->getValue(); int SExtValue = ((int) Value << 16) >> 16; if (Value == (short) SExtValue) - return DAG.getConstant(Value, ValueType); + return DAG.getConstant(Value, ValueType); } else if (ValueType == MVT::i64) { int64_t Value = CN->getValue(); int64_t SExtValue = ((Value & 0xffff) << (64 - 16)) >> (64 - 16); if (Value == SExtValue) - return DAG.getConstant(Value, ValueType); + return DAG.getConstant(Value, ValueType); } } @@ -1405,7 +1404,7 @@ if (ConstantSDNode *CN = getVecImm(N)) { int Value = (int) CN->getValue(); if ((ValueType == MVT::i32 && isS10Constant(Value)) - || (ValueType == MVT::i16 && isS10Constant((short) Value))) + || (ValueType == MVT::i16 && isS10Constant((short) Value))) return DAG.getConstant(Value, ValueType); } @@ -1424,11 +1423,11 @@ if (ConstantSDNode *CN = getVecImm(N)) { int Value = (int) CN->getValue(); if (ValueType == MVT::i16 - && Value <= 0xffff /* truncated from uint64_t */ - && ((short) Value >> 8) == ((short) Value & 0xff)) + && Value <= 0xffff /* truncated from uint64_t */ + && ((short) Value >> 8) == ((short) Value & 0xff)) return DAG.getConstant(Value & 0xff, ValueType); else if (ValueType == MVT::i8 - && (Value & 0xff) == Value) + && (Value & 0xff) == Value) return DAG.getConstant(Value, ValueType); } @@ -1443,8 +1442,8 @@ if (ConstantSDNode *CN = getVecImm(N)) { uint64_t Value = CN->getValue(); if ((ValueType == MVT::i32 - && ((unsigned) Value & 0xffff0000) == (unsigned) Value) - || (ValueType == MVT::i64 && (Value & 0xffff0000) == Value)) + && ((unsigned) Value & 0xffff0000) == (unsigned) Value) + || (ValueType == MVT::i64 && (Value & 0xffff0000) == Value)) return DAG.getConstant(Value >> 16, ValueType); } @@ -1496,8 +1495,8 @@ } else if (ConstantFPSDNode *CN = dyn_cast(OpVal)) { const APFloat &apf = CN->getValueAPF(); EltBits = (CN->getValueType(0) == MVT::f32 - ? FloatToBits(apf.convertToFloat()) - : DoubleToBits(apf.convertToDouble())); + ? FloatToBits(apf.convertToFloat()) + : DoubleToBits(apf.convertToDouble())); } else { // Nonconstant element. return true; @@ -1517,7 +1516,7 @@ /// SplatSize = 1 byte. static bool isConstantSplat(const uint64_t Bits128[2], const uint64_t Undef128[2], - int MinSplatBits, + int MinSplatBits, uint64_t &SplatBits, uint64_t &SplatUndef, int &SplatSize) { // Don't let undefs prevent splats from matching. See if the top 64-bits are @@ -1535,34 +1534,34 @@ // Check that the top 32-bits are the same as the lower 32-bits, ignoring // undefs. if ((Bits64 & (~Undef64 >> 32)) == ((Bits64 >> 32) & ~Undef64)) { - if (MinSplatBits < 32) { + if (MinSplatBits < 32) { - // If the top 16-bits are different than the lower 16-bits, ignoring - // undefs, we have an i32 splat. - if ((Bits32 & (~Undef32 >> 16)) == ((Bits32 >> 16) & ~Undef32)) { - if (MinSplatBits < 16) { - // If the top 8-bits are different than the lower 8-bits, ignoring - // undefs, we have an i16 splat. - if ((Bits16 & (uint16_t(~Undef16) >> 8)) == ((Bits16 >> 8) & ~Undef16)) { - // Otherwise, we have an 8-bit splat. - SplatBits = uint8_t(Bits16) | uint8_t(Bits16 >> 8); - SplatUndef = uint8_t(Undef16) & uint8_t(Undef16 >> 8); - SplatSize = 1; - return true; - } - } else { - SplatBits = Bits16; - SplatUndef = Undef16; - SplatSize = 2; - return true; - } - } - } else { - SplatBits = Bits32; - SplatUndef = Undef32; - SplatSize = 4; - return true; - } + // If the top 16-bits are different than the lower 16-bits, ignoring + // undefs, we have an i32 splat. + if ((Bits32 & (~Undef32 >> 16)) == ((Bits32 >> 16) & ~Undef32)) { + if (MinSplatBits < 16) { + // If the top 8-bits are different than the lower 8-bits, ignoring + // undefs, we have an i16 splat. + if ((Bits16 & (uint16_t(~Undef16) >> 8)) == ((Bits16 >> 8) & ~Undef16)) { + // Otherwise, we have an 8-bit splat. + SplatBits = uint8_t(Bits16) | uint8_t(Bits16 >> 8); + SplatUndef = uint8_t(Undef16) & uint8_t(Undef16 >> 8); + SplatSize = 1; + return true; + } + } else { + SplatBits = Bits16; + SplatUndef = Undef16; + SplatSize = 2; + return true; + } + } + } else { + SplatBits = Bits32; + SplatUndef = Undef32; + SplatSize = 4; + return true; + } } } else { SplatBits = Bits128[0]; @@ -1592,7 +1591,7 @@ int SplatSize; if (GetConstantBuildVectorBits(Op.Val, VectorBits, UndefBits) || !isConstantSplat(VectorBits, UndefBits, - MVT::getSizeInBits(MVT::getVectorElementType(VT)), + MVT::getSizeInBits(MVT::getVectorElementType(VT)), SplatBits, SplatUndef, SplatSize)) return SDOperand(); // Not a constant vector, not a splat. @@ -1601,21 +1600,21 @@ case MVT::v4f32: { uint32_t Value32 = SplatBits; assert(SplatSize == 4 - && "LowerBUILD_VECTOR: Unexpected floating point vector element."); + && "LowerBUILD_VECTOR: Unexpected floating point vector element."); // NOTE: pretend the constant is an integer. LLVM won't load FP constants SDOperand T = DAG.getConstant(Value32, MVT::i32); return DAG.getNode(ISD::BIT_CONVERT, MVT::v4f32, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, T, T, T, T)); + DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, T, T, T, T)); break; } case MVT::v2f64: { uint64_t f64val = SplatBits; assert(SplatSize == 8 - && "LowerBUILD_VECTOR: 64-bit float vector element: unexpected size."); + && "LowerBUILD_VECTOR: 64-bit float vector element: unexpected size."); // NOTE: pretend the constant is an integer. LLVM won't load FP constants SDOperand T = DAG.getConstant(f64val, MVT::i64); return DAG.getNode(ISD::BIT_CONVERT, MVT::v2f64, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i64, T, T)); + DAG.getNode(ISD::BUILD_VECTOR, MVT::v2i64, T, T)); break; } case MVT::v16i8: { @@ -1665,69 +1664,69 @@ // Create lower vector if not a special pattern if (!lower_special) { - SDOperand LO32C = DAG.getConstant(lower, MVT::i32); - LO32 = DAG.getNode(ISD::BIT_CONVERT, VT, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - LO32C, LO32C, LO32C, LO32C)); + SDOperand LO32C = DAG.getConstant(lower, MVT::i32); + LO32 = DAG.getNode(ISD::BIT_CONVERT, VT, + DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, + LO32C, LO32C, LO32C, LO32C)); } // Create upper vector if not a special pattern if (!upper_special) { - SDOperand HI32C = DAG.getConstant(upper, MVT::i32); - HI32 = DAG.getNode(ISD::BIT_CONVERT, VT, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - HI32C, HI32C, HI32C, HI32C)); + SDOperand HI32C = DAG.getConstant(upper, MVT::i32); + HI32 = DAG.getNode(ISD::BIT_CONVERT, VT, + DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, + HI32C, HI32C, HI32C, HI32C)); } // If either upper or lower are special, then the two input operands are // the same (basically, one of them is a "don't care") if (lower_special) - LO32 = HI32; + LO32 = HI32; if (upper_special) - HI32 = LO32; + HI32 = LO32; if (lower_special && upper_special) { - // Unhappy situation... both upper and lower are special, so punt with - // a target constant: + // Unhappy situation... both upper and lower are special, so punt with + // a target constant: SDOperand Zero = DAG.getConstant(0, MVT::i32); - HI32 = LO32 = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, Zero, Zero, + HI32 = LO32 = DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, Zero, Zero, Zero, Zero); } for (int i = 0; i < 4; ++i) { - for (int j = 0; j < 4; ++j) { - SDOperand V; - bool process_upper, process_lower; - uint64_t val = 0; - - process_upper = (upper_special && (i & 1) == 0); - process_lower = (lower_special && (i & 1) == 1); - - if (process_upper || process_lower) { - if ((process_upper && upper == 0) - || (process_lower && lower == 0)) - val = 0x80; - else if ((process_upper && upper == 0xffffffff) - || (process_lower && lower == 0xffffffff)) - val = 0xc0; - else if ((process_upper && upper == 0x80000000) - || (process_lower && lower == 0x80000000)) - val = (j == 0 ? 0xe0 : 0x80); - } else - val = i * 4 + j + ((i & 1) * 16); + for (int j = 0; j < 4; ++j) { + SDOperand V; + bool process_upper, process_lower; + uint64_t val = 0; + + process_upper = (upper_special && (i & 1) == 0); + process_lower = (lower_special && (i & 1) == 1); + + if (process_upper || process_lower) { + if ((process_upper && upper == 0) + || (process_lower && lower == 0)) + val = 0x80; + else if ((process_upper && upper == 0xffffffff) + || (process_lower && lower == 0xffffffff)) + val = 0xc0; + else if ((process_upper && upper == 0x80000000) + || (process_lower && lower == 0x80000000)) + val = (j == 0 ? 0xe0 : 0x80); + } else + val = i * 4 + j + ((i & 1) * 16); - ShufBytes.push_back(DAG.getConstant(val, MVT::i8)); - } + ShufBytes.push_back(DAG.getConstant(val, MVT::i8)); + } } return DAG.getNode(SPUISD::SHUFB, VT, HI32, LO32, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, - &ShufBytes[0], ShufBytes.size())); + DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, + &ShufBytes[0], ShufBytes.size())); } else { // For zero, this can be lowered efficiently via v4i32 BUILD_VECTOR SDOperand Zero = DAG.getConstant(0, MVT::i32); return DAG.getNode(ISD::BIT_CONVERT, VT, - DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - Zero, Zero, Zero, Zero)); + DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, + Zero, Zero, Zero, Zero)); } } } @@ -1804,8 +1803,8 @@ // Copy register's contents as index in INSERT_MASK: SDOperand ShufMaskOp = DAG.getNode(SPUISD::INSERT_MASK, V1.getValueType(), - DAG.getTargetConstant(V2Elt, MVT::i32), - DAG.getCopyFromReg(InitTempReg, VReg, PtrVT)); + DAG.getTargetConstant(V2Elt, MVT::i32), + DAG.getCopyFromReg(InitTempReg, VReg, PtrVT)); // Use shuffle mask in SHUFB synthetic instruction: return DAG.getNode(SPUISD::SHUFB, V1.getValueType(), V2, V1, ShufMaskOp); } else { @@ -1816,24 +1815,24 @@ for (unsigned i = 0, e = PermMask.getNumOperands(); i != e; ++i) { unsigned SrcElt; if (PermMask.getOperand(i).getOpcode() == ISD::UNDEF) - SrcElt = 0; + SrcElt = 0; else - SrcElt = cast(PermMask.getOperand(i))->getValue(); + SrcElt = cast(PermMask.getOperand(i))->getValue(); for (unsigned j = 0; j != BytesPerElement; ++j) { - ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j, - MVT::i8)); + ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j, + MVT::i8)); } } SDOperand VPermMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, - &ResultMask[0], ResultMask.size()); + &ResultMask[0], ResultMask.size()); return DAG.getNode(SPUISD::SHUFB, V1.getValueType(), V1, V2, VPermMask); } } static SDOperand LowerSCALAR_TO_VECTOR(SDOperand Op, SelectionDAG &DAG) { - SDOperand Op0 = Op.getOperand(0); // Op0 = the scalar + SDOperand Op0 = Op.getOperand(0); // Op0 = the scalar if (Op0.Val->getOpcode() == ISD::Constant) { // For a constant, build the appropriate constant vector, which will @@ -1847,7 +1846,7 @@ // Create a constant vector: switch (Op.getValueType()) { default: assert(0 && "Unexpected constant value type in " - "LowerSCALAR_TO_VECTOR"); + "LowerSCALAR_TO_VECTOR"); case MVT::v16i8: n_copies = 16; VT = MVT::i8; break; case MVT::v8i16: n_copies = 8; VT = MVT::i16; break; case MVT::v4i32: n_copies = 4; VT = MVT::i32; break; @@ -1861,7 +1860,7 @@ ConstVecValues.push_back(CValue); return DAG.getNode(ISD::BUILD_VECTOR, Op.getValueType(), - &ConstVecValues[0], ConstVecValues.size()); + &ConstVecValues[0], ConstVecValues.size()); } else { // Otherwise, copy the value from one register to another: switch (Op0.getValueType()) { @@ -1912,24 +1911,24 @@ SDOperand FSMBOp = DAG.getCopyToReg(Chain, FSMBIreg, - DAG.getNode(SPUISD::FSMBI, MVT::v8i16, - DAG.getConstant(0xcccc, MVT::i32))); + DAG.getNode(SPUISD::FSMBI, MVT::v8i16, + DAG.getConstant(0xcccc, MVT::i32))); SDOperand HHProd = DAG.getCopyToReg(FSMBOp, HiProdReg, - DAG.getNode(SPUISD::MPYHH, MVT::v8i16, rA, rB)); + DAG.getNode(SPUISD::MPYHH, MVT::v8i16, rA, rB)); SDOperand HHProd_v4i32 = DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, - DAG.getCopyFromReg(HHProd, HiProdReg, MVT::v4i32)); + DAG.getCopyFromReg(HHProd, HiProdReg, MVT::v4i32)); return DAG.getNode(SPUISD::SELB, MVT::v8i16, - DAG.getNode(SPUISD::MPY, MVT::v8i16, rA, rB), - DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), - DAG.getNode(SPUISD::VEC_SHL, MVT::v4i32, - HHProd_v4i32, - DAG.getConstant(16, MVT::i16))), - DAG.getCopyFromReg(FSMBOp, FSMBIreg, MVT::v4i32)); + DAG.getNode(SPUISD::MPY, MVT::v8i16, rA, rB), + DAG.getNode(ISD::BIT_CONVERT, Op.getValueType(), + DAG.getNode(SPUISD::VEC_SHL, MVT::v4i32, + HHProd_v4i32, + DAG.getConstant(16, MVT::i16))), + DAG.getCopyFromReg(FSMBOp, FSMBIreg, MVT::v4i32)); } // This M00sE is N at stI! (apologies to Monty Python) @@ -1952,8 +1951,8 @@ SDOperand LLProd = DAG.getNode(SPUISD::MPY, MVT::v8i16, - DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rA), - DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rB)); + DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rA), + DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rB)); SDOperand rALH = DAG.getNode(SPUISD::VEC_SRA, MVT::v8i16, rA, c8); @@ -1961,70 +1960,70 @@ SDOperand LHProd = DAG.getNode(SPUISD::VEC_SHL, MVT::v8i16, - DAG.getNode(SPUISD::MPY, MVT::v8i16, rALH, rBLH), c8); + DAG.getNode(SPUISD::MPY, MVT::v8i16, rALH, rBLH), c8); SDOperand FSMBdef_2222 = DAG.getCopyToReg(Chain, FSMBreg_2222, - DAG.getNode(SPUISD::FSMBI, MVT::v8i16, - DAG.getConstant(0x2222, MVT::i32))); + DAG.getNode(SPUISD::FSMBI, MVT::v8i16, + DAG.getConstant(0x2222, MVT::i32))); SDOperand FSMBuse_2222 = DAG.getCopyFromReg(FSMBdef_2222, FSMBreg_2222, MVT::v4i32); SDOperand LoProd_1 = DAG.getCopyToReg(Chain, LoProd_reg, - DAG.getNode(SPUISD::SELB, MVT::v8i16, LLProd, LHProd, - FSMBuse_2222)); + DAG.getNode(SPUISD::SELB, MVT::v8i16, LLProd, LHProd, + FSMBuse_2222)); SDOperand LoProdMask = DAG.getConstant(0xffff, MVT::i32); SDOperand LoProd = DAG.getNode(ISD::AND, MVT::v4i32, - DAG.getCopyFromReg(LoProd_1, LoProd_reg, MVT::v4i32), - DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, - LoProdMask, LoProdMask, - LoProdMask, LoProdMask)); + DAG.getCopyFromReg(LoProd_1, LoProd_reg, MVT::v4i32), + DAG.getNode(ISD::BUILD_VECTOR, MVT::v4i32, + LoProdMask, LoProdMask, + LoProdMask, LoProdMask)); SDOperand rAH = DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, - DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, rA), c16); + DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, rA), c16); SDOperand rBH = DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, - DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, rB), c16); + DAG.getNode(ISD::BIT_CONVERT, MVT::v4i32, rB), c16); SDOperand HLProd = DAG.getNode(SPUISD::MPY, MVT::v8i16, - DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rAH), - DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rBH)); + DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rAH), + DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, rBH)); SDOperand HHProd_1 = DAG.getNode(SPUISD::MPY, MVT::v8i16, - DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, - DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, rAH, c8)), - DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, - DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, rBH, c8))); + DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, + DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, rAH, c8)), + DAG.getNode(ISD::BIT_CONVERT, MVT::v8i16, + DAG.getNode(SPUISD::VEC_SRA, MVT::v4i32, rBH, c8))); SDOperand HHProd = DAG.getCopyToReg(Chain, HiProd_reg, - DAG.getNode(SPUISD::SELB, MVT::v8i16, - HLProd, - DAG.getNode(SPUISD::VEC_SHL, MVT::v8i16, HHProd_1, c8), - FSMBuse_2222)); + DAG.getNode(SPUISD::SELB, MVT::v8i16, + HLProd, + DAG.getNode(SPUISD::VEC_SHL, MVT::v8i16, HHProd_1, c8), + FSMBuse_2222)); SDOperand HiProd = DAG.getNode(SPUISD::VEC_SHL, MVT::v4i32, - DAG.getCopyFromReg(HHProd, HiProd_reg, MVT::v4i32), c16); + DAG.getCopyFromReg(HHProd, HiProd_reg, MVT::v4i32), c16); return DAG.getNode(ISD::BIT_CONVERT, MVT::v16i8, - DAG.getNode(ISD::OR, MVT::v4i32, - LoProd, HiProd)); + DAG.getNode(ISD::OR, MVT::v4i32, + LoProd, HiProd)); } default: cerr << "CellSPU: Unknown vector multiplication, got " << MVT::getValueTypeString(Op.getValueType()) - << "\n"; + << "\n"; abort(); /*NOTREACHED*/ } @@ -2056,24 +2055,24 @@ // (Floating Interpolate (FP Reciprocal Estimate B)) SDOperand BRcpl = DAG.getCopyToReg(DAG.getEntryNode(), VRegBR, - DAG.getNode(SPUISD::FPInterp, VT, B, - DAG.getNode(SPUISD::FPRecipEst, VT, B))); + DAG.getNode(SPUISD::FPInterp, VT, B, + DAG.getNode(SPUISD::FPRecipEst, VT, B))); // Computes A * BRcpl and stores in a temporary register SDOperand AxBRcpl = DAG.getCopyToReg(BRcpl, VRegC, - DAG.getNode(ISD::FMUL, VT, A, - DAG.getCopyFromReg(BRcpl, VRegBR, VT))); + DAG.getNode(ISD::FMUL, VT, A, + DAG.getCopyFromReg(BRcpl, VRegBR, VT))); // What's the Chain variable do? It's magic! // TODO: set Chain = Op(0).getEntryNode() return DAG.getNode(ISD::FADD, VT, - DAG.getCopyFromReg(AxBRcpl, VRegC, VT), - DAG.getNode(ISD::FMUL, VT, - DAG.getCopyFromReg(AxBRcpl, VRegBR, VT), - DAG.getNode(ISD::FSUB, VT, A, - DAG.getNode(ISD::FMUL, VT, B, - DAG.getCopyFromReg(AxBRcpl, VRegC, VT))))); + DAG.getCopyFromReg(AxBRcpl, VRegC, VT), + DAG.getNode(ISD::FMUL, VT, + DAG.getCopyFromReg(AxBRcpl, VRegBR, VT), + DAG.getNode(ISD::FSUB, VT, A, + DAG.getNode(ISD::FMUL, VT, B, + DAG.getCopyFromReg(AxBRcpl, VRegC, VT))))); } static SDOperand LowerEXTRACT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG) { @@ -2126,7 +2125,7 @@ } assert(prefslot_begin != -1 && prefslot_end != -1 && - "LowerEXTRACT_VECTOR_ELT: preferred slots uninitialized"); + "LowerEXTRACT_VECTOR_ELT: preferred slots uninitialized"); for (int i = 0; i < 16; ++i) { // zero fill uppper part of preferred slot, don't care about the @@ -2135,9 +2134,9 @@ if (i <= prefslot_end) { mask_val = - ((i < prefslot_begin) - ? 0x80 - : elt_byte + (i - prefslot_begin)); + ((i < prefslot_begin) + ? 0x80 + : elt_byte + (i - prefslot_begin)); ShufMask[i] = DAG.getConstant(mask_val, MVT::i8); } else @@ -2146,13 +2145,13 @@ SDOperand ShufMaskVec = DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8, - &ShufMask[0], - sizeof(ShufMask) / sizeof(ShufMask[0])); + &ShufMask[0], + sizeof(ShufMask) / sizeof(ShufMask[0])); return DAG.getNode(SPUISD::EXTRACT_ELT0, VT, - DAG.getNode(SPUISD::SHUFB, N.getValueType(), - N, N, ShufMaskVec)); - + DAG.getNode(SPUISD::SHUFB, N.getValueType(), + N, N, ShufMaskVec)); + } static SDOperand LowerINSERT_VECTOR_ELT(SDOperand Op, SelectionDAG &DAG) { @@ -2176,7 +2175,7 @@ DAG.getNode(ISD::ADD, PtrVT, PtrBase, DAG.getConstant(CN->getValue(), - PtrVT)))); + PtrVT)))); return result; } @@ -2283,7 +2282,7 @@ ConstVec = Op.getOperand(1); Arg = Op.getOperand(0); if (ConstVec.Val->getOpcode() == ISD::BIT_CONVERT) { - ConstVec = ConstVec.getOperand(0); + ConstVec = ConstVec.getOperand(0); } } } @@ -2295,19 +2294,19 @@ int SplatSize; if (!GetConstantBuildVectorBits(ConstVec.Val, VectorBits, UndefBits) - && isConstantSplat(VectorBits, UndefBits, - MVT::getSizeInBits(MVT::getVectorElementType(VT)), - SplatBits, SplatUndef, SplatSize)) { + && isConstantSplat(VectorBits, UndefBits, + MVT::getSizeInBits(MVT::getVectorElementType(VT)), + SplatBits, SplatUndef, SplatSize)) { SDOperand tcVec[16]; SDOperand tc = DAG.getTargetConstant(SplatBits & 0xff, MVT::i8); const size_t tcVecSize = sizeof(tcVec) / sizeof(tcVec[0]); // Turn the BUILD_VECTOR into a set of target constants: for (size_t i = 0; i < tcVecSize; ++i) - tcVec[i] = tc; + tcVec[i] = tc; return DAG.getNode(Op.Val->getOpcode(), VT, Arg, - DAG.getNode(ISD::BUILD_VECTOR, VT, tcVec, tcVecSize)); + DAG.getNode(ISD::BUILD_VECTOR, VT, tcVec, tcVecSize)); } } @@ -2321,7 +2320,7 @@ default: cerr << "CellSPU: Unknown LowerMUL value type, got " << MVT::getValueTypeString(Op.getValueType()) - << "\n"; + << "\n"; abort(); /*NOTREACHED*/ @@ -2330,10 +2329,10 @@ SDOperand rB = Op.getOperand(1); return DAG.getNode(ISD::ADD, MVT::i32, - DAG.getNode(ISD::ADD, MVT::i32, - DAG.getNode(SPUISD::MPYH, MVT::i32, rA, rB), - DAG.getNode(SPUISD::MPYH, MVT::i32, rB, rA)), - DAG.getNode(SPUISD::MPYU, MVT::i32, rA, rB)); + DAG.getNode(ISD::ADD, MVT::i32, + DAG.getNode(SPUISD::MPYH, MVT::i32, rA, rB), + DAG.getNode(SPUISD::MPYH, MVT::i32, rB, rA)), + DAG.getNode(SPUISD::MPYU, MVT::i32, rA, rB)); } } @@ -2379,18 +2378,18 @@ // CNTB_reg, SUM1_reg become associated: SDOperand CNTB_result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, CNTB, Elt0); - + SDOperand CNTB_rescopy = DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result); SDOperand Tmp1 = DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i16); return DAG.getNode(ISD::AND, MVT::i16, - DAG.getNode(ISD::ADD, MVT::i16, - DAG.getNode(ISD::SRL, MVT::i16, - Tmp1, Shift1), - Tmp1), - Mask0); + DAG.getNode(ISD::ADD, MVT::i16, + DAG.getNode(ISD::SRL, MVT::i16, + Tmp1, Shift1), + Tmp1), + Mask0); } case MVT::i32: { @@ -2413,28 +2412,28 @@ // CNTB_reg, SUM1_reg become associated: SDOperand CNTB_result = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i32, CNTB, Elt0); - + SDOperand CNTB_rescopy = DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result); SDOperand Comp1 = DAG.getNode(ISD::SRL, MVT::i32, - DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32), Shift1); + DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32), Shift1); SDOperand Sum1 = DAG.getNode(ISD::ADD, MVT::i32, - Comp1, DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32)); + Comp1, DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32)); SDOperand Sum1_rescopy = DAG.getCopyToReg(CNTB_result, SUM1_reg, Sum1); SDOperand Comp2 = DAG.getNode(ISD::SRL, MVT::i32, - DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32), - Shift2); + DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32), + Shift2); SDOperand Sum2 = DAG.getNode(ISD::ADD, MVT::i32, Comp2, - DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32)); + DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32)); return DAG.getNode(ISD::AND, MVT::i32, Sum2, Mask0); } @@ -2558,7 +2557,7 @@ #endif const SPUSubtarget *ST = SPUTM.getSubtargetImpl(); SelectionDAG &DAG = DCI.DAG; - SDOperand N0 = N->getOperand(0); // everything has at least one operand + SDOperand N0 = N->getOperand(0); // everything has at least one operand switch (N->getOpcode()) { default: break; @@ -2683,11 +2682,11 @@ void SPUTargetLowering::computeMaskedBitsForTargetNode(const SDOperand Op, - uint64_t Mask, - uint64_t &KnownZero, - uint64_t &KnownOne, - const SelectionDAG &DAG, - unsigned Depth ) const { + uint64_t Mask, + uint64_t &KnownZero, + uint64_t &KnownOne, + const SelectionDAG &DAG, + unsigned Depth ) const { KnownZero = 0; KnownOne = 0; } Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h Tue Jan 29 20:55:46 2008 @@ -38,34 +38,34 @@ CALL, ///< CALL instruction SHUFB, ///< Vector shuffle (permute) INSERT_MASK, ///< Insert element shuffle mask - CNTB, ///< Count leading ones in bytes + CNTB, ///< Count leading ones in bytes PROMOTE_SCALAR, ///< Promote scalar->vector EXTRACT_ELT0, ///< Extract element 0 - EXTRACT_ELT0_CHAINED, ///< Extract element 0, with chain + EXTRACT_ELT0_CHAINED, ///< Extract element 0, with chain EXTRACT_I1_ZEXT, ///< Extract element 0 as i1, zero extend EXTRACT_I1_SEXT, ///< Extract element 0 as i1, sign extend EXTRACT_I8_ZEXT, ///< Extract element 0 as i8, zero extend EXTRACT_I8_SEXT, ///< Extract element 0 as i8, sign extend - MPY, ///< 16-bit Multiply (low parts of a 32-bit) - MPYU, ///< Multiply Unsigned - MPYH, ///< Multiply High - MPYHH, ///< Multiply High-High - VEC_SHL, ///< Vector shift left - VEC_SRL, ///< Vector shift right (logical) - VEC_SRA, ///< Vector shift right (arithmetic) - VEC_ROTL, ///< Vector rotate left - VEC_ROTR, ///< Vector rotate right - ROTBYTES_RIGHT_Z, ///< Vector rotate right, by bytes, zero fill + MPY, ///< 16-bit Multiply (low parts of a 32-bit) + MPYU, ///< Multiply Unsigned + MPYH, ///< Multiply High + MPYHH, ///< Multiply High-High + VEC_SHL, ///< Vector shift left + VEC_SRL, ///< Vector shift right (logical) + VEC_SRA, ///< Vector shift right (arithmetic) + VEC_ROTL, ///< Vector rotate left + VEC_ROTR, ///< Vector rotate right + ROTBYTES_RIGHT_Z, ///< Vector rotate right, by bytes, zero fill ROTBYTES_RIGHT_S, ///< Vector rotate right, by bytes, sign fill - ROTBYTES_LEFT, ///< Rotate bytes (loads -> ROTQBYI) - ROTBYTES_LEFT_CHAINED, ///< Rotate bytes (loads -> ROTQBYI), with chain - FSMBI, ///< Form Select Mask for Bytes, Immediate - SELB, ///< Select bits -> (b & mask) | (a & ~mask) - SFPConstant, ///< Single precision floating point constant + ROTBYTES_LEFT, ///< Rotate bytes (loads -> ROTQBYI) + ROTBYTES_LEFT_CHAINED, ///< Rotate bytes (loads -> ROTQBYI), with chain + FSMBI, ///< Form Select Mask for Bytes, Immediate + SELB, ///< Select bits -> (b & mask) | (a & ~mask) + SFPConstant, ///< Single precision floating point constant FPInterp, ///< Floating point interpolate - FPRecipEst, ///< Floating point reciprocal estimate - SEXT32TO64, ///< Sign-extended 32-bit const -> 64-bits - LAST_SPUISD ///< Last user-defined instruction + FPRecipEst, ///< Floating point reciprocal estimate + SEXT32TO64, ///< Sign-extended 32-bit const -> 64-bits + LAST_SPUISD ///< Last user-defined instruction }; } Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.cpp Tue Jan 29 20:55:46 2008 @@ -408,8 +408,8 @@ if (OpNum == 0) { // move -> store unsigned InReg = MI->getOperand(1).getReg(); if (FrameIndex < SPUFrameInfo::maxFrameOffset()) { - NewMI = addFrameReference(BuildMI(TII.get(SPU::STQDr32)).addReg(InReg), - FrameIndex); + NewMI = addFrameReference(BuildMI(TII.get(SPU::STQDr32)).addReg(InReg), + FrameIndex); } } else { // move -> load unsigned OutReg = MI->getOperand(0).getReg(); Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.h Tue Jan 29 20:55:46 2008 @@ -40,8 +40,8 @@ // leave the source and dest operands in the passed parameters. // virtual bool isMoveInstr(const MachineInstr& MI, - unsigned& sourceReg, - unsigned& destReg) const; + unsigned& sourceReg, + unsigned& destReg) const; unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const; unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const; @@ -60,9 +60,9 @@ //! Store a register to an address, based on its register class virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill, - SmallVectorImpl &Addr, - const TargetRegisterClass *RC, - SmallVectorImpl &NewMIs) const; + SmallVectorImpl &Addr, + const TargetRegisterClass *RC, + SmallVectorImpl &NewMIs) const; //! Load a register from a stack slot, based on its register class. virtual void loadRegFromStackSlot(MachineBasicBlock &MBB, @@ -72,8 +72,8 @@ //! Loqad a register from an address, based on its register class virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg, - SmallVectorImpl &Addr, - const TargetRegisterClass *RC, + SmallVectorImpl &Addr, + const TargetRegisterClass *RC, SmallVectorImpl &NewMIs) const; //! Fold spills into load/store instructions Modified: llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUInstrInfo.td Tue Jan 29 20:55:46 2008 @@ -194,16 +194,16 @@ class StoreAFormVec : RI16Form<0b0010010, (outs), (ins VECREG:$rT, addr256k:$src), - "stqa\t$rT, $src", - LoadStore, - [(store (vectype VECREG:$rT), aform_addr:$src)]> + "stqa\t$rT, $src", + LoadStore, + [(store (vectype VECREG:$rT), aform_addr:$src)]> { } class StoreAForm : RI16Form<0b001001, (outs), (ins rclass:$rT, addr256k:$src), - "stqa\t$rT, $src", - LoadStore, - [(store rclass:$rT, aform_addr:$src)]> + "stqa\t$rT, $src", + LoadStore, + [(store rclass:$rT, aform_addr:$src)]> { } multiclass StoreAForms @@ -226,16 +226,16 @@ class StoreXFormVec : RRForm<0b00100100, (outs), (ins VECREG:$rT, memrr:$src), - "stqx\t$rT, $src", - LoadStore, - [(store (vectype VECREG:$rT), xform_addr:$src)]> + "stqx\t$rT, $src", + LoadStore, + [(store (vectype VECREG:$rT), xform_addr:$src)]> { } class StoreXForm : RRForm<0b00100100, (outs), (ins rclass:$rT, memrr:$src), - "stqx\t$rT, $src", - LoadStore, - [(store rclass:$rT, xform_addr:$src)]> + "stqx\t$rT, $src", + LoadStore, + [(store rclass:$rT, xform_addr:$src)]> { } multiclass StoreXForms @@ -460,9 +460,9 @@ class FSMBIVec : RI16Form<0b101001100, (outs VECREG:$rT), (ins u16imm:$val), - "fsmbi\t$rT, $val", - SelectOp, - [(set (vectype VECREG:$rT), (SPUfsmbi immU16:$val))]> + "fsmbi\t$rT, $val", + SelectOp, + [(set (vectype VECREG:$rT), (SPUfsmbi immU16:$val))]> { } multiclass FSMBIs @@ -1151,7 +1151,7 @@ [/* no pattern */]>; def : Pat<(v16i8 (SPUpromote_scalar R8C:$rA)), - (ORv16i8_i8 R8C:$rA, R8C:$rA)>; + (ORv16i8_i8 R8C:$rA, R8C:$rA)>; def ORv8i16_i16: RRForm<0b10000010000, (outs VECREG:$rT), (ins R16C:$rA, R16C:$rB), @@ -1200,10 +1200,10 @@ [/* no pattern */]>; def : Pat<(SPUextract_elt0 (v16i8 VECREG:$rA)), - (ORi8_v16i8 VECREG:$rA, VECREG:$rA)>; + (ORi8_v16i8 VECREG:$rA, VECREG:$rA)>; def : Pat<(SPUextract_elt0_chained (v16i8 VECREG:$rA)), - (ORi8_v16i8 VECREG:$rA, VECREG:$rA)>; + (ORi8_v16i8 VECREG:$rA, VECREG:$rA)>; def ORi16_v8i16: RRForm<0b10000010000, (outs R16C:$rT), (ins VECREG:$rA, VECREG:$rB), @@ -2311,7 +2311,7 @@ (ROTHMIv8i16 VECREG:$rA, imm:$val)>; def: Pat<(SPUvec_srl_v8i16 (v8i16 VECREG:$rA), (i8 imm:$val)), - (ROTHMIv8i16 VECREG:$rA, imm:$val)>; + (ROTHMIv8i16 VECREG:$rA, imm:$val)>; def ROTHMIr16: RI7Form<0b10111110000, (outs R16C:$rT), (ins R16C:$rA, rothNeg7imm:$val), Modified: llvm/trunk/lib/Target/CellSPU/SPUNodes.td URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUNodes.td?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUNodes.td (original) +++ llvm/trunk/lib/Target/CellSPU/SPUNodes.td Tue Jan 29 20:55:46 2008 @@ -184,10 +184,6 @@ // Indirect [D-Form "imm($reg)" and X-Form "$reg($reg)"] addresses def SPUindirect : SDNode<"SPUISD::IndirectAddr", SDTIntBinOp, []>; -// Load result node -def SPUload_result : SDTypeProfile<1, 3, []>; -def SPUldresult : SDNode<"SPUISD::LDRESULT", SPUload_result, [SDNPHasChain]>; - // SPU 32-bit sign-extension to 64-bits def SPUsext32_to_64: SDNode<"SPUISD::SEXT32TO64", SDTIntExtendOp, []>; Modified: llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.cpp Tue Jan 29 20:55:46 2008 @@ -289,9 +289,9 @@ */ BitVector SPURegisterInfo::getReservedRegs(const MachineFunction &MF) const { BitVector Reserved(getNumRegs()); - Reserved.set(SPU::R0); // LR - Reserved.set(SPU::R1); // SP - Reserved.set(SPU::R2); // environment pointer + Reserved.set(SPU::R0); // LR + Reserved.set(SPU::R1); // SP + Reserved.set(SPU::R2); // environment pointer return Reserved; } @@ -331,7 +331,7 @@ void SPURegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, - RegScavenger *RS) const + RegScavenger *RS) const { unsigned i = 0; MachineInstr &MI = *II; @@ -464,10 +464,10 @@ if (isS10Constant(FrameSize)) { // Spill $sp to adjusted $sp BuildMI(MBB, MBBI, TII.get(SPU::STQDr32), SPU::R1).addImm(FrameSize) - .addReg(SPU::R1); + .addReg(SPU::R1); // Adjust $sp by required amout BuildMI(MBB, MBBI, TII.get(SPU::AIr32), SPU::R1).addReg(SPU::R1) - .addImm(FrameSize); + .addImm(FrameSize); } else if (FrameSize <= (1 << 16) - 1 && FrameSize >= -(1 << 16)) { // Frame size can be loaded into ILr32n, so temporarily spill $r2 and use // $r2 to adjust $sp: @@ -475,7 +475,7 @@ .addImm(-16) .addReg(SPU::R1); BuildMI(MBB, MBBI, TII.get(SPU::ILr32), SPU::R2) - .addImm(FrameSize); + .addImm(FrameSize); BuildMI(MBB, MBBI, TII.get(SPU::STQDr32), SPU::R1) .addReg(SPU::R2) .addReg(SPU::R1); @@ -504,12 +504,12 @@ // Add callee saved registers to move list. const std::vector &CSI = MFI->getCalleeSavedInfo(); for (unsigned I = 0, E = CSI.size(); I != E; ++I) { - int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx()); - unsigned Reg = CSI[I].getReg(); - if (Reg == SPU::R0) continue; - MachineLocation CSDst(MachineLocation::VirtualFP, Offset); - MachineLocation CSSrc(Reg); - Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); + int Offset = MFI->getObjectOffset(CSI[I].getFrameIdx()); + unsigned Reg = CSI[I].getReg(); + if (Reg == SPU::R0) continue; + MachineLocation CSDst(MachineLocation::VirtualFP, Offset); + MachineLocation CSSrc(Reg); + Moves.push_back(MachineMove(FrameLabelId, CSDst, CSSrc)); } // Mark effective beginning of when frame pointer is ready. @@ -556,7 +556,7 @@ .addReg(SPU::R1); BuildMI(MBB, MBBI, TII.get(SPU::AIr32), SPU::R1) .addReg(SPU::R1) - .addImm(FrameSize); + .addImm(FrameSize); } else if (FrameSize <= (1 << 16) - 1 && FrameSize >= -(1 << 16)) { // Frame size can be loaded into ILr32n, so temporarily spill $r2 and use // $r2 to adjust $sp: @@ -564,7 +564,7 @@ .addImm(16) .addReg(SPU::R1); BuildMI(MBB, MBBI, TII.get(SPU::ILr32), SPU::R2) - .addImm(FrameSize); + .addImm(FrameSize); BuildMI(MBB, MBBI, TII.get(SPU::Ar32), SPU::R1) .addReg(SPU::R1) .addReg(SPU::R2); Modified: llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPURegisterInfo.h Tue Jan 29 20:55:46 2008 @@ -41,7 +41,7 @@ static unsigned getRegisterNumbering(unsigned RegEnum); void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, - unsigned DestReg, const MachineInstr *Orig) const; + unsigned DestReg, const MachineInstr *Orig) const; //! Return the array of callee-saved registers virtual const unsigned* getCalleeSavedRegs(const MachineFunction *MF) const; @@ -66,7 +66,7 @@ void determineFrameLayout(MachineFunction &MF) const; void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, - RegScavenger *RS = NULL) const; + RegScavenger *RS = NULL) const; //! Emit the function prologue void emitPrologue(MachineFunction &MF) const; //! Emit the function epilogue Modified: llvm/trunk/lib/Target/CellSPU/SPUSubtarget.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUSubtarget.h?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUSubtarget.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUSubtarget.h Tue Jan 29 20:55:46 2008 @@ -84,7 +84,7 @@ /// properties of this subtarget. const char *getTargetDataString() const { return "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128" - "-i16:16:128-i8:8:128-i1:8:128-a:0:128-v128:128:128" + "-i16:16:128-i8:8:128-i1:8:128-a:0:128-v128:128:128" "-s:128:128"; } }; Modified: llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp?rev=46544&r1=46543&r2=46544&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUTargetMachine.cpp Tue Jan 29 20:55:46 2008 @@ -50,7 +50,7 @@ || (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "cellspu-")) return 20; - return 0; // No match at all... + return 0; // No match at all... } SPUTargetMachine::SPUTargetMachine(const Module &M, const std::string &FS) From scottm at aero.org Tue Jan 29 21:10:00 2008 From: scottm at aero.org (Scott Michel) Date: Wed, 30 Jan 2008 03:10:00 -0000 Subject: [llvm-commits] [llvm] r46545 - in /llvm/trunk/lib/AsmParser: llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200801300310.m0U3A10f011031@zion.cs.uiuc.edu> Author: pingbak Date: Tue Jan 29 21:10:00 2008 New Revision: 46545 URL: http://llvm.org/viewvc/llvm-project?rev=46545&view=rev Log: Back out mods to llvmAsmParser, incorrectly committed Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs?rev=46545&r1=46544&r2=46545&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.cpp.cvs Tue Jan 29 21:10:00 2008 @@ -1,382 +1,165 @@ -/* 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/clamb/Documents/llvm/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 ESAPINTVAL 259 +#define EUAPINTVAL 260 +#define LOCALVAL_ID 261 +#define GLOBALVAL_ID 262 +#define FPVAL 263 +#define VOID 264 +#define INTTYPE 265 +#define FLOAT 266 +#define DOUBLE 267 +#define X86_FP80 268 +#define FP128 269 +#define PPC_FP128 270 +#define LABEL 271 +#define TYPE 272 +#define LOCALVAR 273 +#define GLOBALVAR 274 +#define LABELSTR 275 +#define STRINGCONSTANT 276 +#define ATSTRINGCONSTANT 277 +#define PCTSTRINGCONSTANT 278 +#define ZEROINITIALIZER 279 +#define TRUETOK 280 +#define FALSETOK 281 +#define BEGINTOK 282 +#define ENDTOK 283 +#define DECLARE 284 +#define DEFINE 285 +#define GLOBAL 286 +#define CONSTANT 287 +#define SECTION 288 +#define ALIAS 289 +#define VOLATILE 290 +#define THREAD_LOCAL 291 +#define TO 292 +#define DOTDOTDOT 293 +#define NULL_TOK 294 +#define UNDEF 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 EXTERNAL 304 +#define TARGET 305 +#define TRIPLE 306 +#define ALIGN 307 +#define ADDRSPACE 308 +#define DEPLIBS 309 +#define CALL 310 +#define TAIL 311 +#define ASM_TOK 312 +#define MODULE 313 +#define SIDEEFFECT 314 +#define CC_TOK 315 +#define CCC_TOK 316 +#define FASTCC_TOK 317 +#define COLDCC_TOK 318 +#define X86_STDCALLCC_TOK 319 +#define X86_FASTCALLCC_TOK 320 +#define DATALAYOUT 321 +#define RET 322 +#define BR 323 +#define SWITCH 324 +#define INVOKE 325 +#define UNWIND 326 +#define UNREACHABLE 327 +#define ADD 328 +#define SUB 329 +#define MUL 330 +#define UDIV 331 +#define SDIV 332 +#define FDIV 333 +#define UREM 334 +#define SREM 335 +#define FREM 336 +#define AND 337 +#define OR 338 +#define XOR 339 +#define SHL 340 +#define LSHR 341 +#define ASHR 342 +#define ICMP 343 +#define FCMP 344 +#define EQ 345 +#define NE 346 +#define SLT 347 +#define SGT 348 +#define SLE 349 +#define SGE 350 +#define ULT 351 +#define UGT 352 +#define ULE 353 +#define UGE 354 +#define OEQ 355 +#define ONE 356 +#define OLT 357 +#define OGT 358 +#define OLE 359 +#define OGE 360 +#define ORD 361 +#define UNO 362 +#define UEQ 363 +#define UNE 364 +#define MALLOC 365 +#define ALLOCA 366 +#define FREE 367 +#define LOAD 368 +#define STORE 369 +#define GETELEMENTPTR 370 +#define TRUNC 371 +#define ZEXT 372 +#define SEXT 373 +#define FPTRUNC 374 +#define FPEXT 375 +#define BITCAST 376 +#define UITOFP 377 +#define SITOFP 378 +#define FPTOUI 379 +#define FPTOSI 380 +#define INTTOPTR 381 +#define PTRTOINT 382 +#define PHI_TOK 383 +#define SELECT 384 +#define VAARG 385 +#define EXTRACTELEMENT 386 +#define INSERTELEMENT 387 +#define SHUFFLEVECTOR 388 +#define SIGNEXT 389 +#define ZEROEXT 390 +#define NORETURN 391 +#define INREG 392 +#define SRET 393 +#define NOUNWIND 394 +#define NOALIAS 395 +#define BYVAL 396 +#define NEST 397 +#define READNONE 398 +#define READONLY 399 +#define GC 400 +#define DEFAULT 401 +#define HIDDEN 402 +#define PROTECTED 403 - -/* 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, - ESAPINTVAL = 260, - EUAPINTVAL = 261, - LOCALVAL_ID = 262, - GLOBALVAL_ID = 263, - FPVAL = 264, - VOID = 265, - INTTYPE = 266, - FLOAT = 267, - DOUBLE = 268, - X86_FP80 = 269, - FP128 = 270, - PPC_FP128 = 271, - LABEL = 272, - TYPE = 273, - LOCALVAR = 274, - GLOBALVAR = 275, - LABELSTR = 276, - STRINGCONSTANT = 277, - ATSTRINGCONSTANT = 278, - PCTSTRINGCONSTANT = 279, - ZEROINITIALIZER = 280, - TRUETOK = 281, - FALSETOK = 282, - BEGINTOK = 283, - ENDTOK = 284, - DECLARE = 285, - DEFINE = 286, - GLOBAL = 287, - CONSTANT = 288, - SECTION = 289, - ALIAS = 290, - VOLATILE = 291, - THREAD_LOCAL = 292, - TO = 293, - DOTDOTDOT = 294, - NULL_TOK = 295, - UNDEF = 296, - INTERNAL = 297, - LINKONCE = 298, - WEAK = 299, - APPENDING = 300, - DLLIMPORT = 301, - DLLEXPORT = 302, - EXTERN_WEAK = 303, - OPAQUE = 304, - EXTERNAL = 305, - TARGET = 306, - TRIPLE = 307, - ALIGN = 308, - ADDRSPACE = 309, - DEPLIBS = 310, - CALL = 311, - TAIL = 312, - ASM_TOK = 313, - MODULE = 314, - SIDEEFFECT = 315, - CC_TOK = 316, - CCC_TOK = 317, - FASTCC_TOK = 318, - COLDCC_TOK = 319, - X86_STDCALLCC_TOK = 320, - X86_FASTCALLCC_TOK = 321, - DATALAYOUT = 322, - RET = 323, - BR = 324, - SWITCH = 325, - INVOKE = 326, - UNWIND = 327, - UNREACHABLE = 328, - ADD = 329, - SUB = 330, - MUL = 331, - UDIV = 332, - SDIV = 333, - FDIV = 334, - UREM = 335, - SREM = 336, - FREM = 337, - AND = 338, - OR = 339, - XOR = 340, - SHL = 341, - LSHR = 342, - ASHR = 343, - ICMP = 344, - FCMP = 345, - EQ = 346, - NE = 347, - SLT = 348, - SGT = 349, - SLE = 350, - SGE = 351, - ULT = 352, - UGT = 353, - ULE = 354, - UGE = 355, - OEQ = 356, - ONE = 357, - OLT = 358, - OGT = 359, - OLE = 360, - OGE = 361, - ORD = 362, - UNO = 363, - UEQ = 364, - UNE = 365, - MALLOC = 366, - ALLOCA = 367, - FREE = 368, - LOAD = 369, - STORE = 370, - GETELEMENTPTR = 371, - TRUNC = 372, - ZEXT = 373, - SEXT = 374, - FPTRUNC = 375, - FPEXT = 376, - BITCAST = 377, - UITOFP = 378, - SITOFP = 379, - FPTOUI = 380, - FPTOSI = 381, - INTTOPTR = 382, - PTRTOINT = 383, - PHI_TOK = 384, - SELECT = 385, - VAARG = 386, - EXTRACTELEMENT = 387, - INSERTELEMENT = 388, - SHUFFLEVECTOR = 389, - SIGNEXT = 390, - ZEROEXT = 391, - NORETURN = 392, - INREG = 393, - SRET = 394, - NOUNWIND = 395, - NOALIAS = 396, - BYVAL = 397, - NEST = 398, - READNONE = 399, - READONLY = 400, - GC = 401, - DEFAULT = 402, - HIDDEN = 403, - PROTECTED = 404 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define ESAPINTVAL 260 -#define EUAPINTVAL 261 -#define LOCALVAL_ID 262 -#define GLOBALVAL_ID 263 -#define FPVAL 264 -#define VOID 265 -#define INTTYPE 266 -#define FLOAT 267 -#define DOUBLE 268 -#define X86_FP80 269 -#define FP128 270 -#define PPC_FP128 271 -#define LABEL 272 -#define TYPE 273 -#define LOCALVAR 274 -#define GLOBALVAR 275 -#define LABELSTR 276 -#define STRINGCONSTANT 277 -#define ATSTRINGCONSTANT 278 -#define PCTSTRINGCONSTANT 279 -#define ZEROINITIALIZER 280 -#define TRUETOK 281 -#define FALSETOK 282 -#define BEGINTOK 283 -#define ENDTOK 284 -#define DECLARE 285 -#define DEFINE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define SECTION 289 -#define ALIAS 290 -#define VOLATILE 291 -#define THREAD_LOCAL 292 -#define TO 293 -#define DOTDOTDOT 294 -#define NULL_TOK 295 -#define UNDEF 296 -#define INTERNAL 297 -#define LINKONCE 298 -#define WEAK 299 -#define APPENDING 300 -#define DLLIMPORT 301 -#define DLLEXPORT 302 -#define EXTERN_WEAK 303 -#define OPAQUE 304 -#define EXTERNAL 305 -#define TARGET 306 -#define TRIPLE 307 -#define ALIGN 308 -#define ADDRSPACE 309 -#define DEPLIBS 310 -#define CALL 311 -#define TAIL 312 -#define ASM_TOK 313 -#define MODULE 314 -#define SIDEEFFECT 315 -#define CC_TOK 316 -#define CCC_TOK 317 -#define FASTCC_TOK 318 -#define COLDCC_TOK 319 -#define X86_STDCALLCC_TOK 320 -#define X86_FASTCALLCC_TOK 321 -#define DATALAYOUT 322 -#define RET 323 -#define BR 324 -#define SWITCH 325 -#define INVOKE 326 -#define UNWIND 327 -#define UNREACHABLE 328 -#define ADD 329 -#define SUB 330 -#define MUL 331 -#define UDIV 332 -#define SDIV 333 -#define FDIV 334 -#define UREM 335 -#define SREM 336 -#define FREM 337 -#define AND 338 -#define OR 339 -#define XOR 340 -#define SHL 341 -#define LSHR 342 -#define ASHR 343 -#define ICMP 344 -#define FCMP 345 -#define EQ 346 -#define NE 347 -#define SLT 348 -#define SGT 349 -#define SLE 350 -#define SGE 351 -#define ULT 352 -#define UGT 353 -#define ULE 354 -#define UGE 355 -#define OEQ 356 -#define ONE 357 -#define OLT 358 -#define OGT 359 -#define OLE 360 -#define OGE 361 -#define ORD 362 -#define UNO 363 -#define UEQ 364 -#define UNE 365 -#define MALLOC 366 -#define ALLOCA 367 -#define FREE 368 -#define LOAD 369 -#define STORE 370 -#define GETELEMENTPTR 371 -#define TRUNC 372 -#define ZEXT 373 -#define SEXT 374 -#define FPTRUNC 375 -#define FPEXT 376 -#define BITCAST 377 -#define UITOFP 378 -#define SITOFP 379 -#define FPTOUI 380 -#define FPTOSI 381 -#define INTTOPTR 382 -#define PTRTOINT 383 -#define PHI_TOK 384 -#define SELECT 385 -#define VAARG 386 -#define EXTRACTELEMENT 387 -#define INSERTELEMENT 388 -#define SHUFFLEVECTOR 389 -#define SIGNEXT 390 -#define ZEROEXT 391 -#define NORETURN 392 -#define INREG 393 -#define SRET 394 -#define NOUNWIND 395 -#define NOALIAS 396 -#define BYVAL 397 -#define NEST 398 -#define READNONE 399 -#define READONLY 400 -#define GC 401 -#define DEFAULT 402 -#define HIDDEN 403 -#define PROTECTED 404 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -1309,29 +1092,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 947 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" -{ +#line 947 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; llvm::BasicBlock *BasicBlockVal; @@ -1376,1894 +1138,1209 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; -} -/* Line 187 of yacc.c. */ -#line 1382 "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 1395 "llvmAsmParser.tab.c" +#define YYFINAL 619 +#define YYFLAG -32768 +#define YYNTBASE 164 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 403 ? yytranslate[x] : 247) + +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, 150, + 151, 154, 2, 153, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 159, + 152, 160, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 156, 155, 158, 2, 2, 2, 2, 2, 163, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 157, + 2, 2, 161, 2, 162, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 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 +}; -#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, 127, 132, 133, 136, 137, 139, + 141, 143, 144, 147, 149, 151, 153, 155, 157, 159, + 161, 163, 164, 166, 168, 170, 171, 173, 175, 176, + 178, 180, 182, 184, 185, 187, 189, 190, 192, 194, + 196, 198, 200, 203, 205, 207, 209, 211, 213, 215, + 217, 219, 221, 222, 225, 227, 229, 231, 233, 235, + 237, 238, 241, 242, 245, 246, 249, 250, 254, 257, + 258, 260, 261, 265, 267, 270, 272, 274, 276, 278, + 280, 282, 284, 286, 288, 292, 294, 297, 303, 309, + 315, 321, 325, 328, 334, 339, 342, 344, 346, 348, + 352, 354, 358, 360, 361, 363, 367, 372, 376, 380, + 385, 390, 394, 401, 407, 410, 413, 416, 419, 422, + 425, 428, 431, 434, 437, 440, 443, 450, 456, 465, + 472, 479, 487, 495, 502, 511, 520, 524, 526, 528, + 530, 532, 533, 536, 543, 545, 546, 548, 551, 552, + 556, 557, 561, 565, 569, 573, 574, 583, 584, 594, + 595, 605, 611, 614, 618, 620, 624, 628, 632, 636, + 638, 639, 645, 649, 651, 655, 657, 658, 669, 671, + 673, 678, 680, 682, 685, 689, 690, 692, 694, 696, + 698, 700, 702, 704, 706, 708, 712, 714, 720, 722, + 724, 726, 728, 730, 732, 735, 738, 741, 745, 748, + 749, 751, 754, 757, 761, 771, 781, 790, 805, 807, + 809, 816, 822, 825, 832, 840, 845, 850, 857, 864, + 865, 866, 870, 873, 875, 881, 887, 894, 901, 906, + 913, 918, 923, 930, 937, 940, 949, 951, 953, 954, + 958, 965, 969, 976, 979, 985, 993 +}; -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif +static const short yyrhs[] = { 74, + 0, 75, 0, 76, 0, 77, 0, 78, 0, 79, + 0, 80, 0, 81, 0, 82, 0, 86, 0, 87, + 0, 88, 0, 83, 0, 84, 0, 85, 0, 117, + 0, 118, 0, 119, 0, 120, 0, 121, 0, 122, + 0, 123, 0, 124, 0, 125, 0, 126, 0, 127, + 0, 128, 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, 103, 0, 104, + 0, 105, 0, 106, 0, 107, 0, 108, 0, 109, + 0, 110, 0, 97, 0, 98, 0, 99, 0, 100, + 0, 26, 0, 27, 0, 11, 0, 12, 0, 13, + 0, 16, 0, 15, 0, 14, 0, 19, 0, 22, + 0, 24, 0, 171, 0, 0, 54, 150, 4, 151, + 0, 0, 171, 152, 0, 0, 20, 0, 23, 0, + 177, 0, 0, 175, 152, 0, 42, 0, 44, 0, + 43, 0, 45, 0, 47, 0, 46, 0, 48, 0, + 50, 0, 0, 147, 0, 148, 0, 149, 0, 0, + 46, 0, 48, 0, 0, 42, 0, 43, 0, 44, + 0, 47, 0, 0, 44, 0, 42, 0, 0, 62, + 0, 63, 0, 64, 0, 65, 0, 66, 0, 61, + 4, 0, 136, 0, 118, 0, 135, 0, 119, 0, + 138, 0, 139, 0, 141, 0, 142, 0, 143, 0, + 0, 186, 185, 0, 137, 0, 140, 0, 136, 0, + 135, 0, 144, 0, 145, 0, 0, 188, 187, 0, + 0, 146, 22, 0, 0, 53, 4, 0, 0, 153, + 53, 4, 0, 34, 22, 0, 0, 192, 0, 0, + 153, 195, 194, 0, 192, 0, 53, 4, 0, 11, + 0, 12, 0, 13, 0, 16, 0, 15, 0, 14, + 0, 17, 0, 49, 0, 196, 0, 197, 173, 154, + 0, 231, 0, 155, 4, 0, 197, 150, 201, 151, + 188, 0, 10, 150, 201, 151, 188, 0, 156, 4, + 157, 197, 158, 0, 159, 4, 157, 197, 160, 0, + 161, 202, 162, 0, 161, 162, 0, 159, 161, 202, + 162, 160, 0, 159, 161, 162, 160, 0, 197, 186, + 0, 197, 0, 10, 0, 198, 0, 200, 153, 198, + 0, 200, 0, 200, 153, 39, 0, 39, 0, 0, + 197, 0, 202, 153, 197, 0, 197, 156, 205, 158, + 0, 197, 156, 158, 0, 197, 163, 22, 0, 197, + 159, 205, 160, 0, 197, 161, 205, 162, 0, 197, + 161, 162, 0, 197, 159, 161, 205, 162, 160, 0, + 197, 159, 161, 162, 160, 0, 197, 40, 0, 197, + 41, 0, 197, 231, 0, 197, 204, 0, 197, 25, + 0, 169, 3, 0, 169, 5, 0, 169, 4, 0, + 169, 6, 0, 11, 26, 0, 11, 27, 0, 170, + 9, 0, 166, 150, 203, 38, 197, 151, 0, 116, + 150, 203, 242, 151, 0, 130, 150, 203, 153, 203, + 153, 203, 151, 0, 164, 150, 203, 153, 203, 151, + 0, 165, 150, 203, 153, 203, 151, 0, 89, 167, + 150, 203, 153, 203, 151, 0, 90, 168, 150, 203, + 153, 203, 151, 0, 132, 150, 203, 153, 203, 151, + 0, 133, 150, 203, 153, 203, 153, 203, 151, 0, + 134, 150, 203, 153, 203, 153, 203, 151, 0, 205, + 153, 203, 0, 203, 0, 32, 0, 33, 0, 37, + 0, 0, 199, 231, 0, 122, 150, 208, 38, 197, + 151, 0, 210, 0, 0, 211, 0, 210, 211, 0, + 0, 31, 212, 227, 0, 0, 30, 213, 228, 0, + 59, 58, 217, 0, 174, 18, 197, 0, 174, 18, + 10, 0, 0, 176, 180, 207, 206, 203, 173, 214, + 194, 0, 0, 176, 178, 180, 207, 206, 203, 173, + 215, 194, 0, 0, 176, 179, 180, 207, 206, 197, + 173, 216, 194, 0, 176, 180, 35, 183, 208, 0, + 51, 218, 0, 55, 152, 219, 0, 22, 0, 52, + 152, 22, 0, 67, 152, 22, 0, 156, 220, 158, + 0, 220, 153, 22, 0, 22, 0, 0, 221, 153, + 197, 186, 172, 0, 197, 186, 172, 0, 221, 0, + 221, 153, 39, 0, 39, 0, 0, 184, 199, 175, + 150, 222, 151, 188, 193, 190, 189, 0, 28, 0, + 161, 0, 182, 180, 223, 224, 0, 29, 0, 162, + 0, 234, 226, 0, 181, 180, 223, 0, 0, 60, + 0, 3, 0, 4, 0, 9, 0, 26, 0, 27, + 0, 40, 0, 41, 0, 25, 0, 159, 205, 160, + 0, 204, 0, 58, 229, 22, 153, 22, 0, 7, + 0, 8, 0, 171, 0, 175, 0, 231, 0, 230, + 0, 197, 232, 0, 234, 235, 0, 225, 235, 0, + 236, 174, 237, 0, 236, 239, 0, 0, 21, 0, + 68, 233, 0, 68, 10, 0, 69, 17, 232, 0, + 69, 11, 232, 153, 17, 232, 153, 17, 232, 0, + 70, 169, 232, 153, 17, 232, 156, 238, 158, 0, + 70, 169, 232, 153, 17, 232, 156, 158, 0, 71, + 184, 199, 232, 150, 241, 151, 188, 38, 17, 232, + 72, 17, 232, 0, 72, 0, 73, 0, 238, 169, + 230, 153, 17, 232, 0, 169, 230, 153, 17, 232, + 0, 174, 244, 0, 197, 156, 232, 153, 232, 158, + 0, 240, 153, 156, 232, 153, 232, 158, 0, 197, + 186, 232, 186, 0, 17, 186, 232, 186, 0, 241, + 153, 197, 186, 232, 186, 0, 241, 153, 17, 186, + 232, 186, 0, 0, 0, 242, 153, 233, 0, 57, + 56, 0, 56, 0, 164, 197, 232, 153, 232, 0, + 165, 197, 232, 153, 232, 0, 89, 167, 197, 232, + 153, 232, 0, 90, 168, 197, 232, 153, 232, 0, + 166, 233, 38, 197, 0, 130, 233, 153, 233, 153, + 233, 0, 131, 233, 153, 197, 0, 132, 233, 153, + 233, 0, 133, 233, 153, 233, 153, 233, 0, 134, + 233, 153, 233, 153, 233, 0, 129, 240, 0, 243, + 184, 199, 232, 150, 241, 151, 188, 0, 246, 0, + 36, 0, 0, 111, 197, 191, 0, 111, 197, 153, + 11, 232, 191, 0, 112, 197, 191, 0, 112, 197, + 153, 11, 232, 191, 0, 113, 233, 0, 245, 114, + 197, 232, 191, 0, 245, 115, 233, 153, 197, 232, + 191, 0, 116, 197, 232, 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, + 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1108, + 1108, 1108, 1108, 1108, 1108, 1109, 1109, 1109, 1109, 1109, + 1109, 1109, 1110, 1110, 1110, 1110, 1110, 1113, 1113, 1114, + 1114, 1115, 1115, 1116, 1116, 1117, 1117, 1121, 1121, 1122, + 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1126, 1126, 1127, + 1127, 1128, 1129, 1134, 1135, 1135, 1135, 1135, 1135, 1137, + 1137, 1137, 1138, 1138, 1140, 1141, 1145, 1149, 1154, 1154, + 1156, 1157, 1162, 1168, 1169, 1170, 1171, 1172, 1176, 1177, + 1178, 1182, 1183, 1184, 1185, 1189, 1190, 1191, 1195, 1196, + 1197, 1198, 1199, 1203, 1204, 1205, 1208, 1208, 1209, 1210, + 1211, 1212, 1213, 1221, 1222, 1223, 1224, 1225, 1226, 1227, + 1228, 1229, 1232, 1233, 1238, 1239, 1240, 1241, 1242, 1243, + 1246, 1247, 1252, 1253, 1260, 1260, 1267, 1267, 1277, 1285, + 1285, 1291, 1291, 1293, 1298, 1311, 1311, 1311, 1311, 1311, + 1311, 1311, 1314, 1318, 1322, 1329, 1334, 1342, 1372, 1397, + 1402, 1412, 1422, 1426, 1436, 1443, 1452, 1459, 1464, 1469, + 1476, 1477, 1484, 1491, 1499, 1505, 1517, 1545, 1561, 1588, + 1616, 1642, 1662, 1688, 1708, 1720, 1727, 1793, 1803, 1813, + 1819, 1829, 1835, 1845, 1850, 1855, 1868, 1880, 1902, 1910, + 1916, 1927, 1932, 1937, 1943, 1949, 1958, 1962, 1970, 1970, + 1973, 1973, 1976, 1988, 2009, 2014, 2022, 2023, 2027, 2027, + 2031, 2031, 2034, 2037, 2061, 2072, 2080, 2083, 2089, 2092, + 2099, 2103, 2143, 2146, 2152, 2162, 2166, 2171, 2173, 2178, + 2183, 2192, 2202, 2213, 2217, 2226, 2235, 2240, 2374, 2374, + 2376, 2385, 2385, 2387, 2392, 2404, 2408, 2413, 2417, 2421, + 2425, 2429, 2433, 2437, 2441, 2445, 2470, 2474, 2484, 2488, + 2492, 2497, 2504, 2504, 2510, 2519, 2523, 2532, 2541, 2550, + 2554, 2561, 2565, 2569, 2574, 2584, 2603, 2612, 2696, 2700, + 2707, 2718, 2731, 2741, 2752, 2762, 2773, 2781, 2791, 2798, + 2801, 2802, 2809, 2813, 2818, 2834, 2851, 2865, 2879, 2891, + 2899, 2906, 2912, 2918, 2924, 2939, 3030, 3035, 3039, 3046, + 3053, 3061, 3068, 3076, 3084, 3098, 3115 +}; #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","ESAPINTVAL","EUAPINTVAL","LOCALVAL_ID","GLOBALVAL_ID","FPVAL", +"VOID","INTTYPE","FLOAT","DOUBLE","X86_FP80","FP128","PPC_FP128","LABEL","TYPE", +"LOCALVAR","GLOBALVAR","LABELSTR","STRINGCONSTANT","ATSTRINGCONSTANT","PCTSTRINGCONSTANT", +"ZEROINITIALIZER","TRUETOK","FALSETOK","BEGINTOK","ENDTOK","DECLARE","DEFINE", +"GLOBAL","CONSTANT","SECTION","ALIAS","VOLATILE","THREAD_LOCAL","TO","DOTDOTDOT", +"NULL_TOK","UNDEF","INTERNAL","LINKONCE","WEAK","APPENDING","DLLIMPORT","DLLEXPORT", +"EXTERN_WEAK","OPAQUE","EXTERNAL","TARGET","TRIPLE","ALIGN","ADDRSPACE","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","SIGNEXT","ZEROEXT","NORETURN","INREG","SRET", +"NOUNWIND","NOALIAS","BYVAL","NEST","READNONE","READONLY","GC","DEFAULT","HIDDEN", +"PROTECTED","'('","')'","'='","','","'*'","'\\\\'","'['","'x'","']'","'<'","'>'", +"'{'","'}'","'c'","ArithmeticOps","LogicalOps","CastOps","IPredicates","FPredicates", +"IntType","FPType","LocalName","OptLocalName","OptAddrSpace","OptLocalAssign", +"GlobalName","OptGlobalAssign","GlobalAssign","GVInternalLinkage","GVExternalLinkage", +"GVVisibilityStyle","FunctionDeclareLinkage","FunctionDefineLinkage","AliasLinkage", +"OptCallingConv","ParamAttr","OptParamAttrs","FuncAttr","OptFuncAttrs","OptGC", +"OptAlign","OptCAlign","SectionString","OptSection","GlobalVarAttributes","GlobalVarAttribute", +"PrimType","Types","ArgType","ResultTypes","ArgTypeList","ArgTypeListI","TypeListI", +"ConstVal","ConstExpr","ConstVector","GlobalType","ThreadLocal","AliaseeRef", +"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","ParamList","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 43 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1988 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 164 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 84 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 318 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 619 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 404 - -#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, - 150, 151, 154, 2, 153, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 159, 152, 160, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 156, 155, 158, 2, 2, 2, 2, 2, 163, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 157, 2, 2, 161, 2, 162, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 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 +static const short yyr1[] = { 0, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 165, + 165, 165, 165, 165, 165, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 169, 170, 170, 170, 170, 170, 171, + 171, 171, 172, 172, 173, 173, 174, 174, 175, 175, + 176, 176, 177, 178, 178, 178, 178, 178, 179, 179, + 179, 180, 180, 180, 180, 181, 181, 181, 182, 182, + 182, 182, 182, 183, 183, 183, 184, 184, 184, 184, + 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 186, 186, 187, 187, 187, 187, 187, 187, + 188, 188, 189, 189, 190, 190, 191, 191, 192, 193, + 193, 194, 194, 195, 195, 196, 196, 196, 196, 196, + 196, 196, 197, 197, 197, 197, 197, 197, 197, 197, + 197, 197, 197, 197, 197, 198, 199, 199, 200, 200, + 201, 201, 201, 201, 202, 202, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, + 204, 204, 204, 204, 204, 204, 205, 205, 206, 206, + 207, 207, 208, 208, 209, 209, 210, 210, 212, 211, + 213, 211, 211, 211, 211, 214, 211, 215, 211, 216, + 211, 211, 211, 211, 217, 218, 218, 219, 220, 220, + 220, 221, 221, 222, 222, 222, 222, 223, 224, 224, + 225, 226, 226, 227, 228, 229, 229, 230, 230, 230, + 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, + 231, 231, 232, 232, 233, 234, 234, 235, 236, 236, + 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 238, 238, 239, 240, 240, 241, 241, 241, 241, 241, + 242, 242, 243, 243, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 245, 245, 246, + 246, 246, 246, 246, 246, 246, 246 }; -#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, 130, 135, 136, 139, - 140, 142, 144, 146, 147, 150, 152, 154, 156, 158, - 160, 162, 164, 166, 167, 169, 171, 173, 174, 176, - 178, 179, 181, 183, 185, 187, 188, 190, 192, 193, - 195, 197, 199, 201, 203, 206, 208, 210, 212, 214, - 216, 218, 220, 222, 224, 225, 228, 230, 232, 234, - 236, 238, 240, 241, 244, 245, 248, 249, 252, 253, - 257, 260, 261, 263, 264, 268, 270, 273, 275, 277, - 279, 281, 283, 285, 287, 289, 291, 295, 297, 300, - 306, 312, 318, 324, 328, 331, 337, 342, 345, 347, - 349, 351, 355, 357, 361, 363, 364, 366, 370, 375, - 379, 383, 388, 393, 397, 404, 410, 413, 416, 419, - 422, 425, 428, 431, 434, 437, 440, 443, 446, 453, - 459, 468, 475, 482, 490, 498, 505, 514, 523, 527, - 529, 531, 533, 535, 536, 539, 546, 548, 549, 551, - 554, 555, 559, 560, 564, 568, 572, 576, 577, 586, - 587, 597, 598, 608, 614, 617, 621, 623, 627, 631, - 635, 639, 641, 642, 648, 652, 654, 658, 660, 661, - 672, 674, 676, 681, 683, 685, 688, 692, 693, 695, - 697, 699, 701, 703, 705, 707, 709, 711, 715, 717, - 723, 725, 727, 729, 731, 733, 735, 738, 741, 744, - 748, 751, 752, 754, 757, 760, 764, 774, 784, 793, - 808, 810, 812, 819, 825, 828, 835, 843, 848, 853, - 860, 867, 868, 869, 873, 876, 878, 884, 890, 897, - 904, 909, 916, 921, 926, 933, 940, 943, 952, 954, - 956, 957, 961, 968, 972, 979, 982, 988, 996 +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, 0, 4, 0, 2, 0, 1, 1, + 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, + 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 2, 1, 1, 1, 1, 1, 1, + 0, 2, 0, 2, 0, 2, 0, 3, 2, 0, + 1, 0, 3, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 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, 2, 2, 6, 5, 8, 6, + 6, 7, 7, 6, 8, 8, 3, 1, 1, 1, + 1, 0, 2, 6, 1, 0, 1, 2, 0, 3, + 0, 3, 3, 3, 3, 0, 8, 0, 9, 0, + 9, 5, 2, 3, 1, 3, 3, 3, 3, 1, + 0, 5, 3, 1, 3, 1, 0, 10, 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, 4, 4, 6, 6, 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, 5, 7, 4 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 210, 0, -1, 74, -1, 75, -1, 76, -1, 77, - -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, - -1, 86, -1, 87, -1, 88, -1, 83, -1, 84, - -1, 85, -1, 117, -1, 118, -1, 119, -1, 120, - -1, 121, -1, 122, -1, 123, -1, 124, -1, 125, - -1, 126, -1, 127, -1, 128, -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, 103, -1, 104, -1, 105, -1, 106, -1, 107, - -1, 108, -1, 109, -1, 110, -1, 97, -1, 98, - -1, 99, -1, 100, -1, 26, -1, 27, -1, 11, - -1, 12, -1, 13, -1, 16, -1, 15, -1, 14, - -1, 19, -1, 22, -1, 24, -1, 172, -1, -1, - 54, 150, 4, 151, -1, -1, 172, 152, -1, -1, - 20, -1, 23, -1, 178, -1, -1, 176, 152, -1, - 42, -1, 44, -1, 43, -1, 45, -1, 47, -1, - 46, -1, 48, -1, 50, -1, -1, 147, -1, 148, - -1, 149, -1, -1, 46, -1, 48, -1, -1, 42, - -1, 43, -1, 44, -1, 47, -1, -1, 44, -1, - 42, -1, -1, 62, -1, 63, -1, 64, -1, 65, - -1, 66, -1, 61, 4, -1, 136, -1, 118, -1, - 135, -1, 119, -1, 138, -1, 139, -1, 141, -1, - 142, -1, 143, -1, -1, 187, 186, -1, 137, -1, - 140, -1, 136, -1, 135, -1, 144, -1, 145, -1, - -1, 189, 188, -1, -1, 146, 22, -1, -1, 53, - 4, -1, -1, 153, 53, 4, -1, 34, 22, -1, - -1, 193, -1, -1, 153, 196, 195, -1, 193, -1, - 53, 4, -1, 11, -1, 12, -1, 13, -1, 16, - -1, 15, -1, 14, -1, 17, -1, 49, -1, 197, - -1, 198, 174, 154, -1, 232, -1, 155, 4, -1, - 198, 150, 202, 151, 189, -1, 10, 150, 202, 151, - 189, -1, 156, 4, 157, 198, 158, -1, 159, 4, - 157, 198, 160, -1, 161, 203, 162, -1, 161, 162, - -1, 159, 161, 203, 162, 160, -1, 159, 161, 162, - 160, -1, 198, 187, -1, 198, -1, 10, -1, 199, - -1, 201, 153, 199, -1, 201, -1, 201, 153, 39, - -1, 39, -1, -1, 198, -1, 203, 153, 198, -1, - 198, 156, 206, 158, -1, 198, 156, 158, -1, 198, - 163, 22, -1, 198, 159, 206, 160, -1, 198, 161, - 206, 162, -1, 198, 161, 162, -1, 198, 159, 161, - 206, 162, 160, -1, 198, 159, 161, 162, 160, -1, - 198, 40, -1, 198, 41, -1, 198, 232, -1, 198, - 205, -1, 198, 25, -1, 170, 3, -1, 170, 5, - -1, 170, 4, -1, 170, 6, -1, 11, 26, -1, - 11, 27, -1, 171, 9, -1, 167, 150, 204, 38, - 198, 151, -1, 116, 150, 204, 243, 151, -1, 130, - 150, 204, 153, 204, 153, 204, 151, -1, 165, 150, - 204, 153, 204, 151, -1, 166, 150, 204, 153, 204, - 151, -1, 89, 168, 150, 204, 153, 204, 151, -1, - 90, 169, 150, 204, 153, 204, 151, -1, 132, 150, - 204, 153, 204, 151, -1, 133, 150, 204, 153, 204, - 153, 204, 151, -1, 134, 150, 204, 153, 204, 153, - 204, 151, -1, 206, 153, 204, -1, 204, -1, 32, - -1, 33, -1, 37, -1, -1, 200, 232, -1, 122, - 150, 209, 38, 198, 151, -1, 211, -1, -1, 212, - -1, 211, 212, -1, -1, 31, 213, 228, -1, -1, - 30, 214, 229, -1, 59, 58, 218, -1, 175, 18, - 198, -1, 175, 18, 10, -1, -1, 177, 181, 208, - 207, 204, 174, 215, 195, -1, -1, 177, 179, 181, - 208, 207, 204, 174, 216, 195, -1, -1, 177, 180, - 181, 208, 207, 198, 174, 217, 195, -1, 177, 181, - 35, 184, 209, -1, 51, 219, -1, 55, 152, 220, - -1, 22, -1, 52, 152, 22, -1, 67, 152, 22, - -1, 156, 221, 158, -1, 221, 153, 22, -1, 22, - -1, -1, 222, 153, 198, 187, 173, -1, 198, 187, - 173, -1, 222, -1, 222, 153, 39, -1, 39, -1, - -1, 185, 200, 176, 150, 223, 151, 189, 194, 191, - 190, -1, 28, -1, 161, -1, 183, 181, 224, 225, - -1, 29, -1, 162, -1, 235, 227, -1, 182, 181, - 224, -1, -1, 60, -1, 3, -1, 4, -1, 9, - -1, 26, -1, 27, -1, 40, -1, 41, -1, 25, - -1, 159, 206, 160, -1, 205, -1, 58, 230, 22, - 153, 22, -1, 7, -1, 8, -1, 172, -1, 176, - -1, 232, -1, 231, -1, 198, 233, -1, 235, 236, - -1, 226, 236, -1, 237, 175, 238, -1, 237, 240, - -1, -1, 21, -1, 68, 234, -1, 68, 10, -1, - 69, 17, 233, -1, 69, 11, 233, 153, 17, 233, - 153, 17, 233, -1, 70, 170, 233, 153, 17, 233, - 156, 239, 158, -1, 70, 170, 233, 153, 17, 233, - 156, 158, -1, 71, 185, 200, 233, 150, 242, 151, - 189, 38, 17, 233, 72, 17, 233, -1, 72, -1, - 73, -1, 239, 170, 231, 153, 17, 233, -1, 170, - 231, 153, 17, 233, -1, 175, 245, -1, 198, 156, - 233, 153, 233, 158, -1, 241, 153, 156, 233, 153, - 233, 158, -1, 198, 187, 233, 187, -1, 17, 187, - 233, 187, -1, 242, 153, 198, 187, 233, 187, -1, - 242, 153, 17, 187, 233, 187, -1, -1, -1, 243, - 153, 234, -1, 57, 56, -1, 56, -1, 165, 198, - 233, 153, 233, -1, 166, 198, 233, 153, 233, -1, - 89, 168, 198, 233, 153, 233, -1, 90, 169, 198, - 233, 153, 233, -1, 167, 234, 38, 198, -1, 130, - 234, 153, 234, 153, 234, -1, 131, 234, 153, 198, - -1, 132, 234, 153, 234, -1, 133, 234, 153, 234, - 153, 234, -1, 134, 234, 153, 234, 153, 234, -1, - 129, 241, -1, 244, 185, 200, 233, 150, 242, 151, - 189, -1, 247, -1, 36, -1, -1, 111, 198, 192, - -1, 111, 198, 153, 11, 233, 192, -1, 112, 198, - 192, -1, 112, 198, 153, 11, 233, 192, -1, 113, - 234, -1, 246, 114, 198, 233, 192, -1, 246, 115, - 234, 153, 198, 233, 192, -1, 116, 198, 233, 243, - -1 +static const short yydefact[] = { 72, + 60, 69, 61, 70, 62, 211, 209, 0, 0, 0, + 0, 0, 0, 82, 71, 72, 207, 86, 89, 0, + 0, 223, 0, 0, 67, 0, 73, 74, 76, 75, + 77, 79, 78, 80, 81, 83, 84, 85, 82, 82, + 202, 208, 87, 88, 82, 212, 90, 91, 92, 93, + 82, 270, 210, 270, 0, 0, 231, 224, 225, 213, + 259, 260, 215, 136, 137, 138, 141, 140, 139, 142, + 143, 0, 0, 0, 0, 261, 262, 144, 214, 146, + 202, 202, 94, 201, 0, 97, 97, 271, 267, 68, + 242, 243, 244, 266, 226, 227, 230, 0, 164, 147, + 0, 0, 0, 0, 153, 165, 0, 0, 164, 0, + 0, 0, 96, 95, 0, 199, 200, 0, 0, 98, + 99, 100, 101, 102, 0, 245, 0, 309, 269, 0, + 228, 163, 113, 159, 161, 0, 0, 0, 0, 0, + 0, 152, 0, 0, 145, 0, 0, 158, 0, 157, + 0, 222, 136, 137, 138, 141, 140, 139, 0, 0, + 66, 66, 103, 0, 239, 240, 241, 308, 294, 0, + 0, 0, 0, 97, 279, 280, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 13, 14, 15, 10, 11, + 12, 0, 0, 0, 0, 0, 0, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 268, 97, + 283, 0, 307, 229, 156, 0, 121, 66, 66, 155, + 0, 166, 0, 121, 66, 66, 0, 203, 184, 185, + 180, 182, 181, 183, 186, 179, 175, 176, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 178, 177, 216, 0, 293, 273, 66, 272, + 0, 0, 54, 0, 0, 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, 127, 127, 314, 66, 66, 305, 0, + 0, 0, 0, 0, 66, 66, 0, 0, 0, 0, + 105, 107, 106, 104, 108, 109, 110, 111, 112, 114, + 162, 160, 149, 150, 151, 154, 65, 148, 218, 220, + 0, 0, 0, 0, 0, 0, 0, 0, 168, 198, + 0, 0, 0, 172, 0, 169, 0, 0, 0, 132, + 237, 248, 249, 250, 255, 251, 252, 253, 254, 246, + 0, 257, 264, 263, 265, 0, 274, 0, 0, 66, + 66, 0, 310, 0, 312, 291, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 66, 0, 118, + 117, 115, 116, 119, 120, 122, 132, 132, 0, 0, + 0, 291, 0, 0, 0, 0, 0, 167, 153, 165, + 0, 170, 171, 0, 0, 0, 0, 217, 236, 113, + 234, 0, 247, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 317, 0, 0, 0, 301, 302, 0, + 0, 0, 0, 299, 0, 127, 0, 219, 221, 66, + 0, 0, 0, 0, 0, 0, 0, 197, 174, 0, + 0, 0, 0, 0, 0, 134, 132, 64, 0, 121, + 0, 256, 0, 0, 290, 0, 0, 127, 128, 127, + 0, 0, 0, 0, 0, 0, 295, 296, 290, 0, + 315, 66, 204, 0, 0, 188, 0, 0, 0, 0, + 173, 0, 0, 66, 129, 135, 133, 63, 233, 235, + 113, 130, 0, 0, 0, 113, 113, 0, 297, 298, + 311, 313, 292, 0, 0, 300, 303, 304, 0, 127, + 0, 0, 0, 194, 0, 0, 190, 191, 187, 64, + 131, 125, 258, 0, 0, 0, 0, 121, 0, 284, + 0, 121, 316, 192, 193, 0, 0, 0, 232, 0, + 123, 0, 277, 0, 0, 105, 107, 113, 113, 0, + 113, 113, 285, 306, 189, 195, 196, 126, 0, 238, + 275, 0, 276, 0, 287, 286, 0, 0, 0, 124, + 0, 0, 0, 113, 113, 0, 0, 0, 289, 288, + 282, 0, 0, 281, 0, 278, 0, 0, 0 }; -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, - 1107, 1108, 1108, 1108, 1108, 1108, 1108, 1109, 1109, 1109, - 1109, 1109, 1109, 1110, 1110, 1110, 1110, 1110, 1110, 1113, - 1113, 1114, 1114, 1115, 1115, 1116, 1116, 1117, 1117, 1121, - 1121, 1122, 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1126, - 1126, 1127, 1127, 1128, 1129, 1134, 1135, 1135, 1135, 1135, - 1135, 1137, 1137, 1137, 1138, 1138, 1140, 1141, 1145, 1149, - 1154, 1154, 1156, 1157, 1162, 1168, 1169, 1170, 1171, 1172, - 1176, 1177, 1178, 1182, 1183, 1184, 1185, 1189, 1190, 1191, - 1195, 1196, 1197, 1198, 1199, 1203, 1204, 1205, 1208, 1209, - 1210, 1211, 1212, 1213, 1214, 1221, 1222, 1223, 1224, 1225, - 1226, 1227, 1228, 1229, 1232, 1233, 1238, 1239, 1240, 1241, - 1242, 1243, 1246, 1247, 1252, 1253, 1260, 1261, 1267, 1268, - 1277, 1285, 1286, 1291, 1292, 1293, 1298, 1311, 1311, 1311, - 1311, 1311, 1311, 1311, 1314, 1318, 1322, 1329, 1334, 1342, - 1372, 1397, 1402, 1412, 1422, 1426, 1436, 1443, 1452, 1459, - 1464, 1469, 1476, 1477, 1484, 1491, 1499, 1505, 1517, 1545, - 1561, 1588, 1616, 1642, 1662, 1688, 1708, 1720, 1727, 1793, - 1803, 1813, 1819, 1829, 1835, 1845, 1850, 1855, 1868, 1880, - 1902, 1910, 1916, 1927, 1932, 1937, 1943, 1949, 1958, 1962, - 1970, 1970, 1973, 1973, 1976, 1988, 2009, 2014, 2022, 2023, - 2027, 2027, 2031, 2031, 2034, 2037, 2061, 2073, 2072, 2084, - 2083, 2093, 2092, 2103, 2143, 2146, 2152, 2162, 2166, 2171, - 2173, 2178, 2183, 2192, 2202, 2213, 2217, 2226, 2235, 2240, - 2374, 2374, 2376, 2385, 2385, 2387, 2392, 2404, 2408, 2413, - 2417, 2421, 2425, 2429, 2433, 2437, 2441, 2445, 2470, 2474, - 2484, 2488, 2492, 2497, 2504, 2504, 2510, 2519, 2523, 2532, - 2541, 2550, 2554, 2561, 2565, 2569, 2574, 2584, 2603, 2612, - 2703, 2707, 2714, 2725, 2738, 2748, 2759, 2769, 2780, 2788, - 2798, 2805, 2808, 2809, 2816, 2820, 2825, 2841, 2858, 2872, - 2886, 2898, 2906, 2913, 2919, 2925, 2931, 2946, 3044, 3049, - 3053, 3060, 3067, 3075, 3082, 3090, 3098, 3112, 3129 +static const short yydefgoto[] = { 260, + 261, 262, 286, 303, 159, 160, 76, 519, 110, 12, + 77, 14, 15, 39, 40, 41, 45, 51, 115, 125, + 330, 225, 406, 333, 590, 571, 383, 476, 552, 428, + 477, 78, 161, 134, 151, 135, 136, 107, 350, 372, + 351, 118, 85, 152, 617, 16, 17, 19, 18, 360, + 407, 408, 60, 22, 58, 98, 431, 432, 126, 167, + 52, 93, 53, 46, 434, 373, 80, 375, 270, 54, + 89, 90, 219, 575, 129, 309, 528, 444, 220, 221, + 222, 223 }; -#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", "ESAPINTVAL", - "EUAPINTVAL", "LOCALVAL_ID", "GLOBALVAL_ID", "FPVAL", "VOID", "INTTYPE", - "FLOAT", "DOUBLE", "X86_FP80", "FP128", "PPC_FP128", "LABEL", "TYPE", - "LOCALVAR", "GLOBALVAR", "LABELSTR", "STRINGCONSTANT", - "ATSTRINGCONSTANT", "PCTSTRINGCONSTANT", "ZEROINITIALIZER", "TRUETOK", - "FALSETOK", "BEGINTOK", "ENDTOK", "DECLARE", "DEFINE", "GLOBAL", - "CONSTANT", "SECTION", "ALIAS", "VOLATILE", "THREAD_LOCAL", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "INTERNAL", "LINKONCE", "WEAK", - "APPENDING", "DLLIMPORT", "DLLEXPORT", "EXTERN_WEAK", "OPAQUE", - "EXTERNAL", "TARGET", "TRIPLE", "ALIGN", "ADDRSPACE", "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", "SIGNEXT", "ZEROEXT", - "NORETURN", "INREG", "SRET", "NOUNWIND", "NOALIAS", "BYVAL", "NEST", - "READNONE", "READONLY", "GC", "DEFAULT", "HIDDEN", "PROTECTED", "'('", - "')'", "'='", "','", "'*'", "'\\\\'", "'['", "'x'", "']'", "'<'", "'>'", - "'{'", "'}'", "'c'", "$accept", "ArithmeticOps", "LogicalOps", "CastOps", - "IPredicates", "FPredicates", "IntType", "FPType", "LocalName", - "OptLocalName", "OptAddrSpace", "OptLocalAssign", "GlobalName", - "OptGlobalAssign", "GlobalAssign", "GVInternalLinkage", - "GVExternalLinkage", "GVVisibilityStyle", "FunctionDeclareLinkage", - "FunctionDefineLinkage", "AliasLinkage", "OptCallingConv", "ParamAttr", - "OptParamAttrs", "FuncAttr", "OptFuncAttrs", "OptGC", "OptAlign", - "OptCAlign", "SectionString", "OptSection", "GlobalVarAttributes", - "GlobalVarAttribute", "PrimType", "Types", "ArgType", "ResultTypes", - "ArgTypeList", "ArgTypeListI", "TypeListI", "ConstVal", "ConstExpr", - "ConstVector", "GlobalType", "ThreadLocal", "AliaseeRef", "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", "ParamList", "IndexList", "OptTailCall", "InstVal", - "OptVolatile", "MemoryInst", 0 +static const short yypact[] = { 253, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, -4, -114, -16, + -103, 46, -78, 12,-32768, 392,-32768, 149, 177, -44, + -31,-32768, -1, 154,-32768, 1529,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -37, -37, + 203,-32768,-32768,-32768, -37,-32768,-32768,-32768,-32768,-32768, + -37, 190,-32768, 2, 195, 217, 245,-32768,-32768,-32768, +-32768,-32768, 124,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 274, 278, 1, 505,-32768,-32768,-32768, 62,-32768, + 256, 256, 200,-32768, 119, 224, 224,-32768,-32768, 100, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, 57, 1052,-32768, + 140, 148, 604, 124,-32768, 62, -69, 157, 1052, 155, + 119, 119,-32768,-32768, 1295,-32768,-32768, 1569, 306,-32768, +-32768,-32768,-32768,-32768, 1627,-32768, -17, 1851,-32768, 289, +-32768,-32768, 62,-32768, 163, 166, 1645, 1645, 158, -58, + 1645,-32768, 315, 171,-32768, 1569, 1645, 124, 170, 62, + 58,-32768, 41, 314, 318, 320, 321, 329, 226, 330, + 1107, 270,-32768, 30,-32768,-32768,-32768,-32768,-32768, 288, + 1685, 137, 336, 224,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 388, 781, 1645, 1645, 1645, 1645,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1645, + 1645, 1645, 1645, 1645, 1645, 1645, 1645, 1645,-32768, 224, +-32768, 70,-32768,-32768, 207, 1374,-32768, -15, -14,-32768, + 197, 62, 208,-32768, 270, -13, 1295,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 388, 781, + 212, 213, 214, 220, 221, 1414, 1725, 782, 351, 228, + 229, 231,-32768,-32768,-32768, 232,-32768, 124, 696,-32768, + 834, 834,-32768, 834, 1627,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 1645,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 1645, 15, 29,-32768, 696, 7, 205, 223, + 235, 236, 237, 238, 696, 696, 346, 1627, 1645, 1645, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 120,-32768,-32768,-32768,-32768, 120,-32768, 155, + 358, 248, 249, 1569, 1569, 1569, 1569, 1569,-32768,-32768, + 69, 1007, -61,-32768, -56,-32768, 1569, 1569, 1569, 251, + 1454,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 341, + 1569,-32768,-32768,-32768,-32768, 252,-32768, 255, 834, 696, + 696, 19,-32768, 23,-32768,-32768, 834, 246, 1645, 1645, + 1645, 1645, 1645, 260, 266, 1645, 834, 696, 271,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, 251, 251, 1645, 1569, + 1569,-32768, 272, 275, 276, 277, 1569,-32768, 267, 962, + -55,-32768,-32768, 286, 291, 371, 18,-32768,-32768, 62, + 292, 280,-32768, 420, -57, 431, 433, 302, 300, 301, + 834, 453, 834, 305, 307, 834, 309, 62,-32768, 310, + 311, 834, 834, 62, 316, 312, 1645,-32768,-32768, -18, + 323, 324, 92, 1569, 1569, 1569, 1569,-32768,-32768, 299, + 1569, 1569, 1645, 446, 469,-32768, 251, 729, 1472,-32768, + 339,-32768, 834, 834, 1743, 834, 834, 312,-32768, 312, + 1645, 834, 340, 1645, 1645, 1645,-32768,-32768, 1743, 421, +-32768, 696,-32768, 1569, 1569,-32768, 342, 343, 344, 345, +-32768, 348, 349, 16,-32768,-32768,-32768,-32768,-32768,-32768, + 62, -6, 474, 350, 352, 64, 62, 101,-32768,-32768, +-32768,-32768,-32768, 347, 834,-32768,-32768,-32768, 115, 312, + 353, 356, 1569,-32768, 1569, 1569,-32768,-32768,-32768, 729, +-32768, 448,-32768, 485, -5, 555, 555,-32768, 1800,-32768, + 365,-32768,-32768,-32768,-32768, 363, 379, 380,-32768, 530, + 390, 834,-32768, 1246, -2, 359, 389,-32768,-32768, 5, + 64, 62,-32768, 120,-32768,-32768,-32768,-32768, 516,-32768, +-32768, 391,-32768, 1246, 207, 207, 524, 555, 555,-32768, + 525, 394, 834,-32768,-32768, 834, 526, 473, 207, 207, +-32768, 834, 531,-32768, 834,-32768, 551, 556,-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, - 40, 41, 61, 44, 42, 92, 91, 120, 93, 60, - 62, 123, 125, 99 +static const short yypgoto[] = { 427, + 437, 439, 319, 322, -172,-32768, 0, 11, -149, 480, + 10,-32768,-32768,-32768,-32768, 49,-32768,-32768,-32768, -147, +-32768, -401,-32768, -222,-32768,-32768, -281, 51,-32768, -375, +-32768,-32768, -24, 357, -117,-32768, 462, 481, -111, -157, + -243, 169, 210, 354,-32768,-32768, 560,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 498,-32768, +-32768,-32768,-32768,-32768,-32768, -557, -46, -66, -193,-32768, + 532,-32768,-32768,-32768,-32768,-32768, 88, 176,-32768,-32768, +-32768,-32768 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 164, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 166, 166, 166, 166, 166, 166, 167, 167, 167, - 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, - 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, - 169, 169, 169, 169, 169, 170, 171, 171, 171, 171, - 171, 172, 172, 172, 173, 173, 174, 174, 175, 175, - 176, 176, 177, 177, 178, 179, 179, 179, 179, 179, - 180, 180, 180, 181, 181, 181, 181, 182, 182, 182, - 183, 183, 183, 183, 183, 184, 184, 184, 185, 185, - 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 187, 187, 188, 188, 188, 188, - 188, 188, 189, 189, 190, 190, 191, 191, 192, 192, - 193, 194, 194, 195, 195, 196, 196, 197, 197, 197, - 197, 197, 197, 197, 198, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 199, 200, 200, - 201, 201, 202, 202, 202, 202, 203, 203, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 205, 205, - 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, - 207, 207, 208, 208, 209, 209, 210, 210, 211, 211, - 213, 212, 214, 212, 212, 212, 212, 215, 212, 216, - 212, 217, 212, 212, 212, 212, 218, 219, 219, 220, - 221, 221, 221, 222, 222, 223, 223, 223, 223, 224, - 225, 225, 226, 227, 227, 228, 229, 230, 230, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 232, 232, 232, 232, 233, 233, 234, 235, 235, 236, - 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, - 238, 238, 239, 239, 240, 241, 241, 242, 242, 242, - 242, 242, 243, 243, 244, 244, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, - 246, 247, 247, 247, 247, 247, 247, 247, 247 -}; -/* 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, 0, 4, 0, 2, 0, - 1, 1, 1, 0, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, - 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 2, 1, 1, 1, 1, - 1, 1, 0, 2, 0, 2, 0, 2, 0, 3, - 2, 0, 1, 0, 3, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 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, 2, 2, 6, 5, - 8, 6, 6, 7, 7, 6, 8, 8, 3, 1, - 1, 1, 1, 0, 2, 6, 1, 0, 1, 2, - 0, 3, 0, 3, 3, 3, 3, 0, 8, 0, - 9, 0, 9, 5, 2, 3, 1, 3, 3, 3, - 3, 1, 0, 5, 3, 1, 3, 1, 0, 10, - 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, 4, 4, 6, - 6, 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, 5, 7, 4 -}; +#define YYLAST 1985 -/* 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[] = -{ - 73, 61, 70, 62, 71, 63, 212, 210, 0, 0, - 0, 0, 0, 0, 83, 72, 0, 73, 208, 87, - 90, 0, 0, 224, 0, 0, 68, 0, 74, 75, - 77, 76, 78, 80, 79, 81, 82, 84, 85, 86, - 83, 83, 203, 1, 209, 88, 89, 83, 213, 91, - 92, 93, 94, 83, 271, 211, 271, 0, 0, 232, - 225, 226, 214, 260, 261, 216, 137, 138, 139, 142, - 141, 140, 143, 144, 0, 0, 0, 0, 262, 263, - 145, 215, 147, 203, 203, 95, 202, 0, 98, 98, - 272, 268, 69, 243, 244, 245, 267, 227, 228, 231, - 0, 165, 148, 0, 0, 0, 0, 154, 166, 0, - 0, 165, 0, 0, 0, 97, 96, 0, 200, 201, - 0, 0, 99, 100, 101, 102, 103, 0, 246, 0, - 310, 270, 0, 229, 164, 114, 160, 162, 0, 0, - 0, 0, 0, 0, 153, 0, 0, 146, 0, 0, - 159, 0, 158, 0, 223, 137, 138, 139, 142, 141, - 140, 0, 0, 67, 67, 104, 0, 240, 241, 242, - 309, 295, 0, 0, 0, 0, 98, 280, 281, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 14, 15, - 16, 11, 12, 13, 0, 0, 0, 0, 0, 0, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 269, 98, 284, 0, 308, 230, 157, 0, 122, - 67, 67, 156, 0, 167, 0, 122, 67, 67, 0, - 204, 185, 186, 181, 183, 182, 184, 187, 180, 176, - 177, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 179, 178, 217, 0, 294, - 274, 67, 273, 0, 0, 55, 0, 0, 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, 128, 128, 315, 67, - 67, 306, 0, 0, 0, 0, 0, 67, 67, 0, - 0, 0, 0, 106, 108, 107, 105, 109, 110, 111, - 112, 113, 115, 163, 161, 150, 151, 152, 155, 66, - 149, 219, 221, 0, 0, 0, 0, 0, 0, 0, - 0, 169, 199, 0, 0, 0, 173, 0, 170, 0, - 0, 0, 133, 238, 249, 250, 251, 256, 252, 253, - 254, 255, 247, 0, 258, 265, 264, 266, 0, 275, - 0, 0, 67, 67, 0, 311, 0, 313, 292, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 67, 0, 119, 118, 116, 117, 120, 121, 123, 133, - 133, 0, 0, 0, 292, 0, 0, 0, 0, 0, - 168, 154, 166, 0, 171, 172, 0, 0, 0, 0, - 218, 237, 114, 235, 0, 248, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 318, 0, 0, 0, - 302, 303, 0, 0, 0, 0, 300, 0, 128, 0, - 220, 222, 67, 0, 0, 0, 0, 0, 0, 0, - 198, 175, 0, 0, 0, 0, 0, 0, 135, 133, - 65, 0, 122, 0, 257, 0, 0, 291, 0, 0, - 128, 129, 128, 0, 0, 0, 0, 0, 0, 296, - 297, 291, 0, 316, 67, 205, 0, 0, 189, 0, - 0, 0, 0, 174, 0, 0, 67, 130, 136, 134, - 64, 234, 236, 114, 131, 0, 0, 0, 114, 114, - 0, 298, 299, 312, 314, 293, 0, 0, 301, 304, - 305, 0, 128, 0, 0, 0, 195, 0, 0, 191, - 192, 188, 65, 132, 126, 259, 0, 0, 0, 0, - 122, 0, 285, 0, 122, 317, 193, 194, 0, 0, - 0, 233, 0, 124, 0, 278, 0, 0, 106, 108, - 114, 114, 0, 114, 114, 286, 307, 190, 196, 197, - 127, 0, 239, 276, 0, 277, 0, 288, 287, 0, - 0, 0, 125, 0, 0, 0, 114, 114, 0, 0, - 0, 290, 289, 283, 0, 0, 282, 0, 279 -}; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 262, 263, 264, 288, 305, 161, 162, 78, 521, - 112, 12, 79, 14, 15, 40, 41, 42, 47, 53, - 117, 127, 332, 227, 408, 335, 592, 573, 385, 478, - 554, 430, 479, 80, 163, 136, 153, 137, 138, 109, - 352, 374, 353, 120, 87, 154, 16, 17, 18, 20, - 19, 362, 409, 410, 62, 23, 60, 100, 433, 434, - 128, 169, 54, 95, 55, 48, 436, 375, 82, 377, - 272, 56, 91, 92, 221, 577, 131, 311, 530, 446, - 222, 223, 224, 225 +static const short yytable[] = { 11, + 274, 79, 306, 263, 102, 273, 162, 164, 273, 13, + 165, 338, 265, 353, 355, 11, 592, 310, 311, 312, + 313, 314, 88, 385, 317, 13, 275, 474, 478, 441, + 91, 458, 459, 443, 235, 108, 602, 23, 108, 108, + 108, 24, 597, -54, -54, -54, -54, 20, 25, 2, + 106, 474, 4, 28, 29, 30, 31, 32, 33, 34, + 108, 35, 21, 26, 61, 62, 239, 240, 108, 108, + 475, 442, 318, 27, 133, 442, 1, 2, 106, 3, + 4, 5, 108, 141, 133, 339, 340, 81, 82, 11, + 150, 417, 142, 86, 141, 417, 417, 417, 422, 87, + 150, 517, 482, 231, 238, 423, 470, 55, 421, 36, + 37, 38, 228, 229, 264, 108, 232, -142, 1, 550, + 56, 3, 236, 5, 556, 557, 399, 435, 400, 401, + 402, 109, 503, 403, 109, 109, 109, 404, 405, 400, + 401, 402, 334, 166, 403, 335, 269, 271, 404, 405, + 116, 117, 573, 272, 57, 593, 109, 379, 36, 37, + 38, 103, 387, 92, 109, 109, 549, 382, -66, 304, + 305, 269, 307, 266, 501, 59, 595, 596, 109, 598, + 599, 384, -66, 319, 320, 308, 269, 269, 269, 269, + 269, 315, 316, 269, 43, 447, 44, 449, 450, 451, + 397, 133, 609, 610, 376, 377, 531, 378, 532, 130, + 88, 109, 150, -142, 131, -66, 95, -142, 47, 48, + 49, 417, 374, 50, 374, 374, 418, 374, 241, 242, + 243, 244, 412, 413, 414, 415, 416, 83, 96, 84, + 386, 113, 506, 114, 491, 424, 425, 426, 394, 395, + 150, 558, -206, 559, 400, 401, 402, 522, 563, 403, + 374, 380, 263, 404, 405, 562, 97, 559, 374, 374, + -68, 1, 2, 99, 3, 4, 5, 100, 381, 146, + 147, 101, 6, 7, 119, 120, 121, 122, 123, 124, + 111, 112, 84, 150, 398, 269, 137, 533, 461, 462, + 536, 537, 538, 8, 138, 468, 143, 9, 145, 163, + 224, 10, 438, 439, 440, 226, 227, 230, 233, 237, + 445, 234, -55, 108, 321, 322, -56, 420, -59, -58, + 455, 456, 374, 374, 374, 580, 430, -57, 245, 584, + 374, 323, 324, 267, 325, 326, 273, 327, 328, 329, + 374, 374, 507, 508, 509, 510, 336, 388, 337, 512, + 513, 344, 345, 346, 269, 448, 269, 269, 269, 347, + 348, 454, 356, 264, 488, 389, 490, 357, 358, 493, + 359, 361, 574, 396, 460, 497, 498, 390, 391, 392, + 393, -205, 541, 542, 374, 409, 374, 410, 411, 374, + 433, 446, 594, 427, 436, 374, 374, 437, 473, -68, + 1, 2, 452, 3, 4, 5, 524, 525, 453, 529, + 530, 6, 7, 457, 464, 534, 469, 465, 466, 467, + 480, 566, 502, 567, 568, 540, 374, 374, 471, 374, + 374, 481, 8, 472, 479, 374, 9, 483, 514, 484, + 10, 485, 486, 487, 521, 374, 489, 491, 511, 492, + 527, 494, 495, 496, 500, 499, 269, 515, 561, 269, + 269, 269, 516, 442, 527, 504, 505, 518, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 374, 578, + 579, 523, 535, 544, 543, 553, 545, 546, 547, 548, + 570, 572, 554, 564, 560, 591, 565, 555, -17, 374, + 374, 61, 62, 585, 104, 64, 65, 66, 67, 68, + 69, 70, 583, 1, 2, 374, 3, 4, 5, 586, + 587, 604, 605, 588, 582, 589, 608, 600, -18, 611, + 603, 606, 612, 601, 613, 614, 607, 615, 616, 518, + 618, 374, 374, 71, 216, 619, 374, 362, 363, 374, + 569, 61, 62, 364, 217, 374, 218, 342, 374, 128, + 144, 343, 551, 1, 2, 42, 3, 4, 5, 365, + 366, 367, 332, 140, 127, 94, 539, 463, 0, 0, + 341, 0, 0, 0, 368, 369, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 61, 62, 370, 104, 64, 65, 66, 67, 68, 69, + 70, 0, 1, 2, 0, 3, 4, 5, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 249, 250, 0, 0, 0, 0, 0, + 0, 0, 71, 0, 0, 0, 0, 0, 0, 72, + 73, 0, 0, 74, 0, 75, 105, 0, 0, 0, + 251, 198, 576, 577, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 0, 252, 0, 253, 254, 255, 323, + 324, 0, 325, 326, 0, 327, 328, 329, 362, 363, + 0, 0, 61, 62, 364, 0, 0, 0, 0, 0, + 0, 0, 0, 371, 1, 2, 0, 3, 4, 5, + 365, 366, 367, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 108, + 3, 0, 5, 370, 0, 0, 0, 0, 72, 73, + 0, 0, 74, 0, 75, 139, 0, 0, 0, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 249, 250, 0, 0, 61, 62, + 0, 104, 153, 154, 155, 156, 157, 158, 70, 0, + 1, 2, 0, 3, 4, 5, 287, 288, 0, 0, + 0, 251, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 0, 252, 0, 253, 254, 255, + 71, 0, 0, 0, 0, 0, 362, 363, 0, 0, + 61, 62, 364, 0, 0, 109, 321, 322, 0, 0, + 0, 0, 1, 2, 371, 3, 4, 5, 365, 366, + 367, 0, 0, 323, 324, 0, 325, 326, 0, 327, + 328, 329, 0, 368, 369, 0, 0, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 370, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 249, 250, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, + 74, 0, 75, 354, 0, 0, 0, 0, 0, 251, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 0, 252, 0, 253, 254, 255, 61, 62, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 3, 4, 5, 246, 0, 0, 0, + 0, 0, 371, 0, 0, 0, 0, 0, 0, 0, + 0, 247, 248, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 61, 62, 108, 104, 153, 154, 155, + 156, 157, 158, 70, 0, 1, 2, 0, 3, 4, + 5, 0, 0, 0, 0, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 249, 250, 0, 0, 0, 71, 0, 0, 61, 62, + 0, 104, 64, 65, 66, 67, 68, 69, 70, 0, + 1, 2, 0, 3, 4, 5, 0, 251, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 132, 252, 0, 253, 254, 255, 0, 0, 0, 0, + 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 109, 0, 61, 62, -66, 0, 256, 0, 0, + 257, 0, 258, 0, 259, 1, 2, 0, 3, 4, + 5, 246, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 247, 248, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 108, 72, 73, 0, 0, 74, 0, 75, 419, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 249, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, + 74, 0, 75, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 251, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 0, 252, 0, 253, 254, + 255, 0, 0, 0, 0, 0, 0, 0, 362, 363, + 0, 0, 0, 0, 364, 0, 109, 0, 0, 0, + 0, 0, 256, 0, 0, 257, 0, 258, 0, 259, + 365, 366, 367, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 368, 369, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 61, 62, 370, 148, 64, 65, 66, 67, 68, + 69, 70, 0, 1, 2, 0, 3, 4, 5, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 249, 250, 0, 0, 0, 0, + 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 251, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 0, 252, 0, 253, 254, 255, + 61, 62, 0, 104, 64, 65, 66, 67, 68, 69, + 70, 0, 1, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 371, 0, 0, 0, 0, 0, + 0, 0, 331, 0, 0, 0, 149, 0, 0, 0, + 61, 62, 71, 104, 153, 154, 155, 156, 157, 158, + 70, 0, 1, 2, 0, 3, 4, 5, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, + 73, 0, 0, 74, 0, 75, 0, 0, 0, 0, + 61, 62, 71, 104, 64, 65, 66, 67, 68, 69, + 70, 0, 1, 2, 0, 3, 4, 5, 61, 62, + 0, 104, 64, 65, 66, 67, 68, 69, 70, 0, + 1, 2, 429, 3, 4, 5, 0, 0, 0, 0, + 0, 0, 71, 0, 0, 0, 0, 0, 0, 0, + 520, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 71, 0, 0, 0, 0, 0, 0, 0, 72, 73, + 0, 0, 74, 0, 75, 61, 62, 0, 63, 64, + 65, 66, 67, 68, 69, 70, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 72, 73, + 0, 349, 74, 0, 75, 61, 62, 71, 104, 153, + 154, 155, 156, 157, 158, 70, 0, 1, 2, 0, + 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 72, 73, + 0, 0, 74, 0, 75, 0, 0, 71, 0, 0, + 0, 0, 0, 0, 0, 0, 72, 73, 0, 0, + 74, 0, 75, 61, 62, 0, 148, 64, 65, 66, + 67, 68, 69, 70, 0, 1, 2, 0, 3, 4, + 5, 61, 62, 0, 104, 64, 65, 66, 67, 68, + 69, 70, 0, 1, 2, 0, 3, 4, 5, 0, + 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, + 0, 0, 0, 72, 73, 0, 0, 74, 0, 75, + 0, 61, 62, 71, 268, 64, 65, 66, 67, 68, + 69, 70, 0, 1, 2, 0, 3, 4, 5, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 72, 73, 0, 0, 74, 0, 75, + 0, 61, 62, 71, 104, 153, 154, 155, 156, 157, + 158, 70, 0, 1, 2, 0, 3, 4, 5, 61, + 62, 0, 104, 64, 65, 66, 67, 68, 69, 526, + 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, + 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, + 0, 72, 73, 0, 0, 74, 0, 75, 0, 0, + 0, 71, 0, 0, 0, 0, 0, 0, 0, 72, + 73, 0, 0, 74, 0, 75, 61, 62, 0, 104, + 64, 65, 66, 67, 68, 69, 581, 0, 1, 2, + 0, 3, 4, 5, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, + 73, 0, 0, 74, 0, 75, 0, 0, 71, 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, 72, + 73, 0, 0, 74, 0, 352, 168, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 72, 73, 0, + 0, 74, 0, 75, 0, 0, 169, 170, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 72, 73, 0, 0, 74, 0, + 75, 194, 195, 196, 0, 0, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -544 -static const yytype_int16 yypact[] = -{ - 291, -544, -544, -544, -544, -544, -544, -544, -9, -121, - -14, -80, 72, -50, 19, -544, 110, 423, -544, 113, - 13, -37, -33, -544, -16, 121, -544, 1532, -544, -544, - -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, - 128, 128, 160, -544, -544, -544, -544, 128, -544, -544, - -544, -544, -544, 128, 133, -544, 3, 183, 189, 192, - -544, -544, -544, -544, -544, 32, -544, -544, -544, -544, - -544, -544, -544, -544, 215, 218, 1, 509, -544, -544, - -544, -18, -544, 190, 190, 184, -544, 260, 219, 219, - -544, -544, 199, -544, -544, -544, -544, -544, -544, -544, - -53, 1055, -544, 86, 102, 748, 32, -544, -18, -108, - 118, 1055, 109, 260, 260, -544, -544, 1298, -544, -544, - 1572, 267, -544, -544, -544, -544, -544, 1630, -544, -17, - 1854, -544, 256, -544, -544, -18, -544, 136, 135, 1648, - 1648, 137, -85, 1648, -544, 300, 157, -544, 1572, 1648, - 32, 162, -18, 74, -544, 44, 307, 311, 324, 334, - 335, 236, 336, 1110, 293, -544, 101, -544, -544, -544, - -544, -544, 292, 1688, 63, 338, 219, -544, -544, -544, - -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, - -544, -544, -544, -544, 392, 1194, 1648, 1648, 1648, 1648, - -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, - -544, -544, 1648, 1648, 1648, 1648, 1648, 1648, 1648, 1648, - 1648, -544, 219, -544, 49, -544, -544, 269, 1377, -544, - -42, -38, -544, 197, -18, 200, -544, 293, -13, 1298, - -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, - -544, 392, 1194, 202, 209, 212, 213, 214, 1417, 1728, - 788, 348, 221, 223, 224, -544, -544, -544, 226, -544, - 32, 699, -544, 837, 837, -544, 837, 1630, -544, -544, - -544, -544, -544, -544, -544, -544, -544, -544, 1648, -544, - -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, - -544, -544, -544, -544, -544, 1648, -8, -2, -544, 699, - -15, 222, 227, 229, 230, 239, 245, 699, 699, 339, - 1630, 1648, 1648, -544, -544, -544, -544, -544, -544, -544, - -544, -544, -544, -544, -544, 120, -544, -544, -544, -544, - 120, -544, 109, 340, 249, 250, 1572, 1572, 1572, 1572, - 1572, -544, -544, -47, 1010, -4, -544, -75, -544, 1572, - 1572, 1572, 248, 1457, -544, -544, -544, -544, -544, -544, - -544, -544, 329, 1572, -544, -544, -544, -544, 262, -544, - 263, 837, 699, 699, 23, -544, 31, -544, -544, 837, - 246, 1648, 1648, 1648, 1648, 1648, 264, 265, 1648, 837, - 699, 266, -544, -544, -544, -544, -544, -544, -544, 248, - 248, 1648, 1572, 1572, -544, 273, 274, 275, 276, 1572, - -544, 271, 965, -67, -544, -544, 283, 284, 371, 6, - -544, -544, -18, 285, 288, -544, 398, 16, 427, 431, - 301, 297, 299, 837, 452, 837, 305, 310, 837, 312, - -18, -544, 313, 323, 837, 837, -18, 314, 326, 1648, - -544, -544, 34, 328, 343, 154, 1572, 1572, 1572, 1572, - -544, -544, 317, 1572, 1572, 1648, 438, 489, -544, 248, - 131, 1475, -544, 344, -544, 837, 837, 1746, 837, 837, - 326, -544, 326, 1648, 837, 345, 1648, 1648, 1648, -544, - -544, 1746, 448, -544, 699, -544, 1572, 1572, -544, 351, - 354, 353, 356, -544, 360, 361, 79, -544, -544, -544, - -544, -544, -544, -18, -6, 485, 362, 357, 29, -18, - 173, -544, -544, -544, -544, -544, 369, 837, -544, -544, - -544, 176, 326, 363, 379, 1572, -544, 1572, 1572, -544, - -544, -544, 131, -544, 481, -544, 521, -1, 558, 558, - -544, 1803, -544, 381, -544, -544, -544, -544, 389, 391, - 394, -544, 539, 400, 837, -544, 1249, 2, 397, 399, - -544, -544, 80, 29, -18, -544, 120, -544, -544, -544, - -544, 526, -544, -544, 401, -544, 1249, 269, 269, 538, - 558, 558, -544, 540, 403, 837, -544, -544, 837, 542, - 488, 269, 269, -544, 837, 546, -544, 837, -544 +static const short yycheck[] = { 0, + 173, 26, 196, 161, 4, 11, 118, 125, 11, 0, + 28, 234, 162, 257, 258, 16, 574, 211, 212, 213, + 214, 215, 21, 305, 218, 16, 174, 34, 430, 11, + 29, 407, 408, 11, 146, 54, 594, 152, 54, 54, + 54, 58, 38, 3, 4, 5, 6, 52, 152, 20, + 75, 34, 23, 42, 43, 44, 45, 46, 47, 48, + 54, 50, 67, 18, 7, 8, 26, 27, 54, 54, + 53, 53, 220, 152, 99, 53, 19, 20, 103, 22, + 23, 24, 54, 153, 109, 235, 236, 39, 40, 90, + 115, 153, 162, 45, 153, 153, 153, 153, 160, 51, + 125, 477, 160, 162, 151, 162, 162, 152, 352, 147, + 148, 149, 137, 138, 161, 54, 141, 54, 19, 521, + 152, 22, 147, 24, 526, 527, 320, 371, 135, 136, + 137, 150, 151, 140, 150, 150, 150, 144, 145, 135, + 136, 137, 158, 161, 140, 160, 171, 11, 144, 145, + 32, 33, 158, 17, 156, 158, 150, 275, 147, 148, + 149, 161, 156, 162, 150, 150, 151, 153, 154, 194, + 195, 196, 197, 164, 456, 22, 578, 579, 150, 581, + 582, 153, 154, 114, 115, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 46, 389, 48, 391, 392, 393, + 318, 226, 604, 605, 271, 272, 488, 274, 490, 153, + 21, 150, 237, 150, 158, 154, 22, 154, 42, 43, + 44, 153, 269, 47, 271, 272, 158, 274, 3, 4, + 5, 6, 344, 345, 346, 347, 348, 35, 22, 37, + 307, 42, 151, 44, 153, 357, 358, 359, 315, 316, + 275, 151, 0, 153, 135, 136, 137, 480, 540, 140, + 307, 286, 420, 144, 145, 151, 22, 153, 315, 316, + 18, 19, 20, 150, 22, 23, 24, 4, 303, 111, + 112, 4, 30, 31, 61, 62, 63, 64, 65, 66, + 81, 82, 37, 318, 319, 320, 157, 491, 410, 411, + 494, 495, 496, 51, 157, 417, 150, 55, 154, 4, + 22, 59, 379, 380, 381, 153, 151, 160, 4, 150, + 387, 151, 9, 54, 118, 119, 9, 352, 9, 9, + 397, 398, 379, 380, 381, 558, 361, 9, 9, 562, + 387, 135, 136, 56, 138, 139, 11, 141, 142, 143, + 397, 398, 464, 465, 466, 467, 160, 153, 151, 471, + 472, 150, 150, 150, 389, 390, 391, 392, 393, 150, + 150, 396, 22, 420, 441, 153, 443, 150, 150, 446, + 150, 150, 555, 38, 409, 452, 453, 153, 153, 153, + 153, 0, 504, 505, 441, 38, 443, 150, 150, 446, + 60, 156, 575, 153, 153, 452, 453, 153, 38, 18, + 19, 20, 153, 22, 23, 24, 483, 484, 153, 486, + 487, 30, 31, 153, 153, 492, 160, 153, 153, 153, + 151, 543, 457, 545, 546, 502, 483, 484, 153, 486, + 487, 22, 51, 153, 153, 492, 55, 17, 473, 17, + 59, 150, 153, 153, 479, 502, 4, 153, 160, 153, + 485, 153, 153, 153, 153, 150, 491, 22, 535, 494, + 495, 496, 4, 53, 499, 153, 153, 478, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 535, 556, + 557, 153, 153, 151, 153, 22, 153, 153, 151, 151, + 53, 17, 153, 151, 158, 572, 151, 156, 150, 556, + 557, 7, 8, 151, 10, 11, 12, 13, 14, 15, + 16, 17, 158, 19, 20, 572, 22, 23, 24, 151, + 151, 598, 599, 4, 559, 146, 603, 22, 150, 606, + 17, 17, 17, 153, 72, 612, 153, 17, 615, 550, + 0, 598, 599, 49, 128, 0, 603, 3, 4, 606, + 550, 7, 8, 9, 128, 612, 128, 249, 615, 90, + 109, 250, 522, 19, 20, 16, 22, 23, 24, 25, + 26, 27, 226, 103, 87, 54, 499, 412, -1, -1, + 237, -1, -1, -1, 40, 41, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 7, 8, 58, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, -1, -1, -1, -1, -1, + -1, -1, 49, -1, -1, -1, -1, -1, -1, 155, + 156, -1, -1, 159, -1, 161, 162, -1, -1, -1, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, -1, 130, -1, 132, 133, 134, 135, + 136, -1, 138, 139, -1, 141, 142, 143, 3, 4, + -1, -1, 7, 8, 9, -1, -1, -1, -1, -1, + -1, -1, -1, 159, 19, 20, -1, 22, 23, 24, + 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 19, -1, 54, + 22, -1, 24, 58, -1, -1, -1, -1, 155, 156, + -1, -1, 159, -1, 161, 162, -1, -1, -1, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, -1, -1, 7, 8, + -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, 26, 27, -1, -1, + -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, -1, 130, -1, 132, 133, 134, + 49, -1, -1, -1, -1, -1, 3, 4, -1, -1, + 7, 8, 9, -1, -1, 150, 118, 119, -1, -1, + -1, -1, 19, 20, 159, 22, 23, 24, 25, 26, + 27, -1, -1, 135, 136, -1, 138, 139, -1, 141, + 142, 143, -1, 40, 41, -1, -1, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 58, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 155, 156, -1, -1, + 159, -1, 161, 162, -1, -1, -1, -1, -1, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, -1, 130, -1, 132, 133, 134, 7, 8, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 19, 20, -1, 22, 23, 24, 25, -1, -1, -1, + -1, -1, 159, -1, -1, -1, -1, -1, -1, -1, + -1, 40, 41, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 7, 8, 54, 10, 11, 12, 13, + 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, + 24, -1, -1, -1, -1, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, -1, -1, -1, 49, -1, -1, 7, 8, + -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, -1, 22, 23, 24, -1, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 39, 130, -1, 132, 133, 134, -1, -1, -1, -1, + 49, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 150, -1, 7, 8, 154, -1, 156, -1, -1, + 159, -1, 161, -1, 163, 19, 20, -1, 22, 23, + 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 40, 41, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 54, 155, 156, -1, -1, 159, -1, 161, 162, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 155, 156, -1, -1, + 159, -1, 161, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, -1, 130, -1, 132, 133, + 134, -1, -1, -1, -1, -1, -1, -1, 3, 4, + -1, -1, -1, -1, 9, -1, 150, -1, -1, -1, + -1, -1, 156, -1, -1, 159, -1, 161, -1, 163, + 25, 26, 27, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 7, 8, 58, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, -1, -1, -1, -1, + -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, -1, 130, -1, 132, 133, 134, + 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, + -1, -1, -1, -1, 159, -1, -1, -1, -1, -1, + -1, -1, 39, -1, -1, -1, 122, -1, -1, -1, + 7, 8, 49, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 155, + 156, -1, -1, 159, -1, 161, -1, -1, -1, -1, + 7, 8, 49, 10, 11, 12, 13, 14, 15, 16, + 17, -1, 19, 20, -1, 22, 23, 24, 7, 8, + -1, 10, 11, 12, 13, 14, 15, 16, 17, -1, + 19, 20, 39, 22, 23, 24, -1, -1, -1, -1, + -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, + 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 49, -1, -1, -1, -1, -1, -1, -1, 155, 156, + -1, -1, 159, -1, 161, 7, 8, -1, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 155, 156, + -1, 158, 159, -1, 161, 7, 8, 49, 10, 11, + 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, + 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 155, 156, + -1, -1, 159, -1, 161, -1, -1, 49, -1, -1, + -1, -1, -1, -1, -1, -1, 155, 156, -1, -1, + 159, -1, 161, 7, 8, -1, 10, 11, 12, 13, + 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, + 24, 7, 8, -1, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, + -1, -1, -1, -1, -1, 49, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + -1, 7, 8, 49, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, + -1, 7, 8, 49, 10, 11, 12, 13, 14, 15, + 16, 17, -1, 19, 20, -1, 22, 23, 24, 7, + 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, + -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, + -1, -1, -1, 49, -1, -1, -1, -1, -1, -1, + -1, 155, 156, -1, -1, 159, -1, 161, -1, -1, + -1, 49, -1, -1, -1, -1, -1, -1, -1, 155, + 156, -1, -1, 159, -1, 161, 7, 8, -1, 10, + 11, 12, 13, 14, 15, 16, 17, -1, 19, 20, + -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 155, + 156, -1, -1, 159, -1, 161, -1, -1, 49, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 155, + 156, -1, -1, 159, -1, 161, 36, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 155, 156, -1, + -1, 159, -1, 161, -1, -1, 56, 57, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 155, 156, -1, -1, 159, -1, + 161, 111, 112, 113, -1, -1, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134 }; +/* -*-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[] = -{ - -544, 434, 439, 440, 320, 316, -171, -544, 0, 22, - -134, 483, 9, -544, -544, -544, -544, 191, -544, -544, - -544, -149, -544, -403, -544, -230, -544, -544, -284, 52, - -544, -372, -544, -544, -26, 358, -119, -544, 468, 482, - -113, -161, -245, 225, 257, 350, -544, -544, 573, -544, - -544, -544, -544, -544, -544, -544, -544, -544, -544, -544, - 502, -544, -544, -544, -544, -544, -544, -543, -64, 14, - -195, -544, 536, -544, -544, -544, -544, -544, 92, 180, - -544, -544, -544, -544 -}; +/* 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 -208 -static const yytype_int16 yytable[] = -{ - 11, 81, 265, 308, 276, 104, 340, 164, 166, 13, - 275, 167, 110, 275, 355, 357, 110, 11, 312, 313, - 314, 315, 316, 387, 90, 319, 13, 277, 476, 480, - 267, 24, 93, 594, 443, 237, 110, 460, 461, 110, - 476, 110, 445, 21, 25, 143, 110, -55, -55, -55, - -55, 108, 110, 604, 144, 49, 50, 51, 22, 477, - 52, 29, 30, 31, 32, 33, 34, 35, 143, 36, - 241, 242, 26, 320, 273, 135, 444, 233, 419, 108, - 274, 63, 64, -143, 444, 135, 419, 425, 110, 240, - 27, 152, 11, 1, 2, 472, 3, 4, 5, 266, - 132, 152, 28, 341, 342, 133, 419, 519, 111, 423, - 43, 420, 111, 230, 231, 57, 336, 234, 599, 58, - 552, 2, 337, 238, 4, 558, 559, 401, 437, 402, - 403, 404, 111, 110, 405, 111, -67, 111, 406, 407, - 59, 389, 111, 61, 168, 384, -67, 271, 111, 419, - 1, 386, -67, 3, 90, 5, 424, 575, 381, 45, - 595, 46, 105, 321, 322, 94, 37, 38, 39, 419, - 306, 307, 271, 309, 503, 268, 484, 597, 598, -143, - 600, 601, 101, -143, 111, 505, 310, 271, 271, 271, - 271, 271, 317, 318, 271, 85, 449, 86, 451, 452, - 453, 399, 135, 611, 612, 97, 533, 376, 534, 376, - 376, 98, 376, 152, 99, 402, 403, 404, 1, 102, - 405, 3, 103, 5, 406, 407, 115, 86, 116, 111, - 551, 83, 84, 414, 415, 416, 417, 418, 88, 243, - 244, 245, 246, 139, 89, 376, 426, 427, 428, 323, - 324, 152, 524, 376, 376, 402, 403, 404, 565, 140, - 405, 265, 382, 147, 406, 407, 325, 326, 145, 327, - 328, 165, 329, 330, 331, 37, 38, 39, 226, 383, - 121, 122, 123, 124, 125, 126, 229, 378, 379, 228, - 380, -207, 118, 119, 152, 400, 271, 232, 535, 463, - 464, 538, 539, 540, 235, 508, 470, 493, 236, -69, - 1, 2, 239, 3, 4, 5, -56, 376, 376, 376, - -57, 6, 7, 388, 560, 376, 561, 564, 422, 561, - 582, 396, 397, -60, 586, 376, 376, 432, 148, 149, - 113, 114, 8, -59, -58, 247, 9, 110, 269, 275, - 10, 339, 346, 509, 510, 511, 512, 338, 266, 347, - 514, 515, 348, 349, 350, 271, 450, 271, 271, 271, - 358, 359, 456, 360, 361, 390, 363, 398, 411, 376, - 391, 376, 392, 393, 376, 462, 576, 323, 324, 435, - 376, 376, 394, 543, 544, 440, 441, 442, 395, 412, - 413, 429, 448, 447, 325, 326, 596, 327, 328, 475, - 329, 330, 331, 457, 458, 438, 439, 454, 455, 459, - 483, 376, 376, -206, 376, 376, 466, 467, 468, 469, - 376, 471, 568, 504, 569, 570, 473, 474, 481, 482, - 376, -69, 1, 2, 485, 3, 4, 5, 486, 516, - 488, 487, 489, 6, 7, 523, 491, 490, 493, 492, - 517, 529, 495, 494, 501, 496, 497, 271, 499, 500, - 271, 271, 271, 376, 8, 529, 498, 513, 9, 502, - 520, 506, 10, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 518, 376, 376, 507, 525, 537, 526, - 527, 444, 531, 532, 545, 546, 547, 555, 536, 548, - 376, 549, 550, 557, 566, 556, 63, 64, 542, 106, - 66, 67, 68, 69, 70, 71, 72, 562, 1, 2, - 567, 3, 4, 5, 572, 584, 376, 376, 574, 585, - 587, 376, 588, 590, 376, 589, 591, -18, 602, -19, - 376, 563, 520, 376, 603, 605, 609, 608, 73, 614, - 615, 364, 365, 617, 218, 63, 64, 366, 345, 219, - 220, 344, 580, 581, 571, 130, 553, 1, 2, 146, - 3, 4, 5, 367, 368, 369, 334, 142, 593, 343, - 44, 129, 96, 541, 465, 0, 0, 0, 370, 371, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 606, 607, 372, 0, 0, 610, - 0, 0, 613, 0, 0, 0, 0, 0, 616, 0, - 0, 618, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 251, 252, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 74, 75, 0, 0, 76, 0, - 77, 107, 0, 0, 253, 200, 578, 579, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 0, 254, 0, - 255, 256, 257, 325, 326, 0, 327, 328, 0, 329, - 330, 331, 364, 365, 0, 0, 63, 64, 366, 0, - 0, 0, 0, 0, 0, 0, 0, 373, 1, 2, - 0, 3, 4, 5, 367, 368, 369, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 370, - 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 110, 0, 63, 64, 372, 106, 66, - 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, - 3, 4, 5, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 251, 252, - 0, 0, 0, 0, 0, 63, 64, 73, 106, 155, - 156, 157, 158, 159, 160, 72, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 253, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 0, 254, - 0, 255, 256, 257, 0, 0, 0, 73, 0, 0, - 364, 365, 0, 0, 63, 64, 366, 0, 0, 111, - 0, 0, 0, 0, 0, 0, 1, 2, 373, 3, - 4, 5, 367, 368, 369, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 370, 371, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 372, 0, 0, 0, 0, - 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, - 141, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 251, 252, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, - 356, 0, 0, 253, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 0, 254, 0, 255, - 256, 257, 63, 64, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 2, 0, 3, 4, 5, - 248, 0, 0, 0, 0, 0, 373, 0, 0, 0, - 0, 0, 0, 0, 0, 249, 250, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 63, 64, 110, - 106, 155, 156, 157, 158, 159, 160, 72, 0, 1, - 2, 0, 3, 4, 5, 0, 0, 0, 0, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 251, 252, 0, 0, 0, 73, - 0, 0, 63, 64, 0, 106, 66, 67, 68, 69, - 70, 71, 72, 0, 1, 2, 0, 3, 4, 5, - 0, 253, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 134, 254, 0, 255, 256, 257, - 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 111, 0, 63, 64, -67, - 0, 258, 0, 0, 259, 0, 260, 0, 261, 1, - 2, 0, 3, 4, 5, 248, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 249, 250, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 110, 74, 75, 0, 0, 76, - 0, 77, 421, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 251, - 252, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 74, 75, 0, 0, 76, 0, 77, 0, 0, 0, - 289, 290, 0, 0, 0, 0, 253, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 0, - 254, 0, 255, 256, 257, 0, 0, 0, 0, 0, - 0, 0, 364, 365, 0, 0, 0, 0, 366, 0, - 111, 0, 0, 0, 0, 0, 258, 0, 0, 259, - 0, 260, 0, 261, 367, 368, 369, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 370, - 371, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 63, 64, 372, 150, 66, - 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, - 3, 4, 5, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 251, 252, - 0, 0, 0, 0, 0, 0, 0, 73, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 253, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 0, 254, - 0, 255, 256, 257, 63, 64, 0, 106, 66, 67, - 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, - 4, 5, 0, 0, 0, 0, 0, 0, 373, 0, - 0, 0, 0, 0, 0, 0, 333, 0, 0, 0, - 151, 0, 0, 0, 63, 64, 73, 106, 155, 156, - 157, 158, 159, 160, 72, 0, 1, 2, 0, 3, - 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, - 0, 0, 0, 0, 63, 64, 73, 106, 66, 67, - 68, 69, 70, 71, 72, 0, 1, 2, 0, 3, - 4, 5, 63, 64, 0, 106, 66, 67, 68, 69, - 70, 71, 72, 0, 1, 2, 431, 3, 4, 5, - 0, 0, 0, 0, 0, 0, 73, 0, 0, 0, - 0, 0, 0, 0, 522, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 73, 0, 0, 0, 0, 0, - 0, 0, 74, 75, 0, 0, 76, 0, 77, 63, - 64, 0, 65, 66, 67, 68, 69, 70, 71, 72, - 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 74, 75, 0, 351, 76, 0, 77, 63, - 64, 73, 106, 155, 156, 157, 158, 159, 160, 72, - 0, 1, 2, 0, 3, 4, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 74, 75, 0, 0, 76, 0, 77, 0, - 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, - 74, 75, 0, 0, 76, 0, 77, 63, 64, 0, - 150, 66, 67, 68, 69, 70, 71, 72, 0, 1, - 2, 0, 3, 4, 5, 63, 64, 0, 106, 66, - 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 73, - 0, 0, 0, 0, 0, 0, 0, 74, 75, 0, - 0, 76, 0, 77, 0, 63, 64, 73, 270, 66, - 67, 68, 69, 70, 71, 72, 0, 1, 2, 0, - 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 74, 75, 0, - 0, 76, 0, 77, 0, 63, 64, 73, 106, 155, - 156, 157, 158, 159, 160, 72, 0, 1, 2, 0, - 3, 4, 5, 63, 64, 0, 106, 66, 67, 68, - 69, 70, 71, 528, 0, 1, 2, 0, 3, 4, - 5, 0, 0, 0, 0, 0, 0, 73, 0, 0, - 0, 0, 0, 0, 0, 74, 75, 0, 0, 76, - 0, 77, 0, 0, 0, 73, 0, 0, 0, 0, - 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, - 63, 64, 0, 106, 66, 67, 68, 69, 70, 71, - 583, 0, 1, 2, 0, 3, 4, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 74, 75, 0, 0, 76, 0, 77, - 0, 0, 73, 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, 74, 75, 0, 0, 76, 0, 354, - 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 74, 75, 0, 0, 76, 0, 77, 0, 0, - 171, 172, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 74, 75, - 0, 0, 76, 0, 77, 196, 197, 198, 0, 0, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217 -}; + 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, 27, 163, 198, 175, 4, 236, 120, 127, 0, - 11, 28, 54, 11, 259, 260, 54, 17, 213, 214, - 215, 216, 217, 307, 21, 220, 17, 176, 34, 432, - 164, 152, 29, 576, 11, 148, 54, 409, 410, 54, - 34, 54, 11, 52, 58, 153, 54, 3, 4, 5, - 6, 77, 54, 596, 162, 42, 43, 44, 67, 53, - 47, 42, 43, 44, 45, 46, 47, 48, 153, 50, - 26, 27, 152, 222, 11, 101, 53, 162, 153, 105, - 17, 7, 8, 54, 53, 111, 153, 162, 54, 153, - 18, 117, 92, 19, 20, 162, 22, 23, 24, 163, - 153, 127, 152, 237, 238, 158, 153, 479, 150, 354, - 0, 158, 150, 139, 140, 152, 158, 143, 38, 152, - 523, 20, 160, 149, 23, 528, 529, 322, 373, 135, - 136, 137, 150, 54, 140, 150, 154, 150, 144, 145, - 156, 156, 150, 22, 161, 153, 154, 173, 150, 153, - 19, 153, 154, 22, 21, 24, 160, 158, 277, 46, - 158, 48, 161, 114, 115, 162, 147, 148, 149, 153, - 196, 197, 198, 199, 458, 166, 160, 580, 581, 150, - 583, 584, 150, 154, 150, 151, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 35, 391, 37, 393, 394, - 395, 320, 228, 606, 607, 22, 490, 271, 492, 273, - 274, 22, 276, 239, 22, 135, 136, 137, 19, 4, - 140, 22, 4, 24, 144, 145, 42, 37, 44, 150, - 151, 40, 41, 346, 347, 348, 349, 350, 47, 3, - 4, 5, 6, 157, 53, 309, 359, 360, 361, 118, - 119, 277, 482, 317, 318, 135, 136, 137, 542, 157, - 140, 422, 288, 154, 144, 145, 135, 136, 150, 138, - 139, 4, 141, 142, 143, 147, 148, 149, 22, 305, - 61, 62, 63, 64, 65, 66, 151, 273, 274, 153, - 276, 0, 32, 33, 320, 321, 322, 160, 493, 412, - 413, 496, 497, 498, 4, 151, 419, 153, 151, 18, - 19, 20, 150, 22, 23, 24, 9, 381, 382, 383, - 9, 30, 31, 309, 151, 389, 153, 151, 354, 153, - 560, 317, 318, 9, 564, 399, 400, 363, 113, 114, - 83, 84, 51, 9, 9, 9, 55, 54, 56, 11, - 59, 151, 150, 466, 467, 468, 469, 160, 422, 150, - 473, 474, 150, 150, 150, 391, 392, 393, 394, 395, - 22, 150, 398, 150, 150, 153, 150, 38, 38, 443, - 153, 445, 153, 153, 448, 411, 557, 118, 119, 60, - 454, 455, 153, 506, 507, 381, 382, 383, 153, 150, - 150, 153, 156, 389, 135, 136, 577, 138, 139, 38, - 141, 142, 143, 399, 400, 153, 153, 153, 153, 153, - 22, 485, 486, 0, 488, 489, 153, 153, 153, 153, - 494, 160, 545, 459, 547, 548, 153, 153, 153, 151, - 504, 18, 19, 20, 17, 22, 23, 24, 17, 475, - 153, 150, 153, 30, 31, 481, 4, 443, 153, 445, - 22, 487, 448, 153, 150, 153, 153, 493, 454, 455, - 496, 497, 498, 537, 51, 501, 153, 160, 55, 153, - 480, 153, 59, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 4, 558, 559, 153, 153, 153, 485, - 486, 53, 488, 489, 153, 151, 153, 22, 494, 153, - 574, 151, 151, 156, 151, 153, 7, 8, 504, 10, - 11, 12, 13, 14, 15, 16, 17, 158, 19, 20, - 151, 22, 23, 24, 53, 561, 600, 601, 17, 158, - 151, 605, 151, 4, 608, 151, 146, 150, 22, 150, - 614, 537, 552, 617, 153, 17, 153, 17, 49, 17, - 72, 3, 4, 17, 130, 7, 8, 9, 252, 130, - 130, 251, 558, 559, 552, 92, 524, 19, 20, 111, - 22, 23, 24, 25, 26, 27, 228, 105, 574, 239, - 17, 89, 56, 501, 414, -1, -1, -1, 40, 41, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 600, 601, 58, -1, -1, 605, - -1, -1, 608, -1, -1, -1, -1, -1, 614, -1, - -1, 617, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 155, 156, -1, -1, 159, -1, - 161, 162, -1, -1, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, -1, 130, -1, - 132, 133, 134, 135, 136, -1, 138, 139, -1, 141, - 142, 143, 3, 4, -1, -1, 7, 8, 9, -1, - -1, -1, -1, -1, -1, -1, -1, 159, 19, 20, - -1, 22, 23, 24, 25, 26, 27, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, - 41, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 54, -1, 7, 8, 58, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - -1, -1, -1, -1, -1, 7, 8, 49, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, -1, 130, - -1, 132, 133, 134, -1, -1, -1, 49, -1, -1, - 3, 4, -1, -1, 7, 8, 9, -1, -1, 150, - -1, -1, -1, -1, -1, -1, 19, 20, 159, 22, - 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 40, 41, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 58, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - 162, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - 162, -1, -1, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, -1, 130, -1, 132, - 133, 134, 7, 8, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 19, 20, -1, 22, 23, 24, - 25, -1, -1, -1, -1, -1, 159, -1, -1, -1, - -1, -1, -1, -1, -1, 40, 41, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 7, 8, 54, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, -1, -1, -1, -1, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, -1, -1, -1, 49, - -1, -1, 7, 8, -1, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, -1, 22, 23, 24, - -1, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 39, 130, -1, 132, 133, 134, - -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 150, -1, 7, 8, 154, - -1, 156, -1, -1, 159, -1, 161, -1, 163, 19, - 20, -1, 22, 23, 24, 25, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 40, 41, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 54, 155, 156, -1, -1, 159, - -1, 161, 162, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 155, 156, -1, -1, 159, -1, 161, -1, -1, -1, - 26, 27, -1, -1, -1, -1, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, -1, - 130, -1, 132, 133, 134, -1, -1, -1, -1, -1, - -1, -1, 3, 4, -1, -1, -1, -1, 9, -1, - 150, -1, -1, -1, -1, -1, 156, -1, -1, 159, - -1, 161, -1, 163, 25, 26, 27, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, - 41, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 7, 8, 58, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - -1, -1, -1, -1, -1, -1, -1, 49, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, -1, 130, - -1, 132, 133, 134, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, -1, -1, -1, -1, -1, -1, 159, -1, - -1, -1, -1, -1, -1, -1, 39, -1, -1, -1, - 122, -1, -1, -1, 7, 8, 49, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - -1, -1, -1, -1, 7, 8, 49, 10, 11, 12, - 13, 14, 15, 16, 17, -1, 19, 20, -1, 22, - 23, 24, 7, 8, -1, 10, 11, 12, 13, 14, - 15, 16, 17, -1, 19, 20, 39, 22, 23, 24, - -1, -1, -1, -1, -1, -1, 49, -1, -1, -1, - -1, -1, -1, -1, 39, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 49, -1, -1, -1, -1, -1, - -1, -1, 155, 156, -1, -1, 159, -1, 161, 7, - 8, -1, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 155, 156, -1, 158, 159, -1, 161, 7, - 8, 49, 10, 11, 12, 13, 14, 15, 16, 17, - -1, 19, 20, -1, 22, 23, 24, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 155, 156, -1, -1, 159, -1, 161, -1, - -1, 49, -1, -1, -1, -1, -1, -1, -1, -1, - 155, 156, -1, -1, 159, -1, 161, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, - 20, -1, 22, 23, 24, 7, 8, -1, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, 49, - -1, -1, -1, -1, -1, -1, -1, 155, 156, -1, - -1, 159, -1, 161, -1, 7, 8, 49, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 155, 156, -1, - -1, 159, -1, 161, -1, 7, 8, 49, 10, 11, - 12, 13, 14, 15, 16, 17, -1, 19, 20, -1, - 22, 23, 24, 7, 8, -1, 10, 11, 12, 13, - 14, 15, 16, 17, -1, 19, 20, -1, 22, 23, - 24, -1, -1, -1, -1, -1, -1, 49, -1, -1, - -1, -1, -1, -1, -1, 155, 156, -1, -1, 159, - -1, 161, -1, -1, -1, 49, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, -1, 19, 20, -1, 22, 23, 24, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - -1, -1, 49, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 155, 156, -1, -1, 159, -1, 161, - 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 155, 156, -1, -1, 159, -1, 161, -1, -1, - 56, 57, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 155, 156, - -1, -1, 159, -1, 161, 111, 112, 113, -1, -1, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134 -}; + 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, 19, 20, 22, 23, 24, 30, 31, 51, 55, - 59, 172, 175, 176, 177, 178, 210, 211, 212, 214, - 213, 52, 67, 219, 152, 58, 152, 18, 152, 42, - 43, 44, 45, 46, 47, 48, 50, 147, 148, 149, - 179, 180, 181, 0, 212, 46, 48, 182, 229, 42, - 43, 44, 47, 183, 226, 228, 235, 152, 152, 156, - 220, 22, 218, 7, 8, 10, 11, 12, 13, 14, - 15, 16, 17, 49, 155, 156, 159, 161, 172, 176, - 197, 198, 232, 181, 181, 35, 37, 208, 181, 181, - 21, 236, 237, 29, 162, 227, 236, 22, 22, 22, - 221, 150, 4, 4, 4, 161, 10, 162, 198, 203, - 54, 150, 174, 208, 208, 42, 44, 184, 32, 33, - 207, 61, 62, 63, 64, 65, 66, 185, 224, 224, - 175, 240, 153, 158, 39, 198, 199, 201, 202, 157, - 157, 162, 203, 153, 162, 150, 202, 154, 207, 207, - 10, 122, 198, 200, 209, 11, 12, 13, 14, 15, - 16, 170, 171, 198, 204, 4, 200, 28, 161, 225, - 36, 56, 57, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 111, 112, 113, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 165, 166, - 167, 238, 244, 245, 246, 247, 22, 187, 153, 151, - 198, 198, 160, 162, 198, 4, 151, 204, 198, 150, - 232, 26, 27, 3, 4, 5, 6, 9, 25, 40, - 41, 89, 90, 116, 130, 132, 133, 134, 156, 159, - 161, 163, 165, 166, 167, 205, 232, 174, 176, 56, - 10, 198, 234, 11, 17, 11, 170, 185, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 168, 26, - 27, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 169, 198, 198, 234, 198, - 198, 241, 234, 234, 234, 234, 234, 198, 198, 234, - 185, 114, 115, 118, 119, 135, 136, 138, 139, 141, - 142, 143, 186, 39, 199, 189, 158, 160, 160, 151, - 189, 174, 174, 209, 168, 169, 150, 150, 150, 150, - 150, 158, 204, 206, 161, 206, 162, 206, 22, 150, - 150, 150, 215, 150, 3, 4, 9, 25, 26, 27, - 40, 41, 58, 159, 205, 231, 232, 233, 233, 233, - 233, 200, 198, 198, 153, 192, 153, 192, 233, 156, - 153, 153, 153, 153, 153, 153, 233, 233, 38, 200, - 198, 234, 135, 136, 137, 140, 144, 145, 188, 216, - 217, 38, 150, 150, 204, 204, 204, 204, 204, 153, - 158, 162, 198, 206, 160, 162, 204, 204, 204, 153, - 195, 39, 198, 222, 223, 60, 230, 206, 153, 153, - 233, 233, 233, 11, 53, 11, 243, 233, 156, 234, - 198, 234, 234, 234, 153, 153, 198, 233, 233, 153, - 195, 195, 198, 204, 204, 243, 153, 153, 153, 153, - 204, 160, 162, 153, 153, 38, 34, 53, 193, 196, - 187, 153, 151, 22, 160, 17, 17, 150, 153, 153, - 233, 4, 233, 153, 153, 233, 153, 153, 153, 233, - 233, 150, 153, 192, 198, 151, 153, 153, 151, 204, - 204, 204, 204, 160, 204, 204, 198, 22, 4, 195, - 172, 173, 39, 198, 189, 153, 233, 233, 17, 198, - 242, 233, 233, 192, 192, 234, 233, 153, 234, 234, - 234, 242, 233, 204, 204, 153, 151, 153, 153, 151, - 151, 151, 187, 193, 194, 22, 153, 156, 187, 187, - 151, 153, 158, 233, 151, 192, 151, 151, 204, 204, - 204, 173, 53, 191, 17, 158, 170, 239, 118, 119, - 233, 233, 189, 17, 198, 158, 189, 151, 151, 151, - 4, 146, 190, 233, 231, 158, 170, 187, 187, 38, - 187, 187, 22, 153, 231, 17, 233, 233, 17, 153, - 233, 187, 187, 233, 17, 72, 233, 17, 233 -}; + 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); +#else /* __cplusplus */ - 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) +/* 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 +#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; + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; + 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; @@ -3275,773 +2352,727 @@ 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) +#if YYDEBUG != 0 + if (yydebug) { - case 29: -#line 1113 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;} - break; - - case 30: -#line 1113 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;} - break; - - case 31: -#line 1114 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;} - break; - - case 32: -#line 1114 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;} - break; - - case 33: -#line 1115 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;} - break; - - case 34: -#line 1115 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;} - break; - - case 35: -#line 1116 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;} - break; - - case 36: -#line 1116 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;} - break; - - case 37: -#line 1117 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;} - break; - - case 38: -#line 1117 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;} - break; - - case 39: -#line 1121 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;} - break; - - case 40: -#line 1121 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;} - break; - - case 41: -#line 1122 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;} - break; - - case 42: -#line 1122 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;} - break; - - case 43: -#line 1123 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;} - break; - - case 44: -#line 1123 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;} - break; - - case 45: -#line 1124 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;} - break; - - case 46: -#line 1124 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;} - break; - - case 47: -#line 1125 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;} - break; - - case 48: -#line 1125 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;} - break; - - case 49: -#line 1126 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;} - break; - - case 50: -#line 1126 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;} - break; - - case 51: -#line 1127 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;} - break; + int i; - case 52: -#line 1127 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;} - break; - - case 53: -#line 1128 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;} - break; - - case 54: -#line 1129 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;} - break; - - case 65: -#line 1138 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 66: -#line 1140 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal)=(yyvsp[(3) - (4)].UInt64Val); ;} - break; - - case 67: -#line 1141 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal)=0; ;} - break; - - case 68: -#line 1145 "/Users/scottm/play/llvm-trunk/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 1113 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_EQ; ; + break;} +case 29: +#line 1113 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_NE; ; + break;} +case 30: +#line 1114 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLT; ; + break;} +case 31: +#line 1114 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGT; ; + break;} +case 32: +#line 1115 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SLE; ; + break;} +case 33: +#line 1115 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_SGE; ; + break;} +case 34: +#line 1116 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULT; ; + break;} +case 35: +#line 1116 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGT; ; + break;} +case 36: +#line 1117 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_ULE; ; + break;} +case 37: +#line 1117 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.IPredicate = ICmpInst::ICMP_UGE; ; + break;} +case 38: +#line 1121 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OEQ; ; + break;} +case 39: +#line 1121 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ONE; ; + break;} +case 40: +#line 1122 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLT; ; + break;} +case 41: +#line 1122 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGT; ; + break;} +case 42: +#line 1123 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OLE; ; + break;} +case 43: +#line 1123 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_OGE; ; + break;} +case 44: +#line 1124 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ORD; ; + break;} +case 45: +#line 1124 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNO; ; + break;} +case 46: +#line 1125 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UEQ; ; + break;} +case 47: +#line 1125 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UNE; ; + break;} +case 48: +#line 1126 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULT; ; + break;} +case 49: +#line 1126 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGT; ; + break;} +case 50: +#line 1127 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_ULE; ; + break;} +case 51: +#line 1127 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_UGE; ; + break;} +case 52: +#line 1128 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_TRUE; ; + break;} +case 53: +#line 1129 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.FPredicate = FCmpInst::FCMP_FALSE; ; + break;} +case 64: +#line 1138 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 65: +#line 1140 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal=yyvsp[-1].UInt64Val; ; + break;} +case 66: +#line 1141 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal=0; ; + break;} +case 67: +#line 1145 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 69: -#line 1149 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 68: +#line 1149 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 73: -#line 1157 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 72: +#line 1157 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 74: -#line 1162 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal); + ; + break;} +case 73: +#line 1162 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 75: -#line 1168 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 76: -#line 1169 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 77: -#line 1170 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 78: -#line 1171 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} - break; - - case 79: -#line 1172 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 80: -#line 1176 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 81: -#line 1177 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 82: -#line 1178 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 83: -#line 1182 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} - break; - - case 84: -#line 1183 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::DefaultVisibility; ;} - break; - - case 85: -#line 1184 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::HiddenVisibility; ;} - break; - - case 86: -#line 1185 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Visibility) = GlobalValue::ProtectedVisibility; ;} - break; - - case 87: -#line 1189 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 88: -#line 1190 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;} - break; - - case 89: -#line 1191 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;} - break; - - case 90: -#line 1195 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 91: -#line 1196 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 92: -#line 1197 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 93: -#line 1198 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 94: -#line 1199 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;} - break; - - case 95: -#line 1203 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 96: -#line 1204 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 97: -#line 1205 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 98: -#line 1208 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 99: -#line 1209 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 100: -#line 1210 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Fast; ;} - break; - - case 101: -#line 1211 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Cold; ;} - break; - - case 102: -#line 1212 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_StdCall; ;} - break; - - case 103: -#line 1213 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::X86_FastCall; ;} - break; - - case 104: -#line 1214 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val)) + ; + break;} +case 74: +#line 1168 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 75: +#line 1169 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 76: +#line 1170 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 77: +#line 1171 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 78: +#line 1172 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 79: +#line 1176 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 80: +#line 1177 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 81: +#line 1178 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 82: +#line 1182 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::DefaultVisibility; ; + break;} +case 83: +#line 1183 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::DefaultVisibility; ; + break;} +case 84: +#line 1184 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::HiddenVisibility; ; + break;} +case 85: +#line 1185 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Visibility = GlobalValue::ProtectedVisibility; ; + break;} +case 86: +#line 1189 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 87: +#line 1190 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLImportLinkage; ; + break;} +case 88: +#line 1191 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalWeakLinkage; ; + break;} +case 89: +#line 1195 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 90: +#line 1196 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 91: +#line 1197 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 92: +#line 1198 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 93: +#line 1199 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::DLLExportLinkage; ; + break;} +case 94: +#line 1203 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 95: +#line 1204 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 96: +#line 1205 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 97: +#line 1208 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 98: +#line 1209 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 99: +#line 1210 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Fast; ; + break;} +case 100: +#line 1211 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Cold; ; + break;} +case 101: +#line 1212 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_StdCall; ; + break;} +case 102: +#line 1213 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::X86_FastCall; ; + break;} +case 103: +#line 1214 "/Users/clamb/Documents/llvm/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 105: -#line 1221 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} - break; - - case 106: -#line 1222 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} - break; - - case 107: -#line 1223 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::SExt; ;} - break; - - case 108: -#line 1224 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::SExt; ;} - break; - - case 109: -#line 1225 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::InReg; ;} - break; - - case 110: -#line 1226 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::StructRet; ;} - break; - - case 111: -#line 1227 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoAlias; ;} - break; - - case 112: -#line 1228 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ByVal; ;} - break; - - case 113: -#line 1229 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::Nest; ;} - break; - - case 114: -#line 1232 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::None; ;} - break; - - case 115: -#line 1233 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); - ;} - break; - - case 116: -#line 1238 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoReturn; ;} - break; - - case 117: -#line 1239 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::NoUnwind; ;} - break; - - case 118: -#line 1240 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ZExt; ;} - break; - - case 119: -#line 1241 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::SExt; ;} - break; - - case 120: -#line 1242 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ReadNone; ;} - break; - - case 121: -#line 1243 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::ReadOnly; ;} - break; - - case 122: -#line 1246 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamAttrs) = ParamAttr::None; ;} - break; - - case 123: -#line 1247 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ParamAttrs) = (yyvsp[(1) - (2)].ParamAttrs) | (yyvsp[(2) - (2)].ParamAttrs); - ;} - break; - - case 124: -#line 1252 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 125: -#line 1253 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal); - ;} - break; - - case 126: -#line 1260 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 127: -#line 1261 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + ; + break;} +case 104: +#line 1221 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ZExt; ; + break;} +case 105: +#line 1222 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ZExt; ; + break;} +case 106: +#line 1223 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::SExt; ; + break;} +case 107: +#line 1224 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::SExt; ; + break;} +case 108: +#line 1225 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::InReg; ; + break;} +case 109: +#line 1226 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::StructRet; ; + break;} +case 110: +#line 1227 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::NoAlias; ; + break;} +case 111: +#line 1228 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ByVal; ; + break;} +case 112: +#line 1229 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::Nest; ; + break;} +case 113: +#line 1232 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::None; ; + break;} +case 114: +#line 1233 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; + ; + break;} +case 115: +#line 1238 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::NoReturn; ; + break;} +case 116: +#line 1239 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::NoUnwind; ; + break;} +case 117: +#line 1240 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ZExt; ; + break;} +case 118: +#line 1241 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::SExt; ; + break;} +case 119: +#line 1242 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ReadNone; ; + break;} +case 120: +#line 1243 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::ReadOnly; ; + break;} +case 121: +#line 1246 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamAttrs = ParamAttr::None; ; + break;} +case 122: +#line 1247 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ParamAttrs = yyvsp[-1].ParamAttrs | yyvsp[0].ParamAttrs; + ; + break;} +case 123: +#line 1252 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 124: +#line 1253 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[0].StrVal; + ; + break;} +case 125: +#line 1260 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 126: +#line 1261 "/Users/clamb/Documents/llvm/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 128: -#line 1267 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 129: -#line 1268 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) +; + break;} +case 127: +#line 1267 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 128: +#line 1268 "/Users/clamb/Documents/llvm/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 130: -#line 1277 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - for (unsigned i = 0, e = (yyvsp[(2) - (2)].StrVal)->length(); i != e; ++i) - if ((*(yyvsp[(2) - (2)].StrVal))[i] == '"' || (*(yyvsp[(2) - (2)].StrVal))[i] == '\\') +; + break;} +case 129: +#line 1277 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + for (unsigned i = 0, e = yyvsp[0].StrVal->length(); 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 131: -#line 1285 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 132: -#line 1286 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;} - break; - - case 133: -#line 1291 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 134: -#line 1292 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 135: -#line 1293 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - CurGV->setSection(*(yyvsp[(1) - (1)].StrVal)); - delete (yyvsp[(1) - (1)].StrVal); +; + break;} +case 130: +#line 1285 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 131: +#line 1286 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = yyvsp[0].StrVal; ; + break;} +case 132: +#line 1291 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 133: +#line 1292 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 134: +#line 1293 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurGV->setSection(*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 136: -#line 1298 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val))) + ; + break;} +case 135: +#line 1298 "/Users/clamb/Documents/llvm/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 144: -#line 1314 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); + ; + break;} +case 143: +#line 1314 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ;} - break; - - case 145: -#line 1318 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); + ; + break;} +case 144: +#line 1318 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); CHECK_FOR_ERROR - ;} - break; - - case 146: -#line 1322 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Pointer type? - if (*(yyvsp[(1) - (3)].TypeVal) == Type::LabelTy) + ; + break;} +case 145: +#line 1322 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Pointer type? + if (*yyvsp[-2].TypeVal == Type::LabelTy) GEN_ERROR("Cannot form a pointer to a basic block"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[(1) - (3)].TypeVal), (yyvsp[(2) - (3)].UIntVal)))); - delete (yyvsp[(1) - (3)].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-2].TypeVal, yyvsp[-1].UIntVal))); + delete yyvsp[-2].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 147: -#line 1329 "/Users/scottm/play/llvm-trunk/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 148: -#line 1334 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Type UpReference - if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range"); + ; + break;} +case 146: +#line 1329 "/Users/clamb/Documents/llvm/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 147: +#line 1334 "/Users/clamb/Documents/llvm/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 149: -#line 1342 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 148: +#line 1342 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. - const Type* RetTy = *(yyvsp[(1) - (5)].TypeVal); + const Type* RetTy = *yyvsp[-4].TypeVal; if (!(RetTy->isFirstClassType() || RetTy == Type::VoidTy || isa(RetTy))) GEN_ERROR("LLVM Functions cannot return aggregates"); std::vector Params; - TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); + TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); for (; I != E; ++I ) { const Type *Ty = I->Ty->get(); Params.push_back(Ty); @@ -4057,20 +3088,19 @@ CHECK_FOR_ERROR FunctionType *FT = FunctionType::get(RetTy, Params, isVarArg); - 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 150: -#line 1372 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + 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 149: +#line 1372 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. std::vector Params; - TypeWithAttrsList::iterator I = (yyvsp[(3) - (5)].TypeWithAttrsList)->begin(), E = (yyvsp[(3) - (5)].TypeWithAttrsList)->end(); + TypeWithAttrsList::iterator I = yyvsp[-2].TypeWithAttrsList->begin(), E = yyvsp[-2].TypeWithAttrsList->end(); for ( ; I != E; ++I ) { const Type* Ty = I->Ty->get(); Params.push_back(Ty); @@ -4085,303 +3115,282 @@ CHECK_FOR_ERROR - FunctionType *FT = FunctionType::get((yyvsp[(1) - (5)].PrimType), Params, isVarArg); - delete (yyvsp[(3) - (5)].TypeWithAttrsList); // Delete the argument list - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FT)); - CHECK_FOR_ERROR - ;} - break; - - case 151: -#line 1397 "/Users/scottm/play/llvm-trunk/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 152: -#line 1402 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Vector 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); + delete yyvsp[-2].TypeWithAttrsList; // Delete the argument list + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FT)); + CHECK_FOR_ERROR + ; + break;} +case 150: +#line 1397 "/Users/clamb/Documents/llvm/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 151: +#line 1402 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Vector 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 VectorType must be primitive"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(VectorType::get(*(yyvsp[(4) - (5)].TypeVal), (unsigned)(yyvsp[(2) - (5)].UInt64Val)))); - delete (yyvsp[(4) - (5)].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(VectorType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 153: -#line 1412 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Structure type? + ; + break;} +case 152: +#line 1412 "/Users/clamb/Documents/llvm/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 154: -#line 1422 "/Users/scottm/play/llvm-trunk/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 155: -#line 1426 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 153: +#line 1422 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ; + break;} +case 154: +#line 1426 "/Users/clamb/Documents/llvm/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 156: -#line 1436 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector(), true)); - CHECK_FOR_ERROR - ;} - break; - - case 157: -#line 1443 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 155: +#line 1436 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector(), true)); + CHECK_FOR_ERROR + ; + break;} +case 156: +#line 1443 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Allow but ignore attributes on function types; this permits auto-upgrade. // FIXME: remove in LLVM 3.0. - (yyval.TypeWithAttrs).Ty = (yyvsp[(1) - (2)].TypeVal); - (yyval.TypeWithAttrs).Attrs = ParamAttr::None; - ;} - break; - - case 158: -#line 1452 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyval.TypeWithAttrs.Ty = yyvsp[-1].TypeVal; + yyval.TypeWithAttrs.Attrs = ParamAttr::None; + ; + break;} +case 157: +#line 1452 "/Users/clamb/Documents/llvm/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 159: -#line 1459 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(Type::VoidTy); - ;} - break; - - case 160: -#line 1464 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); - (yyval.TypeWithAttrsList)->push_back((yyvsp[(1) - (1)].TypeWithAttrs)); + yyval.TypeVal = yyvsp[0].TypeVal; + ; + break;} +case 158: +#line 1459 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(Type::VoidTy); + ; + break;} +case 159: +#line 1464 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); + yyval.TypeWithAttrsList->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 161: -#line 1469 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList))->push_back((yyvsp[(3) - (3)].TypeWithAttrs)); + ; + break;} +case 160: +#line 1469 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList)->push_back(yyvsp[0].TypeWithAttrs); CHECK_FOR_ERROR - ;} - break; - - case 163: -#line 1477 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList)=(yyvsp[(1) - (3)].TypeWithAttrsList); + ; + break;} +case 162: +#line 1477 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList=yyvsp[-2].TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 164: -#line 1484 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList; + ; + break;} +case 163: +#line 1484 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList; TypeWithAttrs TWA; TWA.Attrs = ParamAttr::None; TWA.Ty = new PATypeHolder(Type::VoidTy); - (yyval.TypeWithAttrsList)->push_back(TWA); - CHECK_FOR_ERROR - ;} - break; - - case 165: -#line 1491 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeWithAttrsList) = new TypeWithAttrsList(); + yyval.TypeWithAttrsList->push_back(TWA); CHECK_FOR_ERROR - ;} - break; - - case 166: -#line 1499 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[(1) - (1)].TypeVal)); - delete (yyvsp[(1) - (1)].TypeVal); + ; + break;} +case 164: +#line 1491 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeWithAttrsList = new TypeWithAttrsList(); CHECK_FOR_ERROR - ;} - break; - - case 167: -#line 1505 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList)=(yyvsp[(1) - (3)].TypeList))->push_back(*(yyvsp[(3) - (3)].TypeVal)); - delete (yyvsp[(3) - (3)].TypeVal); + ; + break;} +case 165: +#line 1499 "/Users/clamb/Documents/llvm/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 166: +#line 1505 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); + delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 168: -#line 1517 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + ; + break;} +case 167: +#line 1517 "/Users/clamb/Documents/llvm/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 169: -#line 1545 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 168: +#line 1545 "/Users/clamb/Documents/llvm/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 170: -#line 1561 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 169: +#line 1561 "/Users/clamb/Documents/llvm/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(); - if (NumElements != -1 && NumElements != int((yyvsp[(3) - (3)].StrVal)->length())) + if (NumElements != -1 && NumElements != int(yyvsp[0].StrVal->length())) GEN_ERROR("Can't build string constant of size " + - itostr((int)((yyvsp[(3) - (3)].StrVal)->length())) + + itostr((int)(yyvsp[0].StrVal->length())) + " when array has size " + itostr(NumElements) + ""); std::vector Vals; if (ETy == Type::Int8Ty) { - for (unsigned i = 0; i < (yyvsp[(3) - (3)].StrVal)->length(); ++i) - Vals.push_back(ConstantInt::get(ETy, (*(yyvsp[(3) - (3)].StrVal))[i])); + for (unsigned i = 0; i < yyvsp[0].StrVal->length(); ++i) + Vals.push_back(ConstantInt::get(ETy, (*yyvsp[0].StrVal)[i])); } else { - delete (yyvsp[(3) - (3)].StrVal); + delete yyvsp[0].StrVal; GEN_ERROR("Cannot build string arrays of non byte sized elements"); } - delete (yyvsp[(3) - (3)].StrVal); - (yyval.ConstVal) = ConstantArray::get(ATy, Vals); - delete (yyvsp[(1) - (3)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 171: -#line 1588 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr + delete yyvsp[0].StrVal; + yyval.ConstVal = ConstantArray::get(ATy, Vals); + delete yyvsp[-2].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 170: +#line 1588 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); - const VectorType *PTy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + const VectorType *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) = ConstantVector::get(PTy, *(yyvsp[(3) - (4)].ConstVector)); - delete (yyvsp[(1) - (4)].TypeVal); delete (yyvsp[(3) - (4)].ConstVector); + yyval.ConstVal = ConstantVector::get(PTy, *yyvsp[-1].ConstVector); + delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 172: -#line 1616 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (4)].TypeVal)->get()); + ; + break;} +case 171: +#line 1616 "/Users/clamb/Documents/llvm/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) + @@ -4392,21 +3401,20 @@ GEN_ERROR("Unpacked Initializer to vector 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 173: -#line 1642 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 172: +#line 1642 "/Users/clamb/Documents/llvm/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"); @@ -4416,26 +3424,25 @@ GEN_ERROR("Unpacked Initializer to vector 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 174: -#line 1662 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - const StructType *STy = dyn_cast((yyvsp[(1) - (6)].TypeVal)->get()); + ; + break;} +case 173: +#line 1662 "/Users/clamb/Documents/llvm/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) + @@ -4446,21 +3453,20 @@ GEN_ERROR("Vector initializer to non-vector 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 175: -#line 1688 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 174: +#line 1688 "/Users/clamb/Documents/llvm/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"); @@ -4470,45 +3476,42 @@ GEN_ERROR("Vector initializer to non-vector 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 176: -#line 1708 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 175: +#line 1708 "/Users/clamb/Documents/llvm/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 177: -#line 1720 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 176: +#line 1720 "/Users/clamb/Documents/llvm/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 178: -#line 1727 "/Users/scottm/play/llvm-trunk/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 177: +#line 1727 "/Users/clamb/Documents/llvm/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"); @@ -4522,7 +3525,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getExistingVal(Ty, (yyvsp[(2) - (2)].ValIDVal)); + Value *V = getExistingVal(Ty, yyvsp[0].ValIDVal); CHECK_FOR_ERROR CurFun.CurrentFunction = SavedCurFn; @@ -4537,16 +3540,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).getName(); - else if ((yyvsp[(2) - (2)].ValIDVal).Type != ValID::GlobalID) + if (yyvsp[0].ValIDVal.Type == ValID::GlobalName) + Name = yyvsp[0].ValIDVal.getName(); + else if (yyvsp[0].ValIDVal.Type != ValID::GlobalID) GEN_ERROR("Invalid reference to global"); // Create the forward referenced global. @@ -4562,377 +3565,342 @@ } // 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 179: -#line 1793 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 178: +#line 1793 "/Users/clamb/Documents/llvm/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 180: -#line 1803 "/Users/scottm/play/llvm-trunk/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 179: +#line 1803 "/Users/clamb/Documents/llvm/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 181: -#line 1813 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].SInt64Val))) + ; + break;} +case 180: +#line 1813 "/Users/clamb/Documents/llvm/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), true); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val, true); CHECK_FOR_ERROR - ;} - break; - - case 182: -#line 1819 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); - if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { + ; + break;} +case 181: +#line 1819 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // arbitrary precision integer constants + uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); + if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[(2) - (2)].APIntVal)->sextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); - delete (yyvsp[(2) - (2)].APIntVal); - CHECK_FOR_ERROR - ;} - break; - - case 183: -#line 1829 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // integral constants - if (!ConstantInt::isValueValidForType((yyvsp[(1) - (2)].PrimType), (yyvsp[(2) - (2)].UInt64Val))) + yyvsp[0].APIntVal->sextOrTrunc(BitWidth); + yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); + delete yyvsp[0].APIntVal; + CHECK_FOR_ERROR + ; + break;} +case 182: +#line 1829 "/Users/clamb/Documents/llvm/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), false); + yyval.ConstVal = ConstantInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val, false); CHECK_FOR_ERROR - ;} - break; - - case 184: -#line 1835 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // arbitrary precision integer constants - uint32_t BitWidth = cast((yyvsp[(1) - (2)].PrimType))->getBitWidth(); - if ((yyvsp[(2) - (2)].APIntVal)->getBitWidth() > BitWidth) { + ; + break;} +case 183: +#line 1835 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // arbitrary precision integer constants + uint32_t BitWidth = cast(yyvsp[-1].PrimType)->getBitWidth(); + if (yyvsp[0].APIntVal->getBitWidth() > BitWidth) { GEN_ERROR("Constant value does not fit in type"); } - (yyvsp[(2) - (2)].APIntVal)->zextOrTrunc(BitWidth); - (yyval.ConstVal) = ConstantInt::get(*(yyvsp[(2) - (2)].APIntVal)); - delete (yyvsp[(2) - (2)].APIntVal); - CHECK_FOR_ERROR - ;} - break; - - case 185: -#line 1845 "/Users/scottm/play/llvm-trunk/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 186: -#line 1850 "/Users/scottm/play/llvm-trunk/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 187: -#line 1855 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Floating point constants - if (!ConstantFP::isValueValidForType((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal))) + yyvsp[0].APIntVal->zextOrTrunc(BitWidth); + yyval.ConstVal = ConstantInt::get(*yyvsp[0].APIntVal); + delete yyvsp[0].APIntVal; + CHECK_FOR_ERROR + ; + break;} +case 184: +#line 1845 "/Users/clamb/Documents/llvm/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 185: +#line 1850 "/Users/clamb/Documents/llvm/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 186: +#line 1855 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Floating point constants + if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, *yyvsp[0].FPVal)) GEN_ERROR("Floating point constant invalid for type"); // Lexer has no type info, so builds all float and double FP constants // as double. Fix this here. Long double is done right. - if (&(yyvsp[(2) - (2)].FPVal)->getSemantics()==&APFloat::IEEEdouble && (yyvsp[(1) - (2)].PrimType)==Type::FloatTy) - (yyvsp[(2) - (2)].FPVal)->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); - (yyval.ConstVal) = ConstantFP::get((yyvsp[(1) - (2)].PrimType), *(yyvsp[(2) - (2)].FPVal)); - delete (yyvsp[(2) - (2)].FPVal); - CHECK_FOR_ERROR - ;} - break; - - case 188: -#line 1868 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + if (&yyvsp[0].FPVal->getSemantics()==&APFloat::IEEEdouble && yyvsp[-1].PrimType==Type::FloatTy) + yyvsp[0].FPVal->convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven); + yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, *yyvsp[0].FPVal); + delete yyvsp[0].FPVal; + CHECK_FOR_ERROR + ; + break;} +case 187: +#line 1868 "/Users/clamb/Documents/llvm/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 189: -#line 1880 "/Users/scottm/play/llvm-trunk/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 188: +#line 1880 "/Users/clamb/Documents/llvm/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)->begin(), (yyvsp[(4) - (5)].ValueList)->end(), + GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end(), 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); + delete yyvsp[-1].ValueList; - (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[(3) - (5)].ConstVal), &IdxVec[0], IdxVec.size()); + yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, &IdxVec[0], IdxVec.size()); CHECK_FOR_ERROR - ;} - break; - - case 190: -#line 1902 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (8)].ConstVal)->getType() != Type::Int1Ty) + ; + break;} +case 189: +#line 1902 "/Users/clamb/Documents/llvm/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 191: -#line 1910 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(3) - (6)].ConstVal)->getType() != (yyvsp[(5) - (6)].ConstVal)->getType()) + ; + break;} +case 190: +#line 1910 "/Users/clamb/Documents/llvm/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 192: -#line 1916 "/Users/scottm/play/llvm-trunk/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 191: +#line 1916 "/Users/clamb/Documents/llvm/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 193: -#line 1927 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(4) - (7)].ConstVal)->getType() != (yyvsp[(6) - (7)].ConstVal)->getType()) + ; + break;} +case 192: +#line 1927 "/Users/clamb/Documents/llvm/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 194: -#line 1932 "/Users/scottm/play/llvm-trunk/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 193: +#line 1932 "/Users/clamb/Documents/llvm/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 195: -#line 1937 "/Users/scottm/play/llvm-trunk/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 194: +#line 1937 "/Users/clamb/Documents/llvm/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 196: -#line 1943 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(3) - (8)].ConstVal), (yyvsp[(5) - (8)].ConstVal), (yyvsp[(7) - (8)].ConstVal))) + ; + break;} +case 195: +#line 1943 "/Users/clamb/Documents/llvm/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)); - CHECK_FOR_ERROR - ;} - break; - - case 197: -#line 1949 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((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 196: +#line 1949 "/Users/clamb/Documents/llvm/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 198: -#line 1958 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.ConstVector) = (yyvsp[(1) - (3)].ConstVector))->push_back((yyvsp[(3) - (3)].ConstVal)); + ; + break;} +case 197: +#line 1958 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 199: -#line 1962 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ConstVector) = new std::vector(); - (yyval.ConstVector)->push_back((yyvsp[(1) - (1)].ConstVal)); + ; + break;} +case 198: +#line 1962 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ConstVector = new std::vector(); + yyval.ConstVector->push_back(yyvsp[0].ConstVal); CHECK_FOR_ERROR - ;} - break; - - case 200: -#line 1970 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 201: -#line 1970 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 202: -#line 1973 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = true; ;} - break; - - case 203: -#line 1973 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.BoolVal) = false; ;} - break; - - case 204: -#line 1976 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - const Type* VTy = (yyvsp[(1) - (2)].TypeVal)->get(); - Value *V = getVal(VTy, (yyvsp[(2) - (2)].ValIDVal)); + ; + break;} +case 199: +#line 1970 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 200: +#line 1970 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 201: +#line 1973 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = true; ; + break;} +case 202: +#line 1973 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.BoolVal = false; ; + break;} +case 203: +#line 1976 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + const Type* VTy = yyvsp[-1].TypeVal->get(); + Value *V = getVal(VTy, yyvsp[0].ValIDVal); CHECK_FOR_ERROR GlobalValue* Aliasee = dyn_cast(V); if (!Aliasee) GEN_ERROR("Aliases can be created only to global values"); - (yyval.ConstVal) = Aliasee; + yyval.ConstVal = Aliasee; CHECK_FOR_ERROR - delete (yyvsp[(1) - (2)].TypeVal); - ;} - break; - - case 205: -#line 1988 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - 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)) + delete yyvsp[-1].TypeVal; + ; + break;} +case 204: +#line 1988 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + 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); + yyval.ConstVal = ConstantExpr::getCast(yyvsp[-5].CastOpVal, yyvsp[-3].ConstVal, DestTy); CHECK_FOR_ERROR - delete (yyvsp[(5) - (6)].TypeVal); - ;} - break; - - case 206: -#line 2009 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + delete yyvsp[-1].TypeVal; + ; + break;} +case 205: +#line 2009 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 207: -#line 2014 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ModuleVal) = ParserResult = CurModule.CurrentModule; + ; + break;} +case 206: +#line 2014 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ModuleVal = ParserResult = CurModule.CurrentModule; CurModule.ModuleDone(); CHECK_FOR_ERROR; - ;} - break; - - case 210: -#line 2027 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = false; ;} - break; - - case 211: -#line 2027 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 209: +#line 2027 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = false; ; + break;} +case 210: +#line 2027 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.FunctionDone(); CHECK_FOR_ERROR - ;} - break; - - case 212: -#line 2031 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { CurFun.isDeclare = true; ;} - break; - - case 213: -#line 2031 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 211: +#line 2031 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurFun.isDeclare = true; ; + break;} +case 212: +#line 2031 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 214: -#line 2034 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 213: +#line 2034 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 215: -#line 2037 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 214: +#line 2037 "/Users/clamb/Documents/llvm/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: // @@ -4942,108 +3910,100 @@ // 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 216: -#line 2061 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - ResolveTypeTo((yyvsp[(1) - (3)].StrVal), (yyvsp[(3) - (3)].PrimType)); + ; + break;} +case 215: +#line 2061 "/Users/clamb/Documents/llvm/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 217: -#line 2073 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 216: +#line 2073 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ /* "Externally Visible" Linkage */ - if ((yyvsp[(5) - (6)].ConstVal) == 0) + if (yyvsp[-1].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (6)].StrVal), GlobalValue::ExternalLinkage, - (yyvsp[(2) - (6)].Visibility), (yyvsp[(4) - (6)].BoolVal), (yyvsp[(5) - (6)].ConstVal)->getType(), (yyvsp[(5) - (6)].ConstVal), (yyvsp[(3) - (6)].BoolVal), (yyvsp[(6) - (6)].UIntVal)); + CurGV = ParseGlobalVariable(yyvsp[-5].StrVal, GlobalValue::ExternalLinkage, + yyvsp[-4].Visibility, yyvsp[-2].BoolVal, yyvsp[-1].ConstVal->getType(), yyvsp[-1].ConstVal, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); CHECK_FOR_ERROR - ;} - break; - - case 218: -#line 2080 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 217: +#line 2080 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 219: -#line 2084 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[(6) - (7)].ConstVal) == 0) + ; + break;} +case 218: +#line 2084 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[-1].ConstVal == 0) GEN_ERROR("Global value initializer is not a constant"); - CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), (yyvsp[(6) - (7)].ConstVal)->getType(), (yyvsp[(6) - (7)].ConstVal), (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); + CurGV = ParseGlobalVariable(yyvsp[-6].StrVal, yyvsp[-5].Linkage, yyvsp[-4].Visibility, yyvsp[-2].BoolVal, yyvsp[-1].ConstVal->getType(), yyvsp[-1].ConstVal, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); CHECK_FOR_ERROR - ;} - break; - - case 220: -#line 2089 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 219: +#line 2089 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; - ;} - break; - - case 221: -#line 2093 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 220: +#line 2093 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(6) - (7)].TypeVal))->getDescription()); - CurGV = ParseGlobalVariable((yyvsp[(1) - (7)].StrVal), (yyvsp[(2) - (7)].Linkage), (yyvsp[(3) - (7)].Visibility), (yyvsp[(5) - (7)].BoolVal), *(yyvsp[(6) - (7)].TypeVal), 0, (yyvsp[(4) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-1].TypeVal)->getDescription()); + CurGV = ParseGlobalVariable(yyvsp[-6].StrVal, yyvsp[-5].Linkage, yyvsp[-4].Visibility, yyvsp[-2].BoolVal, *yyvsp[-1].TypeVal, 0, yyvsp[-3].BoolVal, yyvsp[0].UIntVal); CHECK_FOR_ERROR - delete (yyvsp[(6) - (7)].TypeVal); - ;} - break; - - case 222: -#line 2099 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-1].TypeVal; + ; + break;} +case 221: +#line 2099 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CurGV = 0; CHECK_FOR_ERROR - ;} - break; - - case 223: -#line 2103 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 222: +#line 2103 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ std::string Name; - if ((yyvsp[(1) - (5)].StrVal)) { - Name = *(yyvsp[(1) - (5)].StrVal); - delete (yyvsp[(1) - (5)].StrVal); + if (yyvsp[-4].StrVal) { + Name = *yyvsp[-4].StrVal; + delete yyvsp[-4].StrVal; } if (Name.empty()) GEN_ERROR("Alias name cannot be empty"); - Constant* Aliasee = (yyvsp[(5) - (5)].ConstVal); + Constant* Aliasee = yyvsp[0].ConstVal; if (Aliasee == 0) GEN_ERROR(std::string("Invalid aliasee for alias: ") + Name); - GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), (yyvsp[(4) - (5)].Linkage), Name, Aliasee, + GlobalAlias* GA = new GlobalAlias(Aliasee->getType(), yyvsp[-1].Linkage, Name, Aliasee, CurModule.CurrentModule); - GA->setVisibility((yyvsp[(2) - (5)].Visibility)); + GA->setVisibility(yyvsp[-3].Visibility); InsertValue(GA, CurModule.Values); @@ -5067,169 +4027,154 @@ ID.destroy(); CHECK_FOR_ERROR - ;} - break; - - case 224: -#line 2143 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - CHECK_FOR_ERROR - ;} - break; - - case 225: -#line 2146 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 223: +#line 2143 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CHECK_FOR_ERROR + ; + break;} +case 224: +#line 2146 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 226: -#line 2152 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 225: +#line 2152 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); if (AsmSoFar.empty()) - CurModule.CurrentModule->setModuleInlineAsm(*(yyvsp[(1) - (1)].StrVal)); + CurModule.CurrentModule->setModuleInlineAsm(*yyvsp[0].StrVal); else - CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*(yyvsp[(1) - (1)].StrVal)); - delete (yyvsp[(1) - (1)].StrVal); + CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; CHECK_FOR_ERROR -;} - break; - - case 227: -#line 2162 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setTargetTriple(*(yyvsp[(3) - (3)].StrVal)); - delete (yyvsp[(3) - (3)].StrVal); - ;} - break; - - case 228: -#line 2166 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->setDataLayout(*(yyvsp[(3) - (3)].StrVal)); - delete (yyvsp[(3) - (3)].StrVal); - ;} - break; - - case 230: -#line 2173 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary(*(yyvsp[(3) - (3)].StrVal)); - delete (yyvsp[(3) - (3)].StrVal); +; + break;} +case 226: +#line 2162 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setTargetTriple(*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; + ; + break;} +case 227: +#line 2166 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->setDataLayout(*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; + ; + break;} +case 229: +#line 2173 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 231: -#line 2178 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - CurModule.CurrentModule->addLibrary(*(yyvsp[(1) - (1)].StrVal)); - delete (yyvsp[(1) - (1)].StrVal); + ; + break;} +case 230: +#line 2178 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurModule.CurrentModule->addLibrary(*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 232: -#line 2183 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 231: +#line 2183 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ CHECK_FOR_ERROR - ;} - break; - - case 233: -#line 2192 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 232: +#line 2192 "/Users/clamb/Documents/llvm/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 234: -#line 2202 "/Users/scottm/play/llvm-trunk/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 233: +#line 2202 "/Users/clamb/Documents/llvm/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 235: -#line 2213 "/Users/scottm/play/llvm-trunk/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 234: +#line 2213 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[0].ArgList; CHECK_FOR_ERROR - ;} - break; - - case 236: -#line 2217 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = (yyvsp[(1) - (3)].ArgList); + ; + break;} +case 235: +#line 2217 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = yyvsp[-2].ArgList; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 237: -#line 2226 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = new ArgListType; + ; + break;} +case 236: +#line 2226 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = new ArgListType; struct ArgListEntry E; E.Ty = new PATypeHolder(Type::VoidTy); E.Name = 0; E.Attrs = ParamAttr::None; - (yyval.ArgList)->push_back(E); + yyval.ArgList->push_back(E); CHECK_FOR_ERROR - ;} - break; - - case 238: -#line 2235 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ArgList) = 0; + ; + break;} +case 237: +#line 2235 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ArgList = 0; CHECK_FOR_ERROR - ;} - break; - - case 239: -#line 2241 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - std::string FunctionName(*(yyvsp[(3) - (10)].StrVal)); - delete (yyvsp[(3) - (10)].StrVal); // Free strdup'd memory! + ; + break;} +case 238: +#line 2241 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + std::string FunctionName(*yyvsp[-7].StrVal); + delete yyvsp[-7].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) - (10)].TypeVal))) - GEN_ERROR("Reference to abstract result: "+ (yyvsp[(2) - (10)].TypeVal)->get()->getDescription()); + if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(yyvsp[-8].TypeVal)) + GEN_ERROR("Reference to abstract result: "+ yyvsp[-8].TypeVal->get()->getDescription()); std::vector ParamTypeList; ParamAttrsVector Attrs; - if ((yyvsp[(7) - (10)].ParamAttrs) != ParamAttr::None) { + if (yyvsp[-3].ParamAttrs != ParamAttr::None) { ParamAttrsWithIndex PAWI; PAWI.index = 0; - PAWI.attrs = (yyvsp[(7) - (10)].ParamAttrs); + PAWI.attrs = yyvsp[-3].ParamAttrs; Attrs.push_back(PAWI); } - if ((yyvsp[(5) - (10)].ArgList)) { // If there are arguments... + if (yyvsp[-5].ArgList) { // If there are arguments... unsigned index = 1; - for (ArgListType::iterator I = (yyvsp[(5) - (10)].ArgList)->begin(); I != (yyvsp[(5) - (10)].ArgList)->end(); ++I, ++index) { + for (ArgListType::iterator I = yyvsp[-5].ArgList->begin(); I != yyvsp[-5].ArgList->end(); ++I, ++index) { const Type* Ty = I->Ty->get(); if (!CurFun.isDeclare && CurModule.TypeIsUnresolved(I->Ty)) GEN_ERROR("Reference to abstract argument: " + Ty->getDescription()); @@ -5251,9 +4196,9 @@ if (!Attrs.empty()) PAL = ParamAttrsList::get(Attrs); - FunctionType *FT = FunctionType::get(*(yyvsp[(2) - (10)].TypeVal), ParamTypeList, isVarArg); + FunctionType *FT = FunctionType::get(*yyvsp[-8].TypeVal, ParamTypeList, isVarArg); const PointerType *PFT = PointerType::getUnqual(FT); - delete (yyvsp[(2) - (10)].TypeVal); + delete yyvsp[-8].TypeVal; ValID ID; if (!FunctionName.empty()) { @@ -5306,31 +4251,31 @@ Fn->setLinkage(CurFun.Linkage); Fn->setVisibility(CurFun.Visibility); } - Fn->setCallingConv((yyvsp[(1) - (10)].UIntVal)); + Fn->setCallingConv(yyvsp[-9].UIntVal); Fn->setParamAttrs(PAL); - Fn->setAlignment((yyvsp[(9) - (10)].UIntVal)); - if ((yyvsp[(8) - (10)].StrVal)) { - Fn->setSection(*(yyvsp[(8) - (10)].StrVal)); - delete (yyvsp[(8) - (10)].StrVal); - } - if ((yyvsp[(10) - (10)].StrVal)) { - Fn->setCollector((yyvsp[(10) - (10)].StrVal)->c_str()); - delete (yyvsp[(10) - (10)].StrVal); + Fn->setAlignment(yyvsp[-1].UIntVal); + if (yyvsp[-2].StrVal) { + Fn->setSection(*yyvsp[-2].StrVal); + delete yyvsp[-2].StrVal; + } + if (yyvsp[0].StrVal) { + Fn->setCollector(yyvsp[0].StrVal->c_str()); + delete yyvsp[0].StrVal; } // Add all of the arguments we parsed to the function... - if ((yyvsp[(5) - (10)].ArgList)) { // Is null if empty... + if (yyvsp[-5].ArgList) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert((yyvsp[(5) - (10)].ArgList)->back().Ty->get() == Type::VoidTy && (yyvsp[(5) - (10)].ArgList)->back().Name == 0 && + assert(yyvsp[-5].ArgList->back().Ty->get() == Type::VoidTy && yyvsp[-5].ArgList->back().Name == 0 && "Not a varargs marker!"); - delete (yyvsp[(5) - (10)].ArgList)->back().Ty; - (yyvsp[(5) - (10)].ArgList)->pop_back(); // Delete the last entry + delete yyvsp[-5].ArgList->back().Ty; + yyvsp[-5].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) - (10)].ArgList)->begin(); - I != (yyvsp[(5) - (10)].ArgList)->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { + for (ArgListType::iterator I = yyvsp[-5].ArgList->begin(); + I != yyvsp[-5].ArgList->end() && ArgIt != ArgEnd; ++I, ++ArgIt) { delete I->Ty; // Delete the typeholder... setValueName(ArgIt, I->Name); // Insert arg into symtab... CHECK_FOR_ERROR @@ -5338,128 +4283,114 @@ Idx++; } - delete (yyvsp[(5) - (10)].ArgList); // We're now done with the argument list + delete yyvsp[-5].ArgList; // We're now done with the argument list } CHECK_FOR_ERROR -;} - break; - - case 242: -#line 2376 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 241: +#line 2376 "/Users/clamb/Documents/llvm/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 245: -#line 2387 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); + yyval.FunctionVal->setLinkage(yyvsp[-3].Linkage); + yyval.FunctionVal->setVisibility(yyvsp[-2].Visibility); +; + break;} +case 244: +#line 2387 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR -;} - break; - - case 246: -#line 2392 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - CurFun.CurrentFunction->setLinkage((yyvsp[(1) - (3)].Linkage)); - CurFun.CurrentFunction->setVisibility((yyvsp[(2) - (3)].Visibility)); - (yyval.FunctionVal) = CurFun.CurrentFunction; +; + break;} +case 245: +#line 2392 "/Users/clamb/Documents/llvm/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 247: -#line 2404 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; - CHECK_FOR_ERROR - ;} - break; - - case 248: -#line 2408 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; - CHECK_FOR_ERROR - ;} - break; - - case 249: -#line 2413 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // A reference to a direct constant - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].SInt64Val)); - CHECK_FOR_ERROR - ;} - break; - - case 250: -#line 2417 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].UInt64Val)); + ; + break;} +case 246: +#line 2404 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 251: -#line 2421 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Perhaps it's an FP constant? - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].FPVal)); + ; + break;} +case 247: +#line 2408 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 252: -#line 2425 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getTrue()); + ; + break;} +case 248: +#line 2413 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A reference to a direct constant + yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); + CHECK_FOR_ERROR + ; + break;} +case 249: +#line 2417 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 253: -#line 2429 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create(ConstantInt::getFalse()); + ; + break;} +case 250: +#line 2421 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Perhaps it's an FP constant? + yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); + CHECK_FOR_ERROR + ; + break;} +case 251: +#line 2425 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getTrue()); CHECK_FOR_ERROR - ;} - break; - - case 254: -#line 2433 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createNull(); + ; + break;} +case 252: +#line 2429 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(ConstantInt::getFalse()); CHECK_FOR_ERROR - ;} - break; - - case 255: -#line 2437 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createUndef(); + ; + break;} +case 253: +#line 2433 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createNull(); CHECK_FOR_ERROR - ;} - break; - - case 256: -#line 2441 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // A vector zero constant. - (yyval.ValIDVal) = ValID::createZeroInit(); + ; + break;} +case 254: +#line 2437 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createUndef(); CHECK_FOR_ERROR - ;} - break; - - case 257: -#line 2445 "/Users/scottm/play/llvm-trunk/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 255: +#line 2441 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // A vector zero constant. + yyval.ValIDVal = ValID::createZeroInit(); + CHECK_FOR_ERROR + ; + break;} +case 256: +#line 2445 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized packed vector + const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); + int NumElements = yyvsp[-1].ConstVector->size(); VectorType* pt = VectorType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -5471,256 +4402,236 @@ ); // 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(ConstantVector::get(pt, *(yyvsp[(2) - (3)].ConstVector))); - delete PTy; delete (yyvsp[(2) - (3)].ConstVector); - CHECK_FOR_ERROR - ;} - break; - - case 258: -#line 2470 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::create((yyvsp[(1) - (1)].ConstVal)); - CHECK_FOR_ERROR - ;} - break; - - case 259: -#line 2474 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createInlineAsm(*(yyvsp[(3) - (5)].StrVal), *(yyvsp[(5) - (5)].StrVal), (yyvsp[(2) - (5)].BoolVal)); - delete (yyvsp[(3) - (5)].StrVal); - delete (yyvsp[(5) - (5)].StrVal); - CHECK_FOR_ERROR - ;} - break; - - case 260: -#line 2484 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Is it an integer reference...? - (yyval.ValIDVal) = ValID::createLocalID((yyvsp[(1) - (1)].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 261: -#line 2488 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValIDVal) = ValID::createGlobalID((yyvsp[(1) - (1)].UIntVal)); - CHECK_FOR_ERROR - ;} - break; - - case 262: -#line 2492 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal)); - delete (yyvsp[(1) - (1)].StrVal); - CHECK_FOR_ERROR - ;} - break; - - case 263: -#line 2497 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Is it a named reference...? - (yyval.ValIDVal) = ValID::createGlobalName(*(yyvsp[(1) - (1)].StrVal)); - delete (yyvsp[(1) - (1)].StrVal); - CHECK_FOR_ERROR - ;} - break; - - case 266: -#line 2510 "/Users/scottm/play/llvm-trunk/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 267: -#line 2519 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 268: -#line 2523 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Do not allow functions with 0 basic blocks - (yyval.FunctionVal) = (yyvsp[(1) - (2)].FunctionVal); - CHECK_FOR_ERROR - ;} - break; - - case 269: -#line 2532 "/Users/scottm/play/llvm-trunk/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)); - (yyval.BasicBlockVal) = (yyvsp[(1) - (3)].BasicBlockVal); - CHECK_FOR_ERROR - ;} - break; - - case 270: -#line 2541 "/Users/scottm/play/llvm-trunk/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) - (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 271: -#line 2550 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Empty space between instruction lists - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); - CHECK_FOR_ERROR - ;} - break; - - case 272: -#line 2554 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Labelled (named) basic block - (yyval.BasicBlockVal) = defineBBVal(ValID::createLocalName(*(yyvsp[(1) - (1)].StrVal))); - delete (yyvsp[(1) - (1)].StrVal); - CHECK_FOR_ERROR - - ;} - break; - - case 273: -#line 2561 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Return with a result... - (yyval.TermInstVal) = new ReturnInst((yyvsp[(2) - (2)].ValueVal)); - CHECK_FOR_ERROR - ;} - break; - - case 274: -#line 2565 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Return with no result... - (yyval.TermInstVal) = new ReturnInst(); + yyval.ValIDVal = ValID::create(ConstantVector::get(pt, *yyvsp[-1].ConstVector)); + delete PTy; delete yyvsp[-1].ConstVector; CHECK_FOR_ERROR - ;} - break; - - case 275: -#line 2569 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Unconditional Branch... - BasicBlock* tmpBB = getBBVal((yyvsp[(3) - (3)].ValIDVal)); + ; + break;} +case 257: +#line 2470 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBB); - ;} - break; - - case 276: -#line 2574 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - assert(cast((yyvsp[(2) - (9)].PrimType))->getBitWidth() == 1 && "Not Bool?"); - BasicBlock* tmpBBA = getBBVal((yyvsp[(6) - (9)].ValIDVal)); + ; + break;} +case 258: +#line 2474 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createInlineAsm(*yyvsp[-2].StrVal, *yyvsp[0].StrVal, yyvsp[-3].BoolVal); + delete yyvsp[-2].StrVal; + delete yyvsp[0].StrVal; + CHECK_FOR_ERROR + ; + break;} +case 259: +#line 2484 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it an integer reference...? + yyval.ValIDVal = ValID::createLocalID(yyvsp[0].UIntVal); + CHECK_FOR_ERROR + ; + break;} +case 260: +#line 2488 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValIDVal = ValID::createGlobalID(yyvsp[0].UIntVal); CHECK_FOR_ERROR - BasicBlock* tmpBBB = getBBVal((yyvsp[(9) - (9)].ValIDVal)); + ; + break;} +case 261: +#line 2492 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createLocalName(*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; + CHECK_FOR_ERROR + ; + break;} +case 262: +#line 2497 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Is it a named reference...? + yyval.ValIDVal = ValID::createGlobalName(*yyvsp[0].StrVal); + delete yyvsp[0].StrVal; + CHECK_FOR_ERROR + ; + break;} +case 265: +#line 2510 "/Users/clamb/Documents/llvm/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 266: +#line 2519 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.FunctionVal = yyvsp[-1].FunctionVal; CHECK_FOR_ERROR - Value* tmpVal = getVal(Type::Int1Ty, (yyvsp[(3) - (9)].ValIDVal)); + ; + break;} +case 267: +#line 2523 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Do not allow functions with 0 basic blocks + yyval.FunctionVal = yyvsp[-1].FunctionVal; + CHECK_FOR_ERROR + ; + break;} +case 268: +#line 2532 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); CHECK_FOR_ERROR - (yyval.TermInstVal) = new BranchInst(tmpBBA, tmpBBB, tmpVal); - ;} - break; - - case 277: -#line 2584 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (9)].PrimType), (yyvsp[(3) - (9)].ValIDVal)); + InsertValue(yyvsp[0].TermInstVal); + yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); + yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 269: +#line 2541 "/Users/clamb/Documents/llvm/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].BasicBlockVal->getInstList().push_back(CI2); + yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); + yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; + CHECK_FOR_ERROR + ; + break;} +case 270: +#line 2550 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty space between instruction lists + yyval.BasicBlockVal = defineBBVal(ValID::createLocalID(CurFun.NextValNum)); + CHECK_FOR_ERROR + ; + break;} +case 271: +#line 2554 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Labelled (named) basic block + yyval.BasicBlockVal = defineBBVal(ValID::createLocalName(*yyvsp[0].StrVal)); + delete yyvsp[0].StrVal; + CHECK_FOR_ERROR + + ; + break;} +case 272: +#line 2561 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with a result... + yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); + CHECK_FOR_ERROR + ; + break;} +case 273: +#line 2565 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Return with no result... + yyval.TermInstVal = new ReturnInst(); + CHECK_FOR_ERROR + ; + break;} +case 274: +#line 2569 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Unconditional Branch... + BasicBlock* tmpBB = getBBVal(yyvsp[0].ValIDVal); + CHECK_FOR_ERROR + yyval.TermInstVal = new BranchInst(tmpBB); + ; + break;} +case 275: +#line 2574 "/Users/clamb/Documents/llvm/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 276: +#line 2584 "/Users/clamb/Documents/llvm/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 278: -#line 2603 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - Value* tmpVal = getVal((yyvsp[(2) - (8)].PrimType), (yyvsp[(3) - (8)].ValIDVal)); + ; + break;} +case 277: +#line 2603 "/Users/clamb/Documents/llvm/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 279: -#line 2613 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 278: +#line 2613 "/Users/clamb/Documents/llvm/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; - ParamList::iterator I = (yyvsp[(6) - (14)].ParamList)->begin(), E = (yyvsp[(6) - (14)].ParamList)->end(); + ParamList::iterator I = yyvsp[-8].ParamList->begin(), E = yyvsp[-8].ParamList->end(); for (; I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); } - Ty = FunctionType::get((yyvsp[(3) - (14)].TypeVal)->get(), ParamTypes, false); + Ty = FunctionType::get(yyvsp[-11].TypeVal->get(), ParamTypes, false); PFTy = PointerType::getUnqual(Ty); } - delete (yyvsp[(3) - (14)].TypeVal); + delete yyvsp[-11].TypeVal; - 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 ParamAttrsVector Attrs; - if ((yyvsp[(8) - (14)].ParamAttrs) != ParamAttr::None) { - ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = (yyvsp[(8) - (14)].ParamAttrs); + if (yyvsp[-6].ParamAttrs != ParamAttr::None) { + ParamAttrsWithIndex PAWI; PAWI.index = 0; PAWI.attrs = yyvsp[-6].ParamAttrs; Attrs.push_back(PAWI); } // Check the arguments ValueList Args; - if ((yyvsp[(6) - (14)].ParamList)->empty()) { // Has no arguments? + if (yyvsp[-8].ParamList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -5730,7 +4641,7 @@ // correctly! FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ParamList::iterator ArgI = (yyvsp[(6) - (14)].ParamList)->begin(), ArgE = (yyvsp[(6) - (14)].ParamList)->end(); + ParamList::iterator ArgI = yyvsp[-8].ParamList->begin(), ArgE = yyvsp[-8].ParamList->end(); unsigned index = 1; for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) { @@ -5748,15 +4659,8 @@ if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI, ++index) { + for (; ArgI != ArgE; ++ArgI) Args.push_back(ArgI->Val); // push the remaining varargs - if (ArgI->Attrs != ParamAttr::None) { - ParamAttrsWithIndex PAWI; - PAWI.index = index; - PAWI.attrs = ArgI->Attrs; - Attrs.push_back(PAWI); - } - } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } @@ -5767,375 +4671,347 @@ // Create the InvokeInst InvokeInst *II = new InvokeInst(V, Normal, Except, Args.begin(), Args.end()); - II->setCallingConv((yyvsp[(2) - (14)].UIntVal)); + II->setCallingConv(yyvsp[-12].UIntVal); II->setParamAttrs(PAL); - (yyval.TermInstVal) = II; - delete (yyvsp[(6) - (14)].ParamList); + yyval.TermInstVal = II; + delete yyvsp[-8].ParamList; CHECK_FOR_ERROR - ;} - break; - - case 280: -#line 2703 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnwindInst(); + ; + break;} +case 279: +#line 2696 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnwindInst(); CHECK_FOR_ERROR - ;} - break; - - case 281: -#line 2707 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TermInstVal) = new UnreachableInst(); + ; + break;} +case 280: +#line 2700 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TermInstVal = new UnreachableInst(); CHECK_FOR_ERROR - ;} - break; - - case 282: -#line 2714 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = (yyvsp[(1) - (6)].JumpTable); - Constant *V = cast(getExistingVal((yyvsp[(2) - (6)].PrimType), (yyvsp[(3) - (6)].ValIDVal))); + ; + break;} +case 281: +#line 2707 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = yyvsp[-5].JumpTable; + Constant *V = cast(getExistingVal(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 283: -#line 2725 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.JumpTable) = new std::vector >(); - Constant *V = cast(getExistingVal((yyvsp[(1) - (5)].PrimType), (yyvsp[(2) - (5)].ValIDVal))); + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 282: +#line 2718 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.JumpTable = new std::vector >(); + Constant *V = cast(getExistingVal(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 284: -#line 2738 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyval.JumpTable->push_back(std::make_pair(V, tmpBB)); + ; + break;} +case 283: +#line 2731 "/Users/clamb/Documents/llvm/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 285: -#line 2748 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { // Used for PHI nodes + ; + break;} +case 284: +#line 2741 "/Users/clamb/Documents/llvm/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 286: -#line 2759 "/Users/scottm/play/llvm-trunk/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 285: +#line 2752 "/Users/clamb/Documents/llvm/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 287: -#line 2769 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyvsp[-6].PHIList->push_back(std::make_pair(tmpVal, tmpBB)); + ; + break;} +case 286: +#line 2762 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (4)].TypeVal))->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); // Used for call and invoke instructions - (yyval.ParamList) = new ParamList(); - ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getVal((yyvsp[(1) - (4)].TypeVal)->get(), (yyvsp[(3) - (4)].ValIDVal)); - (yyval.ParamList)->push_back(E); - delete (yyvsp[(1) - (4)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 288: -#line 2780 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyval.ParamList = new ParamList(); + ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-3].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); + delete yyvsp[-3].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 287: +#line 2773 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 // Labels are only valid in ASMs - (yyval.ParamList) = new ParamList(); - ParamListEntry E; E.Attrs = (yyvsp[(2) - (4)].ParamAttrs) | (yyvsp[(4) - (4)].ParamAttrs); E.Val = getBBVal((yyvsp[(3) - (4)].ValIDVal)); - (yyval.ParamList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 289: -#line 2788 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyval.ParamList = new ParamList(); + ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 288: +#line 2781 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (6)].TypeVal))->getDescription()); - (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); - ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getVal((yyvsp[(3) - (6)].TypeVal)->get(), (yyvsp[(5) - (6)].ValIDVal)); - (yyval.ParamList)->push_back(E); - delete (yyvsp[(3) - (6)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 290: -#line 2798 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); + yyval.ParamList = yyvsp[-5].ParamList; + ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getVal(yyvsp[-3].TypeVal->get(), yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); + delete yyvsp[-3].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 289: +#line 2791 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ // FIXME: Remove trailing OptParamAttrs in LLVM 3.0, it was a mistake in 2.0 - (yyval.ParamList) = (yyvsp[(1) - (6)].ParamList); - ParamListEntry E; E.Attrs = (yyvsp[(4) - (6)].ParamAttrs) | (yyvsp[(6) - (6)].ParamAttrs); E.Val = getBBVal((yyvsp[(5) - (6)].ValIDVal)); - (yyval.ParamList)->push_back(E); - CHECK_FOR_ERROR - ;} - break; - - case 291: -#line 2805 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ParamList) = new ParamList(); ;} - break; - - case 292: -#line 2808 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { (yyval.ValueList) = new std::vector(); ;} - break; - - case 293: -#line 2809 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.ValueList) = (yyvsp[(1) - (3)].ValueList); - (yyval.ValueList)->push_back((yyvsp[(3) - (3)].ValueVal)); + yyval.ParamList = yyvsp[-5].ParamList; + ParamListEntry E; E.Attrs = yyvsp[-2].ParamAttrs | yyvsp[0].ParamAttrs; E.Val = getBBVal(yyvsp[-1].ValIDVal); + yyval.ParamList->push_back(E); + CHECK_FOR_ERROR + ; + break;} +case 290: +#line 2798 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ParamList = new ParamList(); ; + break;} +case 291: +#line 2801 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.ValueList = new std::vector(); ; + break;} +case 292: +#line 2802 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.ValueList = yyvsp[-2].ValueList; + yyval.ValueList->push_back(yyvsp[0].ValueVal); CHECK_FOR_ERROR - ;} - break; - - case 294: -#line 2816 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 293: +#line 2809 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 295: -#line 2820 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 294: +#line 2813 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 296: -#line 2825 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 295: +#line 2818 "/Users/clamb/Documents/llvm/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"); - 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 297: -#line 2841 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 296: +#line 2834 "/Users/clamb/Documents/llvm/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 298: -#line 2858 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 297: +#line 2851 "/Users/clamb/Documents/llvm/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("Vector 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"); - delete (yyvsp[(3) - (6)].TypeVal); - ;} - break; - - case 299: -#line 2872 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 298: +#line 2865 "/Users/clamb/Documents/llvm/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("Vector 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"); - delete (yyvsp[(3) - (6)].TypeVal); - ;} - break; - - case 300: -#line 2886 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + delete yyvsp[-3].TypeVal; + ; + break;} +case 299: +#line 2879 "/Users/clamb/Documents/llvm/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 301: -#line 2898 "/Users/scottm/play/llvm-trunk/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 300: +#line 2891 "/Users/clamb/Documents/llvm/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 302: -#line 2906 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 301: +#line 2899 "/Users/clamb/Documents/llvm/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 303: -#line 2913 "/Users/scottm/play/llvm-trunk/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 302: +#line 2906 "/Users/clamb/Documents/llvm/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 304: -#line 2919 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if (!InsertElementInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + ; + break;} +case 303: +#line 2912 "/Users/clamb/Documents/llvm/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 305: -#line 2925 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - if (!ShuffleVectorInst::isValidOperands((yyvsp[(2) - (6)].ValueVal), (yyvsp[(4) - (6)].ValueVal), (yyvsp[(6) - (6)].ValueVal))) + ; + break;} +case 304: +#line 2918 "/Users/clamb/Documents/llvm/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 306: -#line 2931 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - const Type *Ty = (yyvsp[(2) - (2)].PHIList)->front().first->getType(); + ; + break;} +case 305: +#line 2924 "/Users/clamb/Documents/llvm/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 307: -#line 2947 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 306: +#line 2940 "/Users/clamb/Documents/llvm/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; - ParamList::iterator I = (yyvsp[(6) - (8)].ParamList)->begin(), E = (yyvsp[(6) - (8)].ParamList)->end(); + ParamList::iterator I = yyvsp[-2].ParamList->begin(), E = yyvsp[-2].ParamList->end(); for (; I != E; ++I) { const Type *Ty = I->Val->getType(); if (Ty == Type::VoidTy) GEN_ERROR("Short call syntax cannot be used with varargs"); ParamTypes.push_back(Ty); } - Ty = FunctionType::get((yyvsp[(3) - (8)].TypeVal)->get(), ParamTypes, false); + Ty = FunctionType::get(yyvsp[-5].TypeVal->get(), ParamTypes, false); PFTy = PointerType::getUnqual(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 for call to invalid intrinsic to avoid crashing later. @@ -6149,15 +5025,15 @@ // Set up the ParamAttrs for the function ParamAttrsVector Attrs; - if ((yyvsp[(8) - (8)].ParamAttrs) != ParamAttr::None) { + if (yyvsp[0].ParamAttrs != ParamAttr::None) { ParamAttrsWithIndex PAWI; PAWI.index = 0; - PAWI.attrs = (yyvsp[(8) - (8)].ParamAttrs); + PAWI.attrs = yyvsp[0].ParamAttrs; Attrs.push_back(PAWI); } // Check the arguments ValueList Args; - if ((yyvsp[(6) - (8)].ParamList)->empty()) { // Has no arguments? + if (yyvsp[-2].ParamList->empty()) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) GEN_ERROR("No arguments passed to a function that " @@ -6167,7 +5043,7 @@ // correctly. Also, gather any parameter attributes. FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - ParamList::iterator ArgI = (yyvsp[(6) - (8)].ParamList)->begin(), ArgE = (yyvsp[(6) - (8)].ParamList)->end(); + ParamList::iterator ArgI = yyvsp[-2].ParamList->begin(), ArgE = yyvsp[-2].ParamList->end(); unsigned index = 1; for (; ArgI != ArgE && I != E; ++ArgI, ++I, ++index) { @@ -6184,15 +5060,8 @@ } if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI, ++index) { + for (; ArgI != ArgE; ++ArgI) Args.push_back(ArgI->Val); // push the remaining varargs - if (ArgI->Attrs != ParamAttr::None) { - ParamAttrsWithIndex PAWI; - PAWI.index = index; - PAWI.attrs = ArgI->Attrs; - Attrs.push_back(PAWI); - } - } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } @@ -6204,372 +5073,366 @@ // Create the call node CallInst *CI = new CallInst(V, Args.begin(), Args.end()); - CI->setTailCall((yyvsp[(1) - (8)].BoolVal)); - CI->setCallingConv((yyvsp[(2) - (8)].UIntVal)); + CI->setTailCall(yyvsp[-7].BoolVal); + CI->setCallingConv(yyvsp[-6].UIntVal); CI->setParamAttrs(PAL); - (yyval.InstVal) = CI; - delete (yyvsp[(6) - (8)].ParamList); - delete (yyvsp[(3) - (8)].TypeVal); - CHECK_FOR_ERROR - ;} - break; - - case 308: -#line 3044 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.InstVal) = (yyvsp[(1) - (1)].InstVal); + yyval.InstVal = CI; + delete yyvsp[-2].ParamList; + delete yyvsp[-5].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 307: +#line 3030 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.InstVal = yyvsp[0].InstVal; CHECK_FOR_ERROR - ;} - break; - - case 309: -#line 3049 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = true; + ; + break;} +case 308: +#line 3035 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = true; CHECK_FOR_ERROR - ;} - break; - - case 310: -#line 3053 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { - (yyval.BoolVal) = false; + ; + break;} +case 309: +#line 3039 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.BoolVal = false; CHECK_FOR_ERROR - ;} - break; - - case 311: -#line 3060 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 310: +#line 3046 "/Users/clamb/Documents/llvm/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 312: -#line 3067 "/Users/scottm/play/llvm-trunk/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 311: +#line 3053 "/Users/clamb/Documents/llvm/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 313: -#line 3075 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, tmpVal, yyvsp[0].UIntVal); + delete yyvsp[-4].TypeVal; + ; + break;} +case 312: +#line 3061 "/Users/clamb/Documents/llvm/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 314: -#line 3082 "/Users/scottm/play/llvm-trunk/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 313: +#line 3068 "/Users/clamb/Documents/llvm/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 315: -#line 3090 "/Users/scottm/play/llvm-trunk/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 314: +#line 3076 "/Users/clamb/Documents/llvm/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 316: -#line 3098 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 315: +#line 3084 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (!isa((yyvsp[(3) - (5)].TypeVal)->get())) + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + if (!isa(yyvsp[-2].TypeVal->get())) GEN_ERROR("Can't load from nonpointer type: " + - (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - if (!cast((yyvsp[(3) - (5)].TypeVal)->get())->getElementType()->isFirstClassType()) + (*yyvsp[-2].TypeVal)->getDescription()); + if (!cast(yyvsp[-2].TypeVal->get())->getElementType()->isFirstClassType()) GEN_ERROR("Can't load from pointer of non-first-class type: " + - (*(yyvsp[(3) - (5)].TypeVal))->getDescription()); - Value* tmpVal = getVal(*(yyvsp[(3) - (5)].TypeVal), (yyvsp[(4) - (5)].ValIDVal)); + (*yyvsp[-2].TypeVal)->getDescription()); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new LoadInst(tmpVal, "", (yyvsp[(1) - (5)].BoolVal), (yyvsp[(5) - (5)].UIntVal)); - delete (yyvsp[(3) - (5)].TypeVal); - ;} - break; - - case 317: -#line 3112 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new LoadInst(tmpVal, "", yyvsp[-4].BoolVal, yyvsp[0].UIntVal); + delete yyvsp[-2].TypeVal; + ; + break;} +case 316: +#line 3098 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); - const PointerType *PT = dyn_cast((yyvsp[(5) - (7)].TypeVal)->get()); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-2].TypeVal)->getDescription()); + const PointerType *PT = dyn_cast(yyvsp[-2].TypeVal->get()); if (!PT) GEN_ERROR("Can't store to a nonpointer type: " + - (*(yyvsp[(5) - (7)].TypeVal))->getDescription()); + (*yyvsp[-2].TypeVal)->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != (yyvsp[(3) - (7)].ValueVal)->getType()) - GEN_ERROR("Can't store '" + (yyvsp[(3) - (7)].ValueVal)->getType()->getDescription() + + if (ElTy != yyvsp[-4].ValueVal->getType()) + GEN_ERROR("Can't store '" + yyvsp[-4].ValueVal->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'"); - Value* tmpVal = getVal(*(yyvsp[(5) - (7)].TypeVal), (yyvsp[(6) - (7)].ValIDVal)); + Value* tmpVal = getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal); CHECK_FOR_ERROR - (yyval.InstVal) = new StoreInst((yyvsp[(3) - (7)].ValueVal), tmpVal, (yyvsp[(1) - (7)].BoolVal), (yyvsp[(7) - (7)].UIntVal)); - delete (yyvsp[(5) - (7)].TypeVal); - ;} - break; - - case 318: -#line 3129 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" - { + yyval.InstVal = new StoreInst(yyvsp[-4].ValueVal, tmpVal, yyvsp[-6].BoolVal, yyvsp[0].UIntVal); + delete yyvsp[-2].TypeVal; + ; + break;} +case 317: +#line 3115 "/Users/clamb/Documents/llvm/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)->begin(), (yyvsp[(4) - (4)].ValueList)->end(), true)) + if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end(), 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)->begin(), (yyvsp[(4) - (4)].ValueList)->end()); - delete (yyvsp[(2) - (4)].TypeVal); - delete (yyvsp[(4) - (4)].ValueList); - ;} - break; - + yyval.InstVal = new GetElementPtrInst(tmpVal, yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end()); + 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 6359 "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 3146 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" +#line 3132 "/Users/clamb/Documents/llvm/llvm/lib/AsmParser/llvmAsmParser.y" // common code from the two 'RunVMAsmParser' functions @@ -6644,4 +5507,3 @@ GenerateError(errMsg); return 0; } - Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs?rev=46545&r1=46544&r2=46545&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.h.cvs Tue Jan 29 21:10:00 2008 @@ -342,7 +342,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 947 "/Users/scottm/play/llvm-trunk/lib/AsmParser/llvmAsmParser.y" +#line 947 "/Users/sabre/llvm/lib/AsmParser/llvmAsmParser.y" { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -389,7 +389,7 @@ llvm::ICmpInst::Predicate IPredicate; llvm::FCmpInst::Predicate FPredicate; } -/* Line 1489 of yacc.c. */ +/* Line 1529 of yacc.c. */ #line 394 "llvmAsmParser.tab.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ Modified: llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs?rev=46545&r1=46544&r2=46545&view=diff ============================================================================== --- llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs (original) +++ llvm/trunk/lib/AsmParser/llvmAsmParser.y.cvs Tue Jan 29 21:10:00 2008 @@ -2675,15 +2675,8 @@ if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI, ++index) { + for (; ArgI != ArgE; ++ArgI) Args.push_back(ArgI->Val); // push the remaining varargs - if (ArgI->Attrs != ParamAttr::None) { - ParamAttrsWithIndex PAWI; - PAWI.index = index; - PAWI.attrs = ArgI->Attrs; - Attrs.push_back(PAWI); - } - } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } @@ -3013,15 +3006,8 @@ } if (Ty->isVarArg()) { if (I == E) - for (; ArgI != ArgE; ++ArgI, ++index) { + for (; ArgI != ArgE; ++ArgI) Args.push_back(ArgI->Val); // push the remaining varargs - if (ArgI->Attrs != ParamAttr::None) { - ParamAttrsWithIndex PAWI; - PAWI.index = index; - PAWI.attrs = ArgI->Attrs; - Attrs.push_back(PAWI); - } - } } else if (I != E || ArgI != ArgE) GEN_ERROR("Invalid number of parameters detected"); } From evan.cheng at apple.com Tue Jan 29 21:57:33 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 30 Jan 2008 03:57:33 -0000 Subject: [llvm-commits] [llvm] r46546 - /llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200801300357.m0U3vXH9012450@zion.cs.uiuc.edu> Author: evancheng Date: Tue Jan 29 21:57:33 2008 New Revision: 46546 URL: http://llvm.org/viewvc/llvm-project?rev=46546&view=rev Log: Skip over the label which marks the beginning of the function before inserting prologue code. Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=46546&r1=46545&r2=46546&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Tue Jan 29 21:57:33 2008 @@ -525,6 +525,12 @@ X86FI->getCalleeSavedFrameSize() +(-TailCallReturnAddrDelta)); uint64_t NumBytes = StackSize - X86FI->getCalleeSavedFrameSize(); + // Skip over the label which mark the beginning of the function. + if (MMI && MMI->needsFrameInfo() && + MBBI != MBB.end() && + MBBI->getOpcode() == X86::LABEL) + ++MBBI; + // Insert stack pointer adjustment for later moving of return addr. Only // applies to tail call optimized functions where the callee argument stack // size is bigger than the callers. From clattner at apple.com Tue Jan 29 22:12:40 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 29 Jan 2008 20:12:40 -0800 Subject: [llvm-commits] [llvm-gcc-4.2] r46164 - in /llvm-gcc-4.2/trunk/gcc/config/i386: llvm-i386-target.h llvm-i386.cpp In-Reply-To: <68E9E037-6FBA-41F5-B068-C970443B159E@apple.com> References: <200801181835.m0IIZJMU009764@zion.cs.uiuc.edu> <200801230703.12134.baldrick@free.fr> <1AAE637E-DBCA-4331-BB6C-B8D1D76CC322@apple.com> <200801230823.54902.baldrick@free.fr> <3EB2CFA9-DD79-4A55-8CE9-DA6B4A731541@apple.com> <68E9E037-6FBA-41F5-B068-C970443B159E@apple.com> Message-ID: On Jan 29, 2008, at 5:52 PM, Dale Johannesen wrote: >> If ABI specifies the aggregate should be passed in memory, then llvm- >> gcc passes it byval. Otherwise, it chops up in pieces following the >> ABI specification (only x86-64 uses a mixture of integer and non- >> integer registers). > > Just noticed this...Darwin ppc64 also uses a mix of registers. The > same > struct can use int, float, vector registers and memory in extreme > cases. Yep, getting darwin/ppc64 abi compliance will require us to do something like Evan did for x86-64, but for ppc. Struct return is even crazier on ppc64 iirc. -Chris From tonic at nondot.org Tue Jan 29 23:15:15 2008 From: tonic at nondot.org (Tanya Lattner) Date: Wed, 30 Jan 2008 05:15:15 -0000 Subject: [llvm-commits] [llvm] r46548 - /llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c Message-ID: <200801300515.m0U5FFR3014984@zion.cs.uiuc.edu> Author: tbrethou Date: Tue Jan 29 23:15:15 2008 New Revision: 46548 URL: http://llvm.org/viewvc/llvm-project?rev=46548&view=rev Log: Pointers change size depending upon the target. Remove them to make the test more stable. Modified: llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c Modified: llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c?rev=46548&r1=46547&r2=46548&view=diff ============================================================================== --- llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c (original) +++ llvm/trunk/test/CFrontend/2007-09-12-PragmaPack.c Tue Jan 29 23:15:15 2008 @@ -1,4 +1,4 @@ -// RUN: %llvmgcc -O3 -S -o - %s | grep {26} +// RUN: %llvmgcc -O3 -S -o - %s | grep {18} #include @@ -6,7 +6,6 @@ typedef struct { uint32_t a; - uint8_t * b; } foo; typedef struct { @@ -19,7 +18,6 @@ uint8_t a[5]; VERSION version; uint8_t b; - char * c; foo d; uint32_t guard; } bar; From clattner at apple.com Tue Jan 29 23:19:45 2008 From: clattner at apple.com (Chris Lattner) Date: Tue, 29 Jan 2008 21:19:45 -0800 Subject: [llvm-commits] [llvm] r46538 - in /llvm/trunk: include/llvm/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/PowerPC/ In-Reply-To: <200801300015.m0U0FBLh004970@zion.cs.uiuc.edu> References: <200801300015.m0U0FBLh004970@zion.cs.uiuc.edu> Message-ID: <5B99B48D-6192-4200-849E-9BFBB0FB0655@apple.com> On Jan 29, 2008, at 4:15 PM, Dan Gohman wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=46538&view=rev > Log: > Factor the addressing mode and the load/store VT out of LoadSDNode > and StoreSDNode into their common base class LSBaseSDNode. Member > functions getLoadedVT and getStoredVT are replaced with the common > getMemoryVT to simplify code that will handle both loads and stores. Nice! -Chris From nicholas at mxc.ca Wed Jan 30 01:45:37 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 30 Jan 2008 07:45:37 -0000 Subject: [llvm-commits] [llvm] r46553 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Message-ID: <200801300745.m0U7jbDh020025@zion.cs.uiuc.edu> Author: nicholas Date: Wed Jan 30 01:45:37 2008 New Revision: 46553 URL: http://llvm.org/viewvc/llvm-project?rev=46553&view=rev Log: Don't DCE FreeInst's. We were using those! Patch from Owen Anderson. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46553&r1=46552&r2=46553&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Jan 30 01:45:37 2008 @@ -420,7 +420,7 @@ } else { // For any non-memory-affecting non-terminators, DCE them as we reach them Instruction *CI = BBI; - if (!CI->isTerminator() && CI->getNumUses() == 0) { + if (!CI->isTerminator() && CI->getNumUses() == 0 && !isa(CI)) { // DCE instructions only used to calculate that load for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end(); From nicholas at mxc.ca Wed Jan 30 01:54:17 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 30 Jan 2008 07:54:17 -0000 Subject: [llvm-commits] [llvm] r46554 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Message-ID: <200801300754.m0U7sHiJ020262@zion.cs.uiuc.edu> Author: nicholas Date: Wed Jan 30 01:54:16 2008 New Revision: 46554 URL: http://llvm.org/viewvc/llvm-project?rev=46554&view=rev Log: Use empty() instead of comparing size() with zero. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46554&r1=46553&r2=46554&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Jan 30 01:54:16 2008 @@ -420,7 +420,7 @@ } else { // For any non-memory-affecting non-terminators, DCE them as we reach them Instruction *CI = BBI; - if (!CI->isTerminator() && CI->getNumUses() == 0 && !isa(CI)) { + if (!CI->isTerminator() && CI->use_empty() && !isa(CI)) { // DCE instructions only used to calculate that load for (Instruction::op_iterator OI = CI->op_begin(), OE = CI->op_end(); From nicholas at mxc.ca Wed Jan 30 02:01:28 2008 From: nicholas at mxc.ca (Nick Lewycky) Date: Wed, 30 Jan 2008 08:01:28 -0000 Subject: [llvm-commits] [llvm] r46555 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Message-ID: <200801300801.m0U81Sf0020479@zion.cs.uiuc.edu> Author: nicholas Date: Wed Jan 30 02:01:28 2008 New Revision: 46555 URL: http://llvm.org/viewvc/llvm-project?rev=46555&view=rev Log: Remove a couple more cases of "getNumUses() == 0". No need to walk the linked list just to see if whether the list is empty. Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Modified: llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp?rev=46555&r1=46554&r2=46555&view=diff ============================================================================== --- llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp (original) +++ llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp Wed Jan 30 02:01:28 2008 @@ -327,7 +327,7 @@ if (LoadInst* L = dyn_cast(BBI)) { // However, if this load is unused, we can go ahead and remove it, and // not have to worry about it making our pointer undead! - if (L->getNumUses() == 0) { + if (L->use_empty()) { MD.removeInstruction(L); // DCE instructions only used to calculate that load @@ -350,7 +350,7 @@ deadPointers.erase(A); // Dead alloca's can be DCE'd when we reach them - if (A->getNumUses() == 0) { + if (A->use_empty()) { MD.removeInstruction(A); // DCE instructions only used to calculate that load From djg at cray.com Wed Jan 30 10:35:32 2008 From: djg at cray.com (Dan Gohman) Date: Wed, 30 Jan 2008 16:35:32 -0000 Subject: [llvm-commits] [llvm] r46556 - in /llvm/trunk: include/llvm/CodeGen/PseudoSourceValue.h include/llvm/Value.h lib/CodeGen/PseudoSourceValue.cpp Message-ID: <200801301635.m0UGZWlb011939@zion.cs.uiuc.edu> Author: djg Date: Wed Jan 30 10:35:31 2008 New Revision: 46556 URL: http://llvm.org/viewvc/llvm-project?rev=46556&view=rev Log: Add a new PseudoSourceValue class, which will be used to help track memory reference information in the backend. Most of this was written by Florian Brander, cleanup and updating to TOT by me. Added: llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Modified: llvm/trunk/include/llvm/Value.h Added: llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h?rev=46556&view=auto ============================================================================== --- llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h (added) +++ llvm/trunk/include/llvm/CodeGen/PseudoSourceValue.h Wed Jan 30 10:35:31 2008 @@ -0,0 +1,62 @@ +//===-- llvm/CodeGen/PseudoSourceValue.h ------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the PseudoSourceValue class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUE_H +#define LLVM_CODEGEN_PSEUDOSOURCEVALUE_H + +#include "llvm/Value.h" + +namespace llvm { + /// PseudoSourceValue - Special value supplied for machine level alias + /// analysis. It indicates that the a memory access references the functions + /// stack frame (e.g., a spill slot), below the stack frame (e.g., argument + /// space), or constant pool. + class PseudoSourceValue : public Value { + const char *name; + public: + explicit PseudoSourceValue(const char *_name); + + virtual void print(std::ostream &OS) const; + + /// classof - Methods for support type inquiry through isa, cast, and + /// dyn_cast: + /// + static inline bool classof(const PseudoSourceValue *) { return true; } + static inline bool classof(const Value *V) { + return V->getValueID() == PseudoSourceValueVal; + } + + /// A pseudo source value referencing to the stack frame of a function, + /// e.g., a spill slot. + static const PseudoSourceValue FPRel; + + /// A source value referencing the area below the stack frame of a function, + /// e.g., the argument space. + static const PseudoSourceValue SPRel; + + /// A source value referencing the global offset table (or something the + /// like). + static const PseudoSourceValue GPRel; + + /// A source value relative to some kind of thread id/pointer. + static const PseudoSourceValue TPRel; + + /// A SV referencing the constant pool + static const PseudoSourceValue CPRel; + + /// A SV referencing the jump table + static const PseudoSourceValue JTRel; + }; +} // End llvm namespace + +#endif Modified: llvm/trunk/include/llvm/Value.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=46556&r1=46555&r2=46556&view=diff ============================================================================== --- llvm/trunk/include/llvm/Value.h (original) +++ llvm/trunk/include/llvm/Value.h Wed Jan 30 10:35:31 2008 @@ -188,6 +188,7 @@ ConstantPointerNullVal, // This is an instance of ConstantPointerNull InlineAsmVal, // This is an instance of InlineAsm InstructionVal, // This is an instance of Instruction + PseudoSourceValueVal, // This is an instance of PseudoSourceValue // Markers: ConstantFirstVal = FunctionVal, Added: llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp?rev=46556&view=auto ============================================================================== --- llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp (added) +++ llvm/trunk/lib/CodeGen/PseudoSourceValue.cpp Wed Jan 30 10:35:31 2008 @@ -0,0 +1,33 @@ +//===-- llvm/CodeGen/PseudoSourceValue.cpp ----------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the PseudoSourceValue class. +// +//===----------------------------------------------------------------------===// + +#include "llvm/CodeGen/PseudoSourceValue.h" +#include "llvm/DerivedTypes.h" + +namespace llvm { + const PseudoSourceValue PseudoSourceValue::FPRel("FPRel"); + const PseudoSourceValue PseudoSourceValue::SPRel("SPRel"); + const PseudoSourceValue PseudoSourceValue::GPRel("GPRel"); + const PseudoSourceValue PseudoSourceValue::TPRel("TPRel"); + const PseudoSourceValue PseudoSourceValue::CPRel("CPRel"); + const PseudoSourceValue PseudoSourceValue::JTRel("JTRel"); + + PseudoSourceValue::PseudoSourceValue(const char *_name) : + Value(PointerType::getUnqual(Type::Int8Ty), PseudoSourceValueVal), + name(_name) { + } + + void PseudoSourceValue::print(std::ostream &OS) const { + OS << name; + } +} From dpatel at apple.com Wed Jan 30 11:43:03 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 30 Jan 2008 17:43:03 -0000 Subject: [llvm-commits] [llvm] r46560 - /llvm/trunk/tools/lto/lto.cpp Message-ID: <200801301743.m0UHh3mH014061@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jan 30 11:43:03 2008 New Revision: 46560 URL: http://llvm.org/viewvc/llvm-project?rev=46560&view=rev Log: Enable exception handling if it is supported. Modified: llvm/trunk/tools/lto/lto.cpp Modified: llvm/trunk/tools/lto/lto.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=46560&r1=46559&r2=46560&view=diff ============================================================================== --- llvm/trunk/tools/lto/lto.cpp (original) +++ llvm/trunk/tools/lto/lto.cpp Wed Jan 30 11:43:03 2008 @@ -31,6 +31,7 @@ #include "llvm/Analysis/Verifier.h" #include "llvm/CodeGen/FileWriters.h" #include "llvm/Target/SubtargetFeature.h" +#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachineRegistry.h" @@ -266,7 +267,11 @@ if (!Target) return LTO_NO_TARGET; - + + // If target supports exception handling then enable it now. + if (Target->getTargetAsmInfo()->doesSupportExceptionHandling()) + ExceptionHandling = true; + // Start off with a verification pass. Passes.add(createVerifierPass()); From evan.cheng at apple.com Wed Jan 30 12:18:23 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 30 Jan 2008 18:18:23 -0000 Subject: [llvm-commits] [llvm] r46562 - in /llvm/trunk: include/llvm/Target/ lib/CodeGen/SelectionDAG/ lib/Target/ARM/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ Message-ID: <200801301818.m0UIIO75015510@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jan 30 12:18:23 2008 New Revision: 46562 URL: http://llvm.org/viewvc/llvm-project?rev=46562&view=rev Log: Even though InsertAtEndOfBasicBlock is an ugly hack it still deserves a proper name. Rename it to EmitInstrWithCustomInserter since it does not necessarily insert instruction at the end. Modified: llvm/trunk/include/llvm/Target/TargetLowering.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp llvm/trunk/lib/Target/ARM/ARMISelLowering.h llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h llvm/trunk/lib/Target/IA64/IA64ISelLowering.h llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.cpp llvm/trunk/lib/Target/X86/X86ISelLowering.h Modified: llvm/trunk/include/llvm/Target/TargetLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetLowering.h?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/include/llvm/Target/TargetLowering.h (original) +++ llvm/trunk/include/llvm/Target/TargetLowering.h Wed Jan 30 12:18:23 2008 @@ -1022,13 +1022,13 @@ // Scheduler hooks // - // InsertAtEndOfBasicBlock - This method should be implemented by targets that - // mark instructions with the 'usesCustomDAGSchedInserter' flag. These + // EmitInstrWithCustomInserter - This method should be implemented by targets + // that mark instructions with the 'usesCustomDAGSchedInserter' flag. These // instructions are special in various ways, which require special support to // insert. The specified MachineInstr is created but not inserted into any // basic blocks, and the scheduler passes ownership of it to this method. - virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *MBB); + virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *MBB); //===--------------------------------------------------------------------===// // Addressing mode description hooks (used by LSR etc). Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Jan 30 12:18:23 2008 @@ -715,7 +715,7 @@ } else { // Insert this instruction into the end of the basic block, potentially // taking some custom action. - BB = DAG.getTargetLoweringInfo().InsertAtEndOfBasicBlock(MI, BB); + BB = DAG.getTargetLoweringInfo().EmitInstrWithCustomInserter(MI, BB); } // Additional results must be an physical register def. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Jan 30 12:18:23 2008 @@ -3855,16 +3855,16 @@ DAG.setRoot(Result.second); } -// InsertAtEndOfBasicBlock - This method should be implemented by targets that -// mark instructions with the 'usesCustomDAGSchedInserter' flag. These +// EmitInstrWithCustomInserter - This method should be implemented by targets +// that mark instructions with the 'usesCustomDAGSchedInserter' flag. These // instructions are special in various ways, which require special support to // insert. The specified MachineInstr is created but not inserted into any // basic blocks, and the scheduler passes ownership of it to this method. -MachineBasicBlock *TargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, +MachineBasicBlock *TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) { cerr << "If a target marks an instruction with " << "'usesCustomDAGSchedInserter', it must implement " - << "TargetLowering::InsertAtEndOfBasicBlock!\n"; + << "TargetLowering::EmitInstrWithCustomInserter!\n"; abort(); return 0; } Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Jan 30 12:18:23 2008 @@ -1453,7 +1453,7 @@ //===----------------------------------------------------------------------===// MachineBasicBlock * -ARMTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, +ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *BB) { const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); switch (MI->getOpcode()) { Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.h?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/ARM/ARMISelLowering.h (original) +++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h Wed Jan 30 12:18:23 2008 @@ -82,7 +82,7 @@ virtual const char *getTargetNodeName(unsigned Opcode) const; - virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, + virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB); /// isLegalAddressingMode - Return true if the addressing mode represented Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Wed Jan 30 12:18:23 2008 @@ -2535,17 +2535,6 @@ } //===----------------------------------------------------------------------===// -// Other Lowering Code -//===----------------------------------------------------------------------===// - -MachineBasicBlock * -SPUTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *BB) -{ - return BB; -} - -//===----------------------------------------------------------------------===// // Target Optimization Hooks //===----------------------------------------------------------------------===// Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h (original) +++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.h Wed Jan 30 12:18:23 2008 @@ -114,9 +114,6 @@ const SelectionDAG &DAG, unsigned Depth = 0) const; - virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *MBB); - ConstraintType getConstraintType(const std::string &ConstraintLetter) const; std::pair Modified: llvm/trunk/lib/Target/IA64/IA64ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/IA64/IA64ISelLowering.h?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/IA64/IA64ISelLowering.h (original) +++ llvm/trunk/lib/Target/IA64/IA64ISelLowering.h Wed Jan 30 12:18:23 2008 @@ -66,8 +66,6 @@ /// (currently, only "ret void") virtual SDOperand LowerOperation(SDOperand Op, SelectionDAG &DAG); -// XXX virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, -// XXX MachineBasicBlock *MBB); }; } Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed Jan 30 12:18:23 2008 @@ -3124,8 +3124,8 @@ //===----------------------------------------------------------------------===// MachineBasicBlock * -PPCTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *BB) { +PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *BB) { const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); assert((MI->getOpcode() == PPC::SELECT_CC_I4 || MI->getOpcode() == PPC::SELECT_CC_I8 || Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h (original) +++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.h Wed Jan 30 12:18:23 2008 @@ -260,8 +260,8 @@ const SelectionDAG &DAG, unsigned Depth = 0) const; - virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *MBB); + virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *MBB); ConstraintType getConstraintType(const std::string &Constraint) const; std::pair Modified: llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp (original) +++ llvm/trunk/lib/Target/Sparc/SparcISelDAGToDAG.cpp Wed Jan 30 12:18:23 2008 @@ -121,8 +121,8 @@ LowerCallTo(SDOperand Chain, const Type *RetTy, bool RetTyIsSigned, bool isVarArg, unsigned CC, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG); - virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *MBB); + virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *MBB); virtual const char *getTargetNodeName(unsigned Opcode) const; }; @@ -895,8 +895,8 @@ } MachineBasicBlock * -SparcTargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *BB) { +SparcTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *BB) { const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo(); unsigned BROpcode; unsigned CC; Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jan 30 12:18:23 2008 @@ -5383,8 +5383,8 @@ //===----------------------------------------------------------------------===// MachineBasicBlock * -X86TargetLowering::InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *BB) { +X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *BB) { const TargetInstrInfo *TII = getTargetMachine().getInstrInfo(); switch (MI->getOpcode()) { default: assert(false && "Unexpected instr type to insert"); Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=46562&r1=46561&r2=46562&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original) +++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Jan 30 12:18:23 2008 @@ -356,8 +356,8 @@ virtual SDOperand PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const; - virtual MachineBasicBlock *InsertAtEndOfBasicBlock(MachineInstr *MI, - MachineBasicBlock *MBB); + virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, + MachineBasicBlock *MBB); /// getTargetNodeName - This method returns the name of a target specific /// DAG node. From dpatel at apple.com Wed Jan 30 12:30:11 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 30 Jan 2008 18:30:11 -0000 Subject: [llvm-commits] [llvm] r46563 - in /llvm/trunk/utils/buildit: GNUmakefile build_llvm Message-ID: <200801301830.m0UIUBoA016097@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jan 30 12:30:11 2008 New Revision: 46563 URL: http://llvm.org/viewvc/llvm-project?rev=46563&view=rev Log: Always put version numbers at the end because they are optional. Modified: llvm/trunk/utils/buildit/GNUmakefile llvm/trunk/utils/buildit/build_llvm Modified: llvm/trunk/utils/buildit/GNUmakefile URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/GNUmakefile?rev=46563&r1=46562&r2=46563&view=diff ============================================================================== --- llvm/trunk/utils/buildit/GNUmakefile (original) +++ llvm/trunk/utils/buildit/GNUmakefile Wed Jan 30 12:30:11 2008 @@ -56,12 +56,14 @@ RC_ProjectSourceSubversion = 01 endif +# NOTE : Always put version numbers at the end because they are optional. install: $(OBJROOT) $(SYMROOT) $(DSTROOT) cd $(OBJROOT) && \ $(SRC)/build_llvm "$(RC_ARCHS)" "$(TARGETS)" \ $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT) \ - $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) \ - $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED) + $(LLVM_ASSERTIONS) $(LLVM_OPTIMIZED) \ + $(RC_ProjectSourceVersion) $(RC_ProjectSourceSubversion) + # installhdrs does nothing, because the headers aren't useful until # the compiler is installed. Modified: llvm/trunk/utils/buildit/build_llvm URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/buildit/build_llvm?rev=46563&r1=46562&r2=46563&view=diff ============================================================================== --- llvm/trunk/utils/buildit/build_llvm (original) +++ llvm/trunk/utils/buildit/build_llvm Wed Jan 30 12:30:11 2008 @@ -34,19 +34,19 @@ # resulting compiler. SYM_DIR="$6" -# The seventh parameter is the version number of the submission, e.g. 1007. -LLVM_SUBMIT_VERSION="$7" - -# The eighth parameter is the subversion number of the submission, e.g. 03. -LLVM_SUBMIT_SUBVERSION="$8" - -# The nineth parameter is a yes/no that indicates whether assertions should be +# The seventh parameter is a yes/no that indicates whether assertions should be # enabled in the LLVM libs/tools. -LLVM_ASSERTIONS="$9" +LLVM_ASSERTIONS="$7" -# The tenth parameter is a yes/no that indicates whether this is an optimized +# The eighth parameter is a yes/no that indicates whether this is an optimized # build. -LLVM_OPTIMIZED="${10}" +LLVM_OPTIMIZED="$8" + +# The nineth parameter is the version number of the submission, e.g. 1007. +LLVM_SUBMIT_VERSION="$9" + +# The tenth parameter is the subversion number of the submission, e.g. 03. +LLVM_SUBMIT_SUBVERSION="${10}" # The current working directory is where the build will happen. It may already # contain a partial result of an interrupted build, in which case this script From dalej at apple.com Wed Jan 30 13:00:21 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 30 Jan 2008 19:00:21 -0000 Subject: [llvm-commits] [llvm] r46565 - in /llvm/trunk: lib/CodeGen/MachineModuleInfo.cpp test/DebugInfo/globalGetElementPtr.ll Message-ID: <200801301900.m0UJ0Mh8016926@zion.cs.uiuc.edu> Author: johannes Date: Wed Jan 30 13:00:21 2008 New Revision: 46565 URL: http://llvm.org/viewvc/llvm-project?rev=46565&view=rev Log: Accept getelementptr starting at GV with all 0 indices as a legitimate way of representing global variable GV in debug info. Added: llvm/trunk/test/DebugInfo/globalGetElementPtr.ll Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=46565&r1=46564&r2=46565&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Jan 30 13:00:21 2008 @@ -104,6 +104,13 @@ } else if (ConstantExpr *CE = dyn_cast(V)) { if (CE->getOpcode() == Instruction::BitCast) { return dyn_cast(CE->getOperand(0)); + } else if (CE->getOpcode() == Instruction::GetElementPtr) { + for (unsigned int i=1; igetNumOperands(); i++) { + Constant* CI = cast(CE->getOperand(i)); + if (!CI || !CI->isNullValue()) + return NULL; + } + return dyn_cast(CE->getOperand(0)); } } return NULL; @@ -117,6 +124,13 @@ } else if (ConstantExpr *CE = dyn_cast(V)) { if (CE->getOpcode() == Instruction::BitCast) { return isa(CE->getOperand(0)); + } else if (CE->getOpcode() == Instruction::GetElementPtr) { + for (unsigned int i=1; igetNumOperands(); i++) { + Constant* CI = cast(CE->getOperand(i)); + if (!CI || !CI->isNullValue()) + return false; + } + return isa(CE->getOperand(0)); } } return false; Added: llvm/trunk/test/DebugInfo/globalGetElementPtr.ll URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/globalGetElementPtr.ll?rev=46565&view=auto ============================================================================== --- llvm/trunk/test/DebugInfo/globalGetElementPtr.ll (added) +++ llvm/trunk/test/DebugInfo/globalGetElementPtr.ll Wed Jan 30 13:00:21 2008 @@ -0,0 +1,264 @@ +; RUN: llvm-as < %s | llc +; ModuleID = 'foo.c' +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i686-apple-darwin8" + %llvm.dbg.anchor.type = type { i32, i32 } + %llvm.dbg.basictype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, i32 } + %llvm.dbg.compile_unit.type = type { i32, %struct.anon*, i32, i8*, i8*, i8* } + %llvm.dbg.compositetype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon*, %struct.anon* } + %llvm.dbg.derivedtype.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, i64, i64, i64, i32, %struct.anon* } + %llvm.dbg.global_variable.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1, %struct.anon* } + %llvm.dbg.subprogram.type = type { i32, %struct.anon*, %struct.anon*, i8*, i8*, i8*, %struct.anon*, i32, %struct.anon*, i1, i1 } + %llvm.dbg.subrange.type = type { i32, i64, i64 } + %llvm.dbg.variable.type = type { i32, %struct.anon*, i8*, %struct.anon*, i32, %struct.anon* } + %struct.S271 = type { [0 x %struct.anon], %struct.anon } + %struct.anon = type { } + at llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { + i32 393262, + %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), + i8* getelementptr ([4 x i8]* @.str3, i32 0, i32 0), + i8* null, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 2, + %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*), + i1 false, + i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] + at llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 46 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] + at llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { + i32 393233, + %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.compile_units to %struct.anon*), + i32 1, + i8* getelementptr ([6 x i8]* @.str, i32 0, i32 0), + i8* getelementptr ([23 x i8]* @.str1, i32 0, i32 0), + i8* getelementptr ([52 x i8]* @.str2, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.compile_unit.type*> [#uses=1] + at llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 17 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] + at .str = internal constant [6 x i8] c"foo.c\00", section "llvm.metadata" ; <[6 x i8]*> [#uses=1] + at .str1 = internal constant [23 x i8] c"/Volumes/MacOS9/tests/\00", section "llvm.metadata" ; <[23 x i8]*> [#uses=1] + at .str2 = internal constant [52 x i8] c"4.2.1 (Based on Apple Inc. build 5546) (LLVM build)\00", section "llvm.metadata" ; <[52 x i8]*> [#uses=1] + at .str3 = internal constant [4 x i8] c"var\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] + at llvm.dbg.derivedtype = internal constant %llvm.dbg.derivedtype.type { + i32 393231, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* null, + %struct.anon* null, + i32 0, + i64 32, + i64 32, + i64 0, + i32 0, + %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] + at llvm.dbg.basictype = internal constant %llvm.dbg.basictype.type { + i32 393252, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* getelementptr ([5 x i8]* @.str4, i32 0, i32 0), + %struct.anon* null, + i32 0, + i64 8, + i64 8, + i64 0, + i32 0, + i32 6 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] + at .str4 = internal constant [5 x i8] c"char\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] + at llvm.dbg.variable = internal constant %llvm.dbg.variable.type { + i32 393474, + %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*), + i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 2, + %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + at .str5 = internal constant [7 x i8] c"retval\00", section "llvm.metadata" ; <[7 x i8]*> [#uses=1] + at a271 = weak global [0 x %struct.S271] zeroinitializer ; <[0 x %struct.S271]*> [#uses=3] + at llvm.dbg.subprogram6 = internal constant %llvm.dbg.subprogram.type { + i32 393262, + %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.subprograms to %struct.anon*), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0), + i8* getelementptr ([5 x i8]* @.str7, i32 0, i32 0), + i8* null, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 3, + %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*), + i1 false, + i1 true }, section "llvm.metadata" ; <%llvm.dbg.subprogram.type*> [#uses=1] + at .str7 = internal constant [5 x i8] c"main\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] + at llvm.dbg.basictype8 = internal constant %llvm.dbg.basictype.type { + i32 393252, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* getelementptr ([4 x i8]* @.str9, i32 0, i32 0), + %struct.anon* null, + i32 0, + i64 32, + i64 32, + i64 0, + i32 0, + i32 5 }, section "llvm.metadata" ; <%llvm.dbg.basictype.type*> [#uses=1] + at .str9 = internal constant [4 x i8] c"int\00", section "llvm.metadata" ; <[4 x i8]*> [#uses=1] + at llvm.dbg.variable10 = internal constant %llvm.dbg.variable.type { + i32 393474, + %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*), + i8* getelementptr ([7 x i8]* @.str5, i32 0, i32 0), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 3, + %struct.anon* bitcast (%llvm.dbg.basictype.type* @llvm.dbg.basictype8 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.variable.type*> [#uses=1] + at llvm.dbg.global_variable = internal constant %llvm.dbg.global_variable.type { + i32 393268, + %struct.anon* bitcast (%llvm.dbg.anchor.type* @llvm.dbg.global_variables to %struct.anon*), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0), + i8* getelementptr ([5 x i8]* @.str11, i32 0, i32 0), + i8* null, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 1, + %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype to %struct.anon*), + i1 false, + i1 true, + %struct.anon* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0, i32 0, i32 0) }, section "llvm.metadata" ; <%llvm.dbg.global_variable.type*> [#uses=0] + at llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { i32 393216, i32 52 }, section "llvm.metadata" ; <%llvm.dbg.anchor.type*> [#uses=1] + at .str11 = internal constant [5 x i8] c"a271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] + at llvm.dbg.compositetype = internal constant %llvm.dbg.compositetype.type { + i32 393217, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* null, + %struct.anon* null, + i32 0, + i64 0, + i64 8, + i64 0, + i32 0, + %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype12 to %struct.anon*), + %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array25 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] + at llvm.dbg.compositetype12 = internal constant %llvm.dbg.compositetype.type { + i32 393235, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* getelementptr ([5 x i8]* @.str13, i32 0, i32 0), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 1, + i64 0, + i64 8, + i64 0, + i32 0, + %struct.anon* null, + %struct.anon* bitcast ([2 x %struct.anon*]* @llvm.dbg.array23 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] + at .str13 = internal constant [5 x i8] c"S271\00", section "llvm.metadata" ; <[5 x i8]*> [#uses=1] + at llvm.dbg.derivedtype14 = internal constant %llvm.dbg.derivedtype.type { + i32 393229, + %struct.anon* null, + i8* getelementptr ([2 x i8]* @.str15, i32 0, i32 0), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 1, + i64 0, + i64 8, + i64 0, + i32 0, + %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype16 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] + at .str15 = internal constant [2 x i8] c"a\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] + at llvm.dbg.compositetype16 = internal constant %llvm.dbg.compositetype.type { + i32 393217, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* null, + %struct.anon* null, + i32 0, + i64 0, + i64 8, + i64 0, + i32 0, + %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype17 to %struct.anon*), + %struct.anon* bitcast ([1 x %struct.anon*]* @llvm.dbg.array18 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] + at llvm.dbg.compositetype17 = internal constant %llvm.dbg.compositetype.type { + i32 393235, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* null, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 1, + i64 0, + i64 8, + i64 0, + i32 0, + %struct.anon* null, + %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] + at llvm.dbg.array = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1] + at llvm.dbg.subrange = internal constant %llvm.dbg.subrange.type { + i32 393249, + i64 0, + i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] + at llvm.dbg.array18 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1] + at llvm.dbg.derivedtype19 = internal constant %llvm.dbg.derivedtype.type { + i32 393229, + %struct.anon* null, + i8* getelementptr ([2 x i8]* @.str20, i32 0, i32 0), + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 1, + i64 0, + i64 8, + i64 0, + i32 0, + %struct.anon* bitcast (%llvm.dbg.compositetype.type* @llvm.dbg.compositetype21 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.derivedtype.type*> [#uses=1] + at .str20 = internal constant [2 x i8] c"b\00", section "llvm.metadata" ; <[2 x i8]*> [#uses=1] + at llvm.dbg.compositetype21 = internal constant %llvm.dbg.compositetype.type { + i32 393235, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i8* null, + %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*), + i32 1, + i64 0, + i64 8, + i64 0, + i32 0, + %struct.anon* null, + %struct.anon* bitcast ([0 x %struct.anon*]* @llvm.dbg.array22 to %struct.anon*) }, section "llvm.metadata" ; <%llvm.dbg.compositetype.type*> [#uses=1] + at llvm.dbg.array22 = internal constant [0 x %struct.anon*] zeroinitializer, section "llvm.metadata" ; <[0 x %struct.anon*]*> [#uses=1] + at llvm.dbg.array23 = internal constant [2 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype14 to %struct.anon*), %struct.anon* bitcast (%llvm.dbg.derivedtype.type* @llvm.dbg.derivedtype19 to %struct.anon*) ], section "llvm.metadata" ; <[2 x %struct.anon*]*> [#uses=1] + at llvm.dbg.subrange24 = internal constant %llvm.dbg.subrange.type { + i32 393249, + i64 0, + i64 4 }, section "llvm.metadata" ; <%llvm.dbg.subrange.type*> [#uses=1] + at llvm.dbg.array25 = internal constant [1 x %struct.anon*] [ %struct.anon* bitcast (%llvm.dbg.subrange.type* @llvm.dbg.subrange24 to %struct.anon*) ], section "llvm.metadata" ; <[1 x %struct.anon*]*> [#uses=1] + +define i8* @var() { +entry: + %retval = alloca i8* ; [#uses=3] + %tmp = alloca i8* ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) ) + call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) ) + %retval1 = bitcast i8** %retval to %struct.anon* ; <%struct.anon*> [#uses=1] + call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to %struct.anon*) ) + bitcast %struct.S271* getelementptr ([0 x %struct.S271]* @a271, i32 0, i32 0) to i8* ; :0 [#uses=0] + store i8* bitcast ([0 x %struct.S271]* @a271 to i8*), i8** %tmp, align 4 + %tmp2 = load i8** %tmp, align 4 ; [#uses=1] + store i8* %tmp2, i8** %retval, align 4 + br label %return + +return: ; preds = %entry + %retval3 = load i8** %retval ; [#uses=1] + call void @llvm.dbg.stoppoint( i32 2, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) ) + call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to %struct.anon*) ) + ret i8* %retval3 +} + +declare void @llvm.dbg.func.start(%struct.anon*) nounwind + +declare void @llvm.dbg.stoppoint(i32, i32, %struct.anon*) nounwind + +declare void @llvm.dbg.declare(%struct.anon*, %struct.anon*) nounwind + +declare void @llvm.dbg.region.end(%struct.anon*) nounwind + +define i32 @main() { +entry: + %retval = alloca i32 ; [#uses=2] + %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + call void @llvm.dbg.func.start( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) ) + call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) ) + %retval1 = bitcast i32* %retval to %struct.anon* ; <%struct.anon*> [#uses=1] + call void @llvm.dbg.declare( %struct.anon* %retval1, %struct.anon* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable10 to %struct.anon*) ) + br label %return + +return: ; preds = %entry + %retval2 = load i32* %retval ; [#uses=1] + call void @llvm.dbg.stoppoint( i32 3, i32 0, %struct.anon* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to %struct.anon*) ) + call void @llvm.dbg.region.end( %struct.anon* bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram6 to %struct.anon*) ) + ret i32 %retval2 +} From clattner at apple.com Wed Jan 30 13:03:19 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 30 Jan 2008 11:03:19 -0800 Subject: [llvm-commits] [llvm] r46555 - /llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp In-Reply-To: <200801300801.m0U81Sf0020479@zion.cs.uiuc.edu> References: <200801300801.m0U81Sf0020479@zion.cs.uiuc.edu> Message-ID: <521D1B5A-3521-47D9-800D-7F85589F033C@apple.com> On Jan 30, 2008, at 12:01 AM, Nick Lewycky wrote: > Author: nicholas > Date: Wed Jan 30 02:01:28 2008 > New Revision: 46555 > > URL: http://llvm.org/viewvc/llvm-project?rev=46555&view=rev > Log: > Remove a couple more cases of "getNumUses() == 0". No need to walk > the linked > list just to see if whether the list is empty. O(N) -> O(1), very nice :) -Chris From clattner at apple.com Wed Jan 30 13:09:19 2008 From: clattner at apple.com (Chris Lattner) Date: Wed, 30 Jan 2008 11:09:19 -0800 Subject: [llvm-commits] [llvm] r46565 - in /llvm/trunk: lib/CodeGen/MachineModuleInfo.cpp test/DebugInfo/globalGetElementPtr.ll In-Reply-To: <200801301900.m0UJ0Mh8016926@zion.cs.uiuc.edu> References: <200801301900.m0UJ0Mh8016926@zion.cs.uiuc.edu> Message-ID: <2A2609BF-7A3F-420A-AA26-C6134C53BA9F@apple.com> On Jan 30, 2008, at 11:00 AM, Dale Johannesen wrote: > URL: http://llvm.org/viewvc/llvm-project?rev=46565&view=rev > Log: > Accept getelementptr starting at GV with all 0 indices as a > legitimate way of representing global variable GV in debug info. Thanks Dale, A minor simplification: > +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Jan 30 13:00:21 > 2008 > @@ -104,6 +104,13 @@ > } else if (ConstantExpr *CE = dyn_cast(V)) { > if (CE->getOpcode() == Instruction::BitCast) { > return dyn_cast(CE->getOperand(0)); > + } else if (CE->getOpcode() == Instruction::GetElementPtr) { > + for (unsigned int i=1; igetNumOperands(); i++) { > + Constant* CI = cast(CE->getOperand(i)); > + if (!CI || !CI->isNullValue()) > + return NULL; > + } CE->getOperand() returns a Constant*, so you can remove the "cast" and null check. Also, FYI, "cast" never returns null: it asserts if the operand isn't the right type. dyn_cast returns null if the type doesn't match. > @@ -117,6 +124,13 @@ > } else if (ConstantExpr *CE = dyn_cast(V)) { > if (CE->getOpcode() == Instruction::BitCast) { > return isa(CE->getOperand(0)); > + } else if (CE->getOpcode() == Instruction::GetElementPtr) { > + for (unsigned int i=1; igetNumOperands(); i++) { > + Constant* CI = cast(CE->getOperand(i)); > + if (!CI || !CI->isNullValue()) Likewise here, Thanks! -Chris From baldrick at free.fr Wed Jan 30 13:10:46 2008 From: baldrick at free.fr (Duncan Sands) Date: Wed, 30 Jan 2008 20:10:46 +0100 Subject: [llvm-commits] [llvm] r46565 - in /llvm/trunk: lib/CodeGen/MachineModuleInfo.cpp test/DebugInfo/globalGetElementPtr.ll In-Reply-To: <200801301900.m0UJ0Mh8016926@zion.cs.uiuc.edu> References: <200801301900.m0UJ0Mh8016926@zion.cs.uiuc.edu> Message-ID: <200801302010.47387.baldrick@free.fr> Hi Dale, maybe you could use IntrinsicInst::StripPointerCasts instead? Best wishes, Duncan. From dpatel at apple.com Wed Jan 30 13:19:31 2008 From: dpatel at apple.com (Devang Patel) Date: Wed, 30 Jan 2008 19:19:31 -0000 Subject: [llvm-commits] [llvm] r46567 - /llvm/trunk/tools/lto/lto.cpp Message-ID: <200801301919.m0UJJVBH017482@zion.cs.uiuc.edu> Author: dpatel Date: Wed Jan 30 13:19:31 2008 New Revision: 46567 URL: http://llvm.org/viewvc/llvm-project?rev=46567&view=rev Log: Supply appropriate arch info to darwin assembler. Modified: llvm/trunk/tools/lto/lto.cpp Modified: llvm/trunk/tools/lto/lto.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/lto.cpp?rev=46567&r1=46566&r2=46567&view=diff ============================================================================== --- llvm/trunk/tools/lto/lto.cpp (original) +++ llvm/trunk/tools/lto/lto.cpp Wed Jan 30 13:19:31 2008 @@ -489,6 +489,22 @@ std::vector args; args.push_back(gcc.c_str()); + if (strncmp(targetTriple.c_str(), "i686-apple-", 11) == 0) { + args.push_back("-arch"); + args.push_back("i386"); + } + if (strncmp(targetTriple.c_str(), "x86_64-apple-", 13) == 0) { + args.push_back("-arch"); + args.push_back("x86_64"); + } + if (strncmp(targetTriple.c_str(), "powerpc-apple-", 14) == 0) { + args.push_back("-arch"); + args.push_back("ppc"); + } + if (strncmp(targetTriple.c_str(), "powerpc64-apple-", 16) == 0) { + args.push_back("-arch"); + args.push_back("ppc64"); + } args.push_back("-c"); args.push_back("-x"); args.push_back("assembler"); From evan.cheng at apple.com Wed Jan 30 13:35:32 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 30 Jan 2008 19:35:32 -0000 Subject: [llvm-commits] [llvm] r46568 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Message-ID: <200801301935.m0UJZWc7017993@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jan 30 13:35:32 2008 New Revision: 46568 URL: http://llvm.org/viewvc/llvm-project?rev=46568&view=rev Log: A semi-gross fix for a debug info issue. When inserting the "function start" label (i.e. first label in the entry block) take care to insert it at the beginning of the block. Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=46568&r1=46567&r2=46568&view=diff ============================================================================== --- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original) +++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Wed Jan 30 13:35:32 2008 @@ -24,6 +24,7 @@ struct InstrStage; struct SUnit; class MachineConstantPool; + class MachineFunction; class MachineModuleInfo; class MachineRegisterInfo; class MachineInstr; @@ -243,6 +244,7 @@ const TargetMachine &TM; // Target processor const TargetInstrInfo *TII; // Target instruction information const MRegisterInfo *MRI; // Target processor register info + MachineFunction *MF; // Machine function MachineRegisterInfo &RegInfo; // Virtual/real register map MachineConstantPool *ConstPool; // Target constant pool std::vector Sequence; // The schedule. Null SUnit*'s Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=46568&r1=46567&r2=46568&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Jan 30 13:35:32 2008 @@ -31,6 +31,7 @@ const TargetMachine &tm) : DAG(dag), BB(bb), TM(tm), RegInfo(BB->getParent()->getRegInfo()) { TII = TM.getInstrInfo(); + MF = &DAG.getMachineFunction(); MRI = TM.getRegisterInfo(); ConstPool = BB->getParent()->getConstantPool(); } @@ -710,13 +711,30 @@ } // Now that we have emitted all operands, emit this instruction itself. - if (!II.usesCustomDAGSchedInsertionHook()) { - BB->insert(BB->end(), MI); - } else { - // Insert this instruction into the end of the basic block, potentially - // taking some custom action. + if (Opc == TargetInstrInfo::LABEL && + !BB->empty() && &MF->front() == BB) { + // If we are inserting a LABEL and this happens to be the first label in + // the entry block, it is the "function start" label. Make sure there are + // no other instructions before it. + bool SeenLabel = false; + MachineBasicBlock::iterator MBBI = BB->begin(); + while (MBBI != BB->end()) { + if (MBBI->getOpcode() == TargetInstrInfo::LABEL) { + SeenLabel = true; + break; + } + ++MBBI; + } + if (!SeenLabel) + BB->insert(BB->begin(), MI); + else + BB->push_back(MI); + } else if (II.usesCustomDAGSchedInsertionHook()) + // Insert this instruction into the basic block using a target + // specific inserter which may returns a new basic block. BB = DAG.getTargetLoweringInfo().EmitInstrWithCustomInserter(MI, BB); - } + else + BB->push_back(MI); // Additional results must be an physical register def. if (HasPhysRegOuts) { @@ -870,13 +888,12 @@ // If this is the first basic block in the function, and if it has live ins // that need to be copied into vregs, emit the copies into the top of the // block before emitting the code for the block. - MachineFunction &MF = DAG.getMachineFunction(); - if (&MF.front() == BB) { + if (&MF->front() == BB) { for (MachineRegisterInfo::livein_iterator LI = RegInfo.livein_begin(), E = RegInfo.livein_end(); LI != E; ++LI) if (LI->second) { const TargetRegisterClass *RC = RegInfo.getRegClass(LI->second); - TII->copyRegToReg(*MF.begin(), MF.begin()->end(), LI->second, + TII->copyRegToReg(*MF->begin(), MF->begin()->end(), LI->second, LI->first, RC, RC); } } From dalej at apple.com Wed Jan 30 13:44:39 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 30 Jan 2008 19:44:39 -0000 Subject: [llvm-commits] [llvm] r46569 - /llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Message-ID: <200801301944.m0UJidwP018327@zion.cs.uiuc.edu> Author: johannes Date: Wed Jan 30 13:44:39 2008 New Revision: 46569 URL: http://llvm.org/viewvc/llvm-project?rev=46569&view=rev Log: Adjust loop per review feedback. Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=46569&r1=46568&r2=46569&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Jan 30 13:44:39 2008 @@ -106,8 +106,7 @@ return dyn_cast(CE->getOperand(0)); } else if (CE->getOpcode() == Instruction::GetElementPtr) { for (unsigned int i=1; igetNumOperands(); i++) { - Constant* CI = cast(CE->getOperand(i)); - if (!CI || !CI->isNullValue()) + if (!CE->getOperand(i)->isNullValue()) return NULL; } return dyn_cast(CE->getOperand(0)); @@ -126,8 +125,7 @@ return isa(CE->getOperand(0)); } else if (CE->getOpcode() == Instruction::GetElementPtr) { for (unsigned int i=1; igetNumOperands(); i++) { - Constant* CI = cast(CE->getOperand(i)); - if (!CI || !CI->isNullValue()) + if (!CE->getOperand(i)->isNullValue()) return false; } return isa(CE->getOperand(0)); From dalej at apple.com Wed Jan 30 13:45:45 2008 From: dalej at apple.com (Dale Johannesen) Date: Wed, 30 Jan 2008 11:45:45 -0800 Subject: [llvm-commits] [llvm] r46565 - in /llvm/trunk: lib/CodeGen/MachineModuleInfo.cpp test/DebugInfo/globalGetElementPtr.ll In-Reply-To: <200801302010.47387.baldrick@free.fr> References: <200801301900.m0UJ0Mh8016926@zion.cs.uiuc.edu> <200801302010.47387.baldrick@free.fr> Message-ID: <1033FCB3-2310-48EF-B31B-B9573ED9D4D7@apple.com> On Jan 30, 2008, at 11:10 AM, Duncan Sands wrote: > Hi Dale, maybe you could use IntrinsicInst::StripPointerCasts instead? > > Best wishes, > > Duncan. Didn't know about this, thanks. It recurses and I don't think that's what I want in this case. I did, however, steal its looping code:) From evan.cheng at apple.com Wed Jan 30 14:08:35 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 30 Jan 2008 20:08:35 -0000 Subject: [llvm-commits] [llvm] r46571 - in /llvm/trunk/lib: CodeGen/SelectionDAG/ScheduleDAG.cpp Target/X86/X86RegisterInfo.cpp Message-ID: <200801302008.m0UK8ZrM019292@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jan 30 14:08:35 2008 New Revision: 46571 URL: http://llvm.org/viewvc/llvm-project?rev=46571&view=rev Log: Treat the label for the first @llvm.dbg.stoppoint the same way as the dbg_func_start label. Make sure nothing else is inserted before them. Note this solution might be somewhat fragile since ISD::LABEL may be used for other purposes. If that ends up to be an issue, we may need to introduce a different node for debug labels. Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp?rev=46571&r1=46570&r2=46571&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp (original) +++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Jan 30 14:08:35 2008 @@ -716,16 +716,16 @@ // If we are inserting a LABEL and this happens to be the first label in // the entry block, it is the "function start" label. Make sure there are // no other instructions before it. - bool SeenLabel = false; + unsigned NumLabels = 0; MachineBasicBlock::iterator MBBI = BB->begin(); while (MBBI != BB->end()) { if (MBBI->getOpcode() == TargetInstrInfo::LABEL) { - SeenLabel = true; - break; + if (++NumLabels > 1) + break; } ++MBBI; } - if (!SeenLabel) + if (NumLabels <= 1) BB->insert(BB->begin(), MI); else BB->push_back(MI); Modified: llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=46571&r1=46570&r2=46571&view=diff ============================================================================== --- llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp (original) +++ llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp Wed Jan 30 14:08:35 2008 @@ -525,11 +525,15 @@ X86FI->getCalleeSavedFrameSize() +(-TailCallReturnAddrDelta)); uint64_t NumBytes = StackSize - X86FI->getCalleeSavedFrameSize(); - // Skip over the label which mark the beginning of the function. - if (MMI && MMI->needsFrameInfo() && - MBBI != MBB.end() && - MBBI->getOpcode() == X86::LABEL) + // Skip over the labels which mark the beginning of the function. + if (MMI && MMI->needsFrameInfo()) { + unsigned NumLabels = 0; + while (NumLabels <= 1 && + MBBI != MBB.end() && MBBI->getOpcode() == X86::LABEL) { + ++NumLabels; ++MBBI; + } + } // Insert stack pointer adjustment for later moving of return addr. Only // applies to tail call optimized functions where the callee argument stack From sam at bishop.dhs.org Wed Jan 30 14:51:29 2008 From: sam at bishop.dhs.org (Sam Bishop) Date: Wed, 30 Jan 2008 13:51:29 -0700 (MST) Subject: [llvm-commits] patches for the JIT and Kaleidoscope tutorials Message-ID: <31973.137.201.242.130.1201726289.squirrel@webmail.nwind.net> I have been working my way through the JIT and Kaleidoscope tutorials in my (minuscule) spare time. Thanks again for writing them! I have attached a patch containing some minor changes, ranging from spelling and grammar fixes to adding a "Next: " hyperlink to the bottom of each page. Every page has been given the "next link" treatment, but otherwise I'm only half way through the Kaleidoscope tutorial. I will send a follow-on patch if time permits. Thanks, Sam Bishop -------------- next part -------------- A non-text attachment was scrubbed... Name: tutorial.patch Type: application/octet-stream Size: 32793 bytes Desc: not available Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20080130/fed7dbfc/attachment.obj From evan.cheng at apple.com Wed Jan 30 15:17:12 2008 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 30 Jan 2008 21:17:12 -0000 Subject: [llvm-commits] [test-suite] r46573 [1/3] - in /test-suite/trunk/MultiSource/Applications: ./ ClamAV/ ClamAV/dbdir/ ClamAV/inputs/ ClamAV/inputs/rtf-test/ ClamAV/scripts/ Message-ID: <200801302117.m0ULHJoY021986@zion.cs.uiuc.edu> Author: evancheng Date: Wed Jan 30 15:17:10 2008 New Revision: 46573 URL: http://llvm.org/viewvc/llvm-project?rev=46573&view=rev Log: Add new benchmark ClamAV. Added: test-suite/trunk/MultiSource/Applications/ClamAV/ test-suite/trunk/MultiSource/Applications/ClamAV/COPYING test-suite/trunk/MultiSource/Applications/ClamAV/ClamAV-srcflat.tar.gz (with props) test-suite/trunk/MultiSource/Applications/ClamAV/LZMADecode.h test-suite/trunk/MultiSource/Applications/ClamAV/Makefile test-suite/trunk/MultiSource/Applications/ClamAV/README.LLVM-tests test-suite/trunk/MultiSource/Applications/ClamAV/aspack.h test-suite/trunk/MultiSource/Applications/ClamAV/autoit.h test-suite/trunk/MultiSource/Applications/ClamAV/binhex.h test-suite/trunk/MultiSource/Applications/ClamAV/blob.h test-suite/trunk/MultiSource/Applications/ClamAV/bzlib_private.h test-suite/trunk/MultiSource/Applications/ClamAV/cab.h test-suite/trunk/MultiSource/Applications/ClamAV/cclass.h test-suite/trunk/MultiSource/Applications/ClamAV/cdiff.h test-suite/trunk/MultiSource/Applications/ClamAV/cfgparser.h test-suite/trunk/MultiSource/Applications/ClamAV/chmunpack.h test-suite/trunk/MultiSource/Applications/ClamAV/clamav-config.h test-suite/trunk/MultiSource/Applications/ClamAV/clamav.h test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.c test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.ce test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.ce test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_opt.h test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.c test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.ce test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.h test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.c test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.ce test-suite/trunk/MultiSource/Applications/ClamAV/cltypes.h test-suite/trunk/MultiSource/Applications/ClamAV/cname.h test-suite/trunk/MultiSource/Applications/ClamAV/cvd.h test-suite/trunk/MultiSource/Applications/ClamAV/dbdir/ test-suite/trunk/MultiSource/Applications/ClamAV/dbdir/daily.cvd (with props) test-suite/trunk/MultiSource/Applications/ClamAV/dconf.h test-suite/trunk/MultiSource/Applications/ClamAV/dsig.h test-suite/trunk/MultiSource/Applications/ClamAV/elf.h test-suite/trunk/MultiSource/Applications/ClamAV/encoding_aliases.h test-suite/trunk/MultiSource/Applications/ClamAV/engine.c test-suite/trunk/MultiSource/Applications/ClamAV/entconv.h test-suite/trunk/MultiSource/Applications/ClamAV/entitylist.h test-suite/trunk/MultiSource/Applications/ClamAV/execs.h test-suite/trunk/MultiSource/Applications/ClamAV/filetypes.h test-suite/trunk/MultiSource/Applications/ClamAV/fsg.h test-suite/trunk/MultiSource/Applications/ClamAV/getopt.h test-suite/trunk/MultiSource/Applications/ClamAV/global.h test-suite/trunk/MultiSource/Applications/ClamAV/hashtab.h test-suite/trunk/MultiSource/Applications/ClamAV/htmlnorm.h test-suite/trunk/MultiSource/Applications/ClamAV/iana_tld.h test-suite/trunk/MultiSource/Applications/ClamAV/inputs/ test-suite/trunk/MultiSource/Applications/ClamAV/inputs/README test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v2.rar (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v3.rar (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.cab (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe.bz2 (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.zip (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clamdoc.pdf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/ test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc1.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc11.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc2.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc22.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/doc3.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/docCLAMexe.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/rtf-novirus.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/rtf1.rtf (with props) test-suite/trunk/MultiSource/Applications/ClamAV/is_tar.h test-suite/trunk/MultiSource/Applications/ClamAV/jscript.h test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_aspack.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_autoit.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_binhex.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_blob.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_cab.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_chmunpack.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_cvd.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_dconf.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_dsig.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_elf.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_entconv.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_filetypes.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_fsg.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_hashtab.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_htmlnorm.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_is_tar.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_jscript.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_line.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_lockdb.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_matcher-ac.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_matcher-bm.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_matcher.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_mbox.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_md5.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_message.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_mew.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_msexpand.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_mspack.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_nsis_LZMADecode.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_nsis_bzlib.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_nsis_infblock.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_nsis_nulsft.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_ole2_extract.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_others.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_packlibs.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_pdf.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_pe.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_petite.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_phish_domaincheck_db.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_phish_whitelist.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_phishcheck.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_pst.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_readdb.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_rebuildpe.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_regex_list.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_regex_regcomp.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_regex_regerror.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_regex_regexec.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_regex_regfree.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_regex_strlcpy.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_rtf.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_scanners.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_sis.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_snprintf.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_special.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_spin.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_str.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_suecrypt.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_table.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_text.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_tnef.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_unarj.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_unsp.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_untar.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_unzip.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_upack.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_upx.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_uuencode.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_vba_extract.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_wwunpack.c test-suite/trunk/MultiSource/Applications/ClamAV/libclamav_yc.c test-suite/trunk/MultiSource/Applications/ClamAV/line.h test-suite/trunk/MultiSource/Applications/ClamAV/lockdb.h test-suite/trunk/MultiSource/Applications/ClamAV/manager.h test-suite/trunk/MultiSource/Applications/ClamAV/matcher-ac.h test-suite/trunk/MultiSource/Applications/ClamAV/matcher-bm.h test-suite/trunk/MultiSource/Applications/ClamAV/matcher.h test-suite/trunk/MultiSource/Applications/ClamAV/mbox.h test-suite/trunk/MultiSource/Applications/ClamAV/md5.h test-suite/trunk/MultiSource/Applications/ClamAV/message.h test-suite/trunk/MultiSource/Applications/ClamAV/mew.h test-suite/trunk/MultiSource/Applications/ClamAV/misc.h test-suite/trunk/MultiSource/Applications/ClamAV/msexpand.h test-suite/trunk/MultiSource/Applications/ClamAV/mspack.h test-suite/trunk/MultiSource/Applications/ClamAV/network.h test-suite/trunk/MultiSource/Applications/ClamAV/nsis_bzlib.h test-suite/trunk/MultiSource/Applications/ClamAV/nsis_zconf.h test-suite/trunk/MultiSource/Applications/ClamAV/nsis_zlib.h test-suite/trunk/MultiSource/Applications/ClamAV/nsis_zutil.h test-suite/trunk/MultiSource/Applications/ClamAV/nulsft.h test-suite/trunk/MultiSource/Applications/ClamAV/ole2_extract.h test-suite/trunk/MultiSource/Applications/ClamAV/options.h test-suite/trunk/MultiSource/Applications/ClamAV/others.h test-suite/trunk/MultiSource/Applications/ClamAV/output.h test-suite/trunk/MultiSource/Applications/ClamAV/packlibs.h test-suite/trunk/MultiSource/Applications/ClamAV/pdf.h test-suite/trunk/MultiSource/Applications/ClamAV/pe.h test-suite/trunk/MultiSource/Applications/ClamAV/petite.h test-suite/trunk/MultiSource/Applications/ClamAV/phish_domaincheck_db.h test-suite/trunk/MultiSource/Applications/ClamAV/phish_whitelist.h test-suite/trunk/MultiSource/Applications/ClamAV/phishcheck.h test-suite/trunk/MultiSource/Applications/ClamAV/pst.h test-suite/trunk/MultiSource/Applications/ClamAV/readdb.h test-suite/trunk/MultiSource/Applications/ClamAV/rebuildpe.h test-suite/trunk/MultiSource/Applications/ClamAV/regex.h test-suite/trunk/MultiSource/Applications/ClamAV/regex2.h test-suite/trunk/MultiSource/Applications/ClamAV/regex_list.h test-suite/trunk/MultiSource/Applications/ClamAV/rtf.h test-suite/trunk/MultiSource/Applications/ClamAV/scanners.h test-suite/trunk/MultiSource/Applications/ClamAV/scripts/ test-suite/trunk/MultiSource/Applications/ClamAV/scripts/header_rename.sh test-suite/trunk/MultiSource/Applications/ClamAV/scripts/prepare.sh (with props) test-suite/trunk/MultiSource/Applications/ClamAV/scripts/remove.sh test-suite/trunk/MultiSource/Applications/ClamAV/scripts/rename.sh test-suite/trunk/MultiSource/Applications/ClamAV/sha256.h test-suite/trunk/MultiSource/Applications/ClamAV/shared_cdiff.c test-suite/trunk/MultiSource/Applications/ClamAV/shared_cfgparser.c test-suite/trunk/MultiSource/Applications/ClamAV/shared_getopt.c test-suite/trunk/MultiSource/Applications/ClamAV/shared_misc.c test-suite/trunk/MultiSource/Applications/ClamAV/shared_network.c test-suite/trunk/MultiSource/Applications/ClamAV/shared_options.c test-suite/trunk/MultiSource/Applications/ClamAV/shared_output.c test-suite/trunk/MultiSource/Applications/ClamAV/shared_sha256.c test-suite/trunk/MultiSource/Applications/ClamAV/sis.h test-suite/trunk/MultiSource/Applications/ClamAV/snprintf.h test-suite/trunk/MultiSource/Applications/ClamAV/special.h test-suite/trunk/MultiSource/Applications/ClamAV/spin.h test-suite/trunk/MultiSource/Applications/ClamAV/str.h test-suite/trunk/MultiSource/Applications/ClamAV/suecrypt.h test-suite/trunk/MultiSource/Applications/ClamAV/table.h test-suite/trunk/MultiSource/Applications/ClamAV/target.h test-suite/trunk/MultiSource/Applications/ClamAV/test_farm_farm.c test-suite/trunk/MultiSource/Applications/ClamAV/test_libclamav_libclamav.c test-suite/trunk/MultiSource/Applications/ClamAV/test_mbox_debugm.c test-suite/trunk/MultiSource/Applications/ClamAV/test_pe_debugpe.c test-suite/trunk/MultiSource/Applications/ClamAV/text.h test-suite/trunk/MultiSource/Applications/ClamAV/tnef.h test-suite/trunk/MultiSource/Applications/ClamAV/treewalk.h test-suite/trunk/MultiSource/Applications/ClamAV/unarj.h test-suite/trunk/MultiSource/Applications/ClamAV/unsp.h test-suite/trunk/MultiSource/Applications/ClamAV/untar.h test-suite/trunk/MultiSource/Applications/ClamAV/unzip.h test-suite/trunk/MultiSource/Applications/ClamAV/upack.h test-suite/trunk/MultiSource/Applications/ClamAV/upx.h test-suite/trunk/MultiSource/Applications/ClamAV/utils.h test-suite/trunk/MultiSource/Applications/ClamAV/uuencode.h test-suite/trunk/MultiSource/Applications/ClamAV/vba_extract.h test-suite/trunk/MultiSource/Applications/ClamAV/wwunpack.h test-suite/trunk/MultiSource/Applications/ClamAV/yc.h Modified: test-suite/trunk/MultiSource/Applications/Makefile Added: test-suite/trunk/MultiSource/Applications/ClamAV/COPYING URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/COPYING?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/COPYING (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/COPYING Wed Jan 30 15:17:10 2008 @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: test-suite/trunk/MultiSource/Applications/ClamAV/ClamAV-srcflat.tar.gz URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/ClamAV-srcflat.tar.gz?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/ClamAV-srcflat.tar.gz ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/LZMADecode.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/LZMADecode.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/LZMADecode.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/LZMADecode.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,126 @@ +/* + * LZMADecode.c + * + * This file is a part of LZMA compression module for NSIS. + * + * Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov + * Modifications Copyright (C) 2003-2007 Amir Szekely + * + * Licensed under the Common Public License version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * Licence details can be found in the file COPYING.nsis. + * + * This software is provided 'as-is', without any express or implied + * warranty. + */ + +#ifndef __LZMADECODE_H +#define __LZMADECODE_H + +/* #define _LZMA_PROB32 */ +/* It can increase speed on some 32-bit CPUs, + but memory usage will be doubled in that case */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "others.h" + +#ifndef lzmaalloc +#define lzmaalloc cli_malloc +#endif + +#ifndef lzmafree +#define lzmafree free +#endif + +#ifndef LZMACALL +# define LZMACALL +#endif + +#ifndef UInt32 +#ifdef _LZMA_UINT32_IS_ULONG +#define UInt32 unsigned long +#else +#define UInt32 unsigned int +#endif +#endif + +#ifdef _LZMA_PROB32 +#define CProb UInt32 +#else +#define CProb unsigned short +#endif + +typedef unsigned char lzByte; + +#define LZMA_STREAM_END 1 +#define LZMA_OK 0 +#define LZMA_DATA_ERROR -1 +/* we don't really care what the problem is... */ +/* #define LZMA_RESULT_NOT_ENOUGH_MEM -2 */ +#define LZMA_NOT_ENOUGH_MEM -1 + +typedef struct +{ + /* mode control */ + int mode; + int last; + int last2; + int last3; + + /* properties */ + UInt32 dynamicDataSize; + UInt32 dictionarySize; + + /* io */ + lzByte *next_in; /* next input byte */ + UInt32 avail_in; /* number of bytes available at next_in */ + + lzByte *next_out; /* next output byte should be put there */ + UInt32 avail_out; /* remaining free space at next_out */ + + UInt32 totalOut; /* total output - not always correct when lzmaDecode returns */ + + /* saved state */ + lzByte previousByte; + lzByte matchByte; + CProb *probs; + CProb *prob; + int mi; + int posState; + int temp1; + int temp2; + int temp3; + int lc; + int state; + int isPreviousMatch; + int len; + UInt32 rep0; + UInt32 rep1; + UInt32 rep2; + UInt32 rep3; + UInt32 posStateMask; + UInt32 literalPosMask; + UInt32 dictionaryPos; + + /* range coder */ + UInt32 range; + UInt32 code; + + /* allocated buffers */ + lzByte *dictionary; + lzByte *dynamicData; +} lzma_stream; + +void LZMACALL lzmaInit(lzma_stream *); +int LZMACALL lzmaDecode(lzma_stream *); +void LZMACALL lzmaShutdown(lzma_stream *); /* aCaB */ + +#ifdef __cplusplus +} +#endif + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/Makefile URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/Makefile?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/Makefile (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/Makefile Wed Jan 30 15:17:10 2008 @@ -0,0 +1,108 @@ +LEVEL = ../../../ +#RUN_OPTIONS = + +Source = $(addprefix libclamav_, \ + aspack.c autoit.c binhex.c blob.c cab.c chmunpack.c cvd.c dconf.c dsig.c\ + elf.c entconv.c filetypes.c fsg.c hashtab.c htmlnorm.c\ + is_tar.c jscript.c line.c lockdb.c matcher-ac.c matcher-bm.c\ + matcher.c mbox.c md5.c message.c mew.c msexpand.c mspack.c ole2_extract.c\ + others.c packlibs.c pdf.c pe.c petite.c phishcheck.c phish_domaincheck_db.c phish_whitelist.c\ + pst.c readdb.c rebuildpe.c regex_list.c rtf.c scanners.c sis.c snprintf.c special.c spin.c str.c suecrypt.c\ + table.c text.c tnef.c unarj.c unsp.c untar.c unzip.c upack.c upx.c uuencode.c vba_extract.c wwunpack.c yc.c)\ + $(addprefix clamscan_, \ + clamscan.c manager.c others.c treewalk.c)\ + $(addprefix shared_, \ + cdiff.c cfgparser.c getopt.c misc.c network.c options.c output.c sha256.c)\ + $(addprefix libclamav_regex_, \ + regerror.c, regfree.c, \ + regcomp.c, regexec.c, strlcpy.c)\ + $(addprefix libclamav_nsis_, \ + nulsft.c, bzlib.c, infblock.c, LZMADecode.c ) +# SVN version has these: +# inflate64.c lzma_iface.c +# $(addprefix libclamav_lzma_, \ +# LzmaStateDecode.c) \ + +PROG = clamscan +CPPFLAGS += -DHAVE_CONFIG_H -I. +LDFLAGS = -lz +RUN_OPTIONS = --debug --no-summary -ddbdir -r inputs/* + +include $(LEVEL)/Makefile.config + + +# for ClamAV these are in clamav-config.h, but since we can't run configure, we have to define them here + + +# -- OS macros -- +# It is especially important to get this correctly defined for windows. + +ifeq ($(OS),Darwin) + CPPFLAGS += -DC_DARWIN +endif +ifeq ($(OS),AIX) + CPPFLAGS += -DC_AIX +endif +ifeq ($(OS), IRIX) + CPPFLAGS += -DC_IRIX +endif +ifeq ($(OS), Cygwin) + CPPFLAGS += -DC_CYGWIN +endif +ifeq ($(OS), FreeBSD) + CPPFLAGS += -DC_BSD +endif +ifeq ($(OS), OpenBSD) + CPPFLAGS += -DC_BSD +endif +ifeq ($(OS), NetBSD) + CPPFLAGS += -DC_BSD +endif +ifeq ($(OS), HP-UX) + CPPFLAGS += -DC_HPUX +endif +ifeq ($(OS), Interix) + CPPFLAGS += -DC_INTERIX -DC_WINDOWS +endif +ifeq ($(OS), Win32) + CPPFLAGS += -DC_WINDOWS +endif +ifeq ($(OS), mingw) + CPPFLAGS += -DC_WINDOWS +endif +ifeq ($(OS), Linux) + CPPFLAGS += -DC_LINUX +endif + +# -- except ARM all arches have WORDS_BIGENDIAN same as ENDIAN. +# for ARM we'd need a runtime autoconf check to detect. +# Only affects autoit.c, not defining this macro will partially disable it. + +ifneq ($(ARCH),ARM) +ifeq ($(ENDIAN),little) + CPPFLAGS += -DFPU_WORDS_BIGENDIAN=0 +endif +ifeq ($(ENDIAN),big) + CPPFLAGS += -DFPU_WORDS_BIGENDIAN=1 +endif +endif + + +# -- endianness detection -- +# It is important to get this correctly, especially for Sparc. +# If arch is little endian the code possibly does unaligned accesses, that would +# cause a SIGBUS on Sparc. + +ifeq ($(ENDIAN),little) + CPPFLAGS += -DWORDS_BIGENDIAN=0 +endif +ifeq ($(ENDIAN),big) + CPPFLAGS += -DWORDS_BIGENDIAN=1 +endif + +include ../../Makefile.multisrc +#compare debug output +DIFFPROG := $(PROGDIR)/DiffOutput.sh "diff " + +EXTRA_LLI_OPTS += -load=libz +EXTRA_JIT_OPTS += -load=libz Added: test-suite/trunk/MultiSource/Applications/ClamAV/README.LLVM-tests URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/README.LLVM-tests?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/README.LLVM-tests (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/README.LLVM-tests Wed Jan 30 15:17:10 2008 @@ -0,0 +1,49 @@ +Building ClamAV (www.clamav.net) for llvm's testsuite. + +To get sources from clamav's repository +(currently from 0.92 stable version, you can edit the tag in prepare.sh) + +$ ./prepare.sh checkout +$ ./prepare.sh copy +$ ./prepare.sh getdb + +Provided files: +prepare.sh +rename.sh: used by prepare.sh +header_rename.sh: used by prepare.sh +clamav-config.h: minimal config header, so we don't have to run autoconf +Makefile: integrate ClamAV into LLVM-testsuite's build-system +filterdiff.sh: compare --debug output to test code generation correctness + +Important to know: + +The directory inputs/ contains files (or symlinks to) to be scanned during the test. +These can be any files, but they must be the same each time you run +the test, to ensure consistency of results. + +The directory dbdir/ contains the virus database. You get an initial copy with the +prepare.sh. +Note, that the recommended way to update is via freshclam(1). Updating the database +is not important for the test-suite. +When you import a new version of ClamAV into the testsuite it is recommended to +use latest DB however. + +When execute clamscan creates files in the system tmp directory (usually /tmp). +Watch disk space! + + + +BUGREPORTS +---------- +If you encounter problems with ClamAV itself, please try to reproduce the problem with +clamav built from latest stable available on www.clamav.net. + +You can report bugs on http://bugs.clamav.net + +If you haven't tried to reproduce problem with the original clamav, +please add a reference to the LLVM bugreport, and a descriptive text in subject stating +it is related to LLVM testsuite. + +For bugs opened on LLVM bugzilla regarding ClamAV testsuite failures +(that are not due to bugs in LLVM), please CC: edwin at clamav dot net + Added: test-suite/trunk/MultiSource/Applications/ClamAV/aspack.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/aspack.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/aspack.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/aspack.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2007 Amaketos, LLC + * Authors: Luciano Giuseppe 'Pnluck' + * aCaB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __ASPACK_H +#define __ASPACK_H + +#include "cltypes.h" +#include "execs.h" + +int unaspack212(uint8_t *, unsigned int, struct cli_exe_section *, uint16_t, uint32_t, uint32_t, int); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/autoit.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/autoit.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/autoit.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/autoit.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2007 Sourcefire Inc. + * Author: aCaB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __AUTOIT_H +#define __AUTOIT_H + +#include "others.h" +int cli_scanautoit(int desc, cli_ctx *ctx, off_t offset); +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/binhex.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/binhex.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/binhex.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/binhex.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2004 Nigel Horne + * + * 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 of the License, 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. + * + * Change History: + * $Log: binhex.h,v $ + * Revision 1.4 2006/04/09 19:59:27 kojm + * update GPL headers with new address for FSF + * + * Revision 1.3 2004/11/18 19:30:29 kojm + * add support for Mac's HQX file format + * + * Revision 1.2 2004/11/18 18:24:45 nigelhorne + * Added binhex.h + * + */ + +#ifndef __BINHEX_H +#define __BINHEX_H + +int cli_binhex(const char *dir, int desc); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/blob.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/blob.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/blob.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/blob.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2002 Nigel Horne + * + * 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 of the License, 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. + */ + +#ifndef __BLOB_H +#define __BLOB_H + +/* + * Resizable chunk of memory + */ +typedef struct blob { + char *name; /* filename */ + unsigned char *data; /* the stuff itself */ + off_t len; /* number of bytes of data so far */ + off_t size; /* number of bytes allocated to data so far */ + int isClosed; +#ifdef CL_DEBUG + object_type magic; /* verify that this is a blob */ +#endif +} blob; + +blob *blobCreate(void); +void blobDestroy(blob *b); +void blobArrayDestroy(blob *b[], int n); +void blobSetFilename(blob *b, const char *dir, const char *filename); +int blobAddData(blob *b, const unsigned char *data, size_t len); +unsigned char *blobGetData(const blob *b); +size_t blobGetDataSize(const blob *b); +void blobClose(blob *b); +int blobcmp(const blob *b1, const blob *b2); +int blobGrow(blob *b, size_t len); + +/* + * Like a blob, but associated with a file stored in the temporary directory + */ +typedef struct fileblob { + FILE *fp; + blob b; /* + * b.name is the name of the attachment as stored in the + * email, not the full path name of the temporary file + */ + char *fullname; /* full pathname of the file */ + unsigned int isNotEmpty : 1; + unsigned int isInfected : 1; + unsigned long bytes_scanned; + cli_ctx *ctx; +} fileblob; + +fileblob *fileblobCreate(void); +int fileblobScanAndDestroy(fileblob *fb); +void fileblobDestructiveDestroy(fileblob *fb); +void fileblobDestroy(fileblob *fb); +void fileblobSetFilename(fileblob *fb, const char *dir, const char *filename); +const char *fileblobGetFilename(const fileblob *fb); +void fileblobSetCTX(fileblob *fb, cli_ctx *ctx); +int fileblobAddData(fileblob *fb, const unsigned char *data, size_t len); +int fileblobScan(const fileblob *fb); +int fileblobInfected(const fileblob *fb); +void sanitiseName(char *name); + +#endif /*_BLOB_H*/ Added: test-suite/trunk/MultiSource/Applications/ClamAV/bzlib_private.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/bzlib_private.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/bzlib_private.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/bzlib_private.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,471 @@ + +/*-------------------------------------------------------------*/ +/*--- Private header file for the library. ---*/ +/*--- bzlib_private.h ---*/ +/*-------------------------------------------------------------*/ + +/* ------------------------------------------------------------------ + This file is part of bzip2/libbzip2, a program and library for + lossless, block-sorting data compression. + + bzip2/libbzip2 version 1.0.4 of 20 December 2006 + Copyright (C) 1996-2006 Julian Seward + This file was modified for ClamAV by aCaB + + This program is released under the terms of the license contained + in the file COPYING.nsis. + ------------------------------------------------------------------ */ + + +#ifndef _BZLIB_PRIVATE_H +#define _BZLIB_PRIVATE_H + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include + +#ifndef BZ_NO_STDIO +#include +#include +#include +#endif + +#include "nsis_bzlib.h" + + + +/*-- General stuff. --*/ + +#define BZ_VERSION "1.0.4, 20-Dec-2006" + +typedef char Char; +typedef unsigned char Bool; +typedef unsigned char UChar; +typedef int Int32; +typedef unsigned int UInt32; +typedef short Int16; +typedef unsigned short UInt16; + +#define True ((Bool)1) +#define False ((Bool)0) + +#ifndef __GNUC__ +#define __inline__ /* */ +#endif + +/* aCaB */ +/* #ifndef BZ_NO_STDIO */ + +/* extern void BZ2_bz__AssertH__fail ( int errcode ); */ +/* #define AssertH(cond,errcode) \ */ +/* { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } */ + +/* #if BZ_DEBUG */ +/* #define AssertD(cond,msg) \ */ +/* { if (!(cond)) { \ */ +/* fprintf ( stderr, \ */ +/* "\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\ */ +/* exit(1); \ */ +/* }} */ +/* #else */ +/* #define AssertD(cond,msg) /\* *\/ */ +/* #endif */ + +/* #define VPrintf0(zf) \ */ +/* fprintf(stderr,zf) */ +/* #define VPrintf1(zf,za1) \ */ +/* fprintf(stderr,zf,za1) */ +/* #define VPrintf2(zf,za1,za2) \ */ +/* fprintf(stderr,zf,za1,za2) */ +/* #define VPrintf3(zf,za1,za2,za3) \ */ +/* fprintf(stderr,zf,za1,za2,za3) */ +/* #define VPrintf4(zf,za1,za2,za3,za4) \ */ +/* fprintf(stderr,zf,za1,za2,za3,za4) */ +/* #define VPrintf5(zf,za1,za2,za3,za4,za5) \ */ +/* fprintf(stderr,zf,za1,za2,za3,za4,za5) */ + +/* #else */ + +/* extern void bz_internal_error ( int errcode ); */ +/* #define AssertH(cond,errcode) \ */ +/* { if (!(cond)) bz_internal_error ( errcode ); } */ +/* #define AssertD(cond,msg) do { } while (0) */ +#define VPrintf0(zf) do { } while (0) +#define VPrintf1(zf,za1) do { } while (0) +#define VPrintf2(zf,za1,za2) do { } while (0) +#define VPrintf3(zf,za1,za2,za3) do { } while (0) +#define VPrintf4(zf,za1,za2,za3,za4) do { } while (0) +#define VPrintf5(zf,za1,za2,za3,za4,za5) do { } while (0) + +/* #endif */ + +#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1) +#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp)) + + +/*-- Header bytes. --*/ + +/* #define BZ_HDR_B 0x42 /\* 'B' *\/ */ +/* #define BZ_HDR_Z 0x5a /\* 'Z' *\/ */ +/* #define BZ_HDR_h 0x68 /\* 'h' *\/ */ +/* #define BZ_HDR_0 0x30 /\* '0' *\/ */ + +/*-- Constants for the back end. --*/ + +#define BZ_MAX_ALPHA_SIZE 258 +#define BZ_MAX_CODE_LEN 23 + +#define BZ_RUNA 0 +#define BZ_RUNB 1 + +#define BZ_N_GROUPS 6 +#define BZ_G_SIZE 50 +#define BZ_N_ITERS 4 + +#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE)) + + + +/*-- Stuff for randomising repetitive blocks. --*/ +/* aCaB */ +/* extern Int32 BZ2_rNums[512]; */ + +#define BZ_RAND_DECLS \ + Int32 rNToGo; \ + Int32 rTPos \ + +#define BZ_RAND_INIT_MASK \ + s->rNToGo = 0; \ + s->rTPos = 0 \ + +#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0) + +#define BZ_RAND_UPD_MASK \ + if (s->rNToGo == 0) { \ + s->rNToGo = BZ2_rNums[s->rTPos]; \ + s->rTPos++; \ + if (s->rTPos == 512) s->rTPos = 0; \ + } \ + s->rNToGo--; +/**/ + +/*-- Stuff for doing CRCs. --*/ +/* aCaB +extern UInt32 BZ2_crc32Table[256]; + +#define BZ_INITIALISE_CRC(crcVar) \ +{ \ + crcVar = 0xffffffffL; \ +} + +#define BZ_FINALISE_CRC(crcVar) \ +{ \ + crcVar = ~(crcVar); \ +} + +#define BZ_UPDATE_CRC(crcVar,cha) \ +{ \ + crcVar = (crcVar << 8) ^ \ + BZ2_crc32Table[(crcVar >> 24) ^ \ + ((UChar)cha)]; \ +} +*/ + +/*-- States and modes for compression. --*/ + +#define BZ_M_IDLE 1 +#define BZ_M_RUNNING 2 +#define BZ_M_FLUSHING 3 +#define BZ_M_FINISHING 4 + +#define BZ_S_OUTPUT 1 +#define BZ_S_INPUT 2 + +#define BZ_N_RADIX 2 +#define BZ_N_QSORT 12 +#define BZ_N_SHELL 18 +#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2) + + + + +/*-- Structure holding all the compression-side stuff. --*/ + +typedef + struct { + /* pointer back to the struct nsis_bzstream */ + nsis_bzstream* strm; + + /* mode this stream is in, and whether inputting */ + /* or outputting data */ + Int32 mode; + Int32 state; + + /* remembers avail_in when flush/finish requested */ + UInt32 avail_in_expect; + + /* for doing the block sorting */ + UInt32* arr1; + UInt32* arr2; + UInt32* ftab; + Int32 origPtr; + + /* aliases for arr1 and arr2 */ + UInt32* ptr; + UChar* block; + UInt16* mtfv; + UChar* zbits; + + /* for deciding when to use the fallback sorting algorithm */ + Int32 workFactor; + + /* run-length-encoding of the input */ + UInt32 state_in_ch; + Int32 state_in_len; + BZ_RAND_DECLS; + + /* input and output limits and current posns */ + Int32 nblock; + Int32 nblockMAX; + Int32 numZ; + Int32 state_out_pos; + + /* map of bytes used in block */ + Int32 nInUse; + Bool inUse[256]; + UChar unseqToSeq[256]; + + /* the buffer for bit stream creation */ + UInt32 bsBuff; + Int32 bsLive; + + /* block and combined CRCs */ + UInt32 blockCRC; + UInt32 combinedCRC; + + /* misc administratium */ + Int32 verbosity; + Int32 blockNo; + Int32 blockSize100k; + + /* stuff for coding the MTF values */ + Int32 nMTF; + Int32 mtfFreq [BZ_MAX_ALPHA_SIZE]; + UChar selector [BZ_MAX_SELECTORS]; + UChar selectorMtf[BZ_MAX_SELECTORS]; + + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + /* second dimension: only 3 needed; 4 makes index calculations faster */ + UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4]; + + } + EState; + + +/*-- states for decompression. --*/ + +#define BZ_X_IDLE 1 +#define BZ_X_OUTPUT 2 + +#define BZ_X_MAGIC_1 10 +#define BZ_X_MAGIC_2 11 +#define BZ_X_MAGIC_3 12 +#define BZ_X_MAGIC_4 13 +#define BZ_X_BLKHDR_1 14 +#define BZ_X_BLKHDR_2 15 +#define BZ_X_BLKHDR_3 16 +#define BZ_X_BLKHDR_4 17 +#define BZ_X_BLKHDR_5 18 +#define BZ_X_BLKHDR_6 19 +#define BZ_X_BCRC_1 20 +#define BZ_X_BCRC_2 21 +#define BZ_X_BCRC_3 22 +#define BZ_X_BCRC_4 23 +#define BZ_X_RANDBIT 24 +#define BZ_X_ORIGPTR_1 25 +#define BZ_X_ORIGPTR_2 26 +#define BZ_X_ORIGPTR_3 27 +#define BZ_X_MAPPING_1 28 +#define BZ_X_MAPPING_2 29 +#define BZ_X_SELECTOR_1 30 +#define BZ_X_SELECTOR_2 31 +#define BZ_X_SELECTOR_3 32 +#define BZ_X_CODING_1 33 +#define BZ_X_CODING_2 34 +#define BZ_X_CODING_3 35 +#define BZ_X_MTF_1 36 +#define BZ_X_MTF_2 37 +#define BZ_X_MTF_3 38 +#define BZ_X_MTF_4 39 +#define BZ_X_MTF_5 40 +#define BZ_X_MTF_6 41 +#define BZ_X_ENDHDR_2 42 +#define BZ_X_ENDHDR_3 43 +#define BZ_X_ENDHDR_4 44 +#define BZ_X_ENDHDR_5 45 +#define BZ_X_ENDHDR_6 46 +#define BZ_X_CCRC_1 47 +#define BZ_X_CCRC_2 48 +#define BZ_X_CCRC_3 49 +#define BZ_X_CCRC_4 50 + + + +/*-- Constants for the fast MTF decoder. --*/ + +#define MTFA_SIZE 4096 +#define MTFL_SIZE 16 + + + +/*-- Structure holding all the decompression-side stuff. --*/ + +typedef + struct { + /* pointer back to the struct nsis_bzstream */ + nsis_bzstream* strm; + + /* state indicator for this stream */ + Int32 state; + + /* for doing the final run-length decoding */ + UChar state_out_ch; + Int32 state_out_len; + Bool blockRandomised; + BZ_RAND_DECLS; + + /* the buffer for bit stream reading */ + UInt32 bsBuff; + Int32 bsLive; + + /* misc administratium */ + Int32 blockSize100k; + Bool smallDecompress; + Int32 currBlockNo; + Int32 verbosity; + + /* for undoing the Burrows-Wheeler transform */ + Int32 origPtr; + UInt32 tPos; + Int32 k0; + Int32 unzftab[256]; + Int32 nblock_used; + Int32 cftab[257]; + Int32 cftabCopy[257]; + + /* for undoing the Burrows-Wheeler transform (FAST) */ + UInt32 *tt; + + /* for undoing the Burrows-Wheeler transform (SMALL) */ + UInt16 *ll16; + UChar *ll4; + + /* stored and calculated CRCs */ + UInt32 storedBlockCRC; + UInt32 storedCombinedCRC; + UInt32 calculatedBlockCRC; + UInt32 calculatedCombinedCRC; + + /* map of bytes used in block */ + Int32 nInUse; + Bool inUse[256]; + Bool inUse16[16]; + UChar seqToUnseq[256]; + + /* for decoding the MTF values */ + UChar mtfa [MTFA_SIZE]; + Int32 mtfbase[256 / MTFL_SIZE]; + UChar selector [BZ_MAX_SELECTORS]; + UChar selectorMtf[BZ_MAX_SELECTORS]; + UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + + Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; + Int32 minLens[BZ_N_GROUPS]; + + /* save area for scalars in the main decompress code */ + Int32 save_i; + Int32 save_j; + Int32 save_t; + Int32 save_alphaSize; + Int32 save_nGroups; + Int32 save_nSelectors; + Int32 save_EOB; + Int32 save_groupNo; + Int32 save_groupPos; + Int32 save_nextSym; + Int32 save_nblockMAX; + Int32 save_nblock; + Int32 save_es; + Int32 save_N; + Int32 save_curr; + Int32 save_zt; + Int32 save_zn; + Int32 save_zvec; + Int32 save_zj; + Int32 save_gSel; + Int32 save_gMinlen; + Int32* save_gLimit; + Int32* save_gBase; + Int32* save_gPerm; + + } + DState; + + + +/*-- Macros for decompression. --*/ + +#define BZ_GET_FAST(cccc) \ + if (s->tPos >= s->blockSize100k * 100000) return True; \ + s->tPos = s->tt[s->tPos]; \ + cccc = (UChar)(s->tPos & 0xff); \ + s->tPos >>= 8; + +#define BZ_GET_FAST_C(cccc) \ + if (c_tPos >= s->blockSize100k * 100000) return True; \ + c_tPos = c_tt[c_tPos]; \ + cccc = (UChar)(c_tPos & 0xff); \ + c_tPos >>= 8; + +#define SET_LL4(i,n) \ + { if (((i) & 0x1) == 0) \ + s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \ + s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \ + } + +#define GET_LL4(i) \ + ((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF) + +#define SET_LL(i,n) \ + { s->ll16[i] = (UInt16)(n & 0x0000ffff); \ + SET_LL4(i, n >> 16); \ + } + +#define GET_LL(i) \ + (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) + +#define BZ_GET_SMALL(cccc) \ + cccc = indexIntoF ( s->tPos, s->cftab ); \ + s->tPos = GET_LL(s->tPos); + +#endif + + +/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/ + +#ifdef BZ_NO_STDIO +#ifndef NULL +#define NULL 0 +#endif +#endif + + +/*-------------------------------------------------------------*/ +/*--- end bzlib_private.h ---*/ +/*-------------------------------------------------------------*/ Added: test-suite/trunk/MultiSource/Applications/ClamAV/cab.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/cab.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/cab.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/cab.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2006 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __CAB_H +#define __CAB_H + +#include +#include "cltypes.h" + +#define CAB_BLOCKMAX 32768 +#define CAB_INPUTMAX (CAB_BLOCKMAX + 6144) + +struct cab_archive { + uint32_t length; + uint16_t nfolders; + uint16_t nfiles; + uint16_t flags; + uint16_t reshdr; + uint8_t resdata; + struct cab_folder *folders; + struct cab_file *files; +}; + +struct cab_state { + unsigned char *pt, *end; + unsigned char block[CAB_INPUTMAX]; + uint16_t blklen; + uint16_t outlen; + void *stream; + uint16_t blknum; +}; + +struct cab_file { + uint32_t length; + uint16_t attribs; + off_t offset; + char *name; + int error; + int fd; + int ofd; + struct cab_folder *folder; + struct cab_file *next; + struct cab_archive *cab; + struct cab_state *state; +}; + +struct cab_folder { + uint16_t cmethod; + uint16_t nblocks; + struct cab_archive *cab; + off_t offset; + struct cab_folder *next; +}; + +int cab_open(int fd, off_t offset, struct cab_archive *cab); +int cab_extract(struct cab_file *file, const char *name); +void cab_free(struct cab_archive *cab); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/cclass.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/cclass.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/cclass.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/cclass.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,68 @@ +/*- + * This code is derived from OpenBSD's libc/regex, original license follows: + * + * Copyright (c) 1992, 1993, 1994 Henry Spencer. + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cclass.h 8.3 (Berkeley) 3/20/94 + */ + +/* character-class table */ +static struct cclass { + const char *name; + const char *chars; + const char *multis; +} cclasses[] = { + { "alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ +0123456789", ""} , + { "alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + ""} , + { "blank", " \t", ""} , + { "cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ +\25\26\27\30\31\32\33\34\35\36\37\177", ""} , + { "digit", "0123456789", ""} , + { "graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ +0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", + ""} , + { "lower", "abcdefghijklmnopqrstuvwxyz", + ""} , + { "print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ +0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", + ""} , + { "punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", + ""} , + { "space", "\t\n\v\f\r ", ""} , + { "upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + ""} , + { "xdigit", "0123456789ABCDEFabcdef", + ""} , + { NULL, 0, "" } +}; Added: test-suite/trunk/MultiSource/Applications/ClamAV/cdiff.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/cdiff.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/cdiff.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/cdiff.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2006 Sensory Networks, Inc. + * (C) 2007 Tomasz Kojm + * Written by Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __CDIFF_H +#define __CDIFF_H + +int cdiff_apply(int fd, unsigned short mode); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/cfgparser.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/cfgparser.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/cfgparser.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/cfgparser.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2002 - 2005 Tomasz Kojm + * + * 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 of the License, 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. + */ + +#ifndef __CFGPARSER_H +#define __CFGPARSER_H + +#define LINE_LENGTH 1024 + +#define OPT_STR 1 /* string argument (space delimited) */ +#define OPT_NUM 2 /* numerical argument */ +#define OPT_COMPSIZE 3 /* convert kilobytes (k) and megabytes (m) to bytes */ +#define OPT_BOOL 4 /* boolean value */ +#define OPT_FULLSTR 5 /* string argument, but get a full line */ +#define OPT_QUOTESTR 6 /* string argument, (space delimited unless the argument starts with ' or ". If the argument starts with a quote character, then the argument data is what appears between the starting quote character and the matching ending quote character.) */ + +#define OPT_CLAMD 1 +#define OPT_FRESHCLAM 2 + +struct cfgoption { + const char *name; + unsigned short argtype; + int numarg; + const char *strarg; + short multiple; + unsigned short owner; +}; + +struct cfgstruct { + char *optname; + char *strarg; + int numarg; + short enabled; + short multiple; + struct cfgstruct *nextarg; + struct cfgstruct *next; +}; + +extern struct cfgoption cfg_options[]; + +struct cfgstruct *getcfg(const char *cfgfile, int verbose); +const struct cfgstruct *cfgopt(const struct cfgstruct *copt, const char *optname); +void freecfg(struct cfgstruct *copt); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/chmunpack.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/chmunpack.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/chmunpack.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/chmunpack.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,27 @@ +/* + * Extract component parts of MS CHM files + * + * Copyright (C) 2004 trog at uncon.org + * + * 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 of the License, 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. + */ + +#ifndef __CHM_UNPACK_H +#define __CHM_UNPACK_H + +int chm_unpack(int fd, const char *dirname); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamav-config.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamav-config.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamav-config.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamav-config.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,398 @@ +/* clamav-config.h. Generated from clamav-config.h.in by configure. */ +/* clamav-config.h.in. Generated from configure.in by autoheader. */ + +/* enable bind8 compatibility */ +/* #undef BIND_8_COMPAT */ + +/* Define if your snprintf is busted */ +/* #undef BROKEN_SNPRINTF */ + +/* "build clamd" */ +/* #undef BUILD_CLAMD */ + +/* name of the clamav group */ +#define CLAMAVGROUP "clamav" + +/* name of the clamav user */ +#define CLAMAVUSER "clamav" + +/* enable clamuko */ +/* #undef CLAMUKO */ + +/* enable debugging */ +/* #undef CL_DEBUG */ + +/* enable experimental code */ +/* #undef CL_EXPERIMENTAL */ + +/* thread safe */ +/* #undef CL_THREAD_SAFE */ + +/* where to look for the config file */ +#define CONFDIR "/usr/local/etc" + +/* os is aix */ +/* #undef C_AIX */ + +/* os is beos */ +/* #undef C_BEOS */ + +/* Increase thread stack size. */ +/* #undef C_BIGSTACK */ + +/* os is bsd flavor */ +/* #undef C_BSD */ + +/* os is cygwin */ +/* #undef C_CYGWIN */ + +/* os is darwin */ +/* #undef C_DARWIN */ + +/* target is gnu-hurd */ +/* #undef C_GNU_HURD */ + +/* os is hpux */ +/* #undef C_HPUX */ + +/* os is interix */ +/* #undef C_INTERIX */ + +/* os is irix */ +/* #undef C_IRIX */ + +/* target is kfreebsd-gnu */ +/* #undef C_KFREEBSD_GNU */ + +/* target is linux */ +/* #define C_LINUX 1 */ + +/* os is OS/2 */ +/* #undef C_OS2 */ + +/* os is osf/tru64 */ +/* #undef C_OSF */ + +/* os is QNX 6.x.x */ +/* #undef C_QNX6 */ + +/* os is solaris */ +/* #undef C_SOLARIS */ + +/* Path to virus database directory. */ +#define DATADIR "/usr/local/share/clamav" + +/* "default FD_SETSIZE value" */ +#define DEFAULT_FD_SETSIZE 1024 + +/* "build unrar code" */ +/* #undef ENABLE_UNRAR */ + +/* file i/o buffer size */ +#define FILEBUFF 8192 + +/* FPU byte ordering is little endian */ +#define FPU_WORDS_BIGENDIAN 0 + +/* enable workaround for broken DNS servers */ +/* #undef FRESHCLAM_DNS_FIX */ + +/* use "Cache-Control: no-cache" in freshclam */ +/* #undef FRESHCLAM_NO_CACHE */ + +/* access rights in msghdr */ +/* #undef HAVE_ACCRIGHTS_IN_MSGHDR */ + +/* attrib aligned */ +#define HAVE_ATTRIB_ALIGNED 1 + +/* attrib packed */ +#define HAVE_ATTRIB_PACKED 1 + +/* have bzip2 */ +/* #define HAVE_BZLIB_H 1 */ + +/* ancillary data style fd pass */ +/* #define HAVE_CONTROL_IN_MSGHDR 1 */ + +/* Define to 1 if you have the `ctime_r' function. */ +/* #define HAVE_CTIME_R 1 */ + +/* ctime_r takes 2 arguments */ +/* #define HAVE_CTIME_R_2 1 */ + +/* ctime_r takes 3 arguments */ +/* #undef HAVE_CTIME_R_3 */ + +/* Define to 1 if you have the header file. */ +/* #define HAVE_DLFCN_H 1 */ + +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ +#define HAVE_FSEEKO 1 + +/* gethostbyname_r takes 3 arguments */ +/* #undef HAVE_GETHOSTBYNAME_R_3 */ + +/* gethostbyname_r takes 5 arguments */ +/* #undef HAVE_GETHOSTBYNAME_R_5 */ + +/* gethostbyname_r takes 6 arguments */ +/* #undef HAVE_GETHOSTBYNAME_R_6 */ + +/* Define to 1 if you have the `getpagesize' function. */ +/* #define HAVE_GETPAGESIZE 1 */ + +/* have gmp installed */ +/* #undef HAVE_GMP */ + +/* Define to 1 if you have the header file. */ + #define HAVE_GRP_H 1 + +/* Define to 1 if you have the header file. */ +/* #define HAVE_ICONV_H 1 */ + +/* Define to 1 if you have the `inet_ntop' function. */ +/* #define HAVE_INET_NTOP 1 */ + +/* Define to 1 if you have the `initgroups' function. */ +/* #define HAVE_INITGROUPS 1 */ + +/* Define to 1 if you have the header file. */ +/* #define HAVE_INTTYPES_H 1 */ + +/* in_addr_t is defined */ +/* #define HAVE_IN_ADDR_T 1 */ + +/* in_port_t is defined */ +/* #define HAVE_IN_PORT_T 1 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBMILTER_MFAPI_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +/* #define HAVE_MALLOC_H 1 */ + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the header file. */ +/* #define HAVE_MEMORY_H 1 */ + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the `poll' function. */ +/* #define HAVE_POLL 1 */ + +/* Define to 1 if you have the header file. */ +/* #define HAVE_POLL_H 1 */ + +/* "pragma pack" */ +/* #undef HAVE_PRAGMA_PACK */ + +/* "pragma pack hppa/hp-ux style" */ +/* #undef HAVE_PRAGMA_PACK_HPPA */ + +/* Define to 1 if you have the header file. */ +#define HAVE_PWD_H 1 + +/* readdir_r takes 2 arguments */ +/* #undef HAVE_READDIR_R_2 */ + +/* readdir_r takes 3 arguments */ +/* #undef HAVE_READDIR_R_3 */ + +/* Define to 1 if you have the `recvmsg' function. */ +/* #define HAVE_RECVMSG 1 */ + +/* have resolv.h */ +/* #undef HAVE_RESOLV_H */ + +/* Define signed right shift implementation */ +#define HAVE_SAR 1 + +/* Define to 1 if you have the `sendmsg' function. */ +/* #define HAVE_SENDMSG 1 */ + +/* Define to 1 if you have the `setgroups' function. */ +/* #define HAVE_SETGROUPS 1 */ + +/* Define to 1 if you have the `setsid' function. */ +/* #define HAVE_SETSID 1 */ + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strerror_r' function. */ +/* #define HAVE_STRERROR_R 1 */ + +/* Define to 1 if you have the header file. */ +/* #define HAVE_STRINGS_H 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +/* #undef HAVE_STRLCAT */ + +/* Define to 1 if you have the `strlcpy' function. */ +/* #undef HAVE_STRLCPY */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_FILIO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_INTTYPES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_INT_TYPES_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* "have " */ +/* #undef HAVE_SYS_SELECT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #define HAVE_SYS_UIO_H 1 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TCPD_H */ + +/* Define to 1 if you have the header file. */ +/* #define HAVE_TERMIOS_H 1 */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* zlib installed */ +#define HAVE_ZLIB_H 1 + +/* Early Linux doesn't set cmsg fields */ +/* #undef INCOMPLETE_CMSG */ + +/* bzip funtions do not have bz2 prefix */ +/* #undef NOBZ2PREFIX */ + +/* "no fd_set" */ +/* #undef NO_FD_SET */ + +/* Name of package */ +#define PACKAGE "clamav" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* scan buffer size */ +#define SCANBUFF 131072 + +/* location of Sendmail binary */ +/* #undef SENDMAIL_BIN */ + +/* major version of Sendmail */ +/* #undef SENDMAIL_VERSION_A */ + +/* minor version of Sendmail */ +/* #undef SENDMAIL_VERSION_B */ + +/* subversion of Sendmail */ +/* #undef SENDMAIL_VERSION_C */ + +/* Define to 1 if the `setpgrp' function takes no argument. */ +#define SETPGRP_VOID 1 + +#if 0 +/* lets assume system has proper stdint that defines uintX_t. */ +/* The number of bytes in type int */ +/* #define SIZEOF_INT 4 */ + +/* The number of bytes in type long */ +#define SIZEOF_LONG 8 + +/* The number of bytes in type long long */ +#define SIZEOF_LONG_LONG 8 + +/* The number of bytes in type short */ +#define SIZEOF_SHORT 2 +#endif + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* use syslog */ +/* #define USE_SYSLOG 1 */ + +/* Version number of package */ +#define VERSION "devel-20071218" + +/* tcpwrappers support */ +/* #undef WITH_TCPWRAP */ + +/* endianess */ +/* #define WORDS_BIGENDIAN 0 */ + +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +/* #undef _LARGEFILE_SOURCE */ + +/* POSIX compatibility */ +/* #undef _POSIX_PII_SOCKET */ + +/* thread safe */ +/* #undef _REENTRANT */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `long int' if does not define. */ +/* #undef off_t */ + +/* Define to "int" if does not define. */ +/* #undef socklen_t */ Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamav.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamav.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamav.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamav.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,206 @@ +/* + * Copyright (C) 2002 - 2007 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __CLAMAV_H +#define __CLAMAV_H + +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define CL_COUNT_PRECISION 4096 + +/* return codes */ +#define CL_CLEAN 0 /* no virus found */ +#define CL_VIRUS 1 /* virus(es) found */ +#define CL_SUCCESS CL_CLEAN +#define CL_BREAK 2 + +#define CL_EMAXREC -100 /* recursion limit exceeded */ +#define CL_EMAXSIZE -101 /* size limit exceeded */ +#define CL_EMAXFILES -102 /* files limit exceeded */ +#define CL_ERAR -103 /* rar handler error */ +#define CL_EZIP -104 /* zip handler error */ +#define CL_EGZIP -105 /* gzip handler error */ +#define CL_EBZIP -106 /* bzip2 handler error */ +#define CL_EOLE2 -107 /* OLE2 handler error */ +#define CL_EMSCOMP -108 /* MS Expand handler error */ +#define CL_EMSCAB -109 /* MS CAB module error */ +#define CL_EACCES -110 /* access denied */ +#define CL_ENULLARG -111 /* null argument */ +#define CL_ETMPFILE -112 /* tmpfile() failed */ +#define CL_EFSYNC -113 /* fsync() failed */ +#define CL_EMEM -114 /* memory allocation error */ +#define CL_EOPEN -115 /* file open error */ +#define CL_EMALFDB -116 /* malformed database */ +#define CL_EPATSHORT -117 /* pattern too short */ +#define CL_ETMPDIR -118 /* mkdir() failed */ +#define CL_ECVD -119 /* not a CVD file (or broken) */ +#define CL_ECVDEXTR -120 /* CVD extraction failure */ +#define CL_EMD5 -121 /* MD5 verification error */ +#define CL_EDSIG -122 /* digital signature verification error */ +#define CL_EIO -123 /* general I/O error */ +#define CL_EFORMAT -124 /* bad format or broken file */ +#define CL_ESUPPORT -125 /* not supported data format */ +#define CL_ELOCKDB -126 /* can't lock DB directory */ +#define CL_EARJ -127 /* ARJ handler error */ + +/* db options */ +#define CL_DB_PHISHING 0x2 +#define CL_DB_ACONLY 0x4 /* WARNING: only for developers */ +#define CL_DB_PHISHING_URLS 0x8 +#define CL_DB_PUA 0x10 + +/* recommended db settings */ +#define CL_DB_STDOPT (CL_DB_PHISHING | CL_DB_PHISHING_URLS) + +/* scan options */ +#define CL_SCAN_RAW 0x0 +#define CL_SCAN_ARCHIVE 0x1 +#define CL_SCAN_MAIL 0x2 +#define CL_SCAN_OLE2 0x4 +#define CL_SCAN_BLOCKENCRYPTED 0x8 +#define CL_SCAN_HTML 0x10 +#define CL_SCAN_PE 0x20 +#define CL_SCAN_BLOCKBROKEN 0x40 +#define CL_SCAN_MAILURL 0x80 +#define CL_SCAN_BLOCKMAX 0x100 +#define CL_SCAN_ALGORITHMIC 0x200 +#define CL_SCAN_PHISHING_DOMAINLIST 0x400 +#define CL_SCAN_PHISHING_BLOCKSSL 0x800 /* ssl mismatches, not ssl by itself*/ +#define CL_SCAN_PHISHING_BLOCKCLOAK 0x1000 +#define CL_SCAN_ELF 0x2000 +#define CL_SCAN_PDF 0x4000 + +/* recommended scan settings */ +#define CL_SCAN_STDOPT (CL_SCAN_ARCHIVE | CL_SCAN_MAIL | CL_SCAN_OLE2 | CL_SCAN_HTML | CL_SCAN_PE | CL_SCAN_ALGORITHMIC | CL_SCAN_ELF | CL_SCAN_PHISHING_DOMAINLIST) + +/* aliases for backward compatibility */ +#define CL_RAW CL_SCAN_RAW +#define CL_ARCHIVE CL_SCAN_ARCHIVE +#define CL_MAIL CL_SCAN_MAIL +#define CL_OLE2 CL_SCAN_OLE2 +#define CL_ENCRYPTED CL_SCAN_BLOCKENCRYPTED +#define cl_node cl_engine +#define cl_perror cl_strerror + +struct cl_engine { + unsigned int refcount; /* reference counter */ + unsigned short sdb; + unsigned int dboptions; + + /* Roots table */ + void **root; + + /* MD5 */ + void **md5_hlist; + + /* B-M matcher for MD5 sigs for PE sections */ + void *md5_sect; + + /* Zip metadata */ + void *zip_mlist; + + /* RAR metadata */ + void *rar_mlist; + + /* Phishing .pdb and .wdb databases*/ + void *whitelist_matcher; + void *domainlist_matcher; + void *phishcheck; + + /* Dynamic configuration */ + void *dconf; +}; + +struct cl_limits { + unsigned int maxreclevel; /* maximum recursion level for archives */ + unsigned int maxfiles; /* maximum number of files to be scanned + * within a single archive + */ + unsigned int maxmailrec; /* maximum recursion level for mail files */ + unsigned int maxratio; /* maximum compression ratio */ + unsigned short archivememlim; /* limit memory usage for some unpackers */ + unsigned long int maxfilesize; /* compressed files larger than this limit + * will not be scanned + */ +}; + +struct cl_stat { + char *dir; + unsigned int entries; + struct stat *stattab; + char **statdname; +}; + +struct cl_cvd { /* field no. */ + char *time; /* 2 */ + unsigned int version; /* 3 */ + unsigned int sigs; /* 4 */ + unsigned int fl; /* 5 */ + char *md5; /* 6 */ + char *dsig; /* 7 */ + char *builder; /* 8 */ + unsigned int stime; /* 9 */ +}; + +/* file scanning */ +extern int cl_scandesc(int desc, const char **virname, unsigned long int *scanned, const struct cl_engine *engine, const struct cl_limits *limits, unsigned int options); + +extern int cl_scanfile(const char *filename, const char **virname, unsigned long int *scanned, const struct cl_engine *engine, const struct cl_limits *limits, unsigned int options); + +/* database handling */ +extern int cl_load(const char *path, struct cl_engine **engine, unsigned int *signo, unsigned int options); +extern const char *cl_retdbdir(void); + +/* engine handling */ +extern int cl_build(struct cl_engine *engine); +extern struct cl_engine *cl_dup(struct cl_engine *engine); +extern void cl_free(struct cl_engine *engine); + +/* CVD */ +extern struct cl_cvd *cl_cvdhead(const char *file); +extern struct cl_cvd *cl_cvdparse(const char *head); +extern int cl_cvdverify(const char *file); +extern void cl_cvdfree(struct cl_cvd *cvd); + +/* db dir stat functions */ +extern int cl_statinidir(const char *dirname, struct cl_stat *dbstat); +extern int cl_statchkdir(const struct cl_stat *dbstat); +extern int cl_statfree(struct cl_stat *dbstat); + +/* enable debug messages */ +extern void cl_debug(void); + +/* software versions */ +extern unsigned int cl_retflevel(void); +extern const char *cl_retver(void); + +/* others */ +extern void cl_settempdir(const char *dir, short leavetemps); +extern const char *cl_strerror(int clerror); + +#ifdef __cplusplus +} +#endif + +#endif /* __CLAMAV_H */ Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.c?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.c (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.c Wed Jan 30 15:17:10 2008 @@ -0,0 +1,331 @@ +/* + * Copyright (C) 2002 - 2006 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef C_WINDOWS +#include +#else +#include +#endif +#include +#ifdef C_LINUX +#include +#endif + +#include "clamscan_opt.h" +#include "clamscan_others.h" +#include "global.h" +#include "manager.h" +#include "treewalk.h" + +#include "misc.h" +#include "output.h" +#include "options.h" + +void help(void); + +#if defined(C_WINDOWS) && defined(CL_DEBUG) +#include +#endif + +struct s_info info; +short recursion = 0, printinfected = 0, bell = 0; + +int main(int argc, char **argv) +{ + int ds, dms, ret; + double mb; + struct timeval t1, t2; +#ifndef C_WINDOWS + struct timezone tz; +#endif + struct optstruct *opt; + const char *pt; + +#if defined(C_WINDOWS) && defined(CL_THREAD_SAFE) + if(!pthread_win32_process_attach_np()) { + mprintf("!Can't start the win32 pthreads layer\n"); + return 72; + } +#endif + + opt = opt_parse(argc, argv, clamscan_shortopt, clamscan_longopt, NULL); + if(!opt) { + mprintf("!Can't parse the command line\n"); + return 40; + } + + if(opt_check(opt, "verbose")) { + mprintf_verbose = 1; + logg_verbose = 1; + } + + if(opt_check(opt, "quiet")) + mprintf_quiet = 1; + + if(opt_check(opt, "stdout")) + mprintf_stdout = 1; + + + if(opt_check(opt, "debug")) { +#if defined(C_LINUX) + /* njh at bandsman.co.uk: create a dump if needed */ + struct rlimit rlim; + + rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY; + if(setrlimit(RLIMIT_CORE, &rlim) < 0) + perror("setrlimit"); +#endif + cl_debug(); /* enable debug messages */ + } + + if(opt_check(opt, "version")) { + opt_free(opt); + print_version(); + return 0; + } + + if(opt_check(opt, "help")) { + opt_free(opt); + help(); + return 0; + } + + if(opt_check(opt, "recursive")) + recursion = 1; + + if(opt_check(opt, "infected")) + printinfected = 1; + + if(opt_check(opt, "bell")) + bell = 1; + + if(opt_check(opt, "tempdir")) + cl_settempdir(opt_arg(opt, "tempdir"), 0); + + if(opt_check(opt, "leave-temps")) + cl_settempdir(NULL, 1); + + /* initialize logger */ + if(opt_check(opt, "log")) { + logg_file = opt_arg(opt, "log"); + if(logg("#\n-------------------------------------------------------------------------------\n\n")) { + mprintf("!Problem with internal logger.\n"); + opt_free(opt); + return 62; + } + } else + logg_file = NULL; + + + /* validate some numerical options */ + + if(opt_check(opt, "max-space")) { + pt = opt_arg(opt, "max-space"); + if(!strchr(pt, 'M') && !strchr(pt, 'm')) { + if(!isnumb(pt)) { + logg("!--max-space requires a natural number\n"); + opt_free(opt); + return 40; + } + } + } + + if(opt_check(opt, "max-files")) { + if(!isnumb(opt_arg(opt, "max-files"))) { + logg("!--max-files requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-recursion")) { + if(!isnumb(opt_arg(opt, "max-recursion"))) { + logg("!--max-recursion requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-mail-recursion")) { + if(!isnumb(opt_arg(opt, "max-mail-recursion"))) { + logg("!--max-mail-recursion requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-dir-recursion")) { + if(!isnumb(opt_arg(opt, "max-dir-recursion"))) { + logg("!--max-dir-recursion requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-ratio")) { + if(!isnumb(opt_arg(opt, "max-ratio"))) { + logg("!--max-ratio requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + memset(&info, 0, sizeof(struct s_info)); + +#ifdef C_WINDOWS + _set_fmode(_O_BINARY); +#ifdef CL_DEBUG + { + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + } +#endif + gettimeofday(&t1, NULL); +#else + gettimeofday(&t1, &tz); +#endif + + ret = scanmanager(opt); + + if(!opt_check(opt, "disable-summary") && !opt_check(opt, "no-summary")) { +#ifdef C_WINDOWS + gettimeofday(&t2, NULL); +#else + gettimeofday(&t2, &tz); +#endif + ds = t2.tv_sec - t1.tv_sec; + dms = t2.tv_usec - t1.tv_usec; + ds -= (dms < 0) ? (1):(0); + dms += (dms < 0) ? (1000000):(0); + logg("\n----------- SCAN SUMMARY -----------\n"); + logg("Known viruses: %u\n", info.sigs); + logg("Engine version: %s\n", cl_retver()); + logg("Scanned directories: %u\n", info.dirs); + logg("Scanned files: %u\n", info.files); + logg("Infected files: %u\n", info.ifiles); + if(info.notremoved) { + logg("Not removed: %u\n", info.notremoved); + } + if(info.notmoved) { + logg("Not %s: %u\n", opt_check(opt, "copy") ? "moved" : "copied", info.notmoved); + } + mb = info.blocks * (CL_COUNT_PRECISION / 1024) / 1024.0; + logg("Data scanned: %2.2lf MB\n", mb); + logg("Time: %u.%3.3u sec (%u m %u s)\n", ds, dms/1000, ds/60, ds%60); + } + + opt_free(opt); + +#if defined(C_WINDOWS) && defined(CL_THREAD_SAFE) + if(!pthread_win32_process_detach_np()) { + logg("!Can't stop the win32 pthreads layer\n"); + return 72; + } +#endif + + return ret; +} + +void help(void) +{ + + mprintf_stdout = 1; + + mprintf("\n"); + mprintf(" Clam AntiVirus Scanner "VERSION"\n"); + mprintf(" (C) 2002 - 2007 ClamAV Team - http://www.clamav.net/team\n\n"); + + mprintf(" --help -h Print this help screen\n"); + mprintf(" --version -V Print version number\n"); + mprintf(" --verbose -v Be verbose\n"); + mprintf(" --debug Enable libclamav's debug messages\n"); + mprintf(" --quiet Only output error messages\n"); + mprintf(" --stdout Write to stdout instead of stderr\n"); + mprintf(" --no-summary Disable summary at end of scanning\n"); + mprintf(" --infected -i Only print infected files\n"); + mprintf(" --bell Sound bell on virus detection\n"); + + mprintf("\n"); + mprintf(" --tempdir=DIRECTORY Create temporary files in DIRECTORY\n"); + mprintf(" --leave-temps Do not remove temporary files\n"); + mprintf(" --database=FILE/DIR -d FILE/DIR Load virus database from FILE or load\n"); + mprintf(" all .cvd and .db[2] files from DIR\n"); + mprintf(" --log=FILE -l FILE Save scan report to FILE\n"); + mprintf(" --recursive -r Scan subdirectories recursively\n"); + mprintf(" --remove Remove infected files. Be careful!\n"); + mprintf(" --move=DIRECTORY Move infected files into DIRECTORY\n"); + mprintf(" --copy=DIRECTORY Copy infected files into DIRECTORY\n"); +#ifdef HAVE_REGEX_H + mprintf(" --exclude=REGEX Don't scan file names matching REGEX\n"); + mprintf(" --exclude-dir=REGEX Don't scan directories matching REGEX\n"); + mprintf(" --include=REGEX Only scan file names matching REGEX\n"); + mprintf(" --include-dir=REGEX Only scan directories matching REGEX\n"); +#else + mprintf(" --exclude=PATT Don't scan file names containing PATT\n"); + mprintf(" --exclude-dir=PATT Don't scan directories containing PATT\n"); + mprintf(" --include=PATT Only scan file names containing PATT\n"); + mprintf(" --include-dir=PATT Only scan directories containing PATT\n"); +#endif + mprintf("\n"); + mprintf(" --detect-pua Detect Possibly Unwanted Applications\n"); + mprintf(" --no-mail Disable mail file support\n"); + mprintf(" --no-phishing-sigs Disable signature-based phishing detection\n"); + mprintf(" --no-phishing-scan-urls Disable url-based phishing detection\n"); + mprintf(" --no-phishing-restrictedscan Enable phishing detection for all domains (might lead to false positives!)\n"); + mprintf(" --phishing-ssl Always block SSL mismatches in URLs (phishing module)\n"); + mprintf(" --phishing-cloak Always block cloaked URLs (phishing module)\n"); + mprintf(" --no-algorithmic Disable algorithmic detection\n"); + mprintf(" --no-pe Disable PE analysis\n"); + mprintf(" --no-elf Disable ELF support\n"); + mprintf(" --no-ole2 Disable OLE2 support\n"); + mprintf(" --no-pdf Disable PDF support\n"); + mprintf(" --no-html Disable HTML support\n"); + mprintf(" --no-archive Disable libclamav archive support\n"); + mprintf(" --detect-broken Try to detect broken executable files\n"); + mprintf(" --block-encrypted Block encrypted archives\n"); + mprintf(" --block-max Block archives that exceed limits\n"); + mprintf(" --mail-follow-urls Download and scan URLs\n"); + mprintf("\n"); + mprintf(" --max-space=#n Only extract first #n kilobytes from\n"); + mprintf(" archived files\n"); + mprintf(" --max-files=#n Only extract first #n files from\n"); + mprintf(" archives\n"); + mprintf(" --max-ratio=#n Maximum compression ratio limit\n"); + mprintf(" --max-recursion=#n Maximum archive recursion level\n"); + mprintf(" --max-dir-recursion=#n Maximum directory recursion level\n"); + mprintf(" --max-mail-recursion=#n Maximum mail recursion level\n"); + mprintf(" --unzip[=FULLPATH] Enable support for .zip files\n"); + mprintf(" --unrar[=FULLPATH] Enable support for .rar files\n"); + mprintf(" --arj[=FULLPATH] Enable support for .arj files\n"); + mprintf(" --unzoo[=FULLPATH] Enable support for .zoo files\n"); + mprintf(" --lha[=FULLPATH] Enable support for .lha files\n"); + mprintf(" --jar[=FULLPATH] Enable support for .jar files\n"); + mprintf(" --tar[=FULLPATH] Enable support for .tar files\n"); + mprintf(" --deb[=FULLPATH to ar] Enable support for .deb files\n"); + mprintf(" --tgz[=FULLPATH] Enable support for .tar.gz, .tgz files\n\n"); +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.ce URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.ce?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.ce (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_clamscan.ce Wed Jan 30 15:17:10 2008 @@ -0,0 +1,331 @@ +/* + * Copyright (C) 2002 - 2006 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef C_WINDOWS +#include +#else +#include +#endif +#include +#ifdef C_LINUX +#include +#endif + +#include "clamscan_opt.h" +#include "others.h" +#include "global.h" +#include "manager.h" +#include "treewalk.h" + +#include "shared/misc.h" +#include "shared/output.h" +#include "shared/options.h" + +void help(void); + +#if defined(C_WINDOWS) && defined(CL_DEBUG) +#include +#endif + +struct s_info info; +short recursion = 0, printinfected = 0, bell = 0; + +int main(int argc, char **argv) +{ + int ds, dms, ret; + double mb; + struct timeval t1, t2; +#ifndef C_WINDOWS + struct timezone tz; +#endif + struct optstruct *opt; + const char *pt; + +#if defined(C_WINDOWS) && defined(CL_THREAD_SAFE) + if(!pthread_win32_process_attach_np()) { + mprintf("!Can't start the win32 pthreads layer\n"); + return 72; + } +#endif + + opt = opt_parse(argc, argv, clamscan_shortopt, clamscan_longopt, NULL); + if(!opt) { + mprintf("!Can't parse the command line\n"); + return 40; + } + + if(opt_check(opt, "verbose")) { + mprintf_verbose = 1; + logg_verbose = 1; + } + + if(opt_check(opt, "quiet")) + mprintf_quiet = 1; + + if(opt_check(opt, "stdout")) + mprintf_stdout = 1; + + + if(opt_check(opt, "debug")) { +#if defined(C_LINUX) + /* njh at bandsman.co.uk: create a dump if needed */ + struct rlimit rlim; + + rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY; + if(setrlimit(RLIMIT_CORE, &rlim) < 0) + perror("setrlimit"); +#endif + cl_debug(); /* enable debug messages */ + } + + if(opt_check(opt, "version")) { + opt_free(opt); + print_version(); + return 0; + } + + if(opt_check(opt, "help")) { + opt_free(opt); + help(); + return 0; + } + + if(opt_check(opt, "recursive")) + recursion = 1; + + if(opt_check(opt, "infected")) + printinfected = 1; + + if(opt_check(opt, "bell")) + bell = 1; + + if(opt_check(opt, "tempdir")) + cl_settempdir(opt_arg(opt, "tempdir"), 0); + + if(opt_check(opt, "leave-temps")) + cl_settempdir(NULL, 1); + + /* initialize logger */ + if(opt_check(opt, "log")) { + logg_file = opt_arg(opt, "log"); + if(logg("#\n-------------------------------------------------------------------------------\n\n")) { + mprintf("!Problem with internal logger.\n"); + opt_free(opt); + return 62; + } + } else + logg_file = NULL; + + + /* validate some numerical options */ + + if(opt_check(opt, "max-space")) { + pt = opt_arg(opt, "max-space"); + if(!strchr(pt, 'M') && !strchr(pt, 'm')) { + if(!isnumb(pt)) { + logg("!--max-space requires a natural number\n"); + opt_free(opt); + return 40; + } + } + } + + if(opt_check(opt, "max-files")) { + if(!isnumb(opt_arg(opt, "max-files"))) { + logg("!--max-files requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-recursion")) { + if(!isnumb(opt_arg(opt, "max-recursion"))) { + logg("!--max-recursion requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-mail-recursion")) { + if(!isnumb(opt_arg(opt, "max-mail-recursion"))) { + logg("!--max-mail-recursion requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-dir-recursion")) { + if(!isnumb(opt_arg(opt, "max-dir-recursion"))) { + logg("!--max-dir-recursion requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + if(opt_check(opt, "max-ratio")) { + if(!isnumb(opt_arg(opt, "max-ratio"))) { + logg("!--max-ratio requires a natural number\n"); + opt_free(opt); + return 40; + } + } + + memset(&info, 0, sizeof(struct s_info)); + +#ifdef C_WINDOWS + _set_fmode(_O_BINARY); +#ifdef CL_DEBUG + { + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + } +#endif + gettimeofday(&t1, NULL); +#else + gettimeofday(&t1, &tz); +#endif + + ret = scanmanager(opt); + + if(!opt_check(opt, "disable-summary") && !opt_check(opt, "no-summary")) { +#ifdef C_WINDOWS + gettimeofday(&t2, NULL); +#else + gettimeofday(&t2, &tz); +#endif + ds = t2.tv_sec - t1.tv_sec; + dms = t2.tv_usec - t1.tv_usec; + ds -= (dms < 0) ? (1):(0); + dms += (dms < 0) ? (1000000):(0); + logg("\n----------- SCAN SUMMARY -----------\n"); + logg("Known viruses: %u\n", info.sigs); + logg("Engine version: %s\n", cl_retver()); + logg("Scanned directories: %u\n", info.dirs); + logg("Scanned files: %u\n", info.files); + logg("Infected files: %u\n", info.ifiles); + if(info.notremoved) { + logg("Not removed: %u\n", info.notremoved); + } + if(info.notmoved) { + logg("Not %s: %u\n", opt_check(opt, "copy") ? "moved" : "copied", info.notmoved); + } + mb = info.blocks * (CL_COUNT_PRECISION / 1024) / 1024.0; + logg("Data scanned: %2.2lf MB\n", mb); + logg("Time: %u.%3.3u sec (%u m %u s)\n", ds, dms/1000, ds/60, ds%60); + } + + opt_free(opt); + +#if defined(C_WINDOWS) && defined(CL_THREAD_SAFE) + if(!pthread_win32_process_detach_np()) { + logg("!Can't stop the win32 pthreads layer\n"); + return 72; + } +#endif + + return ret; +} + +void help(void) +{ + + mprintf_stdout = 1; + + mprintf("\n"); + mprintf(" Clam AntiVirus Scanner "VERSION"\n"); + mprintf(" (C) 2002 - 2007 ClamAV Team - http://www.clamav.net/team\n\n"); + + mprintf(" --help -h Print this help screen\n"); + mprintf(" --version -V Print version number\n"); + mprintf(" --verbose -v Be verbose\n"); + mprintf(" --debug Enable libclamav's debug messages\n"); + mprintf(" --quiet Only output error messages\n"); + mprintf(" --stdout Write to stdout instead of stderr\n"); + mprintf(" --no-summary Disable summary at end of scanning\n"); + mprintf(" --infected -i Only print infected files\n"); + mprintf(" --bell Sound bell on virus detection\n"); + + mprintf("\n"); + mprintf(" --tempdir=DIRECTORY Create temporary files in DIRECTORY\n"); + mprintf(" --leave-temps Do not remove temporary files\n"); + mprintf(" --database=FILE/DIR -d FILE/DIR Load virus database from FILE or load\n"); + mprintf(" all .cvd and .db[2] files from DIR\n"); + mprintf(" --log=FILE -l FILE Save scan report to FILE\n"); + mprintf(" --recursive -r Scan subdirectories recursively\n"); + mprintf(" --remove Remove infected files. Be careful!\n"); + mprintf(" --move=DIRECTORY Move infected files into DIRECTORY\n"); + mprintf(" --copy=DIRECTORY Copy infected files into DIRECTORY\n"); +#ifdef HAVE_REGEX_H + mprintf(" --exclude=REGEX Don't scan file names matching REGEX\n"); + mprintf(" --exclude-dir=REGEX Don't scan directories matching REGEX\n"); + mprintf(" --include=REGEX Only scan file names matching REGEX\n"); + mprintf(" --include-dir=REGEX Only scan directories matching REGEX\n"); +#else + mprintf(" --exclude=PATT Don't scan file names containing PATT\n"); + mprintf(" --exclude-dir=PATT Don't scan directories containing PATT\n"); + mprintf(" --include=PATT Only scan file names containing PATT\n"); + mprintf(" --include-dir=PATT Only scan directories containing PATT\n"); +#endif + mprintf("\n"); + mprintf(" --detect-pua Detect Possibly Unwanted Applications\n"); + mprintf(" --no-mail Disable mail file support\n"); + mprintf(" --no-phishing-sigs Disable signature-based phishing detection\n"); + mprintf(" --no-phishing-scan-urls Disable url-based phishing detection\n"); + mprintf(" --no-phishing-restrictedscan Enable phishing detection for all domains (might lead to false positives!)\n"); + mprintf(" --phishing-ssl Always block SSL mismatches in URLs (phishing module)\n"); + mprintf(" --phishing-cloak Always block cloaked URLs (phishing module)\n"); + mprintf(" --no-algorithmic Disable algorithmic detection\n"); + mprintf(" --no-pe Disable PE analysis\n"); + mprintf(" --no-elf Disable ELF support\n"); + mprintf(" --no-ole2 Disable OLE2 support\n"); + mprintf(" --no-pdf Disable PDF support\n"); + mprintf(" --no-html Disable HTML support\n"); + mprintf(" --no-archive Disable libclamav archive support\n"); + mprintf(" --detect-broken Try to detect broken executable files\n"); + mprintf(" --block-encrypted Block encrypted archives\n"); + mprintf(" --block-max Block archives that exceed limits\n"); + mprintf(" --mail-follow-urls Download and scan URLs\n"); + mprintf("\n"); + mprintf(" --max-space=#n Only extract first #n kilobytes from\n"); + mprintf(" archived files\n"); + mprintf(" --max-files=#n Only extract first #n files from\n"); + mprintf(" archives\n"); + mprintf(" --max-ratio=#n Maximum compression ratio limit\n"); + mprintf(" --max-recursion=#n Maximum archive recursion level\n"); + mprintf(" --max-dir-recursion=#n Maximum directory recursion level\n"); + mprintf(" --max-mail-recursion=#n Maximum mail recursion level\n"); + mprintf(" --unzip[=FULLPATH] Enable support for .zip files\n"); + mprintf(" --unrar[=FULLPATH] Enable support for .rar files\n"); + mprintf(" --arj[=FULLPATH] Enable support for .arj files\n"); + mprintf(" --unzoo[=FULLPATH] Enable support for .zoo files\n"); + mprintf(" --lha[=FULLPATH] Enable support for .lha files\n"); + mprintf(" --jar[=FULLPATH] Enable support for .jar files\n"); + mprintf(" --tar[=FULLPATH] Enable support for .tar files\n"); + mprintf(" --deb[=FULLPATH to ar] Enable support for .deb files\n"); + mprintf(" --tgz[=FULLPATH] Enable support for .tar.gz, .tgz files\n\n"); +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.c Wed Jan 30 15:17:10 2008 @@ -0,0 +1,1105 @@ +/* + * Copyright (C) 2002 - 2007 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + * Wed Mar 5 03:45:31 CET 2003: included --move code from Damien Curtain + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#include +#include +#include +#ifdef C_WINDOWS +#include +#else +#include +#include +#endif +#ifdef HAVE_GRP_H +#include +#endif +#ifdef HAVE_PWD_H +#include +#endif +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include + +#include "manager.h" +#include "clamscan_others.h" +#include "treewalk.h" +#include "global.h" + +#include "options.h" +#include "output.h" +#include "misc.h" + +#include "clamav.h" +#include "others.h" +#include "matcher-ac.h" +#include "str.h" + +#ifdef C_LINUX +dev_t procdev; +#endif + +#ifdef C_WINDOWS +#undef P_tmpdir +#define P_tmpdir "C:\\WINDOWS\\TEMP" +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static int scandirs(const char *dirname, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options) +{ + return treewalk(dirname, engine, user, opt, limits, options, 1); +} + +static int scanstdin(const struct cl_engine *engine, const struct cl_limits *limits, int options) +{ + int ret; + const char *virname, *tmpdir; + char *file, buff[FILEBUFF]; + FILE *fs; + + + /* check write access */ + tmpdir = getenv("TMPDIR"); + + if(tmpdir == NULL) +#ifdef P_tmpdir + tmpdir = P_tmpdir; +#else + tmpdir = "/tmp"; +#endif + + if(checkaccess(tmpdir, CLAMAVUSER, W_OK) != 1) { + logg("!Can't write to temporary directory\n"); + return 64; + } + + file = cli_gentemp(tmpdir); + + if(!(fs = fopen(file, "wb"))) { + logg("!Can't open %s for writing\n", file); + free(file); + return 63; + } + + while((ret = fread(buff, 1, FILEBUFF, stdin))) + if(fwrite(buff, 1, ret, fs) < ret) { + logg("!Can't write to %s\n", file); + free(file); + return 58; + } + + fclose(fs); + + logg("*Checking %s\n", file); + info.files++; + + if((ret = cl_scanfile(file, &virname, &info.blocks, engine, limits, options)) == CL_VIRUS) { + logg("stdin: %s FOUND\n", virname); + info.ifiles++; + + if(bell) + fprintf(stderr, "\007"); + + } else if(ret == CL_CLEAN) { + if(!printinfected) + mprintf("stdin: OK\n"); + } else + if(!printinfected) + logg("stdin: %s\n", cl_strerror(ret)); + + unlink(file); + free(file); + return ret; +} + +int scanmanager(const struct optstruct *opt) +{ + mode_t fmode; + int ret = 0, extunpacker = 0, fmodeint, i, x; + unsigned int options = 0, dboptions = 0; + struct cl_engine *engine = NULL; + struct cl_limits limits; + struct passwd *user = NULL; + struct stat sb; + char *fullpath = NULL, cwd[1024]; + + + if(opt_check(opt, "unzip") || opt_check(opt, "unrar") || opt_check(opt, "arj") || + opt_check(opt, "unzoo") || opt_check(opt, "jar") || opt_check(opt, "lha") || + opt_check(opt, "tar") || opt_check(opt, "tgz") || opt_check(opt, "deb")) + extunpacker = 1; + +/* njh at bandsman.co.uk: BeOS */ +#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_BEOS) && !defined(C_WINDOWS) + if(extunpacker && !geteuid()) { + if((user = getpwnam(CLAMAVUSER)) == NULL) { + logg("!Can't get information about user "CLAMAVUSER" (required to run external unpackers)\n"); + exit(60); /* this is critical problem, so we just exit here */ + } + } +#endif + + if(!opt_check(opt, "no-phishing-sigs")) + dboptions |= CL_DB_PHISHING; + + if(!opt_check(opt,"no-phishing-scan-urls")) + dboptions |= CL_DB_PHISHING_URLS; + if(!opt_check(opt,"no-phishing-restrictedscan")) { + /* not scanning all domains, check only URLs with domains from .pdb */ + options |= CL_SCAN_PHISHING_DOMAINLIST; + } + if(opt_check(opt,"phishing-ssl")) { + options |= CL_SCAN_PHISHING_BLOCKSSL; + } + if(opt_check(opt,"phishing-cloak")) { + options |= CL_SCAN_PHISHING_BLOCKCLOAK; + } + + if(opt_check(opt, "dev-ac-only")) + dboptions |= CL_DB_ACONLY; + + if(opt_check(opt, "dev-ac-depth")) + cli_ac_setdepth(AC_DEFAULT_MIN_DEPTH, atoi(opt_arg(opt, "dev-ac-depth"))); + + if(opt_check(opt, "detect-pua")) + dboptions |= CL_DB_PUA; + + if(opt_check(opt, "database")) { + if((ret = cl_load(opt_arg(opt, "database"), &engine, &info.sigs, dboptions))) { + logg("!%s\n", cl_strerror(ret)); + return 50; + } + + } else { + char *dbdir = freshdbdir(); + + if((ret = cl_load(dbdir, &engine, &info.sigs, dboptions))) { + logg("!%s\n", cl_strerror(ret)); + free(dbdir); + return 50; + } + free(dbdir); + } + + if(!engine) { + logg("!Can't initialize the virus database\n"); + return 50; + } + + if((ret = cl_build(engine)) != 0) { + logg("!Database initialization error: %s\n", cl_strerror(ret));; + return 50; + } + + /* set limits */ + memset(&limits, 0, sizeof(struct cl_limits)); + + if(opt_check(opt, "max-space")) { + char *cpy, *ptr; + ptr = opt_arg(opt, "max-space"); + if(tolower(ptr[strlen(ptr) - 1]) == 'm') { + cpy = calloc(strlen(ptr), 1); + strncpy(cpy, ptr, strlen(ptr) - 1); + limits.maxfilesize = atoi(cpy) * 1024 * 1024; + free(cpy); + } else + limits.maxfilesize = atoi(ptr) * 1024; + } else + limits.maxfilesize = 10485760; + + if(opt_check(opt, "max-files")) + limits.maxfiles = atoi(opt_arg(opt, "max-files")); + else + limits.maxfiles = 500; + + if(opt_check(opt, "max-recursion")) + limits.maxreclevel = atoi(opt_arg(opt, "max-recursion")); + else + limits.maxreclevel = 8; + + if(opt_check(opt, "max-mail-recursion")) + limits.maxmailrec = atoi(opt_arg(opt, "max-mail-recursion")); + else + limits.maxmailrec = 64; + + if(opt_check(opt, "max-ratio")) + limits.maxratio = atoi(opt_arg(opt, "max-ratio")); + else + limits.maxratio = 250; + + /* set options */ + + if(opt_check(opt, "disable-archive") || opt_check(opt, "no-archive")) + options &= ~CL_SCAN_ARCHIVE; + else + options |= CL_SCAN_ARCHIVE; + + if(opt_check(opt, "detect-broken")) + options |= CL_SCAN_BLOCKBROKEN; + + if(opt_check(opt, "block-encrypted")) + options |= CL_SCAN_BLOCKENCRYPTED; + + if(opt_check(opt, "block-max")) + options |= CL_SCAN_BLOCKMAX; + + if(opt_check(opt, "no-pe")) + options &= ~CL_SCAN_PE; + else + options |= CL_SCAN_PE; + + if(opt_check(opt, "no-elf")) + options &= ~CL_SCAN_ELF; + else + options |= CL_SCAN_ELF; + + if(opt_check(opt, "no-ole2")) + options &= ~CL_SCAN_OLE2; + else + options |= CL_SCAN_OLE2; + + if(opt_check(opt, "no-pdf")) + options &= ~CL_SCAN_PDF; + else + options |= CL_SCAN_PDF; + + if(opt_check(opt, "no-html")) + options &= ~CL_SCAN_HTML; + else + options |= CL_SCAN_HTML; + + if(opt_check(opt, "no-mail")) { + options &= ~CL_SCAN_MAIL; + } else { + options |= CL_SCAN_MAIL; + + if(opt_check(opt, "mail-follow-urls")) + options |= CL_SCAN_MAILURL; + } + + if(opt_check(opt, "no-algorithmic")) + options &= ~CL_SCAN_ALGORITHMIC; + else + options |= CL_SCAN_ALGORITHMIC; + +#ifdef C_LINUX + procdev = (dev_t) 0; + if(stat("/proc", &sb) != -1 && !sb.st_size) + procdev = sb.st_dev; +#endif + + /* check filetype */ + if(opt->filename == NULL || strlen(opt->filename) == 0) { + + /* we need full path for some reasons (eg. archive handling) */ + if(!getcwd(cwd, sizeof(cwd))) { + logg("!Can't get absolute pathname of current working directory\n"); + ret = 57; + } else + ret = scandirs(cwd, engine, user, opt, &limits, options); + + } else if(!strcmp(opt->filename, "-")) { /* read data from stdin */ + ret = scanstdin(engine, &limits, options); + + } else { + char *thefilename; + for (x = 0; (thefilename = cli_strtok(opt->filename, x, "\t")) != NULL; x++) { + if((fmodeint = fileinfo(thefilename, 2)) == -1) { + logg("^Can't access file %s\n", thefilename); + perror(thefilename); + ret = 56; + } else { + int slash = 1; + for(i = strlen(thefilename) - 1; i > 0 && slash; i--) { + if(thefilename[i] == '/') + thefilename[i] = 0; + else + slash = 0; + } + + fmode = (mode_t) fmodeint; + + if(extunpacker && (thefilename[0] != '/' && thefilename[0] != '\\' && thefilename[1] != ':')) { + /* we need to complete the path */ + if(!getcwd(cwd, sizeof(cwd))) { + logg("!Can't get absolute pathname of current working directory\n"); + return 57; + } else { + fullpath = malloc(512); +#ifdef NO_SNPRINTF + sprintf(fullpath, "%s/%s", cwd, thefilename); +#else + snprintf(fullpath, 512, "%s/%s", cwd, thefilename); +#endif + logg("*Full path: %s\n", fullpath); + } + } else + fullpath = thefilename; + + switch(fmode & S_IFMT) { + case S_IFREG: + ret = scanfile(fullpath, engine, user, opt, &limits, options); + break; + + case S_IFDIR: + ret = scandirs(fullpath, engine, user, opt, &limits, options); + break; + + default: + logg("!Not supported file type (%s)\n", thefilename); + ret = 52; + } + + if(extunpacker && (thefilename[0] != '/' && thefilename[0] != '\\' && thefilename[1] != ':')) { + free(fullpath); + fullpath = NULL; + } + } + free(thefilename); + } + } + + /* free the engine */ + cl_free(engine); + + /* overwrite return code */ + if(info.ifiles) + ret = 1; + else if(ret < 50) /* hopefully no error detected */ + ret = 0; /* just make sure it's 0 */ + + return ret; +} + +/* + * -1 -> can't fork + * -2 -> can't execute + * -3 -> external signal + * 0 -> OK + */ + +#ifdef C_WINDOWS +static int clamav_unpack(const char *prog, const char **args, const char *tmpdir, const struct passwd *user, const struct optstruct *opt) +{ + /* TODO: use spamvp(P_WAIT, prog, args); */ + cli_errmsg("clamav_unpack is not supported under Windows yet\n"); + return -1; +} +#else +static int clamav_unpack(const char *prog, const char **args, const char *tmpdir, const struct passwd *user, const struct optstruct *opt) +{ + pid_t pid; + int status, wret, fdevnull; + unsigned int maxfiles, maxspace; + struct s_du n; + + + if(opt_check(opt, "max-files")) + maxfiles = atoi(opt_arg(opt, "max-files")); + else + maxfiles = 0; + + if(opt_check(opt, "max-space")) { + char *cpy, *ptr; + ptr = opt_arg(opt, "max-space"); + if(tolower(ptr[strlen(ptr) - 1]) == 'm') { /* megabytes */ + cpy = calloc(strlen(ptr), 1); + strncpy(cpy, ptr, strlen(ptr) - 1); + maxspace = atoi(cpy) * 1024; + free(cpy); + } else /* default - kilobytes */ + maxspace = atoi(ptr); + } else + maxspace = 0; + + + switch(pid = fork()) { + case -1: + return -1; + case 0: +#ifndef C_CYGWIN + if(!geteuid() && user) { + +#ifdef HAVE_SETGROUPS + if(setgroups(1, &user->pw_gid)) { + fprintf(stderr, "ERROR: setgroups() failed\n"); + exit(1); + } +#endif + + if(setgid(user->pw_gid)) { + fprintf(stderr, "ERROR: setgid(%d) failed\n", (int) user->pw_gid); + exit(1); + } + + if(setuid(user->pw_uid)) { + fprintf(stderr, "ERROR: setuid(%d) failed\n", (int) user->pw_uid); + exit(1); + } + } +#endif + if(chdir(tmpdir) == -1) { + fprintf(stderr, "ERROR: chdir(%s) failed\n", tmpdir); + exit(1); + } + + if(printinfected) { + fdevnull = open("/dev/null", O_WRONLY); + if(fdevnull == -1) { + logg("Non fatal error: cannot open /dev/null. Continuing with full output\n"); + printinfected = 0; + } else { + dup2(fdevnull,1); + dup2(fdevnull,2); + } + } + + if(strchr(prog, '/')) /* we have full path */ + execv(prog, args); + else + execvp(prog, args); + perror("execv(p)"); + abort(); + break; + default: + + if(maxfiles || maxspace) { + while(!(wret = waitpid(pid, &status, WNOHANG))) { + memset(&n, 0, sizeof(struct s_du)); + + if(!du(tmpdir, &n)) + if((maxfiles && n.files > maxfiles) || (maxspace && n.space > maxspace)) { + logg("*n.files: %u, n.space: %lu\n", n.files, n.space); + kill(pid, 9); /* stop it immediately */ + } + } + } else + waitpid(pid, &status, 0); + + + if(WIFSIGNALED(status)) { + switch(WTERMSIG(status)) { + + case 9: + logg("\nUnpacker process %d stopped due to exceeded limits\n", pid); + return 0; + case 6: /* abort */ + logg("^Can't run %s\n", prog); + return -2; + default: + logg("^\nUnpacker stopped with external signal %d\n", WTERMSIG(status)); + return -3; + } + } else if(WIFEXITED(status)) + return 0; + } + + return 0; +} +#endif + +static void move_infected(const char *filename, const struct optstruct *opt) +{ + char *movedir, *movefilename, numext[4 + 1]; + const char *tmp; + struct stat ofstat, mfstat; + int n, len, movefilename_size; + int moveflag = opt_check(opt, "move"); + struct utimbuf ubuf; + + + if((moveflag && !(movedir = opt_arg(opt, "move"))) || + (!moveflag && !(movedir = opt_arg(opt, "copy")))) { + /* Should never reach here */ + logg("!opt_arg() returned NULL\n"); + info.notmoved++; + return; + } + + if(access(movedir, W_OK|X_OK) == -1) { + logg("!Can't %s file '%s': cannot write to '%s': %s\n", (moveflag) ? "move" : "copy", filename, movedir, strerror(errno)); + info.notmoved++; + return; + } + + if(!(tmp = strrchr(filename, '/'))) + tmp = filename; + + movefilename_size = sizeof(char) * (strlen(movedir) + strlen(tmp) + sizeof(numext) + 2); + + if(!(movefilename = malloc(movefilename_size))) { + logg("!malloc() failed\n"); + exit(71); + } + + if(!(cli_strrcpy(movefilename, movedir))) { + logg("!cli_strrcpy() returned NULL\n"); + info.notmoved++; + free(movefilename); + return; + } + + strcat(movefilename, "/"); + + if(!(strcat(movefilename, tmp))) { + logg("!strcat() returned NULL\n"); + info.notmoved++; + free(movefilename); + return; + } + + stat(filename, &ofstat); + + if(!stat(movefilename, &mfstat)) { + if((ofstat.st_dev == mfstat.st_dev) && (ofstat.st_ino == mfstat.st_ino)) { /* It's the same file*/ + logg("File excluded '%s'\n", filename); + info.notmoved++; + free(movefilename); + return; + } else { + /* file exists - try to append an ordinal number to the + * quranatined file in an attempt not to overwrite existing + * files in quarantine + */ + len = strlen(movefilename); + n = 0; + do { + /* reset the movefilename to it's initial value by + * truncating to the original filename length + */ + movefilename[len] = 0; + /* append .XXX */ + sprintf(numext, ".%03d", n++); + strcat(movefilename, numext); + } while(!stat(movefilename, &mfstat) && (n < 1000)); + } + } + + if(!moveflag || rename(filename, movefilename) == -1) { + if(filecopy(filename, movefilename) == -1) { + logg("!Can't %s '%s' to '%s': %s\n", (moveflag) ? "move" : "copy", filename, movefilename, strerror(errno)); + info.notmoved++; + free(movefilename); + return; + } + + chmod(movefilename, ofstat.st_mode); +#ifndef C_OS2 + chown(movefilename, ofstat.st_uid, ofstat.st_gid); +#endif + + ubuf.actime = ofstat.st_atime; + ubuf.modtime = ofstat.st_mtime; + utime(movefilename, &ubuf); + + if(moveflag && unlink(filename)) { + logg("!Can't unlink '%s': %s\n", filename, strerror(errno)); + info.notremoved++; + free(movefilename); + return; + } + } + + logg("%s: %s to '%s'\n", filename, (moveflag) ? "moved" : "copied", movefilename); + + free(movefilename); +} + +static int checkfile(const char *filename, const struct cl_engine *engine, const struct cl_limits *limits, int options, short printclean) +{ + int fd, ret; + const char *virname; + + + logg("*Scanning %s\n", filename); + + if((fd = open(filename, O_RDONLY|O_BINARY)) == -1) { + logg("^Can't open file %s\n", filename); + return 54; + } + + if((ret = cl_scandesc(fd, &virname, &info.blocks, engine, limits, options)) == CL_VIRUS) { + logg("%s: %s FOUND\n", filename, virname); + info.ifiles++; + + if(bell) + fprintf(stderr, "\007"); + + } else if(ret == CL_CLEAN) { + if(!printinfected && printclean) + mprintf("%s: OK\n", filename); + } else + if(!printinfected) + logg("%s: %s\n", filename, cl_strerror(ret)); + + close(fd); + return ret; +} + +static int scancompressed(const char *filename, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options) +{ + int ret = 0; + char *gendir, *userprg; + const char *tmpdir; + struct stat statbuf; + + + stat(filename, &statbuf); + + if(!S_ISREG(statbuf.st_mode)) { + logg("^Suspect archive %s (not a regular file)\n", filename); + return 0; /* hmm ? */ + } + + /* check write access */ + + tmpdir = getenv("TMPDIR"); + + if(tmpdir == NULL) +#ifdef P_tmpdir + tmpdir = P_tmpdir; +#else + tmpdir = "/tmp"; +#endif + + if(checkaccess(tmpdir, CLAMAVUSER, W_OK) != 1) { + logg("!Can't write to the temporary directory\n"); + exit(64); + } + + /* generate the temporary directory */ + + gendir = cli_gentemp(tmpdir); + if(mkdir(gendir, 0700)) { + logg("!Can't create the temporary directory %s\n", gendir); + exit(63); /* critical */ + } + +#if !defined(C_OS2) && !defined(C_WINDOWS) + /* FIXME: do the correct native windows way */ + if(user) + chown(gendir, user->pw_uid, user->pw_gid); +#endif + + /* unpack file - as unprivileged user */ + if(cli_strbcasestr(filename, ".zip")) { + const char *args[] = { "unzip", "-P", "clam", "-o", NULL, NULL }; + /* Sun's SUNWspro C compiler doesn't allow direct initialisation + * with a variable + */ + args[4] = filename; + + if((userprg = opt_arg(opt, "unzip"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unzip", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".rar")) { + const char *args[] = { "unrar", "x", "-p-", "-y", NULL, NULL }; + args[4] = filename; + if((userprg = opt_arg(opt, "unrar"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unrar", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".arj")) { + const char *args[] = { "arj", "x","-y", NULL, NULL }; + args[3] = filename; + if((userprg = opt_arg(opt, "arj"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("arj", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".zoo")) { + const char *args[] = { "unzoo", "-x","-j","./", NULL, NULL }; + args[4] = filename; + if((userprg = opt_arg(opt, "unzoo"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unzoo", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".jar")) { + const char *args[] = { "unzip", "-P", "clam", "-o", NULL, NULL }; + args[4] = filename; + if((userprg = opt_arg(opt, "jar"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unzip", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".lzh")) { + const char *args[] = { "lha", "xf", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "lha"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("lha", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".tar")) { + const char *args[] = { "tar", "-xpvf", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "tar"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("tar", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".deb")) { + const char *args[] = { "ar", "x", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "deb"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("ar", args, gendir, user, opt); + + } else if((cli_strbcasestr(filename, ".tar.gz") || cli_strbcasestr(filename, ".tgz"))) { + const char *args[] = { "tar", "-zxpvf", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "tgz"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("tar", args, gendir, user, opt); + } + + /* fix permissions of extracted files */ + fixperms(gendir); + + if(!ret) { /* execute successful */ + short oldrec = recursion; + + recursion = 1; + ret = treewalk(gendir, engine, user, opt, limits, options, 1); + recursion = oldrec; + } + + /* remove the directory - as clamav */ + if(!opt_check(opt, "leave-temps")) + clamav_rmdirs(gendir); + + /* free gendir - it's not necessary now */ + free(gendir); + + switch(ret) { + case -1: + logg("!Can't fork()\n"); + exit(61); /* this is critical problem, so we just exit here */ + case -2: + logg("^Can't execute some unpacker. Check paths and permissions on the temporary directory\n"); + /* This is no longer a critical error (since 0.24). We scan + * raw archive. + */ + if((ret = checkfile(filename, engine, limits, 0, 0)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + return ret; + case -3: + return 0; + case 0: + /* no viruses found in archive, we scan just in case a raw file + */ + if((ret = checkfile(filename, engine, limits, 0, 1)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + return ret; + case 1: + logg("%s: Infected.Archive FOUND\n", filename); + + if(bell) + fprintf(stderr, "\007"); + + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + + return 1; + default: + logg("^Strange value (%d) returned in scancompressed()\n", ret); + return 0; + } +} + +static int scandenied(const char *filename, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options) +{ + char *gendir, *tmp_file; + const char *tmpdir, *pt; + struct stat statbuf; + int ret; + + stat(filename, &statbuf); + if(!S_ISREG(statbuf.st_mode)) { + logg("^Suspect archive %s (not a regular file)\n", filename); + return 0; + } + + /* check write access */ + + tmpdir = getenv("TMPDIR"); + + if(tmpdir == NULL) +#ifdef P_tmpdir + tmpdir = P_tmpdir; +#else + tmpdir = "/tmp"; +#endif + + + if(checkaccess(tmpdir, CLAMAVUSER, W_OK) != 1) { + logg("!Can't write to the temporary directory %s\n", tmpdir); + exit(64); + } + + /* generate the temporary directory */ + gendir = cli_gentemp(tmpdir); + if(mkdir(gendir, 0700)) { + logg("^Can't create the temporary directory %s\n", gendir); + exit(63); /* critical */ + } + + tmp_file = (char *) malloc(strlen(gendir) + strlen(filename) + 10); + pt = strrchr(filename, '/'); + if(!pt) + pt = filename; + else + pt += 1; + + sprintf(tmp_file, "%s/%s", gendir, pt); + + if(filecopy(filename, tmp_file) == -1) { + logg("!I/O error\n"); + perror("copyfile()"); + exit(58); + } + + fixperms(gendir); + +#if !defined(C_OS2) && !defined(C_WINDOWS) + if(user) { + chown(gendir, user->pw_uid, user->pw_gid); + chown(tmp_file, user->pw_uid, user->pw_gid); + } +#endif + + if((ret = treewalk(gendir, engine, user, opt, limits, options, 1)) == 1) { + logg("(Real infected archive: %s)\n", filename); + + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + + /* remove the directory - as clamav */ + clamav_rmdirs(gendir); + + free(gendir); + free(tmp_file); + + return ret; +} + +int scanfile(const char *filename, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, unsigned int options) +{ + int ret, included, printclean = 1; + const struct optnode *optnode; + char *argument; +#ifdef C_LINUX + struct stat sb; + + /* argh, don't scan /proc files */ + if(procdev) + if(stat(filename, &sb) != -1) + if(sb.st_dev == procdev) { + if(!printinfected) + logg("%s: Excluded (/proc)\n", filename); + return 0; + } +#endif + + if(opt_check(opt, "exclude")) { + argument = opt_firstarg(opt, "exclude", &optnode); + while(argument) { + if(match_regex(filename, argument) == 1) { + if(!printinfected) + logg("%s: Excluded\n", filename); + return 0; + } + argument = opt_nextarg(&optnode, "exclude"); + } + } + + if(opt_check(opt, "include")) { + included = 0; + argument = opt_firstarg(opt, "include", &optnode); + while(argument && !included) { + if(match_regex(filename, argument) == 1) { + included = 1; + break; + } + argument = opt_nextarg(&optnode, "include"); + } + + if(!included) { + if(!printinfected) + logg("%s: Excluded\n", filename); + return 0; + } + } + + if(fileinfo(filename, 1) == 0) { + if(!printinfected) + logg("%s: Empty file\n", filename); + return 0; + } + +#ifndef C_WINDOWS + if(geteuid()) + if(checkaccess(filename, NULL, R_OK) != 1) { + if(!printinfected) + logg("%s: Access denied\n", filename); + return 0; + } +#endif + + info.files++; + + /* + * check the extension - this is a special case, normally we don't need to + * do this (libclamav detects archive by its magic string), but here we + * want to know the exit code from internal unpacker and try to use + * external (if provided) when internal cannot extract data. + */ + + if((cli_strbcasestr(filename, ".zip") || cli_strbcasestr(filename, ".rar")) && (options & CL_SCAN_ARCHIVE)) { + /* try to use internal archivers */ + if((ret = checkfile(filename, engine, limits, options, 1)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + + return 1; + + } else if(ret == CL_CLEAN) { + return 0; + } else if(ret == 54) { + return ret; + } + + /* in other case try to continue with external archivers */ + options &= ~CL_SCAN_ARCHIVE; /* and disable decompression for the checkfile() below */ + printclean = 0; + } + + if((cli_strbcasestr(filename, ".zip") && opt_check(opt, "unzip")) + || (cli_strbcasestr(filename, ".rar") && opt_check(opt, "unrar")) + || (cli_strbcasestr(filename, ".arj") && opt_check(opt, "arj")) + || (cli_strbcasestr(filename, ".zoo") && opt_check(opt, "unzoo")) + || (cli_strbcasestr(filename, ".jar") && opt_check(opt, "jar")) + || (cli_strbcasestr(filename, ".lzh") && opt_check(opt, "lha")) + || (cli_strbcasestr(filename, ".tar") && opt_check(opt, "tar")) + || (cli_strbcasestr(filename, ".deb") && opt_check(opt, "deb")) + || ((cli_strbcasestr(filename, ".tar.gz") || cli_strbcasestr(filename, ".tgz")) + && (opt_check(opt, "tgz") || opt_check(opt, "deb"))) ) { + + /* check permissions */ + switch(checkaccess(filename, CLAMAVUSER, R_OK)) { + case -1: + logg("^Can't get information about user "CLAMAVUSER"\n"); + exit(60); /* this is a critical problem so we just exit here */ + case -2: + logg("^Can't fork\n"); + exit(61); + case 0: /* read access denied */ + if(geteuid()) { + if(!printinfected) + logg("^%s: Access denied to archive\n", filename); + } else { + + if(limits && limits->maxfilesize) + if((unsigned int) fileinfo(filename, 1) / 1024 > limits->maxfilesize) { + if(!printinfected) + logg("^%s: Archive too big\n", filename); + return 0; + } + + return(scandenied(filename, engine, user, opt, limits, options)); + } + return 0; + case 1: + return(scancompressed(filename, engine, user, opt, limits, options)); + } + } + + if((ret = checkfile(filename, engine, limits, options, printclean)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + return ret; +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.ce URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.ce?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.ce (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_manager.ce Wed Jan 30 15:17:10 2008 @@ -0,0 +1,1105 @@ +/* + * Copyright (C) 2002 - 2007 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + * Wed Mar 5 03:45:31 CET 2003: included --move code from Damien Curtain + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#include +#include +#include +#ifdef C_WINDOWS +#include +#else +#include +#include +#endif +#ifdef HAVE_GRP_H +#include +#endif +#ifdef HAVE_PWD_H +#include +#endif +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#include + +#include "manager.h" +#include "others.h" +#include "treewalk.h" +#include "global.h" + +#include "shared/options.h" +#include "shared/output.h" +#include "shared/misc.h" + +#include "libclamav/clamav.h" +#include "libclamav/others.h" +#include "libclamav/matcher-ac.h" +#include "libclamav/str.h" + +#ifdef C_LINUX +dev_t procdev; +#endif + +#ifdef C_WINDOWS +#undef P_tmpdir +#define P_tmpdir "C:\\WINDOWS\\TEMP" +#endif + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +static int scandirs(const char *dirname, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options) +{ + return treewalk(dirname, engine, user, opt, limits, options, 1); +} + +static int scanstdin(const struct cl_engine *engine, const struct cl_limits *limits, int options) +{ + int ret; + const char *virname, *tmpdir; + char *file, buff[FILEBUFF]; + FILE *fs; + + + /* check write access */ + tmpdir = getenv("TMPDIR"); + + if(tmpdir == NULL) +#ifdef P_tmpdir + tmpdir = P_tmpdir; +#else + tmpdir = "/tmp"; +#endif + + if(checkaccess(tmpdir, CLAMAVUSER, W_OK) != 1) { + logg("!Can't write to temporary directory\n"); + return 64; + } + + file = cli_gentemp(tmpdir); + + if(!(fs = fopen(file, "wb"))) { + logg("!Can't open %s for writing\n", file); + free(file); + return 63; + } + + while((ret = fread(buff, 1, FILEBUFF, stdin))) + if(fwrite(buff, 1, ret, fs) < ret) { + logg("!Can't write to %s\n", file); + free(file); + return 58; + } + + fclose(fs); + + logg("*Checking %s\n", file); + info.files++; + + if((ret = cl_scanfile(file, &virname, &info.blocks, engine, limits, options)) == CL_VIRUS) { + logg("stdin: %s FOUND\n", virname); + info.ifiles++; + + if(bell) + fprintf(stderr, "\007"); + + } else if(ret == CL_CLEAN) { + if(!printinfected) + mprintf("stdin: OK\n"); + } else + if(!printinfected) + logg("stdin: %s\n", cl_strerror(ret)); + + unlink(file); + free(file); + return ret; +} + +int scanmanager(const struct optstruct *opt) +{ + mode_t fmode; + int ret = 0, extunpacker = 0, fmodeint, i, x; + unsigned int options = 0, dboptions = 0; + struct cl_engine *engine = NULL; + struct cl_limits limits; + struct passwd *user = NULL; + struct stat sb; + char *fullpath = NULL, cwd[1024]; + + + if(opt_check(opt, "unzip") || opt_check(opt, "unrar") || opt_check(opt, "arj") || + opt_check(opt, "unzoo") || opt_check(opt, "jar") || opt_check(opt, "lha") || + opt_check(opt, "tar") || opt_check(opt, "tgz") || opt_check(opt, "deb")) + extunpacker = 1; + +/* njh at bandsman.co.uk: BeOS */ +#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_BEOS) && !defined(C_WINDOWS) + if(extunpacker && !geteuid()) { + if((user = getpwnam(CLAMAVUSER)) == NULL) { + logg("!Can't get information about user "CLAMAVUSER" (required to run external unpackers)\n"); + exit(60); /* this is critical problem, so we just exit here */ + } + } +#endif + + if(!opt_check(opt, "no-phishing-sigs")) + dboptions |= CL_DB_PHISHING; + + if(!opt_check(opt,"no-phishing-scan-urls")) + dboptions |= CL_DB_PHISHING_URLS; + if(!opt_check(opt,"no-phishing-restrictedscan")) { + /* not scanning all domains, check only URLs with domains from .pdb */ + options |= CL_SCAN_PHISHING_DOMAINLIST; + } + if(opt_check(opt,"phishing-ssl")) { + options |= CL_SCAN_PHISHING_BLOCKSSL; + } + if(opt_check(opt,"phishing-cloak")) { + options |= CL_SCAN_PHISHING_BLOCKCLOAK; + } + + if(opt_check(opt, "dev-ac-only")) + dboptions |= CL_DB_ACONLY; + + if(opt_check(opt, "dev-ac-depth")) + cli_ac_setdepth(AC_DEFAULT_MIN_DEPTH, atoi(opt_arg(opt, "dev-ac-depth"))); + + if(opt_check(opt, "detect-pua")) + dboptions |= CL_DB_PUA; + + if(opt_check(opt, "database")) { + if((ret = cl_load(opt_arg(opt, "database"), &engine, &info.sigs, dboptions))) { + logg("!%s\n", cl_strerror(ret)); + return 50; + } + + } else { + char *dbdir = freshdbdir(); + + if((ret = cl_load(dbdir, &engine, &info.sigs, dboptions))) { + logg("!%s\n", cl_strerror(ret)); + free(dbdir); + return 50; + } + free(dbdir); + } + + if(!engine) { + logg("!Can't initialize the virus database\n"); + return 50; + } + + if((ret = cl_build(engine)) != 0) { + logg("!Database initialization error: %s\n", cl_strerror(ret));; + return 50; + } + + /* set limits */ + memset(&limits, 0, sizeof(struct cl_limits)); + + if(opt_check(opt, "max-space")) { + char *cpy, *ptr; + ptr = opt_arg(opt, "max-space"); + if(tolower(ptr[strlen(ptr) - 1]) == 'm') { + cpy = calloc(strlen(ptr), 1); + strncpy(cpy, ptr, strlen(ptr) - 1); + limits.maxfilesize = atoi(cpy) * 1024 * 1024; + free(cpy); + } else + limits.maxfilesize = atoi(ptr) * 1024; + } else + limits.maxfilesize = 10485760; + + if(opt_check(opt, "max-files")) + limits.maxfiles = atoi(opt_arg(opt, "max-files")); + else + limits.maxfiles = 500; + + if(opt_check(opt, "max-recursion")) + limits.maxreclevel = atoi(opt_arg(opt, "max-recursion")); + else + limits.maxreclevel = 8; + + if(opt_check(opt, "max-mail-recursion")) + limits.maxmailrec = atoi(opt_arg(opt, "max-mail-recursion")); + else + limits.maxmailrec = 64; + + if(opt_check(opt, "max-ratio")) + limits.maxratio = atoi(opt_arg(opt, "max-ratio")); + else + limits.maxratio = 250; + + /* set options */ + + if(opt_check(opt, "disable-archive") || opt_check(opt, "no-archive")) + options &= ~CL_SCAN_ARCHIVE; + else + options |= CL_SCAN_ARCHIVE; + + if(opt_check(opt, "detect-broken")) + options |= CL_SCAN_BLOCKBROKEN; + + if(opt_check(opt, "block-encrypted")) + options |= CL_SCAN_BLOCKENCRYPTED; + + if(opt_check(opt, "block-max")) + options |= CL_SCAN_BLOCKMAX; + + if(opt_check(opt, "no-pe")) + options &= ~CL_SCAN_PE; + else + options |= CL_SCAN_PE; + + if(opt_check(opt, "no-elf")) + options &= ~CL_SCAN_ELF; + else + options |= CL_SCAN_ELF; + + if(opt_check(opt, "no-ole2")) + options &= ~CL_SCAN_OLE2; + else + options |= CL_SCAN_OLE2; + + if(opt_check(opt, "no-pdf")) + options &= ~CL_SCAN_PDF; + else + options |= CL_SCAN_PDF; + + if(opt_check(opt, "no-html")) + options &= ~CL_SCAN_HTML; + else + options |= CL_SCAN_HTML; + + if(opt_check(opt, "no-mail")) { + options &= ~CL_SCAN_MAIL; + } else { + options |= CL_SCAN_MAIL; + + if(opt_check(opt, "mail-follow-urls")) + options |= CL_SCAN_MAILURL; + } + + if(opt_check(opt, "no-algorithmic")) + options &= ~CL_SCAN_ALGORITHMIC; + else + options |= CL_SCAN_ALGORITHMIC; + +#ifdef C_LINUX + procdev = (dev_t) 0; + if(stat("/proc", &sb) != -1 && !sb.st_size) + procdev = sb.st_dev; +#endif + + /* check filetype */ + if(opt->filename == NULL || strlen(opt->filename) == 0) { + + /* we need full path for some reasons (eg. archive handling) */ + if(!getcwd(cwd, sizeof(cwd))) { + logg("!Can't get absolute pathname of current working directory\n"); + ret = 57; + } else + ret = scandirs(cwd, engine, user, opt, &limits, options); + + } else if(!strcmp(opt->filename, "-")) { /* read data from stdin */ + ret = scanstdin(engine, &limits, options); + + } else { + char *thefilename; + for (x = 0; (thefilename = cli_strtok(opt->filename, x, "\t")) != NULL; x++) { + if((fmodeint = fileinfo(thefilename, 2)) == -1) { + logg("^Can't access file %s\n", thefilename); + perror(thefilename); + ret = 56; + } else { + int slash = 1; + for(i = strlen(thefilename) - 1; i > 0 && slash; i--) { + if(thefilename[i] == '/') + thefilename[i] = 0; + else + slash = 0; + } + + fmode = (mode_t) fmodeint; + + if(extunpacker && (thefilename[0] != '/' && thefilename[0] != '\\' && thefilename[1] != ':')) { + /* we need to complete the path */ + if(!getcwd(cwd, sizeof(cwd))) { + logg("!Can't get absolute pathname of current working directory\n"); + return 57; + } else { + fullpath = malloc(512); +#ifdef NO_SNPRINTF + sprintf(fullpath, "%s/%s", cwd, thefilename); +#else + snprintf(fullpath, 512, "%s/%s", cwd, thefilename); +#endif + logg("*Full path: %s\n", fullpath); + } + } else + fullpath = thefilename; + + switch(fmode & S_IFMT) { + case S_IFREG: + ret = scanfile(fullpath, engine, user, opt, &limits, options); + break; + + case S_IFDIR: + ret = scandirs(fullpath, engine, user, opt, &limits, options); + break; + + default: + logg("!Not supported file type (%s)\n", thefilename); + ret = 52; + } + + if(extunpacker && (thefilename[0] != '/' && thefilename[0] != '\\' && thefilename[1] != ':')) { + free(fullpath); + fullpath = NULL; + } + } + free(thefilename); + } + } + + /* free the engine */ + cl_free(engine); + + /* overwrite return code */ + if(info.ifiles) + ret = 1; + else if(ret < 50) /* hopefully no error detected */ + ret = 0; /* just make sure it's 0 */ + + return ret; +} + +/* + * -1 -> can't fork + * -2 -> can't execute + * -3 -> external signal + * 0 -> OK + */ + +#ifdef C_WINDOWS +static int clamav_unpack(const char *prog, const char **args, const char *tmpdir, const struct passwd *user, const struct optstruct *opt) +{ + /* TODO: use spamvp(P_WAIT, prog, args); */ + cli_errmsg("clamav_unpack is not supported under Windows yet\n"); + return -1; +} +#else +static int clamav_unpack(const char *prog, const char **args, const char *tmpdir, const struct passwd *user, const struct optstruct *opt) +{ + pid_t pid; + int status, wret, fdevnull; + unsigned int maxfiles, maxspace; + struct s_du n; + + + if(opt_check(opt, "max-files")) + maxfiles = atoi(opt_arg(opt, "max-files")); + else + maxfiles = 0; + + if(opt_check(opt, "max-space")) { + char *cpy, *ptr; + ptr = opt_arg(opt, "max-space"); + if(tolower(ptr[strlen(ptr) - 1]) == 'm') { /* megabytes */ + cpy = calloc(strlen(ptr), 1); + strncpy(cpy, ptr, strlen(ptr) - 1); + maxspace = atoi(cpy) * 1024; + free(cpy); + } else /* default - kilobytes */ + maxspace = atoi(ptr); + } else + maxspace = 0; + + + switch(pid = fork()) { + case -1: + return -1; + case 0: +#ifndef C_CYGWIN + if(!geteuid() && user) { + +#ifdef HAVE_SETGROUPS + if(setgroups(1, &user->pw_gid)) { + fprintf(stderr, "ERROR: setgroups() failed\n"); + exit(1); + } +#endif + + if(setgid(user->pw_gid)) { + fprintf(stderr, "ERROR: setgid(%d) failed\n", (int) user->pw_gid); + exit(1); + } + + if(setuid(user->pw_uid)) { + fprintf(stderr, "ERROR: setuid(%d) failed\n", (int) user->pw_uid); + exit(1); + } + } +#endif + if(chdir(tmpdir) == -1) { + fprintf(stderr, "ERROR: chdir(%s) failed\n", tmpdir); + exit(1); + } + + if(printinfected) { + fdevnull = open("/dev/null", O_WRONLY); + if(fdevnull == -1) { + logg("Non fatal error: cannot open /dev/null. Continuing with full output\n"); + printinfected = 0; + } else { + dup2(fdevnull,1); + dup2(fdevnull,2); + } + } + + if(strchr(prog, '/')) /* we have full path */ + execv(prog, args); + else + execvp(prog, args); + perror("execv(p)"); + abort(); + break; + default: + + if(maxfiles || maxspace) { + while(!(wret = waitpid(pid, &status, WNOHANG))) { + memset(&n, 0, sizeof(struct s_du)); + + if(!du(tmpdir, &n)) + if((maxfiles && n.files > maxfiles) || (maxspace && n.space > maxspace)) { + logg("*n.files: %u, n.space: %lu\n", n.files, n.space); + kill(pid, 9); /* stop it immediately */ + } + } + } else + waitpid(pid, &status, 0); + + + if(WIFSIGNALED(status)) { + switch(WTERMSIG(status)) { + + case 9: + logg("\nUnpacker process %d stopped due to exceeded limits\n", pid); + return 0; + case 6: /* abort */ + logg("^Can't run %s\n", prog); + return -2; + default: + logg("^\nUnpacker stopped with external signal %d\n", WTERMSIG(status)); + return -3; + } + } else if(WIFEXITED(status)) + return 0; + } + + return 0; +} +#endif + +static void move_infected(const char *filename, const struct optstruct *opt) +{ + char *movedir, *movefilename, numext[4 + 1]; + const char *tmp; + struct stat ofstat, mfstat; + int n, len, movefilename_size; + int moveflag = opt_check(opt, "move"); + struct utimbuf ubuf; + + + if((moveflag && !(movedir = opt_arg(opt, "move"))) || + (!moveflag && !(movedir = opt_arg(opt, "copy")))) { + /* Should never reach here */ + logg("!opt_arg() returned NULL\n"); + info.notmoved++; + return; + } + + if(access(movedir, W_OK|X_OK) == -1) { + logg("!Can't %s file '%s': cannot write to '%s': %s\n", (moveflag) ? "move" : "copy", filename, movedir, strerror(errno)); + info.notmoved++; + return; + } + + if(!(tmp = strrchr(filename, '/'))) + tmp = filename; + + movefilename_size = sizeof(char) * (strlen(movedir) + strlen(tmp) + sizeof(numext) + 2); + + if(!(movefilename = malloc(movefilename_size))) { + logg("!malloc() failed\n"); + exit(71); + } + + if(!(cli_strrcpy(movefilename, movedir))) { + logg("!cli_strrcpy() returned NULL\n"); + info.notmoved++; + free(movefilename); + return; + } + + strcat(movefilename, "/"); + + if(!(strcat(movefilename, tmp))) { + logg("!strcat() returned NULL\n"); + info.notmoved++; + free(movefilename); + return; + } + + stat(filename, &ofstat); + + if(!stat(movefilename, &mfstat)) { + if((ofstat.st_dev == mfstat.st_dev) && (ofstat.st_ino == mfstat.st_ino)) { /* It's the same file*/ + logg("File excluded '%s'\n", filename); + info.notmoved++; + free(movefilename); + return; + } else { + /* file exists - try to append an ordinal number to the + * quranatined file in an attempt not to overwrite existing + * files in quarantine + */ + len = strlen(movefilename); + n = 0; + do { + /* reset the movefilename to it's initial value by + * truncating to the original filename length + */ + movefilename[len] = 0; + /* append .XXX */ + sprintf(numext, ".%03d", n++); + strcat(movefilename, numext); + } while(!stat(movefilename, &mfstat) && (n < 1000)); + } + } + + if(!moveflag || rename(filename, movefilename) == -1) { + if(filecopy(filename, movefilename) == -1) { + logg("!Can't %s '%s' to '%s': %s\n", (moveflag) ? "move" : "copy", filename, movefilename, strerror(errno)); + info.notmoved++; + free(movefilename); + return; + } + + chmod(movefilename, ofstat.st_mode); +#ifndef C_OS2 + chown(movefilename, ofstat.st_uid, ofstat.st_gid); +#endif + + ubuf.actime = ofstat.st_atime; + ubuf.modtime = ofstat.st_mtime; + utime(movefilename, &ubuf); + + if(moveflag && unlink(filename)) { + logg("!Can't unlink '%s': %s\n", filename, strerror(errno)); + info.notremoved++; + free(movefilename); + return; + } + } + + logg("%s: %s to '%s'\n", filename, (moveflag) ? "moved" : "copied", movefilename); + + free(movefilename); +} + +static int checkfile(const char *filename, const struct cl_engine *engine, const struct cl_limits *limits, int options, short printclean) +{ + int fd, ret; + const char *virname; + + + logg("*Scanning %s\n", filename); + + if((fd = open(filename, O_RDONLY|O_BINARY)) == -1) { + logg("^Can't open file %s\n", filename); + return 54; + } + + if((ret = cl_scandesc(fd, &virname, &info.blocks, engine, limits, options)) == CL_VIRUS) { + logg("%s: %s FOUND\n", filename, virname); + info.ifiles++; + + if(bell) + fprintf(stderr, "\007"); + + } else if(ret == CL_CLEAN) { + if(!printinfected && printclean) + mprintf("%s: OK\n", filename); + } else + if(!printinfected) + logg("%s: %s\n", filename, cl_strerror(ret)); + + close(fd); + return ret; +} + +static int scancompressed(const char *filename, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options) +{ + int ret = 0; + char *gendir, *userprg; + const char *tmpdir; + struct stat statbuf; + + + stat(filename, &statbuf); + + if(!S_ISREG(statbuf.st_mode)) { + logg("^Suspect archive %s (not a regular file)\n", filename); + return 0; /* hmm ? */ + } + + /* check write access */ + + tmpdir = getenv("TMPDIR"); + + if(tmpdir == NULL) +#ifdef P_tmpdir + tmpdir = P_tmpdir; +#else + tmpdir = "/tmp"; +#endif + + if(checkaccess(tmpdir, CLAMAVUSER, W_OK) != 1) { + logg("!Can't write to the temporary directory\n"); + exit(64); + } + + /* generate the temporary directory */ + + gendir = cli_gentemp(tmpdir); + if(mkdir(gendir, 0700)) { + logg("!Can't create the temporary directory %s\n", gendir); + exit(63); /* critical */ + } + +#if !defined(C_OS2) && !defined(C_WINDOWS) + /* FIXME: do the correct native windows way */ + if(user) + chown(gendir, user->pw_uid, user->pw_gid); +#endif + + /* unpack file - as unprivileged user */ + if(cli_strbcasestr(filename, ".zip")) { + const char *args[] = { "unzip", "-P", "clam", "-o", NULL, NULL }; + /* Sun's SUNWspro C compiler doesn't allow direct initialisation + * with a variable + */ + args[4] = filename; + + if((userprg = opt_arg(opt, "unzip"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unzip", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".rar")) { + const char *args[] = { "unrar", "x", "-p-", "-y", NULL, NULL }; + args[4] = filename; + if((userprg = opt_arg(opt, "unrar"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unrar", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".arj")) { + const char *args[] = { "arj", "x","-y", NULL, NULL }; + args[3] = filename; + if((userprg = opt_arg(opt, "arj"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("arj", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".zoo")) { + const char *args[] = { "unzoo", "-x","-j","./", NULL, NULL }; + args[4] = filename; + if((userprg = opt_arg(opt, "unzoo"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unzoo", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".jar")) { + const char *args[] = { "unzip", "-P", "clam", "-o", NULL, NULL }; + args[4] = filename; + if((userprg = opt_arg(opt, "jar"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("unzip", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".lzh")) { + const char *args[] = { "lha", "xf", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "lha"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("lha", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".tar")) { + const char *args[] = { "tar", "-xpvf", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "tar"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("tar", args, gendir, user, opt); + + } else if(cli_strbcasestr(filename, ".deb")) { + const char *args[] = { "ar", "x", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "deb"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("ar", args, gendir, user, opt); + + } else if((cli_strbcasestr(filename, ".tar.gz") || cli_strbcasestr(filename, ".tgz"))) { + const char *args[] = { "tar", "-zxpvf", NULL, NULL }; + args[2] = filename; + if((userprg = opt_arg(opt, "tgz"))) + ret = clamav_unpack(userprg, args, gendir, user, opt); + else + ret = clamav_unpack("tar", args, gendir, user, opt); + } + + /* fix permissions of extracted files */ + fixperms(gendir); + + if(!ret) { /* execute successful */ + short oldrec = recursion; + + recursion = 1; + ret = treewalk(gendir, engine, user, opt, limits, options, 1); + recursion = oldrec; + } + + /* remove the directory - as clamav */ + if(!opt_check(opt, "leave-temps")) + clamav_rmdirs(gendir); + + /* free gendir - it's not necessary now */ + free(gendir); + + switch(ret) { + case -1: + logg("!Can't fork()\n"); + exit(61); /* this is critical problem, so we just exit here */ + case -2: + logg("^Can't execute some unpacker. Check paths and permissions on the temporary directory\n"); + /* This is no longer a critical error (since 0.24). We scan + * raw archive. + */ + if((ret = checkfile(filename, engine, limits, 0, 0)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + return ret; + case -3: + return 0; + case 0: + /* no viruses found in archive, we scan just in case a raw file + */ + if((ret = checkfile(filename, engine, limits, 0, 1)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + return ret; + case 1: + logg("%s: Infected.Archive FOUND\n", filename); + + if(bell) + fprintf(stderr, "\007"); + + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + + return 1; + default: + logg("^Strange value (%d) returned in scancompressed()\n", ret); + return 0; + } +} + +static int scandenied(const char *filename, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options) +{ + char *gendir, *tmp_file; + const char *tmpdir, *pt; + struct stat statbuf; + int ret; + + stat(filename, &statbuf); + if(!S_ISREG(statbuf.st_mode)) { + logg("^Suspect archive %s (not a regular file)\n", filename); + return 0; + } + + /* check write access */ + + tmpdir = getenv("TMPDIR"); + + if(tmpdir == NULL) +#ifdef P_tmpdir + tmpdir = P_tmpdir; +#else + tmpdir = "/tmp"; +#endif + + + if(checkaccess(tmpdir, CLAMAVUSER, W_OK) != 1) { + logg("!Can't write to the temporary directory %s\n", tmpdir); + exit(64); + } + + /* generate the temporary directory */ + gendir = cli_gentemp(tmpdir); + if(mkdir(gendir, 0700)) { + logg("^Can't create the temporary directory %s\n", gendir); + exit(63); /* critical */ + } + + tmp_file = (char *) malloc(strlen(gendir) + strlen(filename) + 10); + pt = strrchr(filename, '/'); + if(!pt) + pt = filename; + else + pt += 1; + + sprintf(tmp_file, "%s/%s", gendir, pt); + + if(filecopy(filename, tmp_file) == -1) { + logg("!I/O error\n"); + perror("copyfile()"); + exit(58); + } + + fixperms(gendir); + +#if !defined(C_OS2) && !defined(C_WINDOWS) + if(user) { + chown(gendir, user->pw_uid, user->pw_gid); + chown(tmp_file, user->pw_uid, user->pw_gid); + } +#endif + + if((ret = treewalk(gendir, engine, user, opt, limits, options, 1)) == 1) { + logg("(Real infected archive: %s)\n", filename); + + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + + /* remove the directory - as clamav */ + clamav_rmdirs(gendir); + + free(gendir); + free(tmp_file); + + return ret; +} + +int scanfile(const char *filename, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, unsigned int options) +{ + int ret, included, printclean = 1; + const struct optnode *optnode; + char *argument; +#ifdef C_LINUX + struct stat sb; + + /* argh, don't scan /proc files */ + if(procdev) + if(stat(filename, &sb) != -1) + if(sb.st_dev == procdev) { + if(!printinfected) + logg("%s: Excluded (/proc)\n", filename); + return 0; + } +#endif + + if(opt_check(opt, "exclude")) { + argument = opt_firstarg(opt, "exclude", &optnode); + while(argument) { + if(match_regex(filename, argument) == 1) { + if(!printinfected) + logg("%s: Excluded\n", filename); + return 0; + } + argument = opt_nextarg(&optnode, "exclude"); + } + } + + if(opt_check(opt, "include")) { + included = 0; + argument = opt_firstarg(opt, "include", &optnode); + while(argument && !included) { + if(match_regex(filename, argument) == 1) { + included = 1; + break; + } + argument = opt_nextarg(&optnode, "include"); + } + + if(!included) { + if(!printinfected) + logg("%s: Excluded\n", filename); + return 0; + } + } + + if(fileinfo(filename, 1) == 0) { + if(!printinfected) + logg("%s: Empty file\n", filename); + return 0; + } + +#ifndef C_WINDOWS + if(geteuid()) + if(checkaccess(filename, NULL, R_OK) != 1) { + if(!printinfected) + logg("%s: Access denied\n", filename); + return 0; + } +#endif + + info.files++; + + /* + * check the extension - this is a special case, normally we don't need to + * do this (libclamav detects archive by its magic string), but here we + * want to know the exit code from internal unpacker and try to use + * external (if provided) when internal cannot extract data. + */ + + if((cli_strbcasestr(filename, ".zip") || cli_strbcasestr(filename, ".rar")) && (options & CL_SCAN_ARCHIVE)) { + /* try to use internal archivers */ + if((ret = checkfile(filename, engine, limits, options, 1)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + + return 1; + + } else if(ret == CL_CLEAN) { + return 0; + } else if(ret == 54) { + return ret; + } + + /* in other case try to continue with external archivers */ + options &= ~CL_SCAN_ARCHIVE; /* and disable decompression for the checkfile() below */ + printclean = 0; + } + + if((cli_strbcasestr(filename, ".zip") && opt_check(opt, "unzip")) + || (cli_strbcasestr(filename, ".rar") && opt_check(opt, "unrar")) + || (cli_strbcasestr(filename, ".arj") && opt_check(opt, "arj")) + || (cli_strbcasestr(filename, ".zoo") && opt_check(opt, "unzoo")) + || (cli_strbcasestr(filename, ".jar") && opt_check(opt, "jar")) + || (cli_strbcasestr(filename, ".lzh") && opt_check(opt, "lha")) + || (cli_strbcasestr(filename, ".tar") && opt_check(opt, "tar")) + || (cli_strbcasestr(filename, ".deb") && opt_check(opt, "deb")) + || ((cli_strbcasestr(filename, ".tar.gz") || cli_strbcasestr(filename, ".tgz")) + && (opt_check(opt, "tgz") || opt_check(opt, "deb"))) ) { + + /* check permissions */ + switch(checkaccess(filename, CLAMAVUSER, R_OK)) { + case -1: + logg("^Can't get information about user "CLAMAVUSER"\n"); + exit(60); /* this is a critical problem so we just exit here */ + case -2: + logg("^Can't fork\n"); + exit(61); + case 0: /* read access denied */ + if(geteuid()) { + if(!printinfected) + logg("^%s: Access denied to archive\n", filename); + } else { + + if(limits && limits->maxfilesize) + if((unsigned int) fileinfo(filename, 1) / 1024 > limits->maxfilesize) { + if(!printinfected) + logg("^%s: Archive too big\n", filename); + return 0; + } + + return(scandenied(filename, engine, user, opt, limits, options)); + } + return 0; + case 1: + return(scancompressed(filename, engine, user, opt, limits, options)); + } + } + + if((ret = checkfile(filename, engine, limits, options, printclean)) == CL_VIRUS) { + if(opt_check(opt, "remove")) { + if(unlink(filename)) { + logg("^%s: Can't remove\n", filename); + info.notremoved++; + } else { + logg("%s: Removed\n", filename); + } + } else if (opt_check(opt, "move") || opt_check(opt, "copy")) + move_infected(filename, opt); + } + return ret; +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_opt.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_opt.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_opt.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_opt.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2002 - 2006 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + */ + +#ifndef __CLAMSCAN_OPT_H +#define __CLAMSCAN_OPT_H + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include "getopt.h" + +const char *clamscan_shortopt = "hvd:wriVl:m"; +static struct option clamscan_longopt[] = { + {"help", 0, 0, 'h'}, /* clamscan + clamdscan */ + {"quiet", 0, 0, 0}, /* clamscan + clamdscan */ + {"stdout", 0, 0, 0}, /* clamscan + clamdscan */ + {"verbose", 0, 0, 'v'}, /* clamscan + clamdscan */ + {"debug", 0, 0, 0}, + {"version", 0, 0, 'V'}, /* clamscan + clamdscan */ + {"tempdir", 1, 0, 0}, + {"leave-temps", 0, 0, 0}, + {"config-file", 1, 0, 0}, /* clamdscan */ + {"multiscan", 0, 0, 'm'}, + {"database", 1, 0, 'd'}, + {"force", 0, 0, 0}, + {"recursive", 0, 0, 'r'}, + {"bell", 0, 0, 0}, + {"disable-summary", 0, 0, 0}, /* obsolete */ + {"no-summary", 0, 0, 0}, + {"infected", 0, 0, 'i'}, + {"log", 1, 0, 'l'}, + {"move", 1, 0, 0}, + {"copy", 1, 0, 0}, + {"remove", 0, 0, 0}, + {"exclude", 1, 0, 0}, + {"exclude-dir", 1, 0, 0}, + {"include", 1, 0, 0}, + {"include-dir", 1, 0, 0}, + {"max-files", 1, 0, 0}, + {"max-space", 1, 0, 0}, + {"max-ratio", 1, 0, 0}, + {"max-recursion", 1, 0, 0}, + {"max-dir-recursion", 1, 0, 0}, + {"max-mail-recursion", 1, 0, 0}, + {"detect-pua", 0, 0, 0}, + {"disable-archive", 0, 0, 0}, + {"no-archive", 0, 0, 0}, + {"detect-broken", 0, 0, 0}, + {"block-encrypted", 0, 0, 0}, + {"block-max", 0, 0, 0}, + {"no-pe", 0, 0, 0}, + {"no-elf", 0, 0, 0}, + {"no-ole2", 0, 0, 0}, + {"no-pdf", 0, 0, 0}, + {"no-html", 0, 0, 0}, + {"no-mail", 0, 0, 0}, + {"mail-follow-urls", 0, 0, 0}, + {"no-phishing-sigs", 0, 0, 0}, + {"no-phishing-scan-urls", 0, 0, 0}, + {"no-phishing-restrictedscan", 0, 0, 0}, + {"phishing-ssl", 0, 0, 0}, + {"phishing-cloak", 0, 0, 0}, + {"no-algorithmic", 0, 0, 0}, + {"unzip", 2, 0, 0}, + {"unrar", 2, 0, 0}, + {"arj", 2, 0, 0}, + {"unzoo", 2, 0, 0}, + {"lha", 2, 0, 0}, + {"jar", 2, 0, 0}, + {"tar", 2, 0, 0}, + {"tgz", 2, 0, 0}, + {"deb", 2, 0, 0}, + + /* developers only */ + {"dev-ac-only", 0, 0, 0}, + {"dev-ac-depth", 1, 0, 0}, + + {0, 0, 0, 0} +}; + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.c?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.c (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.c Wed Jan 30 15:17:10 2008 @@ -0,0 +1,145 @@ +/* + * Copyright (C) 1999 - 2004 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#ifdef HAVE_PWD_H +#include +#endif +#include +#include +#ifndef C_WINDOWS +#include +#include +#endif +#include +#include +#include +#include + +#include "regex.h" + +#include "output.h" +#include "clamscan_others.h" + +int fileinfo(const char *filename, short i) +{ + struct stat infostruct; + + if(stat(filename, &infostruct) == -1) + return(-1); + + switch(i) { + + case 1: /* size */ + return infostruct.st_size; + case 2: /* permissions */ + return (mode_t)infostruct.st_mode; + case 3: /* modification time */ + return infostruct.st_mtime; + case 4: /* UID */ + return infostruct.st_uid; + case 5: /* GID */ + return infostruct.st_gid; + default: + logg("!fileinfo(): Unknown option.\n"); + exit(1); + } +} + +#ifdef C_WINDOWS +/* FIXME: Handle users correctly */ +int checkaccess(const char *path, const char *username, int mode) +{ + return _access(path, mode); +} +#else +int checkaccess(const char *path, const char *username, int mode) +{ + struct passwd *user; + int ret = 0, status; + + if(!geteuid()) { + + if((user = getpwnam(username)) == NULL) { + return -1; + } + + switch(fork()) { + case -1: + return -2; + + case 0: + if(setgid(user->pw_gid)) { + fprintf(stderr, "ERROR: setgid(%d) failed.\n", (int) user->pw_gid); + exit(0); + } + + if(setuid(user->pw_uid)) { + fprintf(stderr, "ERROR: setuid(%d) failed.\n", (int) user->pw_uid); + exit(0); + } + + if(access(path, mode)) + exit(0); + else + exit(1); + + default: + wait(&status); + if(WIFEXITED(status) && WEXITSTATUS(status) == 1) + ret = 1; + } + + } else { + if(!access(path, mode)) + ret = 1; + } + + return ret; +} +#endif + +int match_regex(const char *filename, const char *pattern) +{ + regex_t reg; + int match, flags; +#if !defined(C_CYGWIN) && !defined(C_OS2) + flags = REG_EXTENDED; +#else + flags = REG_EXTENDED | REG_ICASE; /* case insensitive on Windows */ +#endif + if(cli_regcomp(®, pattern, flags) != 0) { + logg("!%s: Could not parse regular expression %s.\n", filename, pattern); + return 2; + } + match = (cli_regexec(®, filename, 0, NULL, 0) == REG_NOMATCH) ? 0 : 1; + cli_regfree(®); + return match; +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.ce URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.ce?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.ce (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.ce Wed Jan 30 15:17:10 2008 @@ -0,0 +1,145 @@ +/* + * Copyright (C) 1999 - 2004 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#ifdef HAVE_PWD_H +#include +#endif +#include +#include +#ifndef C_WINDOWS +#include +#include +#endif +#include +#include +#include +#include + +#include "regex/regex.h" + +#include "shared/output.h" +#include "others.h" + +int fileinfo(const char *filename, short i) +{ + struct stat infostruct; + + if(stat(filename, &infostruct) == -1) + return(-1); + + switch(i) { + + case 1: /* size */ + return infostruct.st_size; + case 2: /* permissions */ + return (mode_t)infostruct.st_mode; + case 3: /* modification time */ + return infostruct.st_mtime; + case 4: /* UID */ + return infostruct.st_uid; + case 5: /* GID */ + return infostruct.st_gid; + default: + logg("!fileinfo(): Unknown option.\n"); + exit(1); + } +} + +#ifdef C_WINDOWS +/* FIXME: Handle users correctly */ +int checkaccess(const char *path, const char *username, int mode) +{ + return _access(path, mode); +} +#else +int checkaccess(const char *path, const char *username, int mode) +{ + struct passwd *user; + int ret = 0, status; + + if(!geteuid()) { + + if((user = getpwnam(username)) == NULL) { + return -1; + } + + switch(fork()) { + case -1: + return -2; + + case 0: + if(setgid(user->pw_gid)) { + fprintf(stderr, "ERROR: setgid(%d) failed.\n", (int) user->pw_gid); + exit(0); + } + + if(setuid(user->pw_uid)) { + fprintf(stderr, "ERROR: setuid(%d) failed.\n", (int) user->pw_uid); + exit(0); + } + + if(access(path, mode)) + exit(0); + else + exit(1); + + default: + wait(&status); + if(WIFEXITED(status) && WEXITSTATUS(status) == 1) + ret = 1; + } + + } else { + if(!access(path, mode)) + ret = 1; + } + + return ret; +} +#endif + +int match_regex(const char *filename, const char *pattern) +{ + regex_t reg; + int match, flags; +#if !defined(C_CYGWIN) && !defined(C_OS2) + flags = REG_EXTENDED; +#else + flags = REG_EXTENDED | REG_ICASE; /* case insensitive on Windows */ +#endif + if(cli_regcomp(®, pattern, flags) != 0) { + logg("!%s: Could not parse regular expression %s.\n", filename, pattern); + return 2; + } + match = (cli_regexec(®, filename, 0, NULL, 0) == REG_NOMATCH) ? 0 : 1; + cli_regfree(®); + return match; +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_others.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,26 @@ +/* + * Copyright (C) 1999 - 2004 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __OTHERS_H +#define __OTHERS_H + +int fileinfo(const char *filename, short i); +int checkaccess(const char *path, const char *username, int mode); +int match_regex(const char *filename, const char *pattern); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.c?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.c (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.c Wed Jan 30 15:17:10 2008 @@ -0,0 +1,295 @@ +/* + * Copyright (C) 2002 - 2007 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#ifndef C_WINDOWS +#include +#endif +#ifdef HAVE_PWD_H +#include +#endif +#ifdef HAVE_GRP_H +#include +#endif +#ifndef C_WINDOWS +#include +#endif +#include + +#include "global.h" +#include "manager.h" +#include "clamscan_others.h" +#include "treewalk.h" + +#include "options.h" +#include "output.h" +#include "misc.h" + +#include "clamav.h" +#include "others.h" + +int treewalk(const char *dirname, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, unsigned int options, unsigned int depth) +{ + DIR *dd; + struct dirent *dent; + struct stat statbuf; + char *fname; + int scanret = 0, included; + unsigned int maxdepth; + const struct optnode *optnode; + char *argument; + + + if(opt_check(opt, "exclude-dir")) { + argument = opt_firstarg(opt, "exclude-dir", &optnode); + while(argument) { + if(match_regex(dirname, argument) == 1) { + if(!printinfected) + logg("%s: Excluded\n", dirname); + return 0; + } + argument = opt_nextarg(&optnode, "exclude-dir"); + } + } + + if(opt_check(opt, "include-dir")) { + included = 0; + argument = opt_firstarg(opt, "include-dir", &optnode); + while(argument && !included) { + if(match_regex(dirname, argument) == 1) { + included = 1; + break; + } + argument = opt_nextarg(&optnode, "include-dir"); + } + + if(!included) { + if(!printinfected) + logg("%s: Excluded\n", dirname); + return 0; + } + } + + if(opt_check(opt, "max-dir-recursion")) + maxdepth = atoi(opt_arg(opt, "max-dir-recursion")); + else + maxdepth = 15; + + if(depth > maxdepth) + return 0; + + info.dirs++; + depth++; + + if((dd = opendir(dirname)) != NULL) { + while((dent = readdir(dd))) { +#if !defined(C_INTERIX) && !defined(C_WINDOWS) && !defined(C_CYGWIN) + if(dent->d_ino) +#endif + { + if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) { + /* build the full name */ + fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2); + sprintf(fname, "%s/%s", dirname, dent->d_name); + + /* stat the file */ + if(lstat(fname, &statbuf) != -1) { + if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode) && recursion) { + if(treewalk(fname, engine, user, opt, limits, options, depth) == 1) + scanret++; + } else { + if(S_ISREG(statbuf.st_mode)) + scanret += scanfile(fname, engine, user, opt, limits, options); + } + } + free(fname); + } + + } + } + } else { + if(!printinfected) + logg("%s: Can't open directory.\n", dirname); + return 53; + } + + closedir(dd); + + if(scanret) + return 1; + else + return 0; + +} + +#ifdef C_WINDOWS +int clamav_rmdirs(const char *dir) +{ + return cli_rmdirs(dir); +} +#else +int clamav_rmdirs(const char *dir) +{ +#ifndef C_CYGWIN + struct passwd *user; +#endif + pid_t pid; + int status; + + + switch(pid = fork()) { + case -1: + return -1; + case 0: +#ifndef C_CYGWIN + if(!geteuid()) { + if((user = getpwnam(CLAMAVUSER)) == NULL) + return -3; + +#ifdef HAVE_SETGROUPS + if(setgroups(1, &user->pw_gid)) { + fprintf(stderr, "ERROR: setgroups() failed.\n"); + return -3; + } +#endif + + if(setgid(user->pw_gid)) { + fprintf(stderr, "ERROR: setgid(%d) failed.\n", (int) user->pw_gid); + return -3; + } + + if(setuid(user->pw_uid)) { + fprintf(stderr, "ERROR: setuid(%d) failed.\n", (int) user->pw_uid); + return -3; + } + } +#endif + cli_rmdirs(dir); + exit(0); + break; + default: + waitpid(pid, &status, 0); + if(WIFEXITED(status)) + return 0; + else + return -2; + } +} +#endif + +int fixperms(const char *dirname) +{ + DIR *dd; + struct dirent *dent; + struct stat statbuf; + char *fname; + int scanret = 0; + + if((dd = opendir(dirname)) != NULL) { + while((dent = readdir(dd))) { +#if !defined(C_INTERIX) && !defined(C_WINDOWS) && !defined(C_CYGWIN) + if(dent->d_ino) +#endif + { + if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) { + /* build full name */ + fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2); + sprintf(fname, "%s/%s", dirname, dent->d_name); + + /* stat the file */ + if(lstat(fname, &statbuf) != -1) { + if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode)) { + chmod(fname, 0700); + fixperms(fname); + } else if(S_ISREG(statbuf.st_mode)) + chmod(fname, 0700); + } + + free(fname); + } + } + } + } else { + if(!printinfected) + logg("%s: Can't open directory.\n", dirname); + return 53; + } + + closedir(dd); + + if(scanret) + return 1; + else + return 0; + +} + +int du(const char *dirname, struct s_du *n) +{ + DIR *dd; + struct dirent *dent; + struct stat statbuf; + char *fname; + + if((dd = opendir(dirname)) != NULL) { + while((dent = readdir(dd))) { +#if !defined(C_INTERIX) && !defined(C_WINDOWS) && !defined(C_CYGWIN) + if(dent->d_ino) +#endif + { + if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) { + n->files++; + + /* build the full name */ + fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2); + sprintf(fname, "%s/%s", dirname, dent->d_name); + + /* stat the file */ + if(lstat(fname, &statbuf) != -1) { + if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode)) { + du(fname, n); + } else { + n->space += statbuf.st_size / 1024; + } + } + + free(fname); + } + } + } + } else { + if(!printinfected) + logg("%s: Can't open directory.\n", dirname); + return 53; + } + + closedir(dd); + + return 0; +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.ce URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.ce?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.ce (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/clamscan_treewalk.ce Wed Jan 30 15:17:10 2008 @@ -0,0 +1,295 @@ +/* + * Copyright (C) 2002 - 2007 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#include +#ifndef C_WINDOWS +#include +#endif +#ifdef HAVE_PWD_H +#include +#endif +#ifdef HAVE_GRP_H +#include +#endif +#ifndef C_WINDOWS +#include +#endif +#include + +#include "global.h" +#include "manager.h" +#include "others.h" +#include "treewalk.h" + +#include "shared/options.h" +#include "shared/output.h" +#include "shared/misc.h" + +#include "libclamav/clamav.h" +#include "libclamav/others.h" + +int treewalk(const char *dirname, struct cl_engine *engine, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, unsigned int options, unsigned int depth) +{ + DIR *dd; + struct dirent *dent; + struct stat statbuf; + char *fname; + int scanret = 0, included; + unsigned int maxdepth; + const struct optnode *optnode; + char *argument; + + + if(opt_check(opt, "exclude-dir")) { + argument = opt_firstarg(opt, "exclude-dir", &optnode); + while(argument) { + if(match_regex(dirname, argument) == 1) { + if(!printinfected) + logg("%s: Excluded\n", dirname); + return 0; + } + argument = opt_nextarg(&optnode, "exclude-dir"); + } + } + + if(opt_check(opt, "include-dir")) { + included = 0; + argument = opt_firstarg(opt, "include-dir", &optnode); + while(argument && !included) { + if(match_regex(dirname, argument) == 1) { + included = 1; + break; + } + argument = opt_nextarg(&optnode, "include-dir"); + } + + if(!included) { + if(!printinfected) + logg("%s: Excluded\n", dirname); + return 0; + } + } + + if(opt_check(opt, "max-dir-recursion")) + maxdepth = atoi(opt_arg(opt, "max-dir-recursion")); + else + maxdepth = 15; + + if(depth > maxdepth) + return 0; + + info.dirs++; + depth++; + + if((dd = opendir(dirname)) != NULL) { + while((dent = readdir(dd))) { +#if !defined(C_INTERIX) && !defined(C_WINDOWS) && !defined(C_CYGWIN) + if(dent->d_ino) +#endif + { + if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) { + /* build the full name */ + fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2); + sprintf(fname, "%s/%s", dirname, dent->d_name); + + /* stat the file */ + if(lstat(fname, &statbuf) != -1) { + if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode) && recursion) { + if(treewalk(fname, engine, user, opt, limits, options, depth) == 1) + scanret++; + } else { + if(S_ISREG(statbuf.st_mode)) + scanret += scanfile(fname, engine, user, opt, limits, options); + } + } + free(fname); + } + + } + } + } else { + if(!printinfected) + logg("%s: Can't open directory.\n", dirname); + return 53; + } + + closedir(dd); + + if(scanret) + return 1; + else + return 0; + +} + +#ifdef C_WINDOWS +int clamav_rmdirs(const char *dir) +{ + return cli_rmdirs(dir); +} +#else +int clamav_rmdirs(const char *dir) +{ +#ifndef C_CYGWIN + struct passwd *user; +#endif + pid_t pid; + int status; + + + switch(pid = fork()) { + case -1: + return -1; + case 0: +#ifndef C_CYGWIN + if(!geteuid()) { + if((user = getpwnam(CLAMAVUSER)) == NULL) + return -3; + +#ifdef HAVE_SETGROUPS + if(setgroups(1, &user->pw_gid)) { + fprintf(stderr, "ERROR: setgroups() failed.\n"); + return -3; + } +#endif + + if(setgid(user->pw_gid)) { + fprintf(stderr, "ERROR: setgid(%d) failed.\n", (int) user->pw_gid); + return -3; + } + + if(setuid(user->pw_uid)) { + fprintf(stderr, "ERROR: setuid(%d) failed.\n", (int) user->pw_uid); + return -3; + } + } +#endif + cli_rmdirs(dir); + exit(0); + break; + default: + waitpid(pid, &status, 0); + if(WIFEXITED(status)) + return 0; + else + return -2; + } +} +#endif + +int fixperms(const char *dirname) +{ + DIR *dd; + struct dirent *dent; + struct stat statbuf; + char *fname; + int scanret = 0; + + if((dd = opendir(dirname)) != NULL) { + while((dent = readdir(dd))) { +#if !defined(C_INTERIX) && !defined(C_WINDOWS) && !defined(C_CYGWIN) + if(dent->d_ino) +#endif + { + if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) { + /* build full name */ + fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2); + sprintf(fname, "%s/%s", dirname, dent->d_name); + + /* stat the file */ + if(lstat(fname, &statbuf) != -1) { + if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode)) { + chmod(fname, 0700); + fixperms(fname); + } else if(S_ISREG(statbuf.st_mode)) + chmod(fname, 0700); + } + + free(fname); + } + } + } + } else { + if(!printinfected) + logg("%s: Can't open directory.\n", dirname); + return 53; + } + + closedir(dd); + + if(scanret) + return 1; + else + return 0; + +} + +int du(const char *dirname, struct s_du *n) +{ + DIR *dd; + struct dirent *dent; + struct stat statbuf; + char *fname; + + if((dd = opendir(dirname)) != NULL) { + while((dent = readdir(dd))) { +#if !defined(C_INTERIX) && !defined(C_WINDOWS) && !defined(C_CYGWIN) + if(dent->d_ino) +#endif + { + if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) { + n->files++; + + /* build the full name */ + fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2); + sprintf(fname, "%s/%s", dirname, dent->d_name); + + /* stat the file */ + if(lstat(fname, &statbuf) != -1) { + if(S_ISDIR(statbuf.st_mode) && !S_ISLNK(statbuf.st_mode)) { + du(fname, n); + } else { + n->space += statbuf.st_size / 1024; + } + } + + free(fname); + } + } + } + } else { + if(!printinfected) + logg("%s: Can't open directory.\n", dirname); + return 53; + } + + closedir(dd); + + return 0; +} Added: test-suite/trunk/MultiSource/Applications/ClamAV/cltypes.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/cltypes.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/cltypes.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/cltypes.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2004 - 2005 Tomasz Kojm + * + * Based on zzip-stdint.h + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __CLTYPES_H +#define __CLTYPES_H + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#ifdef HAVE_STDINT_H +#include +#elif defined HAVE_SYS_INT_TYPES_H /*solaris*/ +#include +#elif defined HAVE_INTTYPES_H /*freebsd*/ +#include +#else + typedef unsigned char uint8_t; typedef signed char int8_t; + +# if SIZEOF_INT == 2 + typedef unsigned int uint16_t; typedef signed int int16_t; +# elif SIZEOF_SHORT == 2 + typedef unsigned short uint16_t; typedef signed short int16_t; +# else +# error unable to typedef int16_t from either int or short + typedef unsigned short uint16_t; typedef signed short int16_t; +# endif + +# if SIZEOF_INT == 4 + typedef unsigned int uint32_t; typedef signed int int32_t; +# elif SIZEOF_LONG == 4 + typedef unsigned long uint32_t; typedef signed long int32_t; +# else +# error unable to typedef int32_t from either int or long + typedef unsigned long uint32_t; typedef signed long int32_t; +# endif + +# if SIZEOF_LONG == 8 + typedef unsigned long uint64_t; typedef signed long int64_t; +# elif SIZEOF_LONG_LONG == 8 + typedef unsigned long long uint64_t; typedef signed long long int64_t; +# else +# error unable to typedef int64_t from either long or long long + typedef unsigned long long uint64_t; typedef signed long long int64_t; +# endif + +#endif + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/cname.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/cname.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/cname.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/cname.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,139 @@ +/*- + * This code is derived from OpenBSD's libc/regex, original license follows: + * + * Copyright (c) 1992, 1993, 1994 Henry Spencer. + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)cname.h 8.3 (Berkeley) 3/20/94 + */ + +/* character-name table */ +static struct cname { + const char *name; + char code; +} cnames[] = { + { "NUL", '\0' }, + { "SOH", '\001' }, + { "STX", '\002' }, + { "ETX", '\003' }, + { "EOT", '\004' }, + { "ENQ", '\005' }, + { "ACK", '\006' }, + { "BEL", '\007' }, + { "alert", '\007' }, + { "BS", '\010' }, + { "backspace", '\b' }, + { "HT", '\011' }, + { "tab", '\t' }, + { "LF", '\012' }, + { "newline", '\n' }, + { "VT", '\013' }, + { "vertical-tab", '\v' }, + { "FF", '\014' }, + { "form-feed", '\f' }, + { "CR", '\015' }, + { "carriage-return", '\r' }, + { "SO", '\016' }, + { "SI", '\017' }, + { "DLE", '\020' }, + { "DC1", '\021' }, + { "DC2", '\022' }, + { "DC3", '\023' }, + { "DC4", '\024' }, + { "NAK", '\025' }, + { "SYN", '\026' }, + { "ETB", '\027' }, + { "CAN", '\030' }, + { "EM", '\031' }, + { "SUB", '\032' }, + { "ESC", '\033' }, + { "IS4", '\034' }, + { "FS", '\034' }, + { "IS3", '\035' }, + { "GS", '\035' }, + { "IS2", '\036' }, + { "RS", '\036' }, + { "IS1", '\037' }, + { "US", '\037' }, + { "space", ' ' }, + { "exclamation-mark", '!' }, + { "quotation-mark", '"' }, + { "number-sign", '#' }, + { "dollar-sign", '$' }, + { "percent-sign", '%' }, + { "ampersand", '&' }, + { "apostrophe", '\'' }, + { "left-parenthesis", '(' }, + { "right-parenthesis", ')' }, + { "asterisk", '*' }, + { "plus-sign", '+' }, + { "comma", ',' }, + { "hyphen", '-' }, + { "hyphen-minus", '-' }, + { "period", '.' }, + { "full-stop", '.' }, + { "slash", '/' }, + { "solidus", '/' }, + { "zero", '0' }, + { "one", '1' }, + { "two", '2' }, + { "three", '3' }, + { "four", '4' }, + { "five", '5' }, + { "six", '6' }, + { "seven", '7' }, + { "eight", '8' }, + { "nine", '9' }, + { "colon", ':' }, + { "semicolon", ';' }, + { "less-than-sign", '<' }, + { "equals-sign", '=' }, + { "greater-than-sign", '>' }, + { "question-mark", '?' }, + { "commercial-at", '@' }, + { "left-square-bracket", '[' }, + { "backslash", '\\' }, + { "reverse-solidus", '\\' }, + { "right-square-bracket", ']' }, + { "circumflex", '^' }, + { "circumflex-accent", '^' }, + { "underscore", '_' }, + { "low-line", '_' }, + { "grave-accent", '`' }, + { "left-brace", '{' }, + { "left-curly-bracket", '{' }, + { "vertical-line", '|' }, + { "right-brace", '}' }, + { "right-curly-bracket", '}' }, + { "tilde", '~' }, + { "DEL", '\177' }, + { NULL, 0 } +}; Added: test-suite/trunk/MultiSource/Applications/ClamAV/cvd.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/cvd.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/cvd.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/cvd.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2003 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __CVD_H +#define __CVD_H + +#include +#include "clamav.h" + +int cli_cvdload(FILE *fs, struct cl_engine **engine, unsigned int *signo, short warn, unsigned int options); +int cli_untgz(int fd, const char *destdir); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/dbdir/daily.cvd URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/dbdir/daily.cvd?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/dbdir/daily.cvd ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/dconf.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/dconf.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/dconf.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/dconf.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2007 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __DCONF_H +#define __DCONF_H + +#include + +#include "clamav.h" +#include "cltypes.h" + +struct cli_dconf { + uint32_t pe; + uint32_t elf; + uint32_t archive; + uint32_t doc; + uint32_t mail; + uint32_t other; + uint32_t phishing; +}; + +/* PE flags */ +#define PE_CONF_PARITE 0x1 +#define PE_CONF_KRIZ 0x2 +#define PE_CONF_MAGISTR 0x4 +#define PE_CONF_POLIPOS 0x8 +#define PE_CONF_MD5SECT 0x10 +#define PE_CONF_UPX 0x20 +#define PE_CONF_FSG 0x40 +/*#define PE_CONF_REUSEME 0x80 */ +#define PE_CONF_PETITE 0x100 +#define PE_CONF_PESPIN 0x200 +#define PE_CONF_YC 0x400 +#define PE_CONF_WWPACK 0x800 +#define PE_CONF_NSPACK 0x1000 +#define PE_CONF_MEW 0x2000 +#define PE_CONF_UPACK 0x4000 +#define PE_CONF_ASPACK 0x8000 + +/* Archive flags */ +#define ARCH_CONF_RAR 0x1 +#define ARCH_CONF_ZIP 0x2 +#define ARCH_CONF_GZ 0x4 +#define ARCH_CONF_BZ 0x8 +#define ARCH_CONF_SZDD 0x10 +#define ARCH_CONF_CAB 0x20 +#define ARCH_CONF_CHM 0x40 +#define ARCH_CONF_OLE2 0x80 +#define ARCH_CONF_TAR 0x100 +#define ARCH_CONF_BINHEX 0x200 +#define ARCH_CONF_SIS 0x400 +#define ARCH_CONF_NSIS 0x800 +#define ARCH_CONF_ARJ 0x1000 +#define ARCH_CONF_AUTOIT 0x2000 + +/* Document flags */ +#define DOC_CONF_HTML 0x1 +#define DOC_CONF_RTF 0x2 +#define DOC_CONF_PDF 0x4 + +/* Mail flags */ +#define MAIL_CONF_MBOX 0x1 +#define MAIL_CONF_TNEF 0x2 +#define MAIL_CONF_PST 0x4 + +/* Other flags */ +#define OTHER_CONF_UUENC 0x1 +#define OTHER_CONF_SCRENC 0x2 +#define OTHER_CONF_RIFF 0x4 +#define OTHER_CONF_JPEG 0x8 +#define OTHER_CONF_CRYPTFF 0x10 + +/* Phishing flags */ +#define PHISHING_CONF_ENGINE 0x1 +#define PHISHING_CONF_ENTCONV 0x2 + +struct cli_dconf *cli_dconf_init(void); +void cli_dconf_print(struct cli_dconf *dconf); +int cli_dconf_load(FILE *fd, struct cl_engine **engine, unsigned int options); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/dsig.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/dsig.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/dsig.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/dsig.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2003 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __DSIG_H +#define __DSIG_H + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#ifdef HAVE_GMP +#include + +int cli_versig(const char *md5, const char *dsig); +unsigned char *cli_decodesig(const char *sig, unsigned int plen, mpz_t e, mpz_t n); + +#endif /* HAVE_GMP */ +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/elf.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/elf.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/elf.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/elf.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2005 - 2006 Tomasz Kojm + * + * Header structures based on ELF: Executable and Linkable Format, Portable + * Formats Specification, Version 1.1 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __ELF_H +#define __ELF_H + +#include "cltypes.h" +#include "clamav.h" +#include "execs.h" +#include "others.h" + +struct elf_file_hdr32 { + unsigned char e_ident[16]; + uint16_t e_type; + uint16_t e_machine; + uint32_t e_version; + uint32_t e_entry; + uint32_t e_phoff; + uint32_t e_shoff; + uint32_t e_flags; + uint16_t e_ehsize; + uint16_t e_phentsize; + uint16_t e_phnum; + uint16_t e_shentsize; + uint16_t e_shnum; + uint16_t e_shstrndx; +}; + +struct elf_program_hdr32 { + uint32_t p_type; + uint32_t p_offset; + uint32_t p_vaddr; + uint32_t p_paddr; + uint32_t p_filesz; + uint32_t p_memsz; + uint32_t p_flags; + uint32_t p_align; +}; + +struct elf_section_hdr32 { + uint32_t sh_name; + uint32_t sh_type; + uint32_t sh_flags; + uint32_t sh_addr; + uint32_t sh_offset; + uint32_t sh_size; + uint32_t sh_link; + uint32_t sh_info; + uint32_t sh_addralign; + uint32_t sh_entsize; +}; + +int cli_scanelf(int desc, cli_ctx *ctx); + +int cli_elfheader(int desc, struct cli_exe_info *elfinfo); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/encoding_aliases.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/encoding_aliases.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/encoding_aliases.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/encoding_aliases.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,90 @@ +/* + * HTML Entity & Encoding normalization. + * + * Copyright (C) 2006 T?r?k Edvin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + */ +#ifndef _ENCODING_ALIASES_H +#define _ENCODING_ALIASES_H +#include "clamav-config.h" + + +#include +#include "hashtab.h" + +/* don't change the order of keys, instead use generate_encoding_aliases in contrib/entitynorm. + * You can safely change the values (on the right) */ +static struct element aliases_htable_elements[] = { + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"UTF8", 8}, + {(const unsigned char*)"ISO-10646/UTF-8", 8}, + {NULL, 0}, + {(const unsigned char*)"UTF-16", 1}, + {(const unsigned char*)"UTF16LE", 7}, + {NULL, 0}, + {(const unsigned char*)"UTF-32", 0}, + {(const unsigned char*)"10646-1:1993/UCS4", 0}, + {NULL, 0}, + {(const unsigned char*)"UTF-16LE", 7}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"UCS-4LE", 2}, + {(const unsigned char*)"UCS-4", 0}, + {(const unsigned char*)"UCS2", 1}, + {(const unsigned char*)"UTF-16BE", 6}, + {NULL, 0}, + {(const unsigned char*)"UTF-32LE", 2}, + {NULL, 0}, + {(const unsigned char*)"UTF16BE", 6}, + {(const unsigned char*)"UTF32", 0}, + {(const unsigned char*)"UTF-32BE", 3}, + {(const unsigned char*)"UTF32LE", 2}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"UCS-4BE", 3}, + {(const unsigned char*)"ISO-10646/UCS2", 1}, + {NULL, 0}, + {(const unsigned char*)"10646-1:1993", 0}, + {(const unsigned char*)"ISO-10646/UCS4", 0}, + {(const unsigned char*)"ISO-10646", 0}, + {(const unsigned char*)"UTF-8", 8}, + {(const unsigned char*)"UTF32BE", 3}, + {(const unsigned char*)"ISO-10646/UTF8", 8}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"UCS4", 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, +}; +const struct hashtable aliases_htable = { + aliases_htable_elements, 53, 25, 42 +}; + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/engine.c URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/engine.c?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/engine.c (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/engine.c Wed Jan 30 15:17:10 2008 @@ -0,0 +1,1020 @@ +/*- + * This code is derived from OpenBSD's libc/regex, original license follows: + * + * Copyright (c) 1992, 1993, 1994 Henry Spencer. + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Henry Spencer. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)engine.c 8.5 (Berkeley) 3/20/94 + */ + +/* + * The matching engine and friends. This file is #included by regexec.c + * after suitable #defines of a variety of macros used herein, so that + * different state representations can be used without duplicating masses + * of code. + */ + +#ifdef SNAMES +#define matcher smatcher +#define fast sfast +#define slow sslow +#define dissect sdissect +#define backref sbackref +#define step sstep +#define print sprint +#define at sat +#define match smat +#define nope snope +#endif +#ifdef LNAMES +#define matcher lmatcher +#define fast lfast +#define slow lslow +#define dissect ldissect +#define backref lbackref +#define step lstep +#define print lprint +#define at lat +#define match lmat +#define nope lnope +#endif + +/* another structure passed up and down to avoid zillions of parameters */ +struct match { + struct re_guts *g; + int eflags; + regmatch_t *pmatch; /* [nsub+1] (0 element unused) */ + char *offp; /* offsets work from here */ + char *beginp; /* start of string -- virtual NUL precedes */ + char *endp; /* end of string -- virtual NUL here */ + char *coldp; /* can be no match starting before here */ + char **lastpos; /* [nplus+1] */ + STATEVARS; + states st; /* current states */ + states fresh; /* states for a fresh start */ + states tmp; /* temporary */ + states empty; /* empty set of states */ +}; + +static int matcher(struct re_guts *, char *, size_t, regmatch_t[], int); +static char *dissect(struct match *, char *, char *, sopno, sopno); +static char *backref(struct match *, char *, char *, sopno, sopno, sopno, int); +static char *fast(struct match *, char *, char *, sopno, sopno); +static char *slow(struct match *, char *, char *, sopno, sopno); +static states step(struct re_guts *, sopno, sopno, states, int, states); +#define MAX_RECURSION 100 +#define BOL (OUT+1) +#define EOL (BOL+1) +#define BOLEOL (BOL+2) +#define NOTHING (BOL+3) +#define BOW (BOL+4) +#define EOW (BOL+5) +#define CODEMAX (BOL+5) /* highest code used */ +#define NONCHAR(c) ((c) > CHAR_MAX) +#define NNONCHAR (CODEMAX-CHAR_MAX) +#ifdef REDEBUG +static void print(struct match *, char *, states, int, FILE *); +#endif +#ifdef REDEBUG +static void at(struct match *, char *, char *, char *, sopno, sopno); +#endif +#ifdef REDEBUG +static char *pchar(int); +#endif + +#ifdef REDEBUG +#define SP(t, s, c) print(m, t, s, c, stdout) +#define AT(t, p1, p2, s1, s2) at(m, t, p1, p2, s1, s2) +#define NOTE(str) { if (m->eflags®_TRACE) (void)printf("=%s\n", (str)); } +static int nope = 0; +#else +#define SP(t, s, c) /* nothing */ +#define AT(t, p1, p2, s1, s2) /* nothing */ +#define NOTE(s) /* nothing */ +#endif + +/* + - matcher - the actual matching engine + */ +static int /* 0 success, REG_NOMATCH failure */ +matcher(struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], + int eflags) +{ + char *endp; + size_t i; + struct match mv; + struct match *m = &mv; + char *dp; + const sopno gf = g->firststate+1; /* +1 for OEND */ + const sopno gl = g->laststate; + char *start; + char *stop; + + /* simplify the situation where possible */ + if (g->cflags®_NOSUB) + nmatch = 0; + if (eflags®_STARTEND) { + start = string + pmatch[0].rm_so; + stop = string + pmatch[0].rm_eo; + } else { + start = string; + stop = start + strlen(start); + } + if (stop < start) + return(REG_INVARG); + + /* prescreening; this does wonders for this rather slow code */ + if (g->must != NULL) { + for (dp = start; dp < stop; dp++) + if (*dp == g->must[0] && stop - dp >= g->mlen && + memcmp(dp, g->must, (size_t)g->mlen) == 0) + break; + if (dp == stop) /* we didn't find g->must */ + return(REG_NOMATCH); + } + + /* match struct setup */ + m->g = g; + m->eflags = eflags; + m->pmatch = NULL; + m->lastpos = NULL; + m->offp = string; + m->beginp = start; + m->endp = stop; + STATESETUP(m, 4); + SETUP(m->st); + SETUP(m->fresh); + SETUP(m->tmp); + SETUP(m->empty); + CLEAR(m->empty); + + /* this loop does only one repetition except for backrefs */ + for (;;) { + endp = fast(m, start, stop, gf, gl); + if (endp == NULL) { /* a miss */ + free(m->pmatch); + free(m->lastpos); + STATETEARDOWN(m); + return(REG_NOMATCH); + } + if (nmatch == 0 && !g->backrefs) + break; /* no further info needed */ + + /* where? */ + assert(m->coldp != NULL); + for (;;) { + NOTE("finding start"); + endp = slow(m, m->coldp, stop, gf, gl); + if (endp != NULL) + break; + assert(m->coldp < m->endp); + m->coldp++; + } + if (nmatch == 1 && !g->backrefs) + break; /* no further info needed */ + + /* oh my, he wants the subexpressions... */ + if (m->pmatch == NULL) + m->pmatch = (regmatch_t *)cli_malloc((m->g->nsub + 1) * + sizeof(regmatch_t)); + if (m->pmatch == NULL) { + STATETEARDOWN(m); + return(REG_ESPACE); + } + for (i = 1; i <= m->g->nsub; i++) + m->pmatch[i].rm_so = m->pmatch[i].rm_eo = -1; + if (!g->backrefs && !(m->eflags®_BACKR)) { + NOTE("dissecting"); + dp = dissect(m, m->coldp, endp, gf, gl); + } else { + if (g->nplus > 0 && m->lastpos == NULL) + m->lastpos = (char **)cli_malloc((g->nplus+1) * + sizeof(char *)); + if (g->nplus > 0 && m->lastpos == NULL) { + free(m->pmatch); + STATETEARDOWN(m); + return(REG_ESPACE); + } + NOTE("backref dissect"); + dp = backref(m, m->coldp, endp, gf, gl, (sopno)0, 0); + } + if (dp != NULL) + break; + + /* uh-oh... we couldn't find a subexpression-level match */ + assert(g->backrefs); /* must be back references doing it */ + assert(g->nplus == 0 || m->lastpos != NULL); + for (;;) { + if (dp != NULL || endp <= m->coldp) + break; /* defeat */ + NOTE("backoff"); + endp = slow(m, m->coldp, endp-1, gf, gl); + if (endp == NULL) + break; /* defeat */ + /* try it on a shorter possibility */ +#ifndef NDEBUG + for (i = 1; i <= m->g->nsub; i++) { + assert(m->pmatch[i].rm_so == -1); + assert(m->pmatch[i].rm_eo == -1); + } +#endif + NOTE("backoff dissect"); + dp = backref(m, m->coldp, endp, gf, gl, (sopno)0, 0); + } + assert(dp == NULL || dp == endp); + if (dp != NULL) /* found a shorter one */ + break; + + /* despite initial appearances, there is no match here */ + NOTE("false alarm"); + if (m->coldp == stop) + break; + start = m->coldp + 1; /* recycle starting later */ + } + + /* fill in the details if requested */ + if (nmatch > 0) { + pmatch[0].rm_so = m->coldp - m->offp; + pmatch[0].rm_eo = endp - m->offp; + } + if (nmatch > 1) { + assert(m->pmatch != NULL); + for (i = 1; i < nmatch; i++) + if (i <= m->g->nsub) + pmatch[i] = m->pmatch[i]; + else { + pmatch[i].rm_so = -1; + pmatch[i].rm_eo = -1; + } + } + + if (m->pmatch != NULL) + free((char *)m->pmatch); + if (m->lastpos != NULL) + free((char *)m->lastpos); + STATETEARDOWN(m); + return(0); +} + +/* + - dissect - figure out what matched what, no back references + */ +static char * /* == stop (success) always */ +dissect(struct match *m, char *start, char *stop, sopno startst, sopno stopst) +{ + int i; + sopno ss; /* start sop of current subRE */ + sopno es; /* end sop of current subRE */ + char *sp; /* start of string matched by it */ + char *stp; /* string matched by it cannot pass here */ + char *rest; /* start of rest of string */ + char *tail; /* string unmatched by rest of RE */ + sopno ssub; /* start sop of subsubRE */ + sopno esub; /* end sop of subsubRE */ + char *ssp; /* start of string matched by subsubRE */ + char *sep; /* end of string matched by subsubRE */ + char *oldssp; /* previous ssp */ + char *dp; + + AT("diss", start, stop, startst, stopst); + sp = start; + for (ss = startst; ss < stopst; ss = es) { + /* identify end of subRE */ + es = ss; + switch (OP(m->g->strip[es])) { + case OPLUS_: + case OQUEST_: + es += OPND(m->g->strip[es]); + break; + case OCH_: + while (OP(m->g->strip[es]) != O_CH) + es += OPND(m->g->strip[es]); + break; + } + es++; + + /* figure out what it matched */ + switch (OP(m->g->strip[ss])) { + case OEND: + assert(nope); + break; + case OCHAR: + sp++; + break; + case OBOL: + case OEOL: + case OBOW: + case OEOW: + break; + case OANY: + case OANYOF: + sp++; + break; + case OBACK_: + case O_BACK: + assert(nope); + break; + /* cases where length of match is hard to find */ + case OQUEST_: + stp = stop; + for (;;) { + /* how long could this one be? */ + rest = slow(m, sp, stp, ss, es); + assert(rest != NULL); /* it did match */ + /* could the rest match the rest? */ + tail = slow(m, rest, stop, es, stopst); + if (tail == stop) + break; /* yes! */ + /* no -- try a shorter match for this one */ + stp = rest - 1; + assert(stp >= sp); /* it did work */ + } + ssub = ss + 1; + esub = es - 1; + /* did innards match? */ + if (slow(m, sp, rest, ssub, esub) != NULL) { + dp = dissect(m, sp, rest, ssub, esub); + assert(dp == rest); + } else /* no */ + assert(sp == rest); + sp = rest; + break; + case OPLUS_: + stp = stop; + for (;;) { + /* how long could this one be? */ + rest = slow(m, sp, stp, ss, es); + assert(rest != NULL); /* it did match */ + /* could the rest match the rest? */ + tail = slow(m, rest, stop, es, stopst); + if (tail == stop) + break; /* yes! */ + /* no -- try a shorter match for this one */ + stp = rest - 1; + assert(stp >= sp); /* it did work */ + } + ssub = ss + 1; + esub = es - 1; + ssp = sp; + oldssp = ssp; + for (;;) { /* find last match of innards */ + sep = slow(m, ssp, rest, ssub, esub); + if (sep == NULL || sep == ssp) + break; /* failed or matched null */ + oldssp = ssp; /* on to next try */ + ssp = sep; + } + if (sep == NULL) { + /* last successful match */ + sep = ssp; + ssp = oldssp; + } + assert(sep == rest); /* must exhaust substring */ + assert(slow(m, ssp, sep, ssub, esub) == rest); + dp = dissect(m, ssp, sep, ssub, esub); + assert(dp == sep); + sp = rest; + break; + case OCH_: + stp = stop; + for (;;) { + /* how long could this one be? */ + rest = slow(m, sp, stp, ss, es); + assert(rest != NULL); /* it did match */ + /* could the rest match the rest? */ + tail = slow(m, rest, stop, es, stopst); + if (tail == stop) + break; /* yes! */ + /* no -- try a shorter match for this one */ + stp = rest - 1; + assert(stp >= sp); /* it did work */ + } + ssub = ss + 1; + esub = ss + OPND(m->g->strip[ss]) - 1; + assert(OP(m->g->strip[esub]) == OOR1); + for (;;) { /* find first matching branch */ + if (slow(m, sp, rest, ssub, esub) == rest) + break; /* it matched all of it */ + /* that one missed, try next one */ + assert(OP(m->g->strip[esub]) == OOR1); + esub++; + assert(OP(m->g->strip[esub]) == OOR2); + ssub = esub + 1; + esub += OPND(m->g->strip[esub]); + if (OP(m->g->strip[esub]) == OOR2) + esub--; + else + assert(OP(m->g->strip[esub]) == O_CH); + } + dp = dissect(m, sp, rest, ssub, esub); + assert(dp == rest); + sp = rest; + break; + case O_PLUS: + case O_QUEST: + case OOR1: + case OOR2: + case O_CH: + assert(nope); + break; + case OLPAREN: + i = OPND(m->g->strip[ss]); + assert(0 < i && i <= m->g->nsub); + m->pmatch[i].rm_so = sp - m->offp; + break; + case ORPAREN: + i = OPND(m->g->strip[ss]); + assert(0 < i && i <= m->g->nsub); + m->pmatch[i].rm_eo = sp - m->offp; + break; + default: /* uh oh */ + assert(nope); + break; + } + } + + assert(sp == stop); + return(sp); +} + +/* + - backref - figure out what matched what, figuring in back references + */ +static char * /* == stop (success) or NULL (failure) */ +backref(struct match *m, char *start, char *stop, sopno startst, sopno stopst, + sopno lev, int rec) /* PLUS nesting level */ +{ + int i; + sopno ss; /* start sop of current subRE */ + char *sp; /* start of string matched by it */ + sopno ssub; /* start sop of subsubRE */ + sopno esub; /* end sop of subsubRE */ + char *ssp; /* start of string matched by subsubRE */ + char *dp; + size_t len; + int hard; + sop s; + regoff_t offsave; + cset *cs; + + AT("back", start, stop, startst, stopst); + sp = start; + + /* get as far as we can with easy stuff */ + hard = 0; + for (ss = startst; !hard && ss < stopst; ss++) + switch (OP(s = m->g->strip[ss])) { + case OCHAR: + if (sp == stop || *sp++ != (char)OPND(s)) + return(NULL); + break; + case OANY: + if (sp == stop) + return(NULL); + sp++; + break; + case OANYOF: + cs = &m->g->sets[OPND(s)]; + if (sp == stop || !CHIN(cs, *sp++)) + return(NULL); + break; + case OBOL: + if ( (sp == m->beginp && !(m->eflags®_NOTBOL)) || + (sp < m->endp && *(sp-1) == '\n' && + (m->g->cflags®_NEWLINE)) ) + { /* yes */ } + else + return(NULL); + break; + case OEOL: + if ( (sp == m->endp && !(m->eflags®_NOTEOL)) || + (sp < m->endp && *sp == '\n' && + (m->g->cflags®_NEWLINE)) ) + { /* yes */ } + else + return(NULL); + break; + case OBOW: + if (( (sp == m->beginp && !(m->eflags®_NOTBOL)) || + (sp < m->endp && *(sp-1) == '\n' && + (m->g->cflags®_NEWLINE)) || + (sp > m->beginp && + !ISWORD(*(sp-1))) ) && + (sp < m->endp && ISWORD(*sp)) ) + { /* yes */ } + else + return(NULL); + break; + case OEOW: + if (( (sp == m->endp && !(m->eflags®_NOTEOL)) || + (sp < m->endp && *sp == '\n' && + (m->g->cflags®_NEWLINE)) || + (sp < m->endp && !ISWORD(*sp)) ) && + (sp > m->beginp && ISWORD(*(sp-1))) ) + { /* yes */ } + else + return(NULL); + break; + case O_QUEST: + break; + case OOR1: /* matches null but needs to skip */ + ss++; + s = m->g->strip[ss]; + do { + assert(OP(s) == OOR2); + ss += OPND(s); + } while (OP(s = m->g->strip[ss]) != O_CH); + /* note that the ss++ gets us past the O_CH */ + break; + default: /* have to make a choice */ + hard = 1; + break; + } + if (!hard) { /* that was it! */ + if (sp != stop) + return(NULL); + return(sp); + } + ss--; /* adjust for the for's final increment */ + + /* the hard stuff */ + AT("hard", sp, stop, ss, stopst); + s = m->g->strip[ss]; + switch (OP(s)) { + case OBACK_: /* the vilest depths */ + i = OPND(s); + assert(0 < i && i <= m->g->nsub); + if (m->pmatch[i].rm_eo == -1) + return(NULL); + assert(m->pmatch[i].rm_so != -1); + len = m->pmatch[i].rm_eo - m->pmatch[i].rm_so; + if (len == 0 && rec++ > MAX_RECURSION) + return(NULL); + assert(stop - m->beginp >= len); + if (sp > stop - len) + return(NULL); /* not enough left to match */ + ssp = m->offp + m->pmatch[i].rm_so; + if (memcmp(sp, ssp, len) != 0) + return(NULL); + while (m->g->strip[ss] != SOP(O_BACK, i)) + ss++; + return(backref(m, sp+len, stop, ss+1, stopst, lev, rec)); + break; + case OQUEST_: /* to null or not */ + dp = backref(m, sp, stop, ss+1, stopst, lev, rec); + if (dp != NULL) + return(dp); /* not */ + return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev, rec)); + break; + case OPLUS_: + assert(m->lastpos != NULL); + assert(lev+1 <= m->g->nplus); + m->lastpos[lev+1] = sp; + return(backref(m, sp, stop, ss+1, stopst, lev+1, rec)); + break; + case O_PLUS: + if (sp == m->lastpos[lev]) /* last pass matched null */ + return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); + /* try another pass */ + m->lastpos[lev] = sp; + dp = backref(m, sp, stop, ss-OPND(s)+1, stopst, lev, rec); + if (dp == NULL) + return(backref(m, sp, stop, ss+1, stopst, lev-1, rec)); + else + return(dp); + break; + case OCH_: /* find the right one, if any */ + ssub = ss + 1; + esub = ss + OPND(s) - 1; + assert(OP(m->g->strip[esub]) == OOR1); + for (;;) { /* find first matching branch */ + dp = backref(m, sp, stop, ssub, esub, lev, rec); + if (dp != NULL) + return(dp); + /* that one missed, try next one */ + if (OP(m->g->strip[esub]) == O_CH) + return(NULL); /* there is none */ + esub++; + assert(OP(m->g->strip[esub]) == OOR2); + ssub = esub + 1; + esub += OPND(m->g->strip[esub]); + if (OP(m->g->strip[esub]) == OOR2) + esub--; + else + assert(OP(m->g->strip[esub]) == O_CH); + } + break; + case OLPAREN: /* must undo assignment if rest fails */ + i = OPND(s); + assert(0 < i && i <= m->g->nsub); + offsave = m->pmatch[i].rm_so; + m->pmatch[i].rm_so = sp - m->offp; + dp = backref(m, sp, stop, ss+1, stopst, lev, rec); + if (dp != NULL) + return(dp); + m->pmatch[i].rm_so = offsave; + return(NULL); + break; + case ORPAREN: /* must undo assignment if rest fails */ + i = OPND(s); + assert(0 < i && i <= m->g->nsub); + offsave = m->pmatch[i].rm_eo; + m->pmatch[i].rm_eo = sp - m->offp; + dp = backref(m, sp, stop, ss+1, stopst, lev, rec); + if (dp != NULL) + return(dp); + m->pmatch[i].rm_eo = offsave; + return(NULL); + break; + default: /* uh oh */ + assert(nope); + break; + } + + /* "can't happen" */ + assert(nope); + /* NOTREACHED */ +} + +/* + - fast - step through the string at top speed + */ +static char * /* where tentative match ended, or NULL */ +fast(struct match *m, char *start, char *stop, sopno startst, sopno stopst) +{ + states st = m->st; + states fresh = m->fresh; + states tmp = m->tmp; + char *p = start; + int c = (start == m->beginp) ? OUT : *(start-1); + int lastc; /* previous c */ + int flagch; + int i; + char *coldp; /* last p after which no match was underway */ + + CLEAR(st); + SET1(st, startst); + st = step(m->g, startst, stopst, st, NOTHING, st); + ASSIGN(fresh, st); + SP("start", st, *p); + coldp = NULL; + for (;;) { + /* next character */ + lastc = c; + c = (p == m->endp) ? OUT : *p; + if (EQ(st, fresh)) + coldp = p; + + /* is there an EOL and/or BOL between lastc and c? */ + flagch = '\0'; + i = 0; + if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || + (lastc == OUT && !(m->eflags®_NOTBOL)) ) { + flagch = BOL; + i = m->g->nbol; + } + if ( (c == '\n' && m->g->cflags®_NEWLINE) || + (c == OUT && !(m->eflags®_NOTEOL)) ) { + flagch = (flagch == BOL) ? BOLEOL : EOL; + i += m->g->neol; + } + if (i != 0) { + for (; i > 0; i--) + st = step(m->g, startst, stopst, st, flagch, st); + SP("boleol", st, c); + } + + /* how about a word boundary? */ + if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && + (c != OUT && ISWORD(c)) ) { + flagch = BOW; + } + if ( (lastc != OUT && ISWORD(lastc)) && + (flagch == EOL || (c != OUT && !ISWORD(c))) ) { + flagch = EOW; + } + if (flagch == BOW || flagch == EOW) { + st = step(m->g, startst, stopst, st, flagch, st); + SP("boweow", st, c); + } + + /* are we done? */ + if (ISSET(st, stopst) || p == stop) + break; /* NOTE BREAK OUT */ + + /* no, we must deal with this character */ + ASSIGN(tmp, st); + ASSIGN(st, fresh); + assert(c != OUT); + st = step(m->g, startst, stopst, tmp, c, st); + SP("aft", st, c); + assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); + p++; + } + + assert(coldp != NULL); + m->coldp = coldp; + if (ISSET(st, stopst)) + return(p+1); + else + return(NULL); +} + +/* + - slow - step through the string more deliberately + */ +static char * /* where it ended */ +slow(struct match *m, char *start, char *stop, sopno startst, sopno stopst) +{ + states st = m->st; + states empty = m->empty; + states tmp = m->tmp; + char *p = start; + int c = (start == m->beginp) ? OUT : *(start-1); + int lastc; /* previous c */ + int flagch; + int i; + char *matchp; /* last p at which a match ended */ + + AT("slow", start, stop, startst, stopst); + CLEAR(st); + SET1(st, startst); + SP("sstart", st, *p); + st = step(m->g, startst, stopst, st, NOTHING, st); + matchp = NULL; + for (;;) { + /* next character */ + lastc = c; + c = (p == m->endp) ? OUT : *p; + + /* is there an EOL and/or BOL between lastc and c? */ + flagch = '\0'; + i = 0; + if ( (lastc == '\n' && m->g->cflags®_NEWLINE) || + (lastc == OUT && !(m->eflags®_NOTBOL)) ) { + flagch = BOL; + i = m->g->nbol; + } + if ( (c == '\n' && m->g->cflags®_NEWLINE) || + (c == OUT && !(m->eflags®_NOTEOL)) ) { + flagch = (flagch == BOL) ? BOLEOL : EOL; + i += m->g->neol; + } + if (i != 0) { + for (; i > 0; i--) + st = step(m->g, startst, stopst, st, flagch, st); + SP("sboleol", st, c); + } + + /* how about a word boundary? */ + if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) && + (c != OUT && ISWORD(c)) ) { + flagch = BOW; + } + if ( (lastc != OUT && ISWORD(lastc)) && + (flagch == EOL || (c != OUT && !ISWORD(c))) ) { + flagch = EOW; + } + if (flagch == BOW || flagch == EOW) { + st = step(m->g, startst, stopst, st, flagch, st); + SP("sboweow", st, c); + } + + /* are we done? */ + if (ISSET(st, stopst)) + matchp = p; + if (EQ(st, empty) || p == stop) + break; /* NOTE BREAK OUT */ + + /* no, we must deal with this character */ + ASSIGN(tmp, st); + ASSIGN(st, empty); + assert(c != OUT); + st = step(m->g, startst, stopst, tmp, c, st); + SP("saft", st, c); + assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st)); + p++; + } + + return(matchp); +} + + +/* + - step - map set of states reachable before char to set reachable after + */ +static states +step(struct re_guts *g, + sopno start, /* start state within strip */ + sopno stop, /* state after stop state within strip */ + states bef, /* states reachable before */ + int ch, /* character or NONCHAR code */ + states aft) /* states already known reachable after */ +{ + cset *cs; + sop s; + sopno pc; + onestate here; /* note, macros know this name */ + sopno look; + int i; + + for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) { + s = g->strip[pc]; + switch (OP(s)) { + case OEND: + assert(pc == stop-1); + break; + case OCHAR: + /* only characters can match */ + assert(!NONCHAR(ch) || ch != (char)OPND(s)); + if (ch == (char)OPND(s)) + FWD(aft, bef, 1); + break; + case OBOL: + if (ch == BOL || ch == BOLEOL) + FWD(aft, bef, 1); + break; + case OEOL: + if (ch == EOL || ch == BOLEOL) + FWD(aft, bef, 1); + break; + case OBOW: + if (ch == BOW) + FWD(aft, bef, 1); + break; + case OEOW: + if (ch == EOW) + FWD(aft, bef, 1); + break; + case OANY: + if (!NONCHAR(ch)) + FWD(aft, bef, 1); + break; + case OANYOF: + cs = &g->sets[OPND(s)]; + if (!NONCHAR(ch) && CHIN(cs, ch)) + FWD(aft, bef, 1); + break; + case OBACK_: /* ignored here */ + case O_BACK: + FWD(aft, aft, 1); + break; + case OPLUS_: /* forward, this is just an empty */ + FWD(aft, aft, 1); + break; + case O_PLUS: /* both forward and back */ + FWD(aft, aft, 1); + i = ISSETBACK(aft, OPND(s)); + BACK(aft, aft, OPND(s)); + if (!i && ISSETBACK(aft, OPND(s))) { + /* oho, must reconsider loop body */ + pc -= OPND(s) + 1; + INIT(here, pc); + } + break; + case OQUEST_: /* two branches, both forward */ + FWD(aft, aft, 1); + FWD(aft, aft, OPND(s)); + break; + case O_QUEST: /* just an empty */ + FWD(aft, aft, 1); + break; + case OLPAREN: /* not significant here */ + case ORPAREN: + FWD(aft, aft, 1); + break; + case OCH_: /* mark the first two branches */ + FWD(aft, aft, 1); + assert(OP(g->strip[pc+OPND(s)]) == OOR2); + FWD(aft, aft, OPND(s)); + break; + case OOR1: /* done a branch, find the O_CH */ + if (ISSTATEIN(aft, here)) { + for (look = 1; + OP(s = g->strip[pc+look]) != O_CH; + look += OPND(s)) + assert(OP(s) == OOR2); + FWD(aft, aft, look); + } + break; + case OOR2: /* propagate OCH_'s marking */ + FWD(aft, aft, 1); + if (OP(g->strip[pc+OPND(s)]) != O_CH) { + assert(OP(g->strip[pc+OPND(s)]) == OOR2); + FWD(aft, aft, OPND(s)); + } + break; + case O_CH: /* just empty */ + FWD(aft, aft, 1); + break; + default: /* ooooops... */ + assert(nope); + break; + } + } + + return(aft); +} + +#ifdef REDEBUG +/* + - print - print a set of states + */ +static void +print(struct match *m, char *caption, states st, int ch, FILE *d) +{ + struct re_guts *g = m->g; + int i; + int first = 1; + + if (!(m->eflags®_TRACE)) + return; + + (void)fprintf(d, "%s", caption); + if (ch != '\0') + (void)fprintf(d, " %s", pchar(ch)); + for (i = 0; i < g->nstates; i++) + if (ISSET(st, i)) { + (void)fprintf(d, "%s%d", (first) ? "\t" : ", ", i); + first = 0; + } + (void)fprintf(d, "\n"); +} + +/* + - at - print current situation + */ +static void +at(struct match *m, char *title, char *start, char *stop, sopno startst, + sopno stopst) +{ + if (!(m->eflags®_TRACE)) + return; + + (void)printf("%s %s-", title, pchar(*start)); + (void)printf("%s ", pchar(*stop)); + (void)printf("%ld-%ld\n", (long)startst, (long)stopst); +} + +#ifndef PCHARDONE +#define PCHARDONE /* never again */ +/* + - pchar - make a character printable + * + * Is this identical to regchar() over in debug.c? Well, yes. But a + * duplicate here avoids having a debugging-capable regexec.o tied to + * a matching debug.o, and this is convenient. It all disappears in + * the non-debug compilation anyway, so it doesn't matter much. + */ +static char * /* -> representation */ +pchar(int ch) +{ + static char pbuf[10]; + + if (isprint(ch) || ch == ' ') + (void)snprintf(pbuf, sizeof pbuf, "%c", ch); + else + (void)snprintf(pbuf, sizeof pbuf, "\\%o", ch); + return(pbuf); +} +#endif +#endif + +#undef matcher +#undef fast +#undef slow +#undef dissect +#undef backref +#undef step +#undef print +#undef at +#undef match +#undef nope Added: test-suite/trunk/MultiSource/Applications/ClamAV/entconv.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/entconv.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/entconv.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/entconv.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,87 @@ +/* + * HTML Entity & Encoding normalization. + * + * Copyright (C) 2006 T?r?k Edvin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + */ + +#ifndef _ENTITIES_H +#define _ENTITIES_H +#include "cltypes.h" + +#include "hashtab.h" + +#define UCS4_1234 (const unsigned char*)"UCS-4LE" +#define UCS4_4321 (const unsigned char*)"UCS-4BE" +#define UCS4_2143 (const unsigned char*)"UCS4" +#define UCS4_3412 (const unsigned char*)"UCS-4" +#define UTF16_BE (const unsigned char*)"UTF-16BE" +#define UTF16_LE (const unsigned char*)"UTF-16LE" +#define UTF8 (const unsigned char*)"UTF-8" +#define UNDECIDED_32_1234 UCS4_1234 +#define UNDECIDED_32_4321 UCS4_4321 +#define UNDECIDED_32_2143 UCS4_2143 +#define UNDECIDED_32_3412 UCS4_3412 +#define UNDECIDED_16_BE UTF16_BE +#define UNDECIDED_16_LE UTF16_LE +#define UNDECIDED_8 (const unsigned char*)"ISO-8859-1" +#define EBCDIC (const unsigned char*)"EBCDIC-US" +#define UNKNOWN (const unsigned char*)"\0" +#define OTHER (const unsigned char*)"OTHER" + +enum encoding_priority {NOPRIO,CONTENT_TYPE,BOM,NOBOM_AUTODETECT,XML_CHARSET,META}; + +enum encodings {E_UCS4,E_UTF16,E_UCS4_1234,E_UCS4_4321,E_UCS4_2134,E_UCS4_3412,E_UTF16_BE,E_UTF16_LE,E_UTF8,E_UNKNOWN,E_OTHER}; +#define MAX_ENTITY_SIZE 22 + +struct entity_conv { + unsigned char* encoding; + const unsigned char* autodetected; + enum encoding_priority priority; + unsigned short int encoding_specific;/* sub-encoding, used for ISO*/ + const struct hashtable* ht; + uint8_t has_bom; + uint8_t enc_bytes; + uint8_t bytes_read; + uint8_t bom_cnt; + uint32_t partial; + unsigned char bom[4]; +#if 0 + char* buffer; + char* buffer2; +#endif + size_t buffer_size; + size_t buffer_cnt; + uint8_t entity_buffcnt; + char entity_buff[MAX_ENTITY_SIZE+2]; + m_area_t tmp_area; + m_area_t out_area; + m_area_t norm_area; + int msg_zero_shown; +}; + + +int init_entity_converter(struct entity_conv* conv,const unsigned char* encoding,size_t buffer_size); +void process_encoding_set(struct entity_conv* conv,const unsigned char* encoding,enum encoding_priority priority); +int entity_norm_done(struct entity_conv* conv); + +unsigned char* encoding_norm_readline(struct entity_conv* conv, FILE* stream_in, m_area_t* in_m_area, const size_t maxlen); +unsigned char* entity_norm(const struct entity_conv* conv,const unsigned char* entity); +int entitynorm_init(void); + +#endif + Added: test-suite/trunk/MultiSource/Applications/ClamAV/entitylist.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/entitylist.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/entitylist.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/entitylist.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,3086 @@ +/* TODO: include GPL headers */ +#include +static struct element entities_htable_elements[] = { + {(const unsigned char*)"varpropto", 8733}, + {(const unsigned char*)"ncong", 8775}, + {(const unsigned char*)"grave", 96}, + {NULL, 0}, + {(const unsigned char*)"toea", 10536}, + {(const unsigned char*)"map", 8614}, + {(const unsigned char*)"nap", 8777}, + {(const unsigned char*)"lap", 10885}, + {NULL, 0}, + {(const unsigned char*)"gap", 10886}, + {NULL, 0}, + {(const unsigned char*)"twoheadrightarrow", 8608}, + {NULL, 0}, + {(const unsigned char*)"Ll", 8920}, + {(const unsigned char*)"amalg", 10815}, + {(const unsigned char*)"geqslant", 10878}, + {NULL, 0}, + {(const unsigned char*)"origof", 8886}, + {(const unsigned char*)"Tab", 9}, + {NULL, 0}, + {(const unsigned char*)"leqslant", 10877}, + {(const unsigned char*)"asympeq", 8781}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sext", 10038}, + {(const unsigned char*)"Wedge", 8896}, + {(const unsigned char*)"sqcap", 8851}, + {(const unsigned char*)"loang", 12312}, + {(const unsigned char*)"ngeq", 8817}, + {NULL, 0}, + {(const unsigned char*)"NotLessTilde", 8820}, + {(const unsigned char*)"nwArr", 8662}, + {NULL, 0}, + {(const unsigned char*)"roang", 12313}, + {(const unsigned char*)"Delta", 916}, + {NULL, 0}, + {(const unsigned char*)"swArr", 8665}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DifferentialD", 8518}, + {(const unsigned char*)"gl", 8823}, + {(const unsigned char*)"loz", 9674}, + {(const unsigned char*)"Prime", 8243}, + {(const unsigned char*)"ShortRightArrow", 8594}, + {(const unsigned char*)"sigmaf", 962}, + {(const unsigned char*)"ll", 8810}, + {(const unsigned char*)"rx", 8478}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"circledS", 9416}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"notni", 8716}, + {NULL, 0}, + {(const unsigned char*)"wedge", 8743}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rightrightarrows", 8649}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"delta", 948}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ffllig", 64260}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Bernoullis", 8492}, + {(const unsigned char*)"djcy", 1106}, + {NULL, 0}, + {(const unsigned char*)"gjcy", 1107}, + {(const unsigned char*)"prime", 8242}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"kjcy", 1116}, + {(const unsigned char*)"ljcy", 1113}, + {(const unsigned char*)"lmoustache", 9136}, + {(const unsigned char*)"njcy", 1114}, + {(const unsigned char*)"boxDl", 9558}, + {(const unsigned char*)"clubs", 9827}, + {(const unsigned char*)"Integral", 8747}, + {NULL, 0}, + {(const unsigned char*)"rmoustache", 9137}, + {(const unsigned char*)"sol", 47}, + {(const unsigned char*)"SquareSubset", 8847}, + {NULL, 0}, + {(const unsigned char*)"rect", 9645}, + {(const unsigned char*)"sect", 167}, + {(const unsigned char*)"VeryThinSpace", 8202}, + {(const unsigned char*)"lesssim", 8818}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"UnderBrace", 65080}, + {NULL, 0}, + {(const unsigned char*)"comp", 8705}, + {(const unsigned char*)"mapstoup", 8613}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"circ", 710}, + {(const unsigned char*)"complement", 8705}, + {(const unsigned char*)"flat", 9837}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LowerLeftArrow", 8601}, + {NULL, 0}, + {(const unsigned char*)"cuesc", 8927}, + {(const unsigned char*)"sce", 10928}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"euro", 8364}, + {(const unsigned char*)"succcurlyeq", 8829}, + {(const unsigned char*)"LeftCeiling", 8968}, + {(const unsigned char*)"vprop", 8733}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nexists", 8708}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"pitchfork", 8916}, + {(const unsigned char*)"darr2", 8650}, + {NULL, 0}, + {(const unsigned char*)"Ubrcy", 1038}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sqsupe", 8850}, + {(const unsigned char*)"eparsl", 10723}, + {NULL, 0}, + {(const unsigned char*)"larr2", 8647}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LeftUpVectorBar", 10584}, + {(const unsigned char*)"sqsupseteq", 8850}, + {NULL, 0}, + {(const unsigned char*)"rarr2", 8649}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"uarr2", 8648}, + {(const unsigned char*)"veeeq", 8794}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"AElig", 198}, + {(const unsigned char*)"notnivb", 8958}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"plusb", 8862}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DoubleRightTee", 8872}, + {(const unsigned char*)"NotSquareSupersetEqual", 8931}, + {(const unsigned char*)"hookrightarrow", 8618}, + {(const unsigned char*)"ubrcy", 1118}, + {NULL, 0}, + {(const unsigned char*)"OElig", 338}, + {NULL, 0}, + {(const unsigned char*)"NotGreaterTilde", 8821}, + {(const unsigned char*)"filig", 64257}, + {(const unsigned char*)"nlt", 8814}, + {(const unsigned char*)"Agr", 913}, + {(const unsigned char*)"GreaterEqual", 8805}, + {(const unsigned char*)"mldr", 8230}, + {(const unsigned char*)"nldr", 8229}, + {(const unsigned char*)"drcrop", 8972}, + {(const unsigned char*)"Dgr", 916}, + {(const unsigned char*)"Bgr", 914}, + {(const unsigned char*)"Igr", 921}, + {(const unsigned char*)"angmsd", 8737}, + {(const unsigned char*)"trie", 8796}, + {(const unsigned char*)"Kgr", 922}, + {(const unsigned char*)"Ggr", 915}, + {(const unsigned char*)"Mgr", 924}, + {(const unsigned char*)"Egr", 917}, + {(const unsigned char*)"Ogr", 927}, + {(const unsigned char*)"Ngr", 925}, + {(const unsigned char*)"Lgr", 923}, + {(const unsigned char*)"Pgr", 928}, + {(const unsigned char*)"Sgr", 931}, + {(const unsigned char*)"cong", 8773}, + {(const unsigned char*)"doteqdot", 8785}, + {(const unsigned char*)"urcrop", 8974}, + {(const unsigned char*)"Rgr", 929}, + {(const unsigned char*)"Xgr", 926}, + {(const unsigned char*)"Tgr", 932}, + {(const unsigned char*)"Ugr", 933}, + {NULL, 0}, + {(const unsigned char*)"nless", 8814}, + {(const unsigned char*)"LeftTee", 8867}, + {(const unsigned char*)"OverBar", 175}, + {(const unsigned char*)"Zgr", 918}, + {(const unsigned char*)"agr", 945}, + {(const unsigned char*)"bgr", 946}, + {(const unsigned char*)"phis", 981}, + {(const unsigned char*)"dgr", 948}, + {(const unsigned char*)"intlarhk", 10775}, + {(const unsigned char*)"boxplus", 8862}, + {(const unsigned char*)"ggr", 947}, + {(const unsigned char*)"egr", 949}, + {(const unsigned char*)"nrtrie", 8941}, + {(const unsigned char*)"rdldhar", 10601}, + {(const unsigned char*)"lrcorner", 8991}, + {(const unsigned char*)"igr", 953}, + {(const unsigned char*)"lgr", 955}, + {(const unsigned char*)"lhblk", 9604}, + {(const unsigned char*)"ngr", 957}, + {(const unsigned char*)"mgr", 956}, + {(const unsigned char*)"kgr", 954}, + {(const unsigned char*)"ogr", 959}, + {(const unsigned char*)"urcorner", 8989}, + {(const unsigned char*)"sgr", 963}, + {(const unsigned char*)"boxUL", 9565}, + {(const unsigned char*)"npolint", 10772}, + {(const unsigned char*)"uhblk", 9600}, + {(const unsigned char*)"rgr", 961}, + {(const unsigned char*)"curarrm", 10556}, + {(const unsigned char*)"pgr", 960}, + {(const unsigned char*)"ruluhar", 10600}, + {(const unsigned char*)"lbbrk", 12308}, + {(const unsigned char*)"zgr", 950}, + {(const unsigned char*)"tgr", 964}, + {(const unsigned char*)"ugr", 965}, + {NULL, 0}, + {(const unsigned char*)"rbbrk", 12309}, + {(const unsigned char*)"profline", 8978}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rlm", 8207}, + {(const unsigned char*)"OverBrace", 65079}, + {(const unsigned char*)"xgr", 958}, + {(const unsigned char*)"lsaquo", 8249}, + {NULL, 0}, + {(const unsigned char*)"nwarrow", 8598}, + {(const unsigned char*)"Equilibrium", 8652}, + {NULL, 0}, + {(const unsigned char*)"rsaquo", 8250}, + {NULL, 0}, + {(const unsigned char*)"swarrow", 8601}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"prec", 8826}, + {(const unsigned char*)"ltrie", 8884}, + {(const unsigned char*)"dharl", 8643}, + {(const unsigned char*)"shortmid", 8739}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nleftrightarrow", 8622}, + {(const unsigned char*)"rtrie", 8885}, + {(const unsigned char*)"Im", 8465}, + {(const unsigned char*)"frown", 8994}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"pertenk", 8241}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lessgtr", 8822}, + {(const unsigned char*)"bigvee", 8897}, + {(const unsigned char*)"supseteq", 8839}, + {(const unsigned char*)"uharl", 8639}, + {NULL, 0}, + {(const unsigned char*)"Longrightarrow", 10233}, + {(const unsigned char*)"lrarr2", 8646}, + {NULL, 0}, + {(const unsigned char*)"wreath", 8768}, + {NULL, 0}, + {(const unsigned char*)"Updownarrow", 8661}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lessdot", 8918}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nlArr", 8653}, + {(const unsigned char*)"SOFTcy", 1068}, + {NULL, 0}, + {(const unsigned char*)"Barwed", 8966}, + {(const unsigned char*)"upharpoonleft", 8639}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"FilledVerySmallSquare", 9642}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"coprod", 8720}, + {(const unsigned char*)"pm", 177}, + {NULL, 0}, + {(const unsigned char*)"nLeftarrow", 8653}, + {NULL, 0}, + {(const unsigned char*)"DScy", 1029}, + {(const unsigned char*)"xlArr", 10232}, + {(const unsigned char*)"longrightarrow", 10230}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"subseteq", 8838}, + {NULL, 0}, + {(const unsigned char*)"updownarrow", 8597}, + {(const unsigned char*)"bsime", 8909}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"supsetneq", 8843}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"frac56", 8538}, + {NULL, 0}, + {(const unsigned char*)"TScy", 1062}, + {NULL, 0}, + {(const unsigned char*)"zeetrf", 8488}, + {(const unsigned char*)"ogon", 731}, + {(const unsigned char*)"barwed", 8965}, + {(const unsigned char*)"nsime", 8772}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lEg", 10891}, + {(const unsigned char*)"lrhar", 8651}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxminus", 8863}, + {(const unsigned char*)"ape", 8778}, + {NULL, 0}, + {(const unsigned char*)"divonx", 8903}, + {(const unsigned char*)"hksearow", 10533}, + {(const unsigned char*)"boxhD", 9573}, + {(const unsigned char*)"NotLessEqual", 8816}, + {(const unsigned char*)"ang90", 8735}, + {(const unsigned char*)"sstarf", 8902}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"subsetneq", 8842}, + {(const unsigned char*)"Darr", 8609}, + {NULL, 0}, + {(const unsigned char*)"curarr", 8631}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"real", 8476}, + {(const unsigned char*)"Larr", 8606}, + {(const unsigned char*)"CircleDot", 8857}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"CircleTimes", 8855}, + {(const unsigned char*)"Rarr", 8608}, + {(const unsigned char*)"varpi", 982}, + {(const unsigned char*)"SuchThat", 8715}, + {(const unsigned char*)"Uarr", 8607}, + {(const unsigned char*)"smeparsl", 10724}, + {NULL, 0}, + {(const unsigned char*)"orslope", 10839}, + {(const unsigned char*)"cuwed", 8911}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Breve", 728}, + {(const unsigned char*)"nwarr", 8598}, + {NULL, 0}, + {(const unsigned char*)"orv", 10843}, + {(const unsigned char*)"zwj", 8205}, + {(const unsigned char*)"swarr", 8601}, + {NULL, 0}, + {(const unsigned char*)"darr", 8595}, + {(const unsigned char*)"gtrdot", 8919}, + {(const unsigned char*)"precneqq", 10933}, + {(const unsigned char*)"LessGreater", 8822}, + {(const unsigned char*)"harr", 8596}, + {(const unsigned char*)"UpperLeftArrow", 8598}, + {(const unsigned char*)"Verbar", 8214}, + {(const unsigned char*)"harrw", 8621}, + {(const unsigned char*)"TildeTilde", 8776}, + {(const unsigned char*)"larr", 8592}, + {NULL, 0}, + {(const unsigned char*)"succsim", 8831}, + {(const unsigned char*)"rarrw", 8605}, + {NULL, 0}, + {(const unsigned char*)"rarr", 8594}, + {(const unsigned char*)"prnE", 10933}, + {(const unsigned char*)"Hat", 94}, + {(const unsigned char*)"uarr", 8593}, + {(const unsigned char*)"varr", 8597}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxvR", 9566}, + {NULL, 0}, + {(const unsigned char*)"micro", 181}, + {(const unsigned char*)"breve", 728}, + {NULL, 0}, + {(const unsigned char*)"nequiv", 8802}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"verbar", 124}, + {(const unsigned char*)"lopar", 10629}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"frac35", 8535}, + {(const unsigned char*)"RightArrow", 8594}, + {(const unsigned char*)"copy", 169}, + {(const unsigned char*)"ropar", 10630}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nsubseteq", 8840}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nvlArr", 10498}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"setminus", 8726}, + {(const unsigned char*)"boxvH", 9578}, + {(const unsigned char*)"doteq", 8784}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"vartriangleleft", 8882}, + {NULL, 0}, + {(const unsigned char*)"RightTriangleBar", 10704}, + {(const unsigned char*)"shy", 173}, + {(const unsigned char*)"RightUpVectorBar", 10580}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Kappa", 922}, + {NULL, 0}, + {(const unsigned char*)"leftrightarrows", 8646}, + {(const unsigned char*)"sqsupset", 8848}, + {(const unsigned char*)"rationals", 8474}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"cent", 162}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lobrk", 12314}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"OverBracket", 9140}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"robrk", 12315}, + {(const unsigned char*)"Fouriertrf", 8497}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"blacktriangleleft", 9666}, + {(const unsigned char*)"bumpe", 8783}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"kappa", 954}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"weierp", 8472}, + {NULL, 0}, + {(const unsigned char*)"intcal", 8890}, + {(const unsigned char*)"rarrc", 10547}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"iiint", 8749}, + {NULL, 0}, + {(const unsigned char*)"boxdr", 9484}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"percnt", 37}, + {(const unsigned char*)"top", 8868}, + {NULL, 0}, + {(const unsigned char*)"ffilig", 64259}, + {(const unsigned char*)"notnivc", 8957}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"diams", 9830}, + {NULL, 0}, + {(const unsigned char*)"maltese", 10016}, + {(const unsigned char*)"vartriangleright", 8883}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"OverParenthesis", 65077}, + {(const unsigned char*)"nesear", 10536}, + {(const unsigned char*)"LessFullEqual", 8806}, + {NULL, 0}, + {(const unsigned char*)"UpDownArrow", 8597}, + {(const unsigned char*)"measuredangle", 8737}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Leftarrow", 8656}, + {(const unsigned char*)"HumpDownHump", 8782}, + {(const unsigned char*)"frac14", 188}, + {NULL, 0}, + {(const unsigned char*)"LeftUpVector", 8639}, + {(const unsigned char*)"bigotimes", 10754}, + {(const unsigned char*)"questeq", 8799}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"GreaterFullEqual", 8807}, + {NULL, 0}, + {(const unsigned char*)"in", 8712}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Del", 8711}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"CHcy", 1063}, + {(const unsigned char*)"supne", 8843}, + {NULL, 0}, + {(const unsigned char*)"leftarrow", 8592}, + {(const unsigned char*)"ges", 10878}, + {(const unsigned char*)"bnot", 8976}, + {(const unsigned char*)"mumap", 8888}, + {(const unsigned char*)"LeftTriangleEqual", 8884}, + {(const unsigned char*)"KHcy", 1061}, + {(const unsigned char*)"les", 10877}, + {(const unsigned char*)"xutri", 9651}, + {NULL, 0}, + {(const unsigned char*)"caron", 711}, + {NULL, 0}, + {(const unsigned char*)"EqualTilde", 8770}, + {(const unsigned char*)"UnderBar", 818}, + {(const unsigned char*)"SHcy", 1064}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ZHcy", 1046}, + {(const unsigned char*)"gel", 8923}, + {(const unsigned char*)"Vee", 8897}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"subne", 8842}, + {NULL, 0}, + {(const unsigned char*)"ngtr", 8815}, + {(const unsigned char*)"isins", 8948}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"angle", 8736}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ThinSpace", 8201}, + {(const unsigned char*)"samalg", 8720}, + {NULL, 0}, + {(const unsigned char*)"supseteqq", 10950}, + {(const unsigned char*)"SucceedsEqual", 10928}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"vee", 8744}, + {NULL, 0}, + {(const unsigned char*)"approxeq", 8778}, + {(const unsigned char*)"leftarrowtail", 8610}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"dHar", 10597}, + {(const unsigned char*)"andand", 10837}, + {(const unsigned char*)"dlarr", 8601}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"circeq", 8791}, + {NULL, 0}, + {(const unsigned char*)"Lsh", 8624}, + {(const unsigned char*)"laquo", 171}, + {(const unsigned char*)"coloneq", 8788}, + {(const unsigned char*)"llarr", 8647}, + {(const unsigned char*)"Int", 8748}, + {(const unsigned char*)"nlarr", 8602}, + {(const unsigned char*)"Rsh", 8625}, + {(const unsigned char*)"varepsilon", 949}, + {(const unsigned char*)"olarr", 8634}, + {(const unsigned char*)"raquo", 187}, + {(const unsigned char*)"slarr", 8592}, + {(const unsigned char*)"rlarr", 8644}, + {(const unsigned char*)"boxuR", 9560}, + {(const unsigned char*)"minus", 8722}, + {(const unsigned char*)"xlarr", 10229}, + {(const unsigned char*)"lHar", 10594}, + {(const unsigned char*)"rHar", 10596}, + {(const unsigned char*)"subseteqq", 10949}, + {NULL, 0}, + {(const unsigned char*)"uHar", 10595}, + {(const unsigned char*)"epsis", 1013}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ssetmn", 8726}, + {(const unsigned char*)"equals", 61}, + {NULL, 0}, + {(const unsigned char*)"NotExists", 8708}, + {(const unsigned char*)"prnsim", 8936}, + {(const unsigned char*)"lsh", 8624}, + {(const unsigned char*)"curlyeqsucc", 8927}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"int", 8747}, + {NULL, 0}, + {(const unsigned char*)"rsh", 8625}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LessSlantEqual", 10877}, + {(const unsigned char*)"DiacriticalDot", 729}, + {NULL, 0}, + {(const unsigned char*)"nvDash", 8877}, + {(const unsigned char*)"prnap", 10937}, + {(const unsigned char*)"ZeroWidthSpace", 8203}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"oplus", 8853}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"middot", 183}, + {NULL, 0}, + {(const unsigned char*)"emptyset", 8709}, + {(const unsigned char*)"uplus", 8846}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxhu", 9524}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"softcy", 1100}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"squarf", 9642}, + {(const unsigned char*)"TripleDot", 8411}, + {(const unsigned char*)"DownTee", 8868}, + {(const unsigned char*)"cir", 9675}, + {(const unsigned char*)"expectation", 8496}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"cirfnint", 10768}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sfrown", 8994}, + {(const unsigned char*)"ntriangleright", 8939}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nisd", 8954}, + {(const unsigned char*)"dash", 8208}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nvHarr", 10500}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"hybull", 8259}, + {(const unsigned char*)"RightArrowBar", 8677}, + {(const unsigned char*)"leftrightsquigarrow", 8621}, + {(const unsigned char*)"minusb", 8863}, + {NULL, 0}, + {(const unsigned char*)"frac38", 8540}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"centerdot", 183}, + {(const unsigned char*)"nwnear", 10535}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"larrpl", 10553}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"hookleftarrow", 8617}, + {(const unsigned char*)"hellip", 8230}, + {(const unsigned char*)"rarrpl", 10565}, + {(const unsigned char*)"mid", 8739}, + {NULL, 0}, + {(const unsigned char*)"oast", 8859}, + {(const unsigned char*)"NotTildeTilde", 8777}, + {NULL, 0}, + {(const unsigned char*)"NotTilde", 8769}, + {(const unsigned char*)"ohacgr", 974}, + {(const unsigned char*)"marker", 9646}, + {(const unsigned char*)"langle", 9001}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"vellip", 8942}, + {(const unsigned char*)"NotRightTriangleEqual", 8941}, + {(const unsigned char*)"rangle", 9002}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"gnsim", 8935}, + {(const unsigned char*)"malt", 10016}, + {(const unsigned char*)"times", 215}, + {(const unsigned char*)"RightDownTeeVector", 10589}, + {NULL, 0}, + {(const unsigned char*)"lnsim", 8934}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"preceq", 10927}, + {(const unsigned char*)"equiv", 8801}, + {(const unsigned char*)"geqq", 8807}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Iota", 921}, + {(const unsigned char*)"leqq", 8806}, + {NULL, 0}, + {(const unsigned char*)"cuepr", 8926}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxtimes", 8864}, + {(const unsigned char*)"numero", 8470}, + {(const unsigned char*)"setmn", 8726}, + {NULL, 0}, + {(const unsigned char*)"ForAll", 8704}, + {NULL, 0}, + {(const unsigned char*)"excl", 33}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"bsol", 92}, + {(const unsigned char*)"imof", 8887}, + {(const unsigned char*)"dsol", 10742}, + {(const unsigned char*)"ic", 8291}, + {(const unsigned char*)"ReverseElement", 8715}, + {(const unsigned char*)"Exists", 8707}, + {NULL, 0}, + {(const unsigned char*)"parsl", 11005}, + {(const unsigned char*)"bprime", 8245}, + {(const unsigned char*)"Ccedil", 199}, + {(const unsigned char*)"sc", 8827}, + {(const unsigned char*)"propto", 8733}, + {NULL, 0}, + {(const unsigned char*)"osol", 8856}, + {(const unsigned char*)"RightVectorBar", 10579}, + {(const unsigned char*)"iota", 953}, + {(const unsigned char*)"boxDR", 9556}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Theta", 920}, + {(const unsigned char*)"lharu", 8636}, + {(const unsigned char*)"Because", 8757}, + {(const unsigned char*)"qprime", 8279}, + {(const unsigned char*)"simrarr", 10610}, + {NULL, 0}, + {(const unsigned char*)"tprime", 8244}, + {(const unsigned char*)"rharu", 8640}, + {(const unsigned char*)"vprime", 8242}, + {(const unsigned char*)"YUcy", 1070}, + {(const unsigned char*)"plusmn", 177}, + {NULL, 0}, + {(const unsigned char*)"planckh", 8462}, + {(const unsigned char*)"YIcy", 1031}, + {NULL, 0}, + {(const unsigned char*)"NotRightTriangle", 8939}, + {(const unsigned char*)"becaus", 8757}, + {NULL, 0}, + {(const unsigned char*)"PrecedesEqual", 10927}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nsupe", 8841}, + {(const unsigned char*)"ccedil", 231}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"yacy", 1103}, + {(const unsigned char*)"succnsim", 8937}, + {(const unsigned char*)"theta", 952}, + {(const unsigned char*)"because", 8757}, + {(const unsigned char*)"pre", 10927}, + {NULL, 0}, + {(const unsigned char*)"sharp", 9839}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"timesb", 8864}, + {(const unsigned char*)"Longleftarrow", 10232}, + {(const unsigned char*)"Sqrt", 8730}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Vert", 8214}, + {NULL, 0}, + {(const unsigned char*)"Rho", 929}, + {NULL, 0}, + {(const unsigned char*)"LeftDownTeeVector", 10593}, + {(const unsigned char*)"erDot", 8787}, + {NULL, 0}, + {(const unsigned char*)"integers", 8484}, + {(const unsigned char*)"Dot", 168}, + {(const unsigned char*)"eqvparsl", 10725}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"efDot", 8786}, + {NULL, 0}, + {(const unsigned char*)"NewLine", 10}, + {(const unsigned char*)"sbquo", 8218}, + {NULL, 0}, + {(const unsigned char*)"Diamond", 8900}, + {(const unsigned char*)"Not", 10988}, + {NULL, 0}, + {(const unsigned char*)"Eta", 919}, + {(const unsigned char*)"longleftarrow", 10229}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"starf", 9733}, + {(const unsigned char*)"RoundImplies", 10608}, + {(const unsigned char*)"RightAngleBracket", 9002}, + {NULL, 0}, + {(const unsigned char*)"diamondsuit", 9830}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"vert", 124}, + {(const unsigned char*)"eth", 240}, + {(const unsigned char*)"NotReverseElement", 8716}, + {(const unsigned char*)"Longleftrightarrow", 10234}, + {(const unsigned char*)"ssmile", 8995}, + {(const unsigned char*)"bot", 8869}, + {(const unsigned char*)"supe", 8839}, + {(const unsigned char*)"dot", 729}, + {(const unsigned char*)"pointint", 10773}, + {(const unsigned char*)"intercal", 8890}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rho", 961}, + {NULL, 0}, + {(const unsigned char*)"primes", 8473}, + {(const unsigned char*)"fllig", 64258}, + {NULL, 0}, + {(const unsigned char*)"diamond", 8900}, + {(const unsigned char*)"not", 172}, + {(const unsigned char*)"precapprox", 10935}, + {(const unsigned char*)"eta", 951}, + {NULL, 0}, + {(const unsigned char*)"backprime", 8245}, + {(const unsigned char*)"GreaterEqualLess", 8923}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"RightTeeArrow", 8614}, + {(const unsigned char*)"boxHd", 9572}, + {(const unsigned char*)"Gammad", 988}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Assign", 8788}, + {(const unsigned char*)"squf", 9642}, + {(const unsigned char*)"angzarr", 9084}, + {(const unsigned char*)"longleftrightarrow", 10231}, + {NULL, 0}, + {(const unsigned char*)"pound", 163}, + {(const unsigned char*)"topbot", 9014}, + {(const unsigned char*)"twoheadleftarrow", 8606}, + {(const unsigned char*)"Congruent", 8801}, + {(const unsigned char*)"nshortparallel", 8742}, + {(const unsigned char*)"LeftArrowRightArrow", 8646}, + {NULL, 0}, + {(const unsigned char*)"sube", 8838}, + {NULL, 0}, + {(const unsigned char*)"hamilt", 8459}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"harrcir", 10568}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxV", 9553}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"gammad", 989}, + {(const unsigned char*)"OpenCurlyDoubleQuote", 8220}, + {NULL, 0}, + {(const unsigned char*)"target", 8982}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"bigsqcup", 10758}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxVr", 9567}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"eegr", 951}, + {(const unsigned char*)"awint", 10769}, + {(const unsigned char*)"EEacgr", 905}, + {(const unsigned char*)"cwint", 8753}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"RightVector", 8640}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Vvdash", 8874}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Aacute", 193}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Eacute", 201}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Iacute", 205}, + {(const unsigned char*)"boxHU", 9577}, + {(const unsigned char*)"daleth", 8504}, + {(const unsigned char*)"olcross", 10683}, + {(const unsigned char*)"eqcirc", 8790}, + {NULL, 0}, + {(const unsigned char*)"Oacute", 211}, + {(const unsigned char*)"bigodot", 10752}, + {(const unsigned char*)"notinva", 8713}, + {(const unsigned char*)"LeftRightArrow", 8596}, + {(const unsigned char*)"lozenge", 9674}, + {NULL, 0}, + {(const unsigned char*)"Uacute", 218}, + {(const unsigned char*)"nvdash", 8876}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Yacute", 221}, + {(const unsigned char*)"boxvL", 9569}, + {(const unsigned char*)"Bscr", 8492}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Escr", 8496}, + {(const unsigned char*)"Fscr", 8497}, + {(const unsigned char*)"Hacek", 711}, + {(const unsigned char*)"Hscr", 8459}, + {(const unsigned char*)"Iscr", 8464}, + {(const unsigned char*)"boxVh", 9579}, + {(const unsigned char*)"aacute", 225}, + {(const unsigned char*)"Lscr", 8466}, + {(const unsigned char*)"Mscr", 8499}, + {(const unsigned char*)"Downarrow", 8659}, + {(const unsigned char*)"eacute", 233}, + {(const unsigned char*)"iacute", 237}, + {(const unsigned char*)"VerticalLine", 124}, + {(const unsigned char*)"Rscr", 8475}, + {(const unsigned char*)"ap", 8776}, + {(const unsigned char*)"NegativeVeryThinSpace", 8203}, + {(const unsigned char*)"LessTilde", 8818}, + {(const unsigned char*)"oacute", 243}, + {(const unsigned char*)"blk12", 9618}, + {(const unsigned char*)"frac25", 8534}, + {(const unsigned char*)"mp", 8723}, + {(const unsigned char*)"fnof", 402}, + {(const unsigned char*)"Conint", 8751}, + {(const unsigned char*)"uacute", 250}, + {(const unsigned char*)"dd", 8518}, + {(const unsigned char*)"scsim", 8831}, + {(const unsigned char*)"NotSucceeds", 8833}, + {(const unsigned char*)"yacute", 253}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"wp", 8472}, + {(const unsigned char*)"infin", 8734}, + {(const unsigned char*)"escr", 8495}, + {NULL, 0}, + {(const unsigned char*)"DJcy", 1026}, + {(const unsigned char*)"gscr", 8458}, + {(const unsigned char*)"LowerRightArrow", 8600}, + {(const unsigned char*)"GJcy", 1027}, + {(const unsigned char*)"dzcy", 1119}, + {(const unsigned char*)"brvbar", 166}, + {(const unsigned char*)"sqcup", 8852}, + {(const unsigned char*)"KJcy", 1036}, + {(const unsigned char*)"LJcy", 1033}, + {(const unsigned char*)"oscr", 8500}, + {(const unsigned char*)"NJcy", 1034}, + {(const unsigned char*)"ddagger", 8225}, + {(const unsigned char*)"Agrave", 192}, + {(const unsigned char*)"downarrow", 8595}, + {NULL, 0}, + {(const unsigned char*)"duhar", 10607}, + {(const unsigned char*)"Egrave", 200}, + {(const unsigned char*)"Oslash", 216}, + {NULL, 0}, + {(const unsigned char*)"preccurlyeq", 8828}, + {(const unsigned char*)"Igrave", 204}, + {(const unsigned char*)"conint", 8750}, + {(const unsigned char*)"drbkarow", 10512}, + {(const unsigned char*)"DownRightTeeVector", 10591}, + {(const unsigned char*)"odot", 8857}, + {NULL, 0}, + {(const unsigned char*)"Ograve", 210}, + {(const unsigned char*)"ldot", 8918}, + {(const unsigned char*)"LeftAngleBracket", 9001}, + {(const unsigned char*)"tdot", 8411}, + {(const unsigned char*)"idiagr", 912}, + {(const unsigned char*)"sdot", 8901}, + {(const unsigned char*)"Ugrave", 217}, + {(const unsigned char*)"triangleleft", 9667}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"diam", 8900}, + {(const unsigned char*)"commat", 64}, + {(const unsigned char*)"udiagr", 944}, + {(const unsigned char*)"larrb", 8676}, + {(const unsigned char*)"hslash", 8463}, + {(const unsigned char*)"rightleftarrows", 8644}, + {(const unsigned char*)"succnapprox", 10938}, + {(const unsigned char*)"agrave", 224}, + {NULL, 0}, + {(const unsigned char*)"egs", 10902}, + {NULL, 0}, + {(const unsigned char*)"egrave", 232}, + {(const unsigned char*)"oslash", 248}, + {NULL, 0}, + {(const unsigned char*)"nge", 8817}, + {(const unsigned char*)"igrave", 236}, + {(const unsigned char*)"hbar", 8463}, + {NULL, 0}, + {(const unsigned char*)"NestedLessLess", 8810}, + {NULL, 0}, + {(const unsigned char*)"nexist", 8708}, + {(const unsigned char*)"ograve", 242}, + {NULL, 0}, + {(const unsigned char*)"ldquor", 8222}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rdquor", 8221}, + {(const unsigned char*)"ugrave", 249}, + {(const unsigned char*)"div", 247}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"blacktriangledown", 9662}, + {(const unsigned char*)"UpArrow", 8593}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"niv", 8715}, + {(const unsigned char*)"llhard", 10603}, + {(const unsigned char*)"boxdl", 9488}, + {(const unsigned char*)"piv", 982}, + {NULL, 0}, + {(const unsigned char*)"NotPrecedes", 8832}, + {(const unsigned char*)"lbarr", 10508}, + {NULL, 0}, + {(const unsigned char*)"andd", 10844}, + {(const unsigned char*)"bigwedge", 8896}, + {(const unsigned char*)"InvisibleTimes", 8290}, + {NULL, 0}, + {(const unsigned char*)"rbarr", 10509}, + {NULL, 0}, + {(const unsigned char*)"ApplyFunction", 8289}, + {(const unsigned char*)"bottom", 8869}, + {(const unsigned char*)"awconint", 8755}, + {(const unsigned char*)"cwconint", 8754}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"dwangle", 10662}, + {(const unsigned char*)"rarrb", 8677}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"UpArrowBar", 10514}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"realine", 8475}, + {(const unsigned char*)"uwangle", 10663}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lowbar", 95}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Cayleys", 8493}, + {NULL, 0}, + {(const unsigned char*)"bigstar", 9733}, + {(const unsigned char*)"isin", 8712}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"backepsilon", 1014}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"OpenCurlyQuote", 8216}, + {NULL, 0}, + {(const unsigned char*)"Cross", 10799}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lesseqgtr", 8922}, + {(const unsigned char*)"Upsi", 978}, + {(const unsigned char*)"DoubleRightArrow", 8658}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Laplacetrf", 8466}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"bigcirc", 9711}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"epsi", 1013}, + {(const unsigned char*)"LeftTeeVector", 10586}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DoubleUpDownArrow", 8661}, + {NULL, 0}, + {(const unsigned char*)"DiacriticalGrave", 96}, + {(const unsigned char*)"triangle", 9653}, + {NULL, 0}, + {(const unsigned char*)"permil", 8240}, + {NULL, 0}, + {(const unsigned char*)"lpargt", 10656}, + {(const unsigned char*)"UpEquilibrium", 10606}, + {(const unsigned char*)"backsimeq", 8909}, + {(const unsigned char*)"Supset", 8913}, + {(const unsigned char*)"boxUr", 9561}, + {(const unsigned char*)"sccue", 8829}, + {(const unsigned char*)"rpargt", 10644}, + {(const unsigned char*)"cross", 10007}, + {(const unsigned char*)"upsi", 965}, + {NULL, 0}, + {(const unsigned char*)"cularr", 8630}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"varkappa", 1008}, + {(const unsigned char*)"half", 189}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sfgr", 962}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ImaginaryI", 8520}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Tau", 932}, + {(const unsigned char*)"bernou", 8492}, + {(const unsigned char*)"DoubleLeftArrow", 8656}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"supset", 8835}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"MediumSpace", 8287}, + {NULL, 0}, + {(const unsigned char*)"Subset", 8912}, + {(const unsigned char*)"NegativeThickSpace", 8203}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxuL", 9563}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"notin", 8713}, + {NULL, 0}, + {(const unsigned char*)"Re", 8476}, + {NULL, 0}, + {(const unsigned char*)"nleq", 8816}, + {(const unsigned char*)"nLeftrightarrow", 8654}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Beta", 914}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"dollar", 36}, + {(const unsigned char*)"Product", 8719}, + {(const unsigned char*)"tau", 964}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Poincareplane", 8460}, + {(const unsigned char*)"ee", 8519}, + {(const unsigned char*)"CenterDot", 183}, + {(const unsigned char*)"Jsercy", 1032}, + {(const unsigned char*)"ge", 8805}, + {(const unsigned char*)"Rarrtl", 10518}, + {(const unsigned char*)"subset", 8834}, + {NULL, 0}, + {(const unsigned char*)"le", 8804}, + {NULL, 0}, + {(const unsigned char*)"ne", 8800}, + {(const unsigned char*)"mapstoleft", 8612}, + {(const unsigned char*)"NotSucceedsSlantEqual", 8929}, + {(const unsigned char*)"upsih", 978}, + {(const unsigned char*)"cedil", 184}, + {(const unsigned char*)"Zeta", 918}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"apos", 39}, + {(const unsigned char*)"nsube", 8840}, + {(const unsigned char*)"beta", 946}, + {(const unsigned char*)"frac78", 8542}, + {(const unsigned char*)"nltri", 8938}, + {(const unsigned char*)"iiiint", 10764}, + {NULL, 0}, + {(const unsigned char*)"veebar", 8891}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"RightTeeVector", 10587}, + {(const unsigned char*)"Dagger", 8225}, + {(const unsigned char*)"vltri", 8882}, + {(const unsigned char*)"larrtl", 8610}, + {(const unsigned char*)"iocy", 1105}, + {(const unsigned char*)"dashv", 8867}, + {(const unsigned char*)"frac12", 189}, + {(const unsigned char*)"GreaterLess", 8823}, + {(const unsigned char*)"jsercy", 1112}, + {(const unsigned char*)"rarrtl", 8611}, + {(const unsigned char*)"oline", 8254}, + {(const unsigned char*)"sup3", 179}, + {(const unsigned char*)"emsp13", 8196}, + {(const unsigned char*)"asymp", 8776}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"zeta", 950}, + {(const unsigned char*)"UpperRightArrow", 8599}, + {NULL, 0}, + {(const unsigned char*)"smallsetminus", 8726}, + {(const unsigned char*)"LeftUpTeeVector", 10592}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"dagger", 8224}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LeftDownVector", 8643}, + {(const unsigned char*)"sime", 8771}, + {(const unsigned char*)"precsim", 8830}, + {(const unsigned char*)"MinusPlus", 8723}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LeftVector", 8636}, + {NULL, 0}, + {(const unsigned char*)"profalar", 9006}, + {(const unsigned char*)"dtri", 9663}, + {(const unsigned char*)"between", 8812}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"hyphen", 8208}, + {NULL, 0}, + {(const unsigned char*)"NegativeThinSpace", 8203}, + {(const unsigned char*)"downdownarrows", 8650}, + {(const unsigned char*)"xmap", 10236}, + {(const unsigned char*)"ltri", 9667}, + {(const unsigned char*)"bdquo", 8222}, + {(const unsigned char*)"notinvb", 8951}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rtri", 9657}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"hoarr", 8703}, + {(const unsigned char*)"plusdo", 8724}, + {(const unsigned char*)"ldquo", 8220}, + {(const unsigned char*)"bigoplus", 10753}, + {(const unsigned char*)"loarr", 8701}, + {(const unsigned char*)"natur", 9838}, + {(const unsigned char*)"utri", 9653}, + {NULL, 0}, + {(const unsigned char*)"rdquo", 8221}, + {NULL, 0}, + {(const unsigned char*)"roarr", 8702}, + {(const unsigned char*)"VerticalBar", 8739}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"NotPrecedesSlantEqual", 8928}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"imped", 437}, + {(const unsigned char*)"thinsp", 8201}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"dArr", 8659}, + {(const unsigned char*)"dlcorn", 8990}, + {NULL, 0}, + {(const unsigned char*)"LeftUpDownVector", 10577}, + {(const unsigned char*)"hArr", 8660}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lArr", 8656}, + {(const unsigned char*)"ltimes", 8905}, + {NULL, 0}, + {(const unsigned char*)"rightharpoondown", 8641}, + {(const unsigned char*)"otimes", 8855}, + {(const unsigned char*)"RightTee", 8866}, + {(const unsigned char*)"rArr", 8658}, + {(const unsigned char*)"rtimes", 8906}, + {(const unsigned char*)"varsigma", 962}, + {(const unsigned char*)"uArr", 8657}, + {(const unsigned char*)"ulcorn", 8988}, + {(const unsigned char*)"vArr", 8661}, + {(const unsigned char*)"szlig", 223}, + {(const unsigned char*)"Vdash", 8873}, + {(const unsigned char*)"nspar", 8742}, + {(const unsigned char*)"bsim", 8765}, + {(const unsigned char*)"LeftTriangleBar", 10703}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"gsim", 8819}, + {(const unsigned char*)"lcub", 123}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"isinE", 8953}, + {(const unsigned char*)"lsim", 8818}, + {NULL, 0}, + {(const unsigned char*)"rcub", 125}, + {(const unsigned char*)"boxH", 9552}, + {NULL, 0}, + {(const unsigned char*)"nsim", 8769}, + {(const unsigned char*)"bkarow", 10509}, + {(const unsigned char*)"mdash", 8212}, + {(const unsigned char*)"odash", 8861}, + {(const unsigned char*)"clubsuit", 9827}, + {(const unsigned char*)"bigcup", 8899}, + {(const unsigned char*)"nwarhk", 10531}, + {(const unsigned char*)"boxDL", 9559}, + {(const unsigned char*)"ndash", 8211}, + {NULL, 0}, + {(const unsigned char*)"vdash", 8866}, + {(const unsigned char*)"swarhk", 10534}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"blacklozenge", 10731}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DoubleLeftRightArrow", 8660}, + {NULL, 0}, + {(const unsigned char*)"naturals", 8469}, + {(const unsigned char*)"incare", 8453}, + {NULL, 0}, + {(const unsigned char*)"RightUpDownVector", 10575}, + {NULL, 0}, + {(const unsigned char*)"zwnj", 8204}, + {(const unsigned char*)"nprec", 8832}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"circledast", 8859}, + {NULL, 0}, + {(const unsigned char*)"heartsuit", 9829}, + {(const unsigned char*)"esdot", 8784}, + {(const unsigned char*)"bigtriangledown", 9661}, + {(const unsigned char*)"Uparrow", 8657}, + {(const unsigned char*)"gsdot", 8919}, + {(const unsigned char*)"Coproduct", 8720}, + {NULL, 0}, + {(const unsigned char*)"circledcirc", 8858}, + {(const unsigned char*)"oint", 8750}, + {(const unsigned char*)"qint", 10764}, + {NULL, 0}, + {(const unsigned char*)"ldsh", 8626}, + {(const unsigned char*)"trade", 8482}, + {(const unsigned char*)"lrhar2", 8651}, + {(const unsigned char*)"larrhk", 8617}, + {(const unsigned char*)"tint", 8749}, + {NULL, 0}, + {(const unsigned char*)"rdsh", 8627}, + {(const unsigned char*)"psgr", 968}, + {(const unsigned char*)"rarrhk", 8618}, + {(const unsigned char*)"Psi", 936}, + {NULL, 0}, + {(const unsigned char*)"larrsim", 10611}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Epsilon", 917}, + {NULL, 0}, + {(const unsigned char*)"rarrsim", 10612}, + {(const unsigned char*)"male", 9794}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"uparrow", 8593}, + {(const unsigned char*)"Scaron", 352}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Upsilon", 933}, + {NULL, 0}, + {(const unsigned char*)"hearts", 9829}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"eqsim", 8770}, + {(const unsigned char*)"Sigma", 931}, + {(const unsigned char*)"Or", 10836}, + {(const unsigned char*)"UpArrowDownArrow", 8645}, + {(const unsigned char*)"twixt", 8812}, + {(const unsigned char*)"psi", 968}, + {NULL, 0}, + {(const unsigned char*)"nabla", 8711}, + {(const unsigned char*)"bowtie", 8904}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"epsilon", 949}, + {NULL, 0}, + {(const unsigned char*)"GreaterSlantEqual", 10878}, + {(const unsigned char*)"NotLeftTriangleEqual", 8940}, + {(const unsigned char*)"apacir", 10863}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"upharpoonright", 8638}, + {NULL, 0}, + {(const unsigned char*)"scaron", 353}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"af", 8289}, + {(const unsigned char*)"upsilon", 965}, + {(const unsigned char*)"TildeEqual", 8771}, + {NULL, 0}, + {(const unsigned char*)"Lambda", 923}, + {(const unsigned char*)"neArr", 8663}, + {(const unsigned char*)"sigma", 963}, + {(const unsigned char*)"ETH", 208}, + {(const unsigned char*)"leftthreetimes", 8907}, + {(const unsigned char*)"seArr", 8664}, + {(const unsigned char*)"thicksim", 8764}, + {(const unsigned char*)"bigcap", 8898}, + {(const unsigned char*)"ang", 8736}, + {(const unsigned char*)"ldca", 10550}, + {(const unsigned char*)"rdca", 10551}, + {(const unsigned char*)"wr", 8768}, + {NULL, 0}, + {(const unsigned char*)"or", 8744}, + {(const unsigned char*)"pr", 8826}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"triangleq", 8796}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"gtrsim", 8819}, + {(const unsigned char*)"looparrowleft", 8619}, + {(const unsigned char*)"LongRightArrow", 10230}, + {(const unsigned char*)"nis", 8956}, + {(const unsigned char*)"Aring", 197}, + {(const unsigned char*)"LeftDownVectorBar", 10585}, + {(const unsigned char*)"NotTildeEqual", 8772}, + {(const unsigned char*)"lambda", 955}, + {(const unsigned char*)"larrlp", 8619}, + {(const unsigned char*)"leftharpoondown", 8637}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sup2", 178}, + {NULL, 0}, + {(const unsigned char*)"rarrlp", 8620}, + {(const unsigned char*)"SmallCircle", 8728}, + {(const unsigned char*)"bNot", 10989}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"aleph", 8501}, + {(const unsigned char*)"blacktriangle", 9652}, + {NULL, 0}, + {(const unsigned char*)"circleddash", 8861}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rhov", 1009}, + {NULL, 0}, + {(const unsigned char*)"UpTee", 8869}, + {(const unsigned char*)"die", 168}, + {(const unsigned char*)"bump", 8782}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"epar", 8917}, + {(const unsigned char*)"gnap", 10890}, + {(const unsigned char*)"RightFloor", 8971}, + {(const unsigned char*)"aring", 229}, + {NULL, 0}, + {(const unsigned char*)"lnap", 10889}, + {(const unsigned char*)"approx", 8776}, + {(const unsigned char*)"larrbfs", 10527}, + {(const unsigned char*)"lpar", 40}, + {(const unsigned char*)"npar", 8742}, + {(const unsigned char*)"gEl", 10892}, + {(const unsigned char*)"boxVl", 9570}, + {(const unsigned char*)"eqcolon", 8789}, + {(const unsigned char*)"rarrbfs", 10528}, + {(const unsigned char*)"rpar", 41}, + {(const unsigned char*)"spar", 8741}, + {(const unsigned char*)"thksim", 8764}, + {NULL, 0}, + {(const unsigned char*)"RightDownVectorBar", 10581}, + {NULL, 0}, + {(const unsigned char*)"para", 182}, + {(const unsigned char*)"thkap", 8776}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Superset", 8835}, + {NULL, 0}, + {(const unsigned char*)"ddarr", 8650}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Gamma", 915}, + {(const unsigned char*)"frac15", 8533}, + {(const unsigned char*)"kappav", 1008}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"udarr", 8645}, + {(const unsigned char*)"Therefore", 8756}, + {(const unsigned char*)"hairsp", 8202}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"CircleMinus", 8854}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ordf", 170}, + {(const unsigned char*)"VerticalTilde", 8768}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LeftVectorBar", 10578}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"UnderBracket", 9141}, + {NULL, 0}, + {(const unsigned char*)"gamma", 947}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DoubleDot", 168}, + {(const unsigned char*)"lceil", 8968}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"curlyeqprec", 8926}, + {(const unsigned char*)"varnothing", 8709}, + {(const unsigned char*)"nhpar", 10994}, + {(const unsigned char*)"therefore", 8756}, + {(const unsigned char*)"dlcrop", 8973}, + {(const unsigned char*)"rceil", 8969}, + {(const unsigned char*)"leftleftarrows", 8647}, + {(const unsigned char*)"vangrt", 10652}, + {NULL, 0}, + {(const unsigned char*)"lrm", 8206}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"curvearrowright", 8631}, + {(const unsigned char*)"thetas", 952}, + {(const unsigned char*)"PartialD", 8706}, + {(const unsigned char*)"nVDash", 8879}, + {(const unsigned char*)"wedgeq", 8793}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ulcrop", 8975}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"zigrarr", 8669}, + {(const unsigned char*)"lozf", 10731}, + {(const unsigned char*)"sung", 9834}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"iff", 8660}, + {(const unsigned char*)"xnis", 8955}, + {(const unsigned char*)"ring", 730}, + {(const unsigned char*)"dfisht", 10623}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nltrie", 8940}, + {(const unsigned char*)"llcorner", 8990}, + {NULL, 0}, + {(const unsigned char*)"lfisht", 10620}, + {(const unsigned char*)"ctdot", 8943}, + {(const unsigned char*)"dtdot", 8945}, + {(const unsigned char*)"CloseCurlyQuote", 8217}, + {(const unsigned char*)"par", 8741}, + {NULL, 0}, + {(const unsigned char*)"rfisht", 10621}, + {(const unsigned char*)"ulcorner", 8988}, + {NULL, 0}, + {(const unsigned char*)"ufisht", 10622}, + {NULL, 0}, + {(const unsigned char*)"notinvc", 8950}, + {(const unsigned char*)"orderof", 8500}, + {NULL, 0}, + {(const unsigned char*)"Rrightarrow", 8667}, + {(const unsigned char*)"emsp", 8195}, + {(const unsigned char*)"Chi", 935}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"utdot", 8944}, + {(const unsigned char*)"bull", 8226}, + {NULL, 0}, + {(const unsigned char*)"khgr", 967}, + {(const unsigned char*)"ominus", 8854}, + {(const unsigned char*)"eqslantgtr", 10902}, + {(const unsigned char*)"multimap", 8888}, + {(const unsigned char*)"lowast", 8727}, + {(const unsigned char*)"ohgr", 969}, + {(const unsigned char*)"NotLess", 8814}, + {(const unsigned char*)"alefsym", 8501}, + {(const unsigned char*)"Phi", 934}, + {(const unsigned char*)"thgr", 952}, + {NULL, 0}, + {(const unsigned char*)"isinsv", 8947}, + {(const unsigned char*)"OHacgr", 911}, + {NULL, 0}, + {(const unsigned char*)"NotElement", 8713}, + {(const unsigned char*)"nearrow", 8599}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DoubleLeftTee", 10980}, + {(const unsigned char*)"nrightarrow", 8603}, + {NULL, 0}, + {(const unsigned char*)"searrow", 8600}, + {(const unsigned char*)"UpTeeArrow", 8613}, + {NULL, 0}, + {(const unsigned char*)"dbkarow", 10511}, + {(const unsigned char*)"period", 46}, + {(const unsigned char*)"Gg", 8921}, + {(const unsigned char*)"circledR", 174}, + {(const unsigned char*)"DownBreve", 785}, + {NULL, 0}, + {(const unsigned char*)"imagline", 8464}, + {(const unsigned char*)"gneq", 10888}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"chi", 967}, + {NULL, 0}, + {(const unsigned char*)"lneq", 10887}, + {(const unsigned char*)"phi", 981}, + {NULL, 0}, + {(const unsigned char*)"spadesuit", 9824}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"prsim", 8830}, + {(const unsigned char*)"Atilde", 195}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"isinv", 8712}, + {(const unsigned char*)"rlarr2", 8644}, + {(const unsigned char*)"nrArr", 8655}, + {NULL, 0}, + {(const unsigned char*)"angst", 8491}, + {NULL, 0}, + {(const unsigned char*)"sdotb", 8865}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Ntilde", 209}, + {(const unsigned char*)"gg", 8811}, + {(const unsigned char*)"xrArr", 10233}, + {(const unsigned char*)"DoubleLongLeftRightArrow", 10234}, + {(const unsigned char*)"Otilde", 213}, + {NULL, 0}, + {(const unsigned char*)"lg", 8822}, + {(const unsigned char*)"LeftArrowBar", 8676}, + {(const unsigned char*)"thickapprox", 8776}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"precnsim", 8936}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Element", 8712}, + {(const unsigned char*)"atilde", 227}, + {NULL, 0}, + {(const unsigned char*)"LessEqualGreater", 8922}, + {NULL, 0}, + {(const unsigned char*)"eqslantless", 10901}, + {(const unsigned char*)"EmptyVerySmallSquare", 9643}, + {(const unsigned char*)"phgr", 966}, + {(const unsigned char*)"epsiv", 949}, + {(const unsigned char*)"DoubleVerticalBar", 8741}, + {(const unsigned char*)"LeftTriangle", 8882}, + {NULL, 0}, + {(const unsigned char*)"spades", 9824}, + {(const unsigned char*)"frac23", 8532}, + {(const unsigned char*)"ntilde", 241}, + {(const unsigned char*)"otilde", 245}, + {NULL, 0}, + {(const unsigned char*)"sup1", 185}, + {(const unsigned char*)"GreaterGreater", 10914}, + {(const unsigned char*)"iecy", 1077}, + {(const unsigned char*)"NestedGreaterGreater", 8811}, + {(const unsigned char*)"lfloor", 8970}, + {(const unsigned char*)"SquareSubsetEqual", 8849}, + {NULL, 0}, + {(const unsigned char*)"acute", 180}, + {(const unsigned char*)"YAcy", 1071}, + {NULL, 0}, + {(const unsigned char*)"rfloor", 8971}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"quest", 63}, + {NULL, 0}, + {(const unsigned char*)"rlhar", 8652}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"geq", 8805}, + {(const unsigned char*)"CloseCurlyDoubleQuote", 8221}, + {(const unsigned char*)"lsquor", 8218}, + {NULL, 0}, + {(const unsigned char*)"tshcy", 1115}, + {(const unsigned char*)"leq", 8804}, + {(const unsigned char*)"boxUl", 9564}, + {(const unsigned char*)"lurdshar", 10570}, + {(const unsigned char*)"rsquor", 8217}, + {(const unsigned char*)"VerticalSeparator", 10072}, + {(const unsigned char*)"boxdR", 9554}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"scap", 10936}, + {(const unsigned char*)"hkswarow", 10534}, + {NULL, 0}, + {(const unsigned char*)"CapitalDifferentialD", 8517}, + {(const unsigned char*)"NoBreak", 8288}, + {(const unsigned char*)"lthree", 8907}, + {(const unsigned char*)"bigtriangleup", 9651}, + {(const unsigned char*)"elinters", 65533}, + {NULL, 0}, + {(const unsigned char*)"forall", 8704}, + {(const unsigned char*)"NotGreater", 8815}, + {(const unsigned char*)"rthree", 8908}, + {(const unsigned char*)"Jukcy", 1028}, + {NULL, 0}, + {(const unsigned char*)"Iukcy", 1030}, + {NULL, 0}, + {(const unsigned char*)"gtreqqless", 10892}, + {NULL, 0}, + {(const unsigned char*)"UnderParenthesis", 65078}, + {NULL, 0}, + {(const unsigned char*)"nearr", 8599}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"perp", 8869}, + {(const unsigned char*)"bepsi", 1014}, + {(const unsigned char*)"searr", 8600}, + {(const unsigned char*)"iexcl", 161}, + {(const unsigned char*)"LeftArrow", 8592}, + {(const unsigned char*)"NegativeMediumSpace", 8203}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ast", 42}, + {NULL, 0}, + {(const unsigned char*)"lAarr", 8666}, + {(const unsigned char*)"DownRightVectorBar", 10583}, + {(const unsigned char*)"cuvee", 8910}, + {NULL, 0}, + {(const unsigned char*)"iukcy", 1110}, + {(const unsigned char*)"jukcy", 1108}, + {(const unsigned char*)"latail", 10521}, + {(const unsigned char*)"disin", 8946}, + {NULL, 0}, + {(const unsigned char*)"rAarr", 8667}, + {(const unsigned char*)"angsph", 8738}, + {NULL, 0}, + {(const unsigned char*)"InvisibleComma", 8291}, + {(const unsigned char*)"ratail", 10522}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"supnE", 10956}, + {(const unsigned char*)"ngt", 8815}, + {(const unsigned char*)"order", 8500}, + {(const unsigned char*)"divide", 247}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"colon", 58}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"CirclePlus", 8853}, + {(const unsigned char*)"frac18", 8539}, + {(const unsigned char*)"nsup", 8837}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"intprod", 10812}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"And", 10835}, + {NULL, 0}, + {(const unsigned char*)"Cup", 8915}, + {NULL, 0}, + {(const unsigned char*)"nsimeq", 8772}, + {NULL, 0}, + {(const unsigned char*)"subnE", 10955}, + {NULL, 0}, + {(const unsigned char*)"SHCHcy", 1065}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LessLess", 10913}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rightarrowtail", 8611}, + {(const unsigned char*)"EEgr", 919}, + {(const unsigned char*)"Sup", 8913}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"simeq", 8771}, + {(const unsigned char*)"leftharpoonup", 8636}, + {NULL, 0}, + {(const unsigned char*)"boxhd", 9516}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"and", 8743}, + {(const unsigned char*)"Cedilla", 184}, + {(const unsigned char*)"cup", 8746}, + {NULL, 0}, + {(const unsigned char*)"ensp", 8194}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"gimel", 8503}, + {NULL, 0}, + {(const unsigned char*)"straightphi", 981}, + {(const unsigned char*)"nbsp", 160}, + {(const unsigned char*)"NotLessGreater", 8824}, + {(const unsigned char*)"thetav", 977}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sup", 8835}, + {(const unsigned char*)"lsqb", 91}, + {NULL, 0}, + {(const unsigned char*)"check", 10003}, + {(const unsigned char*)"Gt", 8811}, + {(const unsigned char*)"boxv", 9474}, + {(const unsigned char*)"rsqb", 93}, + {(const unsigned char*)"Implies", 8658}, + {(const unsigned char*)"shortparallel", 8741}, + {(const unsigned char*)"Lt", 8810}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Sub", 8912}, + {NULL, 0}, + {(const unsigned char*)"HARDcy", 1066}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"thorn", 254}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxvr", 9500}, + {(const unsigned char*)"DD", 8517}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nVdash", 8878}, + {(const unsigned char*)"angrt", 8735}, + {(const unsigned char*)"gt", 62}, + {(const unsigned char*)"trianglerighteq", 8885}, + {(const unsigned char*)"sub", 8834}, + {(const unsigned char*)"it", 8290}, + {NULL, 0}, + {(const unsigned char*)"lt", 60}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"cudarrr", 10549}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DZcy", 1039}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"seswar", 10537}, + {(const unsigned char*)"boxhU", 9576}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"precnapprox", 10937}, + {NULL, 0}, + {(const unsigned char*)"fallingdotseq", 8786}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"vartheta", 977}, + {(const unsigned char*)"digamma", 989}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Omicron", 927}, + {(const unsigned char*)"oror", 10838}, + {NULL, 0}, + {(const unsigned char*)"DownLeftRightVector", 10576}, + {(const unsigned char*)"NonBreakingSpace", 160}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"NotVerticalBar", 8740}, + {NULL, 0}, + {(const unsigned char*)"boxvh", 9532}, + {(const unsigned char*)"smile", 8995}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Bumpeq", 8782}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Proportion", 8759}, + {(const unsigned char*)"eDot", 8785}, + {NULL, 0}, + {(const unsigned char*)"numsp", 8199}, + {NULL, 0}, + {(const unsigned char*)"ShortLeftArrow", 8592}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"omicron", 959}, + {(const unsigned char*)"realpart", 8476}, + {NULL, 0}, + {(const unsigned char*)"HumpEqual", 8783}, + {(const unsigned char*)"RightDoubleBracket", 12315}, + {NULL, 0}, + {(const unsigned char*)"lhard", 8637}, + {NULL, 0}, + {(const unsigned char*)"Union", 8899}, + {(const unsigned char*)"rhard", 8641}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"topcir", 10993}, + {NULL, 0}, + {(const unsigned char*)"Copf", 8450}, + {(const unsigned char*)"bumpeq", 8783}, + {(const unsigned char*)"ntrianglelefteq", 8940}, + {(const unsigned char*)"lsquo", 8216}, + {(const unsigned char*)"drarr", 8600}, + {(const unsigned char*)"erarr", 10609}, + {(const unsigned char*)"crarr", 8629}, + {NULL, 0}, + {(const unsigned char*)"Hopf", 8461}, + {(const unsigned char*)"rsquo", 8217}, + {NULL, 0}, + {(const unsigned char*)"Nopf", 8469}, + {(const unsigned char*)"lrarr", 8646}, + {(const unsigned char*)"Uarrocir", 10569}, + {(const unsigned char*)"nrarr", 8603}, + {(const unsigned char*)"backcong", 8780}, + {(const unsigned char*)"orarr", 8635}, + {(const unsigned char*)"RBarr", 10512}, + {(const unsigned char*)"rrarr", 8649}, + {(const unsigned char*)"srarr", 8594}, + {(const unsigned char*)"Qopf", 8474}, + {(const unsigned char*)"Ropf", 8477}, + {(const unsigned char*)"trianglelefteq", 8884}, + {(const unsigned char*)"Popf", 8473}, + {(const unsigned char*)"xrarr", 10230}, + {NULL, 0}, + {(const unsigned char*)"Zopf", 8484}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"CupCap", 8781}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"comma", 44}, + {(const unsigned char*)"Acy", 1040}, + {(const unsigned char*)"Bcy", 1041}, + {(const unsigned char*)"lBarr", 10510}, + {(const unsigned char*)"HilbertSpace", 8459}, + {(const unsigned char*)"Ecy", 1069}, + {(const unsigned char*)"Fcy", 1060}, + {(const unsigned char*)"Gcy", 1043}, + {(const unsigned char*)"rBarr", 10511}, + {(const unsigned char*)"Icy", 1048}, + {(const unsigned char*)"Jcy", 1049}, + {(const unsigned char*)"Kcy", 1050}, + {(const unsigned char*)"Lcy", 1051}, + {(const unsigned char*)"aelig", 230}, + {(const unsigned char*)"Mcy", 1052}, + {(const unsigned char*)"Ocy", 1054}, + {(const unsigned char*)"Pcy", 1055}, + {(const unsigned char*)"Ncy", 1053}, + {(const unsigned char*)"Rcy", 1056}, + {(const unsigned char*)"Scy", 1057}, + {(const unsigned char*)"ShortUpArrow", 8593}, + {(const unsigned char*)"Ucy", 1059}, + {(const unsigned char*)"Vcy", 1042}, + {(const unsigned char*)"Tcy", 1058}, + {(const unsigned char*)"DiacriticalDoubleAcute", 733}, + {(const unsigned char*)"Alpha", 913}, + {(const unsigned char*)"Ycy", 1067}, + {(const unsigned char*)"Zcy", 1047}, + {(const unsigned char*)"nmid", 8740}, + {(const unsigned char*)"NotSubsetEqual", 8840}, + {(const unsigned char*)"ntrianglerighteq", 8941}, + {(const unsigned char*)"straightepsilon", 1013}, + {(const unsigned char*)"ddotseq", 10871}, + {(const unsigned char*)"acy", 1072}, + {(const unsigned char*)"bcy", 1073}, + {NULL, 0}, + {(const unsigned char*)"dcy", 1076}, + {(const unsigned char*)"ecy", 1101}, + {(const unsigned char*)"gnapprox", 10890}, + {(const unsigned char*)"fcy", 1092}, + {(const unsigned char*)"Dcy", 1044}, + {(const unsigned char*)"icy", 1080}, + {(const unsigned char*)"gcy", 1075}, + {(const unsigned char*)"lnapprox", 10889}, + {(const unsigned char*)"TildeFullEqual", 8773}, + {(const unsigned char*)"jcy", 1081}, + {(const unsigned char*)"kcy", 1082}, + {(const unsigned char*)"lcy", 1083}, + {(const unsigned char*)"ReverseUpEquilibrium", 10607}, + {(const unsigned char*)"ncy", 1085}, + {(const unsigned char*)"ocy", 1086}, + {(const unsigned char*)"ocir", 8858}, + {(const unsigned char*)"scy", 1089}, + {(const unsigned char*)"rcy", 1088}, + {(const unsigned char*)"pcy", 1087}, + {(const unsigned char*)"mcy", 1084}, + {(const unsigned char*)"ucy", 1091}, + {(const unsigned char*)"alpha", 945}, + {(const unsigned char*)"DoubleContourIntegral", 8751}, + {(const unsigned char*)"zcy", 1079}, + {(const unsigned char*)"nshortmid", 8740}, + {(const unsigned char*)"ohm", 8486}, + {(const unsigned char*)"tcy", 1090}, + {(const unsigned char*)"ycy", 1099}, + {(const unsigned char*)"vcy", 1074}, + {(const unsigned char*)"sqsub", 8847}, + {(const unsigned char*)"Udigr", 939}, + {(const unsigned char*)"DownLeftTeeVector", 10590}, + {(const unsigned char*)"udigr", 971}, + {(const unsigned char*)"ecir", 8790}, + {(const unsigned char*)"cularrp", 10557}, + {(const unsigned char*)"idigr", 970}, + {(const unsigned char*)"smid", 8739}, + {(const unsigned char*)"Idigr", 938}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DoubleLongLeftArrow", 10232}, + {NULL, 0}, + {(const unsigned char*)"SquareSupersetEqual", 8850}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"FilledSmallSquare", 9724}, + {(const unsigned char*)"oelig", 339}, + {(const unsigned char*)"NotGreaterLess", 8825}, + {(const unsigned char*)"b.Gammad", 988}, + {NULL, 0}, + {(const unsigned char*)"rarrap", 10613}, + {NULL, 0}, + {(const unsigned char*)"cylcty", 9005}, + {(const unsigned char*)"ContourIntegral", 8750}, + {(const unsigned char*)"Intersection", 8898}, + {(const unsigned char*)"acd", 8767}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"fltns", 9649}, + {(const unsigned char*)"Lleftarrow", 8666}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"NotSupersetEqual", 8841}, + {NULL, 0}, + {(const unsigned char*)"nvinfin", 10718}, + {(const unsigned char*)"Acirc", 194}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"circlearrowleft", 8634}, + {(const unsigned char*)"Ecirc", 202}, + {(const unsigned char*)"Mu", 924}, + {(const unsigned char*)"Nu", 925}, + {(const unsigned char*)"complexes", 8450}, + {(const unsigned char*)"Icirc", 206}, + {NULL, 0}, + {(const unsigned char*)"NotLeftTriangle", 8938}, + {(const unsigned char*)"dotsquare", 8865}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Ocirc", 212}, + {(const unsigned char*)"swnwar", 10538}, + {(const unsigned char*)"nsucc", 8833}, + {NULL, 0}, + {(const unsigned char*)"Pi", 928}, + {NULL, 0}, + {(const unsigned char*)"Ucirc", 219}, + {(const unsigned char*)"squ", 9633}, + {(const unsigned char*)"boxur", 9492}, + {(const unsigned char*)"Xi", 926}, + {(const unsigned char*)"there4", 8756}, + {(const unsigned char*)"LeftRightVector", 10574}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nleftarrow", 8602}, + {(const unsigned char*)"NotSquareSubsetEqual", 8930}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"acirc", 226}, + {(const unsigned char*)"leftrightharpoons", 8651}, + {(const unsigned char*)"Omega", 937}, + {(const unsigned char*)"Aacgr", 902}, + {(const unsigned char*)"boxHD", 9574}, + {(const unsigned char*)"ecirc", 234}, + {(const unsigned char*)"nu", 957}, + {(const unsigned char*)"nhArr", 8654}, + {(const unsigned char*)"Mellintrf", 8499}, + {(const unsigned char*)"icirc", 238}, + {(const unsigned char*)"succ", 8827}, + {(const unsigned char*)"mu", 956}, + {NULL, 0}, + {(const unsigned char*)"ni", 8715}, + {(const unsigned char*)"ocirc", 244}, + {(const unsigned char*)"pi", 960}, + {(const unsigned char*)"DiacriticalAcute", 180}, + {(const unsigned char*)"xhArr", 10234}, + {(const unsigned char*)"curlyvee", 8910}, + {(const unsigned char*)"deg", 176}, + {(const unsigned char*)"ucirc", 251}, + {(const unsigned char*)"yen", 165}, + {NULL, 0}, + {(const unsigned char*)"xi", 958}, + {(const unsigned char*)"xcirc", 9711}, + {(const unsigned char*)"IOcy", 1025}, + {(const unsigned char*)"els", 10901}, + {(const unsigned char*)"gE", 8807}, + {(const unsigned char*)"leg", 8922}, + {(const unsigned char*)"Iacgr", 906}, + {(const unsigned char*)"LeftTeeArrow", 8612}, + {(const unsigned char*)"dscy", 1109}, + {(const unsigned char*)"SucceedsSlantEqual", 8829}, + {(const unsigned char*)"fpartint", 10765}, + {(const unsigned char*)"omega", 969}, + {(const unsigned char*)"frac34", 190}, + {(const unsigned char*)"reg", 174}, + {(const unsigned char*)"ShortDownArrow", 8595}, + {(const unsigned char*)"quot", 34}, + {(const unsigned char*)"ell", 8467}, + {(const unsigned char*)"circlearrowright", 8635}, + {(const unsigned char*)"inodot", 305}, + {(const unsigned char*)"xdtri", 9661}, + {(const unsigned char*)"iacgr", 943}, + {(const unsigned char*)"imagpart", 8465}, + {(const unsigned char*)"ldrdhar", 10599}, + {(const unsigned char*)"tscy", 1094}, + {(const unsigned char*)"jnodot", 106}, + {(const unsigned char*)"colone", 8788}, + {(const unsigned char*)"Eacgr", 904}, + {(const unsigned char*)"blk34", 9619}, + {(const unsigned char*)"eacgr", 941}, + {(const unsigned char*)"LongLeftArrow", 10229}, + {(const unsigned char*)"lE", 8806}, + {(const unsigned char*)"nsmid", 8740}, + {(const unsigned char*)"uacgr", 973}, + {(const unsigned char*)"boxVR", 9568}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Oacgr", 908}, + {(const unsigned char*)"aacgr", 940}, + {(const unsigned char*)"oacgr", 972}, + {(const unsigned char*)"luruhar", 10598}, + {(const unsigned char*)"ii", 8520}, + {NULL, 0}, + {(const unsigned char*)"telrec", 8981}, + {NULL, 0}, + {(const unsigned char*)"DDotrahd", 10513}, + {(const unsigned char*)"nle", 8816}, + {(const unsigned char*)"gtrless", 8823}, + {NULL, 0}, + {(const unsigned char*)"midcir", 10992}, + {(const unsigned char*)"DownArrowBar", 10515}, + {NULL, 0}, + {(const unsigned char*)"semi", 59}, + {(const unsigned char*)"Uacgr", 910}, + {(const unsigned char*)"lbrace", 123}, + {(const unsigned char*)"phmmat", 8499}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rbrace", 125}, + {(const unsigned char*)"NotCongruent", 8802}, + {NULL, 0}, + {(const unsigned char*)"shchcy", 1097}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"simdot", 10858}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"cirmid", 10991}, + {NULL, 0}, + {(const unsigned char*)"SubsetEqual", 8838}, + {(const unsigned char*)"female", 9792}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nsc", 8833}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxVH", 9580}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ldrushar", 10571}, + {(const unsigned char*)"triangleright", 9657}, + {(const unsigned char*)"gneqq", 8809}, + {NULL, 0}, + {(const unsigned char*)"DownArrow", 8595}, + {NULL, 0}, + {(const unsigned char*)"backsim", 8765}, + {(const unsigned char*)"lneqq", 8808}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Sum", 8721}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"fflig", 64256}, + {NULL, 0}, + {(const unsigned char*)"hardcy", 1098}, + {(const unsigned char*)"nsub", 8836}, + {NULL, 0}, + {(const unsigned char*)"napprox", 8777}, + {(const unsigned char*)"caret", 8257}, + {NULL, 0}, + {(const unsigned char*)"succneqq", 10934}, + {(const unsigned char*)"frac13", 8531}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"num", 35}, + {(const unsigned char*)"emsp14", 8197}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sum", 8721}, + {NULL, 0}, + {(const unsigned char*)"Cconint", 8752}, + {NULL, 0}, + {(const unsigned char*)"blacktriangleright", 9656}, + {NULL, 0}, + {(const unsigned char*)"SupersetEqual", 8839}, + {(const unsigned char*)"sim", 8764}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LeftFloor", 8970}, + {NULL, 0}, + {(const unsigned char*)"RightTriangleEqual", 8885}, + {NULL, 0}, + {(const unsigned char*)"boxDr", 9555}, + {NULL, 0}, + {(const unsigned char*)"plus", 43}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"phiv", 966}, + {NULL, 0}, + {(const unsigned char*)"npr", 8832}, + {(const unsigned char*)"RightCeiling", 8969}, + {(const unsigned char*)"phone", 9742}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"mnplus", 8723}, + {NULL, 0}, + {(const unsigned char*)"vDash", 8872}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"isindot", 8949}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"PSgr", 936}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ntriangleleft", 8938}, + {(const unsigned char*)"image", 8465}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxh", 9472}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"RightDownVector", 8642}, + {(const unsigned char*)"scpolint", 10771}, + {(const unsigned char*)"boxdL", 9557}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"RightUpTeeVector", 10588}, + {NULL, 0}, + {(const unsigned char*)"TSHcy", 1035}, + {(const unsigned char*)"longmapsto", 10236}, + {(const unsigned char*)"doublebarwedge", 8966}, + {(const unsigned char*)"frasl", 8260}, + {NULL, 0}, + {(const unsigned char*)"DoubleLongRightArrow", 10233}, + {(const unsigned char*)"gnE", 8809}, + {NULL, 0}, + {(const unsigned char*)"lnE", 8808}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"exponentiale", 8519}, + {NULL, 0}, + {(const unsigned char*)"larrfs", 10525}, + {(const unsigned char*)"NotDoubleVerticalBar", 8742}, + {NULL, 0}, + {(const unsigned char*)"curlywedge", 8911}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rarrfs", 10526}, + {(const unsigned char*)"quatint", 10774}, + {NULL, 0}, + {(const unsigned char*)"frac58", 8541}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"gtreqless", 8923}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"PrecedesSlantEqual", 8828}, + {NULL, 0}, + {(const unsigned char*)"DotEqual", 8784}, + {(const unsigned char*)"iquest", 191}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"NotEqual", 8800}, + {NULL, 0}, + {(const unsigned char*)"barwedge", 8965}, + {(const unsigned char*)"b.gammad", 989}, + {NULL, 0}, + {(const unsigned char*)"block", 9608}, + {NULL, 0}, + {(const unsigned char*)"strns", 175}, + {NULL, 0}, + {(const unsigned char*)"prod", 8719}, + {(const unsigned char*)"cupre", 8828}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"SquareUnion", 8852}, + {(const unsigned char*)"Auml", 196}, + {NULL, 0}, + {(const unsigned char*)"upuparrows", 8648}, + {NULL, 0}, + {(const unsigned char*)"Euml", 203}, + {(const unsigned char*)"HorizontalLine", 9472}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Iuml", 207}, + {(const unsigned char*)"nvrArr", 10499}, + {(const unsigned char*)"bullet", 8226}, + {(const unsigned char*)"ClockwiseContourIntegral", 8754}, + {NULL, 0}, + {(const unsigned char*)"prop", 8733}, + {(const unsigned char*)"Ouml", 214}, + {NULL, 0}, + {(const unsigned char*)"chcy", 1095}, + {(const unsigned char*)"quaternions", 8461}, + {(const unsigned char*)"beth", 8502}, + {(const unsigned char*)"macr", 175}, + {(const unsigned char*)"Uuml", 220}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"khcy", 1093}, + {(const unsigned char*)"Star", 8902}, + {(const unsigned char*)"copysr", 8471}, + {(const unsigned char*)"Yuml", 376}, + {NULL, 0}, + {(const unsigned char*)"curren", 164}, + {NULL, 0}, + {(const unsigned char*)"Square", 9633}, + {(const unsigned char*)"shcy", 1096}, + {(const unsigned char*)"auml", 228}, + {NULL, 0}, + {(const unsigned char*)"boxUR", 9562}, + {(const unsigned char*)"uml", 168}, + {(const unsigned char*)"euml", 235}, + {NULL, 0}, + {(const unsigned char*)"zhcy", 1078}, + {(const unsigned char*)"iuml", 239}, + {NULL, 0}, + {(const unsigned char*)"Backslash", 8726}, + {(const unsigned char*)"square", 9633}, + {NULL, 0}, + {(const unsigned char*)"sqsube", 8849}, + {(const unsigned char*)"ouml", 246}, + {NULL, 0}, + {(const unsigned char*)"Tilde", 8764}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"prap", 10935}, + {(const unsigned char*)"uuml", 252}, + {(const unsigned char*)"cire", 8791}, + {NULL, 0}, + {(const unsigned char*)"dzigrarr", 10239}, + {(const unsigned char*)"yuml", 255}, + {(const unsigned char*)"star", 9734}, + {(const unsigned char*)"sqsubseteq", 8849}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"fork", 8916}, + {(const unsigned char*)"supsetneqq", 10956}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DoubleDownArrow", 8659}, + {NULL, 0}, + {(const unsigned char*)"dharr", 8642}, + {(const unsigned char*)"lagran", 8466}, + {NULL, 0}, + {(const unsigned char*)"lrhard", 10605}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"downharpoonleft", 8643}, + {(const unsigned char*)"tilde", 732}, + {(const unsigned char*)"nharr", 8622}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"puncsp", 8200}, + {(const unsigned char*)"uharr", 8638}, + {(const unsigned char*)"boxHu", 9575}, + {(const unsigned char*)"models", 8871}, + {(const unsigned char*)"xharr", 10231}, + {(const unsigned char*)"nparallel", 8742}, + {NULL, 0}, + {(const unsigned char*)"Proportional", 8733}, + {NULL, 0}, + {(const unsigned char*)"ltrif", 9666}, + {NULL, 0}, + {(const unsigned char*)"dtrif", 9662}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"subsetneqq", 10955}, + {(const unsigned char*)"NotGreaterEqual", 8817}, + {(const unsigned char*)"rtrif", 9656}, + {NULL, 0}, + {(const unsigned char*)"utrif", 9652}, + {(const unsigned char*)"boxvl", 9508}, + {(const unsigned char*)"curvearrowleft", 8630}, + {(const unsigned char*)"lessapprox", 10885}, + {(const unsigned char*)"scnE", 10934}, + {(const unsigned char*)"thetasym", 977}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ExponentialE", 8519}, + {(const unsigned char*)"andv", 10842}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"mapstodown", 8615}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DownLeftVector", 8637}, + {(const unsigned char*)"rightharpoonup", 8640}, + {(const unsigned char*)"mapsto", 8614}, + {(const unsigned char*)"Lang", 12298}, + {(const unsigned char*)"SquareSuperset", 8848}, + {(const unsigned char*)"rightsquigarrow", 8605}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Rang", 12299}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"sigmav", 962}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"SquareIntersection", 8851}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"downharpoonright", 8642}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lang", 9001}, + {(const unsigned char*)"compfn", 8728}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rang", 9002}, + {NULL, 0}, + {(const unsigned char*)"Leftrightarrow", 8660}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ReverseEquilibrium", 8651}, + {NULL, 0}, + {(const unsigned char*)"Rightarrow", 8658}, + {(const unsigned char*)"planck", 8463}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"KHgr", 935}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"OHgr", 937}, + {(const unsigned char*)"PHgr", 934}, + {NULL, 0}, + {(const unsigned char*)"sqsup", 8848}, + {NULL, 0}, + {(const unsigned char*)"THgr", 920}, + {NULL, 0}, + {(const unsigned char*)"rppolint", 10770}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"gtrapprox", 10886}, + {(const unsigned char*)"LongLeftRightArrow", 10231}, + {NULL, 0}, + {(const unsigned char*)"iinfin", 10716}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"frac16", 8537}, + {NULL, 0}, + {(const unsigned char*)"leftrightarrow", 8596}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rightarrow", 8594}, + {(const unsigned char*)"risingdotseq", 8787}, + {NULL, 0}, + {(const unsigned char*)"blacksquare", 9642}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DotDot", 8412}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"radic", 8730}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"nRightarrow", 8655}, + {NULL, 0}, + {(const unsigned char*)"reals", 8477}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"varphi", 966}, + {NULL, 0}, + {(const unsigned char*)"DownRightVector", 8641}, + {(const unsigned char*)"Equal", 10869}, + {(const unsigned char*)"NotCupCap", 8813}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"SucceedsTilde", 8831}, + {NULL, 0}, + {(const unsigned char*)"Succeeds", 8827}, + {(const unsigned char*)"dotplus", 8724}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"notniva", 8716}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"looparrowright", 8620}, + {(const unsigned char*)"ggg", 8921}, + {(const unsigned char*)"EmptySmallSquare", 9723}, + {NULL, 0}, + {(const unsigned char*)"nrtri", 8939}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"oS", 9416}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"IEcy", 1045}, + {NULL, 0}, + {(const unsigned char*)"succeq", 10928}, + {(const unsigned char*)"vrtri", 8883}, + {(const unsigned char*)"DownTeeArrow", 8615}, + {NULL, 0}, + {(const unsigned char*)"frac45", 8536}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"dblac", 733}, + {NULL, 0}, + {(const unsigned char*)"blk14", 9617}, + {NULL, 0}, + {(const unsigned char*)"lesseqqgtr", 10891}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"yucy", 1102}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"yicy", 1111}, + {NULL, 0}, + {(const unsigned char*)"gne", 10888}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"udhar", 10606}, + {(const unsigned char*)"UnionPlus", 8846}, + {(const unsigned char*)"blank", 9251}, + {(const unsigned char*)"lne", 10887}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"NotTildeFullEqual", 8775}, + {(const unsigned char*)"supE", 10950}, + {NULL, 0}, + {(const unsigned char*)"PlusMinus", 177}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"GreaterTilde", 8819}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"duarr", 8693}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"LeftDoubleBracket", 12314}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"CounterClockwiseContourIntegral", 8755}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"natural", 9838}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"uuarr", 8648}, + {(const unsigned char*)"biguplus", 10756}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DownLeftVectorBar", 10582}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"subE", 10949}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"part", 8706}, + {(const unsigned char*)"drcorn", 8991}, + {(const unsigned char*)"horbar", 8213}, + {(const unsigned char*)"sbsol", 65128}, + {(const unsigned char*)"varrho", 1009}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"cudarrl", 10552}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"boxul", 9496}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"ordm", 186}, + {NULL, 0}, + {(const unsigned char*)"urcorn", 8989}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"dotminus", 8760}, + {(const unsigned char*)"scnsim", 8937}, + {(const unsigned char*)"andslope", 10840}, + {(const unsigned char*)"Cfr", 8493}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rightthreetimes", 8908}, + {(const unsigned char*)"Hfr", 8460}, + {(const unsigned char*)"sqsubset", 8847}, + {(const unsigned char*)"lAtail", 10523}, + {(const unsigned char*)"rightleftharpoons", 8652}, + {(const unsigned char*)"Ifr", 8465}, + {(const unsigned char*)"infintie", 10717}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rAtail", 10524}, + {(const unsigned char*)"scnap", 10938}, + {(const unsigned char*)"lharul", 10602}, + {(const unsigned char*)"Rfr", 8476}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"parallel", 8741}, + {(const unsigned char*)"rharul", 10604}, + {NULL, 0}, + {(const unsigned char*)"Zfr", 8488}, + {(const unsigned char*)"RuleDelayed", 10740}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"RightArrowLeftArrow", 8644}, + {(const unsigned char*)"profsurf", 8979}, + {(const unsigned char*)"nsupseteq", 8841}, + {(const unsigned char*)"nearhk", 10532}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"triangledown", 9663}, + {NULL, 0}, + {(const unsigned char*)"searhk", 10533}, + {(const unsigned char*)"empty", 8709}, + {NULL, 0}, + {(const unsigned char*)"DoubleUpArrow", 8657}, + {(const unsigned char*)"checkmark", 10003}, + {NULL, 0}, + {(const unsigned char*)"succapprox", 10936}, + {NULL, 0}, + {(const unsigned char*)"Cap", 8914}, + {(const unsigned char*)"RightTriangle", 8883}, + {NULL, 0}, + {(const unsigned char*)"tosa", 10537}, + {(const unsigned char*)"RightUpVector", 8638}, + {NULL, 0}, + {(const unsigned char*)"boxVL", 9571}, + {(const unsigned char*)"ecolon", 8789}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"Map", 10501}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"lbrack", 91}, + {(const unsigned char*)"THORN", 222}, + {(const unsigned char*)"DownArrowUpArrow", 8693}, + {NULL, 0}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"rbrack", 93}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"DiacriticalTilde", 732}, + {(const unsigned char*)"amp", 38}, + {(const unsigned char*)"rlhar2", 8652}, + {NULL, 0}, + {(const unsigned char*)"bcong", 8780}, + {NULL, 0}, + {NULL, 0}, + {(const unsigned char*)"exist", 8707}, + {(const unsigned char*)"ord", 10845}, + {NULL, 0}, + {(const unsigned char*)"cap", 8745}, + {(const unsigned char*)"eeacgr", 942}, + {(const unsigned char*)"PrecedesTilde", 8830}, + {(const unsigned char*)"divideontimes", 8903}, + {(const unsigned char*)"Precedes", 8826}, +}; +const struct hashtable entities_htable = { + entities_htable_elements, 3079, 1643, 2463 +}; Added: test-suite/trunk/MultiSource/Applications/ClamAV/execs.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/execs.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/execs.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/execs.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2005 Tomasz Kojm + * + * 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 of the License, 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. + */ + +#ifndef __EXECS_H +#define __EXECS_H + +#include "cltypes.h" +#include + +struct cli_exe_section { + uint32_t rva; + uint32_t vsz; + uint32_t raw; + uint32_t rsz; + uint32_t chr; + uint32_t urva; /* PE - unaligned VirtualAddress */ + uint32_t uvsz; /* PE - unaligned VirtualSize */ + uint32_t uraw; /* PE - unaligned PointerToRawData */ + uint32_t ursz; /* PE - unaligned SizeOfRawData */ +}; + +struct cli_exe_info { + uint32_t ep; + uint16_t nsections; + off_t offset; + struct cli_exe_section *section; +}; + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/filetypes.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/filetypes.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/filetypes.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/filetypes.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2002 - 2005 Tomasz Kojm + * With enhancements from Thomas Lamy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __FILETYPES_H +#define __FILETYPES_H + +#include + +#define MAGIC_BUFFER_SIZE 256 +#define CL_TYPENO 500 +#define MAX_EMBEDDED_OBJ 10 + +typedef enum { + CL_TYPE_UNKNOWN_TEXT = CL_TYPENO, + CL_TYPE_UNKNOWN_DATA, + CL_TYPE_MSEXE, + CL_TYPE_ELF, + CL_TYPE_DATA, + CL_TYPE_POSIX_TAR, + CL_TYPE_OLD_TAR, + CL_TYPE_GZ, + CL_TYPE_ZIP, + CL_TYPE_BZ, + CL_TYPE_RAR, + CL_TYPE_ARJ, + CL_TYPE_MSSZDD, + CL_TYPE_MSOLE2, + CL_TYPE_MSCAB, + CL_TYPE_MSCHM, + CL_TYPE_SIS, + CL_TYPE_SCRENC, + CL_TYPE_GRAPHICS, + CL_TYPE_RIFF, + CL_TYPE_BINHEX, + CL_TYPE_TNEF, + CL_TYPE_CRYPTFF, + CL_TYPE_PDF, + CL_TYPE_UUENCODED, + CL_TYPE_PST, /* Microsoft Outlook binary email folder (.pst file) */ + CL_TYPE_HTML_UTF16, + CL_TYPE_RTF, + + /* bigger numbers have higher priority (in o-t-f detection) */ + CL_TYPE_HTML, /* on the fly */ + CL_TYPE_MAIL, /* magic + on the fly */ + CL_TYPE_SFX, /* foo SFX marker */ + CL_TYPE_ZIPSFX, /* on the fly */ + CL_TYPE_RARSFX, /* on the fly */ + CL_TYPE_CABSFX, + CL_TYPE_ARJSFX, + CL_TYPE_NULSFT, /* on the fly */ + CL_TYPE_AUTOIT +} cli_file_t; + +struct cli_matched_type { + cli_file_t type; + off_t offset; + unsigned short cnt; + struct cli_matched_type *next; +}; + +cli_file_t cli_filetype(const unsigned char *buf, size_t buflen); +cli_file_t cli_filetype2(int desc, const struct cl_engine *engine); +int cli_addtypesigs(struct cl_engine *engine); + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/fsg.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/fsg.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/fsg.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/fsg.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2004 aCaB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __FSG_H +#define __FSG_H + +#include "cltypes.h" +#include "execs.h" + +int unfsg_200(char *, char *, int, int, uint32_t, uint32_t, uint32_t, int); +int unfsg_133(char *, char *, int , int, struct cli_exe_section *, int, uint32_t, uint32_t, int); + +#endif + + + Added: test-suite/trunk/MultiSource/Applications/ClamAV/getopt.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/getopt.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/getopt.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/getopt.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,180 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _GETOPT_H + +#ifndef __need_getopt +# define _GETOPT_H 1 +#endif + +/* If __GNU_LIBRARY__ is not already defined, either we are being used + standalone, or this is the first header included in the source file. + If we are being used with glibc, we need to include , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in for us + if it's from glibc. (Why ctype.h? It's guaranteed to exist and it + doesn't flood the namespace with stuff the way some other headers do.) */ +#if !defined __GNU_LIBRARY__ +# include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +#ifndef __need_getopt +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +# if defined __STDC__ && __STDC__ + const char *name; +# else + char *name; +# endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +# define no_argument 0 +# define required_argument 1 +# define optional_argument 2 +#endif /* need getopt */ + + +/* Get definitions and prototypes for functions to process the + arguments in ARGV (ARGC of them, minus the program name) for + options given in OPTS. + + Return the option character from OPTS just read. Return -1 when + there are no more options. For unrecognized options, or options + missing arguments, `optopt' is set to the option letter, and '?' is + returned. + + The OPTS string is a list of characters which are recognized option + letters, optionally followed by colons, specifying that that letter + takes an argument, to be placed in `optarg'. + + If a letter in OPTS is followed by two colons, its argument is + optional. This behavior is specific to the GNU `getopt'. + + The argument `--' causes premature termination of argument + scanning, explicitly telling `getopt' that there are no more + options. + + If OPTS begins with `--', then non-option arguments are treated as + arguments to the option '\0'. This behavior is specific to the GNU + `getopt'. */ + +#if defined __STDC__ && __STDC__ +# ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int __argc, char *const *__argv, const char *__shortopts); +# else /* not __GNU_LIBRARY__ */ +extern int getopt (); +# endif /* __GNU_LIBRARY__ */ + +# ifndef __need_getopt +extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); +# endif +#else /* not __STDC__ */ +extern int getopt (); +# ifndef __need_getopt +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +# endif +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +/* Make sure we later can get all the definitions and declarations. */ +#undef __need_getopt + +#endif /* getopt.h */ Added: test-suite/trunk/MultiSource/Applications/ClamAV/global.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/global.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/global.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/global.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2002 - 2004 Tomasz Kojm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __GLOBAL_H +#define __GLOBAL_H + +struct s_info { + unsigned int sigs; /* number of signatures */ + unsigned int dirs; /* number of scanned directories */ + unsigned int files; /* number of scanned files */ + unsigned int ifiles; /* number of infected files */ + unsigned int notremoved; /* number of not removed files (if --remove) */ + unsigned int notmoved; /* number of not moved files (if --move) */ + unsigned long int blocks; /* number of read 16kb blocks */ +}; + +extern struct s_info info; +extern short recursion, printinfected, bell; + +#endif Added: test-suite/trunk/MultiSource/Applications/ClamAV/hashtab.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/hashtab.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/hashtab.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/hashtab.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,88 @@ +/* + * HTML Entity & Encoding normalization. + * + * Copyright (C) 2006 T?r?k Edvin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + */ + +#include +#include +#ifndef _HASHTAB_H +#define _HASHTAB_H + +typedef long element_data; + +/* define this for debugging/profiling purposes only, NOT in production/release code */ +#ifdef PROFILE_HASHTABLE + + +typedef struct { + size_t calc_hash; + size_t found; + size_t find_req; + size_t found_tries; + size_t not_found; + size_t not_found_tries; + size_t grow_found; + size_t grow_found_tries; + size_t grow; + size_t update; + size_t update_tries; + size_t inserts; + size_t insert_tries; + size_t deleted_reuse; + size_t deleted_tries; + size_t deletes; + size_t clear; + size_t hash_exhausted; +} PROFILE_STRUCT_; + +#define STRUCT_PROFILE PROFILE_STRUCT_ PROFILE_STRUCT; +#else + +#define STRUCT_PROFILE + +#endif +struct element +{ + const unsigned char* key; + element_data data; +}; + +struct hashtable { + struct element* htable; + size_t capacity; + size_t used; + size_t maxfill;/* 80% */ + + STRUCT_PROFILE +}; + + + +int hashtab_generate_c(const struct hashtable *s,const char* name); +struct element* hashtab_find(const struct hashtable *s,const unsigned char* key,const size_t len); +int hashtab_init(struct hashtable *s,size_t capacity); +int hashtab_insert(struct hashtable *s,const unsigned char* key,size_t len,element_data data); +void hashtab_delete(struct hashtable *s,const unsigned char* key,const size_t len); +void hashtab_clear(struct hashtable *s); + +int hashtab_load(FILE* in, struct hashtable *s); +int hashtab_store(const struct hashtable *s,FILE* out); + +#endif + Added: test-suite/trunk/MultiSource/Applications/ClamAV/htmlnorm.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/htmlnorm.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/htmlnorm.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/htmlnorm.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2004 Trog + * + * 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 of the License, 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. + */ + +#ifndef __HTMLNORM_H +#define __HTMLNORM_H + +typedef struct tag_arguments_tag +{ + int count; + int scanContents; + unsigned char **tag; + unsigned char **value; + struct blob **contents; +} tag_arguments_t; + +typedef struct m_area_tag { + unsigned char *buffer; + off_t length; + off_t offset; +} m_area_t; + + +unsigned char *cli_readline(FILE *stream, m_area_t *m_area, unsigned int max_len); +int html_normalise_mem(unsigned char *in_buff, off_t in_size, const char *dirname, tag_arguments_t *hrefs,const struct cli_dconf* dconf); +int html_normalise_fd(int fd, const char *dirname, tag_arguments_t *hrefs,const struct cli_dconf* dconf); +void html_tag_arg_free(tag_arguments_t *tags); +int html_screnc_decode(int fd, const char *dirname); + +#endif + Added: test-suite/trunk/MultiSource/Applications/ClamAV/iana_tld.h URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/iana_tld.h?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/iana_tld.h (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/iana_tld.h Wed Jan 30 15:17:10 2008 @@ -0,0 +1,27 @@ +/* + * Phishing module: iana tld list. + * + * Copyright (C) 2006 Torok Edvin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + */ + +#ifndef IANA_TLD_H +#define IANA_TLD_H +#define iana_tld "(A[CDEFGILMNOQRSTUWXZ]|B[ABDEFGHIJMNORSTVWYZ]|C[ACDFGHIKLMNORUVXYZ]|D[EJKMOZ]|E[CEGRSTU]|F[IJKMOR]|G[ABDEFGHILMNPQRSTUWY]|H[KMNRTU]|I[DELMNOQRST]|J[EMOP]|K[EGHIMNRWYZ]|L[ABCIKRSTUVY]|M[ACDGHKLMNOPQRSTUVWXYZ]|N[ACEFGILOPRUZ]|OM|P[AEFGHKLMNRSTWY]|QA|R[EOUW]|S[ABCDEGHIJKLMNORTUVYZ]|T[CDFGHJKLMNOPRTVWZ]|U[AGKMSYZ]|V[ACEGINU]|W[FS]|Y[ETU]|Z[AMW]|BIZ|CAT|COM|EDU|GOV|INT|MIL|NET|ORG|PRO|AERO|ARPA|COOP|INFO|JOBS|MOBI|NAME|MUSEUM)" +#define iana_cctld "(a[dfilmoqrtuwxz]|b[bdeghijmorstwyz]|c[ahlmnosuy]|d[ejkmz]|e[cegrstu]|f[ijr]|g[abdeghilmnprtuwy]|h[nrtu]|i[delnqst]|j[emop]|k[eghimwz]|l[birstuv]|m[acglmnoqrstuvwxyz]|n[aegilopru]|om|p[aehkltwy]|qa|r[ow]|s[cdeginorz]|t[dghjklmnorvwz]|u[agyz]|v[enu]|ws|y[etu])" +#endif + Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/README URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/README?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/inputs/README (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/inputs/README Wed Jan 30 15:17:10 2008 @@ -0,0 +1,3 @@ +clam.exe is an extremely small (544 bytes!) MZ+PE executable that prints +a nice message :-) You can use it to test attachment scanning in your ClamAV +based mail scanner. Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v2.rar URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v2.rar?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v2.rar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v3.rar URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v3.rar?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam-v3.rar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.cab URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.cab?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.cab ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe.bz2 URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe.bz2?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.exe.bz2 ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.zip URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.zip?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clam.zip ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clamdoc.pdf URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clamdoc.pdf?rev=46573&view=auto ============================================================================== Binary file - no diff available. Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/clamdoc.pdf ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc1.rtf URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc1.rtf?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc1.rtf (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc1.rtf Wed Jan 30 15:17:10 2008 @@ -0,0 +1,111 @@ +{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f36\froman\fcharset238\fprq2 Times New Roman CE;} +{\f37\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f39\froman\fcharset161\fprq2 Times New Roman Greek;}{\f40\froman\fcharset162\fprq2 Times New Roman Tur;}{\f41\froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f42\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f43\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f44\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255; +\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0; +\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive \ssemihidden +Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid11825703}{\*\generator Micr +osoft Word 11.0.5604;}{\info{\title }{\author edwin}{\operator edwin}{\creatim\yr2006\mo11\dy19\hr19\min31}{\revtim\yr2006\mo11\dy19\hr19\min31}{\version1}{\edmins0}{\nofpages1}{\nofwords3}{\nofchars18}{\*\company -}{\nofcharsws20}{\vern24689}} +\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1800\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot11825703\newtblstyruls\nogrowautofit \fet0\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}} +{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (} +{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain +\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 +\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033\insrsid11825703 {\object\objemb\objw855\objh765{\*\objclass Package}{\*\objdata 0105000002000000080000005061636b6167650000000000000000005b020000 +0200436c616d2e65786500443a5c727466735c636c616d2e657865000000030011000000443a5c727466735c636c616d2e65786500200200004d5a50000200000004000f00ffff0000b80000002100000040001a00000000000000000000000000000000000000000000000000000000000000000000010000bb71104000 +33c050508bf3535350b02940300466ac79f9ba3100780dad50ff66700e1fbe3100e9e5ffb409cd21b44ccd21620c0a0102707617021e4e0c042fdacc100000000000000000000000000000c010000080100000000000000000000000000000da100000f410000000000000000000000000000000000000000000004b4552 +4e454c33322e444c4c00004578697450726f63657373005553455233322e444c4c00434c414d657373616765426f784100e6100000000000003f3f3f3f504500004c010100614361420000000000000000e0008e810b01021900040000000600000000000040100000001000004000000000004000001000000002000001 +0000000000000003000a0000000000002000000004000000000000020000000000100000200000000010000010000000000000100000000000000000000000841000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005b434c414d41565d00100000001000000002000001000000000000000000000000000000000000c0000001050000050000000d0000004d45544146494c455049435400 +e4050000bbfaffff7c0e00000800e40545050000 +0100090000033a0700000200210600000000050000000b0200000000050000000c02320038001c000000fb02f5ff000000000000900100000001040002005461686f6d6100006f070aa744f70700b8a4f377c1a4f3772030f577a7056613040000002d01000005000000090200000000050000000102ffffff00a5000000 +410bc600880020002000000000002000200000000c002800000020000000400000000100010000000000000100000000000000000000000000000000000000000000ffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffff21060000410b4600660020002000000000002000200000000c002800000020000000200000000100180000000000000c00000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 +8080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080000000808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +c0c0c0c0c0c0c0c0c0c0c0c0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0 +c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c080808000 +0000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0 +c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c080808080808080808080 +8080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080c0c0c0808080000000808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0808080000000808080c0c0c0bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf000000000000000000000000000000 +0000000000000000000000000000808080000000808080c0c0c0bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000c0c0c0c0c0c0000000c0c0c0c0c0c0000000c0c0c0c0c0c0000000808080000000808080c0c0c0bf0000bf +0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000c0c0c0c0c0c0000000c0c0c0c0c0c0000000c0c0c0c0c0c0000000808080000000808080c0c0c0bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf +0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000808080000000808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c080808000000080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000020101000000050000002e01060000000a00000021050800436c616d2e65786521001c001c000000fb021000070000000000bc020000000001020222 +53797374656d0000a705661300000a0026008a0100000000ffffffffd0f70700040000002d010100030000000000}{\result {\insrsid11825703 {\pict{\*\picprop\shplid1025{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}} +{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0 +\picw1508\pich1349\picwgoal855\pichgoal765\wmetafile8\bliptag-476490493\blipupi94{\*\blipuid e3995503256cfa9cb3be14e2d301ee38}0100090000033a0700000200210600000000050000000b0200000000050000000c02320038001c000000fb02f5ff000000000000900100000001040002005461 +686f6d6100006f070aa744f70700b8a4f377c1a4f3772030f577a7056613040000002d01000005000000090200000000050000000102ffffff00a5000000410b +c600880020002000000000002000200000000c002800000020000000400000000100010000000000000100000000000000000000000000000000000000000000 +ffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000ffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff +ffffffff21060000410b4600660020002000000000002000200000000c002800000020000000200000000100180000000000000c000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 +8080808080808080808080808080808080808080808080808080808080808080808080000000808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0808080000000808080c0c0c0808080ffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0c0c0 +808080000000808080c0c0c080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 +8080808080808080808080808080808080808080808080808080808080c0c0c0808080000000808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +808080000000808080c0c0c0bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf +0000bf0000000000000000000000000000000000000000000000000000000000808080000000808080c0c0c0bf0000bf0000bf0000bf0000bf0000bf0000bf00 +00bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000c0c0c0c0c0c0000000c0c0c0c0c0c0000000c0c0c0c0c0c0000000 +808080000000808080c0c0c0bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf +0000bf0000c0c0c0c0c0c0000000c0c0c0c0c0c0000000c0c0c0c0c0c0000000808080000000808080c0c0c0bf0000bf0000bf0000bf0000bf0000bf0000bf00 +00bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000bf0000 +808080000000808080c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0 +c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c08080800000008080808080808080808080808080808080808080808080808080 +80808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080 +80808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000005000000020101000000050000002e01060000000a00000021050800436c616d2e65786521001c001c000000fb021000070000000000bc02000000000102022253797374656d0000a705661300000a0026008a0100000000ffffffffd0f70700040000002d010100030000000000}}}}}{\insrsid11825703 + +\par }} \ No newline at end of file Propchange: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc1.rtf ------------------------------------------------------------------------------ svn:executable = * Added: test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc11.rtf URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc11.rtf?rev=46573&view=auto ============================================================================== --- test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc11.rtf (added) +++ test-suite/trunk/MultiSource/Applications/ClamAV/inputs/rtf-test/Doc11.rtf Wed Jan 30 15:17:10 2008 @@ -0,0 +1,545 @@ +{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f36\froman\fcharset238\fprq2 Times New Roman CE;} +{\f37\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f39\froman\fcharset161\fprq2 Times New Roman Greek;}{\f40\froman\fcharset162\fprq2 Times New Roman Tur;}{\f41\froman\fcharset177\fprq2 Times New Roman (Hebrew);} +{\f42\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f43\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f44\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255; +\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0; +\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive \ssemihidden +Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv +\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid5398644\rsid11825703} +{\*\generator Microsoft Word 11.0.5604;}{\info{\title }{\author edwin}{\operator edwin}{\creatim\yr2006\mo11\dy19\hr19\min33}{\revtim\yr2006\mo11\dy19\hr19\min33}{\version2}{\edmins0}{\nofpages1}{\nofwords4}{\nofchars27}{\*\company -}{\nofcharsws30} +{\vern24689}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1800\dgvorigin1440\dghshow1\dgvshow1 +\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct +\asianbrkrule\rsidroot11825703\newtblstyruls\nogrowautofit \fet0\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}} +{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (} +{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain +\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 +\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033\insrsid5398644 {\object\objemb\objsetsize\objw840\objh764{\*\objclass Word.Document.8}{\*\objdata 010500000200000010000000576f72642e446f63756d656e742e3800000000000000000000420000 +d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000a00000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +fffffffffffffffffdffffff1000000003000000040000000500000006000000070000000800000009000000fefffffffeffffff0c0000000d0000000e0000000f00000012000000110000001d000000130000001e00000015000000160000001700000018000000190000001a0000001b0000001c000000fefffffffeff +ffff1f000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff040000000609020000000000c0000000000000460000000000000000000000004032 +39d4000cc7010b0000008010000000000000440061007400610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 +000000000000000002000000001000000000000031005400610062006c006500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0002000100000003000000ffffffff0000000000000000000000000000000000000000000000000000 +0000000000000000000000000000d008000000000000010043006f006d0070004f0062006a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000201ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +00000000000000000000000024000000710000000000000026020000440064000000000000000a000000000000000100000000005703fd02e803e80300000000000000000000000000000000000000000000000000000000000000000f0004f03e000000b2040af00800000001040000000a000023000bf00c0000000441 +01000000ff0100000800130022f106000000bf0300800080000010f00400000000000080320007f0940100000304d0187bf57f117cb8394a957eb39fe4ddff007001000001000000440000000000140060211bf068010000d0187bf57f117cb8394a957eb39fe4dd740e000000000000000000003800000032000000a048 +0800086907003601000000fe78da6364e0646060b6626760606250646300025620e66682b178988c182c186480acdf4c5fff3380c1044620c1c802d4119298919f9bc8c0b08e9dcb98e10f3bc38e259fcb0f02b182c1d7f2771c699c2c4085ba8c109338e1663232fdffff9f612990e5c87d8ca183410108410042f33068 +80d90c0c0e20b50c8c104ba1143a009934d0e0ff0039e23f1480e2cd91db8d210d67482a80035002a28d8761d881065a0288f907680390cd0792ffa90a46cd1f357fd4fc51f347cd1f359f3ee65317a0994febfa773f030379087fcb8472f3214e65c0c61812e6e341748b5f9ab60f873a00f5ca981819a12c3d46504790 +0b88155939189c731273f5522b521581bd40483f5080811dac6b0fb847c7c8c4a4145c595c929acbc000eaf38174aa317431c27a283dc07e21a41fc8c8c00cd6070086641bbe0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000002000000030000000400000005000000060000000700000008000000090000000a00 +00000b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e0000001f00000020000000210000002200000023000000feffffff25000000fefffffffefffffffeffffff29000000 +fefffffffeffffff2c0000002d0000002e0000002f000000300000003100000032000000330000003400000035000000feffffff3700000038000000390000003a0000003b0000003c000000feffffff3e0000003f0000004000000041000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff86020f00120001009c000f00040000000000000000000400000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000040f1ff020040000c04 +000000000000000006004e006f0072006d0061006c000000020000001800434a18005f480104614a18006d480904734809047448090400000000000000000000000000000000000044004140f2ffa10044000c0500000000000000001600440065006600610075006c007400200050006100720061006700720061007000 +6800200046006f006e0074000000000052006900f3ffb30052000c0500000000000000000c005400610062006c00650020004e006f0072006d0061006c0000001c0017f603000034d60600010a036c0034d60600010503000061f603000002000b00000028006b40f4ffc10028000005000000000000000007004e006f00 +20004c00690073007400000002000c000000000000000000120000000600001000000100ffffffff000000001400000049c80030000000000000000001000000000000000000000000000007000600001208000005000000000600001208000006000000000600001208000007000000000000000e000000100000001200 +0000133a94ff95800f0000f038000000000006f01800000002040000020000000100000001000000010000000200000040001ef110000000ffff00000000ff0080808000f7000010000f0002f092000000100008f00800000001000000010400000f0003f0300000000f0004f028000000010009f0100000000000000000 +000000000000000000000002000af00800000000040000050000000f0004f04200000012000af00800000001040000000e000053000bf01e000000bf0100001000cb0100000000ff01000008000403090000003f0301000100000011f00400000001000000030000000400000008000000e50000000000000002000000ab +1d5600f91e8a000c43b300ff40021000000000000000120000006000001000400000ffff01000000070055006e006b006e006f0077006e00ffff0100080000000000000000000000ffff010000000000ffff00000200ffff00000000ffff00000200ffff000000000300000047169001000002020603050405020304877a +0020000000800800000000000000ff01000000000000540069006d006500730020004e0065007700200052006f006d0061006e00000035169001020005050102010706020507000000000000001000000000000000000000008000000000530079006d0062006f006c000000332690010000020b0604020202020204877a +0020000000800800000000000000ff0100000000000041007200690061006c000000220004000100881800f0d0020000680100000000d99cab06dc9cab06000000000100030000000200000010000000010001000000040003100100000002000000100000000100010000000100000000000000210300f0100000000100 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000807a005b400b4008181123400000000000000000000000000001100000011000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000020000000000000000000032831100f0100008000000000000000000000000000000000000000000000000000000000008000000000000f0ff0f0100013f000000000000ffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7f0c43b3000000 +0000320000000000000000000000000000000000ffff120000000000000001002000000000000000050065006400770069006e00050065006400770069006e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000100feff030a0000ffffffff0609020000000000c0000000000000461f0000004d6963726f736f6674204f666669636520576f726420446f63756d656e74000a0000004d53576f7264446f630010000000576f72642e446f63756d656e742e3800f439b27100000000000000000000000000000000000000 +0000000000000000000203000d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000020800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000003004f0062006a0049006e0066006f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000201020000000b000000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000 +2600000006000000000000004f0062006a0065006300740050006f006f006c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000101ffffffffffffffff060000000000000000000000000000000000000000000000403239d4000cc701403239d4000c +c7010000000000000000000000005f00310032003200350034003600390038003900370000000000000000000000000000000000000000000000000000000000000000000000000000000000000018000101ffffffffffffffff080000000c00030000000000c00000000000004600000000403239d4000cc701403239d4 +000cc70100000000000000000000000001004f006c00650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000 +000000000000270000001400000000000000010043006f006d0070004f0062006a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000120002010700000009000000ffffffff00000000000000000000000000000000000000000000000000000000 +000000000000000028000000500000000000000003004f0062006a0049006e0066006f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000201ffffffff0a000000ffffffff0000000000000000000000000000000000000000000000000000 +000000000000000000002a000000060000000000000001004f006c006500310030004e0061007400690076006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000200ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 +0000000000000000000000002b000000830200000000000057006f007200640044006f00630075006d0065006e007400000000000000000000000000000000000000000000000000000000000000000000000000000000001a000200050000000c000000ffffffff00000000000000000000000000000000000000000000 +00000000000000000000000000001400000032100000000000000100feff030a0000ffffffff0c00030000000000c000000000000046080000005061636b61676500080000005061636b61676500080000005061636b61676500f439b2710000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000800003000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f0200000200436c616d2e65786500433a5c444f43554d457e315c656477696e5c44 +65736b746f705c636c616d2e657865000000030023000000433a5c444f43554d457e315c656477696e5c4465736b746f705c636c616d2e65786500200200004d5a50000200000004000f00ffff0000b80000002100000040001a000000000000000000000000000000000000000000000000000000000000000000000100 +00bb7110400033c050508bf3535350b02940300466ac79f9ba3100780dad50ff66700e1fbe3100e9e5ffb409cd21b44ccd21620c0a0102707617021e4e0c042fdacc100000000000000000000000000000c010000080100000000000000000000000000000da100000f41000000000000000000000000000000000000000 +0000004b45524e454c33322e444c4c00004578697450726f63657373005553455233322e444c4c00434c414d657373616765426f784100e6100000000000003f3f3f3f504500004c010100614361420000000000000000e0008e810b01021900040000000600000000000040100000001000004000000000004000001000 +0000020000010000000000000003000a0000000000002000000004000000000000020000000000100000200000000010000010000000000000100000000000000000000000841000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005b434c414d41565d00100000001000000002000001000000000000000000000000000000000000c00000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000feff0000050102000000000000000000000000000000000001000000e0859ff2f94f6810ab9108002b27b3d93000000068010000110000000100000090000000020000009800000003000000a400000004000000b000 +000005000000c000000006000000cc00000007000000d800000008000000e800000009000000f8000000eca5c100716009040000f812bf000000000000100000000000060000120800000e00626a626a715071500000000000000000000000000000000000000904160032100000133a0100133a01001200000000000000 +000000000000000000000000000000000000000000000000ffff0f000000000000000000ffff0f000000000000000000ffff0f0000000000000000000000000000000000a40000000000a403000000000000a4030000a403000000000000a403000000000000a403000000000000a403000000000000a403000014000000 +0000000000000000b803000000000000dc03000000000000dc03000000000000dc03000000000000dc0300000c000000e80300000c000000b80300000000000072050000b600000000040000160000001604000000000000160400000000000016040000000000001604000000000000f104000000000000f10400000000 +0000f104000000000000150500000200000017050000000000001705000000000000170500000000000017050000000000001705000000000000170500000000000028060000680200009008000040000000170500001500000000000000000000000000000000000000a403000000000000f10400000000000000000000 +000000000000000000000000f104000000000000f104000000000000f104000000000000f10400000000000017050000000000000000000000000000a403000000000000a4030000000000001604000000000000000000000000000016040000db0000002c05000016000000f104000000000000f104000000000000f104 +000000000000f104000000000000a4030000000000001604000000000000a403000000000000160400000000000015050000000000000000000000000000f104000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f104000000000000 +15050000000000000000000000000000f1040000000000000000000000000000f104000000000000a403000000000000a4030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f104000000000000160400000000 +0000f40300000c000000b0e1ecab000cc7010000000000000000dc03000000000000f104000000000000f1040000000000000000000000000000150500000000000042050000300000007205000000000000f104000000000000d008000000000000f104000000000000d008000000000000f10400000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d0080000000000000000000000000000a403000000000000f10400002400000000000000000000000000000000000000f1040000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f104000000000000f104000000000000f104000000000000170500000000000017050000000000000000000000000000000000000000000000000000000000000000000000000000f104000000000000 +0000000000000000000000000000000000000000000000000000000000000000f104000000000000f104000000000000f1040000000000007205000000000000f104000000000000f104000000000000f104000000000000f1040000000000000000000000000000b803000000000000b803000000000000b80300002400 +0000dc03000000000000b803000000000000b803000000000000b803000000000000dc03000000000000b803000000000000b803000000000000b803000000000000a403000000000000a403000000000000a403000000000000a403000000000000a403000000000000a403000000000000ffffffff0000000002000c01 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013454d424544205061636b6167651401150d00000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000010800000e0800000f080000100800001108000012080000f7f3e8e0f7f300000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000f036a000000001668ab1d560055080115036ac92f0b490a080116680c43b3005508015608010616680c43b300000f036a0000000016680c43b30055080100060006000012080000fd000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010006000012080000fd00000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000