From pjenkins at apple.com Mon Aug 14 01:57:13 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Mon, 14 Aug 2006 01:57:13 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.cgi Message-ID: <200608140657.k7E6vDAw024946@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTestAccept.cgi updated: 1.44 -> 1.45 --- Log message: When a test program changes status from pass to fail or vice versa it will no longer incorreclty be adeded to the list of new tests and removed tests --- Diffs of the changes: (+19 -5) NightlyTestAccept.cgi | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-) Index: nightlytest-serverside/NightlyTestAccept.cgi diff -u nightlytest-serverside/NightlyTestAccept.cgi:1.44 nightlytest-serverside/NightlyTestAccept.cgi:1.45 --- nightlytest-serverside/NightlyTestAccept.cgi:1.44 Fri Aug 11 12:13:35 2006 +++ nightlytest-serverside/NightlyTestAccept.cgi Mon Aug 14 01:56:59 2006 @@ -597,20 +597,34 @@ $yesterdays_fails = $row->{'unexpfail_tests'}; $yesterdays_xfails = $row->{'expfail_tests'}; if($yesterdays_passes ne ""){ - $newly_passing_tests = Difference $passing_tests, $yesterdays_passes; + $newly_passing_tests = Difference $passing_tests, $yesterdays_passes; } else{ $newly_passing_tests=""; } if($yesterdays_xfails ne "" and $yesterdays_fails ne ""){ - $newly_failing_tests = Difference $expfail_tests."\n".$unexpfail_tests, - $yesterdays_xfails."\n".$yesterdays_fails; + $newly_failing_tests = Difference $expfail_tests."\n".$unexpfail_tests, + $yesterdays_xfails."\n".$yesterdays_fails; } else{ $newly_failing_tests=""; } +# The tests are stored in the database as a string with each test being +# seperated by a newline. Each test is prefixed with either "PASS", +# "FAIL", and "XFAIL". If a test changes from pass to fail, this will +# cause us to think its a new test because its entry no longer matches +# the corresponding entry from the previous day. Therefore, we create a +# different list that does not contain these words. +$temp_test_list_today = $all_tests; +$temp_test_list_today =~ s/PASS//g; +$temp_test_list_today =~ s/FAIL//g; +$temp_test_list_today =~ s/XFAIL//g; +$temp_test_list_yesterday = $yesterdays_tests; +$temp_test_list_yesterday = s/PASS//g; +$temp_test_list_yesterday = s/FAIL//g; +$temp_test_list_yesterday = s/XFAIL//g; if($yesterdays_tests ne ""){ - $new_tests = Difference $all_tests, $yesterdays_tests; + $new_tests = Difference $temp_test_list_today, $temp_test_list_yesterday; } else{ $new_tests=""; } if($all_tests ne ""){ - $removed_tests = Difference $yesterdays_tests, $all_tests; + $removed_tests = Difference $temp_test_list_yesterday, $temp_test_list_today; } else{ $removed_tests=""; } From pjenkins at apple.com Mon Aug 14 11:08:06 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Mon, 14 Aug 2006 11:08:06 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200608141608.k7EG86IF029654@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.49 -> 1.50 --- Log message: Added some comments to clarify code around sub TestDirectory --- Diffs of the changes: (+1 -2) NewNightlyTest.pl | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.49 llvm/utils/NewNightlyTest.pl:1.50 --- llvm/utils/NewNightlyTest.pl:1.49 Sun Aug 13 04:53:02 2006 +++ llvm/utils/NewNightlyTest.pl Mon Aug 14 11:07:14 2006 @@ -636,7 +636,6 @@ #my $NumLibraries = scalar(grep(!/executable/, @Linked)); #my $NumObjects = `grep ']\: Compiling ' $BuildLog | wc -l` + 0; - # Get the number of lines of source code. Must be here after the build is done # because countloc.sh uses the llvm-config script which must be built. my $LOC = `utils/countloc.sh`; @@ -831,7 +830,7 @@ ChangeDir( "../../..", "Programs Test Parent Directory" ); return ($ProgramsTable, $llcbeta_options); -} +} #end sub TestDirectory if (!$BuildError) { if ( $VERBOSE ) { From dpatel at apple.com Mon Aug 14 13:04:01 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 13:04:01 -0500 Subject: [llvm-commits] CVS: llvm/docs/LinkTimeOptimization.html Message-ID: <200608141804.k7EI41RX010631@zion.cs.uiuc.edu> Changes in directory llvm/docs: LinkTimeOptimization.html added (r1.1) --- Log message: Add lto doc. --- Diffs of the changes: (+361 -0) LinkTimeOptimization.html | 361 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 361 insertions(+) Index: llvm/docs/LinkTimeOptimization.html diff -c /dev/null llvm/docs/LinkTimeOptimization.html:1.1 *** /dev/null Mon Aug 14 13:03:50 2006 --- llvm/docs/LinkTimeOptimization.html Mon Aug 14 13:03:40 2006 *************** *** 0 **** --- 1,361 ---- + + + + LLVM Link Time Optimization: design and implementation + + + +
+ LLVM Link Time Optimization: design and implentation +
+ + + +
+

Written by Devang Patel

+
+ + +
+ Description +
+ + +
+

+ LLVM features powerful intermodular optimization which can be used at link time. + Link Time Optimization is another name of intermodular optimization when it + is done during link stage. This document describes the interface between LLVM + intermodular optimizer and the linker and its design. +

+
+ + +
+ Design Philosophy +
+ + +
+

+ The LLVM Link Time Optimizer seeks complete transparency, while doing intermodular + optimization, in compiler tool chain. Its main goal is to let developer take + advantage of intermodular optimizer without making any significant changes to + their makefiles or build system. This is achieved through tight integration with + linker. In this model, linker treates LLVM bytecode files like native objects + file and allows mixing and matching among them. The linker uses + LLVMlto, a dynamically loaded library, to handle LLVM bytecode + files. This tight integration between the linker and LLVM optimizer helps to do + optimizations that are not possible in other models. The linker input allows + optimizer to avoid relying on conservative escape analysis. +

+ + +
+ Example of link time optimization +
+ +
+ +

Following example illustrates advantage of integrated approach that uses + clean interface. +

  • Input source file a.c is compiled into LLVM byte code form. +
  • Input source file main.c is compiled into native object code. +
    + +
    --- a.h --- +
    extern int foo1(void); +
    extern void foo2(void); +
    extern void foo4(void); +
    --- a.c --- +
    #include "a.h" +
    +
    static signed int i = 0; +
    +
    void foo2(void) { +
    i = -1; +
    } +
    +
    static int foo3() { +
    foo4(); +
    return 10; +
    } +
    +
    int foo1(void) { +
    int data = 0; +
    +
    if (i < 0) { data = foo3(); } +
    +
    data = data + 42; +
    return data; +
    } +
    +
    --- main.c --- +
    #include +
    #include "a.h" +
    +
    void foo4(void) { +
    printf ("Hi\n"); +
    } +
    +
    int main() { +
    return foo1(); +
    } +
    +
    --- command lines --- +
    $ llvm-gcc4 --emit-llvm -c a.c -o a.o # <-- a.o is LLVM bytecode file +
    $ llvm-gcc4 -c main.c -o main.o # <-- main.o is native object file +
    $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifications +
    +
    +

    +

    + In this example, the linker recognizes that foo2() is a externally visible + symbol defined in LLVM byte code file. This information is collected using + readLLVMByteCodeFile() . Based on this + information, linker completes its usual symbol resolution pass and finds that + foo2() is not used anywhere. This information is used by LLVM optimizer + and it removes foo2(). As soon as foo2() is removed, optimizer + recognizes that condition i < 0 is always false, which means + foo3() is never used. Hence, optimizer removes foo3() also. + And this in turn, enables linker to remove foo4(). + This example illustrates advantage of tight integration with linker. Here, + optimizer can not remove foo3() without the linker's input. +

    +
  • + + +
    + Alternative Approaches +
    + +
    +

    +

  • Compiler driver invokes link time optimizer separately. +

    In this model link time optimizer is not able to take advantage of information + collected during normal linker's symbol resolution phase. In above example, + optimizer can not remove foo2() without linker's input because it is + externally visible. And this in turn prohibits optimizer from removing foo3(). +

    +
  • Use separate tool to collect symbol information from all object file. +

    In this model, this new separate tool or library replicates linker's + capabilities to collect information for link time optimizer. Not only such code + duplication is difficult to justify but it also has several other disadvantages. + For example, the linking semantics and the features provided by linker on + various platform are not unique. This means, this new tool needs to support all + such features and platforms in one super tool or one new separate tool per + platform is required. This increases maintance cost for link time optimizer + significantly, which is not necessary. Plus, this approach requires staying + synchronized with linker developements on various platforms, which is not the + main focus of link time optimizer. Finally, this approach increases end user's build + time due to duplicate work done by this separate tool and linker itself. +

    +
  • + + +
    + Multi-phase communication between LLVM and linker +
    + +
    +

    + The linker collects information about symbol defininitions and uses in various + link objects which is more accurate than any information collected by other tools + during typical build cycle. + The linker collects this information by looking at definitions and uses of + symbols in native .o files and using symbol visibility information. The linker + also uses user supplied information, such as list of exported symbol. + LLVM optimizer collects control flow information, data flow information and + knows much more about program structure from optimizer's point of view. Our + goal is to take advantage of tight intergration between the linker and + optimizer by sharing this information during various linking phases. +

    +
    + + +
    + Phase 1 : Read LLVM Bytecode Files +
    + +
    +

    + The linker first reads all object files in natural order and collects symbol + information. This includes native object files as well as LLVM byte code files. + In this phase, the linker uses readLLVMByteCodeFile() + to collect symbol information from each LLVM bytecode files and updates its + internal global symbol table accordingly. The intent of this interface is to + avoid overhead in the non LLVM case, where all input object files are native + object files, by putting this code in the error path of the linker. When the + linker sees the first llvm .o file, it dlopen()s the dynamic library. This is + to allow changes to LLVM part without relinking the linker. +

    +
    + + +
    + Phase 2 : Symbol Resolution +
    + +
    +

    + In this stage, the linker resolves symbols using global symbol table information + to report undefined symbol errors, read archive members, resolve weak + symbols etc... The linker is able to do this seamlessly even though it does not + know exact content of input LLVM bytecode files because it uses symbol information + provided by readLLVMByteCodeFile() . + If dead code stripping is enabled then linker collects list of live symbols. +

    +
    + + +
    + Phase 3 : Optimize Bytecode Files +
    +
    +

    + After symbol resolution, the linker updates symbol information supplied by LLVM + bytecode files appropriately. For example, whether certain LLVM bytecode + supplied symbols are used or not. In the example above, the linker reports + that foo2() is not used anywhere in the program, including native .o + files. This information is used by LLVM interprocedural optimizer. The + linker uses optimizeModules() and requests + optimized native object file of the LLVM portion of the program. +

    +
    + + +
    + Phase 4 : Symbol Resolution after optimization +
    + +
    +

    + In this phase, the linker reads optimized native object file and updates internal + global symbol table to reflect any changes. Linker also collects information + about any change in use of external symbols by LLVM bytecode files. In the examle + above, the linker notes that foo4() is not used any more. If dead code + striping is enabled then linker refreshes live symbol information appropriately + and performs dead code stripping. +
    + After this phase, the linker continues linking as if it never saw LLVM bytecode + files. +

    +
    + + +
    + LLVMlto +
    + +
    +

    + LLVMlto is a dynamic library that is part of the LLVM tools, and is + intended for use by a linker. LLVMlto provides an abstract C++ interface + to use the LLVM interprocedural optimizer without exposing details of LLVM + internals. The intention is to keep the interface as stable as possible even + when the LLVM optimizer continues to evolve. +

    +
    + + +
    + LLVMSymbol +
    + +
    +

    + LLVMSymbol class is used to describe the externally visible functions + and global variables, tdefined in LLVM bytecode files, to linker. + This includes symbol visibility information. This information is used by linker + to do symbol resolution. For example : function foo2() is defined inside + a LLVM bytecode module and it is externally visible symbol. + This helps linker connect use of foo2() in native object file with + future definition of symbol foo2(). The linker will see actual definition + of foo2() when it receives optimized native object file in + Symbol Resolution after optimization phase. If the linker does not find any + use of foo2(), it updates LLVMSymbol visibility information to notify + LLVM intermodular optimizer that it is dead. The LLVM intermodular optimizer + takes advantage of such information to generate better code. +

    +
    + + +
    + readLLVMObjectFile() +
    + +
    +

    + readLLVMObjectFile() is used by the linker to read LLVM bytecode files + and collect LLVMSymbol nformation. This routine also + supplies list of externally defined symbols that are used by LLVM bytecode + files. Linker uses this symbol information to do symbol resolution. Internally, + LLVMlto maintains LLVM bytecode modules in memory. This + function also provides list of external references used by bytecode file.
    +

    +
    + + +
    + optimizeModules() +
    + +
    +

    + The linker invokes optimizeModules to optimize already read LLVM + bytecode files by applying LLVM intermodular optimization techniques. This + function runs LLVM intermodular optimizer and generates native object code + as .o file at name and location provided by the linker. +

    +
    + + +
    + Debugging Information +
    + + +
    + +

    ... incomplete ...

    + +
    + + + +
    +
    + Valid CSS! + Valid HTML 4.01! + + Devang Patel
    + LLVM Compiler Infrastructure
    + Last modified: $Date: 2006/08/14 18:03:40 $ +
    + + + From dpatel at apple.com Mon Aug 14 13:22:07 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 13:22:07 -0500 Subject: [llvm-commits] CVS: llvm/docs/index.html Message-ID: <200608141822.k7EIM7Hg011661@zion.cs.uiuc.edu> Changes in directory llvm/docs: index.html updated: 1.56 -> 1.57 --- Log message: Add lto doc link. --- Diffs of the changes: (+5 -1) index.html | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/docs/index.html diff -u llvm/docs/index.html:1.56 llvm/docs/index.html:1.57 --- llvm/docs/index.html:1.56 Tue Jun 20 15:56:03 2006 +++ llvm/docs/index.html Mon Aug 14 13:21:53 2006 @@ -215,6 +215,10 @@ the LLVM System Library (lib/System) and how to keep LLVM source code portable +
  • Link Time Optimization - This +document describes the interface between LLVM intermodular optimizer and +the linker and its design
  • + @@ -260,6 +264,6 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/06/20 20:56:03 $ + Last modified: $Date: 2006/08/14 18:21:53 $ From dpatel at apple.com Mon Aug 14 13:39:51 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 13:39:51 -0500 Subject: [llvm-commits] CVS: llvm/docs/LinkTimeOptimization.html Message-ID: <200608141839.k7EIdpaH013407@zion.cs.uiuc.edu> Changes in directory llvm/docs: LinkTimeOptimization.html updated: 1.1 -> 1.2 --- Log message: Fix verification failures. --- Diffs of the changes: (+17 -15) LinkTimeOptimization.html | 32 +++++++++++++++++--------------- 1 files changed, 17 insertions(+), 15 deletions(-) Index: llvm/docs/LinkTimeOptimization.html diff -u llvm/docs/LinkTimeOptimization.html:1.1 llvm/docs/LinkTimeOptimization.html:1.2 --- llvm/docs/LinkTimeOptimization.html:1.1 Mon Aug 14 13:03:40 2006 +++ llvm/docs/LinkTimeOptimization.html Mon Aug 14 13:39:35 2006 @@ -7,7 +7,7 @@
    - LLVM Link Time Optimization: design and implentation + LLVM Link Time Optimization: design and implementation
    -
  • Multi-phase communication between LLVM and linker
  • +
  • Multi-phase communication between LLVM and linker
  • -
  • LLVMlto
  • +
  • LLVMlto +
  • Debugging Information
  • -

    Written by Devang Patel

    +

    Written by Devang Patel

    @@ -71,6 +71,7 @@ optimizations that are not possible in other models. The linker input allows optimizer to avoid relying on conservative escape analysis.

    +
    @@ -81,11 +82,12 @@

    Following example illustrates advantage of integrated approach that uses clean interface. +

    -
    --- a.h --- +--- a.h ---
    extern int foo1(void);
    extern void foo2(void);
    extern void foo4(void); @@ -113,7 +115,7 @@
    }

    --- main.c --- -
    #include +
    #include < stdio.h >
    #include "a.h"

    void foo4(void) { @@ -130,11 +132,10 @@
    $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifications
    -

    In this example, the linker recognizes that foo2() is a externally visible symbol defined in LLVM byte code file. This information is collected using - readLLVMByteCodeFile() . Based on this + readLLVMObjectFile() . Based on this information, linker completes its usual symbol resolution pass and finds that foo2() is not used anywhere. This information is used by LLVM optimizer and it removes foo2(). As soon as foo2() is removed, optimizer @@ -153,6 +154,7 @@

    +

    @@ -203,7 +205,7 @@

    The linker first reads all object files in natural order and collects symbol information. This includes native object files as well as LLVM byte code files. -In this phase, the linker uses readLLVMByteCodeFile() +In this phase, the linker uses readLLVMObjectFile() to collect symbol information from each LLVM bytecode files and updates its internal global symbol table accordingly. The intent of this interface is to avoid overhead in the non LLVM case, where all input object files are native @@ -224,7 +226,7 @@ to report undefined symbol errors, read archive members, resolve weak symbols etc... The linker is able to do this seamlessly even though it does not know exact content of input LLVM bytecode files because it uses symbol information -provided by readLLVMByteCodeFile() . +provided by readLLVMObjectFile() . If dead code stripping is enabled then linker collects list of live symbols.

    @@ -352,9 +354,9 @@ Valid HTML 4.01! - Devang Patel
    + Devang Patel
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/08/14 18:03:40 $ + Last modified: $Date: 2006/08/14 18:39:35 $ From dpatel at apple.com Mon Aug 14 13:49:19 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 13:49:19 -0500 Subject: [llvm-commits] CVS: llvm/docs/LinkTimeOptimization.html Message-ID: <200608141849.k7EInJKI013653@zion.cs.uiuc.edu> Changes in directory llvm/docs: LinkTimeOptimization.html updated: 1.2 -> 1.3 --- Log message: Use < and > --- Diffs of the changes: (+2 -2) LinkTimeOptimization.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/LinkTimeOptimization.html diff -u llvm/docs/LinkTimeOptimization.html:1.2 llvm/docs/LinkTimeOptimization.html:1.3 --- llvm/docs/LinkTimeOptimization.html:1.2 Mon Aug 14 13:39:35 2006 +++ llvm/docs/LinkTimeOptimization.html Mon Aug 14 13:49:03 2006 @@ -115,7 +115,7 @@
    }

    --- main.c --- -
    #include < stdio.h > +
    #include <stdio.h>
    #include "a.h"

    void foo4(void) { @@ -356,7 +356,7 @@ Devang Patel
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2006/08/14 18:39:35 $ + Last modified: $Date: 2006/08/14 18:49:03 $ From reid at x10sys.com Mon Aug 14 13:49:23 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 13:49:23 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl countloc.sh getsrcs.sh llvmdo llvmgrep userloc.pl Message-ID: <200608141849.k7EInN28013670@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.50 -> 1.51 countloc.sh updated: 1.6 -> 1.7 getsrcs.sh updated: 1.21 -> 1.22 llvmdo updated: 1.18 -> 1.19 llvmgrep updated: 1.10 -> 1.11 userloc.pl updated: 1.8 -> 1.9 --- Log message: Make all tools that use llvmdo have a -topdir option that allows the top source dir for LLVM to be specified explicitly. This removes the dependency on the llvm-config script. If the option is not given, then the scripts use llvm-config which should be both built and in the PATH. This arrangement provides a useful default for most developers but also allows the nightly tester to execute countloc.sh before llvm-config is built and without altering the PATH. --- Diffs of the changes: (+186 -127) NewNightlyTest.pl | 2 countloc.sh | 19 +++- getsrcs.sh | 18 +++ llvmdo | 244 ++++++++++++++++++++++++++++-------------------------- llvmgrep | 15 ++- userloc.pl | 15 ++- 6 files changed, 186 insertions(+), 127 deletions(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.50 llvm/utils/NewNightlyTest.pl:1.51 --- llvm/utils/NewNightlyTest.pl:1.50 Mon Aug 14 11:07:14 2006 +++ llvm/utils/NewNightlyTest.pl Mon Aug 14 13:49:05 2006 @@ -638,7 +638,7 @@ # Get the number of lines of source code. Must be here after the build is done # because countloc.sh uses the llvm-config script which must be built. -my $LOC = `utils/countloc.sh`; +my $LOC = `utils/countloc.sh -topdir $BuildDir`; # Get the time taken by the configure script my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog"; Index: llvm/utils/countloc.sh diff -u llvm/utils/countloc.sh:1.6 llvm/utils/countloc.sh:1.7 --- llvm/utils/countloc.sh:1.6 Sun Aug 13 13:29:21 2006 +++ llvm/utils/countloc.sh Mon Aug 14 13:49:05 2006 @@ -12,20 +12,29 @@ # (excluding certain things), runs "wc -l" on them to get the number of lines in # each file and then sums up and prints the total with awk. # -# The script takes no arguments but does expect to be run from somewhere in -# the top llvm source directory. +# The script takes one optional option, -topdir, which specifies the top llvm +# source directory. If it is not specified then the llvm-config tool is +# consulted to find top source dir. # # Note that the implementation is based on llvmdo. See that script for more # details. ##===----------------------------------------------------------------------===## -TOPDIR=`llvm-config --src-root` +if test $# -gt 1 ; then + if test "$1" = "-topdir" ; then + TOPDIR="$2" + shift; shift; + else + TOPDIR=`llvm-config --src-root` + fi +fi + if test -d "$TOPDIR" ; then cd $TOPDIR - ./utils/llvmdo -dirs "include lib tools test utils examples" -code-only wc -l | awk '\ + ./utils/llvmdo -topdir "$TOPDIR" -dirs "include lib tools test utils examples" -code-only wc -l | awk '\ BEGIN { loc=0; } \ { loc += $1; } \ END { print loc; }' else - echo "Can't find LLVM top directory in $TOPDIR" + echo "Can't find LLVM top directory" fi Index: llvm/utils/getsrcs.sh diff -u llvm/utils/getsrcs.sh:1.21 llvm/utils/getsrcs.sh:1.22 --- llvm/utils/getsrcs.sh:1.21 Mon Sep 20 03:09:36 2004 +++ llvm/utils/getsrcs.sh Mon Aug 14 13:49:05 2006 @@ -10,15 +10,27 @@ ##===----------------------------------------------------------------------===## # # This script just prints out the path names for all the source files in LLVM. +# The optional -topdir option can be used to specify the top LLVM source +# directory. Without it, the llvm-config command is consulted to find the +# top source directory. # # Note that the implementation is based on llvmdo. See that script for more # details. ##===----------------------------------------------------------------------===## -TOPDIR=`pwd | sed -e 's#\(.*/llvm\).*#\1#'` +if test $# -gt 1 ; then + if test "$1" = "-topdir" ; then + TOPDIR="$2" + shift; shift; + else + TOPDIR=`llvm-config --src-root` + fi +fi + if test -d "$TOPDIR" ; then cd $TOPDIR - ./utils/llvmdo -dirs "include lib tools utils examples projects" echo + ./utils/llvmdo -topdir "$TOPDIR" \ + -dirs "include lib tools utils examples projects" echo else - echo "Can't find LLVM top directory in $TOPDIR" + echo "Can't find LLVM top directory" fi Index: llvm/utils/llvmdo diff -u llvm/utils/llvmdo:1.18 llvm/utils/llvmdo:1.19 --- llvm/utils/llvmdo:1.18 Sun Aug 13 13:59:40 2006 +++ llvm/utils/llvmdo Mon Aug 14 13:49:05 2006 @@ -11,28 +11,46 @@ # This script is a general purpose "apply" function for the source files in LLVM # It uses "find" to locate all the source files and then applies the user's # command to them. As such, this command is often not used by itself much but -# the other find related tools (countloc.sh,llvmgrep,getsrcs.sh) are all based -# on the implementation. This script defines "what is a source file" in LLVM and -# so should be maintained if new directories, new file extensions, etc. are -# used in LLVM as it progresses. +# the other find related tools (countloc.sh,llvmgrep,getsrcs.sh,userloc.sh) are +# all based on this script. This script defines "what is a source file" in +# LLVM and so should be maintained if new directories, new file extensions, +# etc. are used in LLVM as it progresses. # # Usage: -# llvmdo [-dirs "DIRNAMES..."] PROGRAM ARGS... +# llvmdo [-topdir DIR] [-dirs "DIRNAMES..."] [-code-only] PROGRAM ARGS... +# +# The -topdir option allows you to specify the llvm source root directly. If it +# is not specified then it will be obtained with llvm-config which must be built +# and in your path. # # The -dirs argument allows you to specify the set of directories that are -# searched. By default, everything is searched. Note that you must use quotes -# around the list of directory names. After that you simply specify whatever -# program you want to run against each file and the arguments to give it. The -# PROGRAM will be given the file name as its last argument. +# searched. The default list of directories searched is: +# include lib tools utils runtime autoconf docs test examples projects +# Note that you must use quotes around the list of directory names. +# +# The -code-only option specifies that only those files that are considered +# "code" should be visited. HTML documentation is considered code, but things +# like README files, etc. are not. +# +# Finally, you simply specify whatever program you want to run against each +# file and the arguments to give it. The PROGRAM will be given the file name +# as its last argument. ##===----------------------------------------------------------------------===## if test $# -lt 1 ; then - echo "Usage: llvmdo [-dirs "DIRNAMES..."] [-code-only] PROGRAM ARGS..." + echo "Usage: llvmdo [-topdir DIR] [-dirs "DIRNAMES..."] [-code-only] PROGRAM ARGS..." exit 1 fi +if test "$1" = "-topdir" ; then + TOPDIR="$2" + shift; shift; +else + TOPDIR=`llvm-config --src-root` +fi + if test "$1" = "-dirs" ; then - LLVMDO_DIRS="$2"; + LLVMDO_DIRS="$2" shift ; shift elif test -z "$LLVMDO_DIRS" ; then LLVMDO_DIRS="include lib tools utils runtime autoconf docs test examples projects" @@ -57,115 +75,115 @@ fi shift; -TOPDIR=`llvm-config --src-root` +paths_to_ignore="\ + -path */CVS -o \ + -path */CVS/* -o \ + -path docs/doxygen/* -o \ + -path docs/CommandGuide/html/* -o \ + -path docs/CommandGuide/man/* -o \ + -path docs/CommandGuide/ps/* -o \ + -path docs/CommandGuide/man/* -o \ + -path docs/HistoricalNotes/* -o \ + -path docs/img/* -o \ + -path */.libs/* -o \ + -path lib/Support/bzip2/* -o \ + -path projects/llvm-test/* \ +" +files_to_match="\ + -name *.ac \ + -o -name *.b \ + -o -name *.c \ + -o -name *.cc \ + -o -name *.cfg \ + -o -name *.cpp \ + -o -name *.css \ + -o -name *.def \ + -o -name *.el \ + -o -name *.exp \ + -o -name *.footer \ + -o -name *.gnuplot' \ + -o -name *.h \ + -o -name *.header \ + -o -name *.html \ + -o -name *.in \ + -o -name *.inc \ + -o -name *.intro \ + -o -name *.l \ + -o -name *.ll \ + -o -name *.llx \ + -o -name *.lst \ + -o -name *.m4 \ + -o -name *.pod \ + -o -name *.pl \ + -o -name *.py \ + -o -name *.sh \ + -o -name *.schema \ + -o -name *.st \ + -o -name *.tcl \ + -o -name *.td \ + -o -name *.tr \ + -o -name *.y \ + -o -name Make* \ + -o -name llvmdo \ + -o -name llvmgrep \ + -o -name check-each-file \ + -o -name codgen-diff \ + -o -name cvsupdate \ + -o -name llvm-native-gcc \ + -o -name llvm-native-gxx \ + -o -name makellvm \ + -o -path include/llvm/ADT/ilist \ + -o -path test/\*.ll \ + -o -path test/Scripts/not \ + -o -path runtime/\*.ll \ +" +if test -z "$CODE_ONLY" ; then + files_to_match="$files_to_match \ + -o -name *.txt \ + -o -name *.TXT \ + -o -name *.vim \ + -o -name vimrc \ + -o -name README \ + -o -name COPYING.LIB \ + -o -name LICENSE* " +fi +files_to_ignore="\ + -name \.* \ + -o -name *~ \ + -o -name #* \ + -o -name *.cvs \ + -o -name configure \ + -o -name slow.ll \ + -o -name *libtool* \ + -o -name ltdl* \ + -o -name ltdl.m4 \ + -o -name ltmain.m4 \ + -o -name ltmain.sh \ + -o -name aclocal.m4 \ + -o -name acinclude.m4 \ + -o -name *VerifierIsReallySlow.llx \ + -o -name *LoopSimplifyCrash.ll \ + -o -name *AST-Remove.ll \ + -o -name llvmAsmParser.cpp \ + -o -name llvmAsmParser.h \ + -o -name Lexer.cpp \ + -o -name FileLexer.cpp \ + -o -name FileParser.cpp \ + -o -name FileParser.h \ + -o -name StackerParser.h \ + -o -name StackerParser.cpp \ + -o -name ConfigLexer.cpp \ + -o -name PPCPerfectShuffle.h \ +" if test -d "$TOPDIR" ; then cd $TOPDIR + # Have to use the right "find" on a per-platform basis. Most platforms have + # Gnu find as "find", but Solaris does not. case `uname -s` in SunOS) find_prog=gfind ;; *) find_prog=find ;; esac - paths_to_ignore="\ - -path */CVS -o \ - -path */CVS/* -o \ - -path docs/doxygen/* -o \ - -path docs/CommandGuide/html/* -o \ - -path docs/CommandGuide/man/* -o \ - -path docs/CommandGuide/ps/* -o \ - -path docs/CommandGuide/man/* -o \ - -path docs/HistoricalNotes/* -o \ - -path docs/img/* -o \ - -path */.libs/* -o \ - -path lib/Support/bzip2/* -o \ - -path projects/llvm-test/* \ - " - files_to_match="\ - -name *.ac \ - -o -name *.b \ - -o -name *.c \ - -o -name *.cc \ - -o -name *.cfg \ - -o -name *.cpp \ - -o -name *.css \ - -o -name *.def \ - -o -name *.el \ - -o -name *.exp \ - -o -name *.footer \ - -o -name *.gnuplot' \ - -o -name *.h \ - -o -name *.header \ - -o -name *.html \ - -o -name *.in \ - -o -name *.inc \ - -o -name *.intro \ - -o -name *.l \ - -o -name *.ll \ - -o -name *.llx \ - -o -name *.lst \ - -o -name *.m4 \ - -o -name *.pod \ - -o -name *.pl \ - -o -name *.py \ - -o -name *.sh \ - -o -name *.schema \ - -o -name *.st \ - -o -name *.tcl \ - -o -name *.td \ - -o -name *.tr \ - -o -name *.y \ - -o -name Make* \ - -o -name llvmdo \ - -o -name llvmgrep \ - -o -name check-each-file \ - -o -name codgen-diff \ - -o -name cvsupdate \ - -o -name llvm-native-gcc \ - -o -name llvm-native-gxx \ - -o -name makellvm \ - -o -path include/llvm/ADT/ilist \ - -o -path test/\*.ll \ - -o -path test/Scripts/not \ - -o -path runtime/\*.ll \ - " - if test -z "$CODE_ONLY" ; then - files_to_match="$files_to_match \ - -o -name *.txt \ - -o -name *.TXT \ - -o -name *.vim \ - -o -name vimrc \ - -o -name README \ - -o -name COPYING.LIB \ - -o -name LICENSE* " - fi - files_to_ignore="\ - -name \.* \ - -o -name *~ \ - -o -name #* \ - -o -name *.cvs \ - -o -name configure \ - -o -name slow.ll \ - -o -name *libtool* \ - -o -name ltdl* \ - -o -name ltdl.m4 \ - -o -name ltmain.m4 \ - -o -name ltmain.sh \ - -o -name aclocal.m4 \ - -o -name acinclude.m4 \ - -o -name *VerifierIsReallySlow.llx \ - -o -name *LoopSimplifyCrash.ll \ - -o -name *AST-Remove.ll \ - -o -name llvmAsmParser.cpp \ - -o -name llvmAsmParser.h \ - -o -name Lexer.cpp \ - -o -name FileLexer.cpp \ - -o -name FileParser.cpp \ - -o -name FileParser.h \ - -o -name StackerParser.h \ - -o -name StackerParser.cpp \ - -o -name ConfigLexer.cpp \ - -o -name PPCPerfectShuffle.h \ - " - # Turn off file name generation (globbing) so that substitution of the # variables doesn't cause the shell to create lists of file names set -f Index: llvm/utils/llvmgrep diff -u llvm/utils/llvmgrep:1.10 llvm/utils/llvmgrep:1.11 --- llvm/utils/llvmgrep:1.10 Fri Aug 11 16:53:27 2006 +++ llvm/utils/llvmgrep Mon Aug 14 13:49:05 2006 @@ -18,7 +18,15 @@ # details. ##===----------------------------------------------------------------------===## -TOPDIR=`llvm-config --src-root` +if test $# -gt 1 ; then + if test "$1" = "-topdir" ; then + TOPDIR="$2" + shift; shift; + else + TOPDIR=`llvm-config --src-root` + fi +fi + if test -d "$TOPDIR" ; then cd $TOPDIR case `uname -s` in @@ -26,7 +34,8 @@ Linux) grep_cmd="egrep -H -n" ;; *) grep_cmd="egrep -l -n" ;; esac - ./utils/llvmdo -dirs "include lib tools utils docs examples test projects" $grep_cmd "$*" + ./utils/llvmdo -topdir "$TOPDIR" \ + -dirs "include lib tools utils docs examples test projects" $grep_cmd "$*" else - echo "Can't find LLVM top directory in $TOPDIR" + echo "Can't find LLVM top directory" fi Index: llvm/utils/userloc.pl diff -u llvm/utils/userloc.pl:1.8 llvm/utils/userloc.pl:1.9 --- llvm/utils/userloc.pl:1.8 Sun Aug 13 14:03:06 2006 +++ llvm/utils/userloc.pl Mon Aug 14 13:49:05 2006 @@ -17,6 +17,9 @@ # Report details about lines of code in each file for each user # -html # Generate HTML output instead of text output +# -topdir +# Specify where the top llvm source directory is. Otherwise the +# llvm-config tool is used to find it. # Directories: # The directories passed after the options should be relative paths to # directories of interest from the top of the llvm source tree, e.g. "lib" @@ -29,6 +32,7 @@ my $html = 0; my $debug = 0; my $filedetails = ""; +my $srcroot = ""; while ( defined($ARGV[0]) && substr($ARGV[0],0,1) eq '-' ) { if ($ARGV[0] =~ /-tag=.*/) { @@ -40,15 +44,22 @@ $html = 1; } elsif ($ARGV[0] eq "-debug") { $debug = 1; + } elsif ($ARGV[0] eq "-topdir") { + shift; $srcroot = $ARGV[0]; shift; } else { die "Invalid option: $ARGV[0]"; } shift; } -chomp(my $srcroot = `llvm-config --src-root`); +if (length($srcroot) == 0) { + chomp($srcroot = `llvm-config --src-root`); +} +if (! -d "$srcroot") { + die "Invalid source root: $srcroot\n"; +} chdir($srcroot); -my $llvmdo = "$srcroot/utils/llvmdo"; +my $llvmdo = "$srcroot/utils/llvmdo -topdir '$srcroot'"; my %Stats; my %FileStats; From rafael.espindola at gmail.com Mon Aug 14 14:01:42 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 14 Aug 2006 14:01:42 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/ldr.ll Message-ID: <200608141901.k7EJ1gSI014924@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: ldr.ll added (r1.1) --- Log message: select code like ldr rx, [ry, #offset] --- Diffs of the changes: (+23 -0) ldr.ll | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+) Index: llvm/test/Regression/CodeGen/ARM/ldr.ll diff -c /dev/null llvm/test/Regression/CodeGen/ARM/ldr.ll:1.1 *** /dev/null Mon Aug 14 14:01:35 2006 --- llvm/test/Regression/CodeGen/ARM/ldr.ll Mon Aug 14 14:01:24 2006 *************** *** 0 **** --- 1,23 ---- + ; RUN: llvm-as < %s | llc -march=arm && + ; RUN: llvm-as < %s | llc -march=arm | grep "ldr r0.*#0" | wc -l | grep 2 && + ; RUN: llvm-as < %s | llc -march=arm | grep "ldr r0.*#4092" | wc -l | grep 1 + + int %f1(int* %v) { + entry: + %tmp = load int* %v ; [#uses=1] + ret int %tmp + } + + int %f2(int* %v) { + entry: + %tmp2 = getelementptr int* %v, int 1023 ; [#uses=1] + %tmp = load int* %tmp2 ; [#uses=1] + ret int %tmp + } + + int %f3(int* %v) { + entry: + %tmp2 = getelementptr int* %v, int 1024 ; [#uses=1] + %tmp = load int* %tmp2 ; [#uses=1] + ret int %tmp + } From rafael.espindola at gmail.com Mon Aug 14 14:01:42 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Mon, 14 Aug 2006 14:01:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Message-ID: <200608141901.k7EJ1gYV014920@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMISelDAGToDAG.cpp updated: 1.28 -> 1.29 --- Log message: select code like ldr rx, [ry, #offset] --- Diffs of the changes: (+34 -1) ARMISelDAGToDAG.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.28 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.29 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.28 Fri Aug 11 12:38:39 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Mon Aug 14 14:01:24 2006 @@ -258,7 +258,8 @@ static SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) { GlobalValue *GV = cast(Op)->getGlobal(); - SDOperand CPAddr = DAG.getConstantPool(GV, MVT::i32, 2); + int alignment = 2; + SDOperand CPAddr = DAG.getConstantPool(GV, MVT::i32, alignment); return DAG.getLoad(MVT::i32, DAG.getEntryNode(), CPAddr, DAG.getSrcValue(NULL)); } @@ -336,9 +337,41 @@ ScheduleAndEmitDAG(DAG); } +static bool isInt12Immediate(SDNode *N, short &Imm) { + if (N->getOpcode() != ISD::Constant) + return false; + + int32_t t = cast(N)->getValue(); + int max = 2<<12 - 1; + int min = -max; + if (t > min && t < max) { + Imm = t; + return true; + } + else + return false; +} + +static bool isInt12Immediate(SDOperand Op, short &Imm) { + return isInt12Immediate(Op.Val, Imm); +} + //register plus/minus 12 bit offset bool ARMDAGToDAGISel::SelectAddrRegImm(SDOperand N, SDOperand &Offset, SDOperand &Base) { + if (N.getOpcode() == ISD::ADD) { + short imm = 0; + if (isInt12Immediate(N.getOperand(1), imm)) { + Offset = CurDAG->getTargetConstant(imm, MVT::i32); + if (FrameIndexSDNode *FI = dyn_cast(N.getOperand(0))) { + Base = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); + } else { + Base = N.getOperand(0); + } + return true; // [r+i] + } + } + Offset = CurDAG->getTargetConstant(0, MVT::i32); if (FrameIndexSDNode *FI = dyn_cast(N)) { Base = CurDAG->getTargetFrameIndex(FI->getIndex(), N.getValueType()); From reid at x10sys.com Mon Aug 14 14:20:10 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 14:20:10 -0500 Subject: [llvm-commits] CVS: llvm/docs/LinkTimeOptimization.html Message-ID: <200608141920.k7EJKALg015621@zion.cs.uiuc.edu> Changes in directory llvm/docs: LinkTimeOptimization.html updated: 1.3 -> 1.4 --- Log message: Fix several grammaros and a few HTML usage items. --- Diffs of the changes: (+181 -188) LinkTimeOptimization.html | 369 ++++++++++++++++++++++------------------------ 1 files changed, 181 insertions(+), 188 deletions(-) Index: llvm/docs/LinkTimeOptimization.html diff -u llvm/docs/LinkTimeOptimization.html:1.3 llvm/docs/LinkTimeOptimization.html:1.4 --- llvm/docs/LinkTimeOptimization.html:1.3 Mon Aug 14 13:49:03 2006 +++ llvm/docs/LinkTimeOptimization.html Mon Aug 14 14:19:55 2006 @@ -2,12 +2,12 @@ "http://www.w3.org/TR/html4/strict.dtd"> - LLVM Link Time Optimization: design and implementation + LLVM Link Time Optimization: Design and Implementation
    - LLVM Link Time Optimization: design and implementation + LLVM Link Time Optimization: Design and Implementation
      @@ -45,11 +45,10 @@

      -LLVM features powerful intermodular optimization which can be used at link time. -Link Time Optimization is another name of intermodular optimization when it -is done during link stage. This document describes the interface between LLVM -intermodular optimizer and the linker and its design. -

      +LLVM features powerful intermodular optimizations which can be used at link +time. Link Time Optimization is another name for intermodular optimization +when performed during the link stage. This document describes the interface +and design between the LLVM intermodular optimizer and the linker.

      @@ -60,16 +59,17 @@

      -The LLVM Link Time Optimizer seeks complete transparency, while doing intermodular -optimization, in compiler tool chain. Its main goal is to let developer take -advantage of intermodular optimizer without making any significant changes to -their makefiles or build system. This is achieved through tight integration with -linker. In this model, linker treates LLVM bytecode files like native objects -file and allows mixing and matching among them. The linker uses -LLVMlto, a dynamically loaded library, to handle LLVM bytecode -files. This tight integration between the linker and LLVM optimizer helps to do -optimizations that are not possible in other models. The linker input allows -optimizer to avoid relying on conservative escape analysis. +The LLVM Link Time Optimizer provides complete transparency, while doing +intermodular optimization, in the compiler tool chain. Its main goal is to let +the developer take advantage of intermodular optimizations without making any +significant changes to the developer's makefiles or build system. This is +achieved through tight integration with the linker. In this model, the linker +treates LLVM bytecode files like native object files and allows mixing and +matching among them. The linker uses LLVMlto, a dynamically +loaded library, to handle LLVM bytecode files. This tight integration between +the linker and LLVM optimizer helps to do optimizations that are not possible +in other models. The linker input allows the optimizer to avoid relying on +conservative escape analysis.

      @@ -79,72 +79,70 @@
      - -

      Following example illustrates advantage of integrated approach that uses -clean interface. -

        -
      • Input source file a.c is compiled into LLVM byte code form. -
      • Input source file main.c is compiled into native object code. -
      - +

      The following example illustrates the advantages of LTO's integrated + approach and clean interface.

      +
        +
      • Input source file a.c is compiled into LLVM byte code form. +
      • Input source file main.c is compiled into native object code. +
      +
       --- a.h ---
      -
      extern int foo1(void); -
      extern void foo2(void); -
      extern void foo4(void); -
      --- a.c --- -
      #include "a.h" -
      -
      static signed int i = 0; -
      -
      void foo2(void) { -
      i = -1; -
      } -
      -
      static int foo3() { -
      foo4(); -
      return 10; -
      } -
      -
      int foo1(void) { -
      int data = 0; -
      -
      if (i < 0) { data = foo3(); } -
      -
      data = data + 42; -
      return data; -
      } -
      -
      --- main.c --- -
      #include <stdio.h> -
      #include "a.h" -
      -
      void foo4(void) { -
      printf ("Hi\n"); -
      } -
      -
      int main() { -
      return foo1(); -
      } -
      -
      --- command lines --- -
      $ llvm-gcc4 --emit-llvm -c a.c -o a.o # <-- a.o is LLVM bytecode file -
      $ llvm-gcc4 -c main.c -o main.o # <-- main.o is native object file -
      $ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifications -
      -
      -

      -In this example, the linker recognizes that foo2() is a externally visible -symbol defined in LLVM byte code file. This information is collected using - readLLVMObjectFile() . Based on this -information, linker completes its usual symbol resolution pass and finds that -foo2() is not used anywhere. This information is used by LLVM optimizer -and it removes foo2(). As soon as foo2() is removed, optimizer -recognizes that condition i < 0 is always false, which means -foo3() is never used. Hence, optimizer removes foo3() also. -And this in turn, enables linker to remove foo4(). -This example illustrates advantage of tight integration with linker. Here, -optimizer can not remove foo3() without the linker's input. -

      +extern int foo1(void); +extern void foo2(void); +extern void foo4(void); +--- a.c --- +#include "a.h" + +static signed int i = 0; + +void foo2(void) { + i = -1; +} + +static int foo3() { +foo4(); +return 10; +} + +int foo1(void) { +int data = 0; + +if (i < 0) { data = foo3(); } + +data = data + 42; +return data; +} + +--- main.c --- +#include <stdio.h> +#include "a.h" + +void foo4(void) { + printf ("Hi\n"); +} + +int main() { + return foo1(); +} + +--- command lines --- +$ llvm-gcc4 --emit-llvm -c a.c -o a.o # <-- a.o is LLVM bytecode file +$ llvm-gcc4 -c main.c -o main.o # <-- main.o is native object file +$ llvm-gcc4 a.o main.o -o main # <-- standard link command without any modifications +
      +

      In this example, the linker recognizes that foo2() is an + externally visible symbol defined in LLVM byte code file. This information + is collected using readLLVMObjectFile(). + Based on this information, the linker completes its usual symbol resolution + pass and finds that foo2() is not used anywhere. This information + is used by the LLVM optimizer and it removes foo2(). As soon as + foo2() is removed, the optimizer recognizes that condition + i < 0 is always false, which means foo3() is never + used. Hence, the optimizer removes foo3(), also. And this in turn, + enables linker to remove foo4(). This example illustrates the + advantage of tight integration with the linker. Here, the optimizer can not + remove foo3() without the linker's input. +

      @@ -153,27 +151,29 @@
      -

      -

        -
      • Compiler driver invokes link time optimizer separately. -

        In this model link time optimizer is not able to take advantage of information -collected during normal linker's symbol resolution phase. In above example, -optimizer can not remove foo2() without linker's input because it is -externally visible. And this in turn prohibits optimizer from removing foo3(). -

        -
      • Use separate tool to collect symbol information from all object file. -

        In this model, this new separate tool or library replicates linker's -capabilities to collect information for link time optimizer. Not only such code -duplication is difficult to justify but it also has several other disadvantages. -For example, the linking semantics and the features provided by linker on -various platform are not unique. This means, this new tool needs to support all -such features and platforms in one super tool or one new separate tool per -platform is required. This increases maintance cost for link time optimizer -significantly, which is not necessary. Plus, this approach requires staying -synchronized with linker developements on various platforms, which is not the -main focus of link time optimizer. Finally, this approach increases end user's build -time due to duplicate work done by this separate tool and linker itself. -
      +
      +
      Compiler driver invokes link time optimizer separately.
      +
      In this model the link time optimizer is not able to take advantage of + information collected during the linker's normal symbol resolution phase. + In the above example, the optimizer can not remove foo2() without + the linker's input because it is externally visible. This in turn prohibits + the optimizer from removing foo3().
      +
      Use separate tool to collect symbol information from all object + files.
      +
      In this model, a new, separate, tool or library replicates the linker's + capability to collect information for link time optimization. Not only is + this code duplication difficult to justify, but it also has several other + disadvantages. For example, the linking semantics and the features + provided by the linker on various platform are not unique. This means, + this new tool needs to support all such features and platforms in one + super tool or a separate tool per platform is required. This increases + maintance cost for link time optimizer significantly, which is not + necessary. This approach also requires staying synchronized with linker + developements on various platforms, which is not the main focus of the link + time optimizer. Finally, this approach increases end user's build time due + to the duplication of work done by this separate tool and the linker itself. +
      +
      @@ -182,17 +182,16 @@
      -

      -The linker collects information about symbol defininitions and uses in various -link objects which is more accurate than any information collected by other tools -during typical build cycle. -The linker collects this information by looking at definitions and uses of -symbols in native .o files and using symbol visibility information. The linker -also uses user supplied information, such as list of exported symbol. -LLVM optimizer collects control flow information, data flow information and -knows much more about program structure from optimizer's point of view. Our -goal is to take advantage of tight intergration between the linker and -optimizer by sharing this information during various linking phases. +

      The linker collects information about symbol defininitions and uses in + various link objects which is more accurate than any information collected + by other tools during typical build cycles. The linker collects this + information by looking at the definitions and uses of symbols in native .o + files and using symbol visibility information. The linker also uses + user-supplied information, such as a list of exported symbols. LLVM + optimizer collects control flow information, data flow information and knows + much more about program structure from the optimizer's point of view. + Our goal is to take advantage of tight intergration between the linker and + the optimizer by sharing this information during various linking phases.

      @@ -202,16 +201,16 @@
      -

      -The linker first reads all object files in natural order and collects symbol -information. This includes native object files as well as LLVM byte code files. -In this phase, the linker uses readLLVMObjectFile() -to collect symbol information from each LLVM bytecode files and updates its -internal global symbol table accordingly. The intent of this interface is to -avoid overhead in the non LLVM case, where all input object files are native -object files, by putting this code in the error path of the linker. When the -linker sees the first llvm .o file, it dlopen()s the dynamic library. This is -to allow changes to LLVM part without relinking the linker. +

      The linker first reads all object files in natural order and collects + symbol information. This includes native object files as well as LLVM byte + code files. In this phase, the linker uses + readLLVMObjectFile() to collect symbol + information from each LLVM bytecode files and updates its internal global + symbol table accordingly. The intent of this interface is to avoid overhead + in the non LLVM case, where all input object files are native object files, + by putting this code in the error path of the linker. When the linker sees + the first llvm .o file, it dlopen()s the dynamic library. This is + to allow changes to the LLVM LTO code without relinking the linker.

      @@ -221,14 +220,14 @@
      -

      -In this stage, the linker resolves symbols using global symbol table information -to report undefined symbol errors, read archive members, resolve weak -symbols etc... The linker is able to do this seamlessly even though it does not -know exact content of input LLVM bytecode files because it uses symbol information -provided by readLLVMObjectFile() . -If dead code stripping is enabled then linker collects list of live symbols. -

      +

      In this stage, the linker resolves symbols using global symbol table + information to report undefined symbol errors, read archive members, resolve + weak symbols, etc. The linker is able to do this seamlessly even though it + does not know the exact content of input LLVM bytecode files because it uses + symbol information provided by + readLLVMObjectFile(). If dead code + stripping is enabled then the linker collects the list of live symbols. +

      @@ -236,14 +235,14 @@ Phase 3 : Optimize Bytecode Files
      -

      -After symbol resolution, the linker updates symbol information supplied by LLVM -bytecode files appropriately. For example, whether certain LLVM bytecode -supplied symbols are used or not. In the example above, the linker reports -that foo2() is not used anywhere in the program, including native .o -files. This information is used by LLVM interprocedural optimizer. The -linker uses optimizeModules() and requests -optimized native object file of the LLVM portion of the program. +

      After symbol resolution, the linker updates symbol information supplied + by LLVM bytecode files appropriately. For example, whether certain LLVM + bytecode supplied symbols are used or not. In the example above, the linker + reports that foo2() is not used anywhere in the program, including + native .o files. This information is used by the LLVM interprocedural + optimizer. The linker uses optimizeModules() + and requests an optimized native object file of the LLVM portion of the + program.

      @@ -253,17 +252,15 @@
      -

      -In this phase, the linker reads optimized native object file and updates internal -global symbol table to reflect any changes. Linker also collects information -about any change in use of external symbols by LLVM bytecode files. In the examle -above, the linker notes that foo4() is not used any more. If dead code -striping is enabled then linker refreshes live symbol information appropriately -and performs dead code stripping. -
      -After this phase, the linker continues linking as if it never saw LLVM bytecode -files. -

      +

      In this phase, the linker reads optimized a native object file and + updates the internal global symbol table to reflect any changes. The linker + also collects information about any changes in use of external symbols by + LLVM bytecode files. In the examle above, the linker notes that + foo4() is not used any more. If dead code stripping is enabled then + the linker refreshes the live symbol information appropriately and performs + dead code stripping.

      +

      After this phase, the linker continues linking as if it never saw LLVM + bytecode files.

      @@ -272,13 +269,11 @@
      -

      -LLVMlto is a dynamic library that is part of the LLVM tools, and is -intended for use by a linker. LLVMlto provides an abstract C++ interface -to use the LLVM interprocedural optimizer without exposing details of LLVM -internals. The intention is to keep the interface as stable as possible even -when the LLVM optimizer continues to evolve. -

      +

      LLVMlto is a dynamic library that is part of the LLVM tools, and + is intended for use by a linker. LLVMlto provides an abstract C++ + interface to use the LLVM interprocedural optimizer without exposing details + of LLVM's internals. The intention is to keep the interface as stable as + possible even when the LLVM optimizer continues to evolve.

      @@ -287,20 +282,20 @@
      -

      -LLVMSymbol class is used to describe the externally visible functions -and global variables, tdefined in LLVM bytecode files, to linker. -This includes symbol visibility information. This information is used by linker -to do symbol resolution. For example : function foo2() is defined inside -a LLVM bytecode module and it is externally visible symbol. -This helps linker connect use of foo2() in native object file with -future definition of symbol foo2(). The linker will see actual definition -of foo2() when it receives optimized native object file in -Symbol Resolution after optimization phase. If the linker does not find any -use of foo2(), it updates LLVMSymbol visibility information to notify -LLVM intermodular optimizer that it is dead. The LLVM intermodular optimizer -takes advantage of such information to generate better code. -

      +

      The LLVMSymbol class is used to describe the externally visible + functions and global variables, defined in LLVM bytecode files, to the linker. + This includes symbol visibility information. This information is used by + the linker to do symbol resolution. For example: function foo2() is + defined inside an LLVM bytecode module and it is an externally visible symbol. + This helps the linker connect the use of foo2() in native object + files with a future definition of the symbol foo2(). The linker + will see the actual definition of foo2() when it receives the + optimized native object file in + Symbol Resolution after optimization phase. If the + linker does not find any uses of foo2(), it updates LLVMSymbol + visibility information to notify LLVM intermodular optimizer that it is dead. + The LLVM intermodular optimizer takes advantage of such information to + generate better code.

      @@ -309,14 +304,13 @@
      -

      -readLLVMObjectFile() is used by the linker to read LLVM bytecode files -and collect LLVMSymbol nformation. This routine also -supplies list of externally defined symbols that are used by LLVM bytecode -files. Linker uses this symbol information to do symbol resolution. Internally, -LLVMlto maintains LLVM bytecode modules in memory. This -function also provides list of external references used by bytecode file.
      -

      +

      The readLLVMObjectFile() function is used by the linker to read + LLVM bytecode files and collect LLVMSymbol nformation. This routine also + supplies a list of externally defined symbols that are used by LLVM bytecode + files. The linker uses this symbol information to do symbol resolution. + Internally, LLVMlto maintains LLVM bytecode modules in + memory. This function also provides a list of external references used by + bytecode files.

      @@ -325,12 +319,11 @@
      -

      -The linker invokes optimizeModules to optimize already read LLVM -bytecode files by applying LLVM intermodular optimization techniques. This -function runs LLVM intermodular optimizer and generates native object code -as .o file at name and location provided by the linker. -

      +

      The linker invokes optimizeModules to optimize already read + LLVM bytecode files by applying LLVM intermodular optimization techniques. + This function runs the LLVM intermodular optimizer and generates native + object code as .o files at the name and location provided by the + linker.

      @@ -341,7 +334,7 @@
      -

      ... incomplete ...

      +

      ... To be completed ...

      @@ -356,7 +349,7 @@ Devang Patel
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/14 18:49:03 $ + Last modified: $Date: 2006/08/14 19:19:55 $ From pjenkins at apple.com Mon Aug 14 14:20:45 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Mon, 14 Aug 2006 14:20:45 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.cgi Message-ID: <200608141920.k7EJKjaT015715@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTestAccept.cgi updated: 1.45 -> 1.46 --- Log message: Changed around how lists of added and removed tests are created. --- Diffs of the changes: (+6 -6) NightlyTestAccept.cgi | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: nightlytest-serverside/NightlyTestAccept.cgi diff -u nightlytest-serverside/NightlyTestAccept.cgi:1.45 nightlytest-serverside/NightlyTestAccept.cgi:1.46 --- nightlytest-serverside/NightlyTestAccept.cgi:1.45 Mon Aug 14 01:56:59 2006 +++ nightlytest-serverside/NightlyTestAccept.cgi Mon Aug 14 14:20:30 2006 @@ -612,13 +612,13 @@ # the corresponding entry from the previous day. Therefore, we create a # different list that does not contain these words. $temp_test_list_today = $all_tests; -$temp_test_list_today =~ s/PASS//g; -$temp_test_list_today =~ s/FAIL//g; -$temp_test_list_today =~ s/XFAIL//g; +$temp_test_list_today =~ s/PASS\://g; +$temp_test_list_today =~ s/XFAIL\://g; +$temp_test_list_today =~ s/FAIL\://g; $temp_test_list_yesterday = $yesterdays_tests; -$temp_test_list_yesterday = s/PASS//g; -$temp_test_list_yesterday = s/FAIL//g; -$temp_test_list_yesterday = s/XFAIL//g; +$temp_test_list_yesterday = s/PASS\://g; +$temp_test_list_yesterday = s/XFAIL\://g; +$temp_test_list_yesterday = s/FAIL\://g; if($yesterdays_tests ne ""){ $new_tests = Difference $temp_test_list_today, $temp_test_list_yesterday; } From reid at x10sys.com Mon Aug 14 14:51:17 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 14:51:17 -0500 Subject: [llvm-commits] CVS: llvm/docs/LinkTimeOptimization.html Message-ID: <200608141951.k7EJpH9P018374@zion.cs.uiuc.edu> Changes in directory llvm/docs: LinkTimeOptimization.html updated: 1.4 -> 1.5 --- Log message: Fix a typo. --- Diffs of the changes: (+2 -2) LinkTimeOptimization.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/LinkTimeOptimization.html diff -u llvm/docs/LinkTimeOptimization.html:1.4 llvm/docs/LinkTimeOptimization.html:1.5 --- llvm/docs/LinkTimeOptimization.html:1.4 Mon Aug 14 14:19:55 2006 +++ llvm/docs/LinkTimeOptimization.html Mon Aug 14 14:51:02 2006 @@ -305,7 +305,7 @@

      The readLLVMObjectFile() function is used by the linker to read - LLVM bytecode files and collect LLVMSymbol nformation. This routine also + LLVM bytecode files and collect LLVMSymbol innformation. This routine also supplies a list of externally defined symbols that are used by LLVM bytecode files. The linker uses this symbol information to do symbol resolution. Internally, LLVMlto maintains LLVM bytecode modules in @@ -349,7 +349,7 @@ Devang Patel
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/14 19:19:55 $ + Last modified: $Date: 2006/08/14 19:51:02 $ From lattner at cs.uiuc.edu Mon Aug 14 15:08:05 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 15:08:05 -0500 Subject: [llvm-commits] CVS: llvm/docs/LinkTimeOptimization.html Message-ID: <200608142008.k7EK85xl018812@zion.cs.uiuc.edu> Changes in directory llvm/docs: LinkTimeOptimization.html updated: 1.5 -> 1.6 --- Log message: typo --- Diffs of the changes: (+2 -2) LinkTimeOptimization.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/LinkTimeOptimization.html diff -u llvm/docs/LinkTimeOptimization.html:1.5 llvm/docs/LinkTimeOptimization.html:1.6 --- llvm/docs/LinkTimeOptimization.html:1.5 Mon Aug 14 14:51:02 2006 +++ llvm/docs/LinkTimeOptimization.html Mon Aug 14 15:07:50 2006 @@ -305,7 +305,7 @@

      The readLLVMObjectFile() function is used by the linker to read - LLVM bytecode files and collect LLVMSymbol innformation. This routine also + LLVM bytecode files and collect LLVMSymbol information. This routine also supplies a list of externally defined symbols that are used by LLVM bytecode files. The linker uses this symbol information to do symbol resolution. Internally, LLVMlto maintains LLVM bytecode modules in @@ -349,7 +349,7 @@ Devang Patel
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/14 19:51:02 $ + Last modified: $Date: 2006/08/14 20:07:50 $ From lattner at cs.uiuc.edu Mon Aug 14 15:12:59 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 15:12:59 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp SelectionDAGCSEMap.cpp Message-ID: <200608142012.k7EKCxlX018983@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.325 -> 1.326 SelectionDAGCSEMap.cpp updated: 1.5 -> 1.6 --- Log message: Add the actual constant to the hash for ConstantPool nodes. Thanks to Rafael Espindola for pointing this out. --- Diffs of the changes: (+2 -0) SelectionDAG.cpp | 1 + SelectionDAGCSEMap.cpp | 1 + 2 files changed, 2 insertions(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.325 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.326 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.325 Fri Aug 11 16:55:30 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 14 15:12:44 2006 @@ -583,6 +583,7 @@ SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); ID.AddInteger(Alignment); ID.AddInteger(Offset); + ID.AddPointer(C); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.5 llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.6 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.5 Fri Aug 11 20:07:10 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp Mon Aug 14 15:12:44 2006 @@ -64,6 +64,7 @@ case ISD::TargetConstantPool: AddInteger(cast(N)->getAlignment()); AddInteger(cast(N)->getOffset()); + AddPointer(cast(N)->get()); break; } } From lattner at cs.uiuc.edu Mon Aug 14 15:45:41 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 15:45:41 -0500 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200608142045.k7EKjfi0014835@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.141 -> 1.142 --- Log message: Update the example to work with llvm-gcc4. Fix validation errors. --- Diffs of the changes: (+87 -6) GettingStarted.html | 93 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 87 insertions(+), 6 deletions(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.141 llvm/docs/GettingStarted.html:1.142 --- llvm/docs/GettingStarted.html:1.141 Thu Aug 3 17:14:43 2006 +++ llvm/docs/GettingStarted.html Mon Aug 14 15:45:25 2006 @@ -305,17 +305,18 @@

    • No native code generation
    • Build is not complete: one or more tools don't link
    • The GCC-based C/C++ frontend does not build
    • -
    • The port is done using the MSYS shell. +
    • The port is done using the MSYS shell. Download and install bison (excl. M4.exe) and flex in that order. Build binutils-2.15 from source, -if necessary. Bison & flex can be also grabbed from GNUWin32 sf.net project
    • +if necessary. Bison & flex can be also grabbed from GNUWin32 sf.net +project.
    • Native code generation exists but is not complete.
    • -
    • Binutils up to post-2.17 has bug in bfd/cofflink.c +
    • Binutils up to post-2.17 has bug in bfd/cofflink.c preventing LLVM from building correctly. Several workarounds have been introduced into LLVM build system, but the bug can occur anytime in the - future. It's highly recommended to rebuild your current binutils with the + future. We highly recommend that you rebuild your current binutils with the patch from - Binutils bugzilla, if it's wasn't already applied.
    • + Binutils bugzilla, if it wasn't already applied.
      @@ -1489,6 +1490,86 @@
      +

      This section gives an example of using LLVM. Since we are currently +transitioning from llvm-gcc3 to llvm-gcc4, we include examples for both. +

      +
      + + + + +
      + +
        +
      1. First, create a simple C file, name it 'hello.c': +
        +   #include <stdio.h>
        +   int main() {
        +     printf("hello world\n");
        +     return 0;
        +   }
        +       
      2. + +
      3. Next, compile the C file into a native executable:

        + +

        % llvm-gcc hello.c -o hello

        + +

        Note that llvm-gcc works just like GCC by default. The standard -S and + -c arguments work as usual (producing a native .s or .o file, + respectively).

        + +
      4. Next, compile the C file into a LLVM bytecode file:

        +

        % llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc

        + +

        The -emit-llvm option can be used with the -S or -c options to emit an + LLVM ".ll" or ".bc" file (respectively) for the code. This allows you + to use the standard LLVM tools on + the bytecode file.

        + +

        Unlike llvm-gcc3, llvm-gcc4 correctly responds to -O[0123] arguments. +

      5. + +
      6. Run the program in both forms. To run the program, use:

        + +

        % ./hello

        + +

        and

        + +

        % lli hello.bc

      7. + +

        The second examples shows how to invoke the LLVM JIT, lli.

        + +
      8. Use the llvm-dis utility to take a look at the LLVM assembly + code:

        + +

        % llvm-dis < hello.bc | less

      9. + +
      10. Compile the program to native assembly using the LLC code + generator:

        + +

        % llc hello.bc -o hello.s

        + +
      11. Assemble the native assembly language file into a program:

        + +

        Solaris:% /opt/SUNWspro/bin/cc -xarch=v9 hello.s -o hello.native

        +

        Others:% gcc hello.s -o hello.native

        + +
      12. Execute the native code program:

        + +

        % ./hello.native

      13. + +

        Note that using llvm-gcc to compile directly to native code (i.e. when + the -emit-llvm option is not present) does steps 6/7/8 for you.

        + +
      + +
      + + + + +
      1. First, create a simple C file, name it 'hello.c': @@ -1595,7 +1676,7 @@ Chris Lattner
        Reid Spencer
        The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/03 22:14:43 $ + Last modified: $Date: 2006/08/14 20:45:25 $ From lattner at cs.uiuc.edu Mon Aug 14 15:51:51 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 15:51:51 -0500 Subject: [llvm-commits] CVS: llvm/docs/GettingStarted.html Message-ID: <200608142051.k7EKppwK015101@zion.cs.uiuc.edu> Changes in directory llvm/docs: GettingStarted.html updated: 1.142 -> 1.143 --- Log message: Fix more validation issues --- Diffs of the changes: (+5 -4) GettingStarted.html | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.142 llvm/docs/GettingStarted.html:1.143 --- llvm/docs/GettingStarted.html:1.142 Mon Aug 14 15:45:25 2006 +++ llvm/docs/GettingStarted.html Mon Aug 14 15:51:35 2006 @@ -1535,10 +1535,10 @@

        and

        -

        % lli hello.bc

      2. +

        % lli hello.bc

        The second examples shows how to invoke the LLVM JIT, lli.

        + href="CommandGuide/html/lli.html">lli.

      3. Use the llvm-dis utility to take a look at the LLVM assembly code:

        @@ -1557,10 +1557,11 @@
      4. Execute the native code program:

        -

        % ./hello.native

      5. +

        % ./hello.native

        Note that using llvm-gcc to compile directly to native code (i.e. when the -emit-llvm option is not present) does steps 6/7/8 for you.

        +
      @@ -1676,7 +1677,7 @@ Chris Lattner
      Reid Spencer
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/14 20:45:25 $ + Last modified: $Date: 2006/08/14 20:51:35 $ From reid at x10sys.com Mon Aug 14 16:10:53 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 16:10:53 -0500 Subject: [llvm-commits] CVS: llvm-www/demo/index.cgi Message-ID: <200608142110.k7ELArRl018260@zion.cs.uiuc.edu> Changes in directory llvm-www/demo: index.cgi updated: 1.63 -> 1.64 --- Log message: Actually dereference a variable name in the llvm2cpp command. --- Diffs of the changes: (+4 -3) index.cgi | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm-www/demo/index.cgi diff -u llvm-www/demo/index.cgi:1.63 llvm-www/demo/index.cgi:1.64 --- llvm-www/demo/index.cgi:1.63 Wed Aug 9 17:47:28 2006 +++ llvm-www/demo/index.cgi Mon Aug 14 16:09:53 2006 @@ -5,13 +5,13 @@ # doing remote web JO99C compilations. (It could still be used for that # purpose, though the two scripts have diverged somewhat.) # -# Last modified $Date: 2006/08/09 22:47:28 $ +# Last modified $Date: 2006/08/14 21:09:53 $ # use strict; use CGI; use POSIX; -use Mail::Send; +#use Mail::Send; $| = 1; @@ -440,7 +440,8 @@ } if ($c->param('showllvm2cpp') ) { my $l2cppFile = getname(".l2cpp"); - try_run("llvm2cpp","llvm2cpp $bytecodeFile -o l2cppFile 2>&1",$l2cppFile); + try_run("llvm2cpp","llvm2cpp $bytecodeFile -o $l2cppFile 2>&1", + $l2cppFile); } addlog( $source, $pid, $UnhilightedResult ); From reid at x10sys.com Mon Aug 14 16:12:49 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 16:12:49 -0500 Subject: [llvm-commits] CVS: llvm-www/demo/index.cgi Message-ID: <200608142112.k7ELCn27018492@zion.cs.uiuc.edu> Changes in directory llvm-www/demo: index.cgi updated: 1.64 -> 1.65 --- Log message: Don't comment out the Mail::Send package! --- Diffs of the changes: (+2 -2) index.cgi | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/demo/index.cgi diff -u llvm-www/demo/index.cgi:1.64 llvm-www/demo/index.cgi:1.65 --- llvm-www/demo/index.cgi:1.64 Mon Aug 14 16:09:53 2006 +++ llvm-www/demo/index.cgi Mon Aug 14 16:12:35 2006 @@ -5,13 +5,13 @@ # doing remote web JO99C compilations. (It could still be used for that # purpose, though the two scripts have diverged somewhat.) # -# Last modified $Date: 2006/08/14 21:09:53 $ +# Last modified $Date: 2006/08/14 21:12:35 $ # use strict; use CGI; use POSIX; -#use Mail::Send; +use Mail::Send; $| = 1; From lattner at cs.uiuc.edu Mon Aug 14 16:37:46 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 16:37:46 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll Message-ID: <200608142137.k7ELbkOR019069@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/CondProp: 2006-08-14-SingleEntryPhiCrash.ll added (r1.1) --- Log message: new testcase from PR877: http://llvm.org/PR877 --- Diffs of the changes: (+466 -0) 2006-08-14-SingleEntryPhiCrash.ll | 466 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 466 insertions(+) Index: llvm/test/Regression/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll diff -c /dev/null llvm/test/Regression/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll:1.1 *** /dev/null Mon Aug 14 16:37:42 2006 --- llvm/test/Regression/Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll Mon Aug 14 16:37:32 2006 *************** *** 0 **** --- 1,466 ---- + ; RUN: llvm-as < %s | opt -condprop -disable-output + ; PR877 + + target endian = big + target pointersize = 32 + target triple = "powerpc-apple-darwin9.0.0d1" + "struct.kc::impl_Ccode_option" = type { "struct.kc::impl_abstract_phylum" } + "struct.kc::impl_ID" = type { "struct.kc::impl_abstract_phylum", "struct.kc::impl_Ccode_option"*, "struct.kc::impl_casestring__Str"*, int, "struct.kc::impl_casestring__Str"* } + "struct.kc::impl_abstract_phylum" = type { int (...)** } + "struct.kc::impl_casestring__Str" = type { "struct.kc::impl_abstract_phylum", sbyte* } + "struct.kc::impl_elem_patternrepresentation" = type { "struct.kc::impl_abstract_phylum", int, "struct.kc::impl_casestring__Str"*, "struct.kc::impl_ID"* } + "struct.kc::impl_outmostpatterns" = type { "struct.kc::impl_Ccode_option", "struct.kc::impl_elem_patternrepresentation"*, "struct.kc::impl_outmostpatterns"* } + "struct.kc::impl_patternrepresentations" = type { "struct.kc::impl_Ccode_option", "struct.kc::impl_outmostpatterns"*, "struct.kc::impl_patternrepresentations"* } + + implementation ; Functions: + + void %_ZN2kc16compare_patternsEPNS_26impl_patternrepresentationES1_PNS_27impl_patternrepresentationsE() { + entry: + br label %bb1269.outer.outer.outer.outer + + cond_true: ; preds = %cond_true1298 + br label %bb1269.outer69 + + cond_false: ; preds = %cond_true1298 + br bool false, label %cond_next, label %bb51 + + cond_next: ; preds = %cond_false + br bool false, label %bb52, label %bb51 + + bb51: ; preds = %cond_next, %cond_false + br label %bb52 + + bb52: ; preds = %bb51, %cond_next + br bool false, label %cond_false82, label %cond_true55 + + cond_true55: ; preds = %bb52 + br bool false, label %UnifiedReturnBlock, label %cond_true57 + + cond_true57: ; preds = %cond_true55 + br label %UnifiedReturnBlock + + cond_false82: ; preds = %bb52 + br bool false, label %cond_next97, label %bb113 + + cond_next97: ; preds = %cond_false82 + br bool false, label %bb114, label %bb113 + + bb113: ; preds = %cond_next97, %cond_false82 + br label %bb114 + + bb114: ; preds = %bb113, %cond_next97 + br bool false, label %cond_false151, label %cond_true117 + + cond_true117: ; preds = %bb114 + br bool false, label %UnifiedReturnBlock, label %cond_true120 + + cond_true120: ; preds = %cond_true117 + br label %UnifiedReturnBlock + + cond_false151: ; preds = %bb114 + br bool false, label %cond_next166, label %bb182 + + cond_next166: ; preds = %cond_false151 + br bool false, label %bb183, label %bb182 + + bb182: ; preds = %cond_next166, %cond_false151 + br label %bb183 + + bb183: ; preds = %bb182, %cond_next166 + br bool false, label %cond_false256, label %cond_true186 + + cond_true186: ; preds = %bb183 + br bool false, label %cond_true207, label %cond_false214 + + cond_true207: ; preds = %cond_true186 + br label %bb1269.outer38.backedge + + bb1269.outer38.backedge: ; preds = %cond_true545, %cond_true432, %cond_true320, %cond_true207 + br label %bb1269.outer38 + + cond_false214: ; preds = %cond_true186 + br bool false, label %cond_true228, label %cond_false235 + + cond_true228: ; preds = %cond_false214 + br label %bb1269.outer21.backedge + + bb1269.outer21.backedge: ; preds = %cond_true566, %cond_true453, %cond_true341, %cond_true228 + br label %bb1269.outer21 + + cond_false235: ; preds = %cond_false214 + br bool false, label %UnifiedReturnBlock, label %cond_false250 + + cond_false250: ; preds = %cond_false235 + br label %UnifiedUnreachableBlock + + cond_false256: ; preds = %bb183 + br bool false, label %cond_next271, label %bb287 + + cond_next271: ; preds = %cond_false256 + br bool false, label %bb288, label %bb287 + + bb287: ; preds = %cond_next271, %cond_false256 + br label %bb288 + + bb288: ; preds = %bb287, %cond_next271 + br bool false, label %cond_false369, label %cond_true291 + + cond_true291: ; preds = %bb288 + br bool false, label %cond_true320, label %cond_false327 + + cond_true320: ; preds = %cond_true291 + br label %bb1269.outer38.backedge + + cond_false327: ; preds = %cond_true291 + br bool false, label %cond_true341, label %cond_false348 + + cond_true341: ; preds = %cond_false327 + br label %bb1269.outer21.backedge + + cond_false348: ; preds = %cond_false327 + br bool false, label %UnifiedReturnBlock, label %cond_false363 + + cond_false363: ; preds = %cond_false348 + br label %UnifiedUnreachableBlock + + cond_false369: ; preds = %bb288 + br bool false, label %cond_next384, label %bb400 + + cond_next384: ; preds = %cond_false369 + br bool false, label %bb401, label %bb400 + + bb400: ; preds = %cond_next384, %cond_false369 + br label %bb401 + + bb401: ; preds = %bb400, %cond_next384 + br bool false, label %cond_false481, label %cond_true404 + + cond_true404: ; preds = %bb401 + br bool false, label %cond_true432, label %cond_false439 + + cond_true432: ; preds = %cond_true404 + br label %bb1269.outer38.backedge + + cond_false439: ; preds = %cond_true404 + br bool false, label %cond_true453, label %cond_false460 + + cond_true453: ; preds = %cond_false439 + br label %bb1269.outer21.backedge + + cond_false460: ; preds = %cond_false439 + br bool false, label %UnifiedReturnBlock, label %cond_false475 + + cond_false475: ; preds = %cond_false460 + br label %UnifiedUnreachableBlock + + cond_false481: ; preds = %bb401 + br bool false, label %cond_next496, label %bb512 + + cond_next496: ; preds = %cond_false481 + br bool false, label %bb513, label %bb512 + + bb512: ; preds = %cond_next496, %cond_false481 + br label %bb513 + + bb513: ; preds = %bb512, %cond_next496 + br bool false, label %cond_false594, label %cond_true516 + + cond_true516: ; preds = %bb513 + br bool false, label %cond_true545, label %cond_false552 + + cond_true545: ; preds = %cond_true516 + br label %bb1269.outer38.backedge + + cond_false552: ; preds = %cond_true516 + br bool false, label %cond_true566, label %cond_false573 + + cond_true566: ; preds = %cond_false552 + br label %bb1269.outer21.backedge + + cond_false573: ; preds = %cond_false552 + br bool false, label %UnifiedReturnBlock, label %cond_false588 + + cond_false588: ; preds = %cond_false573 + br label %UnifiedUnreachableBlock + + cond_false594: ; preds = %bb513 + br bool false, label %cond_next609, label %bb625 + + cond_next609: ; preds = %cond_false594 + br bool false, label %bb626, label %bb625 + + bb625: ; preds = %cond_next609, %cond_false594 + br label %bb626 + + bb626: ; preds = %bb625, %cond_next609 + br bool false, label %cond_false707, label %cond_true629 + + cond_true629: ; preds = %bb626 + br bool false, label %cond_true658, label %cond_false665 + + cond_true658: ; preds = %cond_true629 + br label %bb1269.outer2.backedge + + bb1269.outer2.backedge: ; preds = %cond_true679, %cond_true658 + br label %bb1269.outer2 + + cond_false665: ; preds = %cond_true629 + br bool false, label %cond_true679, label %cond_false686 + + cond_true679: ; preds = %cond_false665 + br label %bb1269.outer2.backedge + + cond_false686: ; preds = %cond_false665 + br bool false, label %UnifiedReturnBlock, label %cond_false701 + + cond_false701: ; preds = %cond_false686 + br label %UnifiedUnreachableBlock + + cond_false707: ; preds = %bb626 + br bool false, label %cond_next722, label %bb738 + + cond_next722: ; preds = %cond_false707 + br bool false, label %bb739, label %bb738 + + bb738: ; preds = %cond_next722, %cond_false707 + br label %bb739 + + bb739: ; preds = %bb738, %cond_next722 + br bool false, label %cond_false820, label %cond_true742 + + cond_true742: ; preds = %bb739 + br bool false, label %cond_true771, label %cond_false778 + + cond_true771: ; preds = %cond_true742 + br label %bb1269.outer.backedge + + bb1269.outer.backedge: ; preds = %cond_true792, %cond_true771 + br label %bb1269.outer + + cond_false778: ; preds = %cond_true742 + br bool false, label %cond_true792, label %cond_false799 + + cond_true792: ; preds = %cond_false778 + br label %bb1269.outer.backedge + + cond_false799: ; preds = %cond_false778 + br bool false, label %UnifiedReturnBlock, label %cond_false814 + + cond_false814: ; preds = %cond_false799 + br label %UnifiedUnreachableBlock + + cond_false820: ; preds = %bb739 + br bool false, label %cond_next835, label %bb851 + + cond_next835: ; preds = %cond_false820 + br bool false, label %bb852, label %bb851 + + bb851: ; preds = %cond_next835, %cond_false820 + br label %bb852 + + bb852: ; preds = %bb851, %cond_next835 + br bool false, label %cond_false933, label %cond_true855 + + cond_true855: ; preds = %bb852 + br bool false, label %cond_true884, label %cond_false891 + + cond_true884: ; preds = %cond_true855 + br label %bb1269.outer.outer.backedge + + bb1269.outer.outer.backedge: ; preds = %cond_true905, %cond_true884 + br label %bb1269.outer.outer + + cond_false891: ; preds = %cond_true855 + br bool false, label %cond_true905, label %cond_false912 + + cond_true905: ; preds = %cond_false891 + br label %bb1269.outer.outer.backedge + + cond_false912: ; preds = %cond_false891 + br bool false, label %UnifiedReturnBlock, label %cond_false927 + + cond_false927: ; preds = %cond_false912 + br label %UnifiedUnreachableBlock + + cond_false933: ; preds = %bb852 + br bool false, label %cond_next948, label %bb964 + + cond_next948: ; preds = %cond_false933 + br bool false, label %bb965, label %bb964 + + bb964: ; preds = %cond_next948, %cond_false933 + br label %bb965 + + bb965: ; preds = %bb964, %cond_next948 + br bool false, label %cond_false1046, label %cond_true968 + + cond_true968: ; preds = %bb965 + br bool false, label %cond_true997, label %cond_false1004 + + cond_true997: ; preds = %cond_true968 + br label %bb1269.outer.outer.outer.backedge + + bb1269.outer.outer.outer.backedge: ; preds = %cond_true1018, %cond_true997 + br label %bb1269.outer.outer.outer + + cond_false1004: ; preds = %cond_true968 + br bool false, label %cond_true1018, label %cond_false1025 + + cond_true1018: ; preds = %cond_false1004 + br label %bb1269.outer.outer.outer.backedge + + cond_false1025: ; preds = %cond_false1004 + br bool false, label %UnifiedReturnBlock, label %cond_false1040 + + cond_false1040: ; preds = %cond_false1025 + br label %UnifiedUnreachableBlock + + cond_false1046: ; preds = %bb965 + br bool false, label %cond_next1061, label %bb1077 + + cond_next1061: ; preds = %cond_false1046 + br bool false, label %bb1078, label %bb1077 + + bb1077: ; preds = %cond_next1061, %cond_false1046 + br label %bb1078 + + bb1078: ; preds = %bb1077, %cond_next1061 + %tmp1080 = phi bool [ true, %bb1077 ], [ false, %cond_next1061 ] ; [#uses=1] + br bool %tmp1080, label %cond_false1159, label %cond_true1081 + + cond_true1081: ; preds = %bb1078 + br bool false, label %cond_true1110, label %cond_false1117 + + cond_true1110: ; preds = %cond_true1081 + br label %bb1269.outer.outer.outer.outer.backedge + + bb1269.outer.outer.outer.outer.backedge: ; preds = %cond_true1131, %cond_true1110 + br label %bb1269.outer.outer.outer.outer + + cond_false1117: ; preds = %cond_true1081 + br bool false, label %cond_true1131, label %cond_false1138 + + cond_true1131: ; preds = %cond_false1117 + br label %bb1269.outer.outer.outer.outer.backedge + + cond_false1138: ; preds = %cond_false1117 + br bool false, label %UnifiedReturnBlock, label %cond_false1153 + + cond_false1153: ; preds = %cond_false1138 + br label %UnifiedUnreachableBlock + + cond_false1159: ; preds = %bb1078 + %tmp.i119.lcssa35.lcssa.lcssa.lcssa.lcssa.lcssa = phi "struct.kc::impl_elem_patternrepresentation"* [ null, %bb1078 ] ; <"struct.kc::impl_elem_patternrepresentation"*> [#uses=0] + br bool false, label %UnifiedReturnBlock, label %cond_false1174 + + cond_false1174: ; preds = %cond_false1159 + br bool false, label %UnifiedReturnBlock, label %cond_false1189 + + cond_false1189: ; preds = %cond_false1174 + br bool false, label %UnifiedReturnBlock, label %cond_false1204 + + cond_false1204: ; preds = %cond_false1189 + br bool false, label %UnifiedReturnBlock, label %cond_false1219 + + cond_false1219: ; preds = %cond_false1204 + br bool false, label %UnifiedReturnBlock, label %cond_true1222 + + cond_true1222: ; preds = %cond_false1219 + br label %UnifiedReturnBlock + + bb1269.outer.outer.outer.outer: ; preds = %bb1269.outer.outer.outer.outer.backedge, %entry + br label %bb1269.outer.outer.outer + + bb1269.outer.outer.outer: ; preds = %bb1269.outer.outer.outer.outer, %bb1269.outer.outer.outer.backedge + br label %bb1269.outer.outer + + bb1269.outer.outer: ; preds = %bb1269.outer.outer.outer, %bb1269.outer.outer.backedge + br label %bb1269.outer + + bb1269.outer: ; preds = %bb1269.outer.outer, %bb1269.outer.backedge + br label %bb1269.outer2 + + bb1269.outer2: ; preds = %bb1269.outer, %bb1269.outer2.backedge + br label %bb1269.outer21 + + bb1269.outer21: ; preds = %bb1269.outer2, %bb1269.outer21.backedge + br label %bb1269.outer38 + + bb1269.outer38: ; preds = %bb1269.outer21, %bb1269.outer38.backedge + br label %bb1269.outer54 + + bb1269.outer54: ; preds = %bb1269.outer38 + br label %bb1269.outer69 + + bb1269.outer69: ; preds = %bb1269.outer54, %cond_true + br label %bb1269 + + bb1269: ; preds = %bb1269.outer69 + br bool false, label %cond_next1281, label %bb1294 + + cond_next1281: ; preds = %bb1269 + br bool false, label %cond_true1298, label %bb1294 + + bb1294: ; preds = %cond_next1281, %bb1269 + br bool false, label %cond_true1331, label %cond_next1313 + + cond_true1298: ; preds = %cond_next1281 + br bool false, label %cond_false, label %cond_true + + cond_next1313: ; preds = %bb1294 + br bool false, label %cond_true1331, label %cond_next1355 + + cond_true1331: ; preds = %cond_next1313, %bb1294 + br bool false, label %cond_false1346, label %cond_true1342 + + cond_true1342: ; preds = %cond_true1331 + br label %cond_next1350 + + cond_false1346: ; preds = %cond_true1331 + br label %cond_next1350 + + cond_next1350: ; preds = %cond_false1346, %cond_true1342 + br label %bb.i + + bb.i: ; preds = %bb.i, %cond_next1350 + br bool false, label %_ZN2kc18impl_abstract_list8freelistEv.exit, label %bb.i + + _ZN2kc18impl_abstract_list8freelistEv.exit: ; preds = %bb.i + br label %cond_next1355 + + cond_next1355: ; preds = %_ZN2kc18impl_abstract_list8freelistEv.exit, %cond_next1313 + br bool false, label %cond_next1363, label %bb1388 + + cond_next1363: ; preds = %cond_next1355 + br bool false, label %UnifiedReturnBlock, label %cond_true1366 + + cond_true1366: ; preds = %cond_next1363 + br label %UnifiedReturnBlock + + bb1388: ; preds = %cond_next1355 + br bool false, label %UnifiedReturnBlock, label %bb1414.preheader + + bb1414.preheader: ; preds = %bb1388 + br label %bb1414 + + bb1414: ; preds = %cond_true1426, %bb1414.preheader + br bool false, label %cond_true1426, label %bb1429 + + cond_true1426: ; preds = %bb1414 + br label %bb1414 + + bb1429: ; preds = %bb1414 + br bool false, label %cond_true1431, label %UnifiedReturnBlock + + cond_true1431: ; preds = %bb1429 + br bool false, label %UnifiedReturnBlock, label %cond_true1434 + + cond_true1434: ; preds = %cond_true1431 + br label %UnifiedReturnBlock + + UnifiedUnreachableBlock: ; preds = %cond_false1153, %cond_false1040, %cond_false927, %cond_false814, %cond_false701, %cond_false588, %cond_false475, %cond_false363, %cond_false250 + unreachable + + UnifiedReturnBlock: ; preds = %cond_true1434, %cond_true1431, %bb1429, %bb1388, %cond_true1366, %cond_next1363, %cond_true1222, %cond_false1219, %cond_false1204, %cond_false1189, %cond_false1174, %cond_false1159, %cond_false1138, %cond_false1025, %cond_false912, %cond_false799, %cond_false686, %cond_false573, %cond_false460, %cond_false348, %cond_false235, %cond_true120, %cond_true117, %cond_true57, %cond_true55 + ret void + } From lattner at cs.uiuc.edu Mon Aug 14 16:38:19 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 16:38:19 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/CondPropagate.cpp Message-ID: <200608142138.k7ELcJx3019116@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: CondPropagate.cpp updated: 1.4 -> 1.5 --- Log message: Handle single-entry PHI nodes correctly. This fixes PR877: http://llvm.org/PR877 and Transforms/CondProp/2006-08-14-SingleEntryPhiCrash.ll --- Diffs of the changes: (+11 -1) CondPropagate.cpp | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.4 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.5 --- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.4 Thu Aug 4 18:24:19 2005 +++ llvm/lib/Transforms/Scalar/CondPropagate.cpp Mon Aug 14 16:38:05 2006 @@ -87,8 +87,18 @@ // If this block ends with an unconditional branch and the only successor has // only this block as a predecessor, merge the two blocks together. if (BranchInst *BI = dyn_cast(BB->getTerminator())) - if (BI->isUnconditional() && BI->getSuccessor(0)->getSinglePredecessor()) { + if (BI->isUnconditional() && BI->getSuccessor(0)->getSinglePredecessor() && + BB != BI->getSuccessor(0)) { BasicBlock *Succ = BI->getSuccessor(0); + + // If Succ has any PHI nodes, they are all single-entry PHI's. + while (PHINode *PN = dyn_cast(Succ->begin())) { + assert(PN->getNumIncomingValues() == 1 && + "PHI doesn't match parent block"); + PN->replaceAllUsesWith(PN->getIncomingValue(0)); + PN->eraseFromParent(); + } + // Remove BI. BI->eraseFromParent(); From lattner at cs.uiuc.edu Mon Aug 14 16:48:05 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 16:48:05 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200608142148.k7ELm5Lv005043@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.11 -> 1.12 --- Log message: avoid a warning --- Diffs of the changes: (+1 -1) SmallVector.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.11 llvm/include/llvm/ADT/SmallVector.h:1.12 --- llvm/include/llvm/ADT/SmallVector.h:1.11 Fri Aug 11 18:40:23 2006 +++ llvm/include/llvm/ADT/SmallVector.h Mon Aug 14 16:47:50 2006 @@ -196,7 +196,7 @@ // If we have to grow to have enough elements, destroy the current elements. // This allows us to avoid copying them during the grow. - if (Capacity-Begin < RHSSize) { + if (unsigned(Capacity-Begin) < RHSSize) { // Destroy current elements. for (iterator I = Begin, E = End; I != E; ++I) I->~T(); From lattner at cs.uiuc.edu Mon Aug 14 17:19:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 17:19:40 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp SelectionDAGCSEMap.cpp Message-ID: <200608142219.k7EMJeFN012732@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.326 -> 1.327 SelectionDAGCSEMap.cpp updated: 1.6 -> 1.7 --- Log message: Add code to resize the CSEMap hash table. This doesn't speedup codegen of kimwitu, but seems like a good idea from a "avoid performance cliffs" standpoint :) --- Diffs of the changes: (+47 -3) SelectionDAG.cpp | 1 + SelectionDAGCSEMap.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.326 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.327 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.326 Mon Aug 14 15:12:44 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 14 17:19:25 2006 @@ -469,6 +469,7 @@ SelectionDAG::~SelectionDAG() { while (!AllNodes.empty()) { SDNode *N = AllNodes.begin(); + N->SetNextInBucket(0); delete [] N->OperandList; N->OperandList = 0; N->NumOperands = 0; Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.6 llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.7 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.6 Mon Aug 14 15:12:44 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp Mon Aug 14 17:19:25 2006 @@ -157,7 +157,7 @@ // SelectionDAGCSEMap Implementation SelectionDAGCSEMap::SelectionDAGCSEMap() : NumNodes(0) { - NumBuckets = 256; + NumBuckets = 64; Buckets = new void*[NumBuckets]; memset(Buckets, 0, NumBuckets*sizeof(void*)); } @@ -176,6 +176,15 @@ return static_cast(NextInBucketPtr); } +/// GetNextPtr - This is just like the previous GetNextPtr implementation, but +/// allows a bucket array to be specified. +SDNode *SelectionDAGCSEMap::GetNextPtr(void *NextInBucketPtr, void **Bucks, + unsigned NumBuck) { + if (NextInBucketPtr >= Bucks && NextInBucketPtr < Bucks+NumBuck) + return 0; + return static_cast(NextInBucketPtr); +} + void **SelectionDAGCSEMap::GetBucketPtr(void *NextInBucketPtr) { //assert(NextInBucketPtr >= Buckets && NextInBucketPtr < Buckets+NumBuckets && // "NextInBucketPtr is not a bucket ptr"); @@ -185,13 +194,42 @@ /// GetBucketFor - Hash the specified node ID and return the hash bucket for the /// specified ID. void **SelectionDAGCSEMap::GetBucketFor(const NodeID &ID) const { - // TODO: if load is high, resize hash table. - // NumBuckets is always a power of 2. unsigned BucketNum = ID.ComputeHash() & (NumBuckets-1); return Buckets+BucketNum; } +/// GrowHashTable - Double the size of the hash table and rehash everything. +/// +void SelectionDAGCSEMap::GrowHashTable() { + void **OldBuckets = Buckets; + unsigned OldNumBuckets = NumBuckets; + NumBuckets <<= 1; + + // Reset the node count to zero: we're going to reinsert everything. + NumNodes = 0; + + // Clear out new buckets. + Buckets = new void*[NumBuckets]; + memset(Buckets, 0, NumBuckets*sizeof(void*)); + + // Walk the old buckets, rehashing nodes into their new place. + for (unsigned i = 0; i != OldNumBuckets; ++i) { + void *Probe = OldBuckets[i]; + if (!Probe) continue; + while (SDNode *NodeInBucket = GetNextPtr(Probe, OldBuckets, OldNumBuckets)){ + // Figure out the next link, remove NodeInBucket from the old link. + Probe = NodeInBucket->getNextInBucket(); + NodeInBucket->SetNextInBucket(0); + + // Insert the node into the new bucket, after recomputing the hash. + InsertNode(NodeInBucket, GetBucketFor(NodeID(NodeInBucket))); + } + } + + delete[] OldBuckets; +} + /// FindNodeOrInsertPos - Look up the node specified by ID. If it exists, /// return it. If not, return the insertion token that will make insertion /// faster. @@ -226,6 +264,11 @@ /// FindNodeOrInsertPos. void SelectionDAGCSEMap::InsertNode(SDNode *N, void *InsertPos) { ++NumNodes; + // Do we need to grow the hashtable? + if (NumNodes > NumBuckets*2) { + GrowHashTable(); + InsertPos = GetBucketFor(NodeID(N)); + } /// The insert position is actually a bucket pointer. void **Bucket = static_cast(InsertPos); From lattner at cs.uiuc.edu Mon Aug 14 17:19:41 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 17:19:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGCSEMap.h SelectionDAGNodes.h Message-ID: <200608142219.k7EMJfJH012741@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.117 -> 1.118 SelectionDAGCSEMap.h updated: 1.5 -> 1.6 SelectionDAGNodes.h updated: 1.139 -> 1.140 --- Log message: Add code to resize the CSEMap hash table. This doesn't speedup codegen of kimwitu, but seems like a good idea from a "avoid performance cliffs" standpoint :) --- Diffs of the changes: (+9 -3) SelectionDAG.h | 9 ++++++--- SelectionDAGCSEMap.h | 2 ++ SelectionDAGNodes.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.117 llvm/include/llvm/CodeGen/SelectionDAG.h:1.118 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.117 Fri Aug 11 16:55:30 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Mon Aug 14 17:19:25 2006 @@ -46,12 +46,16 @@ MachineFunction &MF; MachineDebugInfo *DI; - // Root - The root of the entire DAG. EntryNode - The starting token. + /// Root - The root of the entire DAG. EntryNode - The starting token. SDOperand Root, EntryNode; - // AllNodes - A linked list of nodes in the current DAG. + /// AllNodes - A linked list of nodes in the current DAG. ilist AllNodes; + /// CSEMap - This structure is used to memoize nodes, automatically performing + /// CSE with existing nodes with a duplicate is requested. + SelectionDAGCSEMap CSEMap; + public: SelectionDAG(TargetLowering &tli, MachineFunction &mf, MachineDebugInfo *di) : TLI(tli), MF(mf), DI(di) { @@ -464,7 +468,6 @@ std::map ExternalSymbols; std::map TargetExternalSymbols; std::map StringNodes; - SelectionDAGCSEMap CSEMap; }; template <> struct GraphTraits : public GraphTraits { Index: llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h diff -u llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h:1.5 llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h:1.6 --- llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h:1.5 Fri Aug 11 20:07:51 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h Mon Aug 14 17:19:25 2006 @@ -117,8 +117,10 @@ private: SDNode *GetNextPtr(void *NextInBucketPtr); + SDNode *GetNextPtr(void *NextInBucketPtr, void **Buckets, unsigned NumBuck); void **GetBucketPtr(void *NextInBucketPtr); void **GetBucketFor(const NodeID &ID) const; + void GrowHashTable(); }; } // end namespace llvm Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.139 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.140 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.139 Mon Aug 7 20:09:31 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Aug 14 17:19:25 2006 @@ -719,6 +719,7 @@ public: virtual ~SDNode() { assert(NumOperands == 0 && "Operand list not cleared before deletion"); + assert(NextInBucket == 0 && "Still in CSEMap?"); NodeType = ISD::DELETED_NODE; } From lattner at cs.uiuc.edu Mon Aug 14 17:21:33 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 17:21:33 -0500 Subject: [llvm-commits] CVS: llvm-test/External/Povray/.cvsignore Message-ID: <200608142221.k7EMLXCJ013243@zion.cs.uiuc.edu> Changes in directory llvm-test/External/Povray: .cvsignore added (r1.1) --- Log message: The makefile copies all the povray source into this dir, don't report them as ?'s when cvs up'ing. --- Diffs of the changes: (+3 -0) .cvsignore | 3 +++ 1 files changed, 3 insertions(+) Index: llvm-test/External/Povray/.cvsignore diff -c /dev/null llvm-test/External/Povray/.cvsignore:1.1 *** /dev/null Mon Aug 14 17:21:28 2006 --- llvm-test/External/Povray/.cvsignore Mon Aug 14 17:21:18 2006 *************** *** 0 **** --- 1,3 ---- + *.c + Output + From lattner at cs.uiuc.edu Mon Aug 14 17:24:56 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 17:24:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200608142224.k7EMOuV0014269@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.327 -> 1.328 --- Log message: remove SelectionDAG::InsertISelMapEntry, it is dead --- Diffs of the changes: (+0 -9) SelectionDAG.cpp | 9 --------- 1 files changed, 9 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.327 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.328 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.327 Mon Aug 14 17:19:25 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 14 17:24:39 2006 @@ -2901,12 +2901,3 @@ std::cerr << "\n\n"; } -/// InsertISelMapEntry - A helper function to insert a key / element pair -/// into a SDOperand to SDOperand map. This is added to avoid the map -/// insertion operator from being inlined. -void SelectionDAG::InsertISelMapEntry(std::map &Map, - SDNode *Key, unsigned KeyResNo, - SDNode *Element, unsigned ElementResNo) { - Map.insert(std::make_pair(SDOperand(Key, KeyResNo), - SDOperand(Element, ElementResNo))); -} From lattner at cs.uiuc.edu Mon Aug 14 17:24:56 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 17:24:56 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h Message-ID: <200608142224.k7EMOu1j014266@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.118 -> 1.119 --- Log message: remove SelectionDAG::InsertISelMapEntry, it is dead --- Diffs of the changes: (+0 -7) SelectionDAG.h | 7 ------- 1 files changed, 7 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.118 llvm/include/llvm/CodeGen/SelectionDAG.h:1.119 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.118 Mon Aug 14 17:19:25 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Mon Aug 14 17:24:39 2006 @@ -431,13 +431,6 @@ void dump() const; - /// InsertISelMapEntry - A helper function to insert a key / element pair - /// into a SDOperand to SDOperand map. This is added to avoid the map - /// insertion operator from being inlined. - static void InsertISelMapEntry(std::map &Map, - SDNode *Key, unsigned KeyResNo, - SDNode *Element, unsigned ElementResNo); - private: void RemoveNodeFromCSEMaps(SDNode *N); SDNode *AddNonLeafNodeToCSEMaps(SDNode *N); From reid at x10sys.com Mon Aug 14 17:35:30 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 17:35:30 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm2cpp/CppWriter.cpp Message-ID: <200608142235.k7EMZUOs019502@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm2cpp: CppWriter.cpp updated: 1.13 -> 1.14 --- Log message: Provide indentation of the generated program. --- Diffs of the changes: (+268 -182) CppWriter.cpp | 450 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 268 insertions(+), 182 deletions(-) Index: llvm/tools/llvm2cpp/CppWriter.cpp diff -u llvm/tools/llvm2cpp/CppWriter.cpp:1.13 llvm/tools/llvm2cpp/CppWriter.cpp:1.14 --- llvm/tools/llvm2cpp/CppWriter.cpp:1.13 Thu Jun 15 11:09:59 2006 +++ llvm/tools/llvm2cpp/CppWriter.cpp Mon Aug 14 17:35:15 2006 @@ -139,6 +139,19 @@ }; +static unsigned indent_level = 0; +inline std::ostream& nl(std::ostream& Out, int delta = 0) { + Out << "\n"; + if (delta >= 0 || indent_level >= unsigned(-delta)) + indent_level += delta; + for (unsigned i = 0; i < indent_level; ++i) + Out << " "; + return Out; +} + +inline void in() { indent_level++; } +inline void out() { if (indent_level >0) indent_level--; } + inline void sanitize(std::string& str) { for (size_t i = 0; i < str.length(); ++i) @@ -420,7 +433,8 @@ if (TI != TypeStack.end()) { TypeMap::const_iterator I = UnresolvedTypes.find(Ty); if (I == UnresolvedTypes.end()) { - Out << "PATypeHolder " << typeName << "_fwd = OpaqueType::get();\n"; + Out << "PATypeHolder " << typeName << "_fwd = OpaqueType::get();"; + nl(Out); UnresolvedTypes[Ty] = typeName; } return true; @@ -435,7 +449,8 @@ switch (Ty->getTypeID()) { case Type::FunctionTyID: { const FunctionType* FT = cast(Ty); - Out << "std::vector" << typeName << "_args;\n"; + Out << "std::vector" << typeName << "_args;"; + nl(Out); FunctionType::param_iterator PI = FT->param_begin(); FunctionType::param_iterator PE = FT->param_end(); for (; PI != PE; ++PI) { @@ -445,21 +460,26 @@ Out << typeName << "_args.push_back(" << argName; if (isForward) Out << "_fwd"; - Out << ");\n"; + Out << ");"; + nl(Out); } bool isForward = printTypeInternal(FT->getReturnType()); std::string retTypeName(getCppName(FT->getReturnType())); - Out << "FunctionType* " << typeName << " = FunctionType::get(\n" - << " /*Result=*/" << retTypeName; + Out << "FunctionType* " << typeName << " = FunctionType::get("; + in(); nl(Out) << "/*Result=*/" << retTypeName; if (isForward) Out << "_fwd"; - Out << ",\n /*Params=*/" << typeName << "_args,\n /*isVarArg=*/" - << (FT->isVarArg() ? "true" : "false") << ");\n"; + Out << ","; + nl(Out) << "/*Params=*/" << typeName << "_args,"; + nl(Out) << "/*isVarArg=*/" << (FT->isVarArg() ? "true" : "false") << ");"; + out(); + nl(Out); break; } case Type::StructTyID: { const StructType* ST = cast(Ty); - Out << "std::vector" << typeName << "_fields;\n"; + Out << "std::vector" << typeName << "_fields;"; + nl(Out); StructType::element_iterator EI = ST->element_begin(); StructType::element_iterator EE = ST->element_end(); for (; EI != EE; ++EI) { @@ -469,10 +489,12 @@ Out << typeName << "_fields.push_back(" << fieldName; if (isForward) Out << "_fwd"; - Out << ");\n"; + Out << ");"; + nl(Out); } Out << "StructType* " << typeName << " = StructType::get(" - << typeName << "_fields);\n"; + << typeName << "_fields);"; + nl(Out); break; } case Type::ArrayTyID: { @@ -482,7 +504,8 @@ std::string elemName(getCppName(ET)); Out << "ArrayType* " << typeName << " = ArrayType::get(" << elemName << (isForward ? "_fwd" : "") - << ", " << utostr(AT->getNumElements()) << ");\n"; + << ", " << utostr(AT->getNumElements()) << ");"; + nl(Out); break; } case Type::PointerTyID: { @@ -491,7 +514,8 @@ bool isForward = printTypeInternal(ET); std::string elemName(getCppName(ET)); Out << "PointerType* " << typeName << " = PointerType::get(" - << elemName << (isForward ? "_fwd" : "") << ");\n"; + << elemName << (isForward ? "_fwd" : "") << ");"; + nl(Out); break; } case Type::PackedTyID: { @@ -501,12 +525,14 @@ std::string elemName(getCppName(ET)); Out << "PackedType* " << typeName << " = PackedType::get(" << elemName << (isForward ? "_fwd" : "") - << ", " << utostr(PT->getNumElements()) << ");\n"; + << ", " << utostr(PT->getNumElements()) << ");"; + nl(Out); break; } case Type::OpaqueTyID: { const OpaqueType* OT = cast(Ty); - Out << "OpaqueType* " << typeName << " = OpaqueType::get();\n"; + Out << "OpaqueType* " << typeName << " = OpaqueType::get();"; + nl(Out); break; } default: @@ -518,7 +544,8 @@ findTypeName(TheModule->getSymbolTable(),Ty); if (progTypeName) Out << "mod->addTypeName(\"" << *progTypeName << "\", " - << typeName << ");\n"; + << typeName << ");"; + nl(Out); // Pop us off the type stack TypeStack.pop_back(); @@ -533,7 +560,8 @@ TypeMap::iterator I = UnresolvedTypes.find(Ty); if (I != UnresolvedTypes.end()) { Out << "cast(" << I->second - << "_fwd.get())->refineAbstractTypeTo(" << I->second << ");\n"; + << "_fwd.get())->refineAbstractTypeTo(" << I->second << ");"; + nl(Out); Out << I->second << " = cast<"; switch (Ty->getTypeID()) { case Type::FunctionTyID: Out << "FunctionType"; break; @@ -544,12 +572,13 @@ case Type::OpaqueTyID: Out << "OpaqueType"; break; default: Out << "NoSuchDerivedType"; break; } - Out << ">(" << I->second << "_fwd.get());\n\n"; + Out << ">(" << I->second << "_fwd.get());"; + nl(Out); nl(Out); UnresolvedTypes.erase(I); } // Finally, separate the type definition from other with a newline. - Out << "\n"; + nl(Out); // We weren't a recursive type return false; @@ -578,7 +607,8 @@ if (TI->second->isPrimitiveType() || TNI != TypeNames.end()) { Out << "mod->addTypeName(\""; printEscapedString(TI->first); - Out << "\", " << getCppName(TI->second) << ");\n"; + Out << "\", " << getCppName(TI->second) << ");"; + nl(Out); // For everything else, define the type } else { printType(TI->second); @@ -627,13 +657,12 @@ if (isa(CV) || ValueNames.find(CV) != ValueNames.end()) return; - const int IndentSize = 2; - static std::string Indent = "\n"; std::string constName(getCppName(CV)); std::string typeName(getCppName(CV->getType())); if (CV->isNullValue()) { Out << "Constant* " << constName << " = Constant::getNullValue(" - << typeName << ");\n"; + << typeName << ");"; + nl(Out); return; } if (isa(CV)) { @@ -671,33 +700,39 @@ Out << "\", true"; // Indicate that the null terminator should be added. Out << ");"; } else { - Out << "std::vector " << constName << "_elems;\n"; + Out << "std::vector " << constName << "_elems;"; + nl(Out); unsigned N = CA->getNumOperands(); for (unsigned i = 0; i < N; ++i) { printConstant(CA->getOperand(i)); // recurse to print operands Out << constName << "_elems.push_back(" - << getCppName(CA->getOperand(i)) << ");\n"; + << getCppName(CA->getOperand(i)) << ");"; + nl(Out); } Out << "Constant* " << constName << " = ConstantArray::get(" << typeName << ", " << constName << "_elems);"; } } else if (const ConstantStruct *CS = dyn_cast(CV)) { - Out << "std::vector " << constName << "_fields;\n"; + Out << "std::vector " << constName << "_fields;"; + nl(Out); unsigned N = CS->getNumOperands(); for (unsigned i = 0; i < N; i++) { printConstant(CS->getOperand(i)); Out << constName << "_fields.push_back(" - << getCppName(CS->getOperand(i)) << ");\n"; + << getCppName(CS->getOperand(i)) << ");"; + nl(Out); } Out << "Constant* " << constName << " = ConstantStruct::get(" << typeName << ", " << constName << "_fields);"; } else if (const ConstantPacked *CP = dyn_cast(CV)) { - Out << "std::vector " << constName << "_elems;\n"; + Out << "std::vector " << constName << "_elems;"; + nl(Out); unsigned N = CP->getNumOperands(); for (unsigned i = 0; i < N; ++i) { printConstant(CP->getOperand(i)); Out << constName << "_elems.push_back(" - << getCppName(CP->getOperand(i)) << ");\n"; + << getCppName(CP->getOperand(i)) << ");"; + nl(Out); } Out << "Constant* " << constName << " = ConstantPacked::get(" << typeName << ", " << constName << "_elems);"; @@ -706,12 +741,14 @@ << typeName << ");"; } else if (const ConstantExpr *CE = dyn_cast(CV)) { if (CE->getOpcode() == Instruction::GetElementPtr) { - Out << "std::vector " << constName << "_indices;\n"; + Out << "std::vector " << constName << "_indices;"; + nl(Out); printConstant(CE->getOperand(0)); for (unsigned i = 1; i < CE->getNumOperands(); ++i ) { printConstant(CE->getOperand(i)); Out << constName << "_indices.push_back(" - << getCppName(CE->getOperand(i)) << ");\n"; + << getCppName(CE->getOperand(i)) << ");"; + nl(Out); } Out << "Constant* " << constName << " = ConstantExpr::getGetElementPtr(" @@ -762,7 +799,7 @@ error("Bad Constant"); Out << "Constant* " << constName << " = 0; "; } - Out << "\n"; + nl(Out); } void @@ -792,63 +829,72 @@ } void CppWriter::printVariableUses(const GlobalVariable *GV) { - Out << "\n// Type Definitions\n"; + nl(Out) << "// Type Definitions"; + nl(Out); printType(GV->getType()); if (GV->hasInitializer()) { Constant* Init = GV->getInitializer(); printType(Init->getType()); if (Function* F = dyn_cast(Init)) { - Out << "\n// Function Declarations\n"; + nl(Out)<< "/ Function Declarations"; nl(Out); printFunctionHead(F); } else if (GlobalVariable* gv = dyn_cast(Init)) { - Out << "\n// Global Variable Declarations\n"; + nl(Out) << "// Global Variable Declarations"; nl(Out); printVariableHead(gv); } else { - Out << "\n// Constant Definitions\n"; + nl(Out) << "// Constant Definitions"; nl(Out); printConstant(gv); } if (GlobalVariable* gv = dyn_cast(Init)) { - Out << "\n// Global Variable Definitions\n"; + nl(Out) << "// Global Variable Definitions"; nl(Out); printVariableBody(gv); } } } void CppWriter::printVariableHead(const GlobalVariable *GV) { - Out << "\nGlobalVariable* " << getCppName(GV); + nl(Out) << "GlobalVariable* " << getCppName(GV); if (is_inline) { Out << " = mod->getGlobalVariable("; printEscapedString(GV->getName()); - Out << ", " << getCppName(GV->getType()->getElementType()) << ",true)\n"; - Out << "if (!" << getCppName(GV) << ") {\n " << getCppName(GV); + Out << ", " << getCppName(GV->getType()->getElementType()) << ",true)"; + nl(Out) << "if (!" << getCppName(GV) << ") {"; + in(); nl(Out) << getCppName(GV); } - Out << " = new GlobalVariable(\n"; - Out << " /*Type=*/"; + Out << " = new GlobalVariable("; + nl(Out) << "/*Type=*/"; printCppName(GV->getType()->getElementType()); - Out << ",\n"; - Out << " /*isConstant=*/" << (GV->isConstant()?"true":"false") - << ",\n /*Linkage=*/"; + Out << ","; + nl(Out) << "/*isConstant=*/" << (GV->isConstant()?"true":"false"); + Out << ","; + nl(Out) << "/*Linkage=*/"; printLinkageType(GV->getLinkage()); - Out << ",\n /*Initializer=*/0, "; + Out << ","; + nl(Out) << "/*Initializer=*/0, "; if (GV->hasInitializer()) { Out << "// has initializer, specified below"; } - Out << "\n /*Name=*/\""; + nl(Out) << "/*Name=*/\""; printEscapedString(GV->getName()); - Out << "\",\n mod);\n"; + Out << "\","; + nl(Out) << "mod);"; + nl(Out); if (GV->hasSection()) { printCppName(GV); Out << "->setSection(\""; printEscapedString(GV->getSection()); - Out << "\");\n"; + Out << "\");"; + nl(Out); } if (GV->getAlignment()) { printCppName(GV); - Out << "->setAlignment(" << utostr(GV->getAlignment()) << ");\n"; + Out << "->setAlignment(" << utostr(GV->getAlignment()) << ");"; + nl(Out); }; - if (is_inline) - Out << "}\n"; + if (is_inline) { + out(); Out << "}"; nl(Out); + } } void @@ -858,7 +904,8 @@ Out << "->setInitializer("; //if (!isagetInitializer())) //else - Out << getCppName(GV->getInitializer()) << ");\n"; + Out << getCppName(GV->getInitializer()) << ");"; + nl(Out); } } @@ -879,8 +926,9 @@ // Yes, this is a hack. An Argument is the smallest instantiable value that // we can make as a placeholder for the real value. We'll replace these // Argument instances later. - Out << " Argument* " << result << " = new Argument(" - << getCppName(V->getType()) << ");\n"; + Out << "Argument* " << result << " = new Argument(" + << getCppName(V->getType()) << ");"; + nl(Out); ForwardRefs[V] = result; return result; } @@ -900,13 +948,13 @@ switch (I->getOpcode()) { case Instruction::Ret: { const ReturnInst* ret = cast(I); - Out << " ReturnInst* " << iName << " = new ReturnInst(" + Out << "ReturnInst* " << iName << " = new ReturnInst(" << (ret->getReturnValue() ? opNames[0] + ", " : "") << bbname << ");"; break; } case Instruction::Br: { const BranchInst* br = cast(I); - Out << " BranchInst* " << iName << " = new BranchInst(" ; + Out << "BranchInst* " << iName << " = new BranchInst(" ; if (br->getNumOperands() == 3 ) { Out << opNames[0] << ", " << opNames[1] << ", " @@ -922,42 +970,47 @@ } case Instruction::Switch: { const SwitchInst* sw = cast(I); - Out << " SwitchInst* " << iName << " = new SwitchInst(" + Out << "SwitchInst* " << iName << " = new SwitchInst(" << opNames[0] << ", " << opNames[1] << ", " - << sw->getNumCases() << ", " << bbname << ");\n"; + << sw->getNumCases() << ", " << bbname << ");"; + nl(Out); for (unsigned i = 2; i < sw->getNumOperands(); i += 2 ) { - Out << " " << iName << "->addCase(" + Out << iName << "->addCase(" << opNames[i] << ", " - << opNames[i+1] << ");\n"; + << opNames[i+1] << ");"; + nl(Out); } break; } case Instruction::Invoke: { const InvokeInst* inv = cast(I); - Out << " std::vector " << iName << "_params;\n"; - for (unsigned i = 3; i < inv->getNumOperands(); ++i) - Out << " " << iName << "_params.push_back(" - << opNames[i] << ");\n"; - Out << " InvokeInst* " << iName << " = new InvokeInst(" + Out << "std::vector " << iName << "_params;"; + nl(Out); + for (unsigned i = 3; i < inv->getNumOperands(); ++i) { + Out << iName << "_params.push_back(" + << opNames[i] << ");"; + nl(Out); + } + Out << "InvokeInst* " << iName << " = new InvokeInst(" << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", " << iName << "_params, \""; printEscapedString(inv->getName()); - Out << "\", " << bbname << ");\n"; - Out << iName << "->setCallingConv("; + Out << "\", " << bbname << ");"; + nl(Out) << iName << "->setCallingConv("; printCallingConv(inv->getCallingConv()); Out << ");"; break; } case Instruction::Unwind: { - Out << " UnwindInst* " << iName << " = new UnwindInst(" + Out << "UnwindInst* " << iName << " = new UnwindInst(" << bbname << ");"; break; } case Instruction::Unreachable:{ - Out << " UnreachableInst* " << iName << " = new UnreachableInst(" + Out << "UnreachableInst* " << iName << " = new UnreachableInst(" << bbname << ");"; break; } @@ -971,7 +1024,7 @@ case Instruction::Xor: case Instruction::Shl: case Instruction::Shr:{ - Out << " BinaryOperator* " << iName << " = BinaryOperator::create("; + Out << "BinaryOperator* " << iName << " = BinaryOperator::create("; switch (I->getOpcode()) { case Instruction::Add: Out << "Instruction::Add"; break; case Instruction::Sub: Out << "Instruction::Sub"; break; @@ -979,7 +1032,7 @@ case Instruction::Div: Out << "Instruction::Div"; break; case Instruction::Rem: Out << "Instruction::Rem"; break; case Instruction::And: Out << "Instruction::And"; break; - case Instruction::Or: Out << "Instruction::Or"; break; + case Instruction::Or: Out << "Instruction::Or"; break; case Instruction::Xor: Out << "Instruction::Xor"; break; case Instruction::Shl: Out << "Instruction::Shl"; break; case Instruction::Shr: Out << "Instruction::Shr"; break; @@ -996,7 +1049,7 @@ case Instruction::SetGE: case Instruction::SetLT: case Instruction::SetGT: { - Out << " SetCondInst* " << iName << " = new SetCondInst("; + Out << "SetCondInst* " << iName << " = new SetCondInst("; switch (I->getOpcode()) { case Instruction::SetEQ: Out << "Instruction::SetEQ"; break; case Instruction::SetNE: Out << "Instruction::SetNE"; break; @@ -1013,7 +1066,7 @@ } case Instruction::Malloc: { const MallocInst* mallocI = cast(I); - Out << " MallocInst* " << iName << " = new MallocInst(" + Out << "MallocInst* " << iName << " = new MallocInst(" << getCppName(mallocI->getAllocatedType()) << ", "; if (mallocI->isArrayAllocation()) Out << opNames[0] << ", " ; @@ -1021,18 +1074,18 @@ printEscapedString(mallocI->getName()); Out << "\", " << bbname << ");"; if (mallocI->getAlignment()) - Out << "\n " << iName << "->setAlignment(" + nl(Out) << iName << "->setAlignment(" << mallocI->getAlignment() << ");"; break; } case Instruction::Free: { - Out << " FreeInst* " << iName << " = new FreeInst(" + Out << "FreeInst* " << iName << " = new FreeInst(" << getCppName(I->getOperand(0)) << ", " << bbname << ");"; break; } case Instruction::Alloca: { const AllocaInst* allocaI = cast(I); - Out << " AllocaInst* " << iName << " = new AllocaInst(" + Out << "AllocaInst* " << iName << " = new AllocaInst(" << getCppName(allocaI->getAllocatedType()) << ", "; if (allocaI->isArrayAllocation()) Out << opNames[0] << ", "; @@ -1040,42 +1093,44 @@ printEscapedString(allocaI->getName()); Out << "\", " << bbname << ");"; if (allocaI->getAlignment()) - Out << "\n " << iName << "->setAlignment(" + nl(Out) << iName << "->setAlignment(" << allocaI->getAlignment() << ");"; break; } case Instruction::Load:{ const LoadInst* load = cast(I); - Out << " LoadInst* " << iName << " = new LoadInst(" + Out << "LoadInst* " << iName << " = new LoadInst(" << opNames[0] << ", \""; printEscapedString(load->getName()); Out << "\", " << (load->isVolatile() ? "true" : "false" ) - << ", " << bbname << ");\n"; + << ", " << bbname << ");"; break; } case Instruction::Store: { const StoreInst* store = cast(I); - Out << " StoreInst* " << iName << " = new StoreInst(" + Out << "StoreInst* " << iName << " = new StoreInst(" << opNames[0] << ", " << opNames[1] << ", " << (store->isVolatile() ? "true" : "false") - << ", " << bbname << ");\n"; + << ", " << bbname << ");"; break; } case Instruction::GetElementPtr: { const GetElementPtrInst* gep = cast(I); if (gep->getNumOperands() <= 2) { - Out << " GetElementPtrInst* " << iName << " = new GetElementPtrInst(" + Out << "GetElementPtrInst* " << iName << " = new GetElementPtrInst(" << opNames[0]; if (gep->getNumOperands() == 2) Out << ", " << opNames[1]; } else { - Out << " std::vector " << iName << "_indices;\n"; + Out << "std::vector " << iName << "_indices;"; + nl(Out); for (unsigned i = 1; i < gep->getNumOperands(); ++i ) { - Out << " " << iName << "_indices.push_back(" - << opNames[i] << ");\n"; + Out << iName << "_indices.push_back(" + << opNames[i] << ");"; + nl(Out); } - Out << " Instruction* " << iName << " = new GetElementPtrInst(" + Out << "Instruction* " << iName << " = new GetElementPtrInst(" << opNames[0] << ", " << iName << "_indices"; } Out << ", \""; @@ -1086,69 +1141,75 @@ case Instruction::PHI: { const PHINode* phi = cast(I); - Out << " PHINode* " << iName << " = new PHINode(" + Out << "PHINode* " << iName << " = new PHINode(" << getCppName(phi->getType()) << ", \""; printEscapedString(phi->getName()); - Out << "\", " << bbname << ");\n"; - Out << " " << iName << "->reserveOperandSpace(" + Out << "\", " << bbname << ");"; + nl(Out) << iName << "->reserveOperandSpace(" << phi->getNumIncomingValues() - << ");\n"; + << ");"; + nl(Out); for (unsigned i = 0; i < phi->getNumOperands(); i+=2) { - Out << " " << iName << "->addIncoming(" - << opNames[i] << ", " << opNames[i+1] << ");\n"; + Out << iName << "->addIncoming(" + << opNames[i] << ", " << opNames[i+1] << ");"; + nl(Out); } break; } case Instruction::Cast: { const CastInst* cst = cast(I); - Out << " CastInst* " << iName << " = new CastInst(" + Out << "CastInst* " << iName << " = new CastInst(" << opNames[0] << ", " << getCppName(cst->getType()) << ", \""; printEscapedString(cst->getName()); - Out << "\", " << bbname << ");\n"; + Out << "\", " << bbname << ");"; break; } case Instruction::Call:{ const CallInst* call = cast(I); if (InlineAsm* ila = dyn_cast(call->getOperand(0))) { - Out << " InlineAsm* " << getCppName(ila) << " = InlineAsm::get(" + Out << "InlineAsm* " << getCppName(ila) << " = InlineAsm::get(" << getCppName(ila->getFunctionType()) << ", \"" << ila->getAsmString() << "\", \"" << ila->getConstraintString() << "\"," - << (ila->hasSideEffects() ? "true" : "false") << ");\n"; + << (ila->hasSideEffects() ? "true" : "false") << ");"; + nl(Out); } if (call->getNumOperands() > 3) { - Out << " std::vector " << iName << "_params;\n"; - for (unsigned i = 1; i < call->getNumOperands(); ++i) - Out << " " << iName << "_params.push_back(" << opNames[i] << ");\n"; - Out << " CallInst* " << iName << " = new CallInst(" + Out << "std::vector " << iName << "_params;"; + nl(Out); + for (unsigned i = 1; i < call->getNumOperands(); ++i) { + Out << iName << "_params.push_back(" << opNames[i] << ");"; + nl(Out); + } + Out << "CallInst* " << iName << " = new CallInst(" << opNames[0] << ", " << iName << "_params, \""; } else if (call->getNumOperands() == 3) { - Out << " CallInst* " << iName << " = new CallInst(" + Out << "CallInst* " << iName << " = new CallInst(" << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \""; } else if (call->getNumOperands() == 2) { - Out << " CallInst* " << iName << " = new CallInst(" + Out << "CallInst* " << iName << " = new CallInst(" << opNames[0] << ", " << opNames[1] << ", \""; } else { - Out << " CallInst* " << iName << " = new CallInst(" << opNames[0] + Out << "CallInst* " << iName << " = new CallInst(" << opNames[0] << ", \""; } printEscapedString(call->getName()); - Out << "\", " << bbname << ");\n"; - Out << " " << iName << "->setCallingConv("; + Out << "\", " << bbname << ");"; + nl(Out) << iName << "->setCallingConv("; printCallingConv(call->getCallingConv()); - Out << ");\n"; - Out << " " << iName << "->setTailCall(" + Out << ");"; + nl(Out) << iName << "->setTailCall(" << (call->isTailCall() ? "true":"false"); Out << ");"; break; } case Instruction::Select: { const SelectInst* sel = cast(I); - Out << " SelectInst* " << getCppName(sel) << " = new SelectInst("; + Out << "SelectInst* " << getCppName(sel) << " = new SelectInst("; Out << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \""; printEscapedString(sel->getName()); - Out << "\", " << bbname << ");\n"; + Out << "\", " << bbname << ");"; break; } case Instruction::UserOp1: @@ -1159,49 +1220,49 @@ } case Instruction::VAArg: { const VAArgInst* va = cast(I); - Out << " VAArgInst* " << getCppName(va) << " = new VAArgInst(" + Out << "VAArgInst* " << getCppName(va) << " = new VAArgInst(" << opNames[0] << ", " << getCppName(va->getType()) << ", \""; printEscapedString(va->getName()); - Out << "\", " << bbname << ");\n"; + Out << "\", " << bbname << ");"; break; } case Instruction::ExtractElement: { const ExtractElementInst* eei = cast(I); - Out << " ExtractElementInst* " << getCppName(eei) + Out << "ExtractElementInst* " << getCppName(eei) << " = new ExtractElementInst(" << opNames[0] << ", " << opNames[1] << ", \""; printEscapedString(eei->getName()); - Out << "\", " << bbname << ");\n"; + Out << "\", " << bbname << ");"; break; } case Instruction::InsertElement: { const InsertElementInst* iei = cast(I); - Out << " InsertElementInst* " << getCppName(iei) + Out << "InsertElementInst* " << getCppName(iei) << " = new InsertElementInst(" << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \""; printEscapedString(iei->getName()); - Out << "\", " << bbname << ");\n"; + Out << "\", " << bbname << ");"; break; } case Instruction::ShuffleVector: { const ShuffleVectorInst* svi = cast(I); - Out << " ShuffleVectorInst* " << getCppName(svi) + Out << "ShuffleVectorInst* " << getCppName(svi) << " = new ShuffleVectorInst(" << opNames[0] << ", " << opNames[1] << ", " << opNames[2] << ", \""; printEscapedString(svi->getName()); - Out << "\", " << bbname << ");\n"; + Out << "\", " << bbname << ");"; break; } } DefinedValues.insert(I); - Out << "\n"; + nl(Out); delete [] opNames; } // Print out the types, constants and declarations needed by one function void CppWriter::printFunctionUses(const Function* F) { - Out << "\n// Type Definitions\n"; + nl(Out) << "// Type Definitions"; nl(Out); if (!is_inline) { // Print the function's return type printType(F->getReturnType()); @@ -1239,7 +1300,7 @@ } // Print the function declarations for any functions encountered - Out << "\n// Function Declarations\n"; + nl(Out) << "// Function Declarations"; nl(Out); for (std::vector::iterator I = gvs.begin(), E = gvs.end(); I != E; ++I) { if (Function* Fun = dyn_cast(*I)) { @@ -1249,7 +1310,7 @@ } // Print the global variable declarations for any variables encountered - Out << "\n// Global Variable Declarations\n"; + nl(Out) << "// Global Variable Declarations"; nl(Out); for (std::vector::iterator I = gvs.begin(), E = gvs.end(); I != E; ++I) { if (GlobalVariable* F = dyn_cast(*I)) @@ -1257,7 +1318,7 @@ } // Print the constants found - Out << "\n// Constant Definitions\n"; + nl(Out) << "// Constant Definitions"; nl(Out); for (std::vector::iterator I = consts.begin(), E = consts.end(); I != E; ++I) { printConstant(*I); @@ -1266,7 +1327,7 @@ // Process the global variables definitions now that all the constants have // been emitted. These definitions just couple the gvars with their constant // initializers. - Out << "\n// Global Variable Definitions\n"; + nl(Out) << "// Global Variable Definitions"; nl(Out); for (std::vector::iterator I = gvs.begin(), E = gvs.end(); I != E; ++I) { if (GlobalVariable* GV = dyn_cast(*I)) @@ -1275,36 +1336,41 @@ } void CppWriter::printFunctionHead(const Function* F) { - Out << "\nFunction* " << getCppName(F); + nl(Out) << "Function* " << getCppName(F); if (is_inline) { Out << " = mod->getFunction(\""; printEscapedString(F->getName()); - Out << "\", " << getCppName(F->getFunctionType()) << ");\n"; - Out << "if (!" << getCppName(F) << ") {\n"; - Out << getCppName(F); - } - Out<< " = new Function(\n" - << " /*Type=*/" << getCppName(F->getFunctionType()) << ",\n" - << " /*Linkage=*/"; + Out << "\", " << getCppName(F->getFunctionType()) << ");"; + nl(Out) << "if (!" << getCppName(F) << ") {"; + nl(Out) << getCppName(F); + } + Out<< " = new Function("; + nl(Out,1) << "/*Type=*/" << getCppName(F->getFunctionType()) << ","; + nl(Out) << "/*Linkage=*/"; printLinkageType(F->getLinkage()); - Out << ",\n /*Name=*/\""; + Out << ","; + nl(Out) << "/*Name=*/\""; printEscapedString(F->getName()); - Out << "\", mod); " - << (F->isExternal()? "// (external, no body)" : "") << "\n"; + Out << "\", mod); " << (F->isExternal()? "// (external, no body)" : ""); + nl(Out,-1); printCppName(F); Out << "->setCallingConv("; printCallingConv(F->getCallingConv()); - Out << ");\n"; + Out << ");"; + nl(Out); if (F->hasSection()) { printCppName(F); - Out << "->setSection(\"" << F->getSection() << "\");\n"; + Out << "->setSection(\"" << F->getSection() << "\");"; + nl(Out); } if (F->getAlignment()) { printCppName(F); - Out << "->setAlignment(" << F->getAlignment() << ");\n"; + Out << "->setAlignment(" << F->getAlignment() << ");"; + nl(Out); } if (is_inline) { - Out << "}\n"; + Out << "}"; + nl(Out); } } @@ -1320,34 +1386,39 @@ // Create all the argument values if (!is_inline) { if (!F->arg_empty()) { - Out << " Function::arg_iterator args = " << getCppName(F) - << "->arg_begin();\n"; + Out << "Function::arg_iterator args = " << getCppName(F) + << "->arg_begin();"; + nl(Out); } for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); AI != AE; ++AI) { - Out << " Value* " << getCppName(AI) << " = args++;\n"; - if (AI->hasName()) - Out << " " << getCppName(AI) << "->setName(\"" << AI->getName() - << "\");\n"; + Out << "Value* " << getCppName(AI) << " = args++;"; + nl(Out); + if (AI->hasName()) { + Out << getCppName(AI) << "->setName(\"" << AI->getName() << "\");"; + nl(Out); + } } } // Create all the basic blocks - Out << "\n"; + nl(Out); for (Function::const_iterator BI = F->begin(), BE = F->end(); BI != BE; ++BI) { std::string bbname(getCppName(BI)); - Out << " BasicBlock* " << bbname << " = new BasicBlock(\""; + Out << "BasicBlock* " << bbname << " = new BasicBlock(\""; if (BI->hasName()) printEscapedString(BI->getName()); - Out << "\"," << getCppName(BI->getParent()) << ",0);\n"; + Out << "\"," << getCppName(BI->getParent()) << ",0);"; + nl(Out); } // Output all of its basic blocks... for the function for (Function::const_iterator BI = F->begin(), BE = F->end(); BI != BE; ++BI) { std::string bbname(getCppName(BI)); - Out << "\n // Block " << BI->getName() << " (" << bbname << ")\n"; + nl(Out) << "// Block " << BI->getName() << " (" << bbname << ")"; + nl(Out); // Output all of the instructions in the basic block... for (BasicBlock::const_iterator I = BI->begin(), E = BI->end(); @@ -1358,12 +1429,16 @@ // Loop over the ForwardRefs and resolve them now that all instructions // are generated. - if (!ForwardRefs.empty()) - Out << "\n // Resolve Forward References\n"; + if (!ForwardRefs.empty()) { + nl(Out) << "// Resolve Forward References"; + nl(Out); + } + while (!ForwardRefs.empty()) { ForwardRefMap::iterator I = ForwardRefs.begin(); - Out << " " << I->second << "->replaceAllUsesWith(" - << getCppName(I->first) << "); delete " << I->second << ";\n"; + Out << I->second << "->replaceAllUsesWith(" + << getCppName(I->first) << "); delete " << I->second << ";"; + nl(Out); ForwardRefs.erase(I); } } @@ -1378,37 +1453,39 @@ error(std::string("Function '") + func + "' is external!"); return; } - Out << "\nBasicBlock* " << fname << "(Module* mod, Function *" + nl(Out) << "BasicBlock* " << fname << "(Module* mod, Function *" << getCppName(F); unsigned arg_count = 1; for (Function::const_arg_iterator AI = F->arg_begin(), AE = F->arg_end(); AI != AE; ++AI) { Out << ", Value* arg_" << arg_count; } - Out << ") {\n"; + Out << ") {"; + nl(Out); is_inline = true; printFunctionUses(F); printFunctionBody(F); is_inline = false; - Out << "return " << getCppName(F->begin()) << ";\n"; - Out << "}\n"; + Out << "return " << getCppName(F->begin()) << ";"; + nl(Out) << "}"; + nl(Out); } void CppWriter::printModuleBody() { // Print out all the type definitions - Out << "\n// Type Definitions\n"; + nl(Out) << "// Type Definitions"; nl(Out); printTypes(TheModule); // Functions can call each other and global variables can reference them so // define all the functions first before emitting their function bodies. - Out << "\n// Function Declarations\n"; + nl(Out) << "// Function Declarations"; nl(Out); for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); I != E; ++I) printFunctionHead(I); // Process the global variables declarations. We can't initialze them until // after the constants are printed so just print a header for each global - Out << "\n// Global Variable Declarations\n"; + nl(Out) << "// Global Variable Declarations\n"; nl(Out); for (Module::const_global_iterator I = TheModule->global_begin(), E = TheModule->global_end(); I != E; ++I) { printVariableHead(I); @@ -1417,27 +1494,30 @@ // Print out all the constants definitions. Constants don't recurse except // through GlobalValues. All GlobalValues have been declared at this point // so we can proceed to generate the constants. - Out << "\n// Constant Definitions\n"; + nl(Out) << "// Constant Definitions"; nl(Out); printConstants(TheModule); // Process the global variables definitions now that all the constants have // been emitted. These definitions just couple the gvars with their constant // initializers. - Out << "\n// Global Variable Definitions\n"; + nl(Out) << "// Global Variable Definitions"; nl(Out); for (Module::const_global_iterator I = TheModule->global_begin(), E = TheModule->global_end(); I != E; ++I) { printVariableBody(I); } // Finally, we can safely put out all of the function bodies. - Out << "\n// Function Definitions\n"; + nl(Out) << "// Function Definitions"; nl(Out); for (Module::const_iterator I = TheModule->begin(), E = TheModule->end(); I != E; ++I) { if (!I->isExternal()) { - Out << "\n// Function: " << I->getName() << " (" << getCppName(I) - << ")\n{\n"; + nl(Out) << "// Function: " << I->getName() << " (" << getCppName(I) + << ")"; + nl(Out) << "{"; + nl(Out,1); printFunctionBody(I); - Out << "}\n"; + nl(Out,-1) << "}"; + nl(Out); } } } @@ -1481,41 +1561,47 @@ const std::string& fname, const std::string& mName ) { - Out << "\nModule* " << fname << "() {\n"; - Out << "\n// Module Construction\n"; - Out << "\nModule* mod = new Module(\"" << mName << "\");\n"; - Out << "mod->setEndianness("; + nl(Out) << "Module* " << fname << "() {"; + nl(Out,1) << "// Module Construction"; + nl(Out) << "Module* mod = new Module(\"" << mName << "\");"; + nl(Out) << "mod->setEndianness("; switch (TheModule->getEndianness()) { - case Module::LittleEndian: Out << "Module::LittleEndian);\n"; break; - case Module::BigEndian: Out << "Module::BigEndian);\n"; break; - case Module::AnyEndianness:Out << "Module::AnyEndianness);\n"; break; + case Module::LittleEndian: Out << "Module::LittleEndian);"; break; + case Module::BigEndian: Out << "Module::BigEndian);"; break; + case Module::AnyEndianness:Out << "Module::AnyEndianness);"; break; } - Out << "mod->setPointerSize("; + nl(Out) << "mod->setPointerSize("; switch (TheModule->getPointerSize()) { - case Module::Pointer32: Out << "Module::Pointer32);\n"; break; - case Module::Pointer64: Out << "Module::Pointer64);\n"; break; - case Module::AnyPointerSize: Out << "Module::AnyPointerSize);\n"; break; + case Module::Pointer32: Out << "Module::Pointer32);"; break; + case Module::Pointer64: Out << "Module::Pointer64);"; break; + case Module::AnyPointerSize: Out << "Module::AnyPointerSize);"; break; } - if (!TheModule->getTargetTriple().empty()) + nl(Out); + if (!TheModule->getTargetTriple().empty()) { Out << "mod->setTargetTriple(\"" << TheModule->getTargetTriple() - << "\");\n"; + << "\");"; + nl(Out); + } if (!TheModule->getModuleInlineAsm().empty()) { Out << "mod->setModuleInlineAsm(\""; printEscapedString(TheModule->getModuleInlineAsm()); - Out << "\");\n"; + Out << "\");"; + nl(Out); } // Loop over the dependent libraries and emit them. Module::lib_iterator LI = TheModule->lib_begin(); Module::lib_iterator LE = TheModule->lib_end(); while (LI != LE) { - Out << "mod->addLibrary(\"" << *LI << "\");\n"; + Out << "mod->addLibrary(\"" << *LI << "\");"; + nl(Out); ++LI; } printModuleBody(); - Out << "\nreturn mod;\n"; - Out << "}\n"; + nl(Out) << "return mod;"; + nl(Out,-1) << "}"; + nl(Out); } void CppWriter::printContents( From dpatel at apple.com Mon Aug 14 17:36:33 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 17:36:33 -0500 Subject: [llvm-commits] CVS: llvm/tools/lto/lto.cpp Message-ID: <200608142236.k7EMaXWj019868@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: lto.cpp updated: 1.3 -> 1.4 --- Log message: Use mangler, instead of addUnderscore(), to get mangled name. Now, LLVMSymbol keeps symbol original name and mangled name. --- Diffs of the changes: (+20 -14) lto.cpp | 34 ++++++++++++++++++++-------------- 1 files changed, 20 insertions(+), 14 deletions(-) Index: llvm/tools/lto/lto.cpp diff -u llvm/tools/lto/lto.cpp:1.3 llvm/tools/lto/lto.cpp:1.4 --- llvm/tools/lto/lto.cpp:1.3 Fri Aug 4 14:10:26 2006 +++ llvm/tools/lto/lto.cpp Mon Aug 14 17:36:16 2006 @@ -23,6 +23,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/SystemUtils.h" +#include "llvm/Support/Mangler.h" #include "llvm/System/Program.h" #include "llvm/System/Signals.h" #include "llvm/Analysis/Passes.h" @@ -84,17 +85,18 @@ // Find exeternal symbols referenced by VALUE. This is a recursive function. static void -findExternalRefs(Value *value, std::set &references) { +findExternalRefs(Value *value, std::set &references, + Mangler &mangler) { if (GlobalValue *gv = dyn_cast(value)) { LTOLinkageTypes lt = getLTOLinkageType(gv); if (lt != LTOInternalLinkage && strncmp (gv->getName().c_str(), "llvm.", 5)) - references.insert(addUnderscore(gv->getName().c_str())); + references.insert(mangler.getValueName(gv)); } else if (Constant *c = dyn_cast(value)) // Handle ConstantExpr, ConstantStruct, ConstantArry etc.. for (unsigned i = 0, e = c->getNumOperands(); i != e; ++i) - findExternalRefs(c->getOperand(i), references); + findExternalRefs(c->getOperand(i), references, mangler); } /// InputFilename is a LLVM bytecode file. Read it using bytecode reader. @@ -104,11 +106,15 @@ enum LTOStatus LinkTimeOptimizer::readLLVMObjectFile(const std::string &InputFilename, NameToSymbolMap &symbols, - std::set &references) + std::set &references) { Module *m = ParseBytecodeFile(InputFilename); if (!m) return LTO_READ_FAILURE; + + // Use mangler to add GlobalPrefix to names to match linker names. + // FIXME : Instead of hard coding "-" use GlobalPrefix. + Mangler mangler(*m, "_"); modules.push_back(m); @@ -118,19 +124,19 @@ if (!f->isExternal() && lt != LTOInternalLinkage && strncmp (f->getName().c_str(), "llvm.", 5)) { - const char *name = addUnderscore(f->getName().c_str()); - LLVMSymbol *newSymbol = new LLVMSymbol(lt, f); - symbols[name] = newSymbol; - allSymbols[name] = newSymbol; + LLVMSymbol *newSymbol = new LLVMSymbol(lt, f, f->getName(), + mangler.getValueName(f)); + symbols[newSymbol->getMangledName()] = newSymbol; + allSymbols[newSymbol->getMangledName()] = newSymbol; } - + // Collect external symbols referenced by this function. for (Function::iterator b = f->begin(), fe = f->end(); b != fe; ++b) for (BasicBlock::iterator i = b->begin(), be = b->end(); i != be; ++i) for (unsigned count = 0, total = i->getNumOperands(); count != total; ++count) - findExternalRefs(i->getOperand(count), references); + findExternalRefs(i->getOperand(count), references, mangler); } for (Module::global_iterator v = m->global_begin(), e = m->global_end(); @@ -138,13 +144,13 @@ LTOLinkageTypes lt = getLTOLinkageType(v); if (!v->isExternal() && lt != LTOInternalLinkage && strncmp (v->getName().c_str(), "llvm.", 5)) { - const char *name = addUnderscore(v->getName().c_str()); - LLVMSymbol *newSymbol = new LLVMSymbol(lt,v); - symbols[name] = newSymbol; + LLVMSymbol *newSymbol = new LLVMSymbol(lt, v, v->getName(), + mangler.getValueName(v)); + symbols[newSymbol->getMangledName()] = newSymbol; for (unsigned count = 0, total = v->getNumOperands(); count != total; ++count) - findExternalRefs(v->getOperand(count), references); + findExternalRefs(v->getOperand(count), references, mangler); } } From dpatel at apple.com Mon Aug 14 17:36:33 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 17:36:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/LinkTimeOptimizer.h Message-ID: <200608142236.k7EMaX6C019871@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: LinkTimeOptimizer.h updated: 1.2 -> 1.3 --- Log message: Use mangler, instead of addUnderscore(), to get mangled name. Now, LLVMSymbol keeps symbol original name and mangled name. --- Diffs of the changes: (+8 -2) LinkTimeOptimizer.h | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) Index: llvm/include/llvm/LinkTimeOptimizer.h diff -u llvm/include/llvm/LinkTimeOptimizer.h:1.2 llvm/include/llvm/LinkTimeOptimizer.h:1.3 --- llvm/include/llvm/LinkTimeOptimizer.h:1.2 Thu Aug 3 11:34:35 2006 +++ llvm/include/llvm/LinkTimeOptimizer.h Mon Aug 14 17:36:16 2006 @@ -55,11 +55,17 @@ LTOLinkageTypes getLinkage() const { return linkage; } void mayBeNotUsed(); - LLVMSymbol (enum LTOLinkageTypes lt, GlobalValue *g) : linkage(lt), gv(g) {} + LLVMSymbol (enum LTOLinkageTypes lt, GlobalValue *g, std::string n, + std::string m) : linkage(lt), gv(g), name(n), mangledName(m) {} + + const char *getName() { return name.c_str(); } + const char *getMangledName() { return mangledName.c_str(); } private: enum LTOLinkageTypes linkage; GlobalValue *gv; + std::string name; + std::string mangledName; }; class string_compare { @@ -79,7 +85,7 @@ enum LTOStatus readLLVMObjectFile(const std::string &InputFilename, NameToSymbolMap &symbols, - std::set &references); + std::set &references); enum LTOStatus optimizeModules(const std::string &OutputFilename, std::vector &exportList); From reid at x10sys.com Mon Aug 14 18:11:06 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 18:11:06 -0500 Subject: [llvm-commits] CVS: llvm-test/autoconf/AutoRegen.sh configure.ac Message-ID: <200608142311.k7ENB6bZ028086@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf: AutoRegen.sh updated: 1.4 -> 1.5 configure.ac updated: 1.32 -> 1.33 --- Log message: For PR875: http://llvm.org/PR875 : Make the SPEC2000 and SPEC95 checks look for a dir ending in "benchspec" --- Diffs of the changes: (+23 -4) AutoRegen.sh | 2 +- configure.ac | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) Index: llvm-test/autoconf/AutoRegen.sh diff -u llvm-test/autoconf/AutoRegen.sh:1.4 llvm-test/autoconf/AutoRegen.sh:1.5 --- llvm-test/autoconf/AutoRegen.sh:1.4 Wed Dec 29 13:12:55 2004 +++ llvm-test/autoconf/AutoRegen.sh Mon Aug 14 18:10:49 2006 @@ -5,7 +5,7 @@ } test -d autoconf && test -f autoconf/configure.ac && cd autoconf test -f configure.ac || die "Can't find 'autoconf' dir; please cd into it first" -autoconf --version | egrep '2\.5[0-9]' > /dev/null +autoconf --version | egrep '2\.[5-6][0-9]' > /dev/null if test $? -ne 0 ; then die "Your autoconf was not detected as being 2.5x" fi Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.32 llvm-test/autoconf/configure.ac:1.33 --- llvm-test/autoconf/configure.ac:1.32 Mon Apr 17 19:02:53 2006 +++ llvm-test/autoconf/configure.ac Mon Aug 14 18:10:49 2006 @@ -76,6 +76,26 @@ EXTERNAL_BENCHMARK(alp,${LLVM_EXTERNALS}/alp) EXTERNAL_BENCHMARK(nurbs,${LLVM_EXTERNALS}/nurbs) +dnl Check that the paths of provided external benchmark dirs make sense +if test -n "$SPEC2000_ROOT" ; then + if test -d "$SPEC2000_ROOT" ; then + if test `basename '${SPEC2000_ROOT%benchspec}'` != "benchspec"; then + AC_MSG_ERROR([SPEC 2000 directory must end in 'benchspec']) + fi + else + AC_MSG_ERROR([SPEC 2000 option must specify a directory]) + fi +fi +if test -n "$SPEC95_ROOT" ; then + if test -d "$SPEC95_ROOT" ; then + if test `basename '${SPEC95_ROOT%benchspec}'` != "benchspec"; then + AC_MSG_ERROR([SPEC 95 directory must end in 'benchspec']) + fi + else + AC_MSG_ERROR([SPEC 95 option must specify a directory]) + fi +fi + dnl LLC Diff Option AC_ARG_ENABLE(llc_diffs, AS_HELP_STRING(--enable-llc_diffs, @@ -101,9 +121,8 @@ dnl Check for GNU Make. We use its extensions too, so don't build without it AC_CHECK_GNU_MAKE -if test -z "$llvm_cv_gnu_make_command" -then - AC_MSG_ERROR([GNU Make required but not found]) +if test -z "$llvm_cv_gnu_make_command" ; then + AC_MSG_ERROR([GNU Make required but not found]) fi dnl Checks for other tools From reid at x10sys.com Mon Aug 14 18:11:06 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 18:11:06 -0500 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200608142311.k7ENB6xr028089@zion.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.33 -> 1.34 --- Log message: For PR875: http://llvm.org/PR875 : Make the SPEC2000 and SPEC95 checks look for a dir ending in "benchspec" --- Diffs of the changes: (+6800 -6073) configure |12873 ++++++++++++++++++++++++++++++++------------------------------ 1 files changed, 6800 insertions(+), 6073 deletions(-) Index: llvm-test/configure diff -u llvm-test/configure:1.33 llvm-test/configure:1.34 --- llvm-test/configure:1.33 Mon Apr 17 03:02:47 2006 +++ llvm-test/configure Mon Aug 14 18:10:48 2006 @@ -1,10 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for LLVM-TEST 1.7cvs. +# Generated by GNU Autoconf 2.60 for LLVM-TEST 1.7cvs. # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,11 +19,35 @@ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset @@ -31,8 +56,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -46,18 +106,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -65,157 +126,386 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf at gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -224,7 +514,19 @@ as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -233,15 +535,6 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - # Check that we are running under the correct shell. @@ -287,8 +580,8 @@ # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break @@ -397,29 +690,26 @@ tagnames=${tagnames+${tagnames},}F77 +exec 7<&0 &1 + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='LLVM-TEST' PACKAGE_TARNAME='-llvm-test-' @@ -456,17 +746,143 @@ #endif #if HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif +#endif +#if HAVE_STDINT_H +# include #endif #if HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ LLVM_EXTERNALS SPEC95_ROOT USE_SPEC95 SPEC2000_ROOT USE_SPEC2000 POVRAY_ROOT USE_POVRAY NAMD_ROOT USE_NAMD SWEEP3D_ROOT USE_SWEEP3D FPGROWTH_ROOT USE_FPGROWTH ALP_ROOT USE_ALP NURBS_ROOT USE_NURBS DISABLE_LLC_DIFFS CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL USE_F2C F2C F2C_BIN F2C_DIR F2C_INC F2C_LIB USE_F95 F95 F95_BIN F95_DIR F95_INC F95_LIB HAVE_RE_COMP LIBOBJ! S LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +LLVM_SRC +LLVM_OBJ +LLVM_EXTERNALS +SPEC95_ROOT +USE_SPEC95 +SPEC2000_ROOT +USE_SPEC2000 +POVRAY_ROOT +USE_POVRAY +NAMD_ROOT +USE_NAMD +SWEEP3D_ROOT +USE_SWEEP3D +FPGROWTH_ROOT +USE_FPGROWTH +ALP_ROOT +USE_ALP +NURBS_ROOT +USE_NURBS +DISABLE_LLC_DIFFS +CXX +CXXFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CXX +EXEEXT +OBJEXT +CC +CFLAGS +ac_ct_CC +CPP +ifGNUmake +LEX +LEXLIB +LEX_OUTPUT_ROOT +FLEX +YACC +YFLAGS +BISON +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +GREP +EGREP +LN_S +ECHO +AR +RANLIB +STRIP +CXXCPP +F77 +FFLAGS +ac_ct_F77 +LIBTOOL +USE_F2C +F2C +F2C_BIN +F2C_DIR +F2C_INC +F2C_LIB +USE_F95 +F95 +F95_BIN +F95_DIR +F95_INC +F95_LIB +HAVE_RE_COMP +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +CPPFLAGS +CCC +CC +CFLAGS +CPP +YACC +YFLAGS +CXXCPP +F77 +FFLAGS' + # Initialize some variables set by options. ac_init_help= @@ -493,34 +909,48 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -542,12 +972,18 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -555,7 +991,17 @@ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -564,11 +1010,7 @@ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -595,6 +1037,12 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -619,13 +1067,16 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -690,6 +1141,16 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -746,11 +1207,7 @@ { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -759,7 +1216,7 @@ { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -790,8 +1247,7 @@ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -811,27 +1267,19 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -858,94 +1306,76 @@ test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_CXXCPP_set=${CXXCPP+set} -ac_env_CXXCPP_value=$CXXCPP -ac_cv_env_CXXCPP_set=${CXXCPP+set} -ac_cv_env_CXXCPP_value=$CXXCPP -ac_env_F77_set=${F77+set} -ac_env_F77_value=$F77 -ac_cv_env_F77_set=${F77+set} -ac_cv_env_F77_value=$F77 -ac_env_FFLAGS_set=${FFLAGS+set} -ac_env_FFLAGS_value=$FFLAGS -ac_cv_env_FFLAGS_set=${FFLAGS+set} -ac_cv_env_FFLAGS_value=$FFLAGS + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -974,9 +1404,6 @@ -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -994,15 +1421,22 @@ --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/-llvm-test-] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1023,12 +1457,13 @@ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-llc_diffs Enable LLC Diffs when testing (default is YES) - --enable-shared[=PKGS] - build shared libraries [default=yes] - --enable-static[=PKGS] - build static libraries [default=yes] + --enable-shared[=PKGS] build shared libraries + [default=enable_shared_default] + --enable-static[=PKGS] build static libraries + [default=enable_static_default] --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] + optimize for fast installation + [default=enable_Fast_install_default] --disable-libtool-lock avoid locking (might break parallel builds) Optional Packages: @@ -1048,8 +1483,7 @@ --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] - --with-tags[=TAGS] - include additional configurations [automatic] + --with-tags[=TAGS] include additional configurations [automatic] --with-f2c=DIR Specify that the f2c install prefix is DIR --with-f2c-bin=DIR Specify that the f2c binary is in DIR --with-f2c-lib=DIR Specify that f2c libraries are in DIR @@ -1067,11 +1501,16 @@ CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor + YACC The `Yet Another C Compiler' implementation to use. Defaults to + the first program found out of: `bison -y', `byacc', `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags @@ -1081,120 +1520,86 @@ Report bugs to . _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF LLVM-TEST configure 1.7cvs -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.60 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by LLVM-TEST $as_me 1.7cvs, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1213,7 +1618,7 @@ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1227,6 +1632,7 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1248,7 +1654,6 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1259,7 +1664,7 @@ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1281,9 +1686,7 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1294,8 +1697,8 @@ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1308,20 +1711,34 @@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1332,22 +1749,28 @@ echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1359,26 +1782,24 @@ ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1409,14 +1830,17 @@ # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1432,8 +1856,8 @@ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1445,12 +1869,11 @@ # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1475,8 +1898,7 @@ # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1493,12 +1915,6 @@ { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1523,186 +1939,197 @@ +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= -for ac_dir in autoconf $srcdir/autoconf; do - if test -f $ac_dir/install-sh; then +for ac_dir in autoconf "$srcdir"/autoconf; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in autoconf \"$srcdir\"/autoconf" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + - ac_config_commands="$ac_config_commands setup" +ac_config_commands="$ac_config_commands setup" - ac_config_files="$ac_config_files Makefile.config" +ac_config_files="$ac_config_files Makefile.config" - ac_config_commands="$ac_config_commands Makefile" +ac_config_commands="$ac_config_commands Makefile" - ac_config_commands="$ac_config_commands Makefile.common" +ac_config_commands="$ac_config_commands Makefile.common" - ac_config_commands="$ac_config_commands Makefile.f2c" +ac_config_commands="$ac_config_commands Makefile.f2c" - ac_config_commands="$ac_config_commands Makefile.programs" +ac_config_commands="$ac_config_commands Makefile.programs" - ac_config_commands="$ac_config_commands Makefile.tests" +ac_config_commands="$ac_config_commands Makefile.tests" - ac_config_commands="$ac_config_commands TEST.aa.Makefile" +ac_config_commands="$ac_config_commands TEST.aa.Makefile" - ac_config_commands="$ac_config_commands TEST.dsgraph.report" +ac_config_commands="$ac_config_commands TEST.dsgraph.report" - ac_config_commands="$ac_config_commands TEST.aa.report" +ac_config_commands="$ac_config_commands TEST.aa.report" - ac_config_commands="$ac_config_commands TEST.example.Makefile" +ac_config_commands="$ac_config_commands TEST.example.Makefile" - ac_config_commands="$ac_config_commands TEST.nightly.Makefile" +ac_config_commands="$ac_config_commands TEST.nightly.Makefile" - ac_config_commands="$ac_config_commands TEST.buildrepo.Makefile" +ac_config_commands="$ac_config_commands TEST.buildrepo.Makefile" - ac_config_commands="$ac_config_commands TEST.jit.Makefile" +ac_config_commands="$ac_config_commands TEST.jit.Makefile" - ac_config_commands="$ac_config_commands TEST.nightly.report" +ac_config_commands="$ac_config_commands TEST.nightly.report" - ac_config_commands="$ac_config_commands TEST.dsgraph.Makefile" +ac_config_commands="$ac_config_commands TEST.dsgraph.Makefile" - ac_config_commands="$ac_config_commands TEST.jit.report" +ac_config_commands="$ac_config_commands TEST.jit.report" - ac_config_commands="$ac_config_commands TEST.typesafe.Makefile" +ac_config_commands="$ac_config_commands TEST.typesafe.Makefile" - ac_config_commands="$ac_config_commands TEST.dsgraph.gnuplot" +ac_config_commands="$ac_config_commands TEST.dsgraph.gnuplot" - ac_config_commands="$ac_config_commands TEST.vtl.Makefile" +ac_config_commands="$ac_config_commands TEST.vtl.Makefile" - ac_config_commands="$ac_config_commands External/Makefile" +ac_config_commands="$ac_config_commands External/Makefile" - ac_config_commands="$ac_config_commands External/Makefile.external" +ac_config_commands="$ac_config_commands External/Makefile.external" - ac_config_commands="$ac_config_commands External/Povray/Makefile" +ac_config_commands="$ac_config_commands External/Povray/Makefile" - ac_config_commands="$ac_config_commands External/SPEC/Makefile" +ac_config_commands="$ac_config_commands External/SPEC/Makefile" - ac_config_commands="$ac_config_commands External/SPEC/Makefile.spec" +ac_config_commands="$ac_config_commands External/SPEC/Makefile.spec" - ac_config_commands="$ac_config_commands External/SPEC/Makefile.spec2000" +ac_config_commands="$ac_config_commands External/SPEC/Makefile.spec2000" - ac_config_commands="$ac_config_commands External/SPEC/Makefile.spec95" +ac_config_commands="$ac_config_commands External/SPEC/Makefile.spec95" - ac_config_commands="$ac_config_commands External/SPEC/CFP2000/Makefile" +ac_config_commands="$ac_config_commands External/SPEC/CFP2000/Makefile" - ac_config_commands="$ac_config_commands External/SPEC/CINT2000/Makefile" +ac_config_commands="$ac_config_commands External/SPEC/CINT2000/Makefile" - ac_config_commands="$ac_config_commands External/SPEC/CFP95/Makefile" +ac_config_commands="$ac_config_commands External/SPEC/CFP95/Makefile" - ac_config_commands="$ac_config_commands External/SPEC/CINT95/Makefile" +ac_config_commands="$ac_config_commands External/SPEC/CINT95/Makefile" - ac_config_commands="$ac_config_commands MultiSource/Makefile" +ac_config_commands="$ac_config_commands MultiSource/Makefile" - ac_config_commands="$ac_config_commands MultiSource/Makefile.multisrc" +ac_config_commands="$ac_config_commands MultiSource/Makefile.multisrc" - ac_config_commands="$ac_config_commands SingleSource/Makefile" +ac_config_commands="$ac_config_commands SingleSource/Makefile" - ac_config_commands="$ac_config_commands SingleSource/Makefile.singlesrc" +ac_config_commands="$ac_config_commands SingleSource/Makefile.singlesrc" -# Check whether --with-llvmsrc or --without-llvmsrc was given. +# Check whether --with-llvmsrc was given. if test "${with_llvmsrc+set}" = set; then - withval="$with_llvmsrc" - LLVM_SRC=$withval + withval=$with_llvmsrc; LLVM_SRC=$withval else LLVM_SRC=`cd ${srcdir}/../..; pwd` -fi; +fi + -# Check whether --with-llvmobj or --without-llvmobj was given. +# Check whether --with-llvmobj was given. if test "${with_llvmobj+set}" = set; then - withval="$with_llvmobj" - LLVM_OBJ=$withval + withval=$with_llvmobj; LLVM_OBJ=$withval else LLVM_OBJ=`cd ../..; pwd` -fi; +fi + -# Check whether --with-externals or --without-externals was given. +# Check whether --with-externals was given. if test "${with_externals+set}" = set; then - withval="$with_externals" - LLVM_EXTERNALS=$withval + withval=$with_externals; LLVM_EXTERNALS=$withval else LLVM_EXTERNALS=/home/vadve/shared/benchmarks -fi; +fi + -# Check whether --with-spec95 or --without-spec95 was given. +# Check whether --with-spec95 was given. if test "${with_spec95+set}" = set; then - withval="$with_spec95" - checkresult=$withval + withval=$with_spec95; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for spec95 benchmark sources" >&5 -echo $ECHO_N "checking for spec95 benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for spec95 benchmark sources" >&5 +echo $ECHO_N "checking for spec95 benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/spec95/benchspec @@ -1736,21 +2163,21 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --with-spec2000 or --without-spec2000 was given. +# Check whether --with-spec2000 was given. if test "${with_spec2000+set}" = set; then - withval="$with_spec2000" - checkresult=$withval + withval=$with_spec2000; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for spec2000 benchmark sources" >&5 -echo $ECHO_N "checking for spec2000 benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for spec2000 benchmark sources" >&5 +echo $ECHO_N "checking for spec2000 benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/speccpu2000/benchspec @@ -1784,21 +2211,21 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --with-povray or --without-povray was given. +# Check whether --with-povray was given. if test "${with_povray+set}" = set; then - withval="$with_povray" - checkresult=$withval + withval=$with_povray; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for povray benchmark sources" >&5 -echo $ECHO_N "checking for povray benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for povray benchmark sources" >&5 +echo $ECHO_N "checking for povray benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/povray31 @@ -1832,21 +2259,21 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --with-namd or --without-namd was given. +# Check whether --with-namd was given. if test "${with_namd+set}" = set; then - withval="$with_namd" - checkresult=$withval + withval=$with_namd; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for namd benchmark sources" >&5 -echo $ECHO_N "checking for namd benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for namd benchmark sources" >&5 +echo $ECHO_N "checking for namd benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/spec_namd @@ -1880,21 +2307,21 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --with-sweep3d or --without-sweep3d was given. +# Check whether --with-sweep3d was given. if test "${with_sweep3d+set}" = set; then - withval="$with_sweep3d" - checkresult=$withval + withval=$with_sweep3d; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for sweep3d benchmark sources" >&5 -echo $ECHO_N "checking for sweep3d benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for sweep3d benchmark sources" >&5 +echo $ECHO_N "checking for sweep3d benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/sweep3d @@ -1928,21 +2355,21 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --with-fpgrowth or --without-fpgrowth was given. +# Check whether --with-fpgrowth was given. if test "${with_fpgrowth+set}" = set; then - withval="$with_fpgrowth" - checkresult=$withval + withval=$with_fpgrowth; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for fpgrowth benchmark sources" >&5 -echo $ECHO_N "checking for fpgrowth benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for fpgrowth benchmark sources" >&5 +echo $ECHO_N "checking for fpgrowth benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/fpgrowth @@ -1976,21 +2403,21 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --with-alp or --without-alp was given. +# Check whether --with-alp was given. if test "${with_alp+set}" = set; then - withval="$with_alp" - checkresult=$withval + withval=$with_alp; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for alp benchmark sources" >&5 -echo $ECHO_N "checking for alp benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for alp benchmark sources" >&5 +echo $ECHO_N "checking for alp benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/alp @@ -2024,20 +2451,21 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --with-nurbs or --without-nurbs was given. + +# Check whether --with-nurbs was given. if test "${with_nurbs+set}" = set; then - withval="$with_nurbs" - checkresult=$withval + withval=$with_nurbs; checkresult=$withval else checkresult=auto -fi; -echo "$as_me:$LINENO: checking for nurbs benchmark sources" >&5 -echo $ECHO_N "checking for nurbs benchmark sources... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking for nurbs benchmark sources" >&5 +echo $ECHO_N "checking for nurbs benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) defaultdir=${LLVM_EXTERNALS}/nurbs @@ -2071,18 +2499,45 @@ fi ;; esac -echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 +{ echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } -# Check whether --enable-llc_diffs or --disable-llc_diffs was given. -if test "${enable_llc_diffs+set}" = set; then - enableval="$enable_llc_diffs" +if test -n "$SPEC2000_ROOT" ; then + if test -d "$SPEC2000_ROOT" ; then + if test `basename '${SPEC2000_ROOT%benchspec}'` != "benchspec"; then + { { echo "$as_me:$LINENO: error: SPEC 2000 directory must end in 'benchspec'" >&5 +echo "$as_me: error: SPEC 2000 directory must end in 'benchspec'" >&2;} + { (exit 1); exit 1; }; } + fi + else + { { echo "$as_me:$LINENO: error: SPEC 2000 option must specify a directory" >&5 +echo "$as_me: error: SPEC 2000 option must specify a directory" >&2;} + { (exit 1); exit 1; }; } + fi +fi +if test -n "$SPEC95_ROOT" ; then + if test -d "$SPEC95_ROOT" ; then + if test `basename '${SPEC95_ROOT%benchspec}'` != "benchspec"; then + { { echo "$as_me:$LINENO: error: SPEC 95 directory must end in 'benchspec'" >&5 +echo "$as_me: error: SPEC 95 directory must end in 'benchspec'" >&2;} + { (exit 1); exit 1; }; } + fi + else + { { echo "$as_me:$LINENO: error: SPEC 95 option must specify a directory" >&5 +echo "$as_me: error: SPEC 95 option must specify a directory" >&2;} + { (exit 1); exit 1; }; } + fi +fi +# Check whether --enable-llc_diffs was given. +if test "${enable_llc_diffs+set}" = set; then + enableval=$enable_llc_diffs; else enableval=yes -fi; +fi + if test ${enableval} = "no" then DISABLE_LLC_DIFFS=DISABLE_LLC_DIFFS:=1 @@ -2093,18 +2548,22 @@ fi -ac_ext=cc +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2117,36 +2576,38 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2159,49 +2620,79 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CXX" && break done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi fi - + fi +fi # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2226,46 +2717,70 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 -echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 +echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2278,19 +2793,23 @@ fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 -echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 +echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2309,22 +2828,27 @@ fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2335,9 +2859,8 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2351,14 +2874,14 @@ fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2378,14 +2901,20 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2403,12 +2932,12 @@ rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2431,24 +2960,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2457,24 +2998,28 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2490,24 +3035,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2516,70 +3073,53 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cxx_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration -#include + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2588,61 +3128,91 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - break + ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2659,8 +3229,8 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2673,25 +3243,27 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi @@ -2701,8 +3273,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2715,29 +3287,45 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi @@ -2748,27 +3336,41 @@ { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2791,24 +3393,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2817,24 +3431,28 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2850,24 +3468,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2876,285 +3506,278 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; + +int +main () { - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; + + ; + return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration -#include + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -exit (42); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h +rm -f conftest.$ac_ext +CC=$ac_save_CC + fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3166,8 +3789,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3201,8 +3824,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3227,9 +3855,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3239,8 +3868,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3267,6 +3901,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3284,8 +3919,8 @@ else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3308,8 +3943,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3334,9 +3974,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3346,8 +3987,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3374,6 +4020,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3397,8 +4044,8 @@ -echo "$as_me:$LINENO: checking for GNU make" >&5 -echo $ECHO_N "checking for GNU make... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for GNU make" >&5 +echo $ECHO_N "checking for GNU make... $ECHO_C" >&6; } if test "${llvm_cv_gnu_make_command+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3412,27 +4059,26 @@ fi done fi -echo "$as_me:$LINENO: result: $llvm_cv_gnu_make_command" >&5 -echo "${ECHO_T}$llvm_cv_gnu_make_command" >&6 +{ echo "$as_me:$LINENO: result: $llvm_cv_gnu_make_command" >&5 +echo "${ECHO_T}$llvm_cv_gnu_make_command" >&6; } if test "x$llvm_cv_gnu_make_command" != "x" ; then ifGNUmake='' ; else ifGNUmake='#' ; - echo "$as_me:$LINENO: result: \"Not found\"" >&5 -echo "${ECHO_T}\"Not found\"" >&6; + { echo "$as_me:$LINENO: result: \"Not found\"" >&5 +echo "${ECHO_T}\"Not found\"" >&6; }; fi -if test -z "$llvm_cv_gnu_make_command" -then - { { echo "$as_me:$LINENO: error: GNU Make required but not found" >&5 +if test -z "$llvm_cv_gnu_make_command" ; then + { { echo "$as_me:$LINENO: error: GNU Make required but not found" >&5 echo "$as_me: error: GNU Make required but not found" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking " >&5 -echo $ECHO_N "checking ... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking " >&5 +echo $ECHO_N "checking ... $ECHO_C" >&6; } if test "${ac_cv_has_flex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3440,8 +4086,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_LEX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3454,33 +4100,35 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$as_me:$LINENO: result: $LEX" >&5 -echo "${ECHO_T}$LEX" >&6 + { echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test -z "$LEXLIB" then - echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6; } if test "${ac_cv_lib_fl_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3493,40 +4141,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char yywrap (); int main () { -yywrap (); +return yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3535,19 +4195,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_fl_yywrap=no + ac_cv_lib_fl_yywrap=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6; } if test $ac_cv_lib_fl_yywrap = yes; then LEXLIB="-lfl" else - echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6; } if test "${ac_cv_lib_l_yywrap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3560,40 +4221,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char yywrap (); int main () { -yywrap (); +return yywrap (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3602,14 +4275,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_l_yywrap=no + ac_cv_lib_l_yywrap=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6; } if test $ac_cv_lib_l_yywrap = yes; then LEXLIB="-ll" fi @@ -3619,8 +4293,8 @@ fi if test "x$LEX" != "x:"; then - echo "$as_me:$LINENO: checking lex output file root" >&5 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6; } if test "${ac_cv_prog_lex_root+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3630,8 +4304,13 @@ %% %% _ACEOF -{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 - (eval $LEX conftest.l) 2>&5 +{ (ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$LEX conftest.l") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -3645,13 +4324,13 @@ { (exit 1); exit 1; }; } fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6; } rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6; } if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3666,24 +4345,36 @@ `cat $LEX_OUTPUT_ROOT.c` _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3692,15 +4383,17 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then cat >>confdefs.h <<\_ACEOF @@ -3712,8 +4405,8 @@ fi fi -echo "$as_me:$LINENO: result: $ac_cv_has_flex" >&5 -echo "${ECHO_T}$ac_cv_has_flex" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_has_flex" >&5 +echo "${ECHO_T}$ac_cv_has_flex" >&6; } if test "$LEX" != "flex"; then { { echo "$as_me:$LINENO: error: flex not found but required" >&5 echo "$as_me: error: flex not found but required" >&2;} @@ -3723,8 +4416,8 @@ fi -echo "$as_me:$LINENO: checking " >&5 -echo $ECHO_N "checking ... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking " >&5 +echo $ECHO_N "checking ... $ECHO_C" >&6; } if test "${llvm_cv_has_bison+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3732,8 +4425,8 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3746,32 +4439,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6 + { echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" fi -echo "$as_me:$LINENO: result: $llvm_cv_has_bison" >&5 -echo "${ECHO_T}$llvm_cv_has_bison" >&6 +{ echo "$as_me:$LINENO: result: $llvm_cv_has_bison" >&5 +echo "${ECHO_T}$llvm_cv_has_bison" >&6; } if test "$YACC" != "bison -y"; then { { echo "$as_me:$LINENO: error: bison not found but required" >&5 echo "$as_me: error: bison not found but required" >&2;} @@ -3780,10 +4475,9 @@ BISON=bison fi -# Check whether --enable-shared or --disable-shared was given. +# Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then - enableval="$enable_shared" - p=${PACKAGE-default} + enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; @@ -3802,12 +4496,12 @@ esac else enable_shared=yes -fi; +fi -# Check whether --enable-static or --disable-static was given. + +# Check whether --enable-static was given. if test "${enable_static+set}" = set; then - enableval="$enable_static" - p=${PACKAGE-default} + enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; @@ -3826,12 +4520,12 @@ esac else enable_static=yes -fi; +fi -# Check whether --enable-fast-install or --disable-fast-install was given. + +# Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then - enableval="$enable_fast_install" - p=${PACKAGE-default} + enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; @@ -3850,64 +4544,94 @@ esac else enable_fast_install=yes -fi; +fi + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3931,7 +4655,7 @@ # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && break + test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in @@ -3960,70 +4684,217 @@ fi SED=$lt_cv_path_SED -echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 +{ echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" -# Check whether --with-gnu-ld or --without-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - with_gnu_ld=no -fi; -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4036,7 +4907,7 @@ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. + # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld -echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi -echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -4103,15 +4974,15 @@ case $host_os in darwin*) if test "$GCC" = yes; then - reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r $compiler_flags -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac -echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4119,56 +4990,63 @@ # Let the user override the test. lt_cv_path_NM="$NM" else - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/${ac_tool_prefix}nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" break ;; *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac ;; esac - esac - fi + fi + done + IFS="$lt_save_ifs" done - IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" -echo "$as_me:$LINENO: checking whether ln -s works" >&5 -echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6 + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } fi -echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4218,13 +5096,13 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | kfreebsd*-gnu) +freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; @@ -4240,7 +5118,7 @@ hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file - case "$host_cpu" in + case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so @@ -4256,6 +5134,11 @@ esac ;; +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; @@ -4301,15 +5184,11 @@ lt_cv_deplibs_check_method=pass_all ;; -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - solaris*) lt_cv_deplibs_check_method=pass_all ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) +sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' @@ -4330,17 +5209,20 @@ siemens) lt_cv_deplibs_check_method=pass_all ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; esac ;; -sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi -echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -4351,14 +5233,17 @@ # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + # Allow CC to be a program name with arguments. compiler=$CC -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +# Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" + enableval=$enable_libtool_lock; +fi -fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good @@ -4385,7 +5270,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4340 "configure"' > conftest.$ac_ext + echo '#line 5273 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4428,7 +5313,7 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - case "`/usr/bin/file conftest.o`" in + case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*linux*) @@ -4470,8 +5355,8 @@ # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4488,26 +5373,45 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +int +main () +{ + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4516,9 +5420,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -lt_cv_cc_needs_belf=no + lt_cv_cc_needs_belf=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4527,13 +5432,33 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + esac @@ -4541,8 +5466,8 @@ -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4566,24 +5491,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4592,9 +5529,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -4650,6 +5588,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -4669,18 +5608,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4693,12 +5641,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4721,9 +5671,9 @@ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4737,24 +5687,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4763,12 +5725,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -4783,18 +5747,19 @@ for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4805,24 +5770,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4831,15 +5808,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4848,8 +5826,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -4873,9 +5856,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -4899,25 +5883,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to llvmbugs at cs.uiuc.edu ## ## ----------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -4934,13 +5917,13 @@ if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4970,8 +5953,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -4996,9 +5984,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5008,8 +5997,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5036,6 +6030,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -5053,8 +6048,8 @@ else ac_cv_prog_CXXCPP=$CXXCPP fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6 +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do @@ -5077,8 +6072,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5103,9 +6103,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5115,8 +6116,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5143,6 +6149,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -5158,7 +6165,7 @@ { (exit 1); exit 1; }; } fi -ac_ext=cc +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -5172,12 +6179,12 @@ ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5190,36 +6197,38 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then - echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6 + { echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 - for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran + for ac_prog in g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 f90 xlf90 pgf90 pghpf epcf90 gfortran g95 f95 fort xlf95 ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5232,48 +6241,78 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then - echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_F77" && break done - F77=$ac_ct_F77 + if test "x$ac_ct_F77" = x; then + F77="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + F77=$ac_ct_F77 + fi fi # Provide some information about the compiler. -echo "$as_me:5214:" \ - "checking for Fortran 77 compiler version" >&5 +echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -5283,8 +6322,8 @@ # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F -echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5297,24 +6336,36 @@ end _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5323,20 +6374,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= -echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5347,24 +6399,36 @@ end _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5373,13 +6437,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_f77_g=no + ac_cv_prog_f77_g=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then @@ -5408,8 +6473,8 @@ # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments -echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5449,20 +6514,50 @@ lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* ) + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else - lt_cv_sys_max_cmd_len=65536 # usable default for *BSD + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; - *) + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. @@ -5487,19 +6582,19 @@ fi if test -n $lt_cv_sys_max_cmd_len ; then - echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. -echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5513,9 +6608,6 @@ # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" @@ -5550,9 +6642,18 @@ osf*) symcode='[BCDEGQRST]' ;; -solaris* | sysv5*) +solaris*) symcode='[BDRT]' ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; sysv4) symcode='[DFNSTU]' ;; @@ -5575,8 +6676,11 @@ # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no @@ -5694,15 +6798,15 @@ lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } fi -echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5716,8 +6820,8 @@ fi rmdir .libs 2>/dev/null fi -echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir @@ -5738,7 +6842,7 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' +Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. @@ -5758,7 +6862,7 @@ default_ofile=mklib can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except M$VC, +# All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" @@ -5768,8 +6872,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5782,32 +6886,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5820,27 +6926,41 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - AR=$ac_ct_AR + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else AR="$ac_cv_prog_AR" fi @@ -5848,8 +6968,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5862,32 +6982,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5900,27 +7022,41 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -5928,8 +7064,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5942,32 +7078,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5980,27 +7118,41 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -6015,6 +7167,7 @@ test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" @@ -6034,23 +7187,32 @@ if test -n "$RANLIB"; then case $host_os in openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6070,7 +7232,7 @@ if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then @@ -6102,17 +7264,17 @@ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6132,7 +7294,7 @@ if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then @@ -6164,11 +7326,11 @@ MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6 + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi else @@ -6183,21 +7345,21 @@ enable_dlopen=no enable_win32_dll=no -# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +# Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then - enableval="$enable_libtool_lock" + enableval=$enable_libtool_lock; +fi -fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# Check whether --with-pic or --without-pic was given. +# Check whether --with-pic was given. if test "${with_pic+set}" = set; then - withval="$with_pic" - pic_mode="$withval" + withval=$with_pic; pic_mode="$withval" else pic_mode=default -fi; +fi + test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script @@ -6227,68 +7389,25 @@ # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + # Allow CC to be a program name with arguments. compiler=$CC -# -# Check for any special shared library compilation flags. -# -lt_prog_cc_shlib= -if test "$GCC" = no; then - case $host_os in - sco3.2v5*) - lt_prog_cc_shlib='-belf' - ;; - esac -fi -if test -n "$lt_prog_cc_shlib"; then - { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 -echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} - if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : - else - { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 -echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} - lt_cv_prog_cc_can_build_shared=no - fi -fi - - -# -# Check to make sure the static flag actually works. -# -echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_prog_compiler_static" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 - -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* @@ -6298,8 +7417,8 @@ lt_prog_compiler_no_builtin_flag=' -fno-builtin' -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6313,26 +7432,28 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6271: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7438: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6275: \$? = $ac_status" >&5 + echo "$as_me:7442: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -6346,8 +7467,8 @@ lt_prog_compiler_pic= lt_prog_compiler_static= -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -6385,6 +7506,11 @@ lt_prog_compiler_pic='-fno-common' ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. @@ -6401,7 +7527,7 @@ hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. - case "$host_cpu" in + case $host_cpu in hppa*64*|ia64*) # +Z the default ;; @@ -6430,7 +7556,7 @@ darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in + case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' @@ -6448,7 +7574,7 @@ lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. - case "$host_cpu" in + case $host_cpu in hppa*64*|ia64*) # +Z the default ;; @@ -6472,12 +7598,19 @@ ;; linux*) - case $CC in + case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. @@ -6492,15 +7625,15 @@ lt_prog_compiler_static='-non_shared' ;; - sco3.2v5*) - lt_prog_compiler_pic='-Kpic' - lt_prog_compiler_static='-dn' - ;; - solaris*) - lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac ;; sunos4*) @@ -6509,7 +7642,7 @@ lt_prog_compiler_static='-Bstatic' ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' @@ -6522,6 +7655,17 @@ fi ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' @@ -6533,16 +7677,16 @@ esac fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6556,26 +7700,28 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6514: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7706: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6518: \$? = $ac_status" >&5 + echo "$as_me:7710: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in @@ -6588,7 +7734,7 @@ fi fi -case "$host_os" in +case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= @@ -6598,8 +7744,50 @@ ;; esac -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6616,23 +7804,25 @@ # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6574: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7810: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6578: \$? = $ac_status" >&5 + echo "$as_me:7814: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test ! -s out/conftest.err; then + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi - chmod u+w . + chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation @@ -6643,23 +7833,23 @@ $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} @@ -6669,8 +7859,8 @@ need_locks=no fi -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= @@ -6708,6 +7898,16 @@ # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) @@ -6718,6 +7918,10 @@ with_gnu_ld=no fi ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; openbsd*) with_gnu_ld=no ;; @@ -6728,6 +7932,27 @@ # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) @@ -6778,10 +8003,10 @@ allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then @@ -6790,7 +8015,53 @@ echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi else ld_shlibs=no fi @@ -6806,7 +8077,7 @@ fi ;; - solaris* | sysv5*) + solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 @@ -6827,6 +8098,33 @@ fi ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= @@ -6834,31 +8132,6 @@ hardcode_shlibpath_var=no ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_cmds="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - archive_expsym_cmds="$tmp_archive_cmds" - fi - else - ld_shlibs=no - fi - ;; - *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' @@ -6869,16 +8142,11 @@ ;; esac - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) @@ -6890,7 +8158,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported @@ -6924,6 +8192,7 @@ break fi done + ;; esac exp_sym_flag='-bexport' @@ -6942,7 +8211,7 @@ link_all_deplibs=yes if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) + case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` @@ -6961,8 +8230,12 @@ hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi + ;; esac shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi else # not using gcc if test "$host_cpu" = ia64; then @@ -6970,11 +8243,11 @@ # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then + if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' - fi + fi fi fi @@ -7002,24 +8275,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7033,18 +8318,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF @@ -7063,24 +8350,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7094,8 +8393,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -7104,13 +8405,11 @@ # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec=' ' + whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -7149,7 +8448,7 @@ ;; darwin* | rhapsody*) - case "$host_os" in + case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; @@ -7178,16 +8477,16 @@ output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - case "$cc_basename" in + case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; @@ -7228,7 +8527,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -7251,47 +8550,62 @@ export_dynamic_flag_spec='${wl}-E' ;; - hpux10* | hpux11*) + hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; - ia64*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; *) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' @@ -7385,7 +8699,7 @@ allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -7393,21 +8707,15 @@ hardcode_libdir_separator=: ;; - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then + wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else + wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' @@ -7416,8 +8724,18 @@ hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs=yes ;; @@ -7474,36 +8792,45 @@ fi ;; - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; + runpath_var='LD_RUN_PATH' - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no ;; - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi ;; uts4*) @@ -7518,15 +8845,10 @@ esac fi -echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6 +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - # # Do we need to explicitly link libc? # @@ -7544,8 +8866,8 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -7559,6 +8881,7 @@ libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= @@ -7581,16 +8904,16 @@ cat conftest.err 1>&5 fi $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6 + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -7719,7 +9042,8 @@ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' @@ -7749,7 +9073,7 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; @@ -7772,7 +9096,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` @@ -7807,8 +9131,17 @@ dynamic_linker='GNU ld.so' ;; -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) @@ -7826,14 +9159,19 @@ freebsd2*) shlibpath_overrides_runpath=yes ;; - freebsd3.01* | freebsdelf3.01*) + freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; - *) # from 3.2 on + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; esac ;; @@ -7853,7 +9191,7 @@ version_type=sunos need_lib_prefix=no need_version=no - case "$host_cpu" in + case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes @@ -7893,6 +9231,18 @@ postinstall_cmds='chmod 555 $lib' ;; +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; @@ -7952,7 +9302,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -8014,8 +9364,13 @@ openbsd*) version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - need_version=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH @@ -8053,13 +9408,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -8085,7 +9433,7 @@ need_version=yes ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) +sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -8118,6 +9466,29 @@ fi ;; +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -8129,12 +9500,17 @@ dynamic_linker=no ;; esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ @@ -8158,8 +9534,8 @@ # directories. hardcode_action=unsupported fi -echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6 +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported @@ -8172,29 +9548,29 @@ striplib= old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi ;; *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ;; esac fi @@ -8226,8 +9602,8 @@ darwin*) # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8240,40 +9616,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8282,14 +9670,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -8303,8 +9692,8 @@ ;; *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8331,53 +9720,59 @@ #undef shl_load -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) +#if defined __stub_shl_load || defined __stub___shl_load choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != shl_load; +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8386,18 +9781,19 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_shl_load=no + ac_cv_func_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8410,40 +9806,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shl_load (); int main () { -shl_load (); +return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8452,19 +9860,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_shl_load=no + ac_cv_lib_dld_shl_load=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8491,53 +9900,59 @@ #undef dlopen -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) +#if defined __stub_dlopen || defined __stub___dlopen choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != dlopen; +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8546,18 +9961,19 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_dlopen=no + ac_cv_func_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8570,40 +9986,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8612,19 +10040,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dl_dlopen=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8637,40 +10066,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -dlopen (); +return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8679,19 +10120,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_svld_dlopen=no + ac_cv_lib_svld_dlopen=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8704,40 +10146,52 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dld_link (); int main () { -dld_link (); +return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8746,14 +10200,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dld_dld_link=no + ac_cv_lib_dld_dld_link=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi @@ -8788,13 +10243,13 @@ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8804,7 +10259,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null + (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed @@ -8886,13 +10343,13 @@ fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8902,7 +10359,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null + (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed @@ -8984,8 +10443,8 @@ fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" @@ -9006,19 +10465,19 @@ fi -# Report which librarie types wil actually be built -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 +# Report which library types will actually be built +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. -case "$host_os" in +case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then @@ -9033,15 +10492,15 @@ fi ;; esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh @@ -9056,7 +10515,7 @@ # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ @@ -9160,7 +10619,7 @@ # # 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. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -9171,7 +10630,7 @@ SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e s/^X//" +Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. @@ -9205,6 +10664,12 @@ # The host system. host_alias=$host_alias host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo @@ -9216,6 +10681,9 @@ # A C compiler. LTCC=$lt_LTCC +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + # A language-specific compiler. CC=$lt_compiler @@ -9281,7 +10749,7 @@ # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o -# Must we lock files when doing compilation ? +# Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? @@ -9524,11 +10992,11 @@ CC="$lt_save_CC" -# Check whether --with-tags or --without-tags was given. +# Check whether --with-tags was given. if test "${with_tags+set}" = set; then - withval="$with_tags" - tagnames="$withval" -fi; + withval=$with_tags; tagnames="$withval" +fi + if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then @@ -9546,6 +11014,9 @@ echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. @@ -9572,14 +11043,14 @@ # Update the list of available tags. if test -n "$tagname"; then - echo appending configuration tag "$tagname" to $ofile + echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -9598,6 +11069,7 @@ hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= @@ -9615,7 +11087,7 @@ compiler_lib_search_path_CXX= # Source file extension for C++ test sources. -ac_ext=cc +ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o @@ -9625,17 +11097,34 @@ lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *) { return(0); }\n' +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + # Allow CC to be a program name with arguments. compiler=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD @@ -9646,18 +11135,27 @@ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else - unset lt_cv_prog_gnu_ld + $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else - unset lt_cv_path_LD + $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately @@ -9671,18 +11169,18 @@ # Set up default GNU C++ configuration -# Check whether --with-gnu-ld or --without-gnu-ld was given. +# Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval="$with_gnu_ld" - test "$withval" = no || with_gnu_ld=yes + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi; +fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -9711,11 +11209,11 @@ ;; esac elif test "$with_gnu_ld" = yes; then - echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else - echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9728,7 +11226,7 @@ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 -echo "${ECHO_T}$LD" >&6 + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. + # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9823,8 +11321,8 @@ fi # PORTME: fill in a description of your system's C++ link characteristics -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) @@ -9853,6 +11351,7 @@ ;; esac done + ;; esac exp_sym_flag='-bexport' @@ -9871,7 +11370,7 @@ link_all_deplibs_CXX=yes if test "$GXX" = yes; then - case $host_os in aix4.012|aix4.012.*) + case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` @@ -9890,8 +11389,12 @@ hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi + ;; esac shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi else # not using gcc if test "$host_cpu" = ia64; then @@ -9931,24 +11434,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9962,19 +11477,21 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF @@ -9993,24 +11510,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -10024,8 +11553,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -10034,16 +11565,26 @@ # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX=' ' + whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + chorus*) case $cc_basename in *) @@ -10053,7 +11594,6 @@ esac ;; - cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. @@ -10063,7 +11603,7 @@ enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then @@ -10072,13 +11612,13 @@ echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) - case "$host_os" in + case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; @@ -10116,7 +11656,7 @@ archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else @@ -10124,12 +11664,12 @@ fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - case "$cc_basename" in + case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; @@ -10142,11 +11682,11 @@ dgux*) case $cc_basename in - ec++) + ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - ghcx) + ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -10157,14 +11697,14 @@ ;; esac ;; - freebsd12*) + freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -10181,11 +11721,11 @@ # location of the library. case $cc_basename in - CC) + CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - aCC) + aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when @@ -10195,7 +11735,7 @@ # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then @@ -10209,33 +11749,22 @@ ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - hardcode_libdir_separator_CXX=: - ;; - ia64*) - hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi - case "$host_cpu" in - hppa*64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - ia64*) + case $host_cpu in + hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. ;; *) hardcode_direct_CXX=yes @@ -10246,14 +11775,17 @@ esac case $cc_basename in - CC) + CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - aCC) - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' @@ -10272,9 +11804,12 @@ *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then - case "$host_cpu" in - ia64*|hppa*64*) - archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' @@ -10288,11 +11823,25 @@ ;; esac ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; irix5* | irix6*) case $cc_basename in - CC) + CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -10303,7 +11852,7 @@ *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi @@ -10316,7 +11865,7 @@ ;; linux*) case $cc_basename in - KCC) + KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file @@ -10341,7 +11890,7 @@ # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - icpc) + icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols @@ -10353,8 +11902,12 @@ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no @@ -10362,7 +11915,16 @@ export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; - cxx) + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' @@ -10393,7 +11955,7 @@ ;; mvs*) case $cc_basename in - cxx) + cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; @@ -10432,7 +11994,7 @@ ;; osf3*) case $cc_basename in - KCC) + KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file @@ -10448,14 +12010,14 @@ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; - RCC) + RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - cxx) + cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -10473,7 +12035,7 @@ *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -10492,7 +12054,7 @@ ;; osf4* | osf5*) case $cc_basename in - KCC) + KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file @@ -10507,17 +12069,17 @@ # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; - RCC) + RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - cxx) + cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' @@ -10536,7 +12098,7 @@ *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -10557,27 +12119,14 @@ # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - sco*) - archive_cmds_need_lc_CXX=no - case $cc_basename in - CC) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; sunos4*) case $cc_basename in - CC) + CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - lcc) + lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -10590,36 +12139,33 @@ ;; solaris*) case $cc_basename in - CC) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in - solaris2.0-5 | solaris2.0-5.*) ;; + solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system - # linker. + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -10627,7 +12173,7 @@ # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; - gcx) + gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' @@ -10665,12 +12211,63 @@ ;; esac ;; - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac ;; tandem*) case $cc_basename in - NCC) + NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -10690,8 +12287,8 @@ ld_shlibs_CXX=no ;; esac -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" @@ -10723,7 +12320,7 @@ # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. - output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in @@ -10799,6 +12396,29 @@ $rm -f confest.$objext +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac @@ -10807,8 +12427,8 @@ lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -10846,6 +12466,10 @@ # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic @@ -10854,7 +12478,7 @@ hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. - case "$host_cpu" in + case $host_cpu in hppa*64*|ia64*) ;; *) @@ -10879,7 +12503,7 @@ ;; chorus*) case $cc_basename in - cxch68) + cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; @@ -10888,7 +12512,7 @@ darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in + case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' @@ -10897,10 +12521,10 @@ ;; dgux*) case $cc_basename in - ec++) + ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; - ghcx) + ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; @@ -10908,22 +12532,22 @@ ;; esac ;; - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in - CC) + CC*) lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; - aCC) + aCC*) lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" - case "$host_cpu" in + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in hppa*64*|ia64*) # +Z the default ;; @@ -10936,9 +12560,13 @@ ;; esac ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; irix5* | irix6* | nonstopux*) case $cc_basename in - CC) + CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. @@ -10949,18 +12577,24 @@ ;; linux*) case $cc_basename in - KCC) + KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; - icpc) + icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; - cxx) + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. @@ -10977,7 +12611,7 @@ ;; mvs*) case $cc_basename in - cxx) + cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) @@ -10988,14 +12622,14 @@ ;; osf3* | osf4* | osf5*) case $cc_basename in - KCC) + KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; - RCC) + RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; - cxx) + cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha @@ -11009,24 +12643,15 @@ ;; psos*) ;; - sco*) - case $cc_basename in - CC) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - *) - ;; - esac - ;; solaris*) case $cc_basename in - CC) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; - gcx) + gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; @@ -11036,12 +12661,12 @@ ;; sunos4*) case $cc_basename in - CC) + CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; - lcc) + lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; @@ -11051,7 +12676,7 @@ ;; tandem*) case $cc_basename in - NCC) + NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; @@ -11059,7 +12684,14 @@ ;; esac ;; - unixware*) + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac ;; vxworks*) ;; @@ -11069,16 +12701,16 @@ esac fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11092,26 +12724,28 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11050: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12730: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11054: \$? = $ac_status" >&5 + echo "$as_me:12734: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in @@ -11124,7 +12758,7 @@ fi fi -case "$host_os" in +case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= @@ -11134,8 +12768,50 @@ ;; esac -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -11152,23 +12828,25 @@ # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11110: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12834: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11114: \$? = $ac_status" >&5 + echo "$as_me:12838: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test ! -s out/conftest.err; then + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi - chmod u+w . + chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation @@ -11179,23 +12857,23 @@ $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} @@ -11205,8 +12883,8 @@ need_locks=no fi -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in @@ -11223,22 +12901,17 @@ export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac -echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6 +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - # # Do we need to explicitly link libc? # @@ -11256,8 +12929,8 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -11271,6 +12944,7 @@ libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= @@ -11293,16 +12967,16 @@ cat conftest.err 1>&5 fi $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -11431,7 +13105,8 @@ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' @@ -11461,7 +13136,7 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; @@ -11484,7 +13159,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` @@ -11519,8 +13194,17 @@ dynamic_linker='GNU ld.so' ;; -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) @@ -11538,14 +13222,19 @@ freebsd2*) shlibpath_overrides_runpath=yes ;; - freebsd3.01* | freebsdelf3.01*) + freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; - *) # from 3.2 on + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; esac ;; @@ -11565,7 +13254,7 @@ version_type=sunos need_lib_prefix=no need_version=no - case "$host_cpu" in + case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes @@ -11605,6 +13294,18 @@ postinstall_cmds='chmod 555 $lib' ;; +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; @@ -11664,7 +13365,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -11726,8 +13427,13 @@ openbsd*) version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - need_version=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH @@ -11765,13 +13471,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -11797,7 +13496,7 @@ need_version=yes ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) +sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -11830,6 +13529,29 @@ fi ;; +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -11841,12 +13563,17 @@ dynamic_linker=no ;; esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ @@ -11870,8 +13597,8 @@ # directories. hardcode_action_CXX=unsupported fi -echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6 +{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported @@ -11882,1239 +13609,413 @@ enable_fast_install=needless fi -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; + esac - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; +cfgfile="$ofile" - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes +# Whether or not to build static libraries. +build_old_libs=$enable_static -fi +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX - ;; +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os -#ifdef __STDC__ -# include -#else -# include -#endif +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os -#undef shl_load +# An echo program that does not interpret backslashes. +echo=$lt_echo -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# A C compiler. +LTCC=$lt_LTCC -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# A language-specific compiler. +CC=$lt_compiler_CXX -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +# An ERE matcher. +EGREP=$lt_EGREP -#ifdef __STDC__ -# include -#else -# include -#endif +# The linker used to build libraries. +LD=$lt_LD_CXX -#undef dlopen +# Whether we need hard or soft links. +LN_S=$lt_LN_S -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif +# A BSD-compatible nm program. +NM=$lt_NM -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# A symbol stripping program +STRIP=$lt_STRIP -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Used on cygwin: assembler. +AS="$AS" -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# The name of the directory that contains temporary libtool files. +objdir=$objdir -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" -fi +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX -fi +# Object file suffix (normally "o"). +objext="$ac_objext" +# Old archive suffix (normally "a"). +libext="$libext" -fi +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' +# Executable file suffix (normally ""). +exeext="$exeext" -fi +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len -fi +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX +# Must we lock files when doing compilation? +need_locks=$lt_need_locks -fi +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix - ;; - esac +# Do we need a version for libraries? +need_version=$need_version - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi +# Whether dlopen is supported. +dlopen_support=$enable_dlopen - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX -#include +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +# Library versioning type. +version_type=$version_type -#ifdef __cplusplus -extern "C" void exit (int); -#endif +# Format of library name prefix. +libname_spec=$lt_libname_spec -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX -#include +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX -#ifdef __cplusplus -extern "C" void exit (int); -#endif +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -cfgfile="$ofile" +# This is the shared library runtime path variable. +runpath_var=$runpath_var - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname +# This is the shared library path variable. +shlibpath_var=$shlibpath_var -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -# Whether or not to build static libraries. -build_old_libs=$enable_static +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX -# The host system. -host_alias=$host_alias -host=$host +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX -# An echo program that does not interpret backslashes. -echo=$lt_echo +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX -# A C compiler. -LTCC=$lt_LTCC +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" -# A language-specific compiler. -CC=$lt_compiler_CXX +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -# An ERE matcher. -EGREP=$lt_EGREP +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# The linker used to build libraries. -LD=$lt_LD_CXX +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" -# Whether we need hard or soft links. -LN_S=$lt_LN_S +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX -# A BSD-compatible nm program. -NM=$lt_NM +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX -# A symbol stripping program -STRIP=$lt_STRIP +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" +# ### END LIBTOOL TAG CONFIG: $tagname -# Used on cygwin: assembler. -AS="$AS" +__EOF__ -# The name of the directory that contains temporary libtool files. -objdir=$objdir -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_predep_objects_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_postdep_objects_CXX - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_compiler_lib_search_path_CXX - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_CXX - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi ac_ext=c @@ -13185,29 +14086,55 @@ # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + # Allow CC to be a program name with arguments. compiler=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC -cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + -echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6 +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } -echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. -case "$host_os" in +case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then @@ -13216,20 +14143,20 @@ fi ;; aix4* | aix5*) - test "$enable_shared" = yes && enable_static=no + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi ;; esac -echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6 +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } -echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes -echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6 - -test "$ld_shlibs_F77" = no && can_build_shared=no +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" @@ -13238,8 +14165,8 @@ lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' @@ -13277,6 +14204,11 @@ lt_prog_compiler_pic_F77='-fno-common' ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. @@ -13293,7 +14225,7 @@ hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. - case "$host_cpu" in + case $host_cpu in hppa*64*|ia64*) # +Z the default ;; @@ -13322,7 +14254,7 @@ darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in + case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' @@ -13340,7 +14272,7 @@ lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. - case "$host_cpu" in + case $host_cpu in hppa*64*|ia64*) # +Z the default ;; @@ -13364,12 +14296,19 @@ ;; linux*) - case $CC in + case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. @@ -13384,15 +14323,15 @@ lt_prog_compiler_static_F77='-non_shared' ;; - sco3.2v5*) - lt_prog_compiler_pic_F77='-Kpic' - lt_prog_compiler_static_F77='-dn' - ;; - solaris*) - lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac ;; sunos4*) @@ -13401,7 +14340,7 @@ lt_prog_compiler_static_F77='-Bstatic' ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' @@ -13414,27 +14353,38 @@ fi ;; - uts4*) - lt_prog_compiler_pic_F77='-pic' + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; - *) + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13448,26 +14398,28 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13406: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14404: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13410: \$? = $ac_status" >&5 + echo "$as_me:14408: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in @@ -13480,7 +14432,7 @@ fi fi -case "$host_os" in +case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= @@ -13490,8 +14442,50 @@ ;; esac -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13508,23 +14502,25 @@ # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13466: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14508: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13470: \$? = $ac_status" >&5 + echo "$as_me:14512: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test ! -s out/conftest.err; then + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi - chmod u+w . + chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation @@ -13535,23 +14531,23 @@ $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} @@ -13561,8 +14557,8 @@ need_locks=no fi -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= @@ -13600,6 +14596,16 @@ # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) @@ -13610,6 +14616,10 @@ with_gnu_ld=no fi ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; openbsd*) with_gnu_ld=no ;; @@ -13620,6 +14630,27 @@ # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) @@ -13670,10 +14701,10 @@ allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then @@ -13682,9 +14713,55 @@ echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else - ld_shlibs=no + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no fi ;; @@ -13698,7 +14775,7 @@ fi ;; - solaris* | sysv5*) + solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 @@ -13719,6 +14796,33 @@ fi ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= @@ -13726,31 +14830,6 @@ hardcode_shlibpath_var_F77=no ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_cmds_F77="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - archive_expsym_cmds_F77="$tmp_archive_cmds" - fi - else - ld_shlibs_F77=no - fi - ;; - *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' @@ -13761,16 +14840,11 @@ ;; esac - if test "$ld_shlibs_F77" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) @@ -13782,7 +14856,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported @@ -13816,6 +14890,7 @@ break fi done + ;; esac exp_sym_flag='-bexport' @@ -13834,7 +14909,7 @@ link_all_deplibs_F77=yes if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) + case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` @@ -13853,8 +14928,12 @@ hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi + ;; esac shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi else # not using gcc if test "$host_cpu" = ia64; then @@ -13862,11 +14941,11 @@ # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then + if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' - fi + fi fi fi @@ -13884,24 +14963,36 @@ end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -13915,18 +15006,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF @@ -13935,24 +15028,36 @@ end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_f77_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -13966,8 +15071,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -13976,13 +15083,11 @@ # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77=' ' + whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -14016,12 +15121,12 @@ old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) - case "$host_os" in + case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; @@ -14050,16 +15155,16 @@ output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - case "$cc_basename" in + case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; @@ -14100,7 +15205,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes @@ -14123,47 +15228,62 @@ export_dynamic_flag_spec_F77='${wl}-E' ;; - hpux10* | hpux11*) + hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - ia64*) - hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes ;; *) - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' @@ -14257,7 +15377,7 @@ allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' @@ -14265,21 +15385,15 @@ hardcode_libdir_separator_F77=: ;; - sco3.2v5*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then + wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else + wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' @@ -14288,8 +15402,18 @@ hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs_F77=yes ;; @@ -14346,36 +15470,45 @@ fi ;; - sysv4.2uw2*) - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=no + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; + runpath_var='LD_RUN_PATH' - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no ;; - sysv5*) - no_undefined_flag_F77=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec_F77= + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi ;; uts4*) @@ -14390,15 +15523,10 @@ esac fi -echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6 +{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - # # Do we need to explicitly link libc? # @@ -14416,8 +15544,8 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -14431,6 +15559,7 @@ libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= @@ -14453,16 +15582,16 @@ cat conftest.err 1>&5 fi $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= @@ -14591,7 +15720,8 @@ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' @@ -14621,7 +15751,7 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; @@ -14644,7 +15774,7 @@ soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` @@ -14679,8 +15809,17 @@ dynamic_linker='GNU ld.so' ;; -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) @@ -14698,14 +15837,19 @@ freebsd2*) shlibpath_overrides_runpath=yes ;; - freebsd3.01* | freebsdelf3.01*) + freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; - *) # from 3.2 on + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; esac ;; @@ -14725,7 +15869,7 @@ version_type=sunos need_lib_prefix=no need_version=no - case "$host_cpu" in + case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes @@ -14765,6 +15909,18 @@ postinstall_cmds='chmod 555 $lib' ;; +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; @@ -14824,7 +15980,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -14886,8 +16042,13 @@ openbsd*) version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - need_version=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH @@ -14925,13 +16086,6 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - solaris*) version_type=linux need_lib_prefix=no @@ -14957,7 +16111,7 @@ need_version=yes ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) +sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' @@ -14990,6 +16144,29 @@ fi ;; +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -15001,12 +16178,17 @@ dynamic_linker=no ;; esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ @@ -15030,8 +16212,8 @@ # directories. hardcode_action_F77=unsupported fi -echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6 +{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported @@ -15042,36 +16224,6 @@ enable_fast_install=needless fi -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - - # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh @@ -15086,7 +16238,7 @@ # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ @@ -15187,6 +16339,12 @@ # The host system. host_alias=$host_alias host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo @@ -15198,6 +16356,9 @@ # A C compiler. LTCC=$lt_LTCC +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + # A language-specific compiler. CC=$lt_compiler_F77 @@ -15263,7 +16424,7 @@ # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 -# Must we lock files when doing compilation ? +# Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? @@ -15505,26 +16666,55 @@ lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n' +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + # Allow CC to be a program name with arguments. compiler=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no +old_archive_cmds_GCJ=$old_archive_cmds + lt_prog_compiler_no_builtin_flag_GCJ= @@ -15532,8 +16722,8 @@ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' -echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15547,26 +16737,28 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15505: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16743: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15509: \$? = $ac_status" >&5 + echo "$as_me:16747: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" @@ -15580,8 +16772,8 @@ lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= -echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' @@ -15619,6 +16811,11 @@ lt_prog_compiler_pic_GCJ='-fno-common' ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. @@ -15635,7 +16832,7 @@ hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. - case "$host_cpu" in + case $host_cpu in hppa*64*|ia64*) # +Z the default ;; @@ -15664,7 +16861,7 @@ darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files - case "$cc_basename" in + case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' @@ -15682,7 +16879,7 @@ lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. - case "$host_cpu" in + case $host_cpu in hppa*64*|ia64*) # +Z the default ;; @@ -15706,12 +16903,19 @@ ;; linux*) - case $CC in + case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. @@ -15726,15 +16930,15 @@ lt_prog_compiler_static_GCJ='-non_shared' ;; - sco3.2v5*) - lt_prog_compiler_pic_GCJ='-Kpic' - lt_prog_compiler_static_GCJ='-dn' - ;; - solaris*) - lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac ;; sunos4*) @@ -15743,7 +16947,7 @@ lt_prog_compiler_static_GCJ='-Bstatic' ;; - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' @@ -15756,6 +16960,17 @@ fi ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' @@ -15767,16 +16982,16 @@ esac fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then -echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15790,26 +17005,28 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15748: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17011: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15752: \$? = $ac_status" >&5 + echo "$as_me:17015: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in @@ -15822,7 +17039,7 @@ fi fi -case "$host_os" in +case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= @@ -15832,8 +17049,50 @@ ;; esac -echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -15850,23 +17109,25 @@ # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15808: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17115: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15812: \$? = $ac_status" >&5 + echo "$as_me:17119: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test ! -s out/conftest.err; then + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi - chmod u+w . + chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation @@ -15877,23 +17138,23 @@ $rm conftest* fi -echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6 + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} @@ -15903,8 +17164,8 @@ need_locks=no fi -echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= @@ -15942,6 +17203,16 @@ # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) @@ -15952,6 +17223,10 @@ with_gnu_ld=no fi ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; openbsd*) with_gnu_ld=no ;; @@ -15962,6 +17237,27 @@ # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) @@ -16012,10 +17308,10 @@ allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then @@ -16024,9 +17320,55 @@ echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else - ld_shlibs=no + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no fi ;; @@ -16040,7 +17382,7 @@ fi ;; - solaris* | sysv5*) + solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 @@ -16061,6 +17403,33 @@ fi ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= @@ -16068,31 +17437,6 @@ hardcode_shlibpath_var_GCJ=no ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_cmds_GCJ="$tmp_archive_cmds" - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - archive_expsym_cmds_GCJ="$tmp_archive_cmds" - fi - else - ld_shlibs_GCJ=no - fi - ;; - *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' @@ -16103,16 +17447,11 @@ ;; esac - if test "$ld_shlibs_GCJ" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) @@ -16124,7 +17463,7 @@ # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported @@ -16158,6 +17497,7 @@ break fi done + ;; esac exp_sym_flag='-bexport' @@ -16176,7 +17516,7 @@ link_all_deplibs_GCJ=yes if test "$GCC" = yes; then - case $host_os in aix4.012|aix4.012.*) + case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` @@ -16195,8 +17535,12 @@ hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi + ;; esac shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi else # not using gcc if test "$host_cpu" = ia64; then @@ -16204,11 +17548,11 @@ # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else - if test "$aix_use_runtimelinking" = yes; then + if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' - fi + fi fi fi @@ -16236,24 +17580,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -16267,18 +17623,20 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF @@ -16297,24 +17655,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -16328,8 +17698,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi @@ -16338,13 +17710,11 @@ # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' - # -bexpall does not export symbols beginning with underscore (_) - always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ=' ' + whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds it's shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; @@ -16378,12 +17748,12 @@ old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) - case "$host_os" in + case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; @@ -16412,16 +17782,16 @@ output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else - case "$cc_basename" in + case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; @@ -16462,7 +17832,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu) + freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes @@ -16485,47 +17855,62 @@ export_dynamic_flag_spec_GCJ='${wl}-E' ;; - hpux10* | hpux11*) + hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*|ia64*) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else - case "$host_cpu" in - hppa*64*|ia64*) - archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then - case "$host_cpu" in - hppa*64*) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - ia64*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes ;; *) - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' @@ -16619,7 +18004,7 @@ allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' @@ -16627,21 +18012,15 @@ hardcode_libdir_separator_GCJ=: ;; - sco3.2v5*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ;; - solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then + wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else + wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' @@ -16650,8 +18029,18 @@ hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac link_all_deplibs_GCJ=yes ;; @@ -16708,36 +18097,45 @@ fi ;; - sysv4.2uw2*) - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=no + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; + runpath_var='LD_RUN_PATH' - sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no ;; - sysv5*) - no_undefined_flag_GCJ=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec_GCJ= + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi ;; uts4*) @@ -16752,1491 +18150,705 @@ esac fi -echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6 -test "$ld_shlibs_GCJ" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 - ;; - esac - fi - ;; -esac - -echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.01* | freebsdelf3.01*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - *) # from 3.2 on - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case "$host_cpu" in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`$SED -e 's/:,\t/ /g;s/=^=*$//;s/=^= * / /g' /etc/ld.so.conf | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6 -test "$dynamic_linker" = no && can_build_shared=no - -echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6 - -if test "$hardcode_action_GCJ" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - ;; - *) - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - ;; - esac -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - echo "$as_me:$LINENO: checking for shl_load" >&5 -echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 -if test "${ac_cv_func_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shl_load to an innocuous variant, in case declares shl_load. - For example, HP-UX 11i declares gettimeofday. */ -#define shl_load innocuous_shl_load - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shl_load (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shl_load - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shl_load) || defined (__stub___shl_load) -choke me -#else -char (*f) () = shl_load; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != shl_load; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -echo "${ECHO_T}$ac_cv_func_shl_load" >&6 -if test $ac_cv_func_shl_load = yes; then - lt_cv_dlopen="shl_load" -else - echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shl_load (); -int -main () -{ -shl_load (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_shl_load=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dld_shl_load=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" -else - echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char dlopen (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef dlopen - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_dlopen) || defined (__stub___dlopen) -choke me -#else -char (*f) () = dlopen; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != dlopen; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -echo "${ECHO_T}$ac_cv_func_dlopen" >&6 -if test $ac_cv_func_dlopen = yes; then - lt_cv_dlopen="dlopen" -else - echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dl_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dl_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 -if test $ac_cv_lib_dl_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 -if test "${ac_cv_lib_svld_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +test "$ld_shlibs_GCJ" = no && can_build_shared=no -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dlopen (); -int -main () -{ -dlopen (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_svld_dlopen=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes -ac_cv_lib_svld_dlopen=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 -if test $ac_cv_lib_svld_dlopen = yes; then - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 -if test "${ac_cv_lib_dld_dld_link+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dld_link (); -int -main () -{ -dld_link (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dld_dld_link=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + ;; + esac + fi + ;; +esac -ac_cv_lib_dld_dld_link=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 -if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi +need_lib_prefix=unknown +hardcode_into_libs=no +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown -fi +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; -fi +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; -fi +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; -fi +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes -fi + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else - enable_dlopen=no + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" +freebsd1*) + dynamic_linker=no + ;; - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; - echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; -#include +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -#ifdef __cplusplus -extern "C" void exit (int); -#endif + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' fi -fi -rm -fr conftest* - + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; -fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6 +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; -#include +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; -#ifdef __cplusplus -extern "C" void exit (int); -#endif +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; esac - else : - # compilation failed - lt_cv_dlopen_self_static=no fi -fi -rm -fr conftest* + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 - fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6; } - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless fi @@ -18253,7 +18865,7 @@ # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ @@ -18354,6 +18966,12 @@ # The host system. host_alias=$host_alias host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo @@ -18365,6 +18983,9 @@ # A C compiler. LTCC=$lt_LTCC +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + # A language-specific compiler. CC=$lt_compiler_GCJ @@ -18430,7 +19051,7 @@ # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ -# Must we lock files when doing compilation ? +# Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? @@ -18678,15 +19299,42 @@ # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + # Allow CC to be a program name with arguments. compiler=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the @@ -18702,7 +19350,7 @@ # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ @@ -18803,6 +19451,12 @@ # The host system. host_alias=$host_alias host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo @@ -18814,6 +19468,9 @@ # A C compiler. LTCC=$lt_LTCC +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + # A language-specific compiler. CC=$lt_compiler_RC @@ -18879,7 +19536,7 @@ # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC -# Must we lock files when doing compilation ? +# Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? @@ -19157,40 +19814,40 @@ -echo "$as_me:$LINENO: checking for f2c bin/lib/include locations" >&5 -echo $ECHO_N "checking for f2c bin/lib/include locations... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for f2c bin/lib/include locations" >&5 +echo $ECHO_N "checking for f2c bin/lib/include locations... $ECHO_C" >&6; } -# Check whether --with-f2c or --without-f2c was given. +# Check whether --with-f2c was given. if test "${with_f2c+set}" = set; then - withval="$with_f2c" - f2cpfxdir=$withval + withval=$with_f2c; f2cpfxdir=$withval else f2cpfxdir=nada -fi; +fi -# Check whether --with-f2c-bin or --without-f2c-bin was given. + +# Check whether --with-f2c-bin was given. if test "${with_f2c_bin+set}" = set; then - withval="$with_f2c_bin" - f2cbindir=$withval + withval=$with_f2c_bin; f2cbindir=$withval else f2cbindir=nada -fi; +fi -# Check whether --with-f2c-lib or --without-f2c-lib was given. + +# Check whether --with-f2c-lib was given. if test "${with_f2c_lib+set}" = set; then - withval="$with_f2c_lib" - f2clibdir=$withval + withval=$with_f2c_lib; f2clibdir=$withval else f2clibdir=nada -fi; +fi -# Check whether --with-f2c-inc or --without-f2c-inc was given. + +# Check whether --with-f2c-inc was given. if test "${with_f2c_inc+set}" = set; then - withval="$with_f2c_inc" - f2cincdir=$withval + withval=$with_f2c_inc; f2cincdir=$withval else f2cincdir=nada -fi; +fi + eval pfxval=\$\{f2cpfxdir\} eval binval=\$\{f2cbindir\} eval incval=\$\{f2cincdir\} @@ -19232,39 +19889,39 @@ USE_F2C=1 - echo "$as_me:$LINENO: result: found via --with options" >&5 -echo "${ECHO_T}found via --with options" >&6 + { echo "$as_me:$LINENO: result: found via --with options" >&5 +echo "${ECHO_T}found via --with options" >&6; } else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f2c-libdir value must be a directory" >&5 echo "$as_me: error: The --with-f2c-libdir value must be a directory" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f2c-incdir value must be a directory" >&5 echo "$as_me: error: The --with-f2c-incdir value must be a directory" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f2c-bindir value must be a directory" >&5 echo "$as_me: error: The --with-f2c-bindir value must be a directory" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f2c-incdir option must be specified" >&5 echo "$as_me: error: The --with-f2c-incdir option must be specified" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f2c-libdir option must be specified" >&5 echo "$as_me: error: The --with-f2c-libdir option must be specified" >&2;} { (exit 1); exit 1; }; } @@ -19294,8 +19951,8 @@ fi fi - echo "$as_me:$LINENO: result: found in PATH at $tmppfxdir" >&5 -echo "${ECHO_T}found in PATH at $tmppfxdir" >&6 + { echo "$as_me:$LINENO: result: found in PATH at $tmppfxdir" >&5 +echo "${ECHO_T}found in PATH at $tmppfxdir" >&6; } else checkresult="yes" eval checkval=\$\{"USE_"F2C\} @@ -19410,47 +20067,47 @@ fi fi fi - echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 + { echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } fi fi -echo "$as_me:$LINENO: checking for nag-fortran bin/lib/include locations" >&5 -echo $ECHO_N "checking for nag-fortran bin/lib/include locations... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for nag-fortran bin/lib/include locations" >&5 +echo $ECHO_N "checking for nag-fortran bin/lib/include locations... $ECHO_C" >&6; } -# Check whether --with-f95 or --without-f95 was given. +# Check whether --with-f95 was given. if test "${with_f95+set}" = set; then - withval="$with_f95" - f95pfxdir=$withval + withval=$with_f95; f95pfxdir=$withval else f95pfxdir=nada -fi; +fi -# Check whether --with-f95-bin or --without-f95-bin was given. + +# Check whether --with-f95-bin was given. if test "${with_f95_bin+set}" = set; then - withval="$with_f95_bin" - f95bindir=$withval + withval=$with_f95_bin; f95bindir=$withval else f95bindir=nada -fi; +fi -# Check whether --with-f95-lib or --without-f95-lib was given. + +# Check whether --with-f95-lib was given. if test "${with_f95_lib+set}" = set; then - withval="$with_f95_lib" - f95libdir=$withval + withval=$with_f95_lib; f95libdir=$withval else f95libdir=nada -fi; +fi -# Check whether --with-f95-inc or --without-f95-inc was given. + +# Check whether --with-f95-inc was given. if test "${with_f95_inc+set}" = set; then - withval="$with_f95_inc" - f95incdir=$withval + withval=$with_f95_inc; f95incdir=$withval else f95incdir=nada -fi; +fi + eval pfxval=\$\{f95pfxdir\} eval binval=\$\{f95bindir\} eval incval=\$\{f95incdir\} @@ -19492,39 +20149,39 @@ USE_F95=1 - echo "$as_me:$LINENO: result: found via --with options" >&5 -echo "${ECHO_T}found via --with options" >&6 + { echo "$as_me:$LINENO: result: found via --with options" >&5 +echo "${ECHO_T}found via --with options" >&6; } else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f95-libdir value must be a directory" >&5 echo "$as_me: error: The --with-f95-libdir value must be a directory" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f95-incdir value must be a directory" >&5 echo "$as_me: error: The --with-f95-incdir value must be a directory" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f95-bindir value must be a directory" >&5 echo "$as_me: error: The --with-f95-bindir value must be a directory" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f95-incdir option must be specified" >&5 echo "$as_me: error: The --with-f95-incdir option must be specified" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6 + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } { { echo "$as_me:$LINENO: error: The --with-f95-libdir option must be specified" >&5 echo "$as_me: error: The --with-f95-libdir option must be specified" >&2;} { (exit 1); exit 1; }; } @@ -19554,8 +20211,8 @@ fi fi - echo "$as_me:$LINENO: result: found in PATH at $tmppfxdir" >&5 -echo "${ECHO_T}found in PATH at $tmppfxdir" >&6 + { echo "$as_me:$LINENO: result: found in PATH at $tmppfxdir" >&5 +echo "${ECHO_T}found in PATH at $tmppfxdir" >&6; } else checkresult="yes" eval checkval=\$\{"USE_"F95\} @@ -19670,20 +20327,20 @@ fi fi fi - echo "$as_me:$LINENO: result: $checkresult" >&5 -echo "${ECHO_T}$checkresult" >&6 + { echo "$as_me:$LINENO: result: $checkresult" >&5 +echo "${ECHO_T}$checkresult" >&6; } fi fi -echo "$as_me:$LINENO: checking sanity for program f95" >&5 -echo $ECHO_N "checking sanity for program f95... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking sanity for program f95" >&5 +echo $ECHO_N "checking sanity for program f95... $ECHO_C" >&6; } sanity_path=`which f95 2>/dev/null` if test "$?" -eq 0 -a -x "$sanity_path" ; then sanity=`f95 -V 2>&1 | grep "NAGWare Fortran 95"` if test -z "$sanity" ; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } if test "1" -eq 1 ; then { echo "$as_me:$LINENO: WARNING: Program f95 failed to pass sanity check." >&5 echo "$as_me: WARNING: Program f95 failed to pass sanity check." >&2;} @@ -19693,17 +20350,17 @@ { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } fi else - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 + { echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6; } fi -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -19727,24 +20384,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -19753,9 +20422,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -19811,6 +20481,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -19830,18 +20501,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -19854,12 +20534,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -19868,8 +20550,8 @@ fi -echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -19882,7 +20564,7 @@ #include #include #ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) @@ -19899,24 +20581,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -19925,12 +20619,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_sys_wait_h=no + ac_cv_header_sys_wait_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -19940,8 +20635,8 @@ fi -echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 -echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 +echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6; } if test "${llvm_cv_link_use_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -19969,24 +20664,36 @@ } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -19995,9 +20702,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -llvm_cv_link_use_r=no + llvm_cv_link_use_r=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$oldcflags" ac_ext=c @@ -20008,8 +20716,8 @@ fi -echo "$as_me:$LINENO: result: $llvm_cv_link_use_r" >&5 -echo "${ECHO_T}$llvm_cv_link_use_r" >&6 +{ echo "$as_me:$LINENO: result: $llvm_cv_link_use_r" >&5 +echo "${ECHO_T}$llvm_cv_link_use_r" >&6; } if test "$llvm_cv_link_use_r" = yes ; then cat >>confdefs.h <<\_ACEOF @@ -20019,8 +20727,8 @@ fi -echo "$as_me:$LINENO: checking for re_comp" >&5 -echo $ECHO_N "checking for re_comp... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for re_comp" >&5 +echo $ECHO_N "checking for re_comp... $ECHO_C" >&6; } if test "${ac_cv_func_re_comp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -20047,53 +20755,59 @@ #undef re_comp -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char re_comp (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_re_comp) || defined (__stub___re_comp) +#if defined __stub_re_comp || defined __stub___re_comp choke me -#else -char (*f) () = re_comp; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != re_comp; +return re_comp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -20102,13 +20816,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_re_comp=no + ac_cv_func_re_comp=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_re_comp" >&5 -echo "${ECHO_T}$ac_cv_func_re_comp" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_re_comp" >&5 +echo "${ECHO_T}$ac_cv_func_re_comp" >&6; } if test $ac_cv_func_re_comp = yes; then HAVE_RE_COMP=HAVE_RE_COMP:=1 @@ -20136,39 +20851,58 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -20177,63 +20911,48 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -20271,11 +20990,35 @@ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset @@ -20284,8 +21027,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -20299,178 +21077,140 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -20479,7 +21219,19 @@ as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -20488,31 +21240,14 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by LLVM-TEST $as_me 1.7cvs, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -20520,30 +21255,19 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_commands="$ac_config_commands" -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -20565,18 +21289,20 @@ $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ LLVM-TEST config.status 1.7cvs -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.60, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -20587,60 +21313,42 @@ do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -20656,69 +21364,81 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - llvm_src="${srcdir}" _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile.config" ) CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; - "setup" ) CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; - "Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; - "Makefile.common" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;; - "Makefile.f2c" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.f2c" ;; - "Makefile.programs" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.programs" ;; - "Makefile.tests" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.tests" ;; - "TEST.aa.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.aa.Makefile" ;; - "TEST.dsgraph.report" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.dsgraph.report" ;; - "TEST.aa.report" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.aa.report" ;; - "TEST.example.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.example.Makefile" ;; - "TEST.nightly.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.nightly.Makefile" ;; - "TEST.buildrepo.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.buildrepo.Makefile" ;; - "TEST.jit.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.jit.Makefile" ;; - "TEST.nightly.report" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.nightly.report" ;; - "TEST.dsgraph.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.dsgraph.Makefile" ;; - "TEST.jit.report" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.jit.report" ;; - "TEST.typesafe.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.typesafe.Makefile" ;; - "TEST.dsgraph.gnuplot" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.dsgraph.gnuplot" ;; - "TEST.vtl.Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.vtl.Makefile" ;; - "External/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/Makefile" ;; - "External/Makefile.external" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/Makefile.external" ;; - "External/Povray/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/Povray/Makefile" ;; - "External/SPEC/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile" ;; - "External/SPEC/Makefile.spec" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile.spec" ;; - "External/SPEC/Makefile.spec2000" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile.spec2000" ;; - "External/SPEC/Makefile.spec95" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile.spec95" ;; - "External/SPEC/CFP2000/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CFP2000/Makefile" ;; - "External/SPEC/CINT2000/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CINT2000/Makefile" ;; - "External/SPEC/CFP95/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CFP95/Makefile" ;; - "External/SPEC/CINT95/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CINT95/Makefile" ;; - "MultiSource/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS MultiSource/Makefile" ;; - "MultiSource/Makefile.multisrc" ) CONFIG_COMMANDS="$CONFIG_COMMANDS MultiSource/Makefile.multisrc" ;; - "SingleSource/Makefile" ) CONFIG_COMMANDS="$CONFIG_COMMANDS SingleSource/Makefile" ;; - "SingleSource/Makefile.singlesrc" ) CONFIG_COMMANDS="$CONFIG_COMMANDS SingleSource/Makefile.singlesrc" ;; + case $ac_config_target in + "setup") CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; + "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; + "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; + "Makefile.common") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.common" ;; + "Makefile.f2c") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.f2c" ;; + "Makefile.programs") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.programs" ;; + "Makefile.tests") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile.tests" ;; + "TEST.aa.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.aa.Makefile" ;; + "TEST.dsgraph.report") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.dsgraph.report" ;; + "TEST.aa.report") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.aa.report" ;; + "TEST.example.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.example.Makefile" ;; + "TEST.nightly.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.nightly.Makefile" ;; + "TEST.buildrepo.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.buildrepo.Makefile" ;; + "TEST.jit.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.jit.Makefile" ;; + "TEST.nightly.report") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.nightly.report" ;; + "TEST.dsgraph.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.dsgraph.Makefile" ;; + "TEST.jit.report") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.jit.report" ;; + "TEST.typesafe.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.typesafe.Makefile" ;; + "TEST.dsgraph.gnuplot") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.dsgraph.gnuplot" ;; + "TEST.vtl.Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS TEST.vtl.Makefile" ;; + "External/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS External/Makefile" ;; + "External/Makefile.external") CONFIG_COMMANDS="$CONFIG_COMMANDS External/Makefile.external" ;; + "External/Povray/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS External/Povray/Makefile" ;; + "External/SPEC/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile" ;; + "External/SPEC/Makefile.spec") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile.spec" ;; + "External/SPEC/Makefile.spec2000") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile.spec2000" ;; + "External/SPEC/Makefile.spec95") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/Makefile.spec95" ;; + "External/SPEC/CFP2000/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CFP2000/Makefile" ;; + "External/SPEC/CINT2000/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CINT2000/Makefile" ;; + "External/SPEC/CFP95/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CFP95/Makefile" ;; + "External/SPEC/CINT95/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS External/SPEC/CINT95/Makefile" ;; + "MultiSource/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS MultiSource/Makefile" ;; + "MultiSource/Makefile.multisrc") CONFIG_COMMANDS="$CONFIG_COMMANDS MultiSource/Makefile.multisrc" ;; + "SingleSource/Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS SingleSource/Makefile" ;; + "SingleSource/Makefile.singlesrc") CONFIG_COMMANDS="$CONFIG_COMMANDS SingleSource/Makefile.singlesrc" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -20729,355 +21449,462 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s, at SHELL@,$SHELL,;t t -s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t -s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t -s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s, at exec_prefix@,$exec_prefix,;t t -s, at prefix@,$prefix,;t t -s, at program_transform_name@,$program_transform_name,;t t -s, at bindir@,$bindir,;t t -s, at sbindir@,$sbindir,;t t -s, at libexecdir@,$libexecdir,;t t -s, at datadir@,$datadir,;t t -s, at sysconfdir@,$sysconfdir,;t t -s, at sharedstatedir@,$sharedstatedir,;t t -s, at localstatedir@,$localstatedir,;t t -s, at libdir@,$libdir,;t t -s, at includedir@,$includedir,;t t -s, at oldincludedir@,$oldincludedir,;t t -s, at infodir@,$infodir,;t t -s, at mandir@,$mandir,;t t -s, at build_alias@,$build_alias,;t t -s, at host_alias@,$host_alias,;t t -s, at target_alias@,$target_alias,;t t -s, at DEFS@,$DEFS,;t t -s, at ECHO_C@,$ECHO_C,;t t -s, at ECHO_N@,$ECHO_N,;t t -s, at ECHO_T@,$ECHO_T,;t t -s, at LIBS@,$LIBS,;t t -s, at LLVM_SRC@,$LLVM_SRC,;t t -s, at LLVM_OBJ@,$LLVM_OBJ,;t t -s, at LLVM_EXTERNALS@,$LLVM_EXTERNALS,;t t -s, at SPEC95_ROOT@,$SPEC95_ROOT,;t t -s, at USE_SPEC95@,$USE_SPEC95,;t t -s, at SPEC2000_ROOT@,$SPEC2000_ROOT,;t t -s, at USE_SPEC2000@,$USE_SPEC2000,;t t -s, at POVRAY_ROOT@,$POVRAY_ROOT,;t t -s, at USE_POVRAY@,$USE_POVRAY,;t t -s, at NAMD_ROOT@,$NAMD_ROOT,;t t -s, at USE_NAMD@,$USE_NAMD,;t t -s, at SWEEP3D_ROOT@,$SWEEP3D_ROOT,;t t -s, at USE_SWEEP3D@,$USE_SWEEP3D,;t t -s, at FPGROWTH_ROOT@,$FPGROWTH_ROOT,;t t -s, at USE_FPGROWTH@,$USE_FPGROWTH,;t t -s, at ALP_ROOT@,$ALP_ROOT,;t t -s, at USE_ALP@,$USE_ALP,;t t -s, at NURBS_ROOT@,$NURBS_ROOT,;t t -s, at USE_NURBS@,$USE_NURBS,;t t -s, at DISABLE_LLC_DIFFS@,$DISABLE_LLC_DIFFS,;t t -s, at CXX@,$CXX,;t t -s, at CXXFLAGS@,$CXXFLAGS,;t t -s, at LDFLAGS@,$LDFLAGS,;t t -s, at CPPFLAGS@,$CPPFLAGS,;t t -s, at ac_ct_CXX@,$ac_ct_CXX,;t t -s, at EXEEXT@,$EXEEXT,;t t -s, at OBJEXT@,$OBJEXT,;t t -s, at CC@,$CC,;t t -s, at CFLAGS@,$CFLAGS,;t t -s, at ac_ct_CC@,$ac_ct_CC,;t t -s, at CPP@,$CPP,;t t -s, at ifGNUmake@,$ifGNUmake,;t t -s, at LEX@,$LEX,;t t -s, at LEXLIB@,$LEXLIB,;t t -s, at LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t -s, at FLEX@,$FLEX,;t t -s, at YACC@,$YACC,;t t -s, at BISON@,$BISON,;t t -s, at build@,$build,;t t -s, at build_cpu@,$build_cpu,;t t -s, at build_vendor@,$build_vendor,;t t -s, at build_os@,$build_os,;t t -s, at host@,$host,;t t -s, at host_cpu@,$host_cpu,;t t -s, at host_vendor@,$host_vendor,;t t -s, at host_os@,$host_os,;t t -s, at EGREP@,$EGREP,;t t -s, at LN_S@,$LN_S,;t t -s, at ECHO@,$ECHO,;t t -s, at AR@,$AR,;t t -s, at ac_ct_AR@,$ac_ct_AR,;t t -s, at RANLIB@,$RANLIB,;t t -s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s, at STRIP@,$STRIP,;t t -s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t -s, at CXXCPP@,$CXXCPP,;t t -s, at F77@,$F77,;t t -s, at FFLAGS@,$FFLAGS,;t t -s, at ac_ct_F77@,$ac_ct_F77,;t t -s, at LIBTOOL@,$LIBTOOL,;t t -s, at USE_F2C@,$USE_F2C,;t t -s, at F2C@,$F2C,;t t -s, at F2C_BIN@,$F2C_BIN,;t t -s, at F2C_DIR@,$F2C_DIR,;t t -s, at F2C_INC@,$F2C_INC,;t t -s, at F2C_LIB@,$F2C_LIB,;t t -s, at USE_F95@,$USE_F95,;t t -s, at F95@,$F95,;t t -s, at F95_BIN@,$F95_BIN,;t t -s, at F95_DIR@,$F95_DIR,;t t -s, at F95_INC@,$F95_INC,;t t -s, at F95_LIB@,$F95_LIB,;t t -s, at HAVE_RE_COMP@,$HAVE_RE_COMP,;t t -s, at LIBOBJS@,$LIBOBJS,;t t -s, at LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +LLVM_SRC!$LLVM_SRC$ac_delim +LLVM_OBJ!$LLVM_OBJ$ac_delim +LLVM_EXTERNALS!$LLVM_EXTERNALS$ac_delim +SPEC95_ROOT!$SPEC95_ROOT$ac_delim +USE_SPEC95!$USE_SPEC95$ac_delim +SPEC2000_ROOT!$SPEC2000_ROOT$ac_delim +USE_SPEC2000!$USE_SPEC2000$ac_delim +POVRAY_ROOT!$POVRAY_ROOT$ac_delim +USE_POVRAY!$USE_POVRAY$ac_delim +NAMD_ROOT!$NAMD_ROOT$ac_delim +USE_NAMD!$USE_NAMD$ac_delim +SWEEP3D_ROOT!$SWEEP3D_ROOT$ac_delim +USE_SWEEP3D!$USE_SWEEP3D$ac_delim +FPGROWTH_ROOT!$FPGROWTH_ROOT$ac_delim +USE_FPGROWTH!$USE_FPGROWTH$ac_delim +ALP_ROOT!$ALP_ROOT$ac_delim +USE_ALP!$USE_ALP$ac_delim +NURBS_ROOT!$NURBS_ROOT$ac_delim +USE_NURBS!$USE_NURBS$ac_delim +DISABLE_LLC_DIFFS!$DISABLE_LLC_DIFFS$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +CPP!$CPP$ac_delim +ifGNUmake!$ifGNUmake$ac_delim +LEX!$LEX$ac_delim +LEXLIB!$LEXLIB$ac_delim +LEX_OUTPUT_ROOT!$LEX_OUTPUT_ROOT$ac_delim +FLEX!$FLEX$ac_delim +YACC!$YACC$ac_delim +YFLAGS!$YFLAGS$ac_delim +BISON!$BISON$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LN_S!$LN_S$ac_delim +ECHO!$ECHO$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +STRIP!$STRIP$ac_delim +CXXCPP!$CXXCPP$ac_delim +F77!$F77$ac_delim +FFLAGS!$FFLAGS$ac_delim +ac_ct_F77!$ac_ct_F77$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +USE_F2C!$USE_F2C$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +F2C!$F2C$ac_delim +F2C_BIN!$F2C_BIN$ac_delim +F2C_DIR!$F2C_DIR$ac_delim +F2C_INC!$F2C_INC$ac_delim +F2C_LIB!$F2C_LIB$ac_delim +USE_F95!$USE_F95$ac_delim +F95!$F95$ac_delim +F95_BIN!$F95_BIN$ac_delim +F95_DIR!$F95_DIR$ac_delim +F95_INC!$F95_INC$ac_delim +F95_LIB!$F95_LIB$ac_delim +HAVE_RE_COMP!$HAVE_RE_COMP$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 14; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -21085,211 +21912,111 @@ cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s, at configure_input@,$configure_input,;t t -s, at srcdir@,$ac_srcdir,;t t -s, at abs_srcdir@,$ac_abs_srcdir,;t t -s, at top_srcdir@,$ac_top_srcdir,;t t -s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s, at builddir@,$ac_builddir,;t t -s, at abs_builddir@,$ac_abs_builddir,;t t -s, at top_builddir@,$ac_top_builddir,;t t -s, at abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` + case $ac_file$ac_mode in + "Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile Makefile ;; - Makefile.common ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.common` + "Makefile.common":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.common` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile.common Makefile.common ;; - Makefile.f2c ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.f2c` + "Makefile.f2c":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.f2c` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile.f2c Makefile.f2c ;; - Makefile.programs ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.programs` + "Makefile.programs":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.programs` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile.programs Makefile.programs ;; - Makefile.tests ) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.tests` + "Makefile.tests":C) ${llvm_src}/autoconf/mkinstalldirs `dirname Makefile.tests` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/Makefile.tests Makefile.tests ;; - TEST.aa.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.aa.Makefile` + "TEST.aa.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.aa.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.aa.Makefile TEST.aa.Makefile ;; - TEST.dsgraph.report ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.dsgraph.report` + "TEST.dsgraph.report":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.dsgraph.report` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.dsgraph.report TEST.dsgraph.report ;; - TEST.aa.report ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.aa.report` + "TEST.aa.report":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.aa.report` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.aa.report TEST.aa.report ;; - TEST.example.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.example.Makefile` + "TEST.example.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.example.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.example.Makefile TEST.example.Makefile ;; - TEST.nightly.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.nightly.Makefile` + "TEST.nightly.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.nightly.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.nightly.Makefile TEST.nightly.Makefile ;; - TEST.buildrepo.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.buildrepo.Makefile` + "TEST.buildrepo.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.buildrepo.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.buildrepo.Makefile TEST.buildrepo.Makefile ;; - TEST.jit.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.jit.Makefile` + "TEST.jit.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.jit.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.jit.Makefile TEST.jit.Makefile ;; - TEST.nightly.report ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.nightly.report` + "TEST.nightly.report":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.nightly.report` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.nightly.report TEST.nightly.report ;; - TEST.dsgraph.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.dsgraph.Makefile` + "TEST.dsgraph.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.dsgraph.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.dsgraph.Makefile TEST.dsgraph.Makefile ;; - TEST.jit.report ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.jit.report` + "TEST.jit.report":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.jit.report` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.jit.report TEST.jit.report ;; - TEST.typesafe.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.typesafe.Makefile` + "TEST.typesafe.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.typesafe.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.typesafe.Makefile TEST.typesafe.Makefile ;; - TEST.dsgraph.gnuplot ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.dsgraph.gnuplot` + "TEST.dsgraph.gnuplot":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.dsgraph.gnuplot` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.dsgraph.gnuplot TEST.dsgraph.gnuplot ;; - TEST.vtl.Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.vtl.Makefile` + "TEST.vtl.Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname TEST.vtl.Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/TEST.vtl.Makefile TEST.vtl.Makefile ;; - External/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/Makefile` + "External/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/Makefile External/Makefile ;; - External/Makefile.external ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/Makefile.external` + "External/Makefile.external":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/Makefile.external` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/Makefile.external External/Makefile.external ;; - External/Povray/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/Povray/Makefile` + "External/Povray/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/Povray/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/Povray/Makefile External/Povray/Makefile ;; - External/SPEC/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile` + "External/SPEC/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/Makefile External/SPEC/Makefile ;; - External/SPEC/Makefile.spec ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile.spec` + "External/SPEC/Makefile.spec":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile.spec` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/Makefile.spec External/SPEC/Makefile.spec ;; - External/SPEC/Makefile.spec2000 ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile.spec2000` + "External/SPEC/Makefile.spec2000":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile.spec2000` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/Makefile.spec2000 External/SPEC/Makefile.spec2000 ;; - External/SPEC/Makefile.spec95 ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile.spec95` + "External/SPEC/Makefile.spec95":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/Makefile.spec95` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/Makefile.spec95 External/SPEC/Makefile.spec95 ;; - External/SPEC/CFP2000/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CFP2000/Makefile` + "External/SPEC/CFP2000/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CFP2000/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/CFP2000/Makefile External/SPEC/CFP2000/Makefile ;; - External/SPEC/CINT2000/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CINT2000/Makefile` + "External/SPEC/CINT2000/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CINT2000/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/CINT2000/Makefile External/SPEC/CINT2000/Makefile ;; - External/SPEC/CFP95/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CFP95/Makefile` + "External/SPEC/CFP95/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CFP95/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/CFP95/Makefile External/SPEC/CFP95/Makefile ;; - External/SPEC/CINT95/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CINT95/Makefile` + "External/SPEC/CINT95/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname External/SPEC/CINT95/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/External/SPEC/CINT95/Makefile External/SPEC/CINT95/Makefile ;; - MultiSource/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname MultiSource/Makefile` + "MultiSource/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname MultiSource/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/MultiSource/Makefile MultiSource/Makefile ;; - MultiSource/Makefile.multisrc ) ${llvm_src}/autoconf/mkinstalldirs `dirname MultiSource/Makefile.multisrc` + "MultiSource/Makefile.multisrc":C) ${llvm_src}/autoconf/mkinstalldirs `dirname MultiSource/Makefile.multisrc` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/MultiSource/Makefile.multisrc MultiSource/Makefile.multisrc ;; - SingleSource/Makefile ) ${llvm_src}/autoconf/mkinstalldirs `dirname SingleSource/Makefile` + "SingleSource/Makefile":C) ${llvm_src}/autoconf/mkinstalldirs `dirname SingleSource/Makefile` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/SingleSource/Makefile SingleSource/Makefile ;; - SingleSource/Makefile.singlesrc ) ${llvm_src}/autoconf/mkinstalldirs `dirname SingleSource/Makefile.singlesrc` + "SingleSource/Makefile.singlesrc":C) ${llvm_src}/autoconf/mkinstalldirs `dirname SingleSource/Makefile.singlesrc` ${SHELL} ${llvm_src}/autoconf/install-sh -c ${srcdir}/SingleSource/Makefile.singlesrc SingleSource/Makefile.singlesrc ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF From reid at x10sys.com Mon Aug 14 18:15:18 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 18:15:18 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/m4/find_std_program.m4 Message-ID: <200608142315.k7ENFIkA030456@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: find_std_program.m4 updated: 1.3 -> 1.4 --- Log message: For PR876: http://llvm.org/PR876 : Fix problem noticed by Kenneth Hoste. The wrong name for a variable was being set and subsequently uses of the correct name were empty. --- Diffs of the changes: (+1 -1) find_std_program.m4 | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/autoconf/m4/find_std_program.m4 diff -u llvm/autoconf/m4/find_std_program.m4:1.3 llvm/autoconf/m4/find_std_program.m4:1.4 --- llvm/autoconf/m4/find_std_program.m4:1.3 Mon Jul 25 15:25:08 2005 +++ llvm/autoconf/m4/find_std_program.m4 Mon Aug 14 18:15:03 2006 @@ -51,7 +51,7 @@ eval pfxval=\$\{$1pfxdir\} eval binval=\$\{$1bindir\} eval incval=\$\{$1incdir\} -eval libvar=\$\{$1libdir\} +eval libval=\$\{$1libdir\} if test "${pfxval}" != "nada" ; then CHECK_STD_PROGRAM(${pfxval},$1,$2,$3) elif test "${binval}" != "nada" ; then From reid at x10sys.com Mon Aug 14 18:20:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 18:20:11 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/m4/find_std_program.m4 Message-ID: <200608142320.k7ENKBP6003147@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: find_std_program.m4 updated: 1.4 -> 1.5 --- Log message: For PR876: http://llvm.org/PR876 : Fix problem setting the USE_{program} variable. It should be set to a Makefile variable definition line, not just "1". Problem noted by Kenneth Hoste. --- Diffs of the changes: (+1 -1) find_std_program.m4 | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/autoconf/m4/find_std_program.m4 diff -u llvm/autoconf/m4/find_std_program.m4:1.4 llvm/autoconf/m4/find_std_program.m4:1.5 --- llvm/autoconf/m4/find_std_program.m4:1.4 Mon Aug 14 18:15:03 2006 +++ llvm/autoconf/m4/find_std_program.m4 Mon Aug 14 18:19:57 2006 @@ -64,7 +64,7 @@ AC_SUBST(allcapsname()[_BIN],${binval}) AC_SUBST(allcapsname()[_INC],${incval}) AC_SUBST(allcapsname()[_LIB],${libval}) - AC_SUBST([USE_]allcapsname(),[1]) + AC_SUBST([USE_]allcapsname(),["USE_]allcapsname()[ = 1"]) AC_MSG_RESULT([found via --with options]) else AC_MSG_RESULT([failed]) From reid at x10sys.com Mon Aug 14 18:24:05 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 18:24:05 -0500 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200608142324.k7ENO5x8006340@zion.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.34 -> 1.35 --- Log message: For PR876: http://llvm.org/PR876 : Update of the configure script to incorporate changes from llvm/autoconf/m4 --- Diffs of the changes: (+4 -4) configure | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) Index: llvm-test/configure diff -u llvm-test/configure:1.34 llvm-test/configure:1.35 --- llvm-test/configure:1.34 Mon Aug 14 18:10:48 2006 +++ llvm-test/configure Mon Aug 14 18:23:48 2006 @@ -19851,7 +19851,7 @@ eval pfxval=\$\{f2cpfxdir\} eval binval=\$\{f2cbindir\} eval incval=\$\{f2cincdir\} -eval libvar=\$\{f2clibdir\} +eval libval=\$\{f2clibdir\} if test "${pfxval}" != "nada" ; then if test -n "${pfxval}" -a -d "${pfxval}" -a -n "f2c" -a -d "${pfxval}/bin" -a -x "${pfxval}/bin/f2c" ; then @@ -19887,7 +19887,7 @@ F2C_LIB=${libval} - USE_F2C=1 + USE_F2C="USE_F2C = 1" { echo "$as_me:$LINENO: result: found via --with options" >&5 echo "${ECHO_T}found via --with options" >&6; } @@ -20111,7 +20111,7 @@ eval pfxval=\$\{f95pfxdir\} eval binval=\$\{f95bindir\} eval incval=\$\{f95incdir\} -eval libvar=\$\{f95libdir\} +eval libval=\$\{f95libdir\} if test "${pfxval}" != "nada" ; then if test -n "${pfxval}" -a -d "${pfxval}" -a -n "f95" -a -d "${pfxval}/bin" -a -x "${pfxval}/bin/f95" ; then @@ -20147,7 +20147,7 @@ F95_LIB=${libval} - USE_F95=1 + USE_F95="USE_F95 = 1" { echo "$as_me:$LINENO: result: found via --with options" >&5 echo "${ECHO_T}found via --with options" >&6; } From dpatel at apple.com Mon Aug 14 18:27:51 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 18:27:51 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/LinkTimeOptimizer.h Message-ID: <200608142327.k7ENRpfT008503@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: LinkTimeOptimizer.h updated: 1.3 -> 1.4 --- Log message: Avoid extra string copy. --- Diffs of the changes: (+3 -2) LinkTimeOptimizer.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/include/llvm/LinkTimeOptimizer.h diff -u llvm/include/llvm/LinkTimeOptimizer.h:1.3 llvm/include/llvm/LinkTimeOptimizer.h:1.4 --- llvm/include/llvm/LinkTimeOptimizer.h:1.3 Mon Aug 14 17:36:16 2006 +++ llvm/include/llvm/LinkTimeOptimizer.h Mon Aug 14 18:27:36 2006 @@ -55,8 +55,9 @@ LTOLinkageTypes getLinkage() const { return linkage; } void mayBeNotUsed(); - LLVMSymbol (enum LTOLinkageTypes lt, GlobalValue *g, std::string n, - std::string m) : linkage(lt), gv(g), name(n), mangledName(m) {} + LLVMSymbol (enum LTOLinkageTypes lt, GlobalValue *g, const std::string &n, + const std::string &m) : linkage(lt), gv(g), name(n), + mangledName(m) {} const char *getName() { return name.c_str(); } const char *getMangledName() { return mangledName.c_str(); } From lattner at cs.uiuc.edu Mon Aug 14 18:32:07 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 18:32:07 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200608142332.k7ENW7Sh009392@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.328 -> 1.329 --- Log message: Add a new getNode() method that takes a pointer to an already-intern'd list of value-type nodes. This avoids having to do mallocs for std::vectors of valuetypes when a node returns more than one type. --- Diffs of the changes: (+70 -78) SelectionDAG.cpp | 148 ++++++++++++++++++++++++++----------------------------- 1 files changed, 70 insertions(+), 78 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.328 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.329 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.328 Mon Aug 14 17:24:39 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Aug 14 18:31:51 2006 @@ -1454,30 +1454,26 @@ SDOperand SV) { SDOperand Ops[] = { Chain, Ptr, SV, getConstant(Count, MVT::i32), getValueType(EVT) }; - std::vector VTs; - VTs.reserve(2); - VTs.push_back(MVT::Vector); VTs.push_back(MVT::Other); // Add token chain. - return getNode(ISD::VLOAD, VTs, Ops, 5); + // Add token chain. + MVT::ValueType *VTs = getNodeValueTypes(MVT::Vector, MVT::Other); + return getNode(ISD::VLOAD, VTs, 2, Ops, 5); } SDOperand SelectionDAG::getExtLoad(unsigned Opcode, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV, MVT::ValueType EVT) { SDOperand Ops[] = { Chain, Ptr, SV, getValueType(EVT) }; - std::vector VTs; - VTs.reserve(2); - VTs.push_back(VT); VTs.push_back(MVT::Other); // Add token chain. - return getNode(Opcode, VTs, Ops, 4); + MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); + return getNode(Opcode, VTs, 2, Ops, 4); } SDOperand SelectionDAG::getVAArg(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV) { SDOperand Ops[] = { Chain, Ptr, SV }; - std::vector VTs; - VTs.reserve(2); - VTs.push_back(VT); VTs.push_back(MVT::Other); // Add token chain. - return getNode(ISD::VAARG, VTs, Ops, 3); + // Add token chain. + MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); + return getNode(ISD::VAARG, VTs, 2, Ops, 3); } SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, @@ -1552,29 +1548,36 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, std::vector &ResultTys, const SDOperand *Ops, unsigned NumOps) { - if (ResultTys.size() == 1) - return getNode(Opcode, ResultTys[0], Ops, NumOps); + return getNode(Opcode, getNodeValueTypes(ResultTys), ResultTys.size(), + Ops, NumOps); +} + +SDOperand SelectionDAG::getNode(unsigned Opcode, + const MVT::ValueType *VTs, unsigned NumVTs, + const SDOperand *Ops, unsigned NumOps) { + if (NumVTs == 1) + return getNode(Opcode, VTs[0], Ops, NumOps); switch (Opcode) { case ISD::EXTLOAD: case ISD::SEXTLOAD: case ISD::ZEXTLOAD: { MVT::ValueType EVT = cast(Ops[3])->getVT(); - assert(NumOps == 4 && ResultTys.size() == 2 && "Bad *EXTLOAD!"); + assert(NumOps == 4 && NumVTs == 2 && "Bad *EXTLOAD!"); // If they are asking for an extending load from/to the same thing, return a // normal load. - if (ResultTys[0] == EVT) - return getLoad(ResultTys[0], Ops[0], Ops[1], Ops[2]); - if (MVT::isVector(ResultTys[0])) { - assert(EVT == MVT::getVectorBaseType(ResultTys[0]) && + if (VTs[0] == EVT) + return getLoad(VTs[0], Ops[0], Ops[1], Ops[2]); + if (MVT::isVector(VTs[0])) { + assert(EVT == MVT::getVectorBaseType(VTs[0]) && "Invalid vector extload!"); } else { - assert(EVT < ResultTys[0] && + assert(EVT < VTs[0] && "Should only be an extending load, not truncating!"); } - assert((Opcode == ISD::EXTLOAD || MVT::isInteger(ResultTys[0])) && + assert((Opcode == ISD::EXTLOAD || MVT::isInteger(VTs[0])) && "Cannot sign/zero extend a FP/Vector load!"); - assert(MVT::isInteger(ResultTys[0]) == MVT::isInteger(EVT) && + assert(MVT::isInteger(VTs[0]) == MVT::isInteger(EVT) && "Cannot convert from FP to Int or Int -> FP!"); break; } @@ -1603,8 +1606,7 @@ // Memoize the node unless it returns a flag. SDNode *N; - MVT::ValueType *VTs = getNodeValueTypes(ResultTys); - if (ResultTys.back() != MVT::Flag) { + if (VTs[NumVTs-1] != MVT::Flag) { SelectionDAGCSEMap::NodeID ID; ID.SetOpcode(Opcode); ID.SetValueTypes(VTs); @@ -1613,11 +1615,11 @@ if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); N = new SDNode(Opcode, Ops, NumOps); - N->setValueTypes(VTs, ResultTys.size()); + N->setValueTypes(VTs, NumVTs); CSEMap.InsertNode(N, IP); } else { N = new SDNode(Opcode, Ops, NumOps); - N->setValueTypes(VTs, ResultTys.size()); + N->setValueTypes(VTs, NumVTs); } AllNodes.push_back(N); return SDOperand(N, 0); @@ -1661,6 +1663,24 @@ return &(*VTList.begin())[0]; } +MVT::ValueType *SelectionDAG::getNodeValueTypes(MVT::ValueType VT1, + MVT::ValueType VT2, + MVT::ValueType VT3) { + for (std::list >::iterator I = VTList.begin(), + E = VTList.end(); I != E; ++I) { + if (I->size() == 3 && (*I)[0] == VT1 && (*I)[1] == VT2 && + (*I)[2] == VT3) + return &(*I)[0]; + } + std::vector V; + V.push_back(VT1); + V.push_back(VT2); + V.push_back(VT3); + VTList.push_front(V); + return &(*VTList.begin())[0]; +} + + /// UpdateNodeOperands - *Mutate* the specified node in-place to have the /// specified operands. If the resultant node already exists in the DAG, /// this does not modify the specified node, instead it returns the node that @@ -2151,123 +2171,95 @@ } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, &Op1, 1).Val; + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, &Op1, 1).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 2).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 2).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 3).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 3).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 4).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 4).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 5).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 5).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 6).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 6).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 7).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 7).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); - ResultTys.push_back(VT3); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 2).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); - ResultTys.push_back(VT3); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 5).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 5).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); - ResultTys.push_back(VT3); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 6).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 6).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); - ResultTys.push_back(VT3); + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 }; - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, 7).Val; + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 7).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, const SDOperand *Ops, unsigned NumOps) { - std::vector ResultTys; - ResultTys.push_back(VT1); - ResultTys.push_back(VT2); - return getNode(ISD::BUILTIN_OP_END+Opcode, ResultTys, Ops, NumOps).Val; + MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val; } /// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead. From lattner at cs.uiuc.edu Mon Aug 14 18:32:07 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 18:32:07 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h Message-ID: <200608142332.k7ENW7P5009390@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.119 -> 1.120 SelectionDAGNodes.h updated: 1.140 -> 1.141 --- Log message: Add a new getNode() method that takes a pointer to an already-intern'd list of value-type nodes. This avoids having to do mallocs for std::vectors of valuetypes when a node returns more than one type. --- Diffs of the changes: (+18 -25) SelectionDAG.h | 39 ++++++++++++++++----------------------- SelectionDAGNodes.h | 4 ++-- 2 files changed, 18 insertions(+), 25 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.119 llvm/include/llvm/CodeGen/SelectionDAG.h:1.120 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.119 Mon Aug 14 17:24:39 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Mon Aug 14 18:31:51 2006 @@ -155,29 +155,23 @@ // null) and that there should be a flag result. SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N, SDOperand Flag) { - std::vector VTs; - VTs.push_back(MVT::Other); - VTs.push_back(MVT::Flag); + const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag }; - return getNode(ISD::CopyToReg, VTs, Ops, Flag.Val ? 4 : 3); + return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3); } // Similar to last getCopyToReg() except parameter Reg is a SDOperand SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N, SDOperand Flag) { - std::vector VTs; - VTs.push_back(MVT::Other); - VTs.push_back(MVT::Flag); + const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, Reg, N, Flag }; - return getNode(ISD::CopyToReg, VTs, Ops, Flag.Val ? 4 : 3); + return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3); } SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) { - std::vector ResultTys; - ResultTys.push_back(VT); - ResultTys.push_back(MVT::Other); + const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); SDOperand Ops[] = { Chain, getRegister(Reg, VT) }; - return getNode(ISD::CopyFromReg, ResultTys, Ops, 2); + return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2); } // This version of the getCopyFromReg method takes an extra operand, which @@ -185,12 +179,9 @@ // null) and that there should be a flag result. SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT, SDOperand Flag) { - std::vector ResultTys; - ResultTys.push_back(VT); - ResultTys.push_back(MVT::Other); - ResultTys.push_back(MVT::Flag); + const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag }; - return getNode(ISD::CopyFromReg, ResultTys, Ops, Flag.Val ? 3 : 2); + return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.Val ? 3 : 2); } SDOperand getCondCode(ISD::CondCode Cond); @@ -202,11 +193,9 @@ /// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have /// a flag result (to ensure it's not CSE'd). SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) { - std::vector ResultTys; - ResultTys.push_back(MVT::Other); - ResultTys.push_back(MVT::Flag); + const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag); SDOperand Ops[] = { Chain, Op }; - return getNode(ISD::CALLSEQ_START, ResultTys, Ops, 2); + return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2); } /// getNode - Gets or creates the specified node. @@ -226,6 +215,8 @@ const SDOperand *Ops, unsigned NumOps); SDOperand getNode(unsigned Opcode, std::vector &ResultTys, const SDOperand *Ops, unsigned NumOps); + SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs, + const SDOperand *Ops, unsigned NumOps); /// getSetCC - Helper function to make it easier to build SetCC's if you just /// have an ISD::CondCode instead of an SDOperand. @@ -240,8 +231,8 @@ /// SDOperand getSelectCC(SDOperand LHS, SDOperand RHS, SDOperand True, SDOperand False, ISD::CondCode Cond) { - MVT::ValueType VT = True.getValueType(); - return getNode(ISD::SELECT_CC, VT, LHS, RHS, True, False,getCondCode(Cond)); + return getNode(ISD::SELECT_CC, True.getValueType(), LHS, RHS, True, False, + getCondCode(Cond)); } /// getVAArg - VAArg produces a result and token chain, and takes a pointer @@ -443,6 +434,8 @@ void DeleteNodeNotInCSEMaps(SDNode *N); MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1); MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2); + MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2, + MVT::ValueType VT3); MVT::ValueType *getNodeValueTypes(std::vector &RetVals); Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.140 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.141 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.140 Mon Aug 14 17:19:25 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon Aug 14 18:31:51 2006 @@ -697,7 +697,7 @@ /// ValueList - The types of the values this node defines. SDNode's may /// define multiple values simultaneously. - MVT::ValueType *ValueList; + const MVT::ValueType *ValueList; /// NumOperands/NumValues - The number of entries in the Operand/Value list. unsigned short NumOperands, NumValues; @@ -899,7 +899,7 @@ NumOperands = 0; } - void setValueTypes(MVT::ValueType *List, unsigned NumVal) { + void setValueTypes(const MVT::ValueType *List, unsigned NumVal) { assert(NumValues == 0 && "Should not have values yet!"); ValueList = List; NumValues = NumVal; From dpatel at apple.com Mon Aug 14 18:37:33 2006 From: dpatel at apple.com (Devang Patel) Date: Mon, 14 Aug 2006 18:37:33 -0500 Subject: [llvm-commits] CVS: llvm/tools/lto/lto.cpp Message-ID: <200608142337.k7ENbXUm010148@zion.cs.uiuc.edu> Changes in directory llvm/tools/lto: lto.cpp updated: 1.4 -> 1.5 --- Log message: untabify --- Diffs of the changes: (+15 -15) lto.cpp | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) Index: llvm/tools/lto/lto.cpp diff -u llvm/tools/lto/lto.cpp:1.4 llvm/tools/lto/lto.cpp:1.5 --- llvm/tools/lto/lto.cpp:1.4 Mon Aug 14 17:36:16 2006 +++ llvm/tools/lto/lto.cpp Mon Aug 14 18:37:18 2006 @@ -86,7 +86,7 @@ // Find exeternal symbols referenced by VALUE. This is a recursive function. static void findExternalRefs(Value *value, std::set &references, - Mangler &mangler) { + Mangler &mangler) { if (GlobalValue *gv = dyn_cast(value)) { LTOLinkageTypes lt = getLTOLinkageType(gv); @@ -105,8 +105,8 @@ /// Return LTO_READ_SUCCESS if there is no error. enum LTOStatus LinkTimeOptimizer::readLLVMObjectFile(const std::string &InputFilename, - NameToSymbolMap &symbols, - std::set &references) + NameToSymbolMap &symbols, + std::set &references) { Module *m = ParseBytecodeFile(InputFilename); if (!m) @@ -123,9 +123,9 @@ LTOLinkageTypes lt = getLTOLinkageType(f); if (!f->isExternal() && lt != LTOInternalLinkage - && strncmp (f->getName().c_str(), "llvm.", 5)) { + && strncmp (f->getName().c_str(), "llvm.", 5)) { LLVMSymbol *newSymbol = new LLVMSymbol(lt, f, f->getName(), - mangler.getValueName(f)); + mangler.getValueName(f)); symbols[newSymbol->getMangledName()] = newSymbol; allSymbols[newSymbol->getMangledName()] = newSymbol; } @@ -133,24 +133,24 @@ // Collect external symbols referenced by this function. for (Function::iterator b = f->begin(), fe = f->end(); b != fe; ++b) for (BasicBlock::iterator i = b->begin(), be = b->end(); - i != be; ++i) - for (unsigned count = 0, total = i->getNumOperands(); - count != total; ++count) - findExternalRefs(i->getOperand(count), references, mangler); + i != be; ++i) + for (unsigned count = 0, total = i->getNumOperands(); + count != total; ++count) + findExternalRefs(i->getOperand(count), references, mangler); } for (Module::global_iterator v = m->global_begin(), e = m->global_end(); v != e; ++v) { LTOLinkageTypes lt = getLTOLinkageType(v); if (!v->isExternal() && lt != LTOInternalLinkage - && strncmp (v->getName().c_str(), "llvm.", 5)) { + && strncmp (v->getName().c_str(), "llvm.", 5)) { LLVMSymbol *newSymbol = new LLVMSymbol(lt, v, v->getName(), - mangler.getValueName(v)); + mangler.getValueName(v)); symbols[newSymbol->getMangledName()] = newSymbol; for (unsigned count = 0, total = v->getNumOperands(); - count != total; ++count) - findExternalRefs(v->getOperand(count), references, mangler); + count != total; ++count) + findExternalRefs(v->getOperand(count), references, mangler); } } @@ -163,7 +163,7 @@ /// based on information available to module M. No new target /// features are selected. static enum LTOStatus lto_optimize(Module *M, std::ostream &Out, - std::vector &exportList) + std::vector &exportList) { // Instantiate the pass manager to organize the passes. PassManager Passes; @@ -266,7 +266,7 @@ /// Return appropriate LTOStatus. enum LTOStatus LinkTimeOptimizer::optimizeModules(const std::string &OutputFilename, - std::vector &exportList) + std::vector &exportList) { if (modules.empty()) return LTO_NO_WORK; From lattner at cs.uiuc.edu Mon Aug 14 18:53:50 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 18:53:50 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp LegalizeDAG.cpp Message-ID: <200608142353.k7ENrokj013028@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.268 -> 1.269 LegalizeDAG.cpp updated: 1.386 -> 1.387 --- Log message: eliminate use of getNode that takes vector of valuetypes. --- Diffs of the changes: (+30 -30) LegalizeDAG.cpp | 17 ++++++++--------- SelectionDAGISel.cpp | 43 ++++++++++++++++++++++--------------------- 2 files changed, 30 insertions(+), 30 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.268 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.269 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.268 Mon Aug 7 21:23:41 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Aug 14 18:53:35 2006 @@ -1346,11 +1346,10 @@ getIntPtrConstant(~(uint64_t)(StackAlign-1))); } - std::vector VTs; - VTs.push_back(AllocSize.getValueType()); - VTs.push_back(MVT::Other); SDOperand Ops[] = { getRoot(), AllocSize, getIntPtrConstant(Align) }; - SDOperand DSA = DAG.getNode(ISD::DYNAMIC_STACKALLOC, VTs, Ops, 3); + const MVT::ValueType *VTs = DAG.getNodeValueTypes(AllocSize.getValueType(), + MVT::Other); + SDOperand DSA = DAG.getNode(ISD::DYNAMIC_STACKALLOC, VTs, 2, Ops, 3); DAG.setRoot(setValue(&I, DSA).getValue(1)); // Inform the Frame Information that we have just allocated a variable-sized @@ -1476,14 +1475,19 @@ if (HasChain) VTs.push_back(MVT::Other); + const MVT::ValueType *VTList = DAG.getNodeValueTypes(VTs); + // Create the node. SDOperand Result; if (!HasChain) - Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, VTs, &Ops[0], Ops.size()); + Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, VTList, VTs.size(), + &Ops[0], Ops.size()); else if (I.getType() != Type::VoidTy) - Result = DAG.getNode(ISD::INTRINSIC_W_CHAIN, VTs, &Ops[0], Ops.size()); + Result = DAG.getNode(ISD::INTRINSIC_W_CHAIN, VTList, VTs.size(), + &Ops[0], Ops.size()); else - Result = DAG.getNode(ISD::INTRINSIC_VOID, VTs, &Ops[0], Ops.size()); + Result = DAG.getNode(ISD::INTRINSIC_VOID, VTList, VTs.size(), + &Ops[0], Ops.size()); if (HasChain) { SDOperand Chain = Result.getValue(Result.Val->getNumValues()-1); @@ -1623,11 +1627,10 @@ return 0; } case Intrinsic::readcyclecounter: { - std::vector VTs; - VTs.push_back(MVT::i64); - VTs.push_back(MVT::Other); SDOperand Op = getRoot(); - SDOperand Tmp = DAG.getNode(ISD::READCYCLECOUNTER, VTs, &Op, 1); + SDOperand Tmp = DAG.getNode(ISD::READCYCLECOUNTER, + DAG.getNodeValueTypes(MVT::i64, MVT::Other), 2, + &Op, 1); setValue(&I, Tmp); DAG.setRoot(Tmp.getValue(1)); return 0; @@ -1664,11 +1667,9 @@ getValue(I.getOperand(1)))); return 0; case Intrinsic::stacksave: { - std::vector VTs; - VTs.push_back(TLI.getPointerTy()); - VTs.push_back(MVT::Other); SDOperand Op = getRoot(); - SDOperand Tmp = DAG.getNode(ISD::STACKSAVE, VTs, &Op, 1); + SDOperand Tmp = DAG.getNode(ISD::STACKSAVE, + DAG.getNodeValueTypes(TLI.getPointerTy(), MVT::Other), 2, &Op, 1); setValue(&I, Tmp); DAG.setRoot(Tmp.getValue(1)); return 0; @@ -2256,10 +2257,8 @@ AsmNodeOperands[0] = Chain; if (Flag.Val) AsmNodeOperands.push_back(Flag); - std::vector VTs; - VTs.push_back(MVT::Other); - VTs.push_back(MVT::Flag); - Chain = DAG.getNode(ISD::INLINEASM, VTs, + Chain = DAG.getNode(ISD::INLINEASM, + DAG.getNodeValueTypes(MVT::Other, MVT::Flag), 2, &AsmNodeOperands[0], AsmNodeOperands.size()); Flag = Chain.getValue(1); @@ -2428,7 +2427,8 @@ RetVals.push_back(MVT::Other); // Create the node. - SDNode *Result = DAG.getNode(ISD::FORMAL_ARGUMENTS, RetVals, + SDNode *Result = DAG.getNode(ISD::FORMAL_ARGUMENTS, + DAG.getNodeValueTypes(RetVals), RetVals.size(), &Ops[0], Ops.size()).Val; DAG.setRoot(SDOperand(Result, Result->getNumValues()-1)); @@ -2636,7 +2636,8 @@ RetTys.push_back(MVT::Other); // Always has a chain. // Finally, create the CALL node. - SDOperand Res = DAG.getNode(ISD::CALL, RetTys, &Ops[0], Ops.size()); + SDOperand Res = DAG.getNode(ISD::CALL, DAG.getNodeValueTypes(RetTys), + RetTys.size(), &Ops[0], Ops.size()); // This returns a pair of operands. The first element is the // return value for the function (if RetTy is not VoidTy). The second Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.386 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.387 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.386 Mon Aug 7 21:23:41 2006 +++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Aug 14 18:53:35 2006 @@ -3665,8 +3665,8 @@ ExpandOp(Op, LHSL, LHSH); SDOperand Ops[] = { LHSL, LHSH, Amt }; - std::vector VTs(2, LHSL.getValueType()); - Lo = DAG.getNode(NodeOp, VTs, Ops, 3); + MVT::ValueType VT = LHSL.getValueType(); + Lo = DAG.getNode(NodeOp, DAG.getNodeValueTypes(VT, VT), 2, Ops, 3); Hi = Lo.getValue(1); } @@ -4636,22 +4636,21 @@ SDOperand LHSL, LHSH, RHSL, RHSH; ExpandOp(Node->getOperand(0), LHSL, LHSH); ExpandOp(Node->getOperand(1), RHSL, RHSH); - std::vector VTs; + const MVT::ValueType *VTs = + DAG.getNodeValueTypes(LHSL.getValueType(),MVT::Flag); SDOperand LoOps[2], HiOps[2]; - VTs.push_back(LHSL.getValueType()); - VTs.push_back(MVT::Flag); LoOps[0] = LHSL; LoOps[1] = RHSL; HiOps[0] = LHSH; HiOps[1] = RHSH; if (Node->getOpcode() == ISD::ADD) { - Lo = DAG.getNode(ISD::ADDC, VTs, LoOps, 2); + Lo = DAG.getNode(ISD::ADDC, VTs, 2, LoOps, 2); HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::ADDE, VTs, HiOps, 3); + Hi = DAG.getNode(ISD::ADDE, VTs, 2, HiOps, 3); } else { - Lo = DAG.getNode(ISD::SUBC, VTs, LoOps, 2); + Lo = DAG.getNode(ISD::SUBC, VTs, 2, LoOps, 2); HiOps[2] = Lo.getValue(1); - Hi = DAG.getNode(ISD::SUBE, VTs, HiOps, 3); + Hi = DAG.getNode(ISD::SUBE, VTs, 2, HiOps, 3); } break; } From lattner at cs.uiuc.edu Mon Aug 14 18:54:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 18:54:40 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h Message-ID: <200608142354.k7ENseCb013254@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.120 -> 1.121 --- Log message: Make getNodeValueTypes methods public. --- Diffs of the changes: (+8 -6) SelectionDAG.h | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.120 llvm/include/llvm/CodeGen/SelectionDAG.h:1.121 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.120 Mon Aug 14 18:31:51 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Mon Aug 14 18:54:24 2006 @@ -422,6 +422,14 @@ void dump() const; + /// getNodeValueTypes - Return a pointer to an intern'd representation of the + /// specified valuetype list. + MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1); + MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2); + MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2, + MVT::ValueType VT3); + MVT::ValueType *getNodeValueTypes(std::vector &RetVals); + private: void RemoveNodeFromCSEMaps(SDNode *N); SDNode *AddNonLeafNodeToCSEMaps(SDNode *N); @@ -432,12 +440,6 @@ void *&InsertPos); void DeleteNodeNotInCSEMaps(SDNode *N); - MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1); - MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2); - MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2, - MVT::ValueType VT3); - MVT::ValueType *getNodeValueTypes(std::vector &RetVals); - /// SimplifySetCC - Try to simplify a setcc built with the specified operands /// and cc. If unable to simplify it, return a null SDOperand. From lattner at cs.uiuc.edu Mon Aug 14 19:43:55 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 19:43:55 -0500 Subject: [llvm-commits] CVS: llvm/docs/FAQ.html Message-ID: <200608150043.k7F0htAo025725@zion.cs.uiuc.edu> Changes in directory llvm/docs: FAQ.html updated: 1.38 -> 1.39 --- Log message: Add a link in a prominant location. --- Diffs of the changes: (+11 -1) FAQ.html | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.38 llvm/docs/FAQ.html:1.39 --- llvm/docs/FAQ.html:1.38 Thu Aug 10 15:15:58 2006 +++ llvm/docs/FAQ.html Mon Aug 14 19:43:35 2006 @@ -427,6 +427,16 @@ compiler driver which simplifies the task of running optimizations, linking, and executable generation.

      + + + +
      Using the GCC Front End @@ -673,7 +683,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/10 20:15:58 $ + Last modified: $Date: 2006/08/15 00:43:35 $ From lattner at cs.uiuc.edu Mon Aug 14 19:46:13 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 14 Aug 2006 19:46:13 -0500 Subject: [llvm-commits] CVS: llvm/docs/LangRef.html Message-ID: <200608150046.k7F0kDu9026081@zion.cs.uiuc.edu> Changes in directory llvm/docs: LangRef.html updated: 1.154 -> 1.155 --- Log message: Add a link to the GEP faq. --- Diffs of the changes: (+7 -3) LangRef.html | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.154 llvm/docs/LangRef.html:1.155 --- llvm/docs/LangRef.html:1.154 Mon Jun 12 22:05:47 2006 +++ llvm/docs/LangRef.html Mon Aug 14 19:45:58 2006 @@ -101,7 +101,7 @@
    • 'vselect' Instruction
    • -
    • Memory Access Operations +
    • Memory Access and Addressing Operations
      1. 'malloc' Instruction
      2. 'free' Instruction
      3. @@ -2273,7 +2273,7 @@
        @@ -2574,6 +2574,10 @@ defined to be accessible as variable length arrays, which requires access beyond the zero'th element.

        +

        The getelementptr instruction is often confusing. For some more insight +into how it works, see the getelementptr +FAQ.

        +
        Example:
        @@ -3840,7 +3844,7 @@
         
           Chris Lattner
        The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/06/13 03:05:47 $ + Last modified: $Date: 2006/08/15 00:45:58 $ From reid at x10sys.com Mon Aug 14 22:32:24 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 22:32:24 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608150332.k7F3WO5I030501@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.3 -> 1.4 --- Log message: Rearrange things for clarity, don't talk about "dereferencing" when we shouldn't, and add a better example for one of the questions. Thanks to Chris Lattner for these suggestions. --- Diffs of the changes: (+91 -49) GetElementPtr.html | 140 ++++++++++++++++++++++++++++++++++------------------- 1 files changed, 91 insertions(+), 49 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.3 llvm/docs/GetElementPtr.html:1.4 --- llvm/docs/GetElementPtr.html:1.3 Thu Aug 10 16:38:47 2006 +++ llvm/docs/GetElementPtr.html Mon Aug 14 22:32:10 2006 @@ -56,10 +56,10 @@ this leads to the following questions, all of which are answered in the following sections.

          +
        1. What is the first index of the GEP instruction? +
        2. Why is the extra 0 index required?
        3. What is dereferenced by GEP?
        4. -
        5. Why can you index through the first pointer but not - subsequent ones?
        6. Why don't GEP x,0,0,1 and GEP x,1 alias?
        7. Why do GEP x,1,0,0 and GEP x,1 alias?
        @@ -67,6 +67,83 @@ +
        +

        Quick answer: Because its already present.

        +

        Having understood the previous question, a new + question then arises:

        +
        Why is it okay to index through the first pointer, but + subsequent pointers won't be dereferenced?
        +

        The answer is simply because memory does not have to be accessed to + perform the computation. The first operand to the GEP instruction must be a + value of a pointer type. The value of the pointer is provided directly to + the GEP instruction without any need for accessing memory. It must, + therefore be indexed like any other operand. Consider this example:

        +
        +  struct munger_struct {
        +    int f1;
        +    int f2;
        +  };
        +  void munge(struct munger_struct *P)
        +  {
        +    P[0].f1 = P[1].f1 + P[2].f2;
        +  }
        +  ...
        +  complex Array[3];
        +  ...
        +  munge(Array);
        +

        In this "C" example, the front end compiler (llvm-gcc) will generate three + GEP instructions for the three indices through "P" in the assignment + statement. The function argument P will be the first operand of each + of these GEP instructions. The second operand will be the field offset into + the struct munger_struct type, for either the f1 or + f2 field. So, in LLVM assembly the munge function looks + like:

        +
        +  void %munge(%struct.munger_struct* %P) {
        +  entry:
        +    %tmp = getelementptr %struct.munger_struct* %P, int 1, uint 0
        +    %tmp = load int* %tmp
        +    %tmp6 = getelementptr %struct.munger_struct* %P, int 2, uint 1
        +    %tmp7 = load int* %tmp6
        +    %tmp8 = add int %tmp7, %tmp
        +    %tmp9 = getelementptr %struct.munger_struct* %P, int 0, uint 0
        +    store int %tmp8, int* %tmp9
        +    ret void
        +  }
        +

        In each case the first operand is the pointer through which the GEP + instruction starts. The same is true whether the first operand is an + argument, allocated memory, or a global variable.

        +

        To make this clear, let's consider a more obtuse example:

        +
        +  %MyVar = unintialized global int
        +  ...
        +  %idx1 = getelementptr int* %MyVar, long 0
        +  %idx2 = getelementptr int* %MyVar, long 1
        +  %idx3 = getelementptr int* %MyVar, long 2
        +

        These GEP instructions are simply making address computations from the + base address of MyVar. They compute, as follows (using C syntax): +

        +
          +
        • idx1 = (char*) &MyVar + 0
        • +
        • idx2 = (char*) &MyVar + 4
        • +
        • idx3 = (char*) &MyVar + 8
        • +
        +

        Since the type int is known to be four bytes long, the indices + 0, 1 and 2 translate into memory offsets of 0, 4, and 8, respectively. No + memory is accessed to make these computations because the address of + %MyVar is passed directly to the GEP instructions.

        +

        The obtuse part of this example is in the cases of %idx2 and + %idx3. They result in the computation of addresses that point to + memory past the end of the %MyVar global, which is only one + int long, not three ints long. While this is legal in LLVM, + it is inadvisable because any load or store with the pointer that results + from these GEP instructions would produce undefined results.

        +
        + + + @@ -81,7 +158,7 @@

        The GEP above yields an int* by indexing the int typed field of the structure %MyStruct. When people first look at it, they wonder why the long 0 index is needed. However, a closer inspection - of how globals and GEPs work reveals the need. Becoming aware of the following + of how globals and GEPs work reveals the need. Becoming aware of the following facts will dispell the confusion:

        1. The type of %MyStruct is not { float*, int } @@ -91,8 +168,11 @@
        2. Point #1 is evidenced by noticing the type of the first operand of the GEP instruction (%MyStruct) which is { float*, int }*.
        3. -
        4. The first index, long 0 is required to dereference the - pointer associated with %MyStruct.
        5. +
        6. The first index, long 0 is required to step over the global + variable %MyStruct. Since the first argument to the GEP + instruction must always be a value of pointer type, the first index + steps through that pointer. A value of 0 means 0 elements offset from that + pointer.
        7. The second index, ubyte 1 selects the second field of the structure (the int).
        @@ -105,8 +185,9 @@

        Quick answer: nothing.

        The GetElementPtr instruction dereferences nothing. That is, it doesn't - access memory in any way. That's what the Load instruction is for. GEP is - only involved in the computation of addresses. For example, consider this:

        + access memory in any way. That's what the Load and Store instructions are for. + GEP is only involved in the computation of addresses. For example, consider + this:

           %MyVar = uninitialized global { [40 x int ]* }
           ...
        @@ -139,45 +220,6 @@
         
         
         
        -
        -

        Quick answer: Because its already present.

        -

        Having understood the previous question, a new - question then arises:

        -
        Why is it okay to index through the first pointer, but - subsequent pointers won't be dereferenced?
        -

        The answer is simply because - memory does not have to be accessed to perform the computation. The first - operand to the GEP instruction must be a value of a pointer type. The value - of the pointer is provided directly to the GEP instruction without any need - for accessing memory. It must, therefore be indexed like any other operand. - Consider this example:

        -
        -  %MyVar = unintialized global int
        -  ...
        -  %idx1 = getelementptr int* %MyVar, long 0
        -  %idx2 = getelementptr int* %MyVar, long 1
        -  %idx3 = getelementptr int* %MyVar, long 2
        -

        These GEP instructions are simply making address computations from the - base address of MyVar. They compute, as follows (using C syntax):

        -
          -
        • idx1 = &MyVar + 0
        • -
        • idx2 = &MyVar + 4
        • -
        • idx3 = &MyVar + 8
        • -
        -

        Since the type int is known to be four bytes long, the indices - 0, 1 and 2 translate into memory offsets of 0, 4, and 8, respectively. No - memory is accessed to make these computations because the address of - %MyVar is passed directly to the GEP instructions.

        -

        Note that the cases of %idx2 and %idx3 are a bit silly. - They are computing addresses of something of unknown type (and thus - potentially breaking type safety) because %MyVar is only one - integer long.

        -
        - - -
        @@ -187,7 +229,7 @@ computation diverges with that index. Consider this example:

           %MyVar = global { [10 x int ] }
        -  %idx1 = getlementptr { [10 x int ] }* %MyVar, long 0, byte 0, long 1
        +  %idx1 = getlementptr { [10 x int ] }* %MyVar, long 0, ubyte 0, long 1
           %idx2 = getlementptr { [10 x int ] }* %MyVar, long 1

        In this example, idx1 computes the address of the second integer in the array that is in the structure in %MyVar, that is MyVar+4. The @@ -210,7 +252,7 @@ the type. Consider this example:

           %MyVar = global { [10 x int ] }
        -  %idx1 = getlementptr { [10 x int ] }* %MyVar, long 1, byte 0, long 0
        +  %idx1 = getlementptr { [10 x int ] }* %MyVar, long 1, ubyte 0, long 0
           %idx2 = getlementptr { [10 x int ] }* %MyVar, long 1

        In this example, the value of %idx1 is %MyVar+40 and its type is int*. The value of %idx2 is also @@ -572,7 +614,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/10 21:38:47 $ + Last modified: $Date: 2006/08/15 03:32:10 $ From reid at x10sys.com Mon Aug 14 22:43:45 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 22:43:45 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608150343.k7F3hjaJ031093@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.4 -> 1.5 --- Log message: Clarify the first question. --- Diffs of the changes: (+18 -6) GetElementPtr.html | 24 ++++++++++++++++++------ 1 files changed, 18 insertions(+), 6 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.4 llvm/docs/GetElementPtr.html:1.5 --- llvm/docs/GetElementPtr.html:1.4 Mon Aug 14 22:32:10 2006 +++ llvm/docs/GetElementPtr.html Mon Aug 14 22:43:31 2006 @@ -70,9 +70,21 @@ What is the first index of the GEP instruction?

        -

        Quick answer: Because its already present.

        -

        Having understood the previous question, a new - question then arises:

        +

        Quick answer: The index stepping through the first operand.

        +

        The confusion with the first index usually arises from thinking about + the GetElementPtr instruction as if it was a C index operator. They aren't the + same. For example, when we write, in "C":

        +
        +  AType* Foo;
        +  ...
        +  X = Foo[1];
        +

        it is natural to think that there is only one index, the constant value + 1. This results from C allowing you to treat pointers and arrays as + equivalent. LLVM doesn't. In this example, Foo is a pointer. That pointer must + be indexed. To arrive at the same address location as the C code, you would + provide the GEP instruction with two indices. The first indexes through the + pointer, the second index the second element of the array.

        +

        Sometimes this question gets rephrased as:

        Why is it okay to index through the first pointer, but subsequent pointers won't be dereferenced?

        The answer is simply because memory does not have to be accessed to @@ -194,7 +206,7 @@ %idx = getelementptr { [40 x int]* }* %MyVar, long 0, ubyte 0, long 0, long 17

        In this example, we have a global variable, %MyVar that is a pointer to a structure containing a pointer to an array of 40 ints. The - GEP instruction seems to be accessing the 18th integer of of the structure's + GEP instruction seems to be accessing the 18th integer of the structure's array of ints. However, this is actually an illegal GEP instruction. It won't compile. The reason is that the pointer in the structure must be dereferenced in order to index into the array of 40 ints. Since the @@ -213,7 +225,7 @@ ... %idx = getelementptr { [40 x int] }*, long 0, ubyte 0, long 17

        then everything works fine. In this case, the structure does not contain a - pointer and the GEP instruction can index through the global variable pointer, + pointer and the GEP instruction can index through the global variable, into the first field of the structure and access the 18th int in the array there.

        @@ -614,7 +626,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/15 03:32:10 $ + Last modified: $Date: 2006/08/15 03:43:31 $ From reid at x10sys.com Mon Aug 14 22:46:52 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 22:46:52 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608150346.k7F3kqvi031228@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.5 -> 1.6 --- Log message: Fix an example. --- Diffs of the changes: (+2 -2) GetElementPtr.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.5 llvm/docs/GetElementPtr.html:1.6 --- llvm/docs/GetElementPtr.html:1.5 Mon Aug 14 22:43:31 2006 +++ llvm/docs/GetElementPtr.html Mon Aug 14 22:46:38 2006 @@ -102,7 +102,7 @@ P[0].f1 = P[1].f1 + P[2].f2; } ... - complex Array[3]; + munger_struct Array[3]; ... munge(Array);

        In this "C" example, the front end compiler (llvm-gcc) will generate three @@ -626,7 +626,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/15 03:43:31 $ + Last modified: $Date: 2006/08/15 03:46:38 $ From reid at x10sys.com Mon Aug 14 22:48:36 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 22:48:36 -0500 Subject: [llvm-commits] CVS: llvm/utils/llvmgrep Message-ID: <200608150348.k7F3ma6n031269@zion.cs.uiuc.edu> Changes in directory llvm/utils: llvmgrep updated: 1.11 -> 1.12 --- Log message: This script takes arguments so remove the check for number of arguments, just check the first arg to see if its -topdir. --- Diffs of the changes: (+5 -7) llvmgrep | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) Index: llvm/utils/llvmgrep diff -u llvm/utils/llvmgrep:1.11 llvm/utils/llvmgrep:1.12 --- llvm/utils/llvmgrep:1.11 Mon Aug 14 13:49:05 2006 +++ llvm/utils/llvmgrep Mon Aug 14 22:48:22 2006 @@ -18,13 +18,11 @@ # details. ##===----------------------------------------------------------------------===## -if test $# -gt 1 ; then - if test "$1" = "-topdir" ; then - TOPDIR="$2" - shift; shift; - else - TOPDIR=`llvm-config --src-root` - fi +if test "$1" = "-topdir" ; then + TOPDIR="$2" + shift; shift; +else + TOPDIR=`llvm-config --src-root` fi if test -d "$TOPDIR" ; then From reid at x10sys.com Mon Aug 14 22:50:24 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 22:50:24 -0500 Subject: [llvm-commits] CVS: llvm/utils/getsrcs.sh Message-ID: <200608150350.k7F3oOHT031313@zion.cs.uiuc.edu> Changes in directory llvm/utils: getsrcs.sh updated: 1.22 -> 1.23 --- Log message: Simplify this a little bit. --- Diffs of the changes: (+5 -7) getsrcs.sh | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) Index: llvm/utils/getsrcs.sh diff -u llvm/utils/getsrcs.sh:1.22 llvm/utils/getsrcs.sh:1.23 --- llvm/utils/getsrcs.sh:1.22 Mon Aug 14 13:49:05 2006 +++ llvm/utils/getsrcs.sh Mon Aug 14 22:50:10 2006 @@ -18,13 +18,11 @@ # details. ##===----------------------------------------------------------------------===## -if test $# -gt 1 ; then - if test "$1" = "-topdir" ; then - TOPDIR="$2" - shift; shift; - else - TOPDIR=`llvm-config --src-root` - fi +if test "$1" = "-topdir" ; then + TOPDIR="$2" + shift; shift; +else + TOPDIR=`llvm-config --src-root` fi if test -d "$TOPDIR" ; then From reid at x10sys.com Mon Aug 14 22:57:19 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 22:57:19 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608150357.k7F3vJ3B031463@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.6 -> 1.7 --- Log message: Some more correction to the examples, thanks to Chris Lattner. --- Diffs of the changes: (+8 -5) GetElementPtr.html | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.6 llvm/docs/GetElementPtr.html:1.7 --- llvm/docs/GetElementPtr.html:1.6 Mon Aug 14 22:46:38 2006 +++ llvm/docs/GetElementPtr.html Mon Aug 14 22:57:05 2006 @@ -77,21 +77,24 @@

           AType* Foo;
           ...
        -  X = Foo[1];
        + X = &Foo->F;

        it is natural to think that there is only one index, the constant value 1. This results from C allowing you to treat pointers and arrays as equivalent. LLVM doesn't. In this example, Foo is a pointer. That pointer must be indexed. To arrive at the same address location as the C code, you would provide the GEP instruction with two indices. The first indexes through the - pointer, the second index the second element of the array.

        + pointer, the second index the element of the structure just as if it was:

        +
        +  X = &Foo[0].F;

        Sometimes this question gets rephrased as:

        Why is it okay to index through the first pointer, but subsequent pointers won't be dereferenced?

        The answer is simply because memory does not have to be accessed to perform the computation. The first operand to the GEP instruction must be a value of a pointer type. The value of the pointer is provided directly to - the GEP instruction without any need for accessing memory. It must, - therefore be indexed like any other operand. Consider this example:

        + the GEP instruction as an operand without any need for accessing memory. It + must, therefore be indexed and requires an index operand. Consider this + example:

           struct munger_struct {
             int f1;
        @@ -626,7 +629,7 @@
           Valid HTML 4.01!
           The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/15 03:46:38 $ + Last modified: $Date: 2006/08/15 03:57:05 $ From reid at x10sys.com Mon Aug 14 23:00:43 2006 From: reid at x10sys.com (Reid Spencer) Date: Mon, 14 Aug 2006 23:00:43 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608150400.k7F40h0u031576@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.7 -> 1.8 --- Log message: Okay, make the prose match the example too. --- Diffs of the changes: (+8 -7) GetElementPtr.html | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.7 llvm/docs/GetElementPtr.html:1.8 --- llvm/docs/GetElementPtr.html:1.7 Mon Aug 14 22:57:05 2006 +++ llvm/docs/GetElementPtr.html Mon Aug 14 23:00:29 2006 @@ -78,12 +78,13 @@ AType* Foo; ... X = &Foo->F;
        -

        it is natural to think that there is only one index, the constant value - 1. This results from C allowing you to treat pointers and arrays as - equivalent. LLVM doesn't. In this example, Foo is a pointer. That pointer must - be indexed. To arrive at the same address location as the C code, you would - provide the GEP instruction with two indices. The first indexes through the - pointer, the second index the element of the structure just as if it was:

        +

        it is natural to think that there is only one index, the selection of the + field F. However, in this example, Foo is a pointer. That + pointer must be indexed explicitly in LLVM. C, on the other hand, indexs + through it ransparently. To arrive at the same address location as the C + code, you would provide the GEP instruction with two index operands. The + first operand indexes through the pointer; the second operand indexes the + field F of the structure, just as if you wrote:

           X = &Foo[0].F;

        Sometimes this question gets rephrased as:

        @@ -629,7 +630,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/15 03:57:05 $ + Last modified: $Date: 2006/08/15 04:00:29 $ From reid at x10sys.com Tue Aug 15 01:39:58 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 01:39:58 -0500 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200608150639.k7F6dw7r001475@zion.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.35 -> 1.36 --- Log message: Doh! Fix a bug in my last commit. --- Diffs of the changes: (+1 -1) configure | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/configure diff -u llvm-test/configure:1.35 llvm-test/configure:1.36 --- llvm-test/configure:1.35 Mon Aug 14 18:23:48 2006 +++ llvm-test/configure Tue Aug 15 01:39:42 2006 @@ -2506,7 +2506,7 @@ if test -n "$SPEC2000_ROOT" ; then if test -d "$SPEC2000_ROOT" ; then - if test `basename '${SPEC2000_ROOT%benchspec}'` != "benchspec"; then + if test `basename '$SPEC2000_ROOT'` != "benchspec"; then { { echo "$as_me:$LINENO: error: SPEC 2000 directory must end in 'benchspec'" >&5 echo "$as_me: error: SPEC 2000 directory must end in 'benchspec'" >&2;} { (exit 1); exit 1; }; } From reid at x10sys.com Tue Aug 15 01:39:58 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 01:39:58 -0500 Subject: [llvm-commits] CVS: llvm-test/autoconf/configure.ac Message-ID: <200608150639.k7F6dw2L001470@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf: configure.ac updated: 1.33 -> 1.34 --- Log message: Doh! Fix a bug in my last commit. --- Diffs of the changes: (+1 -1) configure.ac | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.33 llvm-test/autoconf/configure.ac:1.34 --- llvm-test/autoconf/configure.ac:1.33 Mon Aug 14 18:10:49 2006 +++ llvm-test/autoconf/configure.ac Tue Aug 15 01:39:42 2006 @@ -79,7 +79,7 @@ dnl Check that the paths of provided external benchmark dirs make sense if test -n "$SPEC2000_ROOT" ; then if test -d "$SPEC2000_ROOT" ; then - if test `basename '${SPEC2000_ROOT%benchspec}'` != "benchspec"; then + if test `basename '$SPEC2000_ROOT'` != "benchspec"; then AC_MSG_ERROR([SPEC 2000 directory must end in 'benchspec']) fi else From reid at x10sys.com Tue Aug 15 01:54:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 01:54:11 -0500 Subject: [llvm-commits] CVS: llvm-test/autoconf/m4/external_benchmark.m4 Message-ID: <200608150654.k7F6sBnM001744@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf/m4: external_benchmark.m4 updated: 1.3 -> 1.4 --- Log message: One more time, just for fun. --- Diffs of the changes: (+22 -23) external_benchmark.m4 | 45 ++++++++++++++++++++++----------------------- 1 files changed, 22 insertions(+), 23 deletions(-) Index: llvm-test/autoconf/m4/external_benchmark.m4 diff -u llvm-test/autoconf/m4/external_benchmark.m4:1.3 llvm-test/autoconf/m4/external_benchmark.m4:1.4 --- llvm-test/autoconf/m4/external_benchmark.m4:1.3 Fri Apr 7 13:53:21 2006 +++ llvm-test/autoconf/m4/external_benchmark.m4 Tue Aug 15 01:53:55 2006 @@ -12,32 +12,31 @@ AC_MSG_CHECKING([for $1 benchmark sources]) case "$checkresult" in auto|yes) - defaultdir=$2 - if test -d "$defaultdir" - then - AC_SUBST(allcapsname()[_ROOT],[$defaultdir]) - AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1) - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + defaultdir=$2 + if test -d "$defaultdir"; then + AC_SUBST(allcapsname()[_ROOT],[$defaultdir]) + AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1) + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) + AC_SUBST(allcapsname()[_ROOT],[]) + AC_SUBST([USE_]allcapsname(),[]) + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + AC_SUBST(allcapsname()[_ROOT],"$checkresult") + AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1) + checkresult="yes, in $checkresult" + else AC_SUBST(allcapsname()[_ROOT],[]) AC_SUBST([USE_]allcapsname(),[]) - checkresult=no - ;; -*) if test -d "$checkresult" - then - AC_SUBST(allcapsname()[_ROOT],"$checkresult") - AC_SUBST([USE_]allcapsname(),[USE_]allcapsname()=1) - checkresult="yes, in $checkresult" - else - AC_SUBST(allcapsname()[_ROOT],[]) - AC_SUBST([USE_]allcapsname(),[]) - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac AC_MSG_RESULT($checkresult) m4_undefine([allcapsname]) From reid at x10sys.com Tue Aug 15 01:54:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 01:54:12 -0500 Subject: [llvm-commits] CVS: llvm-test/autoconf/configure.ac Message-ID: <200608150654.k7F6sCsp001749@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf: configure.ac updated: 1.34 -> 1.35 --- Log message: One more time, just for fun. --- Diffs of the changes: (+1 -1) configure.ac | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.34 llvm-test/autoconf/configure.ac:1.35 --- llvm-test/autoconf/configure.ac:1.34 Tue Aug 15 01:39:42 2006 +++ llvm-test/autoconf/configure.ac Tue Aug 15 01:53:55 2006 @@ -79,7 +79,7 @@ dnl Check that the paths of provided external benchmark dirs make sense if test -n "$SPEC2000_ROOT" ; then if test -d "$SPEC2000_ROOT" ; then - if test `basename '$SPEC2000_ROOT'` != "benchspec"; then + if test `basename "$SPEC2000_ROOT"` != "benchspec"; then AC_MSG_ERROR([SPEC 2000 directory must end in 'benchspec']) fi else From reid at x10sys.com Tue Aug 15 01:54:12 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 01:54:12 -0500 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200608150654.k7F6sCV2001754@zion.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.36 -> 1.37 --- Log message: One more time, just for fun. --- Diffs of the changes: (+184 -192) configure | 376 ++++++++++++++++++++++++++++++-------------------------------- 1 files changed, 184 insertions(+), 192 deletions(-) Index: llvm-test/configure diff -u llvm-test/configure:1.36 llvm-test/configure:1.37 --- llvm-test/configure:1.36 Tue Aug 15 01:39:42 2006 +++ llvm-test/configure Tue Aug 15 01:53:55 2006 @@ -2132,36 +2132,35 @@ echo $ECHO_N "checking for spec95 benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/spec95/benchspec - if test -d "$defaultdir" - then - SPEC95_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/spec95/benchspec + if test -d "$defaultdir"; then + SPEC95_ROOT=$defaultdir - USE_SPEC95=USE_SPEC95=1 + USE_SPEC95=USE_SPEC95=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - SPEC95_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + SPEC95_ROOT="$checkresult" - USE_SPEC95=USE_SPEC95=1 + USE_SPEC95=USE_SPEC95=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2180,36 +2179,35 @@ echo $ECHO_N "checking for spec2000 benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/speccpu2000/benchspec - if test -d "$defaultdir" - then - SPEC2000_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/speccpu2000/benchspec + if test -d "$defaultdir"; then + SPEC2000_ROOT=$defaultdir - USE_SPEC2000=USE_SPEC2000=1 + USE_SPEC2000=USE_SPEC2000=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - SPEC2000_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + SPEC2000_ROOT="$checkresult" - USE_SPEC2000=USE_SPEC2000=1 + USE_SPEC2000=USE_SPEC2000=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2228,36 +2226,35 @@ echo $ECHO_N "checking for povray benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/povray31 - if test -d "$defaultdir" - then - POVRAY_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/povray31 + if test -d "$defaultdir"; then + POVRAY_ROOT=$defaultdir - USE_POVRAY=USE_POVRAY=1 + USE_POVRAY=USE_POVRAY=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - POVRAY_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + POVRAY_ROOT="$checkresult" - USE_POVRAY=USE_POVRAY=1 + USE_POVRAY=USE_POVRAY=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2276,36 +2273,35 @@ echo $ECHO_N "checking for namd benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/spec_namd - if test -d "$defaultdir" - then - NAMD_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/spec_namd + if test -d "$defaultdir"; then + NAMD_ROOT=$defaultdir - USE_NAMD=USE_NAMD=1 + USE_NAMD=USE_NAMD=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - NAMD_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + NAMD_ROOT="$checkresult" - USE_NAMD=USE_NAMD=1 + USE_NAMD=USE_NAMD=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2324,36 +2320,35 @@ echo $ECHO_N "checking for sweep3d benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/sweep3d - if test -d "$defaultdir" - then - SWEEP3D_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/sweep3d + if test -d "$defaultdir"; then + SWEEP3D_ROOT=$defaultdir - USE_SWEEP3D=USE_SWEEP3D=1 + USE_SWEEP3D=USE_SWEEP3D=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - SWEEP3D_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + SWEEP3D_ROOT="$checkresult" - USE_SWEEP3D=USE_SWEEP3D=1 + USE_SWEEP3D=USE_SWEEP3D=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2372,36 +2367,35 @@ echo $ECHO_N "checking for fpgrowth benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/fpgrowth - if test -d "$defaultdir" - then - FPGROWTH_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/fpgrowth + if test -d "$defaultdir"; then + FPGROWTH_ROOT=$defaultdir - USE_FPGROWTH=USE_FPGROWTH=1 + USE_FPGROWTH=USE_FPGROWTH=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - FPGROWTH_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + FPGROWTH_ROOT="$checkresult" - USE_FPGROWTH=USE_FPGROWTH=1 + USE_FPGROWTH=USE_FPGROWTH=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2420,36 +2414,35 @@ echo $ECHO_N "checking for alp benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/alp - if test -d "$defaultdir" - then - ALP_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/alp + if test -d "$defaultdir"; then + ALP_ROOT=$defaultdir - USE_ALP=USE_ALP=1 + USE_ALP=USE_ALP=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - ALP_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + ALP_ROOT="$checkresult" - USE_ALP=USE_ALP=1 + USE_ALP=USE_ALP=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2468,36 +2461,35 @@ echo $ECHO_N "checking for nurbs benchmark sources... $ECHO_C" >&6; } case "$checkresult" in auto|yes) - defaultdir=${LLVM_EXTERNALS}/nurbs - if test -d "$defaultdir" - then - NURBS_ROOT=$defaultdir + defaultdir=${LLVM_EXTERNALS}/nurbs + if test -d "$defaultdir"; then + NURBS_ROOT=$defaultdir - USE_NURBS=USE_NURBS=1 + USE_NURBS=USE_NURBS=1 - checkresult="yes, found in $defaultdir" - else - checkresult=no - fi - ;; + checkresult="yes, found in $defaultdir" + else + checkresult=no + fi + ;; no) - checkresult=no - ;; -*) if test -d "$checkresult" - then - NURBS_ROOT="$checkresult" + checkresult=no + ;; +*) + if test -d "$checkresult" ; then + NURBS_ROOT="$checkresult" - USE_NURBS=USE_NURBS=1 + USE_NURBS=USE_NURBS=1 - checkresult="yes, in $checkresult" - else + checkresult="yes, in $checkresult" + else - checkresult="no, not found in $checkresult" - fi - ;; + checkresult="no, not found in $checkresult" + fi + ;; esac { echo "$as_me:$LINENO: result: $checkresult" >&5 echo "${ECHO_T}$checkresult" >&6; } @@ -2506,7 +2498,7 @@ if test -n "$SPEC2000_ROOT" ; then if test -d "$SPEC2000_ROOT" ; then - if test `basename '$SPEC2000_ROOT'` != "benchspec"; then + if test `basename "$SPEC2000_ROOT"` != "benchspec"; then { { echo "$as_me:$LINENO: error: SPEC 2000 directory must end in 'benchspec'" >&5 echo "$as_me: error: SPEC 2000 directory must end in 'benchspec'" >&2;} { (exit 1); exit 1; }; } @@ -5270,7 +5262,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5273 "configure"' > conftest.$ac_ext + echo '#line 5265 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7435,11 +7427,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7438: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7430: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7442: \$? = $ac_status" >&5 + echo "$as_me:7434: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7703,11 +7695,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7706: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7698: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7710: \$? = $ac_status" >&5 + echo "$as_me:7702: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7807,11 +7799,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7810: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7802: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7814: \$? = $ac_status" >&5 + echo "$as_me:7806: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10259,7 +10251,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12722: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12734: \$? = $ac_status" >&5 + echo "$as_me:12726: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12831,11 +12823,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12834: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12826: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12838: \$? = $ac_status" >&5 + echo "$as_me:12830: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14401,11 +14393,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14404: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14396: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14408: \$? = $ac_status" >&5 + echo "$as_me:14400: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14505,11 +14497,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14508: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14500: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14512: \$? = $ac_status" >&5 + echo "$as_me:14504: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16740,11 +16732,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16743: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16735: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16747: \$? = $ac_status" >&5 + echo "$as_me:16739: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17008,11 +17000,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17011: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17003: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17015: \$? = $ac_status" >&5 + echo "$as_me:17007: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17112,11 +17104,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17115: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17107: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17119: \$? = $ac_status" >&5 + echo "$as_me:17111: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized From jlaskey at apple.com Tue Aug 15 03:14:33 2006 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 15 Aug 2006 03:14:33 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608150814.k7F8EXaM011248@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.8 -> 1.9 --- Log message: Typo. --- Diffs of the changes: (+2 -2) GetElementPtr.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.8 llvm/docs/GetElementPtr.html:1.9 --- llvm/docs/GetElementPtr.html:1.8 Mon Aug 14 23:00:29 2006 +++ llvm/docs/GetElementPtr.html Tue Aug 15 03:14:19 2006 @@ -81,7 +81,7 @@

        it is natural to think that there is only one index, the selection of the field F. However, in this example, Foo is a pointer. That pointer must be indexed explicitly in LLVM. C, on the other hand, indexs - through it ransparently. To arrive at the same address location as the C + through it transparently. To arrive at the same address location as the C code, you would provide the GEP instruction with two index operands. The first operand indexes through the pointer; the second operand indexes the field F of the structure, just as if you wrote:

        @@ -630,7 +630,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
        - Last modified: $Date: 2006/08/15 04:00:29 $ + Last modified: $Date: 2006/08/15 08:14:19 $ From jlaskey at apple.com Tue Aug 15 07:11:56 2006 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 15 Aug 2006 07:11:56 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608151211.k7FCBu0G008849@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.9 -> 1.10 --- Log message: Hypos pointed out by Jakob Praher. --- Diffs of the changes: (+6 -6) GetElementPtr.html | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.9 llvm/docs/GetElementPtr.html:1.10 --- llvm/docs/GetElementPtr.html:1.9 Tue Aug 15 03:14:19 2006 +++ llvm/docs/GetElementPtr.html Tue Aug 15 07:11:42 2006 @@ -56,12 +56,12 @@ this leads to the following questions, all of which are answered in the following sections.

          -
        1. What is the first index of the GEP instruction? +
        2. What is the first index of the GEP instruction?
        3. -
        4. Why is the extra 0 index required?
        5. -
        6. What is dereferenced by GEP?
        7. -
        8. Why don't GEP x,0,0,1 and GEP x,1 alias?
        9. -
        10. Why do GEP x,1,0,0 and GEP x,1 alias?
        11. +
        12. Why is the extra 0 index required?
        13. +
        14. What is dereferenced by GEP?
        15. +
        16. Why don't GEP x,0,0,1 and GEP x,1 alias?
        17. +
        18. Why do GEP x,1,0,0 and GEP x,1 alias?
    • @@ -630,7 +630,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/15 08:14:19 $ + Last modified: $Date: 2006/08/15 12:11:42 $ From jlaskey at apple.com Tue Aug 15 07:15:22 2006 From: jlaskey at apple.com (Jim Laskey) Date: Tue, 15 Aug 2006 07:15:22 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608151215.k7FCFMVj008952@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.10 -> 1.11 --- Log message: Haste-o discovered after. --- Diffs of the changes: (+2 -2) GetElementPtr.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.10 llvm/docs/GetElementPtr.html:1.11 --- llvm/docs/GetElementPtr.html:1.10 Tue Aug 15 07:11:42 2006 +++ llvm/docs/GetElementPtr.html Tue Aug 15 07:15:08 2006 @@ -259,7 +259,7 @@

      Quick Answer: They compute the same address location.

      @@ -630,7 +630,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/15 12:11:42 $ + Last modified: $Date: 2006/08/15 12:15:08 $ From pjenkins at apple.com Tue Aug 15 11:41:03 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 15 Aug 2006 11:41:03 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp BugDriver.h CrashDebugger.cpp ExecutionDriver.cpp bugpoint.cpp Message-ID: <200608151641.k7FGf37Y013176@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.cpp updated: 1.46 -> 1.47 BugDriver.h updated: 1.43 -> 1.44 CrashDebugger.cpp updated: 1.48 -> 1.49 ExecutionDriver.cpp updated: 1.62 -> 1.63 bugpoint.cpp updated: 1.31 -> 1.32 --- Log message: This commit adds a new feature called find-bugs. The find-bugs option can be invoked on a .bc file from the command like with -find-bugs and a list of passes you wish to test. This procedure takes the set of optimization passes the user specifies, randomizes the passes, runs the passes on the specified .bc file, compiles the program, and finally runs the program checking its output vs the .bc file with no optimizations. This process repeats until either the user kills bugpoint or an error occurs in the optimizations, program complitation, or the running of the program. If an error occurs, bugpoint attempts to diagnose the error by eliminating passes that are not at fault and code that is not needed. --- Diffs of the changes: (+73 -26) BugDriver.cpp | 30 ++++++++++++++---------------- BugDriver.h | 23 +++++++++++++++++++++-- CrashDebugger.cpp | 4 ++-- ExecutionDriver.cpp | 32 +++++++++++++++++++++++++++++--- bugpoint.cpp | 10 +++++++--- 5 files changed, 73 insertions(+), 26 deletions(-) Index: llvm/tools/bugpoint/BugDriver.cpp diff -u llvm/tools/bugpoint/BugDriver.cpp:1.46 llvm/tools/bugpoint/BugDriver.cpp:1.47 --- llvm/tools/bugpoint/BugDriver.cpp:1.46 Mon Jun 12 22:10:48 2006 +++ llvm/tools/bugpoint/BugDriver.cpp Tue Aug 15 11:40:49 2006 @@ -62,10 +62,11 @@ return Result; } -BugDriver::BugDriver(const char *toolname, bool as_child, unsigned timeout) +BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs, + unsigned timeout) : ToolName(toolname), ReferenceOutputFile(OutputFile), Program(0), Interpreter(0), cbe(0), gcc(0), run_as_child(as_child), - Timeout(timeout) {} + run_find_bugs(find_bugs), Timeout(timeout) {} /// ParseInputFile - Given a bytecode or assembly input filename, parse and @@ -140,6 +141,12 @@ // Execute the passes return runPassesAsChild(PassesToRun); } + + if (run_find_bugs) { + // Rearrange the passes and apply them to the program. Repeat this process + // until the user kills the program or we find a bug. + return runManyPasses(PassesToRun); + } // If we're not running as a child, the first thing that we must do is // determine what the problem is. Does the optimization series crash the @@ -175,20 +182,10 @@ bool CreatedOutput = false; if (ReferenceOutputFile.empty()) { std::cout << "Generating reference output from raw program: "; - try { - ReferenceOutputFile = executeProgramWithCBE("bugpoint.reference.out"); - CreatedOutput = true; - std::cout << "Reference output is: " << ReferenceOutputFile << '\n'; - } catch (ToolExecutionError &TEE) { - std::cerr << TEE.what(); - if (Interpreter != cbe) { - std::cerr << "*** There is a bug running the C backend. Either debug" - << " it (use the -run-cbe bugpoint option), or fix the error" - << " some other way.\n"; - return 1; - } - return debugCodeGeneratorCrash(); + if(!createReferenceFile(Program)){ + return debugCodeGeneratorCrash(); } + CreatedOutput = true; } // Make sure the reference output file gets deleted on exit from this @@ -197,7 +194,8 @@ FileRemover RemoverInstance(ROF, CreatedOutput); // Diff the output of the raw program against the reference output. If it - // matches, then we have a miscompilation bug. + // matches, then we assume there is a miscompilation bug and try to + // diagnose it. std::cout << "*** Checking the code generator...\n"; try { if (!diffProgram()) { Index: llvm/tools/bugpoint/BugDriver.h diff -u llvm/tools/bugpoint/BugDriver.h:1.43 llvm/tools/bugpoint/BugDriver.h:1.44 --- llvm/tools/bugpoint/BugDriver.h:1.43 Mon Jun 12 22:10:48 2006 +++ llvm/tools/bugpoint/BugDriver.h Tue Aug 15 11:40:49 2006 @@ -48,6 +48,7 @@ CBE *cbe; GCC *gcc; bool run_as_child; + bool run_find_bugs; unsigned Timeout; // FIXME: sort out public/private distinctions... @@ -55,7 +56,8 @@ friend class ReduceMisCodegenFunctions; public: - BugDriver(const char *toolname, bool as_child, unsigned timeout); + BugDriver(const char *toolname, bool as_child, bool find_bugs, + unsigned timeout); const std::string &getToolName() const { return ToolName; } @@ -82,7 +84,7 @@ /// crashes on input. It attempts to prune down the testcase to something /// reasonable, and figure out exactly which pass is crashing. /// - bool debugOptimizerCrash(); + bool debugOptimizerCrash(const std::string &ID = "passes"); /// debugCodeGeneratorCrash - This method is called when the code generator /// crashes on an input. It attempts to reduce the input as much as possible @@ -175,6 +177,13 @@ /// std::string executeProgramWithCBE(std::string OutputFile = ""); + /// createReferenceFile - calls compileProgram and then records the output + /// into ReferenceOutputFile. Returns true if reference file created, false + /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE + /// this function. + /// + bool createReferenceFile(Module *M, const std::string &Filename = "bugpoint.reference.out"); + /// diffProgram - This method executes the specified module and diffs the /// output against the file specified by ReferenceOutputFile. If the output /// is different, true is returned. If there is a problem with the code @@ -183,6 +192,7 @@ bool diffProgram(const std::string &BytecodeFile = "", const std::string &SharedObj = "", bool RemoveBytecode = false); + /// EmitProgressBytecode - This function is used to output the current Program /// to a file named "bugpoint-ID.bc". /// @@ -235,6 +245,15 @@ bool runPasses(const std::vector &PassesToRun, std::string &OutputFilename, bool DeleteOutput = false, bool Quiet = false) const; + + /// runManyPasses - Take the specified pass list and create different + /// combinations of passes to compile the program with. Compile the program with + /// each set and mark test to see if it compiled correctly. If the passes + /// compiled correctly output nothing and rearrange the passes into a new order. + /// If the passes did not compile correctly, output the command required to + /// recreate the failure. This returns true if a compiler error is found. + /// + bool runManyPasses(const std::vector &AllPasses); /// writeProgramToFile - This writes the current "Program" to the named /// bytecode file. If an error occurs, true is returned. Index: llvm/tools/bugpoint/CrashDebugger.cpp diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.48 llvm/tools/bugpoint/CrashDebugger.cpp:1.49 --- llvm/tools/bugpoint/CrashDebugger.cpp:1.48 Tue Jun 6 17:30:59 2006 +++ llvm/tools/bugpoint/CrashDebugger.cpp Tue Aug 15 11:40:49 2006 @@ -423,7 +423,7 @@ /// It attempts to prune down the testcase to something reasonable, and figure /// out exactly which pass is crashing. /// -bool BugDriver::debugOptimizerCrash() { +bool BugDriver::debugOptimizerCrash(const std::string &ID) { std::cout << "\n*** Debugging optimizer crash!\n"; // Reduce the list of passes which causes the optimizer to crash... @@ -435,7 +435,7 @@ << (PassesToRun.size() == 1 ? ": " : "es: ") << getPassesString(PassesToRun) << '\n'; - EmitProgressBytecode("passinput"); + EmitProgressBytecode(ID); return DebugACrash(*this, TestForOptimizerCrash); } Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.62 llvm/tools/bugpoint/ExecutionDriver.cpp:1.63 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.62 Tue Jun 27 15:35:36 2006 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Tue Aug 15 11:40:49 2006 @@ -297,10 +297,36 @@ return "./" + SharedObjectFile; } +/// createReferenceFile - calls compileProgram and then records the output +/// into ReferenceOutputFile. Returns true if reference file created, false +/// otherwise. Note: initializeExecutionEnvironment should be called BEFORE +/// this function. +/// +bool BugDriver::createReferenceFile(Module *M, const std::string &Filename){ + try { + compileProgram(Program); + } catch (ToolExecutionError &TEE) { + return false; + } + try { + ReferenceOutputFile = executeProgramWithCBE(Filename); + std::cout << "Reference output is: " << ReferenceOutputFile << "\n\n"; + } catch (ToolExecutionError &TEE) { + std::cerr << TEE.what(); + if (Interpreter != cbe) { + std::cerr << "*** There is a bug running the C backend. Either debug" + << " it (use the -run-cbe bugpoint option), or fix the error" + << " some other way.\n"; + } + return false; + } + return true; +} -/// diffProgram - This method executes the specified module and diffs the output -/// against the file specified by ReferenceOutputFile. If the output is -/// different, true is returned. +/// diffProgram - This method executes the specified module and diffs the +/// output against the file specified by ReferenceOutputFile. If the output +/// is different, true is returned. If there is a problem with the code +/// generator (e.g., llc crashes), this will throw an exception. /// bool BugDriver::diffProgram(const std::string &BytecodeFile, const std::string &SharedObject, Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.31 llvm/tools/bugpoint/bugpoint.cpp:1.32 --- llvm/tools/bugpoint/bugpoint.cpp:1.31 Mon Jun 12 22:10:48 2006 +++ llvm/tools/bugpoint/bugpoint.cpp Tue Aug 15 11:40:49 2006 @@ -29,8 +29,12 @@ // from a parent process. It is not intended to be used by users so the // option is hidden. static cl::opt - AsChild("as-child", cl::desc("Run bugpoint as child process"), - cl::ReallyHidden); +AsChild("as-child", cl::desc("Run bugpoint as child process"), + cl::ReallyHidden); + +static cl::opt +FindBugs("find-bugs", cl::desc("Run many different optimization sequences" + "on program to find bugs"), cl::init(false)); static cl::list InputFilenames(cl::Positional, cl::OneOrMore, @@ -62,7 +66,7 @@ sys::PrintStackTraceOnErrorSignal(); sys::SetInterruptFunction(BugpointInterruptFunction); - BugDriver D(argv[0],AsChild,TimeoutValue); + BugDriver D(argv[0],AsChild,FindBugs,TimeoutValue); if (D.addSources(InputFilenames)) return 1; D.addPasses(PassList.begin(), PassList.end()); From pjenkins at apple.com Tue Aug 15 11:42:06 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 15 Aug 2006 11:42:06 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/FindBugs.cpp Message-ID: <200608151642.k7FGg6Zk013206@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: FindBugs.cpp added (r1.1) --- Log message: Adding FindBugs.cpp so the -find-bugs option will work. --- Diffs of the changes: (+119 -0) FindBugs.cpp | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 119 insertions(+) Index: llvm/tools/bugpoint/FindBugs.cpp diff -c /dev/null llvm/tools/bugpoint/FindBugs.cpp:1.1 *** /dev/null Tue Aug 15 11:42:02 2006 --- llvm/tools/bugpoint/FindBugs.cpp Tue Aug 15 11:41:52 2006 *************** *** 0 **** --- 1,119 ---- + //===-- FindBugs.cpp - Run Many Different Optimizations -------------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by Patrick Jenkins and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines an interface that allows bugpoint to choose different + // combinations of optimizations to run on the selected input. Bugpoint will + // run these optimizations and record the success/failure of each. This way + // we can hopefully spot bugs in the optimizations. + // + //===----------------------------------------------------------------------===// + #include "BugDriver.h" + #include "ToolRunner.h" + + #include "llvm/Bytecode/WriteBytecodePass.h" + + #include + #include + using namespace llvm; + + /// runManyPasses - Take the specified pass list and create different + /// combinations of passes to compile the program with. Compile the program with + /// each set and mark test to see if it compiled correctly. If the passes + /// compiled correctly output nothing and rearrange the passes into a new order. + /// If the passes did not compile correctly, output the command required to + /// recreate the failure. This returns true if a compiler error is found. + /// + bool BugDriver::runManyPasses(const std::vector &AllPasses) + { + std::string Filename; + std::vector TempPass(AllPasses); + std::cout << "Starting bug finding procedure...\n\n"; + + // Creating a reference output if necessary + if (initializeExecutionEnvironment()) return false; + std::cout << "\n"; + if (ReferenceOutputFile.empty()) { + std::cout << "Generating reference output from raw program: \n"; + if(!createReferenceFile(Program)){ + return false; + } + } + + srand(time(NULL)); + std::vector::iterator I = TempPass.begin(); + std::vector::iterator E = TempPass.end(); + + int num=1; + while(1){ + // + // Step 1: Randomize the order of the optimizer passes. + // + std::random_shuffle(TempPass.begin(), TempPass.end()); + + // + // Step 2: Run optimizer passes on the program and check for success. + // + std::cout << "Running selected passes on program to test for crash: "; + for(int i=0, e=TempPass.size(); i!=e; i++) { + std::cout << "-" << TempPass[i]->getPassArgument( )<< " "; + } + std::string Filename; + if(runPasses(TempPass, Filename, false)) { + std::cout << "\n"; + std::cout << "Optimizer passes caused failure!\n\n"; + debugOptimizerCrash(); + return true; + } + else{ + std::cout << "Combination "< Changes in directory llvm/docs: Bugpoint.html updated: 1.6 -> 1.7 --- Log message: This commit mentions -find-bugs under the advice for using bugpoints section of the bugpoint design and usage document. --- Diffs of the changes: (+7 -1) Bugpoint.html | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/docs/Bugpoint.html diff -u llvm/docs/Bugpoint.html:1.6 llvm/docs/Bugpoint.html:1.7 --- llvm/docs/Bugpoint.html:1.6 Mon Mar 13 23:39:39 2006 +++ llvm/docs/Bugpoint.html Tue Aug 15 12:03:17 2006 @@ -215,6 +215,12 @@ confused. One way to deal with this is to cause bugpoint to ignore the exit code from your program, by giving it the -check-exit-code=false option. + +
    • bugpoint is useful for proactively finding bugs in LLVM. + Invoking bugpoint with the -find-bugs option will cause + the list of specified optimizations to be randomized and applied to the + program. This process will repeat until an error occurs or the user + kills bugpoint. @@ -231,7 +237,7 @@ Chris Lattner
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/03/14 05:39:39 $ + Last modified: $Date: 2006/08/15 17:03:17 $ From pjenkins at apple.com Tue Aug 15 12:32:12 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 15 Aug 2006 12:32:12 -0500 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/bugpoint.pod Message-ID: <200608151732.k7FHWChG014136@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: bugpoint.pod updated: 1.6 -> 1.7 --- Log message: Added option description for -find-bugs. --- Diffs of the changes: (+5 -0) bugpoint.pod | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/docs/CommandGuide/bugpoint.pod diff -u llvm/docs/CommandGuide/bugpoint.pod:1.6 llvm/docs/CommandGuide/bugpoint.pod:1.7 --- llvm/docs/CommandGuide/bugpoint.pod:1.6 Mon Mar 13 23:42:07 2006 +++ llvm/docs/CommandGuide/bugpoint.pod Tue Aug 15 12:31:58 2006 @@ -64,6 +64,11 @@ reduce test programs. If you're trying to find a bug in one of these passes, B may crash. +=item B<-find-bugs> + +Continually randomize the specified passes and run them on the test program +until an error is found in LLVM or the user kills B. + =item B<--help> Print a summary of command line options. From pjenkins at apple.com Tue Aug 15 12:38:50 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 15 Aug 2006 12:38:50 -0500 Subject: [llvm-commits] CVS: llvm/docs/Bugpoint.html Message-ID: <200608151738.k7FHcosp014289@zion.cs.uiuc.edu> Changes in directory llvm/docs: Bugpoint.html updated: 1.7 -> 1.8 --- Log message: Fixed the awkward description of -find-bugs in the "Advice for using bugpoint" section. --- Diffs of the changes: (+2 -2) Bugpoint.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/Bugpoint.html diff -u llvm/docs/Bugpoint.html:1.7 llvm/docs/Bugpoint.html:1.8 --- llvm/docs/Bugpoint.html:1.7 Tue Aug 15 12:03:17 2006 +++ llvm/docs/Bugpoint.html Tue Aug 15 12:38:36 2006 @@ -219,7 +219,7 @@
    • bugpoint is useful for proactively finding bugs in LLVM. Invoking bugpoint with the -find-bugs option will cause the list of specified optimizations to be randomized and applied to the - program. This process will repeat until an error occurs or the user + program. This process will repeat until a bug is found or the user kills bugpoint. @@ -237,7 +237,7 @@ Chris Lattner
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/15 17:03:17 $ + Last modified: $Date: 2006/08/15 17:38:36 $ From pjenkins at apple.com Tue Aug 15 12:39:54 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 15 Aug 2006 12:39:54 -0500 Subject: [llvm-commits] CVS: llvm/docs/CommandGuide/bugpoint.pod Message-ID: <200608151739.k7FHdsCo014370@zion.cs.uiuc.edu> Changes in directory llvm/docs/CommandGuide: bugpoint.pod updated: 1.7 -> 1.8 --- Log message: Fixed the awkward description of the -find-bugs option for bugpoint. --- Diffs of the changes: (+1 -1) bugpoint.pod | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/docs/CommandGuide/bugpoint.pod diff -u llvm/docs/CommandGuide/bugpoint.pod:1.7 llvm/docs/CommandGuide/bugpoint.pod:1.8 --- llvm/docs/CommandGuide/bugpoint.pod:1.7 Tue Aug 15 12:31:58 2006 +++ llvm/docs/CommandGuide/bugpoint.pod Tue Aug 15 12:39:40 2006 @@ -67,7 +67,7 @@ =item B<-find-bugs> Continually randomize the specified passes and run them on the test program -until an error is found in LLVM or the user kills B. +until a bug is found or the user kills B. =item B<--help> From lattner at cs.uiuc.edu Tue Aug 15 12:46:15 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 12:46:15 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h Message-ID: <200608151746.k7FHkFwZ014516@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.121 -> 1.122 --- Log message: add a new SDVTList type and new SelectionDAG::getVTList methods to streamline the creation of canonical VTLists. --- Diffs of the changes: (+37 -9) SelectionDAG.h | 46 +++++++++++++++++++++++++++++++++++++--------- 1 files changed, 37 insertions(+), 9 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.121 llvm/include/llvm/CodeGen/SelectionDAG.h:1.122 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.121 Mon Aug 14 18:54:24 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Aug 15 12:46:01 2006 @@ -30,6 +30,15 @@ class MachineDebugInfo; class MachineFunction; +/// SDVTList - This represents a list of ValueType's that has been intern'd by +/// a SelectionDAG. Instances of this simple value class are returned by +/// SelectionDAG::getVTList(...). +/// +struct SDVTList { + const MVT::ValueType *VTs; + unsigned short NumVTs; +}; + /// SelectionDAG class - This is used to represent a portion of an LLVM function /// in a low-level Data Dependence DAG representation suitable for instruction /// selection. This DAG is constructed as the first step of instruction @@ -109,7 +118,34 @@ /// RemoveDeadNodes - This method deletes all unreachable nodes in the /// SelectionDAG. void RemoveDeadNodes(); - + + /// getVTList - Return an SDVTList that represents the list of values + /// specified. + SDVTList getVTList(MVT::ValueType VT); + SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2); + SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2,MVT::ValueType VT3); + SDVTList getVTList(const MVT::ValueType *VTs, unsigned NumVTs); + + /// getNodeValueTypes - These are obsolete, use getVTList instead. + const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT) { + return getVTList(VT).VTs; + } + const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, + MVT::ValueType VT2) { + return getVTList(VT1, VT2).VTs; + } + const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,MVT::ValueType VT2, + MVT::ValueType VT3) { + return getVTList(VT1, VT2, VT3).VTs; + } + const MVT::ValueType *getNodeValueTypes(std::vector &VTList) { + return getVTList(&VTList[0], VTList.size()).VTs; + } + + + //===----------------------------------------------------------------------===// + // Node creation methods. + // SDOperand getString(const std::string &Val); SDOperand getConstant(uint64_t Val, MVT::ValueType VT, bool isTarget = false); SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT) { @@ -422,14 +458,6 @@ void dump() const; - /// getNodeValueTypes - Return a pointer to an intern'd representation of the - /// specified valuetype list. - MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1); - MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2); - MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1, MVT::ValueType VT2, - MVT::ValueType VT3); - MVT::ValueType *getNodeValueTypes(std::vector &RetVals); - private: void RemoveNodeFromCSEMaps(SDNode *N); SDNode *AddNonLeafNodeToCSEMaps(SDNode *N); From lattner at cs.uiuc.edu Tue Aug 15 12:46:16 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 12:46:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200608151746.k7FHkGbK014522@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.329 -> 1.330 --- Log message: add a new SDVTList type and new SelectionDAG::getVTList methods to streamline the creation of canonical VTLists. --- Diffs of the changes: (+79 -68) SelectionDAG.cpp | 147 +++++++++++++++++++++++++++++-------------------------- 1 files changed, 79 insertions(+), 68 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.329 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.330 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.329 Mon Aug 14 18:31:51 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 15 12:46:01 2006 @@ -893,7 +893,7 @@ /// getNode - Gets or creates the specified node. /// SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT) { - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(Opcode, VTs); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1071,7 +1071,7 @@ } SDNode *N; - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); if (VT != MVT::Flag) { // Don't CSE flag producing nodes SelectionDAGCSEMap::NodeID ID(Opcode, VTs, Operand); void *IP = 0; @@ -1343,7 +1343,7 @@ // Memoize this node if possible. SDNode *N; - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); if (VT != MVT::Flag) { SelectionDAGCSEMap::NodeID ID(Opcode, VTs, N1, N2); void *IP = 0; @@ -1401,7 +1401,7 @@ // Memoize node if it doesn't produce a flag. SDNode *N; - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); if (VT != MVT::Flag) { SelectionDAGCSEMap::NodeID ID(Opcode, VTs, N1, N2, N3); @@ -1436,7 +1436,7 @@ SDOperand SelectionDAG::getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV) { - MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); + const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); SelectionDAGCSEMap::NodeID ID(ISD::LOAD, VTs, Chain, Ptr, SV); void *IP = 0; @@ -1455,7 +1455,7 @@ SDOperand Ops[] = { Chain, Ptr, SV, getConstant(Count, MVT::i32), getValueType(EVT) }; // Add token chain. - MVT::ValueType *VTs = getNodeValueTypes(MVT::Vector, MVT::Other); + const MVT::ValueType *VTs = getNodeValueTypes(MVT::Vector, MVT::Other); return getNode(ISD::VLOAD, VTs, 2, Ops, 5); } @@ -1463,7 +1463,7 @@ SDOperand Chain, SDOperand Ptr, SDOperand SV, MVT::ValueType EVT) { SDOperand Ops[] = { Chain, Ptr, SV, getValueType(EVT) }; - MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); + const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); return getNode(Opcode, VTs, 2, Ops, 4); } @@ -1472,7 +1472,7 @@ SDOperand SV) { SDOperand Ops[] = { Chain, Ptr, SV }; // Add token chain. - MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); + const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); return getNode(ISD::VAARG, VTs, 2, Ops, 3); } @@ -1528,7 +1528,7 @@ // Memoize nodes. SDNode *N; - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); if (VT != MVT::Flag) { SelectionDAGCSEMap::NodeID ID(Opcode, VTs, Ops, NumOps); void *IP = 0; @@ -1625,59 +1625,70 @@ return SDOperand(N, 0); } - -MVT::ValueType *SelectionDAG::getNodeValueTypes(MVT::ValueType VT) { - return SDNode::getValueTypeList(VT); +/// makeVTList - Return an instance of the SDVTList struct initialized with the +/// specified members. +static SDVTList makeVTList(const MVT::ValueType *VTs, unsigned NumVTs) { + SDVTList Res = {VTs, NumVTs}; + return Res; } -MVT::ValueType *SelectionDAG::getNodeValueTypes( - std::vector &RetVals) { - switch (RetVals.size()) { - case 0: assert(0 && "Cannot have nodes without results!"); - case 1: return SDNode::getValueTypeList(RetVals[0]); - case 2: return getNodeValueTypes(RetVals[0], RetVals[1]); - default: break; - } - - std::list >::iterator I = - std::find(VTList.begin(), VTList.end(), RetVals); - if (I == VTList.end()) { - VTList.push_front(RetVals); - I = VTList.begin(); - } - - return &(*I)[0]; +SDVTList SelectionDAG::getVTList(MVT::ValueType VT) { + return makeVTList(SDNode::getValueTypeList(VT), 1); } -MVT::ValueType *SelectionDAG::getNodeValueTypes(MVT::ValueType VT1, - MVT::ValueType VT2) { +SDVTList SelectionDAG::getVTList(MVT::ValueType VT1, MVT::ValueType VT2) { for (std::list >::iterator I = VTList.begin(), E = VTList.end(); I != E; ++I) { if (I->size() == 2 && (*I)[0] == VT1 && (*I)[1] == VT2) - return &(*I)[0]; + return makeVTList(&(*I)[0], 2); } std::vector V; V.push_back(VT1); V.push_back(VT2); VTList.push_front(V); - return &(*VTList.begin())[0]; + return makeVTList(&(*VTList.begin())[0], 2); } - -MVT::ValueType *SelectionDAG::getNodeValueTypes(MVT::ValueType VT1, - MVT::ValueType VT2, - MVT::ValueType VT3) { +SDVTList SelectionDAG::getVTList(MVT::ValueType VT1, MVT::ValueType VT2, + MVT::ValueType VT3) { for (std::list >::iterator I = VTList.begin(), - E = VTList.end(); I != E; ++I) { - if (I->size() == 3 && (*I)[0] == VT1 && (*I)[1] == VT2 && - (*I)[2] == VT3) - return &(*I)[0]; - } + E = VTList.end(); I != E; ++I) { + if (I->size() == 3 && (*I)[0] == VT1 && (*I)[1] == VT2 && + (*I)[2] == VT3) + return makeVTList(&(*I)[0], 3); + } std::vector V; V.push_back(VT1); V.push_back(VT2); V.push_back(VT3); VTList.push_front(V); - return &(*VTList.begin())[0]; + return makeVTList(&(*VTList.begin())[0], 3); +} + +SDVTList SelectionDAG::getVTList(const MVT::ValueType *VTs, unsigned NumVTs) { + switch (NumVTs) { + case 0: assert(0 && "Cannot have nodes without results!"); + case 1: return makeVTList(SDNode::getValueTypeList(VTs[0]), 1); + case 2: return getVTList(VTs[0], VTs[1]); + case 3: return getVTList(VTs[0], VTs[1], VTs[2]); + default: break; + } + + for (std::list >::iterator I = VTList.begin(), + E = VTList.end(); I != E; ++I) { + if (I->size() != NumVTs || VTs[0] != (*I)[0] || VTs[1] != (*I)[1]) continue; + + bool NoMatch = false; + for (unsigned i = 2; i != NumVTs; ++i) + if (VTs[i] != (*I)[i]) { + NoMatch = true; + break; + } + if (!NoMatch) + return makeVTList(&*I->begin(), NumVTs); + } + + VTList.push_front(std::vector(VTs, VTs+NumVTs)); + return makeVTList(&*VTList.begin()->begin(), NumVTs); } @@ -1825,7 +1836,7 @@ /// the current one. SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT) { - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1843,7 +1854,7 @@ SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1861,7 +1872,7 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1880,7 +1891,7 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2, Op3); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1900,7 +1911,7 @@ SDOperand Op2, SDOperand Op3, SDOperand Op4) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -1923,7 +1934,7 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5) { - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -1947,7 +1958,7 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3,SDOperand Op4, SDOperand Op5, SDOperand Op6) { - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -1973,7 +1984,7 @@ SDOperand Op2, SDOperand Op3,SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); // If an identical node already exists, use it. SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); @@ -2001,7 +2012,7 @@ SDOperand Op5, SDOperand Op6, SDOperand Op7, SDOperand Op8) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT); + const MVT::ValueType *VTs = getNodeValueTypes(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -2027,7 +2038,7 @@ SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -2047,7 +2058,7 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2, Op3); void *IP = 0; @@ -2068,7 +2079,7 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -2093,7 +2104,7 @@ SDOperand Op3, SDOperand Op4, SDOperand Op5) { // If an identical node already exists, use it. - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -2171,20 +2182,20 @@ } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, &Op1, 1).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 2).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 3).Val; } @@ -2192,7 +2203,7 @@ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 4).Val; } @@ -2200,7 +2211,7 @@ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 5).Val; } @@ -2208,7 +2219,7 @@ MVT::ValueType VT2, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 6).Val; } @@ -2217,14 +2228,14 @@ SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, 7).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, MVT::ValueType VT3, SDOperand Op1, SDOperand Op2) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 2).Val; } @@ -2233,7 +2244,7 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 5).Val; } @@ -2242,7 +2253,7 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 6).Val; } @@ -2251,14 +2262,14 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2, VT3); SDOperand Ops[] = { Op1, Op2, Op3, Op4, Op5, Op6, Op7 }; return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 3, Ops, 7).Val; } SDNode *SelectionDAG::getTargetNode(unsigned Opcode, MVT::ValueType VT1, MVT::ValueType VT2, const SDOperand *Ops, unsigned NumOps) { - MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); return getNode(ISD::BUILTIN_OP_END+Opcode, VTs, 2, Ops, NumOps).Val; } From pjenkins at apple.com Tue Aug 15 13:04:47 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Tue, 15 Aug 2006 13:04:47 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.cgi Message-ID: <200608151804.k7FI4lPI014931@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTestAccept.cgi updated: 1.46 -> 1.47 --- Log message: We now only consider previous tests with a buildstatus that is "OK". --- Diffs of the changes: (+3 -2) NightlyTestAccept.cgi | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: nightlytest-serverside/NightlyTestAccept.cgi diff -u nightlytest-serverside/NightlyTestAccept.cgi:1.46 nightlytest-serverside/NightlyTestAccept.cgi:1.47 --- nightlytest-serverside/NightlyTestAccept.cgi:1.46 Mon Aug 14 14:20:30 2006 +++ nightlytest-serverside/NightlyTestAccept.cgi Tue Aug 15 13:04:33 2006 @@ -589,7 +589,8 @@ # or their equivalent. # ################################################################################ -my $d = $dbh->prepare("select * from night where machine = $machine_id ORDER BY added DESC"); +my $d = $dbh->prepare("select * from night where machine = $machine_id ". + "and buildstatus=\"OK\" ORDER BY added DESC"); $d->execute; my $row=$d->fetchrow_hashref; $yesterdays_tests = $row->{'all_tests'}; @@ -697,7 +698,7 @@ # adds very useful information to the nightly test email. # ################################################################################ -$query = "select id from night where id<$night_id and machine=$machine_id order by id desc"; +$query = "select id from night where id<$night_id and machine=$machine_id and buildstatus=\"OK\" order by id desc"; my $g = $dbh->prepare($query); $g->execute; $row = $g->fetchrow_hashref; From lattner at cs.uiuc.edu Tue Aug 15 14:11:22 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 14:11:22 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp SelectionDAGCSEMap.cpp Message-ID: <200608151911.k7FJBMqw016471@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.330 -> 1.331 SelectionDAGCSEMap.cpp updated: 1.7 -> 1.8 --- Log message: Start using SDVTList more consistently --- Diffs of the changes: (+78 -72) SelectionDAG.cpp | 132 ++++++++++++++++++++++++------------------------- SelectionDAGCSEMap.cpp | 18 ++++-- 2 files changed, 78 insertions(+), 72 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.330 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.331 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.330 Tue Aug 15 12:46:01 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 15 14:11:05 2006 @@ -31,6 +31,13 @@ #include using namespace llvm; +/// makeVTList - Return an instance of the SDVTList struct initialized with the +/// specified members. +static SDVTList makeVTList(const MVT::ValueType *VTs, unsigned NumVTs) { + SDVTList Res = {VTs, NumVTs}; + return Res; +} + static bool isCommutativeBinOp(unsigned Opcode) { switch (Opcode) { case ISD::ADD: @@ -415,7 +422,7 @@ SelectionDAGCSEMap::NodeID ID; ID.SetOpcode(N->getOpcode()); - ID.SetValueTypes(N->value_begin()); + ID.SetValueTypes(N->getVTList()); ID.SetOperands(Op); return CSEMap.FindNodeOrInsertPos(ID, InsertPos); } @@ -437,7 +444,7 @@ SelectionDAGCSEMap::NodeID ID; ID.SetOpcode(N->getOpcode()); - ID.SetValueTypes(N->value_begin()); + ID.SetValueTypes(N->getVTList()); ID.SetOperands(Op1, Op2); return CSEMap.FindNodeOrInsertPos(ID, InsertPos); } @@ -460,7 +467,7 @@ SelectionDAGCSEMap::NodeID ID; ID.SetOpcode(N->getOpcode()); - ID.SetValueTypes(N->value_begin()); + ID.SetValueTypes(N->getVTList()); ID.SetOperands(Ops, NumOps); return CSEMap.FindNodeOrInsertPos(ID, InsertPos); } @@ -501,7 +508,7 @@ Val &= MVT::getIntVTBitMask(VT); unsigned Opc = isT ? ISD::TargetConstant : ISD::Constant; - SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); + SelectionDAGCSEMap::NodeID ID(Opc, getVTList(VT)); ID.AddInteger(Val); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -523,7 +530,7 @@ // value, so that we don't have problems with 0.0 comparing equal to -0.0, and // we don't have issues with SNANs. unsigned Opc = isTarget ? ISD::TargetConstantFP : ISD::ConstantFP; - SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); + SelectionDAGCSEMap::NodeID ID(Opc, getVTList(VT)); ID.AddInteger(DoubleToBits(Val)); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -538,7 +545,7 @@ MVT::ValueType VT, int Offset, bool isTargetGA) { unsigned Opc = isTargetGA ? ISD::TargetGlobalAddress : ISD::GlobalAddress; - SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); + SelectionDAGCSEMap::NodeID ID(Opc, getVTList(VT)); ID.AddPointer(GV); ID.AddInteger(Offset); void *IP = 0; @@ -553,7 +560,7 @@ SDOperand SelectionDAG::getFrameIndex(int FI, MVT::ValueType VT, bool isTarget) { unsigned Opc = isTarget ? ISD::TargetFrameIndex : ISD::FrameIndex; - SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); + SelectionDAGCSEMap::NodeID ID(Opc, getVTList(VT)); ID.AddInteger(FI); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -566,7 +573,7 @@ SDOperand SelectionDAG::getJumpTable(int JTI, MVT::ValueType VT, bool isTarget){ unsigned Opc = isTarget ? ISD::TargetJumpTable : ISD::JumpTable; - SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); + SelectionDAGCSEMap::NodeID ID(Opc, getVTList(VT)); ID.AddInteger(JTI); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -581,7 +588,7 @@ unsigned Alignment, int Offset, bool isTarget) { unsigned Opc = isTarget ? ISD::TargetConstantPool : ISD::ConstantPool; - SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); + SelectionDAGCSEMap::NodeID ID(Opc, getVTList(VT)); ID.AddInteger(Alignment); ID.AddInteger(Offset); ID.AddPointer(C); @@ -596,7 +603,7 @@ SDOperand SelectionDAG::getBasicBlock(MachineBasicBlock *MBB) { - SelectionDAGCSEMap::NodeID ID(ISD::BasicBlock, getNodeValueTypes(MVT::Other)); + SelectionDAGCSEMap::NodeID ID(ISD::BasicBlock, getVTList(MVT::Other)); ID.AddPointer(MBB); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -647,7 +654,7 @@ } SDOperand SelectionDAG::getRegister(unsigned RegNo, MVT::ValueType VT) { - SelectionDAGCSEMap::NodeID ID(ISD::Register, getNodeValueTypes(VT)); + SelectionDAGCSEMap::NodeID ID(ISD::Register, getVTList(VT)); ID.AddInteger(RegNo); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -662,7 +669,7 @@ assert((!V || isa(V->getType())) && "SrcValue is not a pointer?"); - SelectionDAGCSEMap::NodeID ID(ISD::SRCVALUE, getNodeValueTypes(MVT::Other)); + SelectionDAGCSEMap::NodeID ID(ISD::SRCVALUE, getVTList(MVT::Other)); ID.AddPointer(V); ID.AddInteger(Offset); void *IP = 0; @@ -893,8 +900,7 @@ /// getNode - Gets or creates the specified node. /// SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT) { - const MVT::ValueType *VTs = getNodeValueTypes(VT); - SelectionDAGCSEMap::NodeID ID(Opcode, VTs); + SelectionDAGCSEMap::NodeID ID(Opcode, getVTList(VT)); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); @@ -1071,18 +1077,18 @@ } SDNode *N; - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); if (VT != MVT::Flag) { // Don't CSE flag producing nodes SelectionDAGCSEMap::NodeID ID(Opcode, VTs, Operand); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); N = new SDNode(Opcode, Operand); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); CSEMap.InsertNode(N, IP); } else { N = new SDNode(Opcode, Operand); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); } AllNodes.push_back(N); return SDOperand(N, 0); @@ -1343,18 +1349,18 @@ // Memoize this node if possible. SDNode *N; - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); if (VT != MVT::Flag) { SelectionDAGCSEMap::NodeID ID(Opcode, VTs, N1, N2); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); N = new SDNode(Opcode, N1, N2); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); CSEMap.InsertNode(N, IP); } else { N = new SDNode(Opcode, N1, N2); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); } AllNodes.push_back(N); @@ -1401,19 +1407,18 @@ // Memoize node if it doesn't produce a flag. SDNode *N; - const MVT::ValueType *VTs = getNodeValueTypes(VT); - + SDVTList VTs = getVTList(VT); if (VT != MVT::Flag) { SelectionDAGCSEMap::NodeID ID(Opcode, VTs, N1, N2, N3); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); N = new SDNode(Opcode, N1, N2, N3); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); CSEMap.InsertNode(N, IP); } else { N = new SDNode(Opcode, N1, N2, N3); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); } AllNodes.push_back(N); return SDOperand(N, 0); @@ -1436,14 +1441,14 @@ SDOperand SelectionDAG::getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV) { - const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); + SDVTList VTs = getVTList(VT, MVT::Other); SelectionDAGCSEMap::NodeID ID(ISD::LOAD, VTs, Chain, Ptr, SV); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); SDNode *N = new SDNode(ISD::LOAD, Chain, Ptr, SV); - N->setValueTypes(VTs, 2); + N->setValueTypes(VTs); CSEMap.InsertNode(N, IP); AllNodes.push_back(N); return SDOperand(N, 0); @@ -1528,18 +1533,18 @@ // Memoize nodes. SDNode *N; - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); if (VT != MVT::Flag) { SelectionDAGCSEMap::NodeID ID(Opcode, VTs, Ops, NumOps); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); N = new SDNode(Opcode, Ops, NumOps); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); CSEMap.InsertNode(N, IP); } else { N = new SDNode(Opcode, Ops, NumOps); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); } AllNodes.push_back(N); return SDOperand(N, 0); @@ -1606,32 +1611,26 @@ // Memoize the node unless it returns a flag. SDNode *N; + SDVTList VTList = makeVTList(VTs, NumVTs); if (VTs[NumVTs-1] != MVT::Flag) { SelectionDAGCSEMap::NodeID ID; ID.SetOpcode(Opcode); - ID.SetValueTypes(VTs); + ID.SetValueTypes(VTList); ID.SetOperands(&Ops[0], NumOps); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); N = new SDNode(Opcode, Ops, NumOps); - N->setValueTypes(VTs, NumVTs); + N->setValueTypes(VTList); CSEMap.InsertNode(N, IP); } else { N = new SDNode(Opcode, Ops, NumOps); - N->setValueTypes(VTs, NumVTs); + N->setValueTypes(VTList); } AllNodes.push_back(N); return SDOperand(N, 0); } -/// makeVTList - Return an instance of the SDVTList struct initialized with the -/// specified members. -static SDVTList makeVTList(const MVT::ValueType *VTs, unsigned NumVTs) { - SDVTList Res = {VTs, NumVTs}; - return Res; -} - SDVTList SelectionDAG::getVTList(MVT::ValueType VT) { return makeVTList(SDNode::getValueTypeList(VT), 1); } @@ -1836,7 +1835,7 @@ /// the current one. SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT) { - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1845,7 +1844,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(getNodeValueTypes(VT), 1); + N->setValueTypes(VTs); CSEMap.InsertNode(N, IP); return SDOperand(N, 0); @@ -1854,7 +1853,7 @@ SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT, SDOperand Op1) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1862,7 +1861,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(getNodeValueTypes(VT), 1); + N->setValueTypes(VTs); N->setOperands(Op1); CSEMap.InsertNode(N, IP); return SDOperand(N, 0); @@ -1872,7 +1871,7 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -1880,7 +1879,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); N->setOperands(Op1, Op2); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -1891,15 +1890,16 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT); - SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2, Op3); + SDVTList VTs = getVTList(VT); + SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, + Op1, Op2, Op3); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(ON, 0); RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -1911,7 +1911,7 @@ SDOperand Op2, SDOperand Op3, SDOperand Op4) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -1923,7 +1923,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3, Op4); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -1934,7 +1934,7 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4, SDOperand Op5) { - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -1947,7 +1947,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3, Op4, Op5); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -1958,7 +1958,7 @@ MVT::ValueType VT, SDOperand Op1, SDOperand Op2, SDOperand Op3,SDOperand Op4, SDOperand Op5, SDOperand Op6) { - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -1972,7 +1972,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -1984,7 +1984,7 @@ SDOperand Op2, SDOperand Op3,SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) { - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); // If an identical node already exists, use it. SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); @@ -2000,7 +2000,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -2012,7 +2012,7 @@ SDOperand Op5, SDOperand Op6, SDOperand Op7, SDOperand Op8) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT); + SDVTList VTs = getVTList(VT); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -2028,7 +2028,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 1); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3, Op4, Op5, Op6, Op7, Op8); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -2038,7 +2038,7 @@ SDOperand SelectionDAG::SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1, MVT::ValueType VT2, SDOperand Op1, SDOperand Op2) { - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2); void *IP = 0; if (SDNode *ON = CSEMap.FindNodeOrInsertPos(ID, IP)) @@ -2046,7 +2046,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 2); + N->setValueTypes(VTs); N->setOperands(Op1, Op2); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -2058,7 +2058,7 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs, Op1, Op2, Op3); void *IP = 0; @@ -2067,7 +2067,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 2); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -2079,7 +2079,7 @@ SDOperand Op1, SDOperand Op2, SDOperand Op3, SDOperand Op4) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -2091,7 +2091,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 2); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3, Op4); CSEMap.InsertNode(N, IP); // Memoize the new node. @@ -2104,7 +2104,7 @@ SDOperand Op3, SDOperand Op4, SDOperand Op5) { // If an identical node already exists, use it. - const MVT::ValueType *VTs = getNodeValueTypes(VT1, VT2); + SDVTList VTs = getVTList(VT1, VT2); SelectionDAGCSEMap::NodeID ID(ISD::BUILTIN_OP_END+TargetOpc, VTs); ID.AddOperand(Op1); ID.AddOperand(Op2); @@ -2117,7 +2117,7 @@ RemoveNodeFromCSEMaps(N); N->MorphNodeTo(ISD::BUILTIN_OP_END+TargetOpc); - N->setValueTypes(VTs, 2); + N->setValueTypes(VTs); N->setOperands(Op1, Op2, Op3, Op4, Op5); CSEMap.InsertNode(N, IP); // Memoize the new node. Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.7 llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.8 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp:1.7 Mon Aug 14 17:19:25 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp Tue Aug 15 14:11:05 2006 @@ -18,10 +18,16 @@ //===----------------------------------------------------------------------===// // SelectionDAGCSEMap::NodeID Implementation +/// SetValueTypes - Value type lists are intern'd so we can represent them +/// solely with their pointer. +void SelectionDAGCSEMap::NodeID::SetValueTypes(SDVTList VTList) { + AddPointer(VTList.VTs); +} + SelectionDAGCSEMap::NodeID::NodeID(SDNode *N) { SetOpcode(N->getOpcode()); // Add the return value info. - SetValueTypes(N->value_begin()); + SetValueTypes(N->getVTList()); // Add the operand info. SetOperands(N->op_begin(), N->getNumOperands()); @@ -70,31 +76,31 @@ } } -SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, const void *VTList) { +SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, SDVTList VTList) { SetOpcode(ID); SetValueTypes(VTList); SetOperands(); } -SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, const void *VTList, +SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, SDVTList VTList, SDOperand Op) { SetOpcode(ID); SetValueTypes(VTList); SetOperands(Op); } -SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, const void *VTList, +SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, SDVTList VTList, SDOperand Op1, SDOperand Op2) { SetOpcode(ID); SetValueTypes(VTList); SetOperands(Op1, Op2); } -SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, const void *VTList, +SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, SDVTList VTList, SDOperand Op1, SDOperand Op2, SDOperand Op3) { SetOpcode(ID); SetValueTypes(VTList); SetOperands(Op1, Op2, Op3); } -SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, const void *VTList, +SelectionDAGCSEMap::NodeID::NodeID(unsigned short ID, SDVTList VTList, const SDOperand *OpList, unsigned N) { SetOpcode(ID); SetValueTypes(VTList); From lattner at cs.uiuc.edu Tue Aug 15 14:11:22 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 14:11:22 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGCSEMap.h SelectionDAGNodes.h Message-ID: <200608151911.k7FJBMca016466@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.122 -> 1.123 SelectionDAGCSEMap.h updated: 1.6 -> 1.7 SelectionDAGNodes.h updated: 1.141 -> 1.142 --- Log message: Start using SDVTList more consistently --- Diffs of the changes: (+25 -18) SelectionDAG.h | 9 --------- SelectionDAGCSEMap.h | 13 +++++++------ SelectionDAGNodes.h | 21 ++++++++++++++++++--- 3 files changed, 25 insertions(+), 18 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.122 llvm/include/llvm/CodeGen/SelectionDAG.h:1.123 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.122 Tue Aug 15 12:46:01 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Aug 15 14:11:05 2006 @@ -30,15 +30,6 @@ class MachineDebugInfo; class MachineFunction; -/// SDVTList - This represents a list of ValueType's that has been intern'd by -/// a SelectionDAG. Instances of this simple value class are returned by -/// SelectionDAG::getVTList(...). -/// -struct SDVTList { - const MVT::ValueType *VTs; - unsigned short NumVTs; -}; - /// SelectionDAG class - This is used to represent a portion of an LLVM function /// in a low-level Data Dependence DAG representation suitable for instruction /// selection. This DAG is constructed as the first step of instruction Index: llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h diff -u llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h:1.6 llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h:1.7 --- llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h:1.6 Mon Aug 14 17:19:25 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGCSEMap.h Tue Aug 15 14:11:05 2006 @@ -20,6 +20,7 @@ namespace llvm { class SDNode; class SDOperand; + struct SDVTList; /// SelectionDAGCSEMap - This class is used for two purposes: /// 1. Given information (e.g. opcode and operand info) about a node we want @@ -68,13 +69,13 @@ public: NodeID() {} NodeID(SDNode *N); - NodeID(unsigned short ID, const void *VTList); - NodeID(unsigned short ID, const void *VTList, SDOperand Op); - NodeID(unsigned short ID, const void *VTList, + NodeID(unsigned short ID, SDVTList VTList); + NodeID(unsigned short ID, SDVTList VTList, SDOperand Op); + NodeID(unsigned short ID, SDVTList VTList, SDOperand Op1, SDOperand Op2); - NodeID(unsigned short ID, const void *VTList, + NodeID(unsigned short ID, SDVTList VTList, SDOperand Op1, SDOperand Op2, SDOperand Op3); - NodeID(unsigned short ID, const void *VTList, + NodeID(unsigned short ID, SDVTList VTList, const SDOperand *OpList, unsigned N); void SetOpcode(unsigned short ID) { @@ -87,7 +88,7 @@ return Bits[0]; } - void SetValueTypes(const void *VTList) { AddPointer(VTList); } + void SetValueTypes(SDVTList VTList); void SetOperands() {} void SetOperands(SDOperand Op) { AddOperand(Op); } void SetOperands(SDOperand Op1, SDOperand Op2) { Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.141 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.142 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.141 Mon Aug 14 18:31:51 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Tue Aug 15 14:11:05 2006 @@ -38,6 +38,16 @@ template class iplist; template class ilist_iterator; +/// SDVTList - This represents a list of ValueType's that has been intern'd by +/// a SelectionDAG. Instances of this simple value class are returned by +/// SelectionDAG::getVTList(...). +/// +struct SDVTList { + const MVT::ValueType *VTs; + unsigned short NumVTs; +}; + + /// ISD namespace - This namespace contains an enum which represents all of the /// SelectionDAG node types and value types. /// @@ -769,6 +779,11 @@ op_iterator op_end() const { return OperandList+NumOperands; } + SDVTList getVTList() const { + SDVTList X = { ValueList, NumValues }; + return X; + }; + /// getNumValues - Return the number of values defined/returned by this /// operator. /// @@ -899,10 +914,10 @@ NumOperands = 0; } - void setValueTypes(const MVT::ValueType *List, unsigned NumVal) { + void setValueTypes(SDVTList L) { assert(NumValues == 0 && "Should not have values yet!"); - ValueList = List; - NumValues = NumVal; + ValueList = L.VTs; + NumValues = L.NumVTs; } void setOperands(SDOperand Op0) { From lattner at cs.uiuc.edu Tue Aug 15 18:28:04 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 18:28:04 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608152328.k7FNS49N021005@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.242 -> 1.243 --- Log message: allow Select to return the node being selected if RAU isn't needed. --- Diffs of the changes: (+1 -1) DAGISelEmitter.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.242 llvm/utils/TableGen/DAGISelEmitter.cpp:1.243 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.242 Fri Aug 11 13:33:41 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Aug 15 18:27:50 2006 @@ -3655,7 +3655,7 @@ OS << " ISelQueue.pop_back();\n"; OS << " if (!isSelected(Node->getNodeId())) {\n"; OS << " SDNode *ResNode = Select(Tmp, SDOperand(Node, 0));\n"; - OS << " if (ResNode) ReplaceUses(Node, ResNode);\n"; + OS << " if (ResNode && ResNode != Node) ReplaceUses(Node, ResNode);\n"; OS << " }\n"; OS << " }\n"; OS << "\n"; From lattner at cs.uiuc.edu Tue Aug 15 18:42:40 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 18:42:40 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608152342.k7FNgeoQ021276@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.243 -> 1.244 --- Log message: The generated runloop shouldn't require Select to update 'Result'. In fact we'd like to remove result entirely. --- Diffs of the changes: (+6 -3) DAGISelEmitter.cpp | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.243 llvm/utils/TableGen/DAGISelEmitter.cpp:1.244 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.243 Tue Aug 15 18:27:50 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Tue Aug 15 18:42:26 2006 @@ -3646,8 +3646,11 @@ OS << " memset(ISelQueued, 0, NumBytes);\n"; OS << " memset(ISelSelected, 0, NumBytes);\n"; OS << "\n"; - OS << " SDOperand ResNode;\n"; - OS << " Select(ResNode, Root);\n"; + OS << " // Create a dummy node (which is not added to allnodes), that adds\n" + << " // a reference to the root node, preventing it from being deleted,\n" + << " // and tracking any changes of the root.\n" + << " HandleSDNode Dummy(CurDAG->getRoot());\n" + << " ISelQueue.push_back(CurDAG->getRoot().Val);\n"; OS << " while (!ISelQueue.empty()) {\n"; OS << " SDOperand Tmp;\n"; OS << " SDNode *Node = ISelQueue.front();\n"; @@ -3663,7 +3666,7 @@ OS << " ISelQueued = NULL;\n"; OS << " delete[] ISelSelected;\n"; OS << " ISelSelected = NULL;\n"; - OS << " return ResNode;\n"; + OS << " return Dummy.getValue();\n"; OS << "}\n"; Intrinsics = LoadIntrinsics(Records); From lattner at cs.uiuc.edu Tue Aug 15 18:45:42 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 18:45:42 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll Message-ID: <200608152345.k7FNjgSk021363@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/PowerPC: 2006-08-15-SelectionCrash.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: (+38 -0) 2006-08-15-SelectionCrash.ll | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+) Index: llvm/test/Regression/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll diff -c /dev/null llvm/test/Regression/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll:1.1 *** /dev/null Tue Aug 15 18:45:38 2006 --- llvm/test/Regression/CodeGen/PowerPC/2006-08-15-SelectionCrash.ll Tue Aug 15 18:45:28 2006 *************** *** 0 **** --- 1,38 ---- + ; RUN: llvm-as < %s | llc + + %struct..0anon = type { int } + %struct.rtx_def = type { ushort, ubyte, ubyte, [1 x %struct..0anon] } + + implementation ; Functions: + + fastcc void %immed_double_const(int %i0, int %i1) { + entry: + %tmp1 = load uint* null ; [#uses=1] + switch uint %tmp1, label %bb103 [ + uint 1, label %bb + uint 3, label %bb + ] + + bb: ; preds = %entry, %entry + %tmp14 = setgt int 0, 31 ; [#uses=1] + br bool %tmp14, label %cond_next77, label %cond_next17 + + cond_next17: ; preds = %bb + ret void + + cond_next77: ; preds = %bb + %tmp79.not = setne int %i1, 0 ; [#uses=1] + %tmp84 = setlt int %i0, 0 ; [#uses=2] + %bothcond1 = or bool %tmp79.not, %tmp84 ; [#uses=1] + br bool %bothcond1, label %bb88, label %bb99 + + bb88: ; preds = %cond_next77 + %bothcond2 = and bool false, %tmp84 ; [#uses=0] + ret void + + bb99: ; preds = %cond_next77 + ret void + + bb103: ; preds = %entry + ret void + } From lattner at cs.uiuc.edu Tue Aug 15 18:48:36 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 18:48:36 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Message-ID: <200608152348.k7FNma3S021446@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCISelDAGToDAG.cpp updated: 1.202 -> 1.203 --- Log message: Fix PowerPC/2006-08-15-SelectionCrash.ll and simplify selection code. --- Diffs of the changes: (+63 -93) PPCISelDAGToDAG.cpp | 156 +++++++++++++++++++++------------------------------- 1 files changed, 63 insertions(+), 93 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp diff -u llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.202 llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.203 --- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:1.202 Fri Aug 11 04:07:52 2006 +++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Tue Aug 15 18:48:22 2006 @@ -165,9 +165,9 @@ #include "PPCGenDAGISel.inc" private: - SDOperand SelectSETCC(SDOperand Op); - SDNode *MySelect_PPCbctrl(SDOperand &Result, SDOperand N); - SDNode *MySelect_PPCcall(SDOperand &Result, SDOperand N); + SDNode *SelectSETCC(SDOperand Op); + SDNode *MySelect_PPCbctrl(SDOperand N); + SDNode *MySelect_PPCcall(SDOperand N); }; } @@ -795,7 +795,7 @@ return 0; } -SDOperand PPCDAGToDAGISel::SelectSETCC(SDOperand Op) { +SDNode *PPCDAGToDAGISel::SelectSETCC(SDOperand Op) { SDNode *N = Op.Val; unsigned Imm; ISD::CondCode CC = cast(N->getOperand(2))->get(); @@ -811,23 +811,23 @@ case ISD::SETEQ: Op = SDOperand(CurDAG->getTargetNode(PPC::CNTLZW, MVT::i32, Op), 0); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(27), - getI32Imm(5), getI32Imm(31)); + getI32Imm(5), getI32Imm(31)).Val; case ISD::SETNE: { SDOperand AD = SDOperand(CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, Op, getI32Imm(~0U)), 0); return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op, - AD.getValue(1)); + AD.getValue(1)).Val; } case ISD::SETLT: return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Op, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); + getI32Imm(31), getI32Imm(31)).Val; case ISD::SETGT: { SDOperand T = SDOperand(CurDAG->getTargetNode(PPC::NEG, MVT::i32, Op), 0); T = SDOperand(CurDAG->getTargetNode(PPC::ANDC, MVT::i32, T, Op), 0); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, T, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); + getI32Imm(31), getI32Imm(31)).Val; } } } else if (Imm == ~0U) { // setcc op, -1 @@ -841,13 +841,13 @@ return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32, SDOperand(CurDAG->getTargetNode(PPC::LI, MVT::i32, getI32Imm(0)), 0), - Op.getValue(1)); + Op.getValue(1)).Val; case ISD::SETNE: { Op = SDOperand(CurDAG->getTargetNode(PPC::NOR, MVT::i32, Op, Op), 0); SDNode *AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, Op, getI32Imm(~0U)); return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, SDOperand(AD, 0), - Op, SDOperand(AD, 1)); + Op, SDOperand(AD, 1)).Val; } case ISD::SETLT: { SDOperand AD = SDOperand(CurDAG->getTargetNode(PPC::ADDI, MVT::i32, Op, @@ -855,13 +855,14 @@ SDOperand AN = SDOperand(CurDAG->getTargetNode(PPC::AND, MVT::i32, AD, Op), 0); return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, AN, getI32Imm(1), - getI32Imm(31), getI32Imm(31)); + getI32Imm(31), getI32Imm(31)).Val; } case ISD::SETGT: Op = SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Op, getI32Imm(1), getI32Imm(31), getI32Imm(31)), 0); - return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op, getI32Imm(1)); + return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op, + getI32Imm(1)).Val; } } } @@ -887,13 +888,13 @@ if (!Inv) { return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, IntCR, getI32Imm((32-(3-Idx)) & 31), - getI32Imm(31), getI32Imm(31)); + getI32Imm(31), getI32Imm(31)).Val; } else { SDOperand Tmp = SDOperand(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, IntCR, getI32Imm((32-(3-Idx)) & 31), getI32Imm(31),getI32Imm(31)), 0); - return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1)); + return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1)).Val; } } @@ -911,25 +912,19 @@ switch (N->getOpcode()) { default: break; case ISD::SETCC: - Result = SelectSETCC(Op); - return NULL; + return SelectSETCC(Op); case PPCISD::GlobalBaseReg: - Result = getGlobalBaseReg(); - return Result.Val; + return getGlobalBaseReg().Val; case ISD::FrameIndex: { int FI = cast(N)->getIndex(); SDOperand TFI = CurDAG->getTargetFrameIndex(FI, Op.getValueType()); unsigned Opc = Op.getValueType() == MVT::i32 ? PPC::ADDI : PPC::ADDI8; - if (N->hasOneUse()) { - Result = CurDAG->SelectNodeTo(N, Opc, Op.getValueType(), TFI, - getSmallIPtrImm(0)); - return NULL; - } - Result = - SDOperand(CurDAG->getTargetNode(Opc, Op.getValueType(), TFI, - getSmallIPtrImm(0)), 0); - return Result.Val; + if (N->hasOneUse()) + return CurDAG->SelectNodeTo(N, Opc, Op.getValueType(), TFI, + getSmallIPtrImm(0)).Val; + return CurDAG->getTargetNode(Opc, Op.getValueType(), TFI, + getSmallIPtrImm(0)); } case PPCISD::MFCR: { @@ -937,11 +932,10 @@ AddToQueue(InFlag, N->getOperand(1)); // Use MFOCRF if supported. if (TLI.getTargetMachine().getSubtarget().isGigaProcessor()) - Result = SDOperand(CurDAG->getTargetNode(PPC::MFOCRF, MVT::i32, - N->getOperand(0), InFlag), 0); + return CurDAG->getTargetNode(PPC::MFOCRF, MVT::i32, + N->getOperand(0), InFlag); else - Result = SDOperand(CurDAG->getTargetNode(PPC::MFCR, MVT::i32, InFlag), 0); - return Result.Val; + return CurDAG->getTargetNode(PPC::MFCR, MVT::i32, InFlag); } case ISD::SDIV: { @@ -958,8 +952,8 @@ SDNode *Op = CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag, N0, getI32Imm(Log2_32(Imm))); - Result = CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32, - SDOperand(Op, 0), SDOperand(Op, 1)); + return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32, + SDOperand(Op, 0), SDOperand(Op, 1)).Val; } else if ((signed)Imm < 0 && isPowerOf2_32(-Imm)) { SDNode *Op = CurDAG->getTargetNode(PPC::SRAWI, MVT::i32, MVT::Flag, @@ -968,9 +962,8 @@ SDOperand(CurDAG->getTargetNode(PPC::ADDZE, MVT::i32, SDOperand(Op, 0), SDOperand(Op, 1)), 0); - Result = CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, PT); + return CurDAG->SelectNodeTo(N, PPC::NEG, MVT::i32, PT).Val; } - return NULL; } // Other cases are autogenerated. @@ -989,16 +982,16 @@ } else if (Imm == 0) { // AND X, 0 -> 0, not "rlwinm 32". AddToQueue(Result, N->getOperand(1)); + ReplaceUses(SDOperand(N, 0), N->getOperand(1)); return NULL; } else { AddToQueue(Val, N->getOperand(0)); isRunOfOnes(Imm, MB, ME); SH = 0; } - Result = CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Val, - getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)); - return NULL; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Val, + getI32Imm(SH), getI32Imm(MB), + getI32Imm(ME)).Val; } // ISD::OR doesn't get all the bitfield insertion fun. // (and (or x, c1), c2) where isRunOfOnes(~(c1^c2)) is a bitfield insert @@ -1011,11 +1004,8 @@ SDOperand Tmp1, Tmp2; AddToQueue(Tmp1, N->getOperand(0).getOperand(0)); AddToQueue(Tmp2, N->getOperand(0).getOperand(1)); - Result = SDOperand(CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, - Tmp1, Tmp2, - getI32Imm(0), getI32Imm(MB), - getI32Imm(ME)), 0); - return Result.Val; + return CurDAG->getTargetNode(PPC::RLWIMI, MVT::i32, Tmp1, Tmp2, + getI32Imm(0), getI32Imm(MB),getI32Imm(ME)); } } @@ -1024,10 +1014,8 @@ } case ISD::OR: if (N->getValueType(0) == MVT::i32) - if (SDNode *I = SelectBitfieldInsert(N)) { - Result = SDOperand(I, 0); - return Result.Val; - } + if (SDNode *I = SelectBitfieldInsert(N)) + return I; // Other cases are autogenerated. break; @@ -1037,10 +1025,9 @@ isRotateAndMask(N, Imm, true, SH, MB, ME)) { SDOperand Val; AddToQueue(Val, N->getOperand(0).getOperand(0)); - Result = CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, - Val, getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)); - return NULL; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, + Val, getI32Imm(SH), getI32Imm(MB), + getI32Imm(ME)).Val; } // Other cases are autogenerated. @@ -1052,10 +1039,9 @@ isRotateAndMask(N, Imm, true, SH, MB, ME)) { SDOperand Val; AddToQueue(Val, N->getOperand(0).getOperand(0)); - Result = CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, - Val, getI32Imm(SH), getI32Imm(MB), - getI32Imm(ME)); - return NULL; + return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, + Val, getI32Imm(SH), getI32Imm(MB), + getI32Imm(ME)).Val; } // Other cases are autogenerated. @@ -1077,10 +1063,9 @@ SDNode *Tmp = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag, LHS, getI32Imm(~0U)); - Result = CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, - SDOperand(Tmp, 0), LHS, - SDOperand(Tmp, 1)); - return NULL; + return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, + SDOperand(Tmp, 0), LHS, + SDOperand(Tmp, 1)).Val; } SDOperand CCReg = SelectCC(N->getOperand(0), N->getOperand(1), CC); @@ -1102,19 +1087,17 @@ SDOperand N2, N3; AddToQueue(N2, N->getOperand(2)); AddToQueue(N3, N->getOperand(3)); - Result = CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), CCReg, - N2, N3, getI32Imm(BROpc)); - return NULL; + return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), CCReg, + N2, N3, getI32Imm(BROpc)).Val; } case ISD::BR_CC: { SDOperand Chain; AddToQueue(Chain, N->getOperand(0)); ISD::CondCode CC = cast(N->getOperand(1))->get(); SDOperand CondCode = SelectCC(N->getOperand(2), N->getOperand(3), CC); - Result = CurDAG->SelectNodeTo(N, PPC::COND_BRANCH, MVT::Other, - CondCode, getI32Imm(getBCCForSetCC(CC)), - N->getOperand(4), Chain); - return NULL; + return CurDAG->SelectNodeTo(N, PPC::COND_BRANCH, MVT::Other, + CondCode, getI32Imm(getBCCForSetCC(CC)), + N->getOperand(4), Chain).Val; } case ISD::BRIND: { // FIXME: Should custom lower this. @@ -1124,13 +1107,12 @@ unsigned Opc = Target.getValueType() == MVT::i32 ? PPC::MTCTR : PPC::MTCTR8; Chain = SDOperand(CurDAG->getTargetNode(Opc, MVT::Other, Target, Chain), 0); - Result = CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain); - return NULL; + return CurDAG->SelectNodeTo(N, PPC::BCTR, MVT::Other, Chain).Val; } // FIXME: These are manually selected because tblgen isn't handling varargs // nodes correctly. - case PPCISD::BCTRL: return MySelect_PPCbctrl(Result, Op); - case PPCISD::CALL: return MySelect_PPCcall(Result, Op); + case PPCISD::BCTRL: return MySelect_PPCbctrl(Op); + case PPCISD::CALL: return MySelect_PPCcall(Op); } return SelectCode(Result, Op); @@ -1139,9 +1121,8 @@ // FIXME: This is manually selected because tblgen isn't handling varargs nodes // correctly. -SDNode *PPCDAGToDAGISel::MySelect_PPCbctrl(SDOperand &Result, SDOperand N) { +SDNode *PPCDAGToDAGISel::MySelect_PPCbctrl(SDOperand N) { SDOperand Chain(0, 0); - SDNode *ResNode; bool hasFlag = N.getOperand(N.getNumOperands()-1).getValueType() == MVT::Flag; @@ -1161,15 +1142,13 @@ Ops.push_back(Chain); } - ResNode = CurDAG->getTargetNode(PPC::BCTRL, MVT::Other, MVT::Flag, - &Ops[0], Ops.size()); - Result = SDOperand(ResNode, N.ResNo); - return ResNode; + return CurDAG->getTargetNode(PPC::BCTRL, MVT::Other, MVT::Flag, + &Ops[0], Ops.size()); } // FIXME: This is manually selected because tblgen isn't handling varargs nodes // correctly. -SDNode *PPCDAGToDAGISel::MySelect_PPCcall(SDOperand &Result, SDOperand N) { +SDNode *PPCDAGToDAGISel::MySelect_PPCcall(SDOperand N) { SDOperand Chain(0, 0); SDOperand N1(0, 0); SDOperand Tmp0(0, 0); @@ -1200,11 +1179,8 @@ AddToQueue(Chain, N.getOperand(N.getNumOperands()-1)); Ops.push_back(Chain); } - ResNode = CurDAG->getTargetNode(PPC::BLA, MVT::Other, MVT::Flag, - &Ops[0], Ops.size()); - - Result = SDOperand(ResNode, N.ResNo); - return ResNode; + return CurDAG->getTargetNode(PPC::BLA, MVT::Other, MVT::Flag, + &Ops[0], Ops.size()); } // Pattern: (PPCcall:void (tglobaladdr:i32):$dst) @@ -1229,11 +1205,8 @@ Ops.push_back(Chain); } - ResNode = CurDAG->getTargetNode(PPC::BL, MVT::Other, MVT::Flag, - &Ops[0], Ops.size()); - - Result = SDOperand(ResNode, N.ResNo); - return ResNode; + return CurDAG->getTargetNode(PPC::BL, MVT::Other, MVT::Flag, + &Ops[0], Ops.size()); } // Pattern: (PPCcall:void (texternalsym:i32):$dst) @@ -1258,11 +1231,8 @@ Ops.push_back(Chain); } - ResNode = CurDAG->getTargetNode(PPC::BL, MVT::Other, MVT::Flag, - &Ops[0], Ops.size()); - - Result = SDOperand(ResNode, N.ResNo); - return ResNode; + return CurDAG->getTargetNode(PPC::BL, MVT::Other, MVT::Flag, + &Ops[0], Ops.size()); } std::cerr << "Cannot yet select: "; N.Val->dump(CurDAG); From reid at x10sys.com Tue Aug 15 19:43:06 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 19:43:06 -0500 Subject: [llvm-commits] CVS: llvm/llvm.spec.in llvm.spec Message-ID: <200608160043.k7G0h6CD022404@zion.cs.uiuc.edu> Changes in directory llvm: llvm.spec.in updated: 1.5 -> 1.6 llvm.spec (r1.5) removed --- Log message: Transform the LLVM RPM spec file to be a configured file. This allows us to automatically pick up the configured version number and other details. Also, update the contents of this script to allow building both a source and binary version of the RPM package. --- Diffs of the changes: (+18 -16) llvm.spec.in | 33 ++++++++++++++++++--------------- 1 files changed, 18 insertions(+), 15 deletions(-) Index: llvm/llvm.spec.in diff -u llvm/llvm.spec.in:1.5 llvm/llvm.spec.in:1.6 --- llvm/llvm.spec.in:1.5 Fri Apr 7 11:07:37 2006 +++ llvm/llvm.spec.in Tue Aug 15 19:42:52 2006 @@ -1,27 +1,27 @@ -Summary: Static and JIT research compiler infrastructure -Name: llvm -Version: 1.6cvs +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ Release: 0 -License: U of Illinois/NCSA Open Source License -Group: Development/Languages -Source0: llvm.tar.gz -URL: http://llvm.cs.uiuc.edu/releases/index.html -#BuildRequires: llvm-gcc -# (someday...) +Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure) +License: University of Illinois/NCSA Open Source License +Vendor: None (open source) +Group: Development/Compilers +URL: http://llvm..org/ +Source: http://llvm.org/releases/@PACKAGE_VERSION@/@PACKAGE_NAME at -@PACKAGE_VERSION at .tar.gz BuildRoot: %{_tmppath}/%{name}-root Requires: /sbin/ldconfig +BuildRequires: gcc >= 3.4 %description LLVM is a compiler infrastructure designed for compile-time, link-time, runtime, -and "idle-time" optimization of programs from arbitrary programming languages. +and idle-time optimization of programs from arbitrary programming languages. LLVM is written in C++ and has been developed since 2000 at the University of -Illinois. It currently supports compilation of C and C++ programs, using -front-ends derived from GCC 3.4. The compiler infrastructure includes mirror -sets of programming tools as well as libraries with equivalent +Illinois and Apple. It currently supports compilation of C and C++ programs, +using front-ends derived from GCC 3.4 and 4.0.2. The compiler infrastructure +includes mirror sets of programming tools as well as libraries with equivalent functionality. %prep -%setup -q -n llvm +%setup -q -n @PACKAGE_NAME at -@PACKAGE_VERSION@ %build ./configure \ @@ -31,8 +31,8 @@ --includedir=%{_includedir} \ --libdir=%{_libdir} \ --enable-optimized \ ---enable-assertions \ -make +--enable-assertions +make tools-only %install rm -rf %{buildroot} @@ -55,6 +55,8 @@ %{_includedir}/llvm %changelog +* Fri Aug 04 2006 Reid Spencer +- Updates for release 1.8 * Fri Apr 07 2006 Reid Spencer - Make the build be optimized+assertions * Fri May 13 2005 Reid Spencer From reid at x10sys.com Tue Aug 15 19:44:04 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 19:44:04 -0500 Subject: [llvm-commits] CVS: llvm/Makefile Message-ID: <200608160044.k7G0i4qc022433@zion.cs.uiuc.edu> Changes in directory llvm: Makefile updated: 1.63 -> 1.64 --- Log message: Add .PHONY targets for building source and binary RPM packages. You can now just "make rpm" or "make srpm" and it will build them. --- Diffs of the changes: (+7 -0) Makefile | 7 +++++++ 1 files changed, 7 insertions(+) Index: llvm/Makefile diff -u llvm/Makefile:1.63 llvm/Makefile:1.64 --- llvm/Makefile:1.63 Wed Jul 26 14:10:34 2006 +++ llvm/Makefile Tue Aug 15 19:43:50 2006 @@ -100,3 +100,10 @@ check-llvm2cpp: $(MAKE) check TESTSUITE=Feature RUNLLVM2CPP=1 +srpm: $(LLVM_OBJ_ROOT)/llvm.spec + rpmbuild -bs $(LLVM_OBJ_ROOT)/llvm.spec + +rpm: $(LLVM_OBJ_ROOT)/llvm.spec + rpmbuild -bb --target $(TARGET_TRIPLE) $(LLVM_OBJ_ROOT)/llvm.spec + +.PHONY: srpm rpm From reid at x10sys.com Tue Aug 15 19:45:53 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 19:45:53 -0500 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200608160045.k7G0jrBX022485@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.246 -> 1.247 --- Log message: Add llvm.spec to the list of files to be configured. Remove the search for etags. Nothing in LLVM uses it any more. --- Diffs of the changes: (+4 -0) configure | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/configure diff -u llvm/configure:1.246 llvm/configure:1.247 --- llvm/configure:1.246 Wed Aug 9 00:40:14 2006 +++ llvm/configure Tue Aug 15 19:45:38 2006 @@ -33336,6 +33336,9 @@ ac_config_files="$ac_config_files Makefile.config" +ac_config_files="$ac_config_files llvm.spec" + + ac_config_files="$ac_config_files docs/doxygen.cfg" @@ -33944,6 +33947,7 @@ "include/llvm/ADT/hash_set") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/hash_set" ;; "include/llvm/ADT/iterator") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator" ;; "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;; + "llvm.spec") CONFIG_FILES="$CONFIG_FILES llvm.spec" ;; "docs/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES docs/doxygen.cfg" ;; "tools/llvm-config/llvm-config.in") CONFIG_FILES="$CONFIG_FILES tools/llvm-config/llvm-config.in" ;; "setup") CONFIG_COMMANDS="$CONFIG_COMMANDS setup" ;; From reid at x10sys.com Tue Aug 15 19:45:52 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 19:45:52 -0500 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200608160045.k7G0jqO7022479@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.243 -> 1.244 --- Log message: Add llvm.spec to the list of files to be configured. Remove the search for etags. Nothing in LLVM uses it any more. --- Diffs of the changes: (+3 -1) configure.ac | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.243 llvm/autoconf/configure.ac:1.244 --- llvm/autoconf/configure.ac:1.243 Fri Aug 4 13:18:08 2006 +++ llvm/autoconf/configure.ac Tue Aug 15 19:45:38 2006 @@ -464,7 +464,6 @@ dnl something if the tool was available. AC_PATH_PROG(BZIP2,[bzip2],[echo "Skipped: bzip2 not found"]) AC_PATH_PROG(DOXYGEN,[doxygen],[echo "Skipped: doxygen not found"]) -AC_PATH_PROG(ETAGS,[etags],[echo "Skipped: etags not found"]) AC_PATH_PROG(GROFF,[groff],[echo "Skipped: groff not found"]) AC_PATH_PROG(GZIP,[gzip],[echo "Skipped: gzip not found"]) AC_PATH_PROG(POD2HTML,[pod2html],[echo "Skipped: pod2html not found"]) @@ -784,6 +783,9 @@ dnl Configure the makefile's configuration data AC_CONFIG_FILES([Makefile.config]) +dnl Configure the RPM spec file for LLVM +AC_CONFIG_FILES([llvm.spec]) + dnl Configure doxygen's configuration file AC_CONFIG_FILES([docs/doxygen.cfg]) From reid at x10sys.com Tue Aug 15 19:55:04 2006 From: reid at x10sys.com (Reid Spencer) Date: Tue, 15 Aug 2006 19:55:04 -0500 Subject: [llvm-commits] CVS: llvm/docs/HowToReleaseLLVM.html Message-ID: <200608160055.k7G0t4EL022669@zion.cs.uiuc.edu> Changes in directory llvm/docs: HowToReleaseLLVM.html updated: 1.9 -> 1.10 --- Log message: Add a section on how to build an RPM package as an optional release activity. --- Diffs of the changes: (+24 -8) HowToReleaseLLVM.html | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) Index: llvm/docs/HowToReleaseLLVM.html diff -u llvm/docs/HowToReleaseLLVM.html:1.9 llvm/docs/HowToReleaseLLVM.html:1.10 --- llvm/docs/HowToReleaseLLVM.html:1.9 Wed Aug 9 19:23:05 2006 +++ llvm/docs/HowToReleaseLLVM.html Tue Aug 15 19:54:50 2006 @@ -61,6 +61,7 @@
    • Run 'make check'
    • Run LLVM Test Suite
    • Build the LLVM Source Distributions
    • +
    • Build RPM Packages (optional)
    • Build the LLVM GCC Binary Distribution
    • Update the LLVM Website
    • @@ -243,16 +244,31 @@ tar -cvf - llvm-test | gzip > llvm-test-X.X.tar.gz
      tar -cvf - cfrontend/src | gzip > cfrontend-X.X.source.tar.gz

      +
      - + +
      +

      You can, optionally, create source and binary RPM packages for LLVM. These + may make it easier to get LLVM into a distribution. This can be done with + the following commands:

      +
      +  make dist        # Build the distribution source tarball
      +  make dist-check  # Check that the source tarball can build itself.
      +  cp llvm-M.m.tar.gz /usr/src/redhat/SOURCES  # Required by rpmbuild
      +  make srpm # for source rpm
      +  make rpm  # for binary rpm
      +  
      +

      First, use "make dist" to simply build the distribution. Any failures need to be corrected (on the branch). Once "make dist" can be successful, do "make dist-check". This target will do the same thing as the - 'dist' target but also test that distribution to make sure it works. This - ensures that needed files are not missing and that the src tarball can be - successfully unbacked, built, installed, and cleaned. This two-level testing - needs to be done on each target platform. - --> + 'dist' target but also test that distribution to make sure it can build itself + and runs "make check" as well. This ensures that needed files are not + missing and that the src tarball can be successfully unpacked, built, + installed, and cleaned. Once you have a reliable tarball, you need to copy + it to the /usr/src/redhat/SOURCES directory which is a requirement of the + rpmbuild tool. The last two "make" invocations just run rpmbuild to build + either a source (srpm) or binary (rpm) RPM package.

      @@ -504,7 +520,7 @@ Reid Spencer
      The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/10 00:23:05 $ + Last modified: $Date: 2006/08/16 00:54:50 $ From lattner at cs.uiuc.edu Tue Aug 15 20:23:45 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 20:23:45 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200608160123.k7G1Nj4d023110@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.12 -> 1.13 --- Log message: Bugfixes for smallvector when the element size is small and N is small. --- Diffs of the changes: (+17 -4) SmallVector.h | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.12 llvm/include/llvm/ADT/SmallVector.h:1.13 --- llvm/include/llvm/ADT/SmallVector.h:1.12 Mon Aug 14 16:47:50 2006 +++ llvm/include/llvm/ADT/SmallVector.h Tue Aug 15 20:23:31 2006 @@ -228,17 +228,30 @@ /// InlineElts - These are 'N-1' elements that are stored inline in the body /// of the vector. The extra '1' element is stored in SmallVectorImpl. typedef typename SmallVectorImpl::U U; - U InlineElts[(sizeof(T)*N+sizeof(U)-1)/sizeof(U) - 1]; + enum { + // MinUs - The number of U's require to cover N T's. + MinUs = (sizeof(T)*N+sizeof(U)-1)/sizeof(U), + + // NumInlineEltsElts - The number of elements actually in this array. There + // is already one in the parent class, and we have to round up to avoid + // having a zero-element array. + NumInlineEltsElts = (MinUs - 1) > 0 ? (MinUs - 1) : 1, + + // NumTsAvailable - The number of T's we actually have space for, which may + // be more than N due to rounding. + NumTsAvailable = (NumInlineEltsElts+1)*sizeof(U) / sizeof(T) + }; + U InlineElts[NumInlineEltsElts]; public: - SmallVector() : SmallVectorImpl(N) { + SmallVector() : SmallVectorImpl(NumTsAvailable) { } template - SmallVector(ItTy S, ItTy E) : SmallVectorImpl(N) { + SmallVector(ItTy S, ItTy E) : SmallVectorImpl(NumTsAvailable) { append(S, E); } - SmallVector(const SmallVector &RHS) : SmallVectorImpl(N) { + SmallVector(const SmallVector &RHS) : SmallVectorImpl(NumTsAvailable) { operator=(RHS); } }; From lattner at cs.uiuc.edu Tue Aug 15 20:24:27 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 20:24:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Message-ID: <200608160124.k7G1ORVL023161@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/Interpreter: ExternalFunctions.cpp updated: 1.87 -> 1.88 --- Log message: initial changes to support JIT'ing from multiple module providers, implicitly linking the program on the fly. --- Diffs of the changes: (+1 -1) ExternalFunctions.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp diff -u llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.87 llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.88 --- llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:1.87 Thu Jun 1 12:27:11 2006 +++ llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp Tue Aug 15 20:24:12 2006 @@ -313,7 +313,7 @@ case 'x': case 'X': if (HowLong >= 1) { if (HowLong == 1 && - TheInterpreter->getModule().getPointerSize()==Module::Pointer64 && + TheInterpreter->getTargetData()->getPointerSizeInBits() == 64 && sizeof(long) < sizeof(int64_t)) { // Make sure we use %lld with a 64 bit argument because we might be // compiling LLI on a 32 bit compiler. From lattner at cs.uiuc.edu Tue Aug 15 20:24:29 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 20:24:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Message-ID: <200608160124.k7G1OTwg023166@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ExecutionEngine: ExecutionEngine.h updated: 1.38 -> 1.39 --- Log message: initial changes to support JIT'ing from multiple module providers, implicitly linking the program on the fly. --- Diffs of the changes: (+11 -6) ExecutionEngine.h | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.38 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.39 --- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.38 Mon May 8 17:00:26 2006 +++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Tue Aug 15 20:24:12 2006 @@ -20,6 +20,7 @@ #include #include #include "llvm/System/Mutex.h" +#include "llvm/ADT/SmallVector.h" namespace llvm { @@ -60,14 +61,13 @@ class ExecutionEngine { - Module &CurMod; const TargetData *TD; - ExecutionEngineState state; - protected: - ModuleProvider *MP; - + /// Modules - This is a list of ModuleProvider's that we are JIT'ing from. We + /// use a smallvector to optimize for the case where there is only one module. + SmallVector Modules; + void setTargetData(const TargetData *td) { TD = td; } @@ -88,9 +88,14 @@ ExecutionEngine(Module *M); virtual ~ExecutionEngine(); - Module &getModule() const { return CurMod; } + //Module &getModule() const { return CurMod; } const TargetData *getTargetData() const { return TD; } + /// FindFunctionNamed - Search all of the active modules to find the one that + /// defines FnName. This is very slow operation and shouldn't be used for + /// general code. + Function *FindFunctionNamed(const char *FnName); + /// create - This is the factory method for creating an execution engine which /// is appropriate for the current machine. static ExecutionEngine *create(ModuleProvider *MP, From lattner at cs.uiuc.edu Tue Aug 15 20:24:31 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 20:24:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.cpp JITEmitter.cpp Message-ID: <200608160124.k7G1OVnc023178@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JIT.cpp updated: 1.72 -> 1.73 JITEmitter.cpp updated: 1.110 -> 1.111 --- Log message: initial changes to support JIT'ing from multiple module providers, implicitly linking the program on the fly. --- Diffs of the changes: (+13 -3) JIT.cpp | 13 ++++++++++++- JITEmitter.cpp | 3 +-- 2 files changed, 13 insertions(+), 3 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JIT.cpp diff -u llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.72 llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.73 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp:1.72 Sat Jul 22 11:59:38 2006 +++ llvm/lib/ExecutionEngine/JIT/JIT.cpp Tue Aug 15 20:24:12 2006 @@ -263,8 +263,19 @@ if (void *Addr = getPointerToGlobalIfAvailable(F)) return Addr; // Check if function already code gen'd - // Make sure we read in the function if it exists in this Module + // Make sure we read in the function if it exists in this Module. if (F->hasNotBeenReadFromBytecode()) { + // Determine the module provider this function is provided by. + Module *M = F->getParent(); + ModuleProvider *MP = 0; + for (unsigned i = 0, e = Modules.size(); i != e; ++i) { + if (Modules[i]->getModule() == M) { + MP = Modules[i]; + break; + } + } + assert(MP && "Function isn't in a module we know about!"); + std::string ErrorMsg; if (MP->materializeFunction(F, &ErrorMsg)) { std::cerr << "Error reading function '" << F->getName() Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.110 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.111 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.110 Thu Jul 27 13:19:24 2006 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Tue Aug 15 20:24:12 2006 @@ -972,8 +972,7 @@ // resolve their addresses at runtime, and this is the way to do it. extern "C" { void *getPointerToNamedFunction(const char *Name) { - Module &M = TheJIT->getModule(); - if (Function *F = M.getNamedFunction(Name)) + if (Function *F = TheJIT->FindFunctionNamed(Name)) return TheJIT->getPointerToFunction(F); return TheJIT->getPointerToNamedFunction(Name); } From lattner at cs.uiuc.edu Tue Aug 15 20:24:31 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 20:24:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200608160124.k7G1OVBB023171@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.83 -> 1.84 --- Log message: initial changes to support JIT'ing from multiple module providers, implicitly linking the program on the fly. --- Diffs of the changes: (+150 -56) ExecutionEngine.cpp | 206 +++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 150 insertions(+), 56 deletions(-) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.83 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.84 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.83 Sun May 14 14:01:55 2006 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Tue Aug 15 20:24:12 2006 @@ -35,19 +35,33 @@ ExecutionEngine::EECtorFn ExecutionEngine::JITCtor = 0; ExecutionEngine::EECtorFn ExecutionEngine::InterpCtor = 0; -ExecutionEngine::ExecutionEngine(ModuleProvider *P) : - CurMod(*P->getModule()), MP(P) { +ExecutionEngine::ExecutionEngine(ModuleProvider *P) { + Modules.push_back(P); assert(P && "ModuleProvider is null?"); } -ExecutionEngine::ExecutionEngine(Module *M) : CurMod(*M), MP(0) { +ExecutionEngine::ExecutionEngine(Module *M) { assert(M && "Module is null?"); + Modules.push_back(new ExistingModuleProvider(M)); } ExecutionEngine::~ExecutionEngine() { - delete MP; + for (unsigned i = 0, e = Modules.size(); i != e; ++i) + delete Modules[i]; } +/// FindFunctionNamed - Search all of the active modules to find the one that +/// defines FnName. This is very slow operation and shouldn't be used for +/// general code. +Function *ExecutionEngine::FindFunctionNamed(const char *FnName) { + for (unsigned i = 0, e = Modules.size(); i != e; ++i) { + if (Function *F = Modules[i]->getModule()->getNamedFunction(FnName)) + return F; + } + return 0; +} + + /// addGlobalMapping - Tell the execution engine that the specified global is /// at the specified location. This is used internally as functions are JIT'd /// and as global variables are laid out in memory. It can and should also be @@ -168,37 +182,43 @@ /// runStaticConstructorsDestructors - This method is used to execute all of -/// the static constructors or destructors for a module, depending on the +/// the static constructors or destructors for a program, depending on the /// value of isDtors. void ExecutionEngine::runStaticConstructorsDestructors(bool isDtors) { const char *Name = isDtors ? "llvm.global_dtors" : "llvm.global_ctors"; - GlobalVariable *GV = CurMod.getNamedGlobal(Name); - - // If this global has internal linkage, or if it has a use, then it must be - // an old-style (llvmgcc3) static ctor with __main linked in and in use. If - // this is the case, don't execute any of the global ctors, __main will do it. - if (!GV || GV->isExternal() || GV->hasInternalLinkage()) return; - // Should be an array of '{ int, void ()* }' structs. The first value is the - // init priority, which we ignore. - ConstantArray *InitList = dyn_cast(GV->getInitializer()); - if (!InitList) return; - for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) - if (ConstantStruct *CS = dyn_cast(InitList->getOperand(i))){ - if (CS->getNumOperands() != 2) return; // Not array of 2-element structs. + // Execute global ctors/dtors for each module in the program. + for (unsigned m = 0, e = Modules.size(); m != e; ++m) { + GlobalVariable *GV = Modules[m]->getModule()->getNamedGlobal(Name); + + // If this global has internal linkage, or if it has a use, then it must be + // an old-style (llvmgcc3) static ctor with __main linked in and in use. If + // this is the case, don't execute any of the global ctors, __main will do + // it. + if (!GV || GV->isExternal() || GV->hasInternalLinkage()) continue; + + // Should be an array of '{ int, void ()* }' structs. The first value is + // the init priority, which we ignore. + ConstantArray *InitList = dyn_cast(GV->getInitializer()); + if (!InitList) continue; + for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) + if (ConstantStruct *CS = + dyn_cast(InitList->getOperand(i))) { + if (CS->getNumOperands() != 2) break; // Not array of 2-element structs. - Constant *FP = CS->getOperand(1); - if (FP->isNullValue()) - return; // Found a null terminator, exit. + Constant *FP = CS->getOperand(1); + if (FP->isNullValue()) + break; // Found a null terminator, exit. - if (ConstantExpr *CE = dyn_cast(FP)) - if (CE->getOpcode() == Instruction::Cast) - FP = CE->getOperand(0); - if (Function *F = dyn_cast(FP)) { - // Execute the ctor/dtor function! - runFunction(F, std::vector()); + if (ConstantExpr *CE = dyn_cast(FP)) + if (CE->getOpcode() == Instruction::Cast) + FP = CE->getOperand(0); + if (Function *F = dyn_cast(FP)) { + // Execute the ctor/dtor function! + runFunction(F, std::vector()); + } } - } + } } /// runFunctionAsMain - This is a helper function which wraps runFunction to @@ -610,36 +630,110 @@ const TargetData *TD = getTargetData(); // Loop over all of the global variables in the program, allocating the memory - // to hold them. - Module &M = getModule(); - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) - if (!I->isExternal()) { - // Get the type of the global... - const Type *Ty = I->getType()->getElementType(); - - // Allocate some memory for it! - unsigned Size = TD->getTypeSize(Ty); - addGlobalMapping(I, new char[Size]); - } else { - // External variable reference. Try to use the dynamic loader to - // get a pointer to it. - if (void *SymAddr = sys::DynamicLibrary::SearchForAddressOfSymbol( - I->getName().c_str())) - addGlobalMapping(I, SymAddr); - else { - std::cerr << "Could not resolve external global address: " - << I->getName() << "\n"; - abort(); + // to hold them. If there is more than one module, do a prepass over globals + // to figure out how the different modules should link together. + // + std::map, + const GlobalValue*> LinkedGlobalsMap; + + if (Modules.size() != 1) { + for (unsigned m = 0, e = Modules.size(); m != e; ++m) { + Module &M = *Modules[m]->getModule(); + for (Module::const_global_iterator I = M.global_begin(), + E = M.global_end(); I != E; ++I) { + const GlobalValue *GV = I; + if (GV->hasInternalLinkage() || GV->isExternal() || + GV->hasAppendingLinkage() || !GV->hasName()) + continue;// Ignore external globals and globals with internal linkage. + + const GlobalValue *&GVEntry = + LinkedGlobalsMap[std::make_pair(GV->getName(), GV->getType())]; + + // If this is the first time we've seen this global, it is the canonical + // version. + if (!GVEntry) { + GVEntry = GV; + continue; + } + + // If the existing global is strong, never replace it. + if (GVEntry->hasExternalLinkage()) + continue; + + // Otherwise, we know it's linkonce/weak, replace it if this is a strong + // symbol. + if (GV->hasExternalLinkage()) + GVEntry = GV; } } - - // Now that all of the globals are set up in memory, loop through them all and - // initialize their contents. - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) - if (!I->isExternal()) - EmitGlobalVariable(I); + } + + std::vector NonCanonicalGlobals; + for (unsigned m = 0, e = Modules.size(); m != e; ++m) { + Module &M = *Modules[m]->getModule(); + for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) { + // In the multi-module case, see what this global maps to. + if (!LinkedGlobalsMap.empty()) { + if (const GlobalValue *GVEntry = + LinkedGlobalsMap[std::make_pair(I->getName(), I->getType())]) { + // If something else is the canonical global, ignore this one. + if (GVEntry != &*I) { + NonCanonicalGlobals.push_back(I); + continue; + } + } + } + + if (!I->isExternal()) { + // Get the type of the global. + const Type *Ty = I->getType()->getElementType(); + + // Allocate some memory for it! + unsigned Size = TD->getTypeSize(Ty); + addGlobalMapping(I, new char[Size]); + } else { + // External variable reference. Try to use the dynamic loader to + // get a pointer to it. + if (void *SymAddr = + sys::DynamicLibrary::SearchForAddressOfSymbol(I->getName().c_str())) + addGlobalMapping(I, SymAddr); + else { + std::cerr << "Could not resolve external global address: " + << I->getName() << "\n"; + abort(); + } + } + } + + // If there are multiple modules, map the non-canonical globals to their + // canonical location. + if (!NonCanonicalGlobals.empty()) { + for (unsigned i = 0, e = NonCanonicalGlobals.size(); i != e; ++i) { + const GlobalValue *GV = NonCanonicalGlobals[i]; + const GlobalValue *CGV = + LinkedGlobalsMap[std::make_pair(GV->getName(), GV->getType())]; + void *Ptr = getPointerToGlobalIfAvailable(CGV); + assert(Ptr && "Canonical global wasn't codegen'd!"); + addGlobalMapping(GV, getPointerToGlobalIfAvailable(CGV)); + } + } + + // Now that all of the globals are set up in memory, loop through them all and + // initialize their contents. + for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); + I != E; ++I) { + if (!I->isExternal()) { + if (!LinkedGlobalsMap.empty()) { + if (const GlobalValue *GVEntry = + LinkedGlobalsMap[std::make_pair(I->getName(), I->getType())]) + if (GVEntry != &*I) // Not the canonical variable. + continue; + } + EmitGlobalVariable(I); + } + } + } } // EmitGlobalVariable - This method emits the specified global variable to the From lattner at cs.uiuc.edu Tue Aug 15 21:47:58 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 21:47:58 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/README.txt Message-ID: <200608160247.k7G2lwtF024473@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: README.txt updated: 1.123 -> 1.124 --- Log message: add a note --- Diffs of the changes: (+13 -0) README.txt | 13 +++++++++++++ 1 files changed, 13 insertions(+) Index: llvm/lib/Target/X86/README.txt diff -u llvm/lib/Target/X86/README.txt:1.123 llvm/lib/Target/X86/README.txt:1.124 --- llvm/lib/Target/X86/README.txt:1.123 Wed Aug 2 00:31:20 2006 +++ llvm/lib/Target/X86/README.txt Tue Aug 15 21:47:44 2006 @@ -709,3 +709,16 @@ When using fastcc abi, align stack slot of argument of type double on 8 byte boundary to improve performance. + +//===---------------------------------------------------------------------===// + +Codegen: + +if ((variable == 4) || (variable == 6)) { stuff } + +as: + +or eax, 2 +cmp eax, 6 +jz label + From lattner at cs.uiuc.edu Tue Aug 15 21:53:41 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 15 Aug 2006 21:53:41 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Message-ID: <200608160253.k7G2rfgs024605@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ExecutionEngine: ExecutionEngine.h updated: 1.39 -> 1.40 --- Log message: add a way to have multiple modules in a JIT :) --- Diffs of the changes: (+7 -1) ExecutionEngine.h | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.39 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.40 --- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.39 Tue Aug 15 20:24:12 2006 +++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Tue Aug 15 21:53:27 2006 @@ -88,9 +88,15 @@ ExecutionEngine(Module *M); virtual ~ExecutionEngine(); - //Module &getModule() const { return CurMod; } const TargetData *getTargetData() const { return TD; } + /// addModuleProvider - Add a ModuleProvider to the list of modules that we + /// can JIT from. Note that this takes ownership of the ModuleProvider: when + /// the ExecutionEngine is destroyed, it destroys the MP as well. + void addModuleProvider(ModuleProvider *P) { + Modules.push_back(P); + } + /// FindFunctionNamed - Search all of the active modules to find the one that /// defines FnName. This is very slow operation and shouldn't be used for /// general code. From reid at x10sys.com Wed Aug 16 00:53:46 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Aug 2006 00:53:46 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608160553.k7G5rkan027464@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.11 -> 1.12 --- Log message: Fix a thinko noticed by Chandler Carruth. --- Diffs of the changes: (+4 -3) GetElementPtr.html | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.11 llvm/docs/GetElementPtr.html:1.12 --- llvm/docs/GetElementPtr.html:1.11 Tue Aug 15 07:15:08 2006 +++ llvm/docs/GetElementPtr.html Wed Aug 16 00:53:32 2006 @@ -112,8 +112,9 @@

      In this "C" example, the front end compiler (llvm-gcc) will generate three GEP instructions for the three indices through "P" in the assignment statement. The function argument P will be the first operand of each - of these GEP instructions. The second operand will be the field offset into - the struct munger_struct type, for either the f1 or + of these GEP instructions. The second operand indexes through that pointer. + The third operand will be the field offset into the + struct munger_struct type, for either the f1 or f2 field. So, in LLVM assembly the munge function looks like:

      @@ -630,7 +631,7 @@
         Valid HTML 4.01!
         The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/15 12:15:08 $ + Last modified: $Date: 2006/08/16 05:53:32 $ From evan.cheng at apple.com Wed Aug 16 02:25:30 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 02:25:30 -0500 Subject: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp Message-ID: <200608160725.k7G7PUAm004536@zion.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.244 -> 1.245 --- Log message: SelectNodeTo() may return a SDOperand that is different from the input. --- Diffs of the changes: (+1 -4) DAGISelEmitter.cpp | 5 +---- 1 files changed, 1 insertion(+), 4 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.244 llvm/utils/TableGen/DAGISelEmitter.cpp:1.245 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.244 Tue Aug 15 18:42:26 2006 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Wed Aug 16 02:25:15 2006 @@ -2794,8 +2794,6 @@ if (NodeHasInFlag || HasImpInputs) Code += ", InFlag"; emitCode(Code + ");"); - if (isRoot) - emitCode(" return NULL;"); emitCode("} else {"); emitDecl("ResNode", 1); Code = " ResNode = CurDAG->getTargetNode(Opc" + utostr(OpcNo); @@ -2812,9 +2810,8 @@ Code += ", InFlag"; emitCode(Code + ");"); emitCode(" Result = SDOperand(ResNode, 0);"); - if (isRoot) - emitCode(" return Result.Val;"); emitCode("}"); + emitCode("return Result.Val;"); } return std::make_pair(1, ResNo); From evan.cheng at apple.com Wed Aug 16 02:26:08 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 02:26:08 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Message-ID: <200608160726.k7G7Q8Yf004567@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaISelDAGToDAG.cpp updated: 1.50 -> 1.51 --- Log message: SelectNodeTo() may return a SDOperand that is different from the input. --- Diffs of the changes: (+12 -17) AlphaISelDAGToDAG.cpp | 29 ++++++++++++----------------- 1 files changed, 12 insertions(+), 17 deletions(-) Index: llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp diff -u llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.50 llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.51 --- llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp:1.50 Fri Aug 11 04:07:02 2006 +++ llvm/lib/Target/Alpha/AlphaISelDAGToDAG.cpp Wed Aug 16 02:25:54 2006 @@ -197,10 +197,9 @@ case ISD::FrameIndex: { int FI = cast(N)->getIndex(); - Result = CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64, - CurDAG->getTargetFrameIndex(FI, MVT::i32), - getI64Imm(0)); - return NULL; + return CurDAG->SelectNodeTo(N, Alpha::LDA, MVT::i64, + CurDAG->getTargetFrameIndex(FI, MVT::i32), + getI64Imm(0)).Val; } case AlphaISD::GlobalBaseReg: Result = getGlobalBaseReg(); @@ -228,8 +227,7 @@ Chain, Chain.getValue(1)); Chain = CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64, SDOperand(CNode, 1)); - Result = CurDAG->SelectNodeTo(N, Alpha::BIS, MVT::i64, Chain, Chain); - return NULL; + return CurDAG->SelectNodeTo(N, Alpha::BIS, MVT::i64, Chain, Chain).Val; } case ISD::READCYCLECOUNTER: { @@ -266,24 +264,21 @@ SDOperand CPI = CurDAG->getTargetConstantPool(C, MVT::i64); SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, MVT::i64, CPI, getGlobalBaseReg()); - Result = CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, - CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()); - return NULL; + return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other, + CPI, SDOperand(Tmp, 0), CurDAG->getEntryNode()).Val; } case ISD::TargetConstantFP: { ConstantFPSDNode *CN = cast(N); bool isDouble = N->getValueType(0) == MVT::f64; MVT::ValueType T = isDouble ? MVT::f64 : MVT::f32; if (CN->isExactlyValue(+0.0)) { - Result = CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS, - T, CurDAG->getRegister(Alpha::F31, T), - CurDAG->getRegister(Alpha::F31, T)); - return NULL; + return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYST : Alpha::CPYSS, + T, CurDAG->getRegister(Alpha::F31, T), + CurDAG->getRegister(Alpha::F31, T)).Val; } else if ( CN->isExactlyValue(-0.0)) { - Result = CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS, - T, CurDAG->getRegister(Alpha::F31, T), - CurDAG->getRegister(Alpha::F31, T)); - return NULL; + return CurDAG->SelectNodeTo(N, isDouble ? Alpha::CPYSNT : Alpha::CPYSNS, + T, CurDAG->getRegister(Alpha::F31, T), + CurDAG->getRegister(Alpha::F31, T)).Val; } else { abort(); } From evan.cheng at apple.com Wed Aug 16 02:29:12 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 02:29:12 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelLowering.cpp Message-ID: <200608160729.k7G7TCMn004646@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelLowering.cpp updated: 1.40 -> 1.41 --- Log message: RET_FLAG has an optional input flag, but it does not produce a flag result. --- Diffs of the changes: (+2 -8) IA64ISelLowering.cpp | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) Index: llvm/lib/Target/IA64/IA64ISelLowering.cpp diff -u llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.40 llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.41 --- llvm/lib/Target/IA64/IA64ISelLowering.cpp:1.40 Fri Aug 11 12:38:39 2006 +++ llvm/lib/Target/IA64/IA64ISelLowering.cpp Wed Aug 16 02:28:58 2006 @@ -573,14 +573,8 @@ SDOperand()); AR_PFSVal = DAG.getCopyToReg(Copy.getValue(0), IA64::AR_PFS, AR_PFSVal, Copy.getValue(1)); - std::vector NodeTys; - std::vector RetOperands; - NodeTys.push_back(MVT::Other); - NodeTys.push_back(MVT::Flag); - RetOperands.push_back(AR_PFSVal); - RetOperands.push_back(AR_PFSVal.getValue(1)); - return DAG.getNode(IA64ISD::RET_FLAG, NodeTys, - &RetOperands[0], RetOperands.size()); + return DAG.getNode(IA64ISD::RET_FLAG, MVT::Other, + AR_PFSVal, AR_PFSVal.getValue(1)); } } return SDOperand(); From evan.cheng at apple.com Wed Aug 16 02:29:27 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 02:29:27 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Message-ID: <200608160729.k7G7TRBx004662@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64ISelDAGToDAG.cpp updated: 1.48 -> 1.49 --- Log message: SelectNodeTo() may return a SDOperand that is different from the input. --- Diffs of the changes: (+20 -31) IA64ISelDAGToDAG.cpp | 51 ++++++++++++++++++++------------------------------- 1 files changed, 20 insertions(+), 31 deletions(-) Index: llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp diff -u llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.48 llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.49 --- llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp:1.48 Fri Aug 11 04:07:25 2006 +++ llvm/lib/Target/IA64/IA64ISelDAGToDAG.cpp Wed Aug 16 02:29:13 2006 @@ -398,25 +398,21 @@ SDOperand Chain = CurDAG->getEntryNode(); // this is a constant, so.. if (cast(N)->isExactlyValue(+0.0)) { - Result = CurDAG->getCopyFromReg(Chain, IA64::F0, MVT::f64); + return CurDAG->getCopyFromReg(Chain, IA64::F0, MVT::f64).Val; } else if (cast(N)->isExactlyValue(+1.0)) { - Result = CurDAG->getCopyFromReg(Chain, IA64::F1, MVT::f64); + return CurDAG->getCopyFromReg(Chain, IA64::F1, MVT::f64).Val; } else assert(0 && "Unexpected FP constant!"); - return Result.Val; } case ISD::FrameIndex: { // TODO: reduce creepyness int FI = cast(N)->getIndex(); - if (N->hasOneUse()) { - Result = CurDAG->SelectNodeTo(N, IA64::MOV, MVT::i64, - CurDAG->getTargetFrameIndex(FI, MVT::i64)); - return NULL; - } else { - Result = SDOperand(CurDAG->getTargetNode(IA64::MOV, MVT::i64, - CurDAG->getTargetFrameIndex(FI, MVT::i64)), 0); - return Result.Val; - } + if (N->hasOneUse()) + return CurDAG->SelectNodeTo(N, IA64::MOV, MVT::i64, + CurDAG->getTargetFrameIndex(FI, MVT::i64)).Val; + else + return SDOperand(CurDAG->getTargetNode(IA64::MOV, MVT::i64, + CurDAG->getTargetFrameIndex(FI, MVT::i64)), 0).Val; } case ISD::ConstantPool: { // TODO: nuke the constant pool @@ -467,11 +463,10 @@ case MVT::i1: { // this is a bool Opc = IA64::LD1; // first we load a byte, then compare for != 0 if(N->getValueType(0) == MVT::i1) { // XXX: early exit! - Result = CurDAG->SelectNodeTo(N, IA64::CMPNE, MVT::i1, MVT::Other, + return CurDAG->SelectNodeTo(N, IA64::CMPNE, MVT::i1, MVT::Other, SDOperand(CurDAG->getTargetNode(Opc, MVT::i64, Address), 0), - CurDAG->getRegister(IA64::r0, MVT::i64), - Chain).getValue(Op.ResNo); - return NULL; + CurDAG->getRegister(IA64::r0, MVT::i64), + Chain).getValue(Op.ResNo).Val; } /* otherwise, we want to load a bool into something bigger: LD1 will do that for us, so we just fall through */ @@ -486,9 +481,8 @@ } // TODO: comment this - Result = CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other, - Address, Chain).getValue(Op.ResNo); - return NULL; + return CurDAG->SelectNodeTo(N, Opc, N->getValueType(0), MVT::Other, + Address, Chain).getValue(Op.ResNo).Val; } case ISD::TRUNCSTORE: @@ -512,8 +506,7 @@ Tmp = SDOperand(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial, CurDAG->getConstant(1, MVT::i64), Tmp), 0); - Result = CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain); - return NULL; + return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain).Val; } case MVT::i64: Opc = IA64::ST8; break; case MVT::f64: Opc = IA64::STF8; break; @@ -531,8 +524,7 @@ SDOperand N1, N2; AddToQueue(N1, N->getOperand(1)); AddToQueue(N2, N->getOperand(2)); - Result = CurDAG->SelectNodeTo(N, Opc, MVT::Other, N2, N1, Chain); - return NULL; + return CurDAG->SelectNodeTo(N, Opc, MVT::Other, N2, N1, Chain).Val; } case ISD::BRCOND: { @@ -542,9 +534,8 @@ MachineBasicBlock *Dest = cast(N->getOperand(2))->getBasicBlock(); //FIXME - we do NOT need long branches all the time - Result = CurDAG->SelectNodeTo(N, IA64::BRLCOND_NOTCALL, MVT::Other, CC, - CurDAG->getBasicBlock(Dest), Chain); - return NULL; + return CurDAG->SelectNodeTo(N, IA64::BRLCOND_NOTCALL, MVT::Other, CC, + CurDAG->getBasicBlock(Dest), Chain).Val; } case ISD::CALLSEQ_START: @@ -554,17 +545,15 @@ IA64::ADJUSTCALLSTACKDOWN : IA64::ADJUSTCALLSTACKUP; SDOperand N0; AddToQueue(N0, N->getOperand(0)); - Result = CurDAG->SelectNodeTo(N, Opc, MVT::Other, getI64Imm(Amt), N0); - return NULL; + return CurDAG->SelectNodeTo(N, Opc, MVT::Other, getI64Imm(Amt), N0).Val; } case ISD::BR: // FIXME: we don't need long branches all the time! SDOperand N0; AddToQueue(N0, N->getOperand(0)); - Result = CurDAG->SelectNodeTo(N, IA64::BRL_NOTCALL, MVT::Other, - N->getOperand(1), N0); - return NULL; + return CurDAG->SelectNodeTo(N, IA64::BRL_NOTCALL, MVT::Other, + N->getOperand(1), N0).Val; } return SelectCode(Result, Op); From evan.cheng at apple.com Wed Aug 16 02:29:54 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 02:29:54 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Message-ID: <200608160729.k7G7TsNY004680@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcISelDAGToDAG.cpp updated: 1.103 -> 1.104 --- Log message: SelectNodeTo() may return a SDOperand that is different from the input. --- Diffs of the changes: (+3 -3) SparcISelDAGToDAG.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp diff -u llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.103 llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.104 --- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp:1.103 Fri Aug 11 04:08:15 2006 +++ llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp Wed Aug 16 02:29:40 2006 @@ -1093,8 +1093,8 @@ // FIXME: Handle div by immediate. unsigned Opcode = N->getOpcode() == ISD::SDIV ? SP::SDIVrr : SP::UDIVrr; - Result = CurDAG->SelectNodeTo(N, Opcode, MVT::i32, DivLHS, DivRHS, TopPart); - return NULL; + return CurDAG->SelectNodeTo(N, Opcode, MVT::i32, DivLHS, DivRHS, + TopPart).Val; } case ISD::MULHU: case ISD::MULHS: { @@ -1106,7 +1106,7 @@ SDNode *Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag, MulLHS, MulRHS); // The high part is in the Y register. - Result = CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDOperand(Mul, 1)); + return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDOperand(Mul, 1)).Val; return NULL; } } From evan.cheng at apple.com Wed Aug 16 02:30:23 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 02:30:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200608160730.k7G7UNUM004709@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.91 -> 1.92 --- Log message: SelectNodeTo() may return a SDOperand that is different from the input. --- Diffs of the changes: (+1 -2) X86ISelDAGToDAG.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.91 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.92 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.91 Fri Aug 11 04:05:03 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Aug 16 02:30:09 2006 @@ -703,8 +703,7 @@ if (C.Val) { if (N.Val->hasOneUse()) { - Result = CurDAG->SelectNodeTo(N.Val, X86::MOV32ri, MVT::i32, C); - return NULL; + return CurDAG->SelectNodeTo(N.Val, X86::MOV32ri, MVT::i32, C).Val; } else { SDNode *ResNode = CurDAG->getTargetNode(X86::MOV32ri, MVT::i32, C); Result = SDOperand(ResNode, 0); From rafael.espindola at gmail.com Wed Aug 16 09:43:47 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Wed, 16 Aug 2006 09:43:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMFrameInfo.h ARMISelDAGToDAG.cpp ARMInstrInfo.td ARMRegisterInfo.cpp ARMTargetMachine.cpp ARMTargetMachine.h Message-ID: <200608161443.k7GEhlY3005148@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMFrameInfo.h added (r1.1) ARMISelDAGToDAG.cpp updated: 1.29 -> 1.30 ARMInstrInfo.td updated: 1.14 -> 1.15 ARMRegisterInfo.cpp updated: 1.14 -> 1.15 ARMTargetMachine.cpp updated: 1.4 -> 1.5 ARMTargetMachine.h updated: 1.1 -> 1.2 --- Log message: Declare the callee saved regs Remove the hard coded store and load of the link register Implement ARMFrameInfo --- Diffs of the changes: (+60 -14) ARMFrameInfo.h | 43 +++++++++++++++++++++++++++++++++++++++++++ ARMISelDAGToDAG.cpp | 5 ++--- ARMInstrInfo.td | 2 +- ARMRegisterInfo.cpp | 18 ++++++++++-------- ARMTargetMachine.cpp | 3 ++- ARMTargetMachine.h | 3 ++- 6 files changed, 60 insertions(+), 14 deletions(-) Index: llvm/lib/Target/ARM/ARMFrameInfo.h diff -c /dev/null llvm/lib/Target/ARM/ARMFrameInfo.h:1.1 *** /dev/null Wed Aug 16 09:43:43 2006 --- llvm/lib/Target/ARM/ARMFrameInfo.h Wed Aug 16 09:43:33 2006 *************** *** 0 **** --- 1,43 ---- + //===-- ARMTargetFrameInfo.h - Define TargetFrameInfo for ARM ---*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the "Instituto Nokia de Tecnologia" and + // is distributed under the University of Illinois Open Source + // License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // + // + //===----------------------------------------------------------------------===// + + #ifndef ARM_FRAMEINFO_H + #define ARM_FRAMEINFO_H + + #include "ARM.h" + #include "llvm/Target/TargetFrameInfo.h" + #include "llvm/Target/TargetMachine.h" + + namespace llvm { + + class ARMFrameInfo: public TargetFrameInfo { + std::pair LR[1]; + + public: + ARMFrameInfo() + : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) { + LR[0].first = ARM::R14; + LR[0].second = -4; + } + + const std::pair * + getCalleeSaveSpillSlots(unsigned &NumEntries) const { + NumEntries = 1; + return &LR[0]; + } + }; + + } // End llvm namespace + + #endif Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.29 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.30 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.29 Mon Aug 14 14:01:24 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Wed Aug 16 09:43:33 2006 @@ -84,9 +84,8 @@ SDOperand Callee = Op.getOperand(4); unsigned NumOps = (Op.getNumOperands() - 5) / 2; - // Count how many bytes are to be pushed on the stack. Initially - // only the link register. - unsigned NumBytes = 4; + // Count how many bytes are to be pushed on the stack. + unsigned NumBytes = 0; // Add up all the space actually used. for (unsigned i = 4; i < NumOps; ++i) Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.14 llvm/lib/Target/ARM/ARMInstrInfo.td:1.15 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.14 Fri Aug 11 04:01:08 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Wed Aug 16 09:43:33 2006 @@ -61,7 +61,7 @@ def bx: InstARM<(ops), "bx r14", [(retflag)]>; } -let Defs = [R0, R1, R2, R3] in { +let Defs = [R0, R1, R2, R3, R14] in { def bl: InstARM<(ops i32imm:$func, variable_ops), "bl $func", [(ARMcall tglobaladdr:$func)]>; } Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.14 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.15 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.14 Wed Aug 9 12:37:45 2006 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Wed Aug 16 09:43:33 2006 @@ -58,13 +58,21 @@ } const unsigned* ARMRegisterInfo::getCalleeSaveRegs() const { - static const unsigned CalleeSaveRegs[] = { 0 }; + static const unsigned CalleeSaveRegs[] = { + ARM::R4, ARM::R5, ARM::R6, ARM::R7, + ARM::R8, ARM::R9, ARM::R10, ARM::R11, + ARM::R14, 0 + }; return CalleeSaveRegs; } const TargetRegisterClass* const * ARMRegisterInfo::getCalleeSaveRegClasses() const { - static const TargetRegisterClass * const CalleeSaveRegClasses[] = { 0 }; + static const TargetRegisterClass * const CalleeSaveRegClasses[] = { + &ARM::IntRegsRegClass, &ARM::IntRegsRegClass, &ARM::IntRegsRegClass, &ARM::IntRegsRegClass, + &ARM::IntRegsRegClass, &ARM::IntRegsRegClass, &ARM::IntRegsRegClass, &ARM::IntRegsRegClass, + &ARM::IntRegsRegClass, 0 + }; return CalleeSaveRegClasses; } @@ -126,16 +134,12 @@ // entry to the current function. This eliminates the need for add/sub // brackets around call sites. NumBytes += MFI->getMaxCallFrameSize(); - } else { - NumBytes += 4; } MFI->setStackSize(NumBytes); //sub sp, sp, #NumBytes BuildMI(MBB, MBBI, ARM::subri, 2, ARM::R13).addReg(ARM::R13).addImm(NumBytes); - //str lr, [sp, #NumBytes - 4] - BuildMI(MBB, MBBI, ARM::str, 2, ARM::R14).addImm(NumBytes - 4).addReg(ARM::R13); } void ARMRegisterInfo::emitEpilogue(MachineFunction &MF, @@ -147,8 +151,6 @@ MachineFrameInfo *MFI = MF.getFrameInfo(); int NumBytes = (int) MFI->getStackSize(); - //ldr lr, [sp] - BuildMI(MBB, MBBI, ARM::ldr, 2, ARM::R14).addImm(NumBytes - 4).addReg(ARM::R13); //add sp, sp, #NumBytes BuildMI(MBB, MBBI, ARM::addri, 2, ARM::R13).addReg(ARM::R13).addImm(NumBytes); } Index: llvm/lib/Target/ARM/ARMTargetMachine.cpp diff -u llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.4 llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.5 --- llvm/lib/Target/ARM/ARMTargetMachine.cpp:1.4 Wed Aug 9 12:37:45 2006 +++ llvm/lib/Target/ARM/ARMTargetMachine.cpp Wed Aug 16 09:43:33 2006 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "ARMTargetMachine.h" +#include "ARMFrameInfo.h" #include "ARM.h" #include "llvm/Assembly/PrintModulePass.h" #include "llvm/Module.h" @@ -33,7 +34,7 @@ /// ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS) : TargetMachine("ARM"), DataLayout("E-p:32:32"), - FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -4) { + FrameInfo() { } unsigned ARMTargetMachine::getModuleMatchQuality(const Module &M) { Index: llvm/lib/Target/ARM/ARMTargetMachine.h diff -u llvm/lib/Target/ARM/ARMTargetMachine.h:1.1 llvm/lib/Target/ARM/ARMTargetMachine.h:1.2 --- llvm/lib/Target/ARM/ARMTargetMachine.h:1.1 Sun May 14 17:18:28 2006 +++ llvm/lib/Target/ARM/ARMTargetMachine.h Wed Aug 16 09:43:33 2006 @@ -20,6 +20,7 @@ #include "llvm/Target/TargetFrameInfo.h" #include "llvm/PassManager.h" #include "ARMInstrInfo.h" +#include "ARMFrameInfo.h" namespace llvm { @@ -28,7 +29,7 @@ class ARMTargetMachine : public TargetMachine { const TargetData DataLayout; // Calculates type size & alignment ARMInstrInfo InstrInfo; - TargetFrameInfo FrameInfo; + ARMFrameInfo FrameInfo; public: ARMTargetMachine(const Module &M, const std::string &FS); From pjenkins at apple.com Wed Aug 16 12:16:29 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Wed, 16 Aug 2006 12:16:29 -0500 Subject: [llvm-commits] CVS: llvm-test/TEST.nightly.report Message-ID: <200608161716.k7GHGTFa008128@zion.cs.uiuc.edu> Changes in directory llvm-test: TEST.nightly.report updated: 1.39 -> 1.40 --- Log message: Changing the way the nightly report gives us information when generating performance results. --- Diffs of the changes: (+10 -10) TEST.nightly.report | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) Index: llvm-test/TEST.nightly.report diff -u llvm-test/TEST.nightly.report:1.39 llvm-test/TEST.nightly.report:1.40 --- llvm-test/TEST.nightly.report:1.39 Fri Mar 17 01:06:34 2006 +++ llvm-test/TEST.nightly.report Wed Aug 16 12:16:15 2006 @@ -68,22 +68,22 @@ ( # Name ["Program" , '\'([^\']+)\' Program'], - [], +# [], # Times ["GCCAS" , "TEST-RESULT-compile: .*$WallTimeRE"], ["Bytecode" , 'TEST-RESULT-compile: *([0-9]+)'], - ["LLC
      compile" , "TEST-RESULT-llc: .*$WallTimeRE"], - ["LLC-BETA
      compile" , "TEST-RESULT-llc-beta: .*$WallTimeRE"], - ["JIT
      codegen" , "TEST-RESULT-jit-comptime: .*$WallTimeRE"], - [], + ["LLC compile" , "TEST-RESULT-llc: .*$WallTimeRE"], + ["LLC-BETA compile" , "TEST-RESULT-llc-beta: .*$WallTimeRE"], + ["JIT codegen" , "TEST-RESULT-jit-comptime: .*$WallTimeRE"], +# [], ["GCC" , 'TEST-RESULT-nat-time: program\s*([.0-9m:]+)', \&FormatTime], ["CBE" , 'TEST-RESULT-cbe-time: program\s*([.0-9m:]+)', \&FormatTime], ["LLC" , 'TEST-RESULT-llc-time: program\s*([.0-9m:]+)', \&FormatTime], ["LLC-BETA" , 'TEST-RESULT-llc-beta-time: program\s*([.0-9m:]+)',\&FormatTime], ["JIT" , 'TEST-RESULT-jit-time: program\s*([.0-9m:]+)', \&FormatTime], - [], - ["GCC/
      CBE" , \&GCCCBERatio], - ["GCC/
      LLC" , \&GCCLLCRatio], - ["GCC/
      LLC-BETA" , \&GCCLLC_BETARatio], - ["LLC/
      LLC-BETA" , \&LLCLLC_BETARatio] +# [], +# ["GCC/CBE" , \&GCCCBERatio], +# ["GCC/LLC" , \&GCCLLCRatio], +# ["GCC/LLC-BETA" , \&GCCLLC_BETARatio], +# ["LLC/LLC-BETA" , \&LLCLLC_BETARatio] ); From reid at x10sys.com Wed Aug 16 15:31:58 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Aug 2006 15:31:58 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Configuration.cpp Makefile c Message-ID: <200608162031.k7GKVwgB029920@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.37 -> 1.38 Configuration.cpp updated: 1.24 -> 1.25 Makefile updated: 1.20 -> 1.21 c updated: 1.1 -> 1.2 --- Log message: Patches to correct several bugs in llvmc. Patches contributed by Bram Adams. Thanks Bram. --- Diffs of the changes: (+58 -7) CompilerDriver.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++---- Configuration.cpp | 7 +++++++ Makefile | 2 +- c | 3 +-- 4 files changed, 58 insertions(+), 7 deletions(-) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.37 llvm/tools/llvmc/CompilerDriver.cpp:1.38 --- llvm/tools/llvmc/CompilerDriver.cpp:1.37 Tue Aug 1 13:12:29 2006 +++ llvm/tools/llvmc/CompilerDriver.cpp Wed Aug 16 15:31:44 2006 @@ -227,9 +227,54 @@ assert(pat != 0 && "Invalid command pattern"); // Copy over some pattern things that don't need to change - action->program = pat->program; action->flags = pat->flags; + // See if program starts with wildcard... + std::string programName=pat->program.toString(); + if (programName[0] == '%' && programName.length() >2) { + switch(programName[1]){ + case 'b': + if (programName.substr(0,8) == "%bindir%") { + std::string tmp(LLVM_BINDIR); + tmp.append(programName.substr(8)); + pat->program.set(tmp); + } + break; + case 'l': + if (programName.substr(0,12) == "%llvmgccdir%"){ + std::string tmp(LLVMGCCDIR); + tmp.append(programName.substr(12)); + pat->program.set(tmp); + }else if (programName.substr(0,13) == "%llvmgccarch%"){ + std::string tmp(LLVMGCCARCH); + tmp.append(programName.substr(13)); + pat->program.set(tmp); + }else if (programName.substr(0,9) == "%llvmgcc%"){ + std::string tmp(LLVMGCC); + tmp.append(programName.substr(9)); + pat->program.set(tmp); + }else if (programName.substr(0,9) == "%llvmgxx%"){ + std::string tmp(LLVMGXX); + tmp.append(programName.substr(9)); + pat->program.set(tmp); + }else if (programName.substr(0,9) == "%llvmcc1%"){ + std::string tmp(LLVMCC1); + tmp.append(programName.substr(9)); + pat->program.set(tmp); + }else if (programName.substr(0,13) == "%llvmcc1plus%"){ + std::string tmp(LLVMCC1PLUS); + tmp.append(programName.substr(13)); + pat->program.set(tmp); + }else if (programName.substr(0,8) == "%libdir%") { + std::string tmp(LLVM_LIBDIR); + tmp.append(programName.substr(8)); + pat->program.set(tmp); + } + break; + } + } + action->program = pat->program; + // Do the substitutions from the pattern to the actual StringVector::iterator PI = pat->args.begin(); StringVector::iterator PE = pat->args.end(); @@ -426,9 +471,9 @@ const char** Args = (const char**) alloca(sizeof(const char*)*(action->args.size()+2)); Args[0] = action->program.toString().c_str(); - for (unsigned i = 1; i != action->args.size(); ++i) - Args[i] = action->args[i].c_str(); - Args[action->args.size()] = 0; // null terminate list. + for (unsigned i = 1; i <= action->args.size(); ++i) + Args[i] = action->args[i-1].c_str(); + Args[action->args.size()+1] = 0; // null terminate list. if (isSet(TIME_ACTIONS_FLAG)) { Timer timer(action->program.toString()); timer.startTimer(); Index: llvm/tools/llvmc/Configuration.cpp diff -u llvm/tools/llvmc/Configuration.cpp:1.24 llvm/tools/llvmc/Configuration.cpp:1.25 --- llvm/tools/llvmc/Configuration.cpp:1.24 Mon May 29 13:52:05 2006 +++ llvm/tools/llvmc/Configuration.cpp Wed Aug 16 15:31:44 2006 @@ -116,6 +116,8 @@ result.clear(); while (next_is_real()) { switch (token ) { + case LLVMGCCDIR_SUBST: + case LLVMGCCARCH_SUBST: case STRING : case OPTION : result += ConfigLexerState.StringVal; @@ -260,6 +262,11 @@ str.clear(); do { switch (token) { + case BINDIR_SUBST: + case LLVMGCC_SUBST: + case LLVMGXX_SUBST: + case LLVMCC1_SUBST: + case LLVMCC1PLUS_SUBST: case OPTION: case STRING: case ARGS_SUBST: Index: llvm/tools/llvmc/Makefile diff -u llvm/tools/llvmc/Makefile:1.20 llvm/tools/llvmc/Makefile:1.21 --- llvm/tools/llvmc/Makefile:1.20 Thu Jul 6 19:46:19 2006 +++ llvm/tools/llvmc/Makefile Wed Aug 16 15:31:44 2006 @@ -24,7 +24,7 @@ -DLLVMGCC="\"$(LLVMGCC)\"" \ -DLLVMGXX="\"$(LLVMGXX)\"" \ -DLLVMCC1="\"$(LLVMCC1)\"" \ - -DLLVMCC1PLUS="$(LLVMCC1PLUS)" + -DLLVMCC1PLUS="\"$(LLVMCC1PLUS)\"" include $(LEVEL)/Makefile.common Index: llvm/tools/llvmc/c diff -u llvm/tools/llvmc/c:1.1 llvm/tools/llvmc/c:1.2 --- llvm/tools/llvmc/c:1.1 Wed May 18 19:52:29 2005 +++ llvm/tools/llvmc/c Wed Aug 16 15:31:44 2006 @@ -9,8 +9,7 @@ lang.opt3=-O3 lang.opt4=-O3 lang.opt5=-O3 - lang.libs=%llvmgccdir%/lib %llvmgccdir%/lib \ - %llvmgccdir%/lib/gcc/%llvmgccarch% + lang.libs=%llvmgccdir%/lib %llvmgccdir%/lib %llvmgccdir%/lib/gcc/%llvmgccarch% ########################################################## # Pre-processor definitions From lattner at cs.uiuc.edu Wed Aug 16 15:59:47 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 15:59:47 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Message-ID: <200608162059.k7GKxlLv027267@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAG.cpp updated: 1.331 -> 1.332 --- Log message: Use the appropriate typedef --- Diffs of the changes: (+1 -2) SelectionDAG.cpp | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.331 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.332 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.331 Tue Aug 15 14:11:05 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Aug 16 15:59:32 2006 @@ -2540,8 +2540,7 @@ std::set UsersHandled; - for (std::vector::const_iterator UI = Uses.begin(), E = Uses.end(); - UI != E; ++UI) { + for (SDNode::use_iterator UI = Uses.begin(), E = Uses.end(); UI != E; ++UI) { SDNode *User = *UI; if (User->getNumOperands() == 1 || UsersHandled.insert(User).second) // First time we've seen this? From lattner at cs.uiuc.edu Wed Aug 16 16:01:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 16:01:25 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h SelectionDAGNodes.h Message-ID: <200608162101.k7GL1PbG027847@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.123 -> 1.124 SelectionDAGNodes.h updated: 1.142 -> 1.143 --- Log message: Change the use_list to be a smallvector instead of a vector. This reduces isel time from 6.79s to 5.53s (22%) on kc++ with a release build on ppc. Go smallvector! :) --- Diffs of the changes: (+4 -3) SelectionDAG.h | 1 + SelectionDAGNodes.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.123 llvm/include/llvm/CodeGen/SelectionDAG.h:1.124 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.123 Tue Aug 15 14:11:05 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Wed Aug 16 16:01:10 2006 @@ -20,6 +20,7 @@ #include "llvm/ADT/ilist" #include +#include #include #include #include Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.142 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.143 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.142 Tue Aug 15 14:11:05 2006 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Wed Aug 16 16:01:10 2006 @@ -23,9 +23,9 @@ #include "llvm/Value.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/iterator" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/DataTypes.h" #include -#include namespace llvm { @@ -722,7 +722,7 @@ /// Uses - These are all of the SDNode's that use a value produced by this /// node. - std::vector Uses; + SmallVector Uses; // Out-of-line virtual method to give class a home. virtual void ANCHOR(); @@ -751,7 +751,7 @@ /// int getNodeId() const { return NodeId; } - typedef std::vector::const_iterator use_iterator; + typedef SmallVector::const_iterator use_iterator; use_iterator use_begin() const { return Uses.begin(); } use_iterator use_end() const { return Uses.end(); } From isanbard at gmail.com Wed Aug 16 16:19:10 2006 From: isanbard at gmail.com (Bill Wendling) Date: Wed, 16 Aug 2006 16:19:10 -0500 Subject: [llvm-commits] CVS: llvm/CREDITS.TXT Message-ID: <200608162119.k7GLJA7V008965@zion.cs.uiuc.edu> Changes in directory llvm: CREDITS.TXT updated: 1.63 -> 1.64 --- Log message: Added my home web page. --- Diffs of the changes: (+1 -1) CREDITS.TXT | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/CREDITS.TXT diff -u llvm/CREDITS.TXT:1.63 llvm/CREDITS.TXT:1.64 --- llvm/CREDITS.TXT:1.63 Sun Aug 13 14:04:57 2006 +++ llvm/CREDITS.TXT Wed Aug 16 16:18:56 2006 @@ -174,5 +174,5 @@ N: Bill Wendling E: isanbard at gmail.com +W: http://web.mac.com/bwendling/ D: The `Lower Setjmp/Longjmp' pass, improvements to the -lowerswitch pass. -D: Bug hunter extraordinaire. From reid at x10sys.com Wed Aug 16 17:09:43 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Aug 2006 17:09:43 -0500 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200608162209.k7GM9hEx004241@zion.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.37 -> 1.38 --- Log message: Oops, fix the SPEC95 case too. --- Diffs of the changes: (+1 -1) configure | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/configure diff -u llvm-test/configure:1.37 llvm-test/configure:1.38 --- llvm-test/configure:1.37 Tue Aug 15 01:53:55 2006 +++ llvm-test/configure Wed Aug 16 17:09:23 2006 @@ -2511,7 +2511,7 @@ fi if test -n "$SPEC95_ROOT" ; then if test -d "$SPEC95_ROOT" ; then - if test `basename '${SPEC95_ROOT%benchspec}'` != "benchspec"; then + if test `basename ${SPEC95_ROOT}` != "benchspec"; then { { echo "$as_me:$LINENO: error: SPEC 95 directory must end in 'benchspec'" >&5 echo "$as_me: error: SPEC 95 directory must end in 'benchspec'" >&2;} { (exit 1); exit 1; }; } From lattner at cs.uiuc.edu Wed Aug 16 17:09:42 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 17:09:42 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h Message-ID: <200608162209.k7GM9gUL004235@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ADT: SmallVector.h updated: 1.13 -> 1.14 --- Log message: silence a warning. --- Diffs of the changes: (+1 -0) SmallVector.h | 1 + 1 files changed, 1 insertion(+) Index: llvm/include/llvm/ADT/SmallVector.h diff -u llvm/include/llvm/ADT/SmallVector.h:1.13 llvm/include/llvm/ADT/SmallVector.h:1.14 --- llvm/include/llvm/ADT/SmallVector.h:1.13 Tue Aug 15 20:23:31 2006 +++ llvm/include/llvm/ADT/SmallVector.h Wed Aug 16 17:09:24 2006 @@ -213,6 +213,7 @@ // Set end. End = Begin+RHSSize; + return *this; } /// SmallVector - This is a 'vector' (really, a variable-sized array), optimized From reid at x10sys.com Wed Aug 16 17:09:41 2006 From: reid at x10sys.com (Reid Spencer) Date: Wed, 16 Aug 2006 17:09:41 -0500 Subject: [llvm-commits] CVS: llvm-test/autoconf/configure.ac Message-ID: <200608162209.k7GM9fIf004229@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf: configure.ac updated: 1.35 -> 1.36 --- Log message: Oops, fix the SPEC95 case too. --- Diffs of the changes: (+1 -1) configure.ac | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.35 llvm-test/autoconf/configure.ac:1.36 --- llvm-test/autoconf/configure.ac:1.35 Tue Aug 15 01:53:55 2006 +++ llvm-test/autoconf/configure.ac Wed Aug 16 17:09:23 2006 @@ -88,7 +88,7 @@ fi if test -n "$SPEC95_ROOT" ; then if test -d "$SPEC95_ROOT" ; then - if test `basename '${SPEC95_ROOT%benchspec}'` != "benchspec"; then + if test `basename ${SPEC95_ROOT}` != "benchspec"; then AC_MSG_ERROR([SPEC 95 directory must end in 'benchspec']) fi else From lattner at cs.uiuc.edu Wed Aug 16 17:13:02 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 17:13:02 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ScheduleDAG.h Message-ID: <200608162213.k7GMD27E004452@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: ScheduleDAG.h updated: 1.30 -> 1.31 --- Log message: Convert vector to smallvector: 4% speedup. --- Diffs of the changes: (+1 -1) ScheduleDAG.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/ScheduleDAG.h diff -u llvm/include/llvm/CodeGen/ScheduleDAG.h:1.30 llvm/include/llvm/CodeGen/ScheduleDAG.h:1.31 --- llvm/include/llvm/CodeGen/ScheduleDAG.h:1.30 Tue Aug 1 14:14:14 2006 +++ llvm/include/llvm/CodeGen/ScheduleDAG.h Wed Aug 16 17:12:48 2006 @@ -78,7 +78,7 @@ /// a group of nodes flagged together. struct SUnit { SDNode *Node; // Representative node. - std::vector FlaggedNodes; // All nodes flagged to Node. + SmallVector FlaggedNodes;// All nodes flagged to Node. // Preds/Succs - The SUnits before/after us in the graph. The boolean value // is true if the edge is a token chain edge, false if it is a value edge. From pjenkins at apple.com Wed Aug 16 17:18:55 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Wed, 16 Aug 2006 17:18:55 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200608162218.k7GMItBR004578@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.51 -> 1.52 --- Log message: Changed the call to countloc.sh so that the correct topdirectory of the llvm build is set. --- Diffs of the changes: (+19 -20) NewNightlyTest.pl | 39 +++++++++++++++++++-------------------- 1 files changed, 19 insertions(+), 20 deletions(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.51 llvm/utils/NewNightlyTest.pl:1.52 --- llvm/utils/NewNightlyTest.pl:1.51 Mon Aug 14 13:49:05 2006 +++ llvm/utils/NewNightlyTest.pl Wed Aug 16 17:18:41 2006 @@ -117,7 +117,7 @@ $NORUNNINGTESTS=0; $MAKECMD="make"; $SUBMITSERVER = "llvm.org"; -$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.cgi"; +$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept2.cgi"; while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { shift; @@ -638,7 +638,7 @@ # Get the number of lines of source code. Must be here after the build is done # because countloc.sh uses the llvm-config script which must be built. -my $LOC = `utils/countloc.sh -topdir $BuildDir`; +my $LOC = `utils/countloc.sh -topdir $BuildDir/llvm`; # Get the time taken by the configure script my $ConfigTimeU = GetRegexNum "^user", 0, "([0-9.]+)", "$BuildLog"; @@ -824,7 +824,7 @@ # Create a list of the tests which were run... # system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ". - "| sort > $Prefix-multisourceprogramstable.txt"; + "| sort > $Prefix-$SubDir-Tests.txt"; } $ProgramsTable = ReadFile "report.nightly.csv"; @@ -838,31 +838,36 @@ } ($SingleSourceProgramsTable, $llcbeta_options) = TestDirectory("SingleSource"); - WriteFile "$Prefix-singlesourceprogramstable.txt", $SingleSourceProgramsTable; + WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable; if ( $VERBOSE ) { print "MultiSource TEST STAGE\n"; } ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource"); - WriteFile "$Prefix-multisourceprogramstable.txt", $MultiSourceProgramsTable; + WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable; if ( ! $NOEXTERNALS ) { if ( $VERBOSE ) { print "External TEST STAGE\n"; } ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External"); - WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable; - system "cat $Prefix-singlesourceprogramstable.txt " . - "$Prefix-multisourceprogramstable.txt ". - "$Prefix-externalprogramstable.txt | sort > $Prefix-Tests.txt"; + WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable; + system "cat $Prefix-SingleSource-Tests.txt " . + "$Prefix-MultiSource-Tests.txt ". + "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt"; + system "cat $Prefix-SingleSource-Performance.txt " . + "$Prefix-MultiSource-Performance.txt ". + "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt"; } else { $ExternalProgramsTable = "External TEST STAGE SKIPPED\n"; if ( $VERBOSE ) { print "External TEST STAGE SKIPPED\n"; } - system "cat $Prefix-singlesourceprogramstable.txt " . - "$Prefix-multisourceprogramstable.txt ". + system "cat $Prefix-SingleSource-Tests.txt " . + "$Prefix-MultiSource-Tests.txt ". " | sort > $Prefix-Tests.txt"; + system "cat $Prefix-SingleSource-Performance.txt " . + "$Prefix-MultiSource-Performance.txt ". + " | sort > $Prefix-Performance.txt"; } - WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable; } ############################################################## @@ -872,9 +877,8 @@ # # ############################################################## -my $dejagnu = ReadFile $DejagnuSum; -my @DEJAGNU = split "\n", $dejagnu; -my $dejagnu_test_list=""; +my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt"; +my @DEJAGNU = split "\n", $dejagnu_test_list; my $passes="", my $fails=""; @@ -884,15 +888,12 @@ for ($x=0; $x<@DEJAGNU; $x++) { if ($DEJAGNU[$x] =~ m/^PASS:/) { $passes.="$DEJAGNU[$x]\n"; - $dejagnu_test_list.="$DEJAGNU[$x]\n"; } elsif ($DEJAGNU[$x] =~ m/^FAIL:/) { $fails.="$DEJAGNU[$x]\n"; - $dejagnu_test_list.="$DEJAGNU[$x]\n"; } elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) { $xfails.="$DEJAGNU[$x]\n"; - $dejagnu_test_list.="$DEJAGNU[$x]\n"; } } } @@ -983,8 +984,6 @@ @GCC_VERSION = split '\n', $gcc_version_long; my $gcc_version = $GCC_VERSION[0]; -my $all_tests = ReadFile "$Prefix-Tests.txt"; - ############################################################## # # Send data via a post request From pjenkins at apple.com Wed Aug 16 17:25:21 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Wed, 16 Aug 2006 17:25:21 -0500 Subject: [llvm-commits] CVS: llvm-test/TEST.nightly.report Message-ID: <200608162225.k7GMPLgb004709@zion.cs.uiuc.edu> Changes in directory llvm-test: TEST.nightly.report updated: 1.40 -> 1.41 --- Log message: Reinstating the comparisons to GCC for the nightly test reports. --- Diffs of the changes: (+7 -7) TEST.nightly.report | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm-test/TEST.nightly.report diff -u llvm-test/TEST.nightly.report:1.40 llvm-test/TEST.nightly.report:1.41 --- llvm-test/TEST.nightly.report:1.40 Wed Aug 16 12:16:15 2006 +++ llvm-test/TEST.nightly.report Wed Aug 16 17:25:07 2006 @@ -68,22 +68,22 @@ ( # Name ["Program" , '\'([^\']+)\' Program'], -# [], + [], # Times ["GCCAS" , "TEST-RESULT-compile: .*$WallTimeRE"], ["Bytecode" , 'TEST-RESULT-compile: *([0-9]+)'], ["LLC compile" , "TEST-RESULT-llc: .*$WallTimeRE"], ["LLC-BETA compile" , "TEST-RESULT-llc-beta: .*$WallTimeRE"], ["JIT codegen" , "TEST-RESULT-jit-comptime: .*$WallTimeRE"], -# [], + [], ["GCC" , 'TEST-RESULT-nat-time: program\s*([.0-9m:]+)', \&FormatTime], ["CBE" , 'TEST-RESULT-cbe-time: program\s*([.0-9m:]+)', \&FormatTime], ["LLC" , 'TEST-RESULT-llc-time: program\s*([.0-9m:]+)', \&FormatTime], ["LLC-BETA" , 'TEST-RESULT-llc-beta-time: program\s*([.0-9m:]+)',\&FormatTime], ["JIT" , 'TEST-RESULT-jit-time: program\s*([.0-9m:]+)', \&FormatTime], -# [], -# ["GCC/CBE" , \&GCCCBERatio], -# ["GCC/LLC" , \&GCCLLCRatio], -# ["GCC/LLC-BETA" , \&GCCLLC_BETARatio], -# ["LLC/LLC-BETA" , \&LLCLLC_BETARatio] + [], + ["GCC/CBE" , \&GCCCBERatio], + ["GCC/LLC" , \&GCCLLCRatio], + ["GCC/LLC-BETA" , \&GCCLLC_BETARatio], + ["LLC/LLC-BETA" , \&LLCLLC_BETARatio] ); From pjenkins at apple.com Wed Aug 16 17:32:35 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Wed, 16 Aug 2006 17:32:35 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200608162232.k7GMWZJm023038@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.52 -> 1.53 --- Log message: My last commit added some experimental features I have been working on. This commit rolls those back. --- Diffs of the changes: (+19 -18) NewNightlyTest.pl | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.52 llvm/utils/NewNightlyTest.pl:1.53 --- llvm/utils/NewNightlyTest.pl:1.52 Wed Aug 16 17:18:41 2006 +++ llvm/utils/NewNightlyTest.pl Wed Aug 16 17:32:20 2006 @@ -117,7 +117,7 @@ $NORUNNINGTESTS=0; $MAKECMD="make"; $SUBMITSERVER = "llvm.org"; -$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept2.cgi"; +$SUBMITSCRIPT = "/nightlytest/NightlyTestAccept.cgi"; while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) { shift; @@ -824,7 +824,7 @@ # Create a list of the tests which were run... # system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ". - "| sort > $Prefix-$SubDir-Tests.txt"; + "| sort > $Prefix-multisourceprogramstable.txt"; } $ProgramsTable = ReadFile "report.nightly.csv"; @@ -838,36 +838,31 @@ } ($SingleSourceProgramsTable, $llcbeta_options) = TestDirectory("SingleSource"); - WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable; + WriteFile "$Prefix-singlesourceprogramstable.txt", $SingleSourceProgramsTable; if ( $VERBOSE ) { print "MultiSource TEST STAGE\n"; } ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource"); - WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable; + WriteFile "$Prefix-multisourceprogramstable.txt", $MultiSourceProgramsTable; if ( ! $NOEXTERNALS ) { if ( $VERBOSE ) { print "External TEST STAGE\n"; } ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External"); - WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable; - system "cat $Prefix-SingleSource-Tests.txt " . - "$Prefix-MultiSource-Tests.txt ". - "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt"; - system "cat $Prefix-SingleSource-Performance.txt " . - "$Prefix-MultiSource-Performance.txt ". - "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt"; + WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable; + system "cat $Prefix-singlesourceprogramstable.txt " . + "$Prefix-multisourceprogramstable.txt ". + "$Prefix-externalprogramstable.txt | sort > $Prefix-Tests.txt"; } else { $ExternalProgramsTable = "External TEST STAGE SKIPPED\n"; if ( $VERBOSE ) { print "External TEST STAGE SKIPPED\n"; } - system "cat $Prefix-SingleSource-Tests.txt " . - "$Prefix-MultiSource-Tests.txt ". + system "cat $Prefix-singlesourceprogramstable.txt " . + "$Prefix-multisourceprogramstable.txt ". " | sort > $Prefix-Tests.txt"; - system "cat $Prefix-SingleSource-Performance.txt " . - "$Prefix-MultiSource-Performance.txt ". - " | sort > $Prefix-Performance.txt"; } + WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable; } ############################################################## @@ -877,8 +872,9 @@ # # ############################################################## -my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt"; -my @DEJAGNU = split "\n", $dejagnu_test_list; +my $dejagnu = ReadFile $DejagnuSum; +my @DEJAGNU = split "\n", $dejagnu; +my $dejagnu_test_list=""; my $passes="", my $fails=""; @@ -888,12 +884,15 @@ for ($x=0; $x<@DEJAGNU; $x++) { if ($DEJAGNU[$x] =~ m/^PASS:/) { $passes.="$DEJAGNU[$x]\n"; + $dejagnu_test_list.="$DEJAGNU[$x]\n"; } elsif ($DEJAGNU[$x] =~ m/^FAIL:/) { $fails.="$DEJAGNU[$x]\n"; + $dejagnu_test_list.="$DEJAGNU[$x]\n"; } elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) { $xfails.="$DEJAGNU[$x]\n"; + $dejagnu_test_list.="$DEJAGNU[$x]\n"; } } } @@ -984,6 +983,8 @@ @GCC_VERSION = split '\n', $gcc_version_long; my $gcc_version = $GCC_VERSION[0]; +my $all_tests = ReadFile "$Prefix-Tests.txt"; + ############################################################## # # Send data via a post request From lattner at cs.uiuc.edu Wed Aug 16 17:57:25 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 17:57:25 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h Message-ID: <200608162257.k7GMvPEg016353@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: SelectionDAG.h updated: 1.124 -> 1.125 --- Log message: add an accessor --- Diffs of the changes: (+2 -0) SelectionDAG.h | 2 ++ 1 files changed, 2 insertions(+) Index: llvm/include/llvm/CodeGen/SelectionDAG.h diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.124 llvm/include/llvm/CodeGen/SelectionDAG.h:1.125 --- llvm/include/llvm/CodeGen/SelectionDAG.h:1.124 Wed Aug 16 16:01:10 2006 +++ llvm/include/llvm/CodeGen/SelectionDAG.h Wed Aug 16 17:57:08 2006 @@ -245,6 +245,8 @@ const SDOperand *Ops, unsigned NumOps); SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs, const SDOperand *Ops, unsigned NumOps); + SDOperand getNode(unsigned Opcode, SDVTList VTs, + const SDOperand *Ops, unsigned NumOps); /// getSetCC - Helper function to make it easier to build SetCC's if you just /// have an ISD::CondCode instead of an SDOperand. From lattner at cs.uiuc.edu Wed Aug 16 17:58:01 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 17:58:01 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp SelectionDAG.cpp Message-ID: <200608162258.k7GMw1lq016477@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.269 -> 1.270 SelectionDAG.cpp updated: 1.332 -> 1.333 --- Log message: minor changes. --- Diffs of the changes: (+24 -22) SelectionDAG.cpp | 37 +++++++++++++++++++------------------ SelectionDAGISel.cpp | 9 +++++---- 2 files changed, 24 insertions(+), 22 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.269 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.270 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.269 Mon Aug 14 18:53:35 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Aug 16 17:57:46 2006 @@ -2515,7 +2515,7 @@ unsigned CallingConv, bool isTailCall, SDOperand Callee, ArgListTy &Args, SelectionDAG &DAG) { - std::vector Ops; + SmallVector Ops; Ops.push_back(Chain); // Op#0 - Chain Ops.push_back(DAG.getConstant(CallingConv, getPointerTy())); // Op#1 - CC Ops.push_back(DAG.getConstant(isVarArg, getPointerTy())); // Op#2 - VarArg @@ -2592,7 +2592,7 @@ } // Figure out the result value types. - std::vector RetTys; + SmallVector RetTys; if (RetTy != Type::VoidTy) { MVT::ValueType VT = getValueType(RetTy); @@ -2636,8 +2636,9 @@ RetTys.push_back(MVT::Other); // Always has a chain. // Finally, create the CALL node. - SDOperand Res = DAG.getNode(ISD::CALL, DAG.getNodeValueTypes(RetTys), - RetTys.size(), &Ops[0], Ops.size()); + SDOperand Res = DAG.getNode(ISD::CALL, + DAG.getVTList(&RetTys[0], RetTys.size()), + &Ops[0], Ops.size()); // This returns a pair of operands. The first element is the // return value for the function (if RetTy is not VoidTy). The second Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.332 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.333 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.332 Wed Aug 16 15:59:32 2006 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Aug 16 17:57:46 2006 @@ -1459,26 +1459,21 @@ SDOperand SV) { SDOperand Ops[] = { Chain, Ptr, SV, getConstant(Count, MVT::i32), getValueType(EVT) }; - // Add token chain. - const MVT::ValueType *VTs = getNodeValueTypes(MVT::Vector, MVT::Other); - return getNode(ISD::VLOAD, VTs, 2, Ops, 5); + return getNode(ISD::VLOAD, getVTList(MVT::Vector, MVT::Other), Ops, 5); } SDOperand SelectionDAG::getExtLoad(unsigned Opcode, MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV, MVT::ValueType EVT) { SDOperand Ops[] = { Chain, Ptr, SV, getValueType(EVT) }; - const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); - return getNode(Opcode, VTs, 2, Ops, 4); + return getNode(Opcode, getVTList(VT, MVT::Other), Ops, 4); } SDOperand SelectionDAG::getVAArg(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr, SDOperand SV) { SDOperand Ops[] = { Chain, Ptr, SV }; - // Add token chain. - const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other); - return getNode(ISD::VAARG, VTs, 2, Ops, 3); + return getNode(ISD::VAARG, getVTList(VT, MVT::Other), Ops, 3); } SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, @@ -1562,27 +1557,34 @@ const SDOperand *Ops, unsigned NumOps) { if (NumVTs == 1) return getNode(Opcode, VTs[0], Ops, NumOps); + return getNode(Opcode, makeVTList(VTs, NumVTs), Ops, NumOps); +} + +SDOperand SelectionDAG::getNode(unsigned Opcode, SDVTList VTList, + const SDOperand *Ops, unsigned NumOps) { + if (VTList.NumVTs == 1) + return getNode(Opcode, VTList.VTs[0], Ops, NumOps); switch (Opcode) { case ISD::EXTLOAD: case ISD::SEXTLOAD: case ISD::ZEXTLOAD: { MVT::ValueType EVT = cast(Ops[3])->getVT(); - assert(NumOps == 4 && NumVTs == 2 && "Bad *EXTLOAD!"); + assert(NumOps == 4 && VTList.NumVTs == 2 && "Bad *EXTLOAD!"); // If they are asking for an extending load from/to the same thing, return a // normal load. - if (VTs[0] == EVT) - return getLoad(VTs[0], Ops[0], Ops[1], Ops[2]); - if (MVT::isVector(VTs[0])) { - assert(EVT == MVT::getVectorBaseType(VTs[0]) && + if (VTList.VTs[0] == EVT) + return getLoad(VTList.VTs[0], Ops[0], Ops[1], Ops[2]); + if (MVT::isVector(VTList.VTs[0])) { + assert(EVT == MVT::getVectorBaseType(VTList.VTs[0]) && "Invalid vector extload!"); } else { - assert(EVT < VTs[0] && + assert(EVT < VTList.VTs[0] && "Should only be an extending load, not truncating!"); } - assert((Opcode == ISD::EXTLOAD || MVT::isInteger(VTs[0])) && + assert((Opcode == ISD::EXTLOAD || MVT::isInteger(VTList.VTs[0])) && "Cannot sign/zero extend a FP/Vector load!"); - assert(MVT::isInteger(VTs[0]) == MVT::isInteger(EVT) && + assert(MVT::isInteger(VTList.VTs[0]) == MVT::isInteger(EVT) && "Cannot convert from FP to Int or Int -> FP!"); break; } @@ -1611,8 +1613,7 @@ // Memoize the node unless it returns a flag. SDNode *N; - SDVTList VTList = makeVTList(VTs, NumVTs); - if (VTs[NumVTs-1] != MVT::Flag) { + if (VTList.VTs[VTList.NumVTs-1] != MVT::Flag) { SelectionDAGCSEMap::NodeID ID; ID.SetOpcode(Opcode); ID.SetValueTypes(VTList); From evan.cheng at apple.com Wed Aug 16 18:59:14 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 18:59:14 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Message-ID: <200608162359.k7GNxEQt001322@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelDAGToDAG.cpp updated: 1.92 -> 1.93 --- Log message: Doh. Incorrectly inverted condition. Also add a isOnlyUse check to match tablegen. --- Diffs of the changes: (+2 -1) X86ISelDAGToDAG.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.92 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.93 --- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.92 Wed Aug 16 02:30:09 2006 +++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Aug 16 18:59:00 2006 @@ -610,7 +610,8 @@ SDOperand &Index, SDOperand &Disp) { if (N.getOpcode() == ISD::LOAD && N.hasOneUse() && - !CanBeFoldedBy(N.Val, P.Val)) + P.Val->isOnlyUse(N.Val) && + CanBeFoldedBy(N.Val, P.Val)) return SelectAddr(N.getOperand(1), Base, Scale, Index, Disp); return false; } From evan.cheng at apple.com Wed Aug 16 19:01:01 2006 From: evan.cheng at apple.com (Evan Cheng) Date: Wed, 16 Aug 2006 19:01:01 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-08-16-CycleInDAG.ll Message-ID: <200608170001.k7H0115W002260@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-08-16-CycleInDAG.ll added (r1.1) --- Log message: Another cyclic dag test case. --- Diffs of the changes: (+23 -0) 2006-08-16-CycleInDAG.ll | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2006-08-16-CycleInDAG.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/2006-08-16-CycleInDAG.ll:1.1 *** /dev/null Wed Aug 16 19:00:56 2006 --- llvm/test/Regression/CodeGen/X86/2006-08-16-CycleInDAG.ll Wed Aug 16 19:00:46 2006 *************** *** 0 **** --- 1,23 ---- + ; RUN: llvm-as < %s | llc -march=x86 + + %struct.expr = type { %struct.rtx_def*, int, %struct.expr*, %struct.occr*, %struct.occr*, %struct.rtx_def* } + %struct.hash_table = type { %struct.expr**, uint, uint, int } + %struct.occr = type { %struct.occr*, %struct.rtx_def*, sbyte, sbyte } + %struct.rtx_def = type { ushort, ubyte, ubyte, %struct.u } + %struct.u = type { [1 x long] } + + void %test() { + %tmp = load uint* null ; [#uses=1] + %tmp8 = call uint %hash_rtx( ) ; [#uses=1] + %tmp11 = rem uint %tmp8, %tmp ; [#uses=1] + br bool false, label %cond_next, label %return + + cond_next: ; preds = %entry + %tmp17 = getelementptr %struct.expr** null, uint %tmp11 ; <%struct.expr**> [#uses=0] + ret void + + return: ; preds = %entry + ret void + } + + declare uint %hash_rtx() From lattner at cs.uiuc.edu Wed Aug 16 19:10:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 19:10:11 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ScheduleDAG.h Message-ID: <200608170010.k7H0ABDM010803@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: ScheduleDAG.h updated: 1.31 -> 1.32 --- Log message: switch the SUnit pred/succ sets from being std::sets to being smallvectors. This reduces selectiondag time on kc++ from 5.43s to 4.98s (9%). More significantly, this speeds up the default ppc scheduler from ~1571ms to 1063ms, a 33% speedup. --- Diffs of the changes: (+30 -3) ScheduleDAG.h | 33 ++++++++++++++++++++++++++++++--- 1 files changed, 30 insertions(+), 3 deletions(-) Index: llvm/include/llvm/CodeGen/ScheduleDAG.h diff -u llvm/include/llvm/CodeGen/ScheduleDAG.h:1.31 llvm/include/llvm/CodeGen/ScheduleDAG.h:1.32 --- llvm/include/llvm/CodeGen/ScheduleDAG.h:1.31 Wed Aug 16 17:12:48 2006 +++ llvm/include/llvm/CodeGen/ScheduleDAG.h Wed Aug 16 19:09:56 2006 @@ -82,9 +82,16 @@ // Preds/Succs - The SUnits before/after us in the graph. The boolean value // is true if the edge is a token chain edge, false if it is a value edge. - std::set > Preds; // All sunit predecessors. - std::set > Succs; // All sunit successors. + SmallVector, 4> Preds; // All sunit predecessors. + SmallVector, 4> Succs; // All sunit successors. + typedef SmallVector, 4>::iterator pred_iterator; + typedef SmallVector, 4>::iterator succ_iterator; + typedef SmallVector, 4>::const_iterator + const_pred_iterator; + typedef SmallVector, 4>::const_iterator + const_succ_iterator; + short NumPreds; // # of preds. short NumSuccs; // # of sucss. short NumPredsLeft; // # of preds not scheduled. @@ -111,6 +118,26 @@ Latency(0), CycleBound(0), Cycle(0), Depth(0), Height(0), NodeNum(nodenum) {} + /// addPred - This adds the specified node as a pred of the current node if + /// not already. This returns true if this is a new pred. + bool addPred(SUnit *N, bool isChain) { + for (unsigned i = 0, e = Preds.size(); i != e; ++i) + if (Preds[i].first == N && Preds[i].second == isChain) + return false; + Preds.push_back(std::make_pair(N, isChain)); + return true; + } + + /// addSucc - This adds the specified node as a succ of the current node if + /// not already. This returns true if this is a new succ. + bool addSucc(SUnit *N, bool isChain) { + for (unsigned i = 0, e = Succs.size(); i != e; ++i) + if (Succs[i].first == N && Succs[i].second == isChain) + return false; + Succs.push_back(std::make_pair(N, isChain)); + return true; + } + void dump(const SelectionDAG *G) const; void dumpAll(const SelectionDAG *G) const; }; @@ -127,7 +154,7 @@ public: virtual ~SchedulingPriorityQueue() {} - virtual void initNodes(const std::vector &SUnits) = 0; + virtual void initNodes(std::vector &SUnits) = 0; virtual void releaseState() = 0; virtual bool empty() const = 0; From lattner at cs.uiuc.edu Wed Aug 16 19:10:11 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 19:10:11 -0500 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp ScheduleDAGList.cpp ScheduleDAGRRList.cpp Message-ID: <200608170010.k7H0ABLP010812@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen/SelectionDAG: ScheduleDAG.cpp updated: 1.100 -> 1.101 ScheduleDAGList.cpp updated: 1.65 -> 1.66 ScheduleDAGRRList.cpp updated: 1.12 -> 1.13 --- Log message: switch the SUnit pred/succ sets from being std::sets to being smallvectors. This reduces selectiondag time on kc++ from 5.43s to 4.98s (9%). More significantly, this speeds up the default ppc scheduler from ~1571ms to 1063ms, a 33% speedup. --- Diffs of the changes: (+82 -78) ScheduleDAG.cpp | 56 +++++++++++++++++++++++----------------------- ScheduleDAGList.cpp | 44 ++++++++++++++++++++---------------- ScheduleDAGRRList.cpp | 60 +++++++++++++++++++++++++------------------------- 3 files changed, 82 insertions(+), 78 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.100 llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.101 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp:1.100 Mon Aug 7 17:12:12 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp Wed Aug 16 19:09:56 2006 @@ -84,7 +84,7 @@ N = *UI; break; } - if (!HasFlagUse) break; + if (!HasFlagUse) break; } // Now all flagged nodes are in FlaggedNodes and N is the bottom-most node. @@ -150,7 +150,7 @@ assert(OpVT != MVT::Flag && "Flagged nodes should be in same sunit!"); bool isChain = OpVT == MVT::Other; - if (SU->Preds.insert(std::make_pair(OpSU, isChain)).second) { + if (SU->addPred(OpSU, isChain)) { if (!isChain) { SU->NumPreds++; SU->NumPredsLeft++; @@ -158,7 +158,7 @@ SU->NumChainPredsLeft++; } } - if (OpSU->Succs.insert(std::make_pair(SU, isChain)).second) { + if (OpSU->addSucc(SU, isChain)) { if (!isChain) { OpSU->NumSuccs++; OpSU->NumSuccsLeft++; @@ -176,35 +176,35 @@ return; } -static void CalculateDepths(SUnit *SU, unsigned Depth) { - if (SU->Depth == 0 || Depth > SU->Depth) { - SU->Depth = Depth; - for (std::set >::iterator I = SU->Succs.begin(), - E = SU->Succs.end(); I != E; ++I) - CalculateDepths(I->first, Depth+1); +static void CalculateDepths(SUnit &SU, unsigned Depth) { + if (SU.Depth == 0 || Depth > SU.Depth) { + SU.Depth = Depth; + for (SUnit::succ_iterator I = SU.Succs.begin(), E = SU.Succs.end(); + I != E; ++I) + CalculateDepths(*I->first, Depth+1); } } void ScheduleDAG::CalculateDepths() { SUnit *Entry = SUnitMap[DAG.getEntryNode().Val]; - ::CalculateDepths(Entry, 0U); + ::CalculateDepths(*Entry, 0U); for (unsigned i = 0, e = SUnits.size(); i != e; ++i) if (SUnits[i].Preds.size() == 0 && &SUnits[i] != Entry) { - ::CalculateDepths(&SUnits[i], 0U); + ::CalculateDepths(SUnits[i], 0U); } } -static void CalculateHeights(SUnit *SU, unsigned Height) { - if (SU->Height == 0 || Height > SU->Height) { - SU->Height = Height; - for (std::set >::iterator I = SU->Preds.begin(), - E = SU->Preds.end(); I != E; ++I) - CalculateHeights(I->first, Height+1); +static void CalculateHeights(SUnit &SU, unsigned Height) { + if (SU.Height == 0 || Height > SU.Height) { + SU.Height = Height; + for (SUnit::pred_iterator I = SU.Preds.begin(), E = SU.Preds.end(); + I != E; ++I) + CalculateHeights(*I->first, Height+1); } } void ScheduleDAG::CalculateHeights() { SUnit *Root = SUnitMap[DAG.getRoot().Val]; - ::CalculateHeights(Root, 0U); + ::CalculateHeights(*Root, 0U); } /// CountResults - The results of target nodes have register or immediate @@ -646,24 +646,24 @@ if (Preds.size() != 0) { std::cerr << " Predecessors:\n"; - for (std::set >::const_iterator I = Preds.begin(), - E = Preds.end(); I != E; ++I) { + for (SUnit::const_succ_iterator I = Preds.begin(), E = Preds.end(); + I != E; ++I) { if (I->second) - std::cerr << " ch "; + std::cerr << " ch #"; else - std::cerr << " val "; - I->first->dump(G); + std::cerr << " val #"; + std::cerr << I->first << "\n"; } } if (Succs.size() != 0) { std::cerr << " Successors:\n"; - for (std::set >::const_iterator I = Succs.begin(), - E = Succs.end(); I != E; ++I) { + for (SUnit::const_succ_iterator I = Succs.begin(), E = Succs.end(); + I != E; ++I) { if (I->second) - std::cerr << " ch "; + std::cerr << " ch #"; else - std::cerr << " val "; - I->first->dump(G); + std::cerr << " val #"; + std::cerr << I->first << "\n"; } } std::cerr << "\n"; Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.65 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.66 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.65 Wed Aug 2 07:30:23 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp Wed Aug 16 19:09:56 2006 @@ -132,15 +132,16 @@ // available. This is the max of the start time of all predecessors plus // their latencies. unsigned AvailableCycle = 0; - for (std::set >::iterator I = SuccSU->Preds.begin(), + for (SUnit::pred_iterator I = SuccSU->Preds.begin(), E = SuccSU->Preds.end(); I != E; ++I) { // If this is a token edge, we don't need to wait for the latency of the // preceeding instruction (e.g. a long-latency load) unless there is also // some other data dependence. - unsigned PredDoneCycle = I->first->Cycle; + SUnit &Pred = *I->first; + unsigned PredDoneCycle = Pred.Cycle; if (!I->second) - PredDoneCycle += I->first->Latency; - else if (I->first->Latency) + PredDoneCycle += Pred.Latency; + else if (Pred.Latency) PredDoneCycle += 1; AvailableCycle = std::max(AvailableCycle, PredDoneCycle); @@ -161,8 +162,8 @@ SU->Cycle = CurCycle; // Bottom up: release successors. - for (std::set >::iterator I = SU->Succs.begin(), - E = SU->Succs.end(); I != E; ++I) + for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); + I != E; ++I) ReleaseSucc(I->first, I->second); } @@ -313,7 +314,7 @@ namespace { class LatencyPriorityQueue : public SchedulingPriorityQueue { // SUnits - The SUnits for the current graph. - const std::vector *SUnits; + std::vector *SUnits; // Latencies - The latency (max of latency from this node to the bb exit) // for each node. @@ -330,7 +331,7 @@ LatencyPriorityQueue() : Queue(latency_sort(this)) { } - void initNodes(const std::vector &sunits) { + void initNodes(std::vector &sunits) { SUnits = &sunits; // Calculate node priorities. CalculatePriorities(); @@ -379,6 +380,7 @@ void CalculatePriorities(); int CalcLatency(const SUnit &SU); void AdjustPriorityOfUnscheduledPreds(SUnit *SU); + SUnit *getSingleUnscheduledPred(SUnit *SU); /// RemoveFromPriorityQueue - This is a really inefficient way to remove a /// node from a priority queue. We should roll our own heap to make this @@ -434,8 +436,8 @@ return Latency; int MaxSuccLatency = 0; - for (std::set >::const_iterator I = SU.Succs.begin(), - E = SU.Succs.end(); I != E; ++I) + for (SUnit::const_succ_iterator I = SU.Succs.begin(), E = SU.Succs.end(); + I != E; ++I) MaxSuccLatency = std::max(MaxSuccLatency, CalcLatency(*I->first)); return Latency = MaxSuccLatency + SU.Latency; @@ -452,17 +454,19 @@ /// getSingleUnscheduledPred - If there is exactly one unscheduled predecessor /// of SU, return it, otherwise return null. -static SUnit *getSingleUnscheduledPred(SUnit *SU) { +SUnit *LatencyPriorityQueue::getSingleUnscheduledPred(SUnit *SU) { SUnit *OnlyAvailablePred = 0; - for (std::set >::const_iterator I = SU->Preds.begin(), - E = SU->Preds.end(); I != E; ++I) - if (!I->first->isScheduled) { + for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); + I != E; ++I) { + SUnit &Pred = *I->first; + if (!Pred.isScheduled) { // We found an available, but not scheduled, predecessor. If it's the // only one we have found, keep track of it... otherwise give up. - if (OnlyAvailablePred && OnlyAvailablePred != I->first) + if (OnlyAvailablePred && OnlyAvailablePred != &Pred) return 0; - OnlyAvailablePred = I->first; + OnlyAvailablePred = &Pred; } + } return OnlyAvailablePred; } @@ -471,8 +475,8 @@ // Look at all of the successors of this node. Count the number of nodes that // this node is the sole unscheduled node for. unsigned NumNodesBlocking = 0; - for (std::set >::const_iterator I = SU->Succs.begin(), - E = SU->Succs.end(); I != E; ++I) + for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); + I != E; ++I) if (getSingleUnscheduledPred(I->first) == SU) ++NumNodesBlocking; NumNodesSolelyBlocking[SU->NodeNum] = NumNodesBlocking; @@ -486,8 +490,8 @@ // single predecessor has a higher priority, since scheduling it will make // the node available. void LatencyPriorityQueue::ScheduledNode(SUnit *SU) { - for (std::set >::const_iterator I = SU->Succs.begin(), - E = SU->Succs.end(); I != E; ++I) + for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); + I != E; ++I) AdjustPriorityOfUnscheduledPreds(I->first); } Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.12 llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.13 --- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.12 Wed Aug 2 07:30:23 2006 +++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Wed Aug 16 19:09:56 2006 @@ -93,7 +93,7 @@ CalculateDepths(); CalculateHeights(); DEBUG(for (unsigned su = 0, e = SUnits.size(); su != e; ++su) - SUnits[su].dumpAll(&DAG)); + SUnits[su].dumpAll(&DAG)); AvailableQueue->initNodes(SUnits); @@ -143,8 +143,8 @@ } } - for (std::set >::iterator I = SU->Preds.begin(), - E = SU->Preds.end(); I != E; ++I) { + for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); + I != E; ++I) { if (!I->second) OperandSeen.insert(I->first); } @@ -235,8 +235,8 @@ Sequence.push_back(SU); // Bottom up: release predecessors - for (std::set >::iterator I = SU->Preds.begin(), - E = SU->Preds.end(); I != E; ++I) + for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); + I != E; ++I) ReleasePred(I->first, I->second, CurCycle); SU->isScheduled = true; } @@ -347,8 +347,8 @@ Sequence.push_back(SU); // Top down: release successors - for (std::set >::iterator I = SU->Succs.begin(), - E = SU->Succs.end(); I != E; ++I) + for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); + I != E; ++I) ReleaseSucc(I->first, I->second, CurCycle); SU->isScheduled = true; } @@ -448,7 +448,7 @@ RegReductionPriorityQueue() : Queue(SF(this)) {} - virtual void initNodes(const std::vector &sunits) {} + virtual void initNodes(std::vector &sunits) {} virtual void releaseState() {} virtual int getSethiUllmanNumber(unsigned NodeNum) const { @@ -485,7 +485,7 @@ public: BURegReductionPriorityQueue() {} - void initNodes(const std::vector &sunits) { + void initNodes(std::vector &sunits) { SUnits = &sunits; // Add pseudo dependency edges for two-address nodes. AddPseudoTwoAddrDeps(); @@ -521,7 +521,7 @@ public: TDRegReductionPriorityQueue() {} - void initNodes(const std::vector &sunits) { + void initNodes(std::vector &sunits) { SUnits = &sunits; // Calculate node priorities. CalculatePriorities(); @@ -548,8 +548,8 @@ if (SU->NumPreds == 0) return true; if (SU->NumPreds == 1) { - for (std::set >::iterator I = SU->Preds.begin(), - E = SU->Preds.end(); I != E; ++I) { + for (SUnit::const_pred_iterator I = SU->Preds.begin(),E = SU->Preds.end(); + I != E; ++I) { if (I->second) continue; SUnit *PredSU = I->first; @@ -566,8 +566,8 @@ static bool isSimpleFloaterUse(const SUnit *SU) { unsigned NumOps = 0; - for (std::set >::iterator I = SU->Preds.begin(), - E = SU->Preds.end(); I != E; ++I) { + for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); + I != E; ++I) { if (I->second) continue; if (++NumOps > 1) return false; @@ -641,8 +641,8 @@ } if (!Visited.insert(SU).second) return; - for (std::set >::iterator I = SU->Preds.begin(), - E = SU->Preds.end(); I != E; ++I) + for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); I != E; + ++I) isReachable(I->first, TargetSU, Visited, Reached); } @@ -655,8 +655,8 @@ static SUnit *getDefUsePredecessor(SUnit *SU) { SDNode *DU = SU->Node->getOperand(0).Val; - for (std::set >::iterator - I = SU->Preds.begin(), E = SU->Preds.end(); I != E; ++I) { + for (SUnit::pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); + I != E; ++I) { if (I->second) continue; // ignore chain preds SUnit *PredSU = I->first; if (PredSU->Node == DU) @@ -689,8 +689,8 @@ SUnit *DUSU = getDefUsePredecessor(SU); if (!DUSU) continue; - for (std::set >::iterator I = DUSU->Succs.begin(), - E = DUSU->Succs.end(); I != E; ++I) { + for (SUnit::succ_iterator I = DUSU->Succs.begin(), E = DUSU->Succs.end(); + I != E; ++I) { if (I->second) continue; SUnit *SuccSU = I->first; if (SuccSU != SU && @@ -699,9 +699,9 @@ if (SuccSU->Depth == SU->Depth && !isReachable(SuccSU, SU)) { DEBUG(std::cerr << "Adding an edge from SU # " << SU->NodeNum << " to SU #" << SuccSU->NodeNum << "\n"); - if (SU->Preds.insert(std::make_pair(SuccSU, true)).second) + if (SU->addPred(SuccSU, true)) SU->NumChainPredsLeft++; - if (SuccSU->Succs.insert(std::make_pair(SU, true)).second) + if (SuccSU->addSucc(SU, true)) SuccSU->NumChainSuccsLeft++; } } @@ -734,8 +734,8 @@ SethiUllmanNumber = INT_MAX - 10; else { int Extra = 0; - for (std::set >::const_iterator - I = SU->Preds.begin(), E = SU->Preds.end(); I != E; ++I) { + for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); + I != E; ++I) { if (I->second) continue; // ignore chain preds SUnit *PredSU = I->first; int PredSethiUllman = CalcNodePriority(PredSU); @@ -763,11 +763,11 @@ static unsigned SumOfUnscheduledPredsOfSuccs(const SUnit *SU) { unsigned Sum = 0; - for (std::set >::const_iterator - I = SU->Succs.begin(), E = SU->Succs.end(); I != E; ++I) { + for (SUnit::const_succ_iterator I = SU->Succs.begin(), E = SU->Succs.end(); + I != E; ++I) { SUnit *SuccSU = I->first; - for (std::set >::const_iterator - II = SuccSU->Preds.begin(), EE = SuccSU->Preds.end(); II != EE; ++II) { + for (SUnit::const_pred_iterator II = SuccSU->Preds.begin(), + EE = SuccSU->Preds.end(); II != EE; ++II) { SUnit *PredSU = II->first; if (!PredSU->isScheduled) Sum++; @@ -855,8 +855,8 @@ SethiUllmanNumber = 1; else { int Extra = 0; - for (std::set >::const_iterator - I = SU->Preds.begin(), E = SU->Preds.end(); I != E; ++I) { + for (SUnit::const_pred_iterator I = SU->Preds.begin(), E = SU->Preds.end(); + I != E; ++I) { if (I->second) continue; // ignore chain preds SUnit *PredSU = I->first; int PredSethiUllman = CalcNodePriority(PredSU); From lattner at cs.uiuc.edu Wed Aug 16 22:25:27 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 22:25:27 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608170325.k7H3PRcj002952@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.12 -> 1.13 --- Log message: remove IRC transcript. Anything still misunderstood after the faq is read can be added to the faq. --- Diffs of the changes: (+1 -327) GetElementPtr.html | 328 ----------------------------------------------------- 1 files changed, 1 insertion(+), 327 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.12 llvm/docs/GetElementPtr.html:1.13 --- llvm/docs/GetElementPtr.html:1.12 Wed Aug 16 00:53:32 2006 +++ llvm/docs/GetElementPtr.html Wed Aug 16 22:25:07 2006 @@ -297,332 +297,6 @@
      - - -
      -

      The following is a real discussion from the - #llvm IRC channel about the GEP - instruction. You may find this instructive as it was the basis for this - document.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      UserComment
      YorionIf x & y must alias, are [ getelementptr x,0,0,1,2 ] and [ getelementptr x,1,2 ] aliased? (they obviously have different types, but they should alias...)
      Yorionoops, for the second one I meant [ getelementptr y,1,2 ]
      ReidI don't see how that could be, Yorion but I'm not the authority on this
      Yorionhmm..
      Reidthe two geps, by definition, are going to produce different pointers which are not aliased
      Yorionwould [ GEP x,1,0 ] and [ GEP y,1 ] be aliased?
      Reidif the second gep was [gep y,0,0,1,2] then they should be aliased as well
      Reidno, I wouldn't expect that to work either :)
      Reidyou can't just arbitrarily drop leading or trailing indices :)
      Reid(.. leading or trailing 0 indices, I mean)
      Reidthis instruction walks through a data structure and generates a pointer to the resulting thing
      Reidif the number of indices are different, you're ending up at a different place and by definition they'll have different addresses
      Yorionoh, I see, because of different types, [ GEP x,0,1 ] - & [ GEP x,1 ] actually might refer to different fields, but might also refer to the same ones...
      Reidor, at least, that's my crude understanding of it :)
      Reidno, they'll definitely refer to different fields
      nicholasGEP x,0,1 ==> &((*(x+0))+1)? vs. GEP x,1 ==> &(*(x+1))?
      Reidlemme grok that for a sec
      Reidthat might be true in some limited definition of x, but it wouldn't be generally
      nicholasoh. fields of different sizes in a structure.
      Reidyup
      Yorionis perhaps the type unification the reason why [ GEP x,0,1 ] and [ GEP x,1 ] cannot alias?
      Reidno
      Reidthey may or may not have the same type, but they are definitely different pointers
      Reidlets use a concrete example for "x"
      Reidsuppose x is "struct {int a, float b} *"
      ReidGEP X,0,1 is going to return the address of b
      ReidGEP X,1 is going to return the address of the *second* "a" (after the first b)
      Yorionah, I see...
      Yoriontrailing zeros are still a bit confusing...
      Reidsame thing .. you're just selecting the 0th member of an array or structure
      Yorionyou don't move away from the pointer, only the type is changed
      Reidno, you still move away from the pointer .. the type might change, or not
      Reidthe pointer definitely changes
      Reidlets look at an example for trailing zero
      Reidsuppose x is "int x[10][10][10][10]" (in C)
      ReidGEP X,0,0 will yield you a 3 dimensional array
      ReidGEP X,0,0,0,0,0 will yield you an "int"
      Reidmake sense?
      Yorionyes
      Reidso, I think there's a law here: if the number of indices in two GEP instructions are not equivalent, there is no way the resulting pointers can alias
      Reid(assuming the x and y alias)
      YorionI was confused with some code in BasicAliasAnalysis that says that two pointers are equal if they differ only in trailing zeros
      YorionBasicAliasAnalysis.cpp:504-518
      Reidlemme look
      nicholasif y1 = GEP X, 0, 0 and y2 = GEP X, 0, 0, 0, 0, 0 (from Reid's example)
      nicholasthen doesn't *y1 and *y2 both refer to the same "int"?
      Reidthey shouldn't
      Reidhmm .. actually, maybe you're right :)
      Reidthey definitely have different *types*
      Yoriontrue
      nicholasdifferent types just doesn't cut it. :)
      Reid.. thinking on this :)
      nicholassimilarly, i could create a yucky with a struct that has a char *, then have you GEP right through the pointer into the pointed-to data. That could mean that the resulting point might alias anything.
      Yorionmy theory (after reading BAA) is that all zeros can be omitted, and that the pointers alias if they have the same sequence of indices
      Yorionhowever, this screws the typing, so that's why zeros are for
      Yorionnicholas, does that match your hunch?
      nicholasI have to admit, I've had much grief with GEPIs already. I wish the semantics were plainly documented as part of their own language, instead of just relying on C aliasing rules and C semantics...
      nicholasYorion: leading zeroes can't be omitted.
      Reidokay, if you have two GEPs and their leading indices are an exact match, if the one with more indices only has trailing 0s then they should alias
      nicholasmust alias, i think.
      Reidyes, must alias, sorry
      Yorionokay
      YorionI'm glad we cleared this up
      Reidso, if y1 = GEP X, 1,2,0 and if y2 = GEP X, 1,2,0,0,0 then y1 "must alias" y2 :)
      Reidbut that doesn't work for leading 0s :)
      Yorionyes, true... I was wrong
      ReidI too have been having fun with GEP recently :)
      Yorionbut, there're cases like [a = GEP x,1,0; b = GEP a,1,0; c = GEP b,1,0], and that should be equivalent to GEP x,1,0,1,0,1
      Reidnot quite
      nicholasI'm sure another rule can be written for GEPIs, but they would only apply to type-safe code.
      nicholasanother *tautology
      YorionReid: why not, only the type should be different...
      Reidits should be equivalent to GEP x,1,0,1,0,1,0
      Yorionand that must alias GEP x,1,0,1,0,1
      Reidhmm, by the previous rule, I guess you're right :)
      YorionI'm a bit scared that even you're a bit confused about GEP
      ReidI'm glad I'm not the only one that gets a little confused wrapping my head around this stuff :)
      ReidGEP has always confused me .. partly because I think its wrong :)
      Reidwell, actually, not so much that GEP is wrong, but that gvars being pointers without storage
      Reidi.e. when you say "%x = global int" in LLVM, the type of X is int*
      Reidyet, there is no storage for that pointer
      Reidits magically deduced
      nicholaswell, it makes no sense to have globals be SSA...
      Reidheh
      Reidyeah, well .. practicalities :)
      Yoriontrue
      Yorionsabre gave me a reference on how globals are handled in SSA
      Reidanyway, gotta run
      Yorionthe paper was crappy, but I do understand now why is it implemented that way in LLVM
      Yorionthx for the interesting discussion Reid
      Reidheh .. its one that Chris and I keep having .. he just tells me that C has rotted my brain :)
      nicholaslol
      Yorionhehehe
      Reidhe might be right :)
      Yorionsabre: have you seen the discussion on GEP?
      sabreno
      sabreI'll read the backlog, j/s
      sabreok, there's a lot
      sabrewhat's the executive summary?
      sabredo you have a q?
      Yorionis it possible that GEP x,0,0,1 and GEP x,1 alias?
      sabreno
      Yorionand b) GEP x,1,0,0 and GEP x,1 should alias, right?
      sabreI assume you mean for size = 1 ?
      sabreb) yes
      Yorionalthough they have different types
      sabreright
      Yorionokay
      YorionI'm still not 100% convinced that: a=GEP x,1,0; b=GEP a,1,0; c=GEP b,1,0 cannot alias Z=GEP x,1,1,1
      Yorion(that c and z cannot alias)
      sabrethat's becuse they do alias
      sabremustalias in fact
      Yorionbut then: GEP x,1,0,1,0,1,0 = GEP x,1,1,1
      sabreYorion: no
      sabrec != GEP x,1,0,1,0,1,0
      sabrethe first index doesn't work like that
      Yorionhow does then the first index work? c and z must alias, but GEP x,1,0,1,0 != GEP x,1,1 ??
      sabre*sigh*
      Reid:)
      Reidwe need an FAQ on this
      sabreYorion: how did you get
      sabre"GEP x,1,0,1,0"?
      Yorionlook
      sabreyou can't just concatenate subscripts
      Yorionwhy?
      sabrebecause... it doesn't work that way?
      sabreconsider C
      Yorionhow does it work?
      sabreif I have blah* P
      sabreP[0][1][2][3][4]
      sabrethis is *not* the same as:
      sabret = &P[0][1][2] ... t[3][4]
      sabreYorion: Consider: struct *P
      sabreP->X == P[0].X
      sabreYou're losing the 0.
      sabreP->X->Y == P[0].X[0].Y
      sabreNot P.X.Y
      sabreactually that's a bad analogy
      sabrebecause C dereferences in this case
      sabreTry: (&(P->X))->Y
      Yorionso, a=GEP x,1,0; b=GEP a,1,0; c=GEP b,1,0, can you construct the definition of c in terms of x?
      sabreyes, but you're going out of bounds :)
      sabreconsider this:
      sabre{ float, { double , { int } } } *P
      sabreint *X = gep P, 0, 1, 1, 0
      sabredo you understand the leading zero?
      sabrealternatively:
      sabret = gep P, 0, 1
      sabret2 = gep t, 0, 1
      sabreX = gep t, 0, 0
      Yorionwhat's t2 for?
      sabreoh
      sabresorry :)
      sabreX = gep t2, 0, 0
      Yoriongive me a minute please
      sabreok
      Yorionsabre: shouldn't the type be: { float, { double, { int }* } }* P ?
      sabrenope
      sabrewhy the extra * ?
      sabreif it helps, the type of t is { double, {int}}* and t2 is {int}* and X is int*
      Yorionwait... 0 represents dereference, natural number i - represents &A[i] ?
      sabregep does no dereferences, ever
      sabregep P, 0, 1 is equivalent to &P[0].X
      sabreaka &P->X
      sabregep P, 1 == &P[1] aka P+1
      sabreso gep P, 0, 1 can't alias gep P, 1 just like - &P->Y can't alias P+1
      sabreassuming P is a pointer to struct {X, Y }
      Yorionsabre: is it possible to come up with a general rule for "arithmetic of GEP indices"?
      sabreYorion: of course, it's very simple
      sabrejust not what you're expecting :)
      sabreSee langref.html
      Yorionfor example, a=GEP x,0,0,1 b=GEP a,0,0,1, c=GEP b,0,0,1, that should be equal to GEP x,0,1,1,0, right?
      YorionI did
      Yorionoops, equal to GEP x,0,1,1,1,0
      sabrethat would be:
      sabreGEP X, 0, 0, 1, 0, 1, 0, 1
      Yorionyou're killing me
      sabreThe basic rule when turning: A = GEP B, C D = GEP A, 0, E
      sabreis that you drop the 0, turning it into
      sabreGEP B, C, E
      Yorionokay, that's good. any other rules?
      nicholaswhat if it isn't a 0?
      sabremore generally: A = GEP Ptr, B, C, ... D = GEP A, 0, E, F, ...
      sabreD = GEP Ptr, B, C, ... E, F, ...
      sabreif it's not zero, you generally cannot concatenate them
      sabreunless the first gep has one subscript
      sabrein which case you drop the zero
      sabreif you look in InstCombiner::visitGetElementPtrInst, it should have this logic
      Yorionwhat if there is no zero? how can I compute the offset from the base pointer in that case?
      Yorionlike A=GEP B,C and D=GEP A,E,F
      sabreyou don't have to combine them to compute an offset
      sabreare you *just* trying to get a byte offset from the pointer?
      YorionI'm trying to get offset of D from B
      sabrewhy didn't you say so? :)
      sabrewith all constant subscripts, it's trivial
      sabrelook at SelectionDAGLowering::visitGetElementPtr
      sabrein CodeGen/SelectionDAG/SelectionDAGISel.cpp
      sabrebasically the rule is that you multiply the index by the size of the thing indexed
      sabrethere is also a Support/GetElementPtrIterator or something
      sabrethat makes it trivial to see what type is indexed by which subscript
      sabrefor each subscript it gives you a type
      sabreFor an array subscript you multiply the index by the indexed type
      sabrefor a struct subscript, you add the field offset
      sabres/array/sequentialtype/ if you're in a pedantic mood
      Yorionlet's focus on structs: in that case, the above given example would be: D = GEP B,C,E,F?
      sabreno
      sabreyou drop the E if it's zero
      sabreif it's not you can't concat
      sabreare you trying to trick me into saying "yes, just append the indices"? :)
      Yorionokay, let's assume E is not zero, how do I compute offset from B for D for a struct?
      sabreWhy are you framing this in terms of concatenation?
      Yorionno, I'm trying to understand it
      sabrecomputing an offset and concatenating are entirely different
      sabreLets consider a specific example
      Yorionbecause I want to express certain properties in the terms of base pointers either globals or parameters
      YorionI want to eliminate locals from my analysis
      sabreyou realize that parmeters can point into the middle of structs?
      Yorionyes
      sabreyou realize invalid access paths can be constructed with geps/
      sabre?
      Yorionwhat do you mean by invalid access paths?
      Yorionlike offseting out of the struct which is passed to the function?
      sabreThe case where the subscript isn't zero is invalid code
      sabrefrom a type-safety perspective
      DannyBhe means untypesafe things that seem valid :)
      DannyBIE they point somewhere in the struct, but not to any particular field
      DannyB(or whatever)
      sabreright
      Yorionokay
      sabreor they might point in some other struct :)
      sabreIt's the equivalent to saying:
      sabrestruct Foo { int A, int B; }
      sabreFoo* P =
      sabreT = &P->B;
      sabreS = T+1
      sabrethat is:
      sabreT = gep 0, 1
      sabreS = gep T, 1
      sabreyou can't concat those and get a type-safe access path
      sabreremember T = &P->B === T = &P[0].B
      sabreunderstand?
      Yorionlet me think for a minute
      sabreConsider what the C case does, it will be most clear if you're used to C
      sabre:)
      sabreConsider the byte offset and why it doesn't point into P-> anything
      sabreit points into P[1] not P[0]
      Yorionit's perfectly fine if GEP offsets out of the type. I'd still need to express GEP in the terms of base pointers. Take the example above: T=GEP P,0,1; S=GEP T,1
      Yoriontype safety is not crucial in my case
      sabreThat specific example is GEP P, 1, 0
      sabrehowever, you can form geps that are NOT equivalent to anything else
      sabrefor example, consider:
      sabrestruct X { int, char}
      Yorionthat is fine. they're equivalent to something in the calling context
      sabrethe same sequence points into padding
      sabreand there is no gep that can do that
      Yorionthe bottom line is: if the program is valid, interprocedural analysis will match that offset with something in one of the functions on the call stack
      Yorionand that's all I care about
      Yorioncan you give me a formula for structs for computing - offsets that takes into account the case GEP T,&lt:non_zeros> and the size of the structs/fields?
      sabreyes, I did above
      sabreTwo things:
      sabreGEP Ptr, A, X, Y, Z
      sabreThe result is Ptr + A * sizeof(struct) + fieldoffs(X) + fieldoffs(Y) + fieldoffs(Z)
      sabresimple enough?
      sabreyou see why "A" is special?
      Yoriongive me a min, I'm constructing an example
      Reidsabre: I think I finally understand
      Reidyour comment that GEP *never* dereferences makes a lot of sense
      Reidit is only doing address calculation, so the first one is taking the address of the var
      sabreIf C didn't conflate lvalues and rvalues, GEP would be much easier to understand for people
      Reidyeah
      Yorionso, for example: M=GEP A,B,C; N=GEP M,D,E; N = [ A + B*sizeof(struct) + fieldoffs(C) ]:(of type T) + D*sizeof(T) + fieldoffs(E)
      ReidI just remember learning a hard lesson about the difference between char* A and char A[] .. long time ago when I was learning C
      sabreof type T*
      sabreotherwise fine
      Yorionokay, I think I finally understand it
      sabrewithout the T* your D sizeof will be wrong
      Yoriona suggestion: the formula you gave above explains it all
      YorionI'd suggest explaining it that way in documentation
      sabreThat's not right though
      sabreit doesn't include arrays or packed types
      sabreso it is, at best, a half truth
      Yoriontell me, how to compute the fieldoffs for an index?
      sabrearrays can be in structs :)
      Yorionin bytes
      sabreidx * sizeof(arrayelt)
      sabrejust like for pointers (the first index)
      sabreThere are two cases: structs and sequentials
      sabrefor sequentials you use idx*sizeof(sequenced type)
      sabrefor structs you add their offset
      sabreit's really very simple :)
      sabrethe first index of a gep is always over the pointer
      Yorionno I meant in LLVM, how do I convert the field offset into bytes?
      sabrewhich is why it's strange
      sabreif you only think about structs
      sabreTargetData::getFieldOffset
      sabreor something
      sabrelook in SelectionDAGISel.cpp (visitGEP) as I suggested.
      Yoriondo you still have the energy to go over sequential types? :-)
      Yorionwhat is the offset formula for sequential types?
      Reidwe just went over that: idx * sizeof(elementType)
      Yorionso, if there's an array hidden somewhere in the struct, essentially I need to compute idx*sizeof() instead of fieldoffs() and that's it?
      sabreyes
      Reidyes
      Yorionexcellent.
      sabreThere are two cases: structs and sequentials
      sabre[9:17pm] sabre: for sequentials you use idx*sizeof(sequenced type)
      sabre[9:17pm] sabre: for structs you add their offset
      sabre[9:17pm] sabre: it's really very simple :)
      Yorionnow when I understand it, it is simple...
      Yorionthx
      - -
      @@ -631,7 +305,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/16 05:53:32 $ + Last modified: $Date: 2006/08/17 03:25:07 $
      From lattner at cs.uiuc.edu Wed Aug 16 22:27:04 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 16 Aug 2006 22:27:04 -0500 Subject: [llvm-commits] CVS: llvm/docs/GetElementPtr.html Message-ID: <200608170327.k7H3R4bh003019@zion.cs.uiuc.edu> Changes in directory llvm/docs: GetElementPtr.html updated: 1.13 -> 1.14 --- Log message: Fix validation problem --- Diffs of the changes: (+3 -3) GetElementPtr.html | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/docs/GetElementPtr.html diff -u llvm/docs/GetElementPtr.html:1.13 llvm/docs/GetElementPtr.html:1.14 --- llvm/docs/GetElementPtr.html:1.13 Wed Aug 16 22:25:07 2006 +++ llvm/docs/GetElementPtr.html Wed Aug 16 22:26:50 2006 @@ -88,8 +88,8 @@
         X = &Foo[0].F;

      Sometimes this question gets rephrased as:

      -
      Why is it okay to index through the first pointer, but - subsequent pointers won't be dereferenced?
      +

      Why is it okay to index through the first pointer, but + subsequent pointers won't be dereferenced?

      The answer is simply because memory does not have to be accessed to perform the computation. The first operand to the GEP instruction must be a value of a pointer type. The value of the pointer is provided directly to @@ -305,7 +305,7 @@ Valid HTML 4.01! The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/17 03:25:07 $ + Last modified: $Date: 2006/08/17 03:26:50 $ From alenhar2 at cs.uiuc.edu Thu Aug 17 10:36:10 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 17 Aug 2006 10:36:10 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200608171536.k7HFaAC1011464@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.245 -> 1.246 --- Log message: Add support for S and D constraints, as needed to compile the linux kernel. --- Diffs of the changes: (+10 -0) X86ISelLowering.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.245 llvm/lib/Target/X86/X86ISelLowering.cpp:1.246 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.245 Fri Aug 11 12:38:39 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Aug 17 10:35:43 2006 @@ -4184,6 +4184,8 @@ case 'Q': case 'x': case 'Y': + case 'S': + case 'D': return C_RegisterClass; default: return TargetLowering::getConstraintType(ConstraintLetter); } @@ -4197,6 +4199,14 @@ // FIXME: not handling MMX registers yet ('y' constraint). switch (Constraint[0]) { // GCC X86 Constraint Letters default: break; // Unknown constraint letter + case 'S': // ESI + if (VT == MVT::i32) + return make_vector(X86::ESI,0); + break; + case 'D': // EDI + if (VT == MVT::i32) + return make_vector(X86::EDI,0); + break; case 'A': // EAX/EDX if (VT == MVT::i32 || VT == MVT::i64) return make_vector(X86::EAX, X86::EDX, 0); From alenhar2 at uiuc.edu Thu Aug 17 09:43:52 2006 From: alenhar2 at uiuc.edu (Andrew Lenharth) Date: Thu, 17 Aug 2006 09:43:52 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp BugDriver.h CrashDebugger.cpp ExecutionDriver.cpp bugpoint.cpp In-Reply-To: <200608151641.k7FGf37Y013176@zion.cs.uiuc.edu> References: <200608151641.k7FGf37Y013176@zion.cs.uiuc.edu> Message-ID: <1155825832.18093.5.camel@apoc.cs.uiuc.edu> Is the external program part of this generalized? I and others have cases where we need to run a complex series of programs to test the correctness of a transform. Namely, we want to take a compiled kernel start it up in a simulator, check something then return and tell bugpoint if the output was right or not. Andrew On Tue, 2006-08-15 at 11:41 -0500, Patrick Jenkins wrote: > > Changes in directory llvm/tools/bugpoint: > > BugDriver.cpp updated: 1.46 -> 1.47 > BugDriver.h updated: 1.43 -> 1.44 > CrashDebugger.cpp updated: 1.48 -> 1.49 > ExecutionDriver.cpp updated: 1.62 -> 1.63 > bugpoint.cpp updated: 1.31 -> 1.32 > --- > Log message: > > This commit adds a new feature called find-bugs. The find-bugs option can be invoked on a .bc file from the command like with -find-bugs and a list of passes you wish to test. This procedure takes the set of optimization passes the user specifies, randomizes the passes, runs the passes on the specified .bc file, compiles the program, and finally runs the program checking its output vs the .bc file with no optimizations. This process repeats until either the user kills bugpoint or an error occurs in the optimizations, program complitation, or the running of the program. If an error occurs, bugpoint attempts to diagnose the error by eliminating passes that are not at fault and code that is not needed. > > > --- > Diffs of the changes: (+73 -26) > > BugDriver.cpp | 30 ++++++++++++++---------------- > BugDriver.h | 23 +++++++++++++++++++++-- > CrashDebugger.cpp | 4 ++-- > ExecutionDriver.cpp | 32 +++++++++++++++++++++++++++++--- > bugpoint.cpp | 10 +++++++--- > 5 files changed, 73 insertions(+), 26 deletions(-) > > > Index: llvm/tools/bugpoint/BugDriver.cpp > diff -u llvm/tools/bugpoint/BugDriver.cpp:1.46 llvm/tools/bugpoint/BugDriver.cpp:1.47 > --- llvm/tools/bugpoint/BugDriver.cpp:1.46 Mon Jun 12 22:10:48 2006 > +++ llvm/tools/bugpoint/BugDriver.cpp Tue Aug 15 11:40:49 2006 > @@ -62,10 +62,11 @@ > return Result; > } > > -BugDriver::BugDriver(const char *toolname, bool as_child, unsigned timeout) > +BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs, > + unsigned timeout) > : ToolName(toolname), ReferenceOutputFile(OutputFile), > Program(0), Interpreter(0), cbe(0), gcc(0), run_as_child(as_child), > - Timeout(timeout) {} > + run_find_bugs(find_bugs), Timeout(timeout) {} > > > /// ParseInputFile - Given a bytecode or assembly input filename, parse and > @@ -140,6 +141,12 @@ > // Execute the passes > return runPassesAsChild(PassesToRun); > } > + > + if (run_find_bugs) { > + // Rearrange the passes and apply them to the program. Repeat this process > + // until the user kills the program or we find a bug. > + return runManyPasses(PassesToRun); > + } > > // If we're not running as a child, the first thing that we must do is > // determine what the problem is. Does the optimization series crash the > @@ -175,20 +182,10 @@ > bool CreatedOutput = false; > if (ReferenceOutputFile.empty()) { > std::cout << "Generating reference output from raw program: "; > - try { > - ReferenceOutputFile = executeProgramWithCBE("bugpoint.reference.out"); > - CreatedOutput = true; > - std::cout << "Reference output is: " << ReferenceOutputFile << '\n'; > - } catch (ToolExecutionError &TEE) { > - std::cerr << TEE.what(); > - if (Interpreter != cbe) { > - std::cerr << "*** There is a bug running the C backend. Either debug" > - << " it (use the -run-cbe bugpoint option), or fix the error" > - << " some other way.\n"; > - return 1; > - } > - return debugCodeGeneratorCrash(); > + if(!createReferenceFile(Program)){ > + return debugCodeGeneratorCrash(); > } > + CreatedOutput = true; > } > > // Make sure the reference output file gets deleted on exit from this > @@ -197,7 +194,8 @@ > FileRemover RemoverInstance(ROF, CreatedOutput); > > // Diff the output of the raw program against the reference output. If it > - // matches, then we have a miscompilation bug. > + // matches, then we assume there is a miscompilation bug and try to > + // diagnose it. > std::cout << "*** Checking the code generator...\n"; > try { > if (!diffProgram()) { > > > Index: llvm/tools/bugpoint/BugDriver.h > diff -u llvm/tools/bugpoint/BugDriver.h:1.43 llvm/tools/bugpoint/BugDriver.h:1.44 > --- llvm/tools/bugpoint/BugDriver.h:1.43 Mon Jun 12 22:10:48 2006 > +++ llvm/tools/bugpoint/BugDriver.h Tue Aug 15 11:40:49 2006 > @@ -48,6 +48,7 @@ > CBE *cbe; > GCC *gcc; > bool run_as_child; > + bool run_find_bugs; > unsigned Timeout; > > // FIXME: sort out public/private distinctions... > @@ -55,7 +56,8 @@ > friend class ReduceMisCodegenFunctions; > > public: > - BugDriver(const char *toolname, bool as_child, unsigned timeout); > + BugDriver(const char *toolname, bool as_child, bool find_bugs, > + unsigned timeout); > > const std::string &getToolName() const { return ToolName; } > > @@ -82,7 +84,7 @@ > /// crashes on input. It attempts to prune down the testcase to something > /// reasonable, and figure out exactly which pass is crashing. > /// > - bool debugOptimizerCrash(); > + bool debugOptimizerCrash(const std::string &ID = "passes"); > > /// debugCodeGeneratorCrash - This method is called when the code generator > /// crashes on an input. It attempts to reduce the input as much as possible > @@ -175,6 +177,13 @@ > /// > std::string executeProgramWithCBE(std::string OutputFile = ""); > > + /// createReferenceFile - calls compileProgram and then records the output > + /// into ReferenceOutputFile. Returns true if reference file created, false > + /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE > + /// this function. > + /// > + bool createReferenceFile(Module *M, const std::string &Filename = "bugpoint.reference.out"); > + > /// diffProgram - This method executes the specified module and diffs the > /// output against the file specified by ReferenceOutputFile. If the output > /// is different, true is returned. If there is a problem with the code > @@ -183,6 +192,7 @@ > bool diffProgram(const std::string &BytecodeFile = "", > const std::string &SharedObj = "", > bool RemoveBytecode = false); > + > /// EmitProgressBytecode - This function is used to output the current Program > /// to a file named "bugpoint-ID.bc". > /// > @@ -235,6 +245,15 @@ > bool runPasses(const std::vector &PassesToRun, > std::string &OutputFilename, bool DeleteOutput = false, > bool Quiet = false) const; > + > + /// runManyPasses - Take the specified pass list and create different > + /// combinations of passes to compile the program with. Compile the program with > + /// each set and mark test to see if it compiled correctly. If the passes > + /// compiled correctly output nothing and rearrange the passes into a new order. > + /// If the passes did not compile correctly, output the command required to > + /// recreate the failure. This returns true if a compiler error is found. > + /// > + bool runManyPasses(const std::vector &AllPasses); > > /// writeProgramToFile - This writes the current "Program" to the named > /// bytecode file. If an error occurs, true is returned. > > > Index: llvm/tools/bugpoint/CrashDebugger.cpp > diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.48 llvm/tools/bugpoint/CrashDebugger.cpp:1.49 > --- llvm/tools/bugpoint/CrashDebugger.cpp:1.48 Tue Jun 6 17:30:59 2006 > +++ llvm/tools/bugpoint/CrashDebugger.cpp Tue Aug 15 11:40:49 2006 > @@ -423,7 +423,7 @@ > /// It attempts to prune down the testcase to something reasonable, and figure > /// out exactly which pass is crashing. > /// > -bool BugDriver::debugOptimizerCrash() { > +bool BugDriver::debugOptimizerCrash(const std::string &ID) { > std::cout << "\n*** Debugging optimizer crash!\n"; > > // Reduce the list of passes which causes the optimizer to crash... > @@ -435,7 +435,7 @@ > << (PassesToRun.size() == 1 ? ": " : "es: ") > << getPassesString(PassesToRun) << '\n'; > > - EmitProgressBytecode("passinput"); > + EmitProgressBytecode(ID); > > return DebugACrash(*this, TestForOptimizerCrash); > } > > > Index: llvm/tools/bugpoint/ExecutionDriver.cpp > diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.62 llvm/tools/bugpoint/ExecutionDriver.cpp:1.63 > --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.62 Tue Jun 27 15:35:36 2006 > +++ llvm/tools/bugpoint/ExecutionDriver.cpp Tue Aug 15 11:40:49 2006 > @@ -297,10 +297,36 @@ > return "./" + SharedObjectFile; > } > > +/// createReferenceFile - calls compileProgram and then records the output > +/// into ReferenceOutputFile. Returns true if reference file created, false > +/// otherwise. Note: initializeExecutionEnvironment should be called BEFORE > +/// this function. > +/// > +bool BugDriver::createReferenceFile(Module *M, const std::string &Filename){ > + try { > + compileProgram(Program); > + } catch (ToolExecutionError &TEE) { > + return false; > + } > + try { > + ReferenceOutputFile = executeProgramWithCBE(Filename); > + std::cout << "Reference output is: " << ReferenceOutputFile << "\n\n"; > + } catch (ToolExecutionError &TEE) { > + std::cerr << TEE.what(); > + if (Interpreter != cbe) { > + std::cerr << "*** There is a bug running the C backend. Either debug" > + << " it (use the -run-cbe bugpoint option), or fix the error" > + << " some other way.\n"; > + } > + return false; > + } > + return true; > +} > > -/// diffProgram - This method executes the specified module and diffs the output > -/// against the file specified by ReferenceOutputFile. If the output is > -/// different, true is returned. > +/// diffProgram - This method executes the specified module and diffs the > +/// output against the file specified by ReferenceOutputFile. If the output > +/// is different, true is returned. If there is a problem with the code > +/// generator (e.g., llc crashes), this will throw an exception. > /// > bool BugDriver::diffProgram(const std::string &BytecodeFile, > const std::string &SharedObject, > > > Index: llvm/tools/bugpoint/bugpoint.cpp > diff -u llvm/tools/bugpoint/bugpoint.cpp:1.31 llvm/tools/bugpoint/bugpoint.cpp:1.32 > --- llvm/tools/bugpoint/bugpoint.cpp:1.31 Mon Jun 12 22:10:48 2006 > +++ llvm/tools/bugpoint/bugpoint.cpp Tue Aug 15 11:40:49 2006 > @@ -29,8 +29,12 @@ > // from a parent process. It is not intended to be used by users so the > // option is hidden. > static cl::opt > - AsChild("as-child", cl::desc("Run bugpoint as child process"), > - cl::ReallyHidden); > +AsChild("as-child", cl::desc("Run bugpoint as child process"), > + cl::ReallyHidden); > + > +static cl::opt > +FindBugs("find-bugs", cl::desc("Run many different optimization sequences" > + "on program to find bugs"), cl::init(false)); > > static cl::list > InputFilenames(cl::Positional, cl::OneOrMore, > @@ -62,7 +66,7 @@ > sys::PrintStackTraceOnErrorSignal(); > sys::SetInterruptFunction(BugpointInterruptFunction); > > - BugDriver D(argv[0],AsChild,TimeoutValue); > + BugDriver D(argv[0],AsChild,FindBugs,TimeoutValue); > if (D.addSources(InputFilenames)) return 1; > D.addPasses(PassList.begin(), PassList.end()); > > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits > -- http://www.lenharth.org/~andrewl/ And without software to do something useful with all that hardware, the hardware's nothing more than a really complicated space heater. --Neal Stephenson From alenhar2 at cs.uiuc.edu Thu Aug 17 11:08:16 2006 From: alenhar2 at cs.uiuc.edu (Andrew Lenharth) Date: Thu, 17 Aug 2006 11:08:16 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200608171608.k7HG8GgR023486@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.246 -> 1.247 --- Log message: Add the 'c' constraint as needed by the linux kernel --- Diffs of the changes: (+7 -2) X86ISelLowering.cpp | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.246 llvm/lib/Target/X86/X86ISelLowering.cpp:1.247 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.246 Thu Aug 17 10:35:43 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Aug 17 11:07:50 2006 @@ -4186,6 +4186,7 @@ case 'Y': case 'S': case 'D': + case 'c': return C_RegisterClass; default: return TargetLowering::getConstraintType(ConstraintLetter); } @@ -4201,11 +4202,15 @@ default: break; // Unknown constraint letter case 'S': // ESI if (VT == MVT::i32) - return make_vector(X86::ESI,0); + return make_vector(X86::ESI,0); break; case 'D': // EDI if (VT == MVT::i32) - return make_vector(X86::EDI,0); + return make_vector(X86::EDI,0); + break; + case 'c': // ECX + if (VT == MVT::i32) + return make_vector(X86::ECX, 0); break; case 'A': // EAX/EDX if (VT == MVT::i32 || VT == MVT::i64) From clattner at apple.com Thu Aug 17 11:25:17 2006 From: clattner at apple.com (Chris Lattner) Date: Thu, 17 Aug 2006 09:25:17 -0700 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp BugDriver.h CrashDebugger.cpp ExecutionDriver.cpp bugpoint.cpp In-Reply-To: <1155825832.18093.5.camel@apoc.cs.uiuc.edu> References: <200608151641.k7FGf37Y013176@zion.cs.uiuc.edu> <1155825832.18093.5.camel@apoc.cs.uiuc.edu> Message-ID: <766CBF87-2205-460B-8EE0-3C8289ED10DF@apple.com> On Aug 17, 2006, at 7:43 AM, Andrew Lenharth wrote: > Is the external program part of this generalized? I and others have > cases where we need to run a complex series of programs to test the > correctness of a transform. Namely, we want to take a compiled kernel > start it up in a simulator, check something then return and tell > bugpoint if the output was right or not. Nope. It uses the standard "run and diff" stuff that bugpoint already has. It would be straight-forward to extend bugpoint to invoke a script to check this, and that way you could customize the script. If you extended bugpoint to do that, the bugfinder would automatically work with it. -Chris From dpatel at apple.com Thu Aug 17 11:30:10 2006 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Aug 2006 11:30:10 -0500 Subject: [llvm-commits] CVS: llvm-www/img/PhotoDevang.jpg Message-ID: <200608171630.k7HGUAl7013591@zion.cs.uiuc.edu> Changes in directory llvm-www/img: PhotoDevang.jpg added (r1.1) --- Log message: Add myself. --- Diffs of the changes: (+0 -0) PhotoDevang.jpg | 0 1 files changed Index: llvm-www/img/PhotoDevang.jpg From dpatel at apple.com Thu Aug 17 11:30:11 2006 From: dpatel at apple.com (Devang Patel) Date: Thu, 17 Aug 2006 11:30:11 -0500 Subject: [llvm-commits] CVS: llvm-www/developers.txt Message-ID: <200608171630.k7HGUB9I013596@zion.cs.uiuc.edu> Changes in directory llvm-www: developers.txt updated: 1.8 -> 1.9 --- Log message: Add myself. --- Diffs of the changes: (+1 -0) developers.txt | 1 + 1 files changed, 1 insertion(+) Index: llvm-www/developers.txt diff -u llvm-www/developers.txt:1.8 llvm-www/developers.txt:1.9 --- llvm-www/developers.txt:1.8 Fri Aug 11 02:21:36 2006 +++ llvm-www/developers.txt Thu Aug 17 11:29:55 2006 @@ -16,5 +16,6 @@ Tanya Lattner href=http://nondot.org/tonic/ img=PhotoTanya.jpg width=200 height=217 alt=tonic Andrew Lenharth href=http://www.lenharth.org/~andrewl/ img=PhotoAndrew.jpg width=140 height=177 alt=Andrew Duraid Madina href=http://kinoko.c.u-tokyo.ac.jp/~duraid/llvm.html img=PhotoDuraid.jpg width=138 height=195 alt=camel_ +Devang Patel href=mailto:dpatel at apple.com img=PhotoDevang.jpg width=145 height=172 alt=Devang Reid Spencer href=http://illuvium.net/rspencer/ img=PhotoReid.jpg width=145 height=172 alt=Reid Bill Wendling href=http://www.isanbard.org/~wendling/ img=PhotoBill.jpg width=173 height=240 alt=Bill From rafael.espindola at gmail.com Thu Aug 17 12:09:56 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 17 Aug 2006 12:09:56 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp ARMISelDAGToDAG.cpp ARMInstrInfo.td ARMRegisterInfo.cpp Message-ID: <200608171709.k7HH9uMH014309@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMAsmPrinter.cpp updated: 1.10 -> 1.11 ARMISelDAGToDAG.cpp updated: 1.30 -> 1.31 ARMInstrInfo.td updated: 1.15 -> 1.16 ARMRegisterInfo.cpp updated: 1.15 -> 1.16 --- Log message: add a "load effective address" --- Diffs of the changes: (+30 -10) ARMAsmPrinter.cpp | 24 ++++++++++++++++-------- ARMISelDAGToDAG.cpp | 5 +++++ ARMInstrInfo.td | 8 +++++++- ARMRegisterInfo.cpp | 3 ++- 4 files changed, 30 insertions(+), 10 deletions(-) Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.10 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.11 --- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.10 Tue Aug 1 13:53:10 2006 +++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu Aug 17 12:09:40 2006 @@ -59,19 +59,27 @@ return "ARM Assembly Printer"; } - void printMemRegImm(const MachineInstr *MI, unsigned OpNo) { - const MachineOperand &MO1 = MI->getOperand(OpNo); - const MachineOperand &MO2 = MI->getOperand(OpNo + 1); + void printMemRegImm(const MachineInstr *MI, int opNum, + const char *Modifier = NULL) { + const MachineOperand &MO1 = MI->getOperand(opNum); + const MachineOperand &MO2 = MI->getOperand(opNum + 1); assert(MO1.isImmediate()); + bool arith = false; + if (Modifier != NULL) { + assert(strcmp(Modifier, "arith") == 0); + arith = true; + } if (MO2.isConstantPoolIndex()) { - printOperand(MI, OpNo + 1); + printOperand(MI, opNum + 1); } else if (MO2.isRegister()) { - O << '['; - printOperand(MI, OpNo + 1); + if(!arith) + O << '['; + printOperand(MI, opNum + 1); O << ", "; - printOperand(MI, OpNo); - O << ']'; + printOperand(MI, opNum); + if(!arith) + O << ']'; } else { assert(0 && "Invalid Operand Type"); } Index: llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp diff -u llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.30 llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.31 --- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp:1.30 Wed Aug 16 09:43:33 2006 +++ llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp Thu Aug 17 12:09:40 2006 @@ -358,6 +358,11 @@ //register plus/minus 12 bit offset bool ARMDAGToDAGISel::SelectAddrRegImm(SDOperand N, SDOperand &Offset, SDOperand &Base) { + if (FrameIndexSDNode *FIN = dyn_cast(N)) { + Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); + Offset = CurDAG->getTargetConstant(0, MVT::i32); + return true; + } if (N.getOpcode() == ISD::ADD) { short imm = 0; if (isInt12Immediate(N.getOperand(1), imm)) { Index: llvm/lib/Target/ARM/ARMInstrInfo.td diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.15 llvm/lib/Target/ARM/ARMInstrInfo.td:1.16 --- llvm/lib/Target/ARM/ARMInstrInfo.td:1.15 Wed Aug 16 09:43:33 2006 +++ llvm/lib/Target/ARM/ARMInstrInfo.td Thu Aug 17 12:09:40 2006 @@ -21,7 +21,7 @@ // Define ARM specific addressing mode. //register plus/minus 12 bit offset -def iaddr : ComplexPattern; +def iaddr : ComplexPattern; //register plus scaled register //def raddr : ComplexPattern; @@ -83,6 +83,12 @@ "add $dst, $a, $b", [(set IntRegs:$dst, (add IntRegs:$a, imm:$b))]>; +// "LEA" forms of add +def lea_addri : InstARM<(ops IntRegs:$dst, memri:$addr), + "add $dst, ${addr:arith}", + [(set IntRegs:$dst, iaddr:$addr)]>; + + def subri : InstARM<(ops IntRegs:$dst, IntRegs:$a, i32imm:$b), "sub $dst, $a, $b", [(set IntRegs:$dst, (sub IntRegs:$a, imm:$b))]>; Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.15 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.16 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.15 Wed Aug 16 09:43:33 2006 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Thu Aug 17 12:09:40 2006 @@ -89,7 +89,8 @@ MachineFunction &MF = *MBB.getParent(); assert (MI.getOpcode() == ARM::ldr || - MI.getOpcode() == ARM::str); + MI.getOpcode() == ARM::str || + MI.getOpcode() == ARM::lea_addri); unsigned FrameIdx = 2; unsigned OffIdx = 1; From rafael.espindola at gmail.com Thu Aug 17 12:09:56 2006 From: rafael.espindola at gmail.com (Rafael Espindola) Date: Thu, 17 Aug 2006 12:09:56 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/ARM/argaddr.ll Message-ID: <200608171709.k7HH9ufb014314@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/ARM: argaddr.ll added (r1.1) --- Log message: add a "load effective address" --- Diffs of the changes: (+18 -0) argaddr.ll | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+) Index: llvm/test/Regression/CodeGen/ARM/argaddr.ll diff -c /dev/null llvm/test/Regression/CodeGen/ARM/argaddr.ll:1.1 *** /dev/null Thu Aug 17 12:09:50 2006 --- llvm/test/Regression/CodeGen/ARM/argaddr.ll Thu Aug 17 12:09:40 2006 *************** *** 0 **** --- 1,18 ---- + ; RUN: llvm-as < %s | llc -march=arm + void %f(int %a, int %b, int %c, int %d, int %e) { + entry: + %a_addr = alloca int ; [#uses=2] + %b_addr = alloca int ; [#uses=2] + %c_addr = alloca int ; [#uses=2] + %d_addr = alloca int ; [#uses=2] + %e_addr = alloca int ; [#uses=2] + store int %a, int* %a_addr + store int %b, int* %b_addr + store int %c, int* %c_addr + store int %d, int* %d_addr + store int %e, int* %e_addr + call void %g( int* %a_addr, int* %b_addr, int* %c_addr, int* %d_addr, int* %e_addr ) + ret void + } + + declare void %g(int*, int*, int*, int*, int*) From pjenkins at apple.com Thu Aug 17 12:32:21 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Thu, 17 Aug 2006 12:32:21 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/machinegraph.php Message-ID: <200608171732.k7HHWLIC014904@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: machinegraph.php updated: 1.1.1.1 -> 1.2 --- Log message: Created a more descriptive error message for when a user tries to create a graph from a machines page without selecting anythign to graph. The previous error message said "ERROR: Incorrect URL" which led users to believe the problem was on the serverside. --- Diffs of the changes: (+1 -1) machinegraph.php | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: nightlytest-serverside/machinegraph.php diff -u nightlytest-serverside/machinegraph.php:1.1.1.1 nightlytest-serverside/machinegraph.php:1.2 --- nightlytest-serverside/machinegraph.php:1.1.1.1 Wed Jul 5 15:56:33 2006 +++ nightlytest-serverside/machinegraph.php Thu Aug 17 12:32:07 2006 @@ -1,7 +1,7 @@ Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.247 -> 1.248 --- Log message: Fix handling of 'g'. Closes 883 --- Diffs of the changes: (+4 -0) X86ISelLowering.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.247 llvm/lib/Target/X86/X86ISelLowering.cpp:1.248 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.247 Thu Aug 17 11:07:50 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Aug 17 12:50:12 2006 @@ -4187,6 +4187,9 @@ case 'S': case 'D': case 'c': + case 'g': //FIXME: This over-constrains g. It should be replaced by rmi in + // target independent code (I think this constraint is target + // independent) return C_RegisterClass; default: return TargetLowering::getConstraintType(ConstraintLetter); } @@ -4218,6 +4221,7 @@ break; case 'r': // GENERAL_REGS case 'R': // LEGACY_REGS + case 'g': if (VT == MVT::i32) return make_vector(X86::EAX, X86::EDX, X86::ECX, X86::EBX, X86::ESI, X86::EDI, X86::EBP, X86::ESP, 0); From lattner at cs.uiuc.edu Thu Aug 17 13:12:42 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 13:12:42 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200608171812.k7HICgNi015819@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.248 -> 1.249 --- Log message: 'g' is handled by the front-end. --- Diffs of the changes: (+0 -4) X86ISelLowering.cpp | 4 ---- 1 files changed, 4 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.248 llvm/lib/Target/X86/X86ISelLowering.cpp:1.249 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.248 Thu Aug 17 12:50:12 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Aug 17 13:12:28 2006 @@ -4187,9 +4187,6 @@ case 'S': case 'D': case 'c': - case 'g': //FIXME: This over-constrains g. It should be replaced by rmi in - // target independent code (I think this constraint is target - // independent) return C_RegisterClass; default: return TargetLowering::getConstraintType(ConstraintLetter); } @@ -4221,7 +4218,6 @@ break; case 'r': // GENERAL_REGS case 'R': // LEGACY_REGS - case 'g': if (VT == MVT::i32) return make_vector(X86::EAX, X86::EDX, X86::ECX, X86::EBX, X86::ESI, X86::EDI, X86::EBP, X86::ESP, 0); From lattner at cs.uiuc.edu Thu Aug 17 13:43:38 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 13:43:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp Message-ID: <200608171843.k7HIhcEY016547@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.249 -> 1.250 --- Log message: Revert this patch, the front-end has been fixed to make it unneccesary. --- Diffs of the changes: (+0 -15) X86ISelLowering.cpp | 15 --------------- 1 files changed, 15 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.249 llvm/lib/Target/X86/X86ISelLowering.cpp:1.250 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.249 Thu Aug 17 13:12:28 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Thu Aug 17 13:43:24 2006 @@ -4184,9 +4184,6 @@ case 'Q': case 'x': case 'Y': - case 'S': - case 'D': - case 'c': return C_RegisterClass; default: return TargetLowering::getConstraintType(ConstraintLetter); } @@ -4200,18 +4197,6 @@ // FIXME: not handling MMX registers yet ('y' constraint). switch (Constraint[0]) { // GCC X86 Constraint Letters default: break; // Unknown constraint letter - case 'S': // ESI - if (VT == MVT::i32) - return make_vector(X86::ESI,0); - break; - case 'D': // EDI - if (VT == MVT::i32) - return make_vector(X86::EDI,0); - break; - case 'c': // ECX - if (VT == MVT::i32) - return make_vector(X86::ECX, 0); - break; case 'A': // EAX/EDX if (VT == MVT::i32 || VT == MVT::i64) return make_vector(X86::EAX, X86::EDX, 0); From lattner at cs.uiuc.edu Thu Aug 17 13:50:06 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 13:50:06 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/FindBugs.cpp Message-ID: <200608171850.k7HIo6XA016669@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: FindBugs.cpp updated: 1.1 -> 1.2 --- Log message: minor cleanups --- Diffs of the changes: (+16 -20) FindBugs.cpp | 36 ++++++++++++++++-------------------- 1 files changed, 16 insertions(+), 20 deletions(-) Index: llvm/tools/bugpoint/FindBugs.cpp diff -u llvm/tools/bugpoint/FindBugs.cpp:1.1 llvm/tools/bugpoint/FindBugs.cpp:1.2 --- llvm/tools/bugpoint/FindBugs.cpp:1.1 Tue Aug 15 11:41:52 2006 +++ llvm/tools/bugpoint/FindBugs.cpp Thu Aug 17 13:49:52 2006 @@ -13,13 +13,13 @@ // we can hopefully spot bugs in the optimizations. // //===----------------------------------------------------------------------===// + #include "BugDriver.h" #include "ToolRunner.h" - -#include "llvm/Bytecode/WriteBytecodePass.h" - +#include "llvm/Pass.h" #include #include +#include using namespace llvm; /// runManyPasses - Take the specified pass list and create different @@ -29,28 +29,27 @@ /// If the passes did not compile correctly, output the command required to /// recreate the failure. This returns true if a compiler error is found. /// -bool BugDriver::runManyPasses(const std::vector &AllPasses) -{ +bool BugDriver::runManyPasses(const std::vector &AllPasses) { std::string Filename; std::vector TempPass(AllPasses); std::cout << "Starting bug finding procedure...\n\n"; // Creating a reference output if necessary if (initializeExecutionEnvironment()) return false; + std::cout << "\n"; if (ReferenceOutputFile.empty()) { - std::cout << "Generating reference output from raw program: \n"; - if(!createReferenceFile(Program)){ - return false; - } + std::cout << "Generating reference output from raw program: \n"; + if (!createReferenceFile(Program)) + return false; } srand(time(NULL)); std::vector::iterator I = TempPass.begin(); std::vector::iterator E = TempPass.end(); - int num=1; - while(1){ + unsigned num = 1; + while(1) { // // Step 1: Randomize the order of the optimizer passes. // @@ -60,18 +59,18 @@ // Step 2: Run optimizer passes on the program and check for success. // std::cout << "Running selected passes on program to test for crash: "; - for(int i=0, e=TempPass.size(); i!=e; i++) { + for(int i = 0, e = TempPass.size(); i != e; i++) { std::cout << "-" << TempPass[i]->getPassArgument( )<< " "; } + std::string Filename; if(runPasses(TempPass, Filename, false)) { std::cout << "\n"; std::cout << "Optimizer passes caused failure!\n\n"; debugOptimizerCrash(); return true; - } - else{ - std::cout << "Combination "< Changes in directory llvm/tools/bugpoint: BugDriver.h updated: 1.44 -> 1.45 --- Log message: fit in 80 cols --- Diffs of the changes: (+2 -1) BugDriver.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/tools/bugpoint/BugDriver.h diff -u llvm/tools/bugpoint/BugDriver.h:1.44 llvm/tools/bugpoint/BugDriver.h:1.45 --- llvm/tools/bugpoint/BugDriver.h:1.44 Tue Aug 15 11:40:49 2006 +++ llvm/tools/bugpoint/BugDriver.h Thu Aug 17 13:51:28 2006 @@ -182,7 +182,8 @@ /// otherwise. Note: initializeExecutionEnvironment should be called BEFORE /// this function. /// - bool createReferenceFile(Module *M, const std::string &Filename = "bugpoint.reference.out"); + bool createReferenceFile(Module *M, const std::string &Filename + = "bugpoint.reference.out"); /// diffProgram - This method executes the specified module and diffs the /// output against the file specified by ReferenceOutputFile. If the output From pjenkins at apple.com Thu Aug 17 15:47:47 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Thu, 17 Aug 2006 15:47:47 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTester.php Message-ID: <200608172047.k7HKll7e002526@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTester.php updated: 1.14 -> 1.15 --- Log message: Changed the definition for "Machines With Recent Submissions" from a machine that has submitted within the last month to a machine that has submitted in the last fourteen days. --- Diffs of the changes: (+18 -2) NightlyTester.php | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) Index: nightlytest-serverside/NightlyTester.php diff -u nightlytest-serverside/NightlyTester.php:1.14 nightlytest-serverside/NightlyTester.php:1.15 --- nightlytest-serverside/NightlyTester.php:1.14 Wed Aug 2 18:29:59 2006 +++ nightlytest-serverside/NightlyTester.php Thu Aug 17 15:47:26 2006 @@ -48,7 +48,7 @@ * *****************************************************/ function getRecentMachineResource($mysql_link){ - $night_query = mysql_query("SELECT machine FROM night where DATE_SUB(NOW(), INTERVAL 1 MONTH) <= added") or die (mysql_error()); + $night_query = mysql_query("SELECT machine FROM night where DATE_SUB(NOW(), INTERVAL 14 DAY) <= added") or die (mysql_error()); $machines="where id=0"; $machine_arr = array(); while($row = mysql_fetch_array($night_query)){ @@ -104,7 +104,8 @@ /***************************************************** * - * Purpose: Get the nights associated with a specific machine + * Purpose: Get the nights associated with a specific machine for + * which buildstatus is "OK" * Returns: A mysql query resource. Basically something you cal * mysql_fetch_array on. * @@ -116,6 +117,21 @@ /***************************************************** * + * Purpose: Get the history of nights given a night and + * specific machine + * Returns: A mysql query resource. Basically something you cal + * mysql_fetch_array on. + * + *****************************************************/ +function getSuccessfulNightsHistory($machine_id, $mysql_link, $night_id, $order="DESC"){ + $query="SELECT * FROM night WHERE machine=$machine_id and id<=$night_id and buildstatus=\"OK\" order by added $order"; + $query = mysql_query($query) or die (mysql_error()); + return $query; +} + + +/***************************************************** + * * Purpose: Get all the tests in the last $hours hours * Returns: A mysql query resource. * From lattner at cs.uiuc.edu Thu Aug 17 17:00:28 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:28 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp AlphaRegisterInfo.td Message-ID: <200608172200.k7HM0Snv008764@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Alpha: AlphaRegisterInfo.cpp updated: 1.46 -> 1.47 AlphaRegisterInfo.td updated: 1.16 -> 1.17 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+7 -7) AlphaRegisterInfo.cpp | 2 +- AlphaRegisterInfo.td | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.46 llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.47 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp:1.46 Mon Jun 12 13:09:24 2006 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp Thu Aug 17 17:00:07 2006 @@ -180,7 +180,7 @@ // pointer register. This is true if the function has variable sized allocas or // if frame pointer elimination is disabled. // -static bool hasFP(MachineFunction &MF) { +static bool hasFP(const MachineFunction &MF) { MachineFrameInfo *MFI = MF.getFrameInfo(); return MFI->hasVarSizedObjects(); } Index: llvm/lib/Target/Alpha/AlphaRegisterInfo.td diff -u llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.16 llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.17 --- llvm/lib/Target/Alpha/AlphaRegisterInfo.td:1.16 Fri Mar 24 15:15:57 2006 +++ llvm/lib/Target/Alpha/AlphaRegisterInfo.td Thu Aug 17 17:00:07 2006 @@ -124,11 +124,11 @@ R15, R30, R31 ]> //zero { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ GPRCClass::iterator - GPRCClass::allocation_order_end(MachineFunction &MF) const { + GPRCClass::allocation_order_end(const MachineFunction &MF) const { return end()-3; } }]; @@ -142,11 +142,11 @@ F31 ]> //zero { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ F4RCClass::iterator - F4RCClass::allocation_order_end(MachineFunction &MF) const { + F4RCClass::allocation_order_end(const MachineFunction &MF) const { return end()-1; } }]; @@ -160,11 +160,11 @@ F31 ]> //zero { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ F8RCClass::iterator - F8RCClass::allocation_order_end(MachineFunction &MF) const { + F8RCClass::allocation_order_end(const MachineFunction &MF) const { return end()-1; } }]; From lattner at cs.uiuc.edu Thu Aug 17 17:00:31 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:31 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp X86RegisterInfo.td Message-ID: <200608172200.k7HM0VDi008774@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.162 -> 1.163 X86RegisterInfo.td updated: 1.37 -> 1.38 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+7 -7) X86RegisterInfo.cpp | 2 +- X86RegisterInfo.td | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.162 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.163 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.162 Thu Jul 20 17:52:28 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Thu Aug 17 17:00:08 2006 @@ -737,7 +737,7 @@ // pointer register. This is true if the function has variable sized allocas or // if frame pointer elimination is disabled. // -static bool hasFP(MachineFunction &MF) { +static bool hasFP(const MachineFunction &MF) { return (NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects() || MF.getInfo()->getForceFramePointer()); Index: llvm/lib/Target/X86/X86RegisterInfo.td diff -u llvm/lib/Target/X86/X86RegisterInfo.td:1.37 llvm/lib/Target/X86/X86RegisterInfo.td:1.38 --- llvm/lib/Target/X86/X86RegisterInfo.td:1.37 Mon Aug 7 16:02:39 2006 +++ llvm/lib/Target/X86/X86RegisterInfo.td Thu Aug 17 17:00:08 2006 @@ -107,11 +107,11 @@ def GR16 : RegisterClass<"X86", [i16], 16, [AX, CX, DX, SI, DI, BX, BP, SP]> { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ GR16Class::iterator - GR16Class::allocation_order_end(MachineFunction &MF) const { + GR16Class::allocation_order_end(const MachineFunction &MF) const { if (hasFP(MF)) // Does the function dedicate EBP to being a frame ptr? return end()-2; // If so, don't allocate SP or BP else @@ -123,11 +123,11 @@ def GR32 : RegisterClass<"X86", [i32], 32, [EAX, ECX, EDX, ESI, EDI, EBX, EBP, ESP]> { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ GR32Class::iterator - GR32Class::allocation_order_end(MachineFunction &MF) const { + GR32Class::allocation_order_end(const MachineFunction &MF) const { if (hasFP(MF)) // Does the function dedicate EBP to being a frame ptr? return end()-2; // If so, don't allocate ESP or EBP else @@ -160,11 +160,11 @@ def RST : RegisterClass<"X86", [f64], 32, [ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7]> { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ RSTClass::iterator - RSTClass::allocation_order_end(MachineFunction &MF) const { + RSTClass::allocation_order_end(const MachineFunction &MF) const { return begin(); } }]; From lattner at cs.uiuc.edu Thu Aug 17 17:00:31 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:31 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h Message-ID: <200608172200.k7HM0V16008779@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: MRegisterInfo.h updated: 1.81 -> 1.82 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+2 -2) MRegisterInfo.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Target/MRegisterInfo.h diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.81 llvm/include/llvm/Target/MRegisterInfo.h:1.82 --- llvm/include/llvm/Target/MRegisterInfo.h:1.81 Thu Aug 10 01:00:40 2006 +++ llvm/include/llvm/Target/MRegisterInfo.h Thu Aug 17 17:00:07 2006 @@ -170,10 +170,10 @@ /// /// By default, these methods return all registers in the class. /// - virtual iterator allocation_order_begin(MachineFunction &MF) const { + virtual iterator allocation_order_begin(const MachineFunction &MF) const { return begin(); } - virtual iterator allocation_order_end(MachineFunction &MF) const { + virtual iterator allocation_order_end(const MachineFunction &MF) const { return end(); } From lattner at cs.uiuc.edu Thu Aug 17 17:00:32 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.td Message-ID: <200608172200.k7HM0W0Q008789@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.td updated: 1.2 -> 1.3 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+2 -2) ARMRegisterInfo.td | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.td diff -u llvm/lib/Target/ARM/ARMRegisterInfo.td:1.2 llvm/lib/Target/ARM/ARMRegisterInfo.td:1.3 --- llvm/lib/Target/ARM/ARMRegisterInfo.td:1.2 Sat Jun 17 19:08:07 2006 +++ llvm/lib/Target/ARM/ARMRegisterInfo.td Thu Aug 17 17:00:07 2006 @@ -45,11 +45,11 @@ R7, R8, R9, R10, R11, R12, R13, R14, R15]> { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ IntRegsClass::iterator - IntRegsClass::allocation_order_end(MachineFunction &MF) const { + IntRegsClass::allocation_order_end(const MachineFunction &MF) const { // r15 == Program Counter // r14 == Link Register // r13 == Stack Pointer From lattner at cs.uiuc.edu Thu Aug 17 17:00:33 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:33 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineFunction.h Message-ID: <200608172200.k7HM0X5t008794@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: MachineFunction.h updated: 1.59 -> 1.60 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+5 -0) MachineFunction.h | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/include/llvm/CodeGen/MachineFunction.h diff -u llvm/include/llvm/CodeGen/MachineFunction.h:1.59 llvm/include/llvm/CodeGen/MachineFunction.h:1.60 --- llvm/include/llvm/CodeGen/MachineFunction.h:1.59 Sat Apr 22 13:53:45 2006 +++ llvm/include/llvm/CodeGen/MachineFunction.h Thu Aug 17 17:00:07 2006 @@ -165,6 +165,11 @@ return static_cast(MFInfo); } + template + const Ty *getInfo() const { + return const_cast(this)->getInfo(); + } + /// setUsedPhysRegs - The register allocator should call this to initialized /// the UsedPhysRegs set. This should be passed a new[]'d array with entries /// for all of the physical registers that the target supports. Each array From lattner at cs.uiuc.edu Thu Aug 17 17:00:33 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.td Message-ID: <200608172200.k7HM0XtV008804@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPCRegisterInfo.td updated: 1.37 -> 1.38 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+8 -8) PPCRegisterInfo.td | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.td diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.37 llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.38 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.td:1.37 Fri Jun 16 13:50:48 2006 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.td Thu Aug 17 17:00:08 2006 @@ -209,16 +209,16 @@ R16, R15, R14, R13, R31, R0, R1, LR]> { let MethodProtos = [{ - iterator allocation_order_begin(MachineFunction &MF) const; - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_begin(const MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ GPRCClass::iterator - GPRCClass::allocation_order_begin(MachineFunction &MF) const { + GPRCClass::allocation_order_begin(const MachineFunction &MF) const { return begin(); } GPRCClass::iterator - GPRCClass::allocation_order_end(MachineFunction &MF) const { + GPRCClass::allocation_order_end(const MachineFunction &MF) const { if (hasFP(MF)) return end()-4; // don't allocate R31, R0, R1, LR else @@ -232,16 +232,16 @@ X16, X15, X14, X13, X31, X0, X1]> { let MethodProtos = [{ - iterator allocation_order_begin(MachineFunction &MF) const; - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_begin(const MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ G8RCClass::iterator - G8RCClass::allocation_order_begin(MachineFunction &MF) const { + G8RCClass::allocation_order_begin(const MachineFunction &MF) const { return begin(); } G8RCClass::iterator - G8RCClass::allocation_order_end(MachineFunction &MF) const { + G8RCClass::allocation_order_end(const MachineFunction &MF) const { if (hasFP(MF)) return end()-3; else From lattner at cs.uiuc.edu Thu Aug 17 17:00:33 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:33 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64RegisterInfo.cpp IA64RegisterInfo.td Message-ID: <200608172200.k7HM0XGf008801@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/IA64: IA64RegisterInfo.cpp updated: 1.20 -> 1.21 IA64RegisterInfo.td updated: 1.16 -> 1.17 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+9 -9) IA64RegisterInfo.cpp | 2 +- IA64RegisterInfo.td | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) Index: llvm/lib/Target/IA64/IA64RegisterInfo.cpp diff -u llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.20 llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.21 --- llvm/lib/Target/IA64/IA64RegisterInfo.cpp:1.20 Wed May 17 19:12:11 2006 +++ llvm/lib/Target/IA64/IA64RegisterInfo.cpp Thu Aug 17 17:00:08 2006 @@ -113,7 +113,7 @@ // pointer register. This is true if the function has variable sized allocas or // if frame pointer elimination is disabled. // -static bool hasFP(MachineFunction &MF) { +static bool hasFP(const MachineFunction &MF) { return NoFramePointerElim || MF.getFrameInfo()->hasVarSizedObjects(); } Index: llvm/lib/Target/IA64/IA64RegisterInfo.td diff -u llvm/lib/Target/IA64/IA64RegisterInfo.td:1.16 llvm/lib/Target/IA64/IA64RegisterInfo.td:1.17 --- llvm/lib/Target/IA64/IA64RegisterInfo.td:1.16 Fri Mar 24 15:15:58 2006 +++ llvm/lib/Target/IA64/IA64RegisterInfo.td Thu Aug 17 17:00:08 2006 @@ -422,18 +422,18 @@ r0, r1, r2, r5, r12, r13, r22, rp]> // the last 16 are special (look down) { let MethodProtos = [{ - iterator allocation_order_begin(MachineFunction &MF) const; - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_begin(const MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ GRClass::iterator - GRClass::allocation_order_begin(MachineFunction &MF) const { + GRClass::allocation_order_begin(const MachineFunction &MF) const { // hide the 8 out? registers appropriately: return begin()+(8-(MF.getInfo()->outRegsUsed)); } GRClass::iterator - GRClass::allocation_order_end(MachineFunction &MF) const { + GRClass::allocation_order_end(const MachineFunction &MF) const { int numReservedRegs=8; // the 8 special registers r0,r1,r2,r5,r12,r13 etc // we also can't allocate registers for use as locals if they're @@ -472,17 +472,17 @@ let Alignment=128; let MethodProtos = [{ - iterator allocation_order_begin(MachineFunction &MF) const; - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_begin(const MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ FPClass::iterator - FPClass::allocation_order_begin(MachineFunction &MF) const { + FPClass::allocation_order_begin(const MachineFunction &MF) const { return begin(); // we don't hide any FP regs from the start } FPClass::iterator - FPClass::allocation_order_end(MachineFunction &MF) const { + FPClass::allocation_order_end(const MachineFunction &MF) const { return end()-2; // we hide regs F0, F1 from the end } }]; From lattner at cs.uiuc.edu Thu Aug 17 17:00:32 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 17:00:32 -0500 Subject: [llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegisterInfo.td Message-ID: <200608172200.k7HM0W99008784@zion.cs.uiuc.edu> Changes in directory llvm/lib/Target/Sparc: SparcRegisterInfo.td updated: 1.31 -> 1.32 --- Log message: Constify some methods. Patch provided by Anton Vayvod, thanks! --- Diffs of the changes: (+2 -2) SparcRegisterInfo.td | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Target/Sparc/SparcRegisterInfo.td diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.td:1.31 llvm/lib/Target/Sparc/SparcRegisterInfo.td:1.32 --- llvm/lib/Target/Sparc/SparcRegisterInfo.td:1.31 Fri Mar 24 16:48:02 2006 +++ llvm/lib/Target/Sparc/SparcRegisterInfo.td Thu Aug 17 17:00:08 2006 @@ -138,11 +138,11 @@ G5, G6, G7 // reserved for kernel ]> { let MethodProtos = [{ - iterator allocation_order_end(MachineFunction &MF) const; + iterator allocation_order_end(const MachineFunction &MF) const; }]; let MethodBodies = [{ IntRegsClass::iterator - IntRegsClass::allocation_order_end(MachineFunction &MF) const { + IntRegsClass::allocation_order_end(const MachineFunction &MF) const { // FIXME: These special regs should be taken out of the regclass! return end()-10 // Don't allocate special registers -1; // FIXME: G1 reserved for large imm generation by frame code. From pjenkins at apple.com Thu Aug 17 17:11:17 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Thu, 17 Aug 2006 17:11:17 -0500 Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl Message-ID: <200608172211.k7HMBHUa009164@zion.cs.uiuc.edu> Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.53 -> 1.54 --- Log message: Changing the format dejagnu tests are submitted. We used to only submit multisource information for pass fail. Now we submit all pass/fail test information. This should fix the issue where some results were not being reported. --- Diffs of the changes: (+23 -19) NewNightlyTest.pl | 42 +++++++++++++++++++++++------------------- 1 files changed, 23 insertions(+), 19 deletions(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.53 llvm/utils/NewNightlyTest.pl:1.54 --- llvm/utils/NewNightlyTest.pl:1.53 Wed Aug 16 17:32:20 2006 +++ llvm/utils/NewNightlyTest.pl Thu Aug 17 17:11:03 2006 @@ -824,7 +824,7 @@ # Create a list of the tests which were run... # system "egrep 'TEST-(PASS|FAIL)' < $ProgramTestLog ". - "| sort > $Prefix-multisourceprogramstable.txt"; + "| sort > $Prefix-$SubDir-Tests.txt"; } $ProgramsTable = ReadFile "report.nightly.csv"; @@ -832,37 +832,47 @@ return ($ProgramsTable, $llcbeta_options); } #end sub TestDirectory +############################################################## +# +# Calling sub TestDirectory +# +############################################################## if (!$BuildError) { if ( $VERBOSE ) { print "SingleSource TEST STAGE\n"; } ($SingleSourceProgramsTable, $llcbeta_options) = TestDirectory("SingleSource"); - WriteFile "$Prefix-singlesourceprogramstable.txt", $SingleSourceProgramsTable; + WriteFile "$Prefix-SingleSource-Performance.txt", $SingleSourceProgramsTable; if ( $VERBOSE ) { - print "MultiSource TEST STAGE\n"; + print "MultiSource TEST STAGE\n"; } ($MultiSourceProgramsTable, $llcbeta_options) = TestDirectory("MultiSource"); - WriteFile "$Prefix-multisourceprogramstable.txt", $MultiSourceProgramsTable; + WriteFile "$Prefix-MultiSource-Performance.txt", $MultiSourceProgramsTable; if ( ! $NOEXTERNALS ) { if ( $VERBOSE ) { print "External TEST STAGE\n"; } ($ExternalProgramsTable, $llcbeta_options) = TestDirectory("External"); - WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable; - system "cat $Prefix-singlesourceprogramstable.txt " . - "$Prefix-multisourceprogramstable.txt ". - "$Prefix-externalprogramstable.txt | sort > $Prefix-Tests.txt"; + WriteFile "$Prefix-External-Performance.txt", $ExternalProgramsTable; + system "cat $Prefix-SingleSource-Tests.txt " . + "$Prefix-MultiSource-Tests.txt ". + "$Prefix-External-Tests.txt | sort > $Prefix-Tests.txt"; + system "cat $Prefix-SingleSource-Performance.txt " . + "$Prefix-MultiSource-Performance.txt ". + "$Prefix-External-Performance.txt | sort > $Prefix-Performance.txt"; } else { $ExternalProgramsTable = "External TEST STAGE SKIPPED\n"; if ( $VERBOSE ) { print "External TEST STAGE SKIPPED\n"; } - system "cat $Prefix-singlesourceprogramstable.txt " . - "$Prefix-multisourceprogramstable.txt ". + system "cat $Prefix-SingleSource-Tests.txt " . + "$Prefix-MultiSource-Tests.txt ". " | sort > $Prefix-Tests.txt"; + system "cat $Prefix-SingleSource-Performance.txt " . + "$Prefix-MultiSource-Performance.txt ". + " | sort > $Prefix-Performance.txt"; } - WriteFile "$Prefix-externalprogramstable.txt", $ExternalProgramsTable; } ############################################################## @@ -872,9 +882,8 @@ # # ############################################################## -my $dejagnu = ReadFile $DejagnuSum; -my @DEJAGNU = split "\n", $dejagnu; -my $dejagnu_test_list=""; +my $dejagnu_test_list = ReadFile "$Prefix-Tests.txt"; +my @DEJAGNU = split "\n", $dejagnu_test_list; my $passes="", my $fails=""; @@ -884,15 +893,12 @@ for ($x=0; $x<@DEJAGNU; $x++) { if ($DEJAGNU[$x] =~ m/^PASS:/) { $passes.="$DEJAGNU[$x]\n"; - $dejagnu_test_list.="$DEJAGNU[$x]\n"; } elsif ($DEJAGNU[$x] =~ m/^FAIL:/) { $fails.="$DEJAGNU[$x]\n"; - $dejagnu_test_list.="$DEJAGNU[$x]\n"; } elsif ($DEJAGNU[$x] =~ m/^XFAIL:/) { $xfails.="$DEJAGNU[$x]\n"; - $dejagnu_test_list.="$DEJAGNU[$x]\n"; } } } @@ -983,8 +989,6 @@ @GCC_VERSION = split '\n', $gcc_version_long; my $gcc_version = $GCC_VERSION[0]; -my $all_tests = ReadFile "$Prefix-Tests.txt"; - ############################################################## # # Send data via a post request From pjenkins at apple.com Thu Aug 17 17:14:19 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Thu, 17 Aug 2006 17:14:19 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.cgi Message-ID: <200608172214.k7HMEJGx009348@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTestAccept.cgi updated: 1.47 -> 1.48 --- Log message: This commit reflects the changes made in the database in the way we store dejagnu test results. Before we stored them as a string in the night table. Now they have their own table where each row is a result. Furthermore, this should now send emails with the correct changes in test information. --- Diffs of the changes: (+303 -265) NightlyTestAccept.cgi | 568 ++++++++++++++++++++++++++------------------------ 1 files changed, 303 insertions(+), 265 deletions(-) Index: nightlytest-serverside/NightlyTestAccept.cgi diff -u nightlytest-serverside/NightlyTestAccept.cgi:1.47 nightlytest-serverside/NightlyTestAccept.cgi:1.48 --- nightlytest-serverside/NightlyTestAccept.cgi:1.47 Tue Aug 15 13:04:33 2006 +++ nightlytest-serverside/NightlyTestAccept.cgi Thu Aug 17 17:14:05 2006 @@ -88,28 +88,28 @@ # #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub Difference{ - $one = $_[0]; - $two = $_[1]; - - @ONE = split "\n", $one; - @TWO = split "\n", $two; - - $value=1; - - my %hash_of_diff=(); - foreach $x (@TWO){ - $hash_of_diff{$x}=$value; - } - - $result=""; - foreach $x (@ONE){ - if($hash_of_diff{$x}!=$value){ - $result.="$x\n"; - } - } - - chomp $result; - return $result; + $one = $_[0]; + $two = $_[1]; + + @ONE = split "\n", $one; + @TWO = split "\n", $two; + + $value=1; + + my %hash_of_diff=(); + foreach $x (@TWO){ + $hash_of_diff{$x}=$value; + } + + $result=""; + foreach $x (@ONE){ + if($hash_of_diff{$x}!=$value){ + $result.="$x\n"; + } + } + + chomp $result; + return $result; } #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -213,101 +213,100 @@ # $new_tests, $removed_tests, # $cvsaddedfiles, $cvsremovedfiles, $cvsmodifiedfiles, # $cvsusercommitlist, $cvsuserupdatelist, -# $a_file_size, $o_file_size; +# $a_file_size, $o_file_size; # #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub CreateNight{ + for($x=0; $x<@_; $x++){ + $_[$x]="" unless $_[$x]; + } + + $y=0; + $machine_id=$_[$y]; + $y++; + $db_date=$_[$y]; + $y++; + $buildstatus=$_[$y]; + $y++; + $configtime_cpu=$_[$y]; + $y++; + $configtime_wall=$_[$y]; + $y++; + $cvscheckouttime_cpu=$_[$y]; + $y++; + $cvscheckouttime_wall=$_[$y]; + $y++; + $buildtime_cpu=$_[$y]; + $y++; + $buildtime_wall=$_[$y]; + $y++; + $dejagnutime_cpu=$_[$y]; + $y++; + $dejagnutime_wall=$_[$y]; + $y++; + $warnings=$_[$y]; + $y++; + $warnings_added=$_[$y]; + $y++; + $warnings_removed=$_[$y]; + $y++; + $dejagnu_exp_passes=$_[$y]; + $y++; + $dejagnu_unexp_failures=$_[$y]; + $y++; + $dejagnu_exp_failures=$_[$y]; + $y++; + $all_tests=$_[$y]; + $y++; + $passing_tests=$_[$y]; + $y++; + $unexpfail_tests=$_[$y]; + $y++; + $expfail_tests=$_[$y]; + $y++; + $newly_passing_tests=$_[$y]; + $y++; + $newly_failing_tests=$_[$y]; + $y++; + $new_tests=$_[$y]; + $y++; + $removed_tests=$_[$y]; + $y++; + $cvsaddedfiles=$_[$y]; + $y++; + $cvsremovedfiles=$_[$y]; + $y++; + $cvsmodifiedfiles=$_[$y]; + $y++; + $cvsusercommitlist=$_[$y]; + $y++; + $cvsuserupdatelist=$_[$y]; + $y++; - for($x=0; $x<@_; $x++){ - $_[$x]="" unless $_[$x]; - } - - $y=0; - $machine_id=$_[$y]; - $y++; - $db_date=$_[$y]; - $y++; - $buildstatus=$_[$y]; - $y++; - $configtime_cpu=$_[$y]; - $y++; - $configtime_wall=$_[$y]; - $y++; - $cvscheckouttime_cpu=$_[$y]; - $y++; - $cvscheckouttime_wall=$_[$y]; - $y++; - $buildtime_cpu=$_[$y]; - $y++; - $buildtime_wall=$_[$y]; - $y++; - $dejagnutime_cpu=$_[$y]; - $y++; - $dejagnutime_wall=$_[$y]; - $y++; - $warnings=$_[$y]; - $y++; - $warnings_added=$_[$y]; - $y++; - $warnings_removed=$_[$y]; - $y++; - $dejagnu_exp_passes=$_[$y]; - $y++; - $dejagnu_unexp_failures=$_[$y]; - $y++; - $dejagnu_exp_failures=$_[$y]; - $y++; - $all_tests=$_[$y]; - $y++; - $passing_tests=$_[$y]; - $y++; - $unexpfail_tests=$_[$y]; - $y++; - $expfail_tests=$_[$y]; - $y++; - $newly_passing_tests=$_[$y]; - $y++; - $newly_failing_tests=$_[$y]; - $y++; - $new_tests=$_[$y]; - $y++; - $removed_tests=$_[$y]; - $y++; - $cvsaddedfiles=$_[$y]; - $y++; - $cvsremovedfiles=$_[$y]; - $y++; - $cvsmodifiedfiles=$_[$y]; - $y++; - $cvsusercommitlist=$_[$y]; - $y++; - $cvsuserupdatelist=$_[$y]; - $y++; - - + - + my $d = $dbh->prepare("insert into night (machine, added, buildstatus, configuretime_cpu, configuretime_wall,". - " getcvstime_cpu, getcvstime_wall, buildtime_cpu,". - " buildtime_wall, dejagnutime_cpu, dejagnutime_wall, warnings,". - " warnings_added, warnings_removed, teststats_exppass,". - " teststats_unexpfail, teststats_expfail, all_tests,". + " getcvstime_cpu, getcvstime_wall, buildtime_cpu,". + " buildtime_wall, dejagnutime_cpu, dejagnutime_wall, warnings,". + " warnings_added, warnings_removed, teststats_exppass,". + " teststats_unexpfail, teststats_expfail, all_tests,". " passing_tests, unexpfail_tests, expfail_tests,". - " newly_passing_tests, newly_failing_tests, new_tests,". - " removed_tests, cvs_added, cvs_removed, cvs_modified,". - " cvs_usersadd, cvs_usersco) values (". - "\"$machine_id\", \"$db_date\", \"$buildstatus\",". - "\"$configtime_cpu\", \"$configtime_wall\", \"$cvscheckouttime_cpu\",". - "\"$cvscheckouttime_wall\", \"$buildtime_cpu\", \"$buildtime_wall\",". - "\"$dejagnutime_cpu\", \"$dejagnutime_wall\", \"$warnings\",". - "\"$warnings_added\", \"$warnings_removed\",". - "\"$dejagnu_exp_passes\", \"$dejagnu_unexp_failures\", \"$dejagnu_exp_failures\",". - "\"$all_tests\", \"$passing_tests\", \"$unexpfail_tests\",". + " newly_passing_tests, newly_failing_tests, new_tests,". + " removed_tests, cvs_added, cvs_removed, cvs_modified,". + " cvs_usersadd, cvs_usersco) values (". + "\"$machine_id\", \"$db_date\", \"$buildstatus\",". + "\"$configtime_cpu\", \"$configtime_wall\", \"$cvscheckouttime_cpu\",". + "\"$cvscheckouttime_wall\", \"$buildtime_cpu\", \"$buildtime_wall\",". + "\"$dejagnutime_cpu\", \"$dejagnutime_wall\", \"$warnings\",". + "\"$warnings_added\", \"$warnings_removed\",". + "\"$dejagnu_exp_passes\", \"$dejagnu_unexp_failures\", \"$dejagnu_exp_failures\",". + "\"$all_tests\", \"$passing_tests\", \"$unexpfail_tests\",". "\"$expfail_tests\", \"$newly_passing_tests\", \"$newly_failing_tests\",". - "\"$new_tests\", \"$removed_tests\",". - "\"$cvsaddedfiles\", \"$cvsremovedfiles\", \"$cvsmodifiedfiles\",". - "\"$cvsusercommitlist\", \"$cvsuserupdatelist\")"); + "\"$new_tests\", \"$removed_tests\",". + "\"$cvsaddedfiles\", \"$cvsremovedfiles\", \"$cvsmodifiedfiles\",". + "\"$cvsusercommitlist\", \"$cvsuserupdatelist\")"); $d->execute; @@ -315,10 +314,10 @@ $e->execute; @row=$e->fetchrow_array; if(@row){ - return $row[0]; + return $row[0]; } else{ - return -1; + return -1; } } @@ -329,7 +328,7 @@ my $d = $dbh->prepare("select * from night where machine = \"$_[0]\""); $d->execute; while (@row = $d->fetchrow_array){ - push(@result, $row[0]); + push(@result, $row[0]); } $result[0]="" unless $result[0]; return @result; @@ -351,12 +350,34 @@ # #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub AddProgram{ #$program, $result, $type, $night - $query = "INSERT INTO program (program, result, type, night) VALUES". - " (\"$_[0]\", \"$_[1]\", \"$_[2]\", $_[3])"; + $query = "INSERT INTO program (program, result, type, night) VALUES". + " (\"$_[0]\", \"$_[1]\", \"$_[2]\", $_[3])"; + my $d = $dbh->prepare($query); + $d->execute; +} + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# mysql> describe tests; +# +---------+-----------------------------+------+-----+---------+-------+ +# | Field | Type | Null | Key | Default | Extra | +# +---------+-----------------------------+------+-----+---------+-------+ +# | program | tinytext | | | | | +# | result | enum('PASS','FAIL','XFAIL') | | | PASS | | +# | measure | tinytext | YES | | NULL | | +# | night | int(11) | YES | | NULL | | +# +---------+-----------------------------+------+-----+---------+-------+ +# 4 rows in set (0.00 sec)# +# +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +sub AddTests{ #$program, $result, $measure, $night + $query = "INSERT INTO program (program, result, measure, night) VALUES". + " (\"$_[0]\", \"$_[1]\", \"$_[2]\", $_[3])"; my $d = $dbh->prepare($query); $d->execute; } + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # mysql> describe file; @@ -372,8 +393,8 @@ # #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub AddFile{ #$file, $size, $night, $type - $query = "INSERT INTO file (file, size, night, type) VALUES (\"$_[0]\", ". - "\"$_[1]\", \"$_[2]\", \"$_[3]\")"; + $query = "INSERT INTO file (file, size, night, type) VALUES (\"$_[0]\", ". + "\"$_[1]\", \"$_[2]\", \"$_[3]\")"; my $d = $dbh->prepare($query); $d->execute; } @@ -401,9 +422,9 @@ $d->execute; $row=$d->fetchrow_hashref; if(%$row && ($row->{'loc'} != $_[1] || - $row->{'files'} != $_[2] || - $row->{'dirs'} != $_[3])){ - my $e = $dbh->prepare("insert into code (added, loc, files, dirs) values (\"$_[0]\", \"$_[1]\", \"$_[2]\", \"$_[3]\")"); + $row->{'files'} != $_[2] || + $row->{'dirs'} != $_[3])){ + my $e = $dbh->prepare("insert into code (added, loc, files, dirs) values (\"$_[0]\", \"$_[1]\", \"$_[2]\", \"$_[3]\")"); $e->execute; } } @@ -449,8 +470,8 @@ my @EXTERNAL_TESTS = split $spliton, $external_tests; my $o_file_size = param('o_file_sizes'); - $o_file_size="" unless $o_file_size; - chomp($o_file_size); + $o_file_size="" unless $o_file_size; + chomp($o_file_size); my @O_FILE_SIZE = split $spliton, $o_file_size; my $a_file_size = param('a_file_sizes'); $a_file_size="" unless $a_file_size; @@ -507,7 +528,6 @@ # Extracting the dejagnu test numbers # ################################################################################ -print "content-type: text/text\r\n\r\n"; my $dejagnu_exp_passes=0; if( ($dejagnutests_log =~ m/\# of expected passes\s*([0-9]+)/) ){ @@ -539,7 +559,7 @@ my @temp_outcome=split $seperator,$SINGLESOURCE_TESTS[$x]; my $outcome = ""; for($y=1; $y<@singlesource_headings; $y++){ - $outcome.="$singlesource_headings[$y]: $temp_outcome[$y], "; + $outcome.="$singlesource_headings[$y]: $temp_outcome[$y], "; } $singlesource_processed{$temp_outcome[0]}=$outcome; } @@ -551,7 +571,7 @@ my @temp_outcome=split $seperator,$MULTISOURCE_TESTS[$x]; my $outcome = ""; for($y=1; $y<@multisource_headings; $y++){ - $outcome.="$multisource_headings[$y]: $temp_outcome[$y], "; + $outcome.="$multisource_headings[$y]: $temp_outcome[$y], "; } $multisource_processed{$temp_outcome[0]}=$outcome; } @@ -563,7 +583,7 @@ my @temp_outcome=split $seperator,$EXTERNAL_TESTS[$x]; my $outcome = ""; for($y=1; $y<@external_headings; $y++){ - $outcome.="$external_headings[$y]: $temp_outcome[$y], "; + $outcome.="$external_headings[$y]: $temp_outcome[$y], "; } $external_processed{$temp_outcome[0]}=$outcome; } @@ -582,70 +602,22 @@ ################################################################################ # -# Creating test lists -# All of these if-else statements are to ensure that if the previous -# night's test had a build failure and reported all tests as not passing, -# all failing, etc, etc then we dont report all the tests as newly passing -# or their equivalent. -# -################################################################################ -my $d = $dbh->prepare("select * from night where machine = $machine_id ". - "and buildstatus=\"OK\" ORDER BY added DESC"); -$d->execute; -my $row=$d->fetchrow_hashref; -$yesterdays_tests = $row->{'all_tests'}; -$yesterdays_passes = $row->{'passing_tests'}; -$yesterdays_fails = $row->{'unexpfail_tests'}; -$yesterdays_xfails = $row->{'expfail_tests'}; -if($yesterdays_passes ne ""){ - $newly_passing_tests = Difference $passing_tests, $yesterdays_passes; -} -else{ $newly_passing_tests=""; } -if($yesterdays_xfails ne "" and $yesterdays_fails ne ""){ - $newly_failing_tests = Difference $expfail_tests."\n".$unexpfail_tests, - $yesterdays_xfails."\n".$yesterdays_fails; -} -else{ $newly_failing_tests=""; } -# The tests are stored in the database as a string with each test being -# seperated by a newline. Each test is prefixed with either "PASS", -# "FAIL", and "XFAIL". If a test changes from pass to fail, this will -# cause us to think its a new test because its entry no longer matches -# the corresponding entry from the previous day. Therefore, we create a -# different list that does not contain these words. -$temp_test_list_today = $all_tests; -$temp_test_list_today =~ s/PASS\://g; -$temp_test_list_today =~ s/XFAIL\://g; -$temp_test_list_today =~ s/FAIL\://g; -$temp_test_list_yesterday = $yesterdays_tests; -$temp_test_list_yesterday = s/PASS\://g; -$temp_test_list_yesterday = s/XFAIL\://g; -$temp_test_list_yesterday = s/FAIL\://g; -if($yesterdays_tests ne ""){ - $new_tests = Difference $temp_test_list_today, $temp_test_list_yesterday; -} -else{ $new_tests=""; } -if($all_tests ne ""){ - $removed_tests = Difference $temp_test_list_yesterday, $temp_test_list_today; -} -else{ $removed_tests=""; } - -################################################################################ -# # Submitting information to database # ################################################################################ #$db_date = $date." ".$time; $db_date = `date "+20%y-%m-%d %H:%M:%S"`; chomp($db_date); +$blank=""; $night_id= CreateNight $machine_id, $db_date, $buildstatus, $configtime_cpu, $configtime_wall, $cvscheckouttime_cpu, $cvscheckouttime_wall, $buildtime_cpu, $buildtime_wall, $dejagnutime_cpu, $dejagnutime_wall, $warnings, $warnings_added, $warnings_removed, $dejagnu_exp_passes, $dejagnu_unexp_failures, $dejagnu_exp_failures, #expected pass, unexp fails, exp fails - $all_tests, $passing_tests, $unexpfail_tests, - $expfail_tests, $newly_passing_tests, $newly_failing_tests, - $new_tests, $removed_tests, + $blank, $blank, $blank, #$all_tests, $passing_tests, $unexpfail_tests, + $blank, $blank, $blank, #$expfail_tests, $TestsFixed, $TestsBroken, + $blank, $blank, #$TestsAdded, $TestsRemoved, $cvsaddedfiles, $cvsremovedfiles, $cvsmodifiedfiles, $cvsusercommitlist, $cvsuserupdatelist; @@ -663,22 +635,40 @@ $len=@O_FILE_SIZE; if($len>1){ - foreach $x (@O_FILE_SIZE){ - $x =~ m/(.+)\s+(.+)\s+(.+)/; - AddFile $2, $1, $night_id, $3; - } + foreach $x (@O_FILE_SIZE){ + $x =~ m/(.+)\s+(.+)\s+(.+)/; + AddFile $2, $1, $night_id, $3; + } } $len=@A_FILE_SIZE; if($len>1){ - foreach $x (@A_FILE_SIZE){ - $x =~ m/(.+)\s+(.+)\s+(.+)/; - AddFile $2, $1, $night_id, $3; - } + foreach $x (@A_FILE_SIZE){ + $x =~ m/(.+)\s+(.+)\s+(.+)/; + AddFile $2, $1, $night_id, $3; + } } ################################################################################ # +# Adding test results pass/fail/xfail status to database +# +################################################################################ + at ALL_TESTS= split "\n", $all_tests; +foreach $x (@ALL_TESTS){ + if($x =~ m/(TEST-)?(PASS|XFAIL|FAIL):\s(.+?)\s(.+)/){ + $query="INSERT INTO tests ( program, result, measure, night) VALUES(\"$4\", \'$2\', \"$3\", $night_id)"; + my $d = $dbh->prepare($query); + $d->execute; + } + else{ + print "Unrecognized test: $x\n"; + } +} + + +################################################################################ +# # Adding lines of code to the database # ################################################################################ @@ -722,53 +712,104 @@ %output_big_changes=(); foreach my $prog(keys(%prog_hash_new)){ - #get data from server - my @vals_new = split(",", $prog_hash_new{"$prog"}); - my @vals_old = split(",", $prog_hash_old{'$prog'}); - - #get list of values measured from newest test - my @measures={}; - foreach my $x(@vals_new){ - $x =~ s/\,//g; - $x =~ s/\.//g; - $x =~ s/\://g; - $x =~ s/\d//g; - $x =~ s/\-//g; - $x =~ s/ //g; - if($x !~ m/\//){ - push @measures, $x; - } - } - - #put measures into hash of arrays - foreach my $x(@measures){ - $prog_hash_new{"$prog"} =~ m/$x:.*?(\d*\.*\d+)/; - my $value_new = $1; - $value_old=0; - if(exists $prog_hash_old{"$prog"}){ - $prog_hash_old{"$prog"} =~ m/$x:.*?(\d*\.*\d+)/; - $value_old = $1; - } - my $diff = ($value_old - $value_new); - my $perc=0; - if( $value_old!=0 && ($diff > .2 || $diff < -.2) ){ - $perc=($diff/$value_old) * 100; - } - if($perc > 5 || $perc < -5){ - if( ! exists $output_big_changes{"$x"} ){ - my $rounded_perc = sprintf("%1.2f", $perc); - $output_big_changes{"$x"}[0]="$prog: $rounded_perc\% ($value_old => $value_new)\n"; - } - else{ - my $rounded_perc = sprintf("%1.2f", $perc); - push(@{ $output_big_changes{"$x"} },"$prog ($x) changed \%$rounded_perc ($value_old => $value_new)\n"); - } #end else - }# end if $perc is acceptable - }# end foreach measure taken + #get data from server + my @vals_new = split(",", $prog_hash_new{"$prog"}); + my @vals_old = split(",", $prog_hash_old{'$prog'}); + #get list of values measured from newest test + my @measures={}; + foreach my $x(@vals_new){ + $x =~ s/\,//g; + $x =~ s/\.//g; + $x =~ s/\://g; + $x =~ s/\d//g; + $x =~ s/\-//g; + $x =~ s/ //g; + if($x !~ m/\//){ + push @measures, $x; + } + } + #put measures into hash of arrays + foreach my $x(@measures){ + $prog_hash_new{"$prog"} =~ m/$x:.*?(\d*\.*\d+)/; + my $value_new = $1; + $value_old=0; + if(exists $prog_hash_old{"$prog"}){ + $prog_hash_old{"$prog"} =~ m/$x:.*?(\d*\.*\d+)/; + $value_old = $1; + } + my $diff = ($value_old - $value_new); + my $perc=0; + if( $value_old!=0 && ($diff > .2 || $diff < -.2) ){ + $perc=($diff/$value_old) * 100; + } + if($perc > 5 || $perc < -5){ + if( ! exists $output_big_changes{"$x"} ){ + my $rounded_perc = sprintf("%1.2f", $perc); + $output_big_changes{"$x"}[0]="$prog: $rounded_perc\% ($value_old => $value_new)\n"; + } + else{ + my $rounded_perc = sprintf("%1.2f", $perc); + push(@{ $output_big_changes{"$x"} },"$prog ($x) changed \%$rounded_perc ($value_old => $value_new)\n"); + } #end else + }# end if $perc is acceptable + }# end foreach measure taken } #end for each program we have measurements for ################################################################################ # +# Determining changes in new tests and old tests +# +################################################################################ +my $d = $dbh->prepare("SELECT id FROM night WHERE machine=38 and buildstatus=\"OK\" order by added desc"); +$d->execute; +my @row=$d->fetchrow_array; +$cur_night=$row[0]; + at row=$d->fetchrow_array; +$prev_night=$row[0]; + +my $c = $dbh->prepare("SELECT program, measure, result FROM tests WHERE night=$cur_night"); +$c->execute; + +%result_hash=(); +%program_hash=(); +while(my @row=$c->fetchrow_array){ + my $key = $row[1]." - ".$row[0]; + $result_hash{$key}=$row[2]; + $program_hash{$key}=1; +} + +my ($num_removed, $num_added, $num_new_passing, $num_new_failing)=0; +my ($removed, $added, $passing, $failing) = ""; +my $j = $dbh->prepare("SELECT program, measure, result FROM tests WHERE night=$prev_night"); +$j->execute; +while(my @row=$j->fetchrow_array){ + my $key = $row[1]." - ".$row[0]; + if($result_hash{$key} and $result_hash{$key} ne $row[2] and $row[2] eq "PASS"){ + $failing .= "changed: from $row[2] to $result_hash{$key} - $key\n"; + $num_new_failing++; + } + if($result_hash{$key} and $result_hash{$key} ne $row[2] and $result_hash{$key} eq "PASS" ){ + $passing .= "changed: from $row[2] to $result_hash{$key} - $key\n"; + $num_new_passing++; + } + + if(!$program_hash{$key}){ + $removed .= "REMOVED: $key\n"; + $num_removed++; + } + else{ + $program_hash{$key}++; + } +} +foreach $x(keys(%program_hash)){ + if($program_hash{$x}==1){ + $added .= "ADDED: $x\n"; + $num_added++; + } +} + +################################################################################ +# # Sending email to nightly test email archive # ################################################################################ @@ -779,44 +820,40 @@ $email .= "Buildstatus: $buildstatus\n"; if($buildstatus eq "OK") { - if ($newly_passing_tests ne "") { - $newly_passing_tests = "\n$newly_passing_tests\n"; - } else { - $newly_passing_tests = "None"; - } - $email .= "\nNew Test Passes: $newly_passing_tests"; - if ($newly_failing_tests ne "") { - $newly_failing_tests = "\n$newly_failing_tests\n"; - } else { - $newly_failing_tests = "None"; - } - $email .= "\nNew Test Failures: $newly_failing_tests"; - if ($new_tests ne "") { - $new_tests = "\n$new_tests\n"; - } else { - $new_tests = "None"; - } - $email .= "\nAdded Tests: $new_tests"; - if ($removed_tests ne "") { - $removed_tests = "\n$removed_tests\n"; - } else { - $removed_tests = "None"; - } - $email .= "\nRemoved Tests: $removed_tests\n"; - - $email .= "\nSignificant changes in test results:\n"; - foreach my $meas(keys(%output_big_changes)){ - $email.= "$meas:\n"; - foreach my $x(@{ $output_big_changes{$meas} } ){ - $email.= " $x"; - } - } + if ($TestsFixed ne "") { + $TestsFixed= "\n$newly_passing_tests\n"; + } else { + $TestsFixed = "None"; + } + $email .= "\nNew Test Passes: $TestsFixed"; + if ($TestsBroken ne "") { + $TestsBroken = "\n$newly_failing_tests\n"; + } else { + $TestsBroken = "None"; + } + $email .= "\nNew Test Failures: $TestsBroken"; + if ($added eq "") { + $added = "None"; + } + $email .= "\nAdded Tests: $added"; + if ($removed eq "") { + $removed= "None"; + } + $email .= "\nRemoved Tests: $removed\n"; + + $email .= "\nSignificant changes in test results:\n"; + foreach my $meas(keys(%output_big_changes)){ + $email.= "$meas:\n"; + foreach my $x(@{ $output_big_changes{$meas} } ){ + $email.= " $x"; + } + } } else{ - $temp_date = $db_date; - $temp_date =~s/ /\_/g; - $email .= "\nBuildlog available at http://llvm.org/nightlytest/". - "machines/$machine_id/$temp_date-Build-Log.txt"; + $temp_date = $db_date; + $temp_date =~s/ /\_/g; + $email .= "\nBuildlog available at http://llvm.org/nightlytest/". + "machines/$machine_id/$temp_date-Build-Log.txt"; } $email_addr = "llvm-testresults\@cs.uiuc.edu"; @@ -837,9 +874,10 @@ ChangeDir("$curr/machines", "Moving into machines directory"); if(! -d "$machine_id"){ `mkdir $machine_id -m 777`; - #mkdir "$curr/machines/$machine_id", 777 or print("couldnt create directory $machine_id because $!"); + } -ChangeDir("$curr/machines/$machine_id", "Moving into machine $machine_id 's directory"); +ChangeDir("$curr/machines/$machine_id", + "Moving into machine $machine_id 's directory"); $db_date =~ s/ /\_/g; my $build_file = "$db_date-Build-Log.txt"; From tbrethou at cs.uiuc.edu Thu Aug 17 17:21:19 2006 From: tbrethou at cs.uiuc.edu (Tanya Lattner) Date: Thu, 17 Aug 2006 17:21:19 -0500 Subject: [llvm-commits] [release_18] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200608172221.k7HMLJMW028692@zion.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.358.2.1 -> 1.358.2.2 --- Log message: Fixing typo --- Diffs of the changes: (+2 -2) ReleaseNotes.html | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.358.2.1 llvm/docs/ReleaseNotes.html:1.358.2.2 --- llvm/docs/ReleaseNotes.html:1.358.2.1 Tue Aug 8 23:31:39 2006 +++ llvm/docs/ReleaseNotes.html Thu Aug 17 17:21:06 2006 @@ -61,7 +61,7 @@

      -

      This is the nineth public release of the LLVM Compiler Infrastructure. This +

      This is the ninth public release of the LLVM Compiler Infrastructure. This release incorporates a large number of enhancements and new features, including DWARF debugging support (C and C++ on Darwin/PPC), improved inline assembly support, a new nightly @@ -684,7 +684,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2006/08/09 04:31:39 $ + Last modified: $Date: 2006/08/17 22:21:06 $ From lattner at cs.uiuc.edu Thu Aug 17 19:18:58 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 17 Aug 2006 19:18:58 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-05-02-InstrSched2.ll Message-ID: <200608180018.k7I0Iwb8006971@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: 2006-05-02-InstrSched2.ll updated: 1.1 -> 1.2 --- Log message: Temporarily xfail this test, evan will look at it in a week or so. --- Diffs of the changes: (+1 -0) 2006-05-02-InstrSched2.ll | 1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/CodeGen/X86/2006-05-02-InstrSched2.ll diff -u llvm/test/Regression/CodeGen/X86/2006-05-02-InstrSched2.ll:1.1 llvm/test/Regression/CodeGen/X86/2006-05-02-InstrSched2.ll:1.2 --- llvm/test/Regression/CodeGen/X86/2006-05-02-InstrSched2.ll:1.1 Tue May 2 21:11:36 2006 +++ llvm/test/Regression/CodeGen/X86/2006-05-02-InstrSched2.ll Thu Aug 17 19:18:38 2006 @@ -1,4 +1,5 @@ ; RUN: llvm-as < %s | llc -march=x86 -stats 2>&1 | grep "asm-printer" | grep 19 +; XFAIL: * void %_ZN9__gnu_cxx9hashtableISt4pairIKPKciES3_NS_4hashIS3_EESt10_Select1stIS5_E5eqstrSaIiEE14find_or_insertERKS5__cond_true456.i(sbyte* %tmp435.i, uint* %tmp449.i.out) { newFuncRoot: From pjenkins at apple.com Thu Aug 17 22:50:32 2006 From: pjenkins at apple.com (Patrick Jenkins) Date: Thu, 17 Aug 2006 22:50:32 -0500 Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTester.php ProgramResults.php fulltest.php individualgraph.php sidebar.php test.php Message-ID: <200608180350.k7I3oWl5019505@zion.cs.uiuc.edu> Changes in directory nightlytest-serverside: NightlyTester.php updated: 1.15 -> 1.16 ProgramResults.php updated: 1.5 -> 1.6 fulltest.php updated: 1.12 -> 1.13 individualgraph.php updated: 1.1.1.1 -> 1.2 sidebar.php updated: 1.8 -> 1.9 test.php updated: 1.15 -> 1.16 --- Log message: The change to sidebar.php makes the website more efficient by asking the database for only what it needs instead of all the other junk that is stored in the night table. The changes to NightlyTester.php, ProgramResults.php, fulltest.php, and test.php reflect the new way we are storing dejagnu pass/fail/xfail results in the datase. Rest assured, there is a hack in ProgramResults.php to ensure we can still handle the old way these were stored in the database, although it should be noted that this old way is missing signifigant data. This "functionality" of losing data is the reason I redesigned the database. The changes to individualgraph.php are to bring it into compliance with the LLVM coding standard (mainly it converts tabs to two spaces). --- Diffs of the changes: (+599 -368) NightlyTester.php | 13 + ProgramResults.php | 216 +++++++++++++++++++ fulltest.php | 581 ++++++++++++++++++++++++++-------------------------- individualgraph.php | 120 +++++----- sidebar.php | 15 - test.php | 22 + 6 files changed, 599 insertions(+), 368 deletions(-) Index: nightlytest-serverside/NightlyTester.php diff -u nightlytest-serverside/NightlyTester.php:1.15 nightlytest-serverside/NightlyTester.php:1.16 --- nightlytest-serverside/NightlyTester.php:1.15 Thu Aug 17 15:47:26 2006 +++ nightlytest-serverside/NightlyTester.php Thu Aug 17 22:50:18 2006 @@ -117,6 +117,19 @@ /***************************************************** * + * Purpose: Get night ids and date added associated + * with a specific machine for + * which buildstatus is "OK" + * Returns: A mysql result + * + *****************************************************/ +function getNightsIDs($machine_id, $mysql_link, $start="2000-01-01 01:01:01", $end="2020-12-30 01:01:01", $order="DESC"){ + $query = mysql_query("SELECT id, added FROM night WHERE machine=$machine_id and added<=\"$end\" and added>=\"$start\" ORDER BY added $order") or die (mysql_error()); + return $query; +} + +/***************************************************** + * * Purpose: Get the history of nights given a night and * specific machine * Returns: A mysql query resource. Basically something you cal Index: nightlytest-serverside/ProgramResults.php diff -u nightlytest-serverside/ProgramResults.php:1.5 nightlytest-serverside/ProgramResults.php:1.6 --- nightlytest-serverside/ProgramResults.php:1.5 Wed Aug 2 17:12:13 2006 +++ nightlytest-serverside/ProgramResults.php Thu Aug 17 22:50:18 2006 @@ -7,6 +7,15 @@ mysql_select_db("nightlytestresults"); } +/* + * This variable is used to determine file size cutoffs for displaying + */ +$byte_threshold=1000; + +/* + * These variables are used in determining + * how to color table cells; + */ $medium_number=0; $medium_change=5; $large_number=0; @@ -135,7 +144,7 @@ foreach ($array_of_measures as $x){ $value=array(); $reg_exp="/$x:\s*([[0-9\.]+|\*|\-|n\/a|\?],)/"; - //print "running preg_match($reg_exp, $data, $value)
      \n"; + #print "{$row['program']} => running preg_match($reg_exp, $data, $value)
      \n"; preg_match($reg_exp, $data, $value); if(isset($value[1])){ array_push($result["{$row['program']}"], $value[1]); @@ -376,6 +385,211 @@ } } +/* + * Get Unexpected failing tests + * + * This is somewhat of a hack because from night 684 forward we now store the test + * in their own table as oppoesd in the night table. + */ +function getUnexpectedFailures($night_id, $mysql_link){ + $result=""; + if($night_id<684){ + $query = "SELECT unexpfail_tests FROM night WHERE id = $night_id"; + $program_query = mysql_query($query) or die (mysql_error()); + $row = mysql_fetch_array($program_query); + $result= $row['unexpfail_tests']; + $result=preg_replace("/\n/","
      \n",$result); + mysql_free_result($program_query); + } + else{ + $query = "SELECT * FROM tests WHERE night=$night_id AND result=\"FAIL\""; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + $result.="{$row['measure']} - {$row['program']}
      \n"; + } + mysql_free_result($program_query); + } + return $result; +} + +/* + * Get New Tests + * + * This is somewhat of a hack because from night 684 forward we now store the test + * in their own table as oppoesd in the night table. + */ +function getNewTests($cur_id, $prev_id, $mysql_link){ + $result=""; + if($cur_id<684){ + $query = "SELECT new_tests FROM night WHERE id = $cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + $row = mysql_fetch_array($program_query); + $result= $row['unexpfail_tests']; + $result=preg_replace("/\n/","
      \n",$result); + mysql_free_result($program_query); + } + else{ + $test_hash=array(); + $query = "SELECT * FROM tests WHERE night=$prev_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + $test_hash["{$row['measure']} - {$row['program']}"]=1; + } + mysql_free_result($program_query); + + $query = "SELECT * FROM tests WHERE night=$cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + if( !isset($test_hash["{$row['measure']} - {$row['program']}"])){ + $result = "{$row['measure']} - {$row['program']}
      \n"; + } + } + mysql_free_result($program_query); + } + return $result; +} + +/* + * Get Removed Tests + * + * This is somewhat of a hack because from night 684 forward we now store the test + * in their own table as oppoesd in the night table. + */ +function getRemovedTests($cur_id, $prev_id, $mysql_link){ + $result=""; + if($cur_id<684){ + $query = "SELECT removed_tests FROM night WHERE id = $cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + $row = mysql_fetch_array($program_query); + $result= $row['unexpfail_tests']; + $result=preg_replace("/\n/","
      \n",$result); + mysql_free_result($program_query); + } + else{ + $test_hash=array(); + $query = "SELECT * FROM tests WHERE night=$cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + $test_hash["{$row['measure']} - {$row['program']}"]=1; + } + mysql_free_result($program_query); + + $query = "SELECT * FROM tests WHERE night=$prev_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + if( !isset($test_hash["{$row['measure']} - {$row['program']}"])){ + $result = "{$row['measure']} - {$row['program']}
      \n"; + } + } + mysql_free_result($program_query); + } + return $result; +} + +/* + * Get Fixed Tests + * + * This is somewhat of a hack because from night 684 forward we now store the test + * in their own table as oppoesd in the night table. + */ +function getFixedTests($cur_id, $prev_id, $mysql_link){ + $result=""; + if($cur_id<684){ + $query = "SELECT removed_tests FROM night WHERE id = $cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + $row = mysql_fetch_array($program_query); + $result= $row['unexpfail_tests']; + $result=preg_replace("/\n/","
      \n",$result); + mysql_free_result($program_query); + } + else{ + $test_hash=array(); + $query = "SELECT * FROM tests WHERE night=$cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + if(strcmp("{$row['result']}", "PASS")===0){ + $test_hash["{$row['measure']} - {$row['program']}"]=$row['result']; + } + } + mysql_free_result($program_query); + + $query = "SELECT * FROM tests WHERE night=$prev_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + if( isset($test_hash["{$row['measure']} - {$row['program']}"]) && + strcmp($test_hash["{$row['measure']} - {$row['program']}"], $row['result'])!==0){ + $result = "{$row['measure']} - {$row['program']}
      \n"; + } + } + mysql_free_result($program_query); + } + return $result; +} + +/* + * Get Broken Tests + * + * This is somewhat of a hack because from night 684 forward we now store the test + * in their own table as oppoesd in the night table. + */ +function getBrokenTests($cur_id, $prev_id, $mysql_link){ + $result=""; + if($cur_id<684){ + $query = "SELECT removed_tests FROM night WHERE id = $cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + $row = mysql_fetch_array($program_query); + $result= $row['unexpfail_tests']; + $result=preg_replace("/\n/","
      \n",$result); + mysql_free_result($program_query); + } + else{ + $test_hash=array(); + $query = "SELECT * FROM tests WHERE night=$prev_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + if(strcmp("{$row['result']}", "PASS")===0){ + $test_hash["{$row['measure']} - {$row['program']}"]=$row['result']; + } + } + mysql_free_result($program_query); + + $query = "SELECT * FROM tests WHERE night=$cur_id"; + $program_query = mysql_query($query) or die (mysql_error()); + while($row = mysql_fetch_array($program_query)){ + if( isset($test_hash["{$row['measure']} - {$row['program']}"]) && + strcmp($test_hash["{$row['measure']} - {$row['program']}"], $row['result'])!==0){ + $result = "{$row['measure']} - {$row['program']}
      \n"; + } + } + mysql_free_result($program_query); + } + return $result; +} + +/* + * Get previous working night + * + * Returns the night id for the machine of the night passed in + * where build status = OK + */ +function getPreviousWorkingNight($night_id, $mysql_link){ + $query = "SELECT machine FROM night WHERE id=$night_id"; + $program_query = mysql_query($query) or die (mysql_error()); + $row = mysql_fetch_array($program_query); + $this_machine_id=$row['machine']; + mysql_free_result($program_query); + + $query = "SELECT id FROM night WHERE machine=$this_machine_id ". + "and id<$night_id and buildstatus=\"OK\" order by added desc"; + $program_query = mysql_query($query) or die (mysql_error()); + $row = mysql_fetch_array($program_query); + $prev_id=$row['id']; + mysql_free_result($program_query); + + return $prev_id; +} + + /*$programs=array("Benchmarks/CoyoteBench/huffbench","Benchmarks/CoyoteBench/lpbench"); $history = buildResultsHistory(18, $programs,"GCCAS",$mysql_link); Index: nightlytest-serverside/fulltest.php diff -u nightlytest-serverside/fulltest.php:1.12 nightlytest-serverside/fulltest.php:1.13 --- nightlytest-serverside/fulltest.php:1.12 Thu Aug 10 17:35:02 2006 +++ nightlytest-serverside/fulltest.php Thu Aug 17 22:50:18 2006 @@ -6,8 +6,8 @@ $night_id = $HTTP_GET_VARS['night']; if(!$machine_id || !$night_id){ - print "Error, incorrect URL for test.php!\n"; - die(); + print "Error, incorrect URL for test.php!\n"; + die(); } @@ -17,15 +17,15 @@ $machine_query = mysql_query("SELECT * FROM machine WHERE id=$machine_id") or die (mysql_error()); $row = mysql_fetch_array($machine_query); mysql_free_result($machine_query); -$today_query = mysql_query("SELECT * FROM night WHERE id=$night_id") or die (mysql_error()); -$today_row = mysql_fetch_array($today_query); -mysql_free_result($today_query); -$cur_date=$today_row['added']; -$today_query = mysql_query("SELECT * FROM night WHERE machine=$machine_id and added<\"$cur_date\" order by added desc") or die (mysql_error()); +$today_query = getSuccessfulNightsHistory($machine_id, $mysql_link, $night_id); +$today_row = mysql_fetch_array($today_query); $yesterday_row = mysql_fetch_array($today_query); +$oldday_row = mysql_fetch_array($today_query); mysql_free_result($today_query); +$cur_date=$today_row['added']; +$previous_succesful_id = getPreviousWorkingNight($night_id, $mysql_link); ?> @@ -47,15 +47,15 @@

      LLVM Nightly Test Results For

      - - - + +
      - - +
      + + ". - "View Build Log\n"; + print "

      ". + "View Build Log

      \n"; } /***************************************************** @@ -113,12 +113,12 @@ $previous_query = mysql_query("SELECT * FROM night WHERE \"$cur_date\" > added and machine=$machine_id ORDER BY added DESC") or die (mysql_error()); if(strpos($today_row['buildstatus'], "OK")===FALSE){ - $disp=""; - $sign="(+)"; + $disp=""; + $sign="(+)"; } else{ - $disp="none"; - $sign="(-)"; + $disp="none"; + $sign="(-)"; } print "$sign Build Status\n"; print "
      \n"; @@ -132,10 +132,10 @@ * Printing changes in test suite * ******************************************************/ -$new_tests=preg_replace("/\n/","
      \n",$today_row['new_tests']); -$removed_tests=preg_replace("/\n/","
      \n",$today_row['removed_tests']); -$newly_passing_tests=preg_replace("/\n/","
      \n",$today_row['newly_passing_tests']); -$newly_failing_tests=preg_replace("/\n/","
      \n",$today_row['newly_failing_tests']); +$new_tests=getNewTests($night_id, $previous_succesful_id, $mysql_link); +$removed_tests=getRemovedTests($night_id, $previous_succesful_id, $mysql_link); +$newly_passing_tests=getFixedTests($night_id, $previous_succesful_id, $mysql_link); +$newly_failing_tests=getBrokenTests($night_id, $previous_succesful_id, $mysql_link); if((strpos($new_tests, "none")!==FALSE && strpos($removed_tests, "none")!==FALSE && @@ -149,8 +149,8 @@ $sign="(-)"; } else{ - $disp=""; - $sign="(+)"; + $disp=""; + $sign="(+)"; } print "$sign Test Suite Changes\n"; print "
      \n"; @@ -173,8 +173,10 @@ $delta_exppass = $today_row['teststats_exppass']-$yesterday_row['teststats_exppass']; $delta_expfail = $today_row['teststats_expfail']-$yesterday_row['teststats_expfail']; $delta_unexpfail = $today_row['teststats_unexpfail']-$yesterday_row['teststats_unexpfail']; +$unexpected_failures = getUnexpectedFailures($night_id, $mysql_link); -if($delta_exppass==0 && $delta_expfail==0 && $delta_unexpfail==0){ +if($delta_exppass==0 && $delta_expfail==0 && + $delta_unexpfail==0 && strcmp($unexpected_failures, "")===0){ $disp="none"; $sign="(-)"; } @@ -227,8 +229,7 @@ print "


      \n"; print"Unexpected test failures:
      \n"; -$unexpfail_tests=preg_replace("/\n/","
      \n",$today_row['unexpfail_tests']); -print "$unexpfail_tests

      \n"; +print "$unexpected_failures

      \n"; print "


      \n"; @@ -245,8 +246,8 @@ $sign="(+)"; } else{ - $disp="none"; - $sign="(-)"; + $disp="none"; + $sign="(-)"; } print "$sign Warning Information\n"; print "
      \n"; @@ -295,99 +296,99 @@ print "\t\n"; if( $previous_row = mysql_fetch_array($previous_query) ){ - print "\t\n"; - print "\t\tPrevious nightly test ({$previous_row['added']})\n"; - print "\t\t{$previous_row['getcvstime_cpu']}\n"; - print "\t\t{$previous_row['getcvstime_wall']}\n"; - print "\t\t{$previous_row['configuretime_cpu']}\n"; - print "\t\t{$previous_row['configuretime_wall']}\n"; - print "\t\t{$previous_row['buildtime_cpu']}\n"; - print "\t\t{$previous_row['buildtime_wall']}\n"; - print "\t\t{$previous_row['dejagnutime_cpu']}\n"; - print "\t\t{$previous_row['dejagnutime_wall']}\n"; - print "\t\n"; - - - print "\t\n"; - print "\t\t% change\n"; - - if($previous_row['getcvstime_cpu']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['getcvstime_cpu'] - $previous_row['getcvstime_cpu'])/$previous_row['getcvstime_cpu']) * 100,2); - $color=DetermineColor($delta, "white"); - print "\t\t$delta\n"; - } - - $color="white"; - if($previous_row['getcvstime_wall']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['getcvstime_wall'] - $previous_row['getcvstime_wall'])/$previous_row['getcvstime_wall']) * 100,2); - print "\t\t$delta\n"; - } - - $color="white"; - if($previous_row['configuretime_cpu']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['configuretime_cpu'] - $previous_row['configuretime_cpu'])/$previous_row['configuretime_cpu']) * 100,2); - $color=DetermineColor($delta, "white"); - print "\t\t$delta\n"; - } - - $color="white"; - - if($previous_row['configuretime_wall']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['configuretime_wall'] - $previous_row['configuretime_wall'])/$previous_row['configuretime_wall']) * 100,2); - print "\t\t$delta\n"; - } - - $color="white"; - if($previous_row['buildtime_cpu']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['buildtime_cpu'] - $previous_row['buildtime_cpu'])/$previous_row['buildtime_cpu']) * 100,2); - $color=DetermineColor($delta, "white"); - print "\t\t$delta\n"; - } - - $color="white"; - if($previous_row['buildtime_wall']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['buildtime_wall'] - $previous_row['buildtime_wall'])/$previous_row['buildtime_wall']) * 100,2); - print "\t\t$delta\n"; - } - - $color="white"; - if($previous_row['dejagnutime_cpu']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['dejagnutime_cpu'] - $previous_row['dejagnutime_cpu'])/$previous_row['dejagnutime_cpu']) * 100,2); - $color=DetermineColor($delta, "white"); - print "\t\t$delta\n"; - } - - $color="white"; - if($previous_row['dejagnutime_wall']==0){ - print "\t\t-\n"; - } - else{ - $delta = round((($today_row['dejagnutime_wall'] - $previous_row['dejagnutime_wall'])/$previous_row['dejagnutime_wall']) * 100,2); - print "\t\t$delta\n"; - } - - print "\t\n"; + print "\t\n"; + print "\t\tPrevious nightly test ({$previous_row['added']})\n"; + print "\t\t{$previous_row['getcvstime_cpu']}\n"; + print "\t\t{$previous_row['getcvstime_wall']}\n"; + print "\t\t{$previous_row['configuretime_cpu']}\n"; + print "\t\t{$previous_row['configuretime_wall']}\n"; + print "\t\t{$previous_row['buildtime_cpu']}\n"; + print "\t\t{$previous_row['buildtime_wall']}\n"; + print "\t\t{$previous_row['dejagnutime_cpu']}\n"; + print "\t\t{$previous_row['dejagnutime_wall']}\n"; + print "\t\n"; + + + print "\t\n"; + print "\t\t% change\n"; + + if($previous_row['getcvstime_cpu']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['getcvstime_cpu'] - $previous_row['getcvstime_cpu'])/$previous_row['getcvstime_cpu']) * 100,2); + $color=DetermineColor($delta, "white"); + print "\t\t$delta\n"; + } + + $color="white"; + if($previous_row['getcvstime_wall']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['getcvstime_wall'] - $previous_row['getcvstime_wall'])/$previous_row['getcvstime_wall']) * 100,2); + print "\t\t$delta\n"; + } + + $color="white"; + if($previous_row['configuretime_cpu']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['configuretime_cpu'] - $previous_row['configuretime_cpu'])/$previous_row['configuretime_cpu']) * 100,2); + $color=DetermineColor($delta, "white"); + print "\t\t$delta\n"; + } + + $color="white"; + + if($previous_row['configuretime_wall']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['configuretime_wall'] - $previous_row['configuretime_wall'])/$previous_row['configuretime_wall']) * 100,2); + print "\t\t$delta\n"; + } + + $color="white"; + if($previous_row['buildtime_cpu']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['buildtime_cpu'] - $previous_row['buildtime_cpu'])/$previous_row['buildtime_cpu']) * 100,2); + $color=DetermineColor($delta, "white"); + print "\t\t$delta\n"; + } + + $color="white"; + if($previous_row['buildtime_wall']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['buildtime_wall'] - $previous_row['buildtime_wall'])/$previous_row['buildtime_wall']) * 100,2); + print "\t\t$delta\n"; + } + + $color="white"; + if($previous_row['dejagnutime_cpu']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['dejagnutime_cpu'] - $previous_row['dejagnutime_cpu'])/$previous_row['dejagnutime_cpu']) * 100,2); + $color=DetermineColor($delta, "white"); + print "\t\t$delta\n"; + } + + $color="white"; + if($previous_row['dejagnutime_wall']==0){ + print "\t\t-\n"; + } + else{ + $delta = round((($today_row['dejagnutime_wall'] - $previous_row['dejagnutime_wall'])/$previous_row['dejagnutime_wall']) * 100,2); + print "\t\t$delta\n"; + } + + print "\t\n"; } mysql_free_result($previous_query); @@ -424,43 +425,43 @@ print"Added files:
      \n"; $added_files = $row['cvs_added']; if(strcmp($added_files,"")!=0){ - $added_files = str_replace("\n","
      ",$added_files); - print "\n"; - print "\t\n"; - print "\t\t\n"; - print "\t\n"; - print "
      $added_files


      \n"; + $added_files = str_replace("\n","
      ",$added_files); + print "\n"; + print "\t\n"; + print "\t\t\n"; + print "\t\n"; + print "
      $added_files


      \n"; } else{ - print "No removed files

      \n"; + print "No removed files

      \n"; } print"Removed files:
      \n"; $removed_files = $row['cvs_removed']; if(strcmp($removed_files,"")!=0){ - $removed_files = str_replace("\n","
      ",$removed_files); - print "\n"; - print "\t\n"; - print "\t\t\n"; - print "\t\n"; - print "
      $removed_files


      \n"; + $removed_files = str_replace("\n","
      ",$removed_files); + print "\n"; + print "\t\n"; + print "\t\t\n"; + print "\t\n"; + print "
      $removed_files


      \n"; } else{ - print "No removed files

      \n"; + print "No removed files

      \n"; } print"Modified files:
      \n"; $modified_files = $row['cvs_modified']; if(strcmp($modified_files,"")!=0){ - $modified_files = str_replace("\n","
      ",$modified_files); - print "\n"; - print "\t\n"; - print "\t\t\n"; - print "\t\n"; - print "
      $modified_files


      \n"; + $modified_files = str_replace("\n","
      ",$modified_files); + print "\n"; + print "\t\n"; + print "\t\t\n"; + print "\t\n"; + print "
      $modified_files


      \n"; } else{ - print "No removed files

      \n"; + print "No removed files

      \n"; } print "


      \n"; @@ -565,8 +566,8 @@ $today_results = GetDayResults($today_row['id'], $category_array, $mysql_link); if(isset($yesterday_row['id'])){ - $yesterday_results = GetDayResults($yesterday_row['id'], $category_array, $mysql_link); - $percent_difference = CalculateChangeBetweenDays($yesterday_results, $today_results,.2); + $yesterday_results = GetDayResults($yesterday_row['id'], $category_print_array, $mysql_link); + $percent_difference = CalculateChangeBetweenDays($yesterday_results, $today_results,.2); } /********************** external table **********************/ print "
      \n"; @@ -577,63 +578,63 @@ print"External tests:
      \n"; print "
      \n"; #creating the black border around the table print "\n"; -print "\t\n"; -print "\t\t\n"; +print "\t\n"; +print "\t\t\n"; $index=0; //here to ensure we dont print %diff for GCC comparisons foreach ($category_print_array as $x){ - print "\t\t\n"; - if($index<10 && isset($percent_difference)){ - print "\t\t\n"; - } - $index++; + print "\t\t\n"; + if($index<10 && isset($percent_difference)){ + print "\t\t\n"; + } + $index++; } -print "\t\n"; +print "\t\n"; print "\t\n"; print "\t\t\n"; -$index=0; +$index=0; foreach ($category_print_array as $x){ - if($index<10 && isset($percent_difference)){ - $col_width=2; - } - else{ - $col_width=1; - } - print "\t\t\n"; - $index++; + if($index<10 && isset($percent_difference)){ + $col_width=2; + } + else{ + $col_width=1; + } + print "\t\t\n"; + $index++; } -print "\t\n"; +print "\t\n"; $row_color=1; $count=0; foreach(array_keys($today_results) as $program){ - if(strcmp($today_results["$program"][0],"external")==0){ - if($row_color % 2 == 0){ - $def_color="white"; - } - else{ - $def_color="#DDDDDD"; - } - print "\t\n"; - print "\t\t\n"; - for($y=1; $y{$today_results["$program"][$y]}\n"; - if($y<11 && isset($percent_difference)){ - $delta=round($percent_difference["$program"][$y-1], 2); - $color=DetermineColor($delta, $def_color); - print "\t\t\n"; - } - } - print "\t\n"; - $row_color++; - if($row_color > 4){ - $row_color=1; - } - $count++; - }//end if strcmp + if(strcmp($today_results["$program"][0],"external")==0){ + if($row_color % 2 == 0){ + $def_color="white"; + } + else{ + $def_color="#DDDDDD"; + } + print "\t\n"; + print "\t\t\n"; + for($y=1; $y{$today_results["$program"][$y]}\n"; + if($y<11 && isset($percent_difference)){ + $delta=round($percent_difference["$program"][$y-1], 2); + $color=DetermineColor($delta, $def_color); + print "\t\t\n"; + } + } + print "\t\n"; + $row_color++; + if($row_color > 4){ + $row_color=1; + } + $count++; + }//end if strcmp }//end foreach print "
      Program
      ProgramToday's $x% change in $xToday's $x% change in $x
      \n"; - print "\n"; - print "\n"; - print "
      {$category_print_array_description[$index]}
      \n"; - print "
      ?
      \n"; - print "
      \n"; + print "\n"; + print "\n"; + print "
      {$category_print_array_description[$index]}
      \n"; + print "
      ?
      \n"; + print "
      $program$delta
      $program$delta
      \n"; print "


      \n"; #ending black border around table @@ -643,63 +644,63 @@ print"Multisource tests:
      \n"; print "
      \n"; #creating the black border around the table print "\n"; -print "\t\n"; -print "\t\t\n"; +print "\t\n"; +print "\t\t\n"; $index=0; //here to ensure we dont print %diff for GCC comparisons foreach ($category_print_array as $x){ - print "\t\t\n"; - if($index<10 && isset($percent_difference)){ - print "\t\t\n"; - } - $index++; + print "\t\t\n"; + if($index<10 && isset($percent_difference)){ + print "\t\t\n"; + } + $index++; } -print "\t\n"; +print "\t\n"; print "\t\n"; print "\t\t\n"; -$index=0; +$index=0; foreach ($category_print_array as $x){ - if($index<10 && isset($percent_difference)){ - $col_width=2; - } - else{ - $col_width=1; - } - print "\t\t\n"; - $index++; + if($index<10 && isset($percent_difference)){ + $col_width=2; + } + else{ + $col_width=1; + } + print "\t\t\n"; + $index++; } -print "\t\n"; +print "\t\n"; $row_color=1; $count=0; foreach(array_keys($today_results) as $program){ - if(strcmp($today_results["$program"][0],"multisource")==0){ - if($row_color % 2 == 0){ - $def_color="white"; - } - else{ - $def_color="#DDDDDD"; - } - print "\t\n"; - print "\t\t\n"; - for($y=1; $y{$today_results["$program"][$y]}\n"; - if($y<11 && isset($percent_difference)){ - $delta=round($percent_difference["$program"][$y-1], 2); - $color=DetermineColor($delta, $def_color); - print "\t\t\n"; - } - } - print "\t\n"; - $row_color++; - if($row_color > 4){ - $row_color=1; - } - $count++; - }//end if strcmp + if(strcmp($today_results["$program"][0],"multisource")==0){ + if($row_color % 2 == 0){ + $def_color="white"; + } + else{ + $def_color="#DDDDDD"; + } + print "\t\n"; + print "\t\t\n"; + for($y=1; $y{$today_results["$program"][$y]}\n"; + if($y<11 && isset($percent_difference)){ + $delta=round($percent_difference["$program"][$y-1], 2); + $color=DetermineColor($delta, $def_color); + print "\t\t\n"; + } + } + print "\t\n"; + $row_color++; + if($row_color > 4){ + $row_color=1; + } + $count++; + }//end if strcmp }//end foreach print "
      Program
      ProgramToday's $x% change in $xToday's $x% change in $x
      \n"; - print "\n"; - print "\n"; - print "
      {$category_print_array_description[$index]}
      \n"; - print "
      ?
      \n"; - print "
      \n"; + print "\n"; + print "\n"; + print "
      {$category_print_array_description[$index]}
      \n"; + print "
      ?
      \n"; + print "
      $program$delta
      $program$delta
      \n"; print "


      \n"; #ending black border around table @@ -713,63 +714,63 @@ print"Singlesource tests:
      \n"; print "
      \n"; #creating the black border around the table print "\n"; -print "\t\n"; -print "\t\t\n"; +print "\t\n"; +print "\t\t\n"; $index=0; //here to ensure we dont print %diff for GCC comparisons foreach ($category_print_array as $x){ - print "\t\t\n"; - if($index<10 && isset($percent_difference)){ - print "\t\t\n"; - } - $index++; + print "\t\t\n"; + if($index<10 && isset($percent_difference)){ + print "\t\t\n"; + } + $index++; } -print "\t\n"; +print "\t\n"; print "\t\n"; print "\t\t\n"; -$index=0; +$index=0; foreach ($category_print_array as $x){ - if($index<10 && isset($percent_difference)){ - $col_width=2; - } - else{ - $col_width=1; - } - print "\t\t\n"; - $index++; + if($index<10 && isset($percent_difference)){ + $col_width=2; + } + else{ + $col_width=1; + } + print "\t\t\n"; + $index++; } -print "\t\n"; +print "\t\n"; $row_color=1; $count=0; foreach(array_keys($today_results) as $program){ - if(strcmp($today_results["$program"][0],"singlesource")==0){ - if($row_color % 2 == 0){ - $def_color="white"; - } - else{ - $def_color="#DDDDDD"; - } - print "\t\n"; - print "\t\t\n"; - for($y=1; $y{$today_results["$program"][$y]}\n"; - if($y<11 && isset($percent_difference)){ - $delta=round($percent_difference["$program"][$y-1], 2); - $color=DetermineColor($delta, $def_color); - print "\t\t\n"; - } - } - print "\t\n"; - $row_color++; - if($row_color > 4){ - $row_color=1; - } - $count++; - }//end if strcmp + if(strcmp($today_results["$program"][0],"singlesource")==0){ + if($row_color % 2 == 0){ + $def_color="white"; + } + else{ + $def_color="#DDDDDD"; + } + print "\t\n"; + print "\t\t\n"; + for($y=1; $y{$today_results["$program"][$y]}\n"; + if($y<11 && isset($percent_difference)){ + $delta=round($percent_difference["$program"][$y-1], 2); + $color=DetermineColor($delta, $def_color); + print "\t\t\n"; + } + } + print "\t\n"; + $row_color++; + if($row_color > 4){ + $row_color=1; + } + $count++; + }//end if strcmp }//end foreach print "
      Program
      ProgramToday's $x% change in $xToday's $x% change in $x
      \n"; - print "\n"; - print "\n"; - print "
      {$category_print_array_description[$index]}
      \n"; - print "
      ?
      \n"; - print "
      \n"; + print "\n"; + print "\n"; + print "
      {$category_print_array_description[$index]}
      \n"; + print "
      ?
      \n"; + print "
      $program$delta
      $program$delta
      \n"; print "


      \n"; #ending black border around table Index: nightlytest-serverside/individualgraph.php diff -u nightlytest-serverside/individualgraph.php:1.1.1.1 nightlytest-serverside/individualgraph.php:1.2 --- nightlytest-serverside/individualgraph.php:1.1.1.1 Wed Jul 5 15:56:33 2006 +++ nightlytest-serverside/individualgraph.php Thu Aug 17 22:50:18 2006 @@ -50,12 +50,12 @@ if(isset($HTTP_GET_VARS['measure'])){ $measure_arr=$HTTP_GET_VARS["measure"]; - $measure=$measure_arr[0]; + $measure=$measure_arr[0]; } else{$URL_ERROR=1;$error_msg="no value for measure";} if(isset($HTTP_GET_VARS['program'])){ - $program_arr=$HTTP_GET_VARS['program']; + $program_arr=$HTTP_GET_VARS['program']; $program=$HTTP_GET_VARS['program']; } else{$URL_ERROR=1;$error_msg="no value for program";} @@ -80,7 +80,7 @@ else{$URL_ERROR=1;$error_msg="no value for machine";} if(isset($HTTP_GET_VARS['start'])){ - if(preg_match("/\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d/", "{$HTTP_GET_VARS['start']}")>0){ + if(preg_match("/\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d/", "{$HTTP_GET_VARS['start']}")>0){ $start = $HTTP_GET_VARS['start']; $start_query = "and added >= \"$start\""; $start_url = "&start=$start"; @@ -91,14 +91,14 @@ } } else{ - $start_url=""; + $start_url=""; $start = ""; $start_query = " "; } if(isset($HTTP_GET_VARS['end'])){ if(preg_match("/\d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d/", $HTTP_GET_VARS['end'])>0){ - $end = $HTTP_GET_VARS['end']; + $end = $HTTP_GET_VARS['end']; $end_url="&end=$end"; $end_query = "and added <= \"$end\""; } @@ -108,7 +108,7 @@ } } else{ - $end_url=""; + $end_url=""; $end = ""; $end_query = " "; } @@ -116,26 +116,26 @@ if(isset($HTTP_GET_VARS['normalize'])){ if(strcmp($HTTP_GET_VARS['normalize'],"true")==0){ $NORMALIZE=1; - $normalize_url = "&normalize=true"; - $def_normalize="CHECKED"; - $def_unnormalize=""; - } + $normalize_url = "&normalize=true"; + $def_normalize="CHECKED"; + $def_unnormalize=""; + } else{ - $normalize_url=""; + $normalize_url=""; $NORMALIZE=0; - $def_normalize=""; - $def_unnormalize="CHECKED"; + $def_normalize=""; + $def_unnormalize="CHECKED"; } } else{ $NORMALIZE=0; - $normalize_url=""; - $def_normalize=""; - $def_unnormalize="CHECKED"; + $normalize_url=""; + $def_normalize=""; + $def_unnormalize="CHECKED"; } if(isset($HTTP_GET_VARS['showdata'])){ if(strcmp($HTTP_GET_VARS['showdata'],"true")==0){ - $SHOWDATA=1; + $SHOWDATA=1; $showdata="&showdata=true"; } else{ @@ -144,22 +144,22 @@ } } else{ - $SHOWDATA=0; + $SHOWDATA=0; $showdata=""; } if(isset($HTTP_GET_VARS['showpoints'])){ if(strcmp($HTTP_GET_VARS['showpoints'],"true")==0){ $SHOWPOINTS=1; - $showpoints="&showpoints=true"; + $showpoints="&showpoints=true"; } else{ - $SHOWPOINTS=0; + $SHOWPOINTS=0; $showpoints=""; } } else{ - $SHOWPOINTS=0; + $SHOWPOINTS=0; $showpoints=""; } @@ -253,7 +253,7 @@ $list_of_programs=""; foreach($program as $prog){ - $list_of_programs.="&program[]=$prog"; + $list_of_programs.="&program[]=$prog"; } print "\t\"$measure\"
      \n"; @@ -320,66 +320,66 @@ $all=0; if(strcmp($start, $all_tests)==0 && strcmp($end, $last_date)==0){$all=1; print "Time: All |";} else{ - print "Time: All |\n"; + print "Time: All |\n"; } if($all==0 && strcmp($start, $all_tests)==0){ - print "From first measurement |"; + print "From first measurement |"; } else{ - print "From first measurement |\n"; + print "From first measurement |\n"; } if(strcmp($start, $one_year)!=0){ - print "1 year | \n"; + print "1 year | \n"; } else { print " 1 year |";} if(strcmp($start, $six_month)!=0){ - print "6 months | \n"; + print "6 months | \n"; } else { print " 6 months |";} if(strcmp($start, $three_month)!=0){ - print "3 months | \n"; + print "3 months | \n"; } else { print " 3 months |";} if(strcmp($start, $one_month)!=0){ - print "1 month | \n"; + print "1 month | \n"; } else { print " 1 month |";} if(strcmp($start, $one_week)!=0){ - print "1 week
      \n"; + print "1 week
      \n"; } else { print " 1 week
      ";} if($NORMALIZE==1){ - print "Data normalization: On |\n"; - print "Off
      \n"; + print "Data normalization: On |\n"; + print "Off
      \n"; } else{ - print "Data normalization: On |\n"; - print "Off
      \n"; + print "Data normalization: On |\n"; + print "Off
      \n"; } if($SHOWDATA==1){ - print "Show data on graph: On |\n"; - print "Off
      \n"; + print "Show data on graph: On |\n"; + print "Off
      \n"; } else{ - print "Show data on graph: On |\n"; - print "Off
      \n"; + print "Show data on graph: On |\n"; + print "Off
      \n"; } if($SHOWPOINTS==1){ - print "Show points on graph: On |\n"; - print "Off
      \n"; + print "Show points on graph: On |\n"; + print "Off
      \n"; } else{ - print "Show points on graph: On |\n"; - print "Off
      \n"; + print "Show points on graph: On |\n"; + print "Off
      \n"; } @@ -392,36 +392,36 @@ print "
      \n"; if(strcmp($start,"")!=0 && strcmp($end,"")!=0){ - $history = buildResultsHistory($machine_id, $program,$measure,$mysql_link,$start,$end); + $history = buildResultsHistory($machine_id, $program,$measure,$mysql_link,$start,$end); } else if(strcmp($start,"")!=0){ - $history = buildResultsHistory($machine_id, $program,$measure,$mysql_link,$start); + $history = buildResultsHistory($machine_id, $program,$measure,$mysql_link,$start); } else{ - $history = buildResultsHistory($machine_id, $program,$measure,$mysql_link); + $history = buildResultsHistory($machine_id, $program,$measure,$mysql_link); } print "\n"; print "\t\n"; print "\t\t\n"; -foreach ($program as $prog){ - print "\t\t\n"; +foreach ($program as $prog){ + print "\t\t\n"; } print "\t\n"; foreach (array_keys($history) as $date){ - if(sizeof($history["$date"])>1){ - print "\t\n"; - print "\t\t\n"; - for($x=1; $x{$history["$date"][$x]}\n"; - } - else{ - print "\t\t\n"; - } - } - print "\t\n"; - } + if(sizeof($history["$date"])>1){ + print "\t\n"; + print "\t\t\n"; + for($x=1; $x{$history["$date"][$x]}\n"; + } + else{ + print "\t\t\n"; + } + } + print "\t\n"; + } } print "
      Date$prog$prog
      $date-
      $date-
      \n"; Index: nightlytest-serverside/sidebar.php diff -u nightlytest-serverside/sidebar.php:1.8 nightlytest-serverside/sidebar.php:1.9 --- nightlytest-serverside/sidebar.php:1.8 Wed Aug 2 12:08:55 2006 +++ nightlytest-serverside/sidebar.php Thu Aug 17 22:50:18 2006 @@ -88,7 +88,7 @@ /********************** Creating list to future and past tests **********************/ $next_stack = array(); - $next_query = getNightsResource($machine,$mysql_link,$cur_date,"2020-12-30 01:01:01","ASC"); + $next_query = getNightsIDs($machine,$mysql_link,$cur_date,"2020-12-30 01:01:01","ASC"); $next = mysql_fetch_array($next_query); $x=0; while($x<7 && $x

      $date

      \n"; - $previous_query = getNightsResource($machine,$mysql_link,"2000-01-01 01:01:01","$cur_date"); + $previous_query = getNightsIDs($machine,$mysql_link,"2000-01-01 01:01:01","$cur_date"); $x=0; $prev=mysql_fetch_array($previous_query); //eliminates current date while($x<7 && $prev=mysql_fetch_array($previous_query)){ @@ -115,19 +115,20 @@ } print "
    \n"; mysql_free_result($previous_query); - - $next_query = getNightsResource($machine,$mysql_link); + + $next_query = getNightsIDs($machine,$mysql_link); print "\n"; print "\n"; print "
    \n"; print "\n"; print "\n"; - mysql_free_result($next_query); + } Index: nightlytest-serverside/test.php diff -u nightlytest-serverside/test.php:1.15 nightlytest-serverside/test.php:1.16 --- nightlytest-serverside/test.php:1.15 Thu Aug 10 17:32:12 2006 +++ nightlytest-serverside/test.php Thu Aug 17 22:50:18 2006 @@ -36,12 +36,13 @@ $today_row = getNightInfo($night_id,$mysql_link); $cur_date=$today_row['added']; -$today_query = getNightsResource($machine_id,$mysql_link,"2000-01-01 01:01:01",$cur_date); +$today_query = getSuccessfulNightsHistory($machine_id,$mysql_link,$night_id); $today_row = mysql_fetch_array($today_query); $yesterday_row = mysql_fetch_array($today_query); $oldday_row = mysql_fetch_array($today_query); mysql_free_result($today_query); +$previous_succesful_id = getPreviousWorkingNight($night_id, $mysql_link); ?> @@ -147,10 +148,10 @@ * Printing changes in test suite * ******************************************************/ -$new_tests=preg_replace("/\n/","
    \n",$today_row['new_tests']); -$removed_tests=preg_replace("/\n/","
    \n",$today_row['removed_tests']); -$newly_passing_tests=preg_replace("/\n/","
    \n",$today_row['newly_passing_tests']); -$newly_failing_tests=preg_replace("/\n/","
    \n",$today_row['newly_failing_tests']); +$new_tests=getNewTests($night_id, $previous_succesful_id, $mysql_link); +$removed_tests=getRemovedTests($night_id, $previous_succesful_id, $mysql_link); +$newly_passing_tests=getFixedTests($night_id, $previous_succesful_id, $mysql_link); +$newly_failing_tests=getBrokenTests($night_id, $previous_succesful_id, $mysql_link); if((strpos($new_tests, "none")!==FALSE && strpos($removed_tests, "none")!==FALSE && @@ -172,7 +173,7 @@ print"

    Test suite changes:

    \n"; print"New tests:
    \n"; print "$new_tests

    \n"; -print"Removed tests
    \n"; +print"Removed tests:
    \n"; print "$removed_tests

    \n"; print"Newly passing tests:
    \n"; print "$newly_passing_tests

    \n"; @@ -188,14 +189,16 @@ $delta_exppass = $today_row['teststats_exppass']-$yesterday_row['teststats_exppass']; $delta_expfail = $today_row['teststats_expfail']-$yesterday_row['teststats_expfail']; $delta_unexpfail = $today_row['teststats_unexpfail']-$yesterday_row['teststats_unexpfail']; +$unexpected_failures = getUnexpectedFailures($night_id, $mysql_link); -if($delta_exppass==0 && $delta_expfail==0 && $delta_unexpfail==0){ +if($delta_exppass==0 && $delta_expfail==0 && + $delta_unexpfail==0 && strcmp($unexpected_failures,"")===0){ $disp="none"; $sign="(-)"; } else{ $disp=""; - $sign="(+)"; + $sign="(+)"; } @@ -242,8 +245,7 @@ print "

    \n"; print"Unexpected test failures:
    \n"; -$unexpfail_tests=preg_replace("/\n/","
    \n",$today_row['unexpfail_tests']); -print "$unexpfail_tests

    \n"; +print "$unexpected_failures

    \n"; print "

    \n"; From reid at x10sys.com Fri Aug 18 01:34:51 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 01:34:51 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll 2003-06-29-NodeCollapsing2.ll 2003-06-30-TopDownResolve.ll 2003-07-01-FieldCollapse.ll 2003-07-16-ConstantExprCollapse.ll 2003-11-02-NodeCollapsing.ll 2004-02-13-memcpy.ll 2005-03-22-IncompleteGlobal.ll 2006-03-27-LinkedCollapsed.ll 2006-04-13-ZeroArrayStruct.ll 2006-04-25-ZeroArrayStructUse.ll FunctionPointerTable-const.ll GlobalsGraphFuncPtr.ll HardBUCase.ll PhysicalSubtyping.ll SCCSimpleExample.ll constant_globals.ll strcpy.ll Message-ID: <200608180634.k7I6YprS005452@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/DSGraph: 2003-06-29-IncompleteTDPass.ll updated: 1.2 -> 1.3 2003-06-29-NodeCollapsing2.ll updated: 1.1 -> 1.2 2003-06-30-TopDownResolve.ll updated: 1.3 -> 1.4 2003-07-01-FieldCollapse.ll updated: 1.1 -> 1.2 2003-07-16-ConstantExprCollapse.ll updated: 1.2 -> 1.3 2003-11-02-NodeCollapsing.ll updated: 1.1 -> 1.2 2004-02-13-memcpy.ll updated: 1.4 -> 1.5 2005-03-22-IncompleteGlobal.ll updated: 1.2 -> 1.3 2006-03-27-LinkedCollapsed.ll updated: 1.1 -> 1.2 2006-04-13-ZeroArrayStruct.ll updated: 1.1 -> 1.2 2006-04-25-ZeroArrayStructUse.ll updated: 1.1 -> 1.2 FunctionPointerTable-const.ll updated: 1.2 -> 1.3 GlobalsGraphFuncPtr.ll updated: 1.2 -> 1.3 HardBUCase.ll updated: 1.2 -> 1.3 PhysicalSubtyping.ll updated: 1.1 -> 1.2 SCCSimpleExample.ll updated: 1.1 -> 1.2 constant_globals.ll updated: 1.2 -> 1.3 strcpy.ll updated: 1.2 -> 1.3 --- Log message: For PR872: http://llvm.org/PR872 : Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. --- Diffs of the changes: (+21 -21) 2003-06-29-IncompleteTDPass.ll | 2 +- 2003-06-29-NodeCollapsing2.ll | 2 +- 2003-06-30-TopDownResolve.ll | 2 +- 2003-07-01-FieldCollapse.ll | 2 +- 2003-07-16-ConstantExprCollapse.ll | 2 +- 2003-11-02-NodeCollapsing.ll | 2 +- 2004-02-13-memcpy.ll | 4 ++-- 2005-03-22-IncompleteGlobal.ll | 4 ++-- 2006-03-27-LinkedCollapsed.ll | 2 +- 2006-04-13-ZeroArrayStruct.ll | 2 +- 2006-04-25-ZeroArrayStructUse.ll | 2 +- FunctionPointerTable-const.ll | 4 ++-- GlobalsGraphFuncPtr.ll | 2 +- HardBUCase.ll | 2 +- PhysicalSubtyping.ll | 2 +- SCCSimpleExample.ll | 2 +- constant_globals.ll | 2 +- strcpy.ll | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) Index: llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll:1.2 Fri Jul 25 16:09:20 2003 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-29-IncompleteTDPass.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=Ptr:HR +; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=Ptr:HR Index: llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll:1.1 llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll:1.1 Sun Jun 29 13:17:20 2003 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-29-NodeCollapsing2.ll Fri Aug 18 01:34:30 2006 @@ -1,7 +1,7 @@ ; This is the same testcase as 2003-06-29-NodeCollapsing2.ll, but it uses the ; graph checker. ; -; RUN: analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed ; %T = type { int} Index: llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.3 llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.4 --- llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll:1.3 Fri Jul 25 16:09:20 2003 +++ llvm/test/Regression/Analysis/DSGraph/2003-06-30-TopDownResolve.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=X:GM +; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=X:GM %G = internal global int 5 Index: llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll:1.1 llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll:1.1 Tue Jul 1 11:28:20 2003 +++ llvm/test/Regression/Analysis/DSGraph/2003-07-01-FieldCollapse.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed %X = internal global { int, short, short } { int 1, short 2, short 3 } Index: llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll:1.2 Sat Nov 6 14:38:27 2004 +++ llvm/test/Regression/Analysis/DSGraph/2003-07-16-ConstantExprCollapse.ll Fri Aug 18 01:34:30 2006 @@ -1,6 +1,6 @@ ; This should cause the global node to collapse!! ; XFAIL: * -; RUN: analyze %s -datastructure-gc --dsgc-check-flags=test:GAU +; RUN: opt -analyze %s -datastructure-gc --dsgc-check-flags=test:GAU %Tree = type { int, %Tree*, %Tree* } %T5 = external global %Tree Index: llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll diff -u llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll:1.1 llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll:1.1 Sun Nov 2 14:43:10 2003 +++ llvm/test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll Fri Aug 18 01:34:30 2006 @@ -1,7 +1,7 @@ ; This is the same testcase as 2003-06-29-NodeCollapsing2.ll, but it uses the ; graph checker. ; -; RUN: analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed ; %S = type { double, int } Index: llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll diff -u llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll:1.4 llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll:1.5 --- llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll:1.4 Tue Apr 4 22:31:45 2006 +++ llvm/test/Regression/Analysis/DSGraph/2004-02-13-memcpy.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ -; RUN: analyze %s -datastructure-gc -dsgc-check-flags=Xn:SMR -; RUN: analyze %s -datastructure-gc -dsgc-check-flags=X:SMR +; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=Xn:SMR +; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=X:SMR declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint) declare void %llvm.memmove.i32(sbyte*, sbyte*, uint, uint) Index: llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll diff -u llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll:1.2 llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll:1.2 Tue Mar 22 16:11:22 2005 +++ llvm/test/Regression/Analysis/DSGraph/2005-03-22-IncompleteGlobal.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ -; RUN: analyze %s -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=bu &&\ -; RUN: analyze %s -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=td +; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=bu &&\ +; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=G:GIM -dsgc-dspass=td %S = type { double, int } Index: llvm/test/Regression/Analysis/DSGraph/2006-03-27-LinkedCollapsed.ll diff -u llvm/test/Regression/Analysis/DSGraph/2006-03-27-LinkedCollapsed.ll:1.1 llvm/test/Regression/Analysis/DSGraph/2006-03-27-LinkedCollapsed.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/2006-03-27-LinkedCollapsed.ll:1.1 Mon Mar 27 17:38:48 2006 +++ llvm/test/Regression/Analysis/DSGraph/2006-03-27-LinkedCollapsed.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | analyze -datastructure +; RUN: llvm-as < %s | opt -analyze -datastructure target endian = little target pointersize = 32 Index: llvm/test/Regression/Analysis/DSGraph/2006-04-13-ZeroArrayStruct.ll diff -u llvm/test/Regression/Analysis/DSGraph/2006-04-13-ZeroArrayStruct.ll:1.1 llvm/test/Regression/Analysis/DSGraph/2006-04-13-ZeroArrayStruct.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/2006-04-13-ZeroArrayStruct.ll:1.1 Thu Apr 13 14:50:07 2006 +++ llvm/test/Regression/Analysis/DSGraph/2006-04-13-ZeroArrayStruct.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | analyze -datastructure +; RUN: llvm-as < %s | opt -analyze -datastructure ; ModuleID = 'bug3.bc' target endian = little Index: llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll diff -u llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll:1.1 llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll:1.1 Tue Apr 25 14:27:56 2006 +++ llvm/test/Regression/Analysis/DSGraph/2006-04-25-ZeroArrayStructUse.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -datastructure-gc -dsgc-check-flags=x:IA +; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=x:IA ; ModuleID = 'bug3.bc' target endian = little Index: llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll diff -u llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.2 llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll:1.2 Wed Jun 28 15:07:36 2006 +++ llvm/test/Regression/Analysis/DSGraph/FunctionPointerTable-const.ll Fri Aug 18 01:34:30 2006 @@ -1,7 +1,7 @@ ; FIXME: this should be SHM for bu, but change it for now since besides incompleteness ; this is working -; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \ -; RUN: analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM +; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=Y:SHIM && \ +; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=td -dsgc-check-flags=P1:SHM,P2:SHM %G = internal constant [2 x int*(int*)*] [ int*(int*)* %callee1, int*(int*)* %callee2 Index: llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll diff -u llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.2 llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll:1.2 Wed Jun 28 15:14:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/GlobalsGraphFuncPtr.ll Fri Aug 18 01:34:30 2006 @@ -5,7 +5,7 @@ ; -- globals in GG pointed to by latter should be marked I, but not other nodes ; ; FIXME: KnownPtr should be just S. -; RUN: analyze %s -datastructure-gc -dsgc-check-flags=KnownPtr:SI,UnknownPtr:SI -dsgc-dspass=bu +; RUN: opt -analyze %s -datastructure-gc -dsgc-check-flags=KnownPtr:SI,UnknownPtr:SI -dsgc-dspass=bu %Z = internal global int 0 %X = internal global int 0 Index: llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll diff -u llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll:1.2 llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll:1.2 Sat Nov 6 15:01:45 2004 +++ llvm/test/Regression/Analysis/DSGraph/HardBUCase.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -budatastructure -dont-print-ds +; RUN: opt -analyze %s -budatastructure -dont-print-ds %MidFnTy = type void (\2*) Index: llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll diff -u llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll:1.1 llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll:1.1 Sun Jun 29 17:35:55 2003 +++ llvm/test/Regression/Analysis/DSGraph/PhysicalSubtyping.ll Fri Aug 18 01:34:30 2006 @@ -1,6 +1,6 @@ ; Test to check for support for "physical subtyping" ; -; RUN: analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed +; RUN: opt -analyze %s -datastructure-gc -dsgc-abort-if-any-collapsed ; %S = type { int } %T = type { int, float, double } Index: llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll diff -u llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll:1.1 llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll:1.2 --- llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll:1.1 Sun Jun 29 22:25:53 2003 +++ llvm/test/Regression/Analysis/DSGraph/SCCSimpleExample.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ -; RUN: analyze %s -datastructure-gc --dsgc-abort-if-merged=Y,BVal +; RUN: opt -analyze %s -datastructure-gc --dsgc-abort-if-merged=Y,BVal implementation Index: llvm/test/Regression/Analysis/DSGraph/constant_globals.ll diff -u llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.2 llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/constant_globals.ll:1.2 Wed Jun 28 15:14:30 2006 +++ llvm/test/Regression/Analysis/DSGraph/constant_globals.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ ; FIXME: A should just be SM -; RUN: analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SIM +; RUN: opt -analyze %s -datastructure-gc -dsgc-dspass=bu -dsgc-check-flags=A:SIM ; Constant globals should not mark stuff incomplete. This should allow the ; bu pass to resolve the indirect call immediately in "test", allowing %A to ; be marked complete and the store to happen. Index: llvm/test/Regression/Analysis/DSGraph/strcpy.ll diff -u llvm/test/Regression/Analysis/DSGraph/strcpy.ll:1.2 llvm/test/Regression/Analysis/DSGraph/strcpy.ll:1.3 --- llvm/test/Regression/Analysis/DSGraph/strcpy.ll:1.2 Tue Mar 16 14:04:55 2004 +++ llvm/test/Regression/Analysis/DSGraph/strcpy.ll Fri Aug 18 01:34:30 2006 @@ -3,7 +3,7 @@ ; has no defined way to check for this, so DSA can know that strcpy doesn't ; require merging the input arguments. -; RUN: analyze %s -datastructure-gc --dsgc-abort-if-merged=A,B --dsgc-check-flags=A:ASM,B:ASR --dsgc-dspass=bu +; RUN: opt -analyze %s -datastructure-gc --dsgc-abort-if-merged=A,B --dsgc-check-flags=A:ASM,B:ASR --dsgc-dspass=bu implementation From reid at x10sys.com Fri Aug 18 01:34:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 01:34:55 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll Message-ID: <200608180634.k7I6YtAN005467@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/LoopInfo: 2003-05-15-NestingProblem.ll updated: 1.2 -> 1.3 --- Log message: For PR872: http://llvm.org/PR872 : Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. --- Diffs of the changes: (+1 -1) 2003-05-15-NestingProblem.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll diff -u llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.2 llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.3 --- llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll:1.2 Thu Oct 23 10:46:42 2003 +++ llvm/test/Regression/Analysis/LoopInfo/2003-05-15-NestingProblem.ll Fri Aug 18 01:34:30 2006 @@ -1,7 +1,7 @@ ; This testcase was incorrectly computing that the loopentry.7 loop was ; not a child of the loopentry.6 loop. ; -; RUN: analyze %s -loops | grep "^ Loop Containing: %loopentry.7" +; RUN: opt -analyze %s -loops | grep "^ Loop Containing: %loopentry.7" void %getAndMoveToFrontDecode() { ; No predecessors! br label %endif.2 From reid at x10sys.com Fri Aug 18 01:34:53 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 01:34:53 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/Makefile opt.cpp Message-ID: <200608180634.k7I6Yroe005461@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: Makefile updated: 1.56 -> 1.57 opt.cpp updated: 1.110 -> 1.111 --- Log message: For PR872: http://llvm.org/PR872 : Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. --- Diffs of the changes: (+151 -7) Makefile | 8 +-- opt.cpp | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 151 insertions(+), 7 deletions(-) Index: llvm/tools/opt/Makefile diff -u llvm/tools/opt/Makefile:1.56 llvm/tools/opt/Makefile:1.57 --- llvm/tools/opt/Makefile:1.56 Thu Jul 6 19:46:19 2006 +++ llvm/tools/opt/Makefile Fri Aug 18 01:34:30 2006 @@ -10,9 +10,9 @@ TOOLNAME = opt REQUIRES_EH := 1 -USEDLIBS = LLVMBCReader.a LLVMBCWriter.a LLVMInstrumentation.a \ - LLVMScalarOpts.a LLVMipo.a LLVMipa.a LLVMDataStructure LLVMTransforms.a \ - LLVMTarget.a LLVMTransformUtils.a LLVMAnalysis.a LLVMCore.a LLVMSupport.a \ - LLVMbzip2.a LLVMSystem.a +USEDLIBS = LLVMAsmParser.a LLVMBCReader.a LLVMBCWriter.a LLVMInstrumentation.a \ + LLVMScalarOpts.a LLVMipo.a LLVMipa.a LLVMDataStructure \ + LLVMTransforms.a LLVMTarget.a LLVMTransformUtils.a LLVMAnalysis.a \ + LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a include $(LEVEL)/Makefile.common Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.110 llvm/tools/opt/opt.cpp:1.111 --- llvm/tools/opt/opt.cpp:1.110 Fri Jun 16 13:23:49 2006 +++ llvm/tools/opt/opt.cpp Fri Aug 18 01:34:30 2006 @@ -8,11 +8,12 @@ //===----------------------------------------------------------------------===// // // Optimizations may be specified an arbitrary number of times on the command -// line, they are run in the order specified. +// line, They are run in the order specified. // //===----------------------------------------------------------------------===// #include "llvm/Module.h" +#include "llvm/Assembly/Parser.h" #include "llvm/PassManager.h" #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/WriteBytecodePass.h" @@ -24,6 +25,8 @@ #include "llvm/System/Signals.h" #include "llvm/Support/PluginLoader.h" #include "llvm/Support/SystemUtils.h" +#include "llvm/Support/Timer.h" +#include "llvm/Analysis/LinkAllAnalyses.h" #include "llvm/Transforms/LinkAllPasses.h" #include "llvm/LinkAllVMCore.h" #include @@ -43,7 +46,8 @@ // Other command line options... // static cl::opt -InputFilename(cl::Positional, cl::desc(""), cl::init("-")); +InputFilename(cl::Positional, cl::desc(""), + cl::init("-"), cl::value_desc("filename")); static cl::opt OutputFilename("o", cl::desc("Override output filename"), @@ -68,6 +72,91 @@ static cl::alias QuietA("quiet", cl::desc("Alias for -q"), cl::aliasopt(Quiet)); +static cl::opt +AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization")); + +// The AnalysesList is automatically populated with registered Passes by the +// PassNameParser. +static + cl::list > + AnalysesList(cl::desc("Analyses available:")); + +static Timer BytecodeLoadTimer("Bytecode Loader"); + +// ---------- Define Printers for module and function passes ------------ +namespace { + +struct ModulePassPrinter : public ModulePass { + const PassInfo *PassToPrint; + ModulePassPrinter(const PassInfo *PI) : PassToPrint(PI) {} + + virtual bool runOnModule(Module &M) { + if (!Quiet) { + std::cout << "Printing analysis '" << PassToPrint->getPassName() + << "':\n"; + getAnalysisID(PassToPrint).print(std::cout, &M); + } + + // Get and print pass... + return false; + } + + virtual const char *getPassName() const { return "'Pass' Printer"; } + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequiredID(PassToPrint); + AU.setPreservesAll(); + } +}; + +struct FunctionPassPrinter : public FunctionPass { + const PassInfo *PassToPrint; + FunctionPassPrinter(const PassInfo *PI) : PassToPrint(PI) {} + + virtual bool runOnFunction(Function &F) { + if (!Quiet) { + std::cout << "Printing analysis '" << PassToPrint->getPassName() + << "' for function '" << F.getName() << "':\n"; + } + // Get and print pass... + getAnalysisID(PassToPrint).print(std::cout, F.getParent()); + return false; + } + + virtual const char *getPassName() const { return "FunctionPass Printer"; } + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequiredID(PassToPrint); + AU.setPreservesAll(); + } +}; + +struct BasicBlockPassPrinter : public BasicBlockPass { + const PassInfo *PassToPrint; + BasicBlockPassPrinter(const PassInfo *PI) : PassToPrint(PI) {} + + virtual bool runOnBasicBlock(BasicBlock &BB) { + if (!Quiet) { + std::cout << "Printing Analysis info for BasicBlock '" << BB.getName() + << "': Pass " << PassToPrint->getPassName() << ":\n"; + } + + // Get and print pass... + getAnalysisID(PassToPrint).print( + std::cout, BB.getParent()->getParent()); + return false; + } + + virtual const char *getPassName() const { return "BasicBlockPass Printer"; } + + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequiredID(PassToPrint); + AU.setPreservesAll(); + } +}; + +} // anonymous namespace + //===----------------------------------------------------------------------===// // main for opt @@ -75,9 +164,63 @@ int main(int argc, char **argv) { try { cl::ParseCommandLineOptions(argc, argv, - " llvm .bc -> .bc modular optimizer\n"); + " llvm .bc -> .bc modular optimizer and analysis printer \n"); sys::PrintStackTraceOnErrorSignal(); + if (AnalyzeOnly) { + Module *CurMod = 0; + try { +#if 0 + TimeRegion RegionTimer(BytecodeLoadTimer); +#endif + CurMod = ParseBytecodeFile(InputFilename); + if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename))){ + std::cerr << argv[0] << ": input file didn't read correctly.\n"; + return 1; + } + } catch (const ParseException &E) { + std::cerr << argv[0] << ": " << E.getMessage() << "\n"; + return 1; + } + + // Create a PassManager to hold and optimize the collection of passes we + // are about to build... + PassManager Passes; + + // Add an appropriate TargetData instance for this module... + Passes.add(new TargetData(CurMod)); + + // Make sure the input LLVM is well formed. + if (!NoVerify) + Passes.add(createVerifierPass()); + + // Create a new optimization pass for each one specified on the + // command line + for (unsigned i = 0; i < AnalysesList.size(); ++i) { + const PassInfo *Analysis = AnalysesList[i]; + + if (Analysis->getNormalCtor()) { + Pass *P = Analysis->getNormalCtor()(); + Passes.add(P); + + if (BasicBlockPass *BBP = dynamic_cast(P)) + Passes.add(new BasicBlockPassPrinter(Analysis)); + else if (FunctionPass *FP = dynamic_cast(P)) + Passes.add(new FunctionPassPrinter(Analysis)); + else + Passes.add(new ModulePassPrinter(Analysis)); + + } else + std::cerr << argv[0] << ": cannot create pass: " + << Analysis->getPassName() << "\n"; + } + + Passes.run(*CurMod); + + delete CurMod; + return 0; + } + // Allocate a full target machine description only if necessary... // FIXME: The choice of target should be controllable on the command line. std::auto_ptr target; @@ -169,6 +312,7 @@ Passes.run(*M.get()); return 0; + } catch (const std::string& msg) { std::cerr << argv[0] << ": " << msg << "\n"; } catch (...) { From reid at x10sys.com Fri Aug 18 01:34:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 01:34:56 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll arraytest.ll badcases.ll basictest.ll fieldmerge.ll goodcases.ll indcalltest.ll misctests.ll physicalsubtype.ll recursion.ll simplest-test.ll simpletest.ll structpadding.ll Message-ID: <200608180634.k7I6YuBL005501@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DSAnalysis: arraymerge.ll updated: 1.2 -> 1.3 arraytest.ll updated: 1.2 -> 1.3 badcases.ll updated: 1.2 -> 1.3 basictest.ll updated: 1.2 -> 1.3 fieldmerge.ll updated: 1.2 -> 1.3 goodcases.ll updated: 1.2 -> 1.3 indcalltest.ll updated: 1.2 -> 1.3 misctests.ll updated: 1.2 -> 1.3 physicalsubtype.ll updated: 1.2 -> 1.3 recursion.ll updated: 1.2 -> 1.3 simplest-test.ll updated: 1.2 -> 1.3 simpletest.ll updated: 1.2 -> 1.3 structpadding.ll updated: 1.2 -> 1.3 --- Log message: For PR872: http://llvm.org/PR872 : Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. --- Diffs of the changes: (+13 -13) arraymerge.ll | 2 +- arraytest.ll | 2 +- badcases.ll | 2 +- basictest.ll | 2 +- fieldmerge.ll | 2 +- goodcases.ll | 2 +- indcalltest.ll | 2 +- misctests.ll | 2 +- physicalsubtype.ll | 2 +- recursion.ll | 2 +- simplest-test.ll | 2 +- simpletest.ll | 2 +- structpadding.ll | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) Index: llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/arraymerge.ll Fri Aug 18 01:34:30 2006 @@ -2,7 +2,7 @@ ; folded completely away if possible. This is a very common case, so it should ; be efficient. ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure ; implementation Index: llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/arraytest.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure %crazy = type [2 x { [2 x sbyte], short } ] implementation Index: llvm/test/Regression/Transforms/DSAnalysis/badcases.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/badcases.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/badcases.ll Fri Aug 18 01:34:30 2006 @@ -1,6 +1,6 @@ ; This file contains a list of situations where node folding should happen... ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/basictest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/basictest.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/basictest.ll Fri Aug 18 01:34:30 2006 @@ -1,6 +1,6 @@ ; very simple test ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/fieldmerge.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure %str = type { int*, int* } Index: llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/goodcases.ll Fri Aug 18 01:34:30 2006 @@ -1,6 +1,6 @@ ; This file contains a list of cases where node folding should NOT happen ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure ; implementation Index: llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/indcalltest.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure %G = global int 2 ; [#uses=1] %H = global int* null Index: llvm/test/Regression/Transforms/DSAnalysis/misctests.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/misctests.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/misctests.ll Fri Aug 18 01:34:30 2006 @@ -1,5 +1,5 @@ ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure int* %test1(int *%A) { %R = getelementptr int* %A, long 1 Index: llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/physicalsubtype.ll Fri Aug 18 01:34:30 2006 @@ -1,6 +1,6 @@ ; A test for "physical subtyping" used in some C programs... ; -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure ; %ST = type { int, int* } ; "Subtype" %DT = type { int, int*, int } ; "derived type" Index: llvm/test/Regression/Transforms/DSAnalysis/recursion.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/recursion.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/recursion.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure implementation ; Functions: Index: llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/simplest-test.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure void %foo(int* %X) { store int 4, int* %X Index: llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/simpletest.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure implementation Index: llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll diff -u llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.2 llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.3 --- llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll:1.2 Fri Oct 3 13:42:25 2003 +++ llvm/test/Regression/Transforms/DSAnalysis/structpadding.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -tddatastructure +; RUN: opt -analyze %s -tddatastructure %str = type { int, int* } From reid at x10sys.com Fri Aug 18 01:34:55 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 01:34:55 -0500 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll Message-ID: <200608180634.k7I6Yt9P005469@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/Dominators: 2003-05-12-UnreachableCode.ll updated: 1.1 -> 1.2 --- Log message: For PR872: http://llvm.org/PR872 : Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. --- Diffs of the changes: (+1 -1) 2003-05-12-UnreachableCode.ll | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll diff -u llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll:1.1 llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll:1.2 --- llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll:1.1 Mon May 12 17:28:15 2003 +++ llvm/test/Regression/Analysis/Dominators/2003-05-12-UnreachableCode.ll Fri Aug 18 01:34:30 2006 @@ -1,4 +1,4 @@ -; RUN: analyze %s -domset -disable-verify +; RUN: opt -analyze %s -domset -disable-verify ; int %re_match_2() { ENTRY: From reid at x10sys.com Fri Aug 18 01:34:56 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 01:34:56 -0500 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200608180634.k7I6YuU8005506@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.50 -> 1.51 --- Log message: For PR872: http://llvm.org/PR872 : Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. --- Diffs of the changes: (+2 -3) Makefile | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.50 llvm/tools/Makefile:1.51 --- llvm/tools/Makefile:1.50 Wed Jul 26 15:19:06 2006 +++ llvm/tools/Makefile Fri Aug 18 01:34:30 2006 @@ -9,8 +9,7 @@ LEVEL := .. PARALLEL_DIRS := llvm-config llvm-as llvm-dis opt gccas llc llvm-link lli gccld\ - llvm-stub analyze llvm-extract llvm-nm llvm-prof llvm-ar \ - llvm-ranlib llvm-bcanalyzer llvmc llvm-ld llvm-db bugpoint \ - llvm2cpp + llvm-stub llvm-extract llvm-nm llvm-prof llvm-ar llvm-ranlib \ + llvm-bcanalyzer llvmc llvm-ld llvm-db bugpoint llvm2cpp include $(LEVEL)/Makefile.common From llvm at cs.uiuc.edu Fri Aug 18 01:35:15 2006 From: llvm at cs.uiuc.edu (LLVM) Date: Fri, 18 Aug 2006 01:35:15 -0500 Subject: [llvm-commits] CVS: llvm/tools/analyze/AnalysisWrappers.cpp GraphPrinters.cpp Makefile PrintSCC.cpp analyze.cpp Message-ID: <200608180635.k7I6ZFIU005574@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: AnalysisWrappers.cpp (r1.18) removed GraphPrinters.cpp (r1.11) removed Makefile (r1.34) removed PrintSCC.cpp (r1.14) removed analyze.cpp (r1.68) removed --- Log message: For PR872: http://llvm.org/PR872 : Shrinkify LLVM's footprint by removing the analyze tool and moving its functionality into the opt tool. THis eliminates one of the largest tools from LLVM and doesn't make opt much bigger because it already included most of the analysis passes. To get the old analyze functionality pass the -analyze option to opt. Note that the integeration here is dead simple. The "main" of analyze was just copied to opt and invoked if the -analyze option was given. There may be opportunities for further integration such as removing the distinction between transform passes and analysis passes. To use the analysis functionality, if you previously did this: analyze $FNAME -domset -disable-verify you would now do this: opt -analyze $FNAME -domset -disable-verify Pretty simple. --- Diffs of the changes: (+0 -0) 0 files changed From reid at x10sys.com Fri Aug 18 03:43:23 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 03:43:23 -0500 Subject: [llvm-commits] CVS: llvm/tools/gccas/gccas.cpp Message-ID: <200608180843.k7I8hNCS021555@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: gccas.cpp updated: 1.117 -> 1.118 --- Log message: For PR797: http://llvm.org/PR797 : Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. --- Diffs of the changes: (+3 -10) gccas.cpp | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) Index: llvm/tools/gccas/gccas.cpp diff -u llvm/tools/gccas/gccas.cpp:1.117 llvm/tools/gccas/gccas.cpp:1.118 --- llvm/tools/gccas/gccas.cpp:1.117 Mon Jul 3 11:46:03 2006 +++ llvm/tools/gccas/gccas.cpp Fri Aug 18 03:43:06 2006 @@ -137,17 +137,10 @@ " llvm .s -> .o assembler for GCC\n"); sys::PrintStackTraceOnErrorSignal(); - std::auto_ptr M; - try { - // Parse the file now... - M.reset(ParseAssemblyFile(InputFilename)); - } catch (const ParseException &E) { - std::cerr << argv[0] << ": " << E.getMessage() << "\n"; - return 1; - } - + ParseError Err; + std::auto_ptr M(ParseAssemblyFile(InputFilename,&Err)); if (M.get() == 0) { - std::cerr << argv[0] << ": assembly didn't read correctly.\n"; + std::cerr << argv[0] << ": " << Err.getMessage() << "\n"; return 1; } From reid at x10sys.com Fri Aug 18 03:43:27 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 03:43:27 -0500 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp Message-ID: <200608180843.k7I8hRih021594@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.cpp updated: 1.47 -> 1.48 --- Log message: For PR797: http://llvm.org/PR797 : Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. --- Diffs of the changes: (+4 -9) BugDriver.cpp | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) Index: llvm/tools/bugpoint/BugDriver.cpp diff -u llvm/tools/bugpoint/BugDriver.cpp:1.47 llvm/tools/bugpoint/BugDriver.cpp:1.48 --- llvm/tools/bugpoint/BugDriver.cpp:1.47 Tue Aug 15 11:40:49 2006 +++ llvm/tools/bugpoint/BugDriver.cpp Fri Aug 18 03:43:06 2006 @@ -73,15 +73,10 @@ /// return it, or return null if not possible. /// Module *llvm::ParseInputFile(const std::string &InputFilename) { - Module *Result = 0; - try { - Result = ParseBytecodeFile(InputFilename); - if (!Result && !(Result = ParseAssemblyFile(InputFilename))){ - std::cerr << "bugpoint: could not read input file '" - << InputFilename << "'!\n"; - } - } catch (const ParseException &E) { - std::cerr << "bugpoint: " << E.getMessage() << '\n'; + ParseError Err; + Module *Result = ParseBytecodeFile(InputFilename); + if (!Result && !(Result = ParseAssemblyFile(InputFilename,&Err))) { + std::cerr << "bugpoint: " << Err.getMessage() << "\n"; Result = 0; } return Result; From reid at x10sys.com Fri Aug 18 03:43:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 03:43:29 -0500 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200608180843.k7I8hTIj021603@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.111 -> 1.112 --- Log message: For PR797: http://llvm.org/PR797 : Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. --- Diffs of the changes: (+5 -9) opt.cpp | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.111 llvm/tools/opt/opt.cpp:1.112 --- llvm/tools/opt/opt.cpp:1.111 Fri Aug 18 01:34:30 2006 +++ llvm/tools/opt/opt.cpp Fri Aug 18 03:43:06 2006 @@ -169,17 +169,13 @@ if (AnalyzeOnly) { Module *CurMod = 0; - try { #if 0 - TimeRegion RegionTimer(BytecodeLoadTimer); + TimeRegion RegionTimer(BytecodeLoadTimer); #endif - CurMod = ParseBytecodeFile(InputFilename); - if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename))){ - std::cerr << argv[0] << ": input file didn't read correctly.\n"; - return 1; - } - } catch (const ParseException &E) { - std::cerr << argv[0] << ": " << E.getMessage() << "\n"; + CurMod = ParseBytecodeFile(InputFilename); + ParseError Err; + if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename,&Err))){ + std::cerr << argv[0] << ": " << Err.getMessage() << "\n"; return 1; } From reid at x10sys.com Fri Aug 18 03:43:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 03:43:29 -0500 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/Parser.h Message-ID: <200608180843.k7I8hTFD021600@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: Parser.h updated: 1.12 -> 1.13 --- Log message: For PR797: http://llvm.org/PR797 : Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. --- Diffs of the changes: (+35 -17) Parser.h | 52 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 35 insertions(+), 17 deletions(-) Index: llvm/include/llvm/Assembly/Parser.h diff -u llvm/include/llvm/Assembly/Parser.h:1.12 llvm/include/llvm/Assembly/Parser.h:1.13 --- llvm/include/llvm/Assembly/Parser.h:1.12 Thu May 19 22:25:29 2005 +++ llvm/include/llvm/Assembly/Parser.h Fri Aug 18 03:43:06 2006 @@ -19,30 +19,45 @@ namespace llvm { class Module; -class ParseException; +class ParseError; -// The useful interface defined by this file... Parse an ascii file, and return -// the internal representation in a nice slice'n'dice'able representation. Note -// that this does not verify that the generated LLVM is valid, so you should run -// the verifier after parsing the file to check that it's ok. -// -Module *ParseAssemblyFile(const std::string &Filename);// throw (ParseException) -Module *ParseAssemblyString(const char * AsmString, Module * M);// throw (ParseException) +/// This function is the main interface to the LLVM Assembly Parse. It parses +/// an ascii file that (presumably) contains LLVM Assembly code. It returns a +/// Module (intermediate representation) with the corresponding features. Note +/// that this does not verify that the generated Module is valid, so you should +/// run the verifier after parsing the file to check that it is okay. +/// @brief Parse LLVM Assembly from a file +Module *ParseAssemblyFile( + const std::string &Filename, ///< The name of the file to parse + ParseError* Error = 0 ///< If not null, an object to return errors in. +); + +/// The function is a secondary interface to the LLVM Assembly Parse. It parses +/// an ascii string that (presumably) contains LLVM Assembly code. It returns a +/// Module (intermediate representation) with the corresponding features. Note +/// that this does not verify that the generated Module is valid, so you should +/// run the verifier after parsing the file to check that it is okay. +/// @brief Parse LLVM Assembly from a string +Module *ParseAssemblyString( + const char * AsmString, ///< The string containing assembly + Module * M, ///< A module to add the assembly too. + ParseError* Error = 0 ///< If not null, an object to return errors in. +); //===------------------------------------------------------------------------=== // Helper Classes //===------------------------------------------------------------------------=== -// ParseException - For when an exceptional event is generated by the parser. -// This class lets you print out the exception message -// -class ParseException { +/// An instance of this class can be passed to ParseAssemblyFile or +/// ParseAssemblyString functions in order to capture error information from +/// the parser. It provides a standard way to print out the error message +/// including the file name and line number where the error occurred. +/// @brief An LLVM Assembly Parsing Error Object +class ParseError { public: - ParseException(const std::string &filename, const std::string &message, - int LineNo = -1, int ColNo = -1); - - ParseException(const ParseException &E); + ParseError() : Filename("unknown"), Message("none"), LineNo(0), ColumnNo(0) {} + ParseError(const ParseError &E); // getMessage - Return the message passed in at construction time plus extra // information extracted from the options used to parse with... @@ -57,6 +72,9 @@ return Filename; } + void setError(const std::string &filename, const std::string &message, + int LineNo = -1, int ColNo = -1); + // getErrorLocation - Return the line and column number of the error in the // input source file. The source filename can be derived from the // ParserOptions in effect. If positional information is not applicable, @@ -71,7 +89,7 @@ std::string Message; int LineNo, ColumnNo; // -1 if not relevant - ParseException &operator=(const ParseException &E); // objects by reference + ParseError &operator=(const ParseError &E); // objects by reference }; } // End llvm namespace From reid at x10sys.com Fri Aug 18 03:43:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 03:43:29 -0500 Subject: [llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp Message-ID: <200608180843.k7I8hTF1021608@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.46 -> 1.47 --- Log message: For PR797: http://llvm.org/PR797 : Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. --- Diffs of the changes: (+3 -5) llvm-as.cpp | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.46 llvm/tools/llvm-as/llvm-as.cpp:1.47 --- llvm/tools/llvm-as/llvm-as.cpp:1.46 Thu Jul 6 13:01:01 2006 +++ llvm/tools/llvm-as/llvm-as.cpp Fri Aug 18 03:43:06 2006 @@ -57,9 +57,10 @@ std::ostream *Out = 0; try { // Parse the file now... - std::auto_ptr M(ParseAssemblyFile(InputFilename)); + ParseError Err; + std::auto_ptr M(ParseAssemblyFile(InputFilename,&Err)); if (M.get() == 0) { - std::cerr << argv[0] << ": assembly didn't read correctly.\n"; + std::cerr << argv[0] << ": " << Err.getMessage() << "\n"; return 1; } @@ -129,9 +130,6 @@ if (Force || !CheckBytecodeOutputToConsole(Out,true)) { WriteBytecodeToFile(M.get(), *Out, !NoCompress); } - } catch (const ParseException &E) { - std::cerr << argv[0] << ": " << E.getMessage() << "\n"; - exitCode = 1; } catch (const std::string& msg) { std::cerr << argv[0] << ": " << msg << "\n"; exitCode = 1; From reid at x10sys.com Fri Aug 18 03:43:29 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 03:43:29 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs Lexer.l Lexer.l.cvs Parser.cpp ParserInternals.h llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200608180843.k7I8hTl4021631@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.cpp.cvs updated: 1.5 -> 1.6 Lexer.l updated: 1.74 -> 1.75 Lexer.l.cvs updated: 1.4 -> 1.5 Parser.cpp updated: 1.16 -> 1.17 ParserInternals.h updated: 1.43 -> 1.44 llvmAsmParser.cpp.cvs updated: 1.7 -> 1.8 llvmAsmParser.h.cvs updated: 1.3 -> 1.4 llvmAsmParser.y updated: 1.255 -> 1.256 llvmAsmParser.y.cvs updated: 1.7 -> 1.8 --- Log message: For PR797: http://llvm.org/PR797 : Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. --- Diffs of the changes: (+4734 -3261) Lexer.cpp.cvs | 274 +- Lexer.l | 13 Lexer.l.cvs | 13 Parser.cpp | 48 ParserInternals.h | 14 llvmAsmParser.cpp.cvs | 6413 ++++++++++++++++++++++++++++---------------------- llvmAsmParser.h.cvs | 352 +- llvmAsmParser.y | 421 ++- llvmAsmParser.y.cvs | 421 ++- 9 files changed, 4734 insertions(+), 3235 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp.cvs diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.5 llvm/lib/AsmParser/Lexer.cpp.cvs:1.6 --- llvm/lib/AsmParser/Lexer.cpp.cvs:1.5 Fri May 19 16:28:53 2006 +++ llvm/lib/AsmParser/Lexer.cpp.cvs Fri Aug 18 03:43:06 2006 @@ -17,10 +17,10 @@ #define yylineno llvmAsmlineno #line 20 "Lexer.cpp" -/* A lexical scanner generated by flex */ +/* A lexical scanner generated by flex*/ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.5 2006/05/19 21:28:53 lattner Exp $ + * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.6 2006/08/18 08:43:06 reid Exp $ */ #define FLEX_SCANNER @@ -28,6 +28,7 @@ #define YY_FLEX_MINOR_VERSION 5 #include +#include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -41,7 +42,6 @@ #ifdef __cplusplus #include -#include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -153,6 +153,15 @@ #define unput(c) yyunput( c, yytext_ptr ) +/* Some routines like yy_flex_realloc() are emitted as static but are + not called by all lexers. This generates warnings in some compilers, + notably GCC. Arrange to suppress these. */ +#ifdef __GNUC__ +#define YY_MAY_BE_UNUSED __attribute__((unused)) +#else +#define YY_MAY_BE_UNUSED +#endif + /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). @@ -259,7 +268,7 @@ YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer @@ -783,7 +792,7 @@ #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 1 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" #define INITIAL 0 /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// // @@ -798,7 +807,7 @@ // //===----------------------------------------------------------------------===*/ #define YY_NEVER_INTERACTIVE 1 -#line 28 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 28 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" #include "ParserInternals.h" #include "llvm/Module.h" #include @@ -833,7 +842,7 @@ Result *= 10; Result += *Buffer-'0'; if (Result < OldRes) // Uh, oh, overflow detected!!! - ThrowException("constant bigger than 64 bits detected!"); + GenerateError("constant bigger than 64 bits detected!"); } return Result; } @@ -852,7 +861,7 @@ Result += C-'a'+10; if (Result < OldRes) // Uh, oh, overflow detected!!! - ThrowException("constant bigger than 64 bits detected!"); + GenerateError("constant bigger than 64 bits detected!"); } return Result; } @@ -890,7 +899,7 @@ char Tmp = BIn[3]; BIn[3] = 0; // Terminate string *BOut = (char)strtol(BIn+1, 0, 16); // Convert to number if (!AllowNull && !*BOut) - ThrowException("String literal cannot accept \\00 escape!"); + GenerateError("String literal cannot accept \\00 escape!"); BIn[3] = Tmp; // Restore character BIn += 3; // Skip over handled chars @@ -924,7 +933,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 928 "Lexer.cpp" +#line 937 "Lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1072,13 +1081,13 @@ YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; + register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; -#line 179 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 179 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" -#line 1082 "Lexer.cpp" +#line 1091 "Lexer.cpp" if ( yy_init ) { @@ -1171,477 +1180,477 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 181 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 181 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 183 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 183 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 184 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 184 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 185 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 185 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 186 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 186 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 187 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 187 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 188 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 188 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 8: YY_RULE_SETUP -#line 189 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 189 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 9: YY_RULE_SETUP -#line 190 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 190 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 10: YY_RULE_SETUP -#line 191 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 191 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 11: YY_RULE_SETUP -#line 192 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 192 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 12: YY_RULE_SETUP -#line 193 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 193 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 13: YY_RULE_SETUP -#line 194 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 194 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return EXTERNAL; } /* Deprecated, turn into external */ YY_BREAK case 14: YY_RULE_SETUP -#line 195 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 195 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return EXTERNAL; } YY_BREAK case 15: YY_RULE_SETUP -#line 196 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 196 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return IMPLEMENTATION; } YY_BREAK case 16: YY_RULE_SETUP -#line 197 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 197 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return ZEROINITIALIZER; } YY_BREAK case 17: YY_RULE_SETUP -#line 198 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 198 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return DOTDOTDOT; } YY_BREAK case 18: YY_RULE_SETUP -#line 199 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 199 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return UNDEF; } YY_BREAK case 19: YY_RULE_SETUP -#line 200 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 200 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return NULL_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 201 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 201 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return TO; } YY_BREAK case 21: YY_RULE_SETUP -#line 202 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 202 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 22: YY_RULE_SETUP -#line 203 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 203 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return NOT; } /* Deprecated, turned into XOR */ YY_BREAK case 23: YY_RULE_SETUP -#line 204 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 204 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return TAIL; } YY_BREAK case 24: YY_RULE_SETUP -#line 205 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 205 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return TARGET; } YY_BREAK case 25: YY_RULE_SETUP -#line 206 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 206 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return TRIPLE; } YY_BREAK case 26: YY_RULE_SETUP -#line 207 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 207 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return DEPLIBS; } YY_BREAK case 27: YY_RULE_SETUP -#line 208 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 208 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return ENDIAN; } YY_BREAK case 28: YY_RULE_SETUP -#line 209 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 209 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return POINTERSIZE; } YY_BREAK case 29: YY_RULE_SETUP -#line 210 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 210 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return LITTLE; } YY_BREAK case 30: YY_RULE_SETUP -#line 211 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 211 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return BIG; } YY_BREAK case 31: YY_RULE_SETUP -#line 212 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 212 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return VOLATILE; } YY_BREAK case 32: YY_RULE_SETUP -#line 213 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 213 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return ALIGN; } YY_BREAK case 33: YY_RULE_SETUP -#line 214 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 214 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return SECTION; } YY_BREAK case 34: YY_RULE_SETUP -#line 215 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 215 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return MODULE; } YY_BREAK case 35: YY_RULE_SETUP -#line 216 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 216 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return ASM_TOK; } YY_BREAK case 36: YY_RULE_SETUP -#line 217 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 217 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return SIDEEFFECT; } YY_BREAK case 37: YY_RULE_SETUP -#line 219 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 219 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return CC_TOK; } YY_BREAK case 38: YY_RULE_SETUP -#line 220 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 220 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return CCC_TOK; } YY_BREAK case 39: YY_RULE_SETUP -#line 221 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 221 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return CSRETCC_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 222 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 222 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return FASTCC_TOK; } YY_BREAK case 41: YY_RULE_SETUP -#line 223 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 223 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return COLDCC_TOK; } YY_BREAK case 42: YY_RULE_SETUP -#line 225 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 225 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::VoidTy ; return VOID; } YY_BREAK case 43: YY_RULE_SETUP -#line 226 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 226 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::BoolTy ; return BOOL; } YY_BREAK case 44: YY_RULE_SETUP -#line 227 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 227 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::SByteTy ; return SBYTE; } YY_BREAK case 45: YY_RULE_SETUP -#line 228 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 228 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::UByteTy ; return UBYTE; } YY_BREAK case 46: YY_RULE_SETUP -#line 229 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 229 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::ShortTy ; return SHORT; } YY_BREAK case 47: YY_RULE_SETUP -#line 230 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 230 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::UShortTy; return USHORT; } YY_BREAK case 48: YY_RULE_SETUP -#line 231 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 231 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::IntTy ; return INT; } YY_BREAK case 49: YY_RULE_SETUP -#line 232 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 232 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::UIntTy ; return UINT; } YY_BREAK case 50: YY_RULE_SETUP -#line 233 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 233 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::LongTy ; return LONG; } YY_BREAK case 51: YY_RULE_SETUP -#line 234 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 234 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::ULongTy ; return ULONG; } YY_BREAK case 52: YY_RULE_SETUP -#line 235 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 235 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::FloatTy ; return FLOAT; } YY_BREAK case 53: YY_RULE_SETUP -#line 236 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 236 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::DoubleTy; return DOUBLE; } YY_BREAK case 54: YY_RULE_SETUP -#line 237 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 237 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::LabelTy ; return LABEL; } YY_BREAK case 55: YY_RULE_SETUP -#line 238 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 238 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return TYPE; } YY_BREAK case 56: YY_RULE_SETUP -#line 239 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 239 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return OPAQUE; } YY_BREAK case 57: YY_RULE_SETUP -#line 241 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 241 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK case 58: YY_RULE_SETUP -#line 242 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 242 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK case 59: YY_RULE_SETUP -#line 243 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 243 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK case 60: YY_RULE_SETUP -#line 244 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 244 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Div, DIV); } YY_BREAK case 61: YY_RULE_SETUP -#line 245 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 245 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Rem, REM); } YY_BREAK case 62: YY_RULE_SETUP -#line 246 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 246 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, And, AND); } YY_BREAK case 63: YY_RULE_SETUP -#line 247 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 247 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK case 64: YY_RULE_SETUP -#line 248 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 248 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK case 65: YY_RULE_SETUP -#line 249 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 249 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetNE, SETNE); } YY_BREAK case 66: YY_RULE_SETUP -#line 250 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 250 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetEQ, SETEQ); } YY_BREAK case 67: YY_RULE_SETUP -#line 251 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 251 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetLT, SETLT); } YY_BREAK case 68: YY_RULE_SETUP -#line 252 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 252 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetGT, SETGT); } YY_BREAK case 69: YY_RULE_SETUP -#line 253 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 253 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetLE, SETLE); } YY_BREAK case 70: YY_RULE_SETUP -#line 254 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 254 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetGE, SETGE); } YY_BREAK case 71: YY_RULE_SETUP -#line 256 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 256 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK case 72: YY_RULE_SETUP -#line 257 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 257 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK case 73: YY_RULE_SETUP -#line 258 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 258 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Cast, CAST); } YY_BREAK case 74: YY_RULE_SETUP -#line 259 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 259 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK case 75: YY_RULE_SETUP -#line 260 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 260 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Shl, SHL); } YY_BREAK case 76: YY_RULE_SETUP -#line 261 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 261 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Shr, SHR); } YY_BREAK case 77: YY_RULE_SETUP -#line 262 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 262 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return VANEXT_old; } YY_BREAK case 78: YY_RULE_SETUP -#line 263 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 263 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return VAARG_old; } YY_BREAK case 79: YY_RULE_SETUP -#line 264 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 264 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK case 80: YY_RULE_SETUP -#line 265 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 265 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Ret, RET); } YY_BREAK case 81: YY_RULE_SETUP -#line 266 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 266 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Br, BR); } YY_BREAK case 82: YY_RULE_SETUP -#line 267 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 267 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Switch, SWITCH); } YY_BREAK case 83: YY_RULE_SETUP -#line 268 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 268 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Invoke, INVOKE); } YY_BREAK case 84: YY_RULE_SETUP -#line 269 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 269 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 85: YY_RULE_SETUP -#line 270 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 270 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } YY_BREAK case 86: YY_RULE_SETUP -#line 272 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 272 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Malloc, MALLOC); } YY_BREAK case 87: YY_RULE_SETUP -#line 273 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 273 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Alloca, ALLOCA); } YY_BREAK case 88: YY_RULE_SETUP -#line 274 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 274 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Free, FREE); } YY_BREAK case 89: YY_RULE_SETUP -#line 275 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 275 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Load, LOAD); } YY_BREAK case 90: YY_RULE_SETUP -#line 276 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 276 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Store, STORE); } YY_BREAK case 91: YY_RULE_SETUP -#line 277 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 277 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } YY_BREAK case 92: YY_RULE_SETUP -#line 279 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 279 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } YY_BREAK case 93: YY_RULE_SETUP -#line 280 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 280 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } YY_BREAK case 94: YY_RULE_SETUP -#line 281 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 281 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } YY_BREAK case 95: YY_RULE_SETUP -#line 284 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 284 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { UnEscapeLexed(yytext+1); llvmAsmlval.StrVal = strdup(yytext+1); // Skip % @@ -1650,7 +1659,7 @@ YY_BREAK case 96: YY_RULE_SETUP -#line 289 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 289 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-1] = 0; // nuke colon UnEscapeLexed(yytext); @@ -1660,7 +1669,7 @@ YY_BREAK case 97: YY_RULE_SETUP -#line 295 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 295 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-2] = 0; // nuke colon, end quote UnEscapeLexed(yytext+1); @@ -1670,7 +1679,7 @@ YY_BREAK case 98: YY_RULE_SETUP -#line 302 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 302 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a @@ -1683,24 +1692,24 @@ YY_BREAK case 99: YY_RULE_SETUP -#line 313 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 313 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; } YY_BREAK case 100: YY_RULE_SETUP -#line 314 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 314 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range if (Val > (uint64_t)INT64_MAX+1) - ThrowException("Constant too large for signed 64 bits!"); + GenerateError("Constant too large for signed 64 bits!"); llvmAsmlval.SInt64Val = -Val; return ESINT64VAL; } YY_BREAK case 101: YY_RULE_SETUP -#line 322 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 322 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = HexIntToVal(yytext+3); return yytext[0] == 's' ? ESINT64VAL : EUINT64VAL; @@ -1708,39 +1717,39 @@ YY_BREAK case 102: YY_RULE_SETUP -#line 327 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 327 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) - ThrowException("Invalid value number (too large)!"); + GenerateError("Invalid value number (too large)!"); llvmAsmlval.UIntVal = unsigned(Val); return UINTVAL; } YY_BREAK case 103: YY_RULE_SETUP -#line 334 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 334 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range if (Val > (uint64_t)INT32_MAX+1) - ThrowException("Constant too large for signed 32 bits!"); + GenerateError("Constant too large for signed 32 bits!"); llvmAsmlval.SIntVal = (int)-Val; return SINTVAL; } YY_BREAK case 104: YY_RULE_SETUP -#line 343 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 343 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 344 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 344 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 346 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 346 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! @@ -1751,20 +1760,20 @@ YY_BREAK case 106: YY_RULE_SETUP -#line 354 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 354 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK case 107: YY_RULE_SETUP -#line 355 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 355 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" { return yytext[0]; } YY_BREAK case 108: YY_RULE_SETUP -#line 357 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" +#line 357 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1768 "Lexer.cpp" +#line 1777 "Lexer.cpp" case YY_END_OF_BUFFER: { @@ -2140,6 +2149,7 @@ #endif /* ifndef YY_NO_UNPUT */ +#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -2186,7 +2196,7 @@ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) - return 0; + return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; @@ -2213,7 +2223,7 @@ return c; } - +#endif /* YY_NO_INPUT */ #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) @@ -2324,11 +2334,6 @@ } -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) @@ -2646,6 +2651,5 @@ return 0; } #endif -#line 357 "/Volumes/Projects/cvs/llvm/lib/AsmParser/Lexer.l" - +#line 357 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" Index: llvm/lib/AsmParser/Lexer.l diff -u llvm/lib/AsmParser/Lexer.l:1.74 llvm/lib/AsmParser/Lexer.l:1.75 --- llvm/lib/AsmParser/Lexer.l:1.74 Fri May 19 16:28:34 2006 +++ llvm/lib/AsmParser/Lexer.l Fri Aug 18 03:43:06 2006 @@ -59,7 +59,7 @@ Result *= 10; Result += *Buffer-'0'; if (Result < OldRes) // Uh, oh, overflow detected!!! - ThrowException("constant bigger than 64 bits detected!"); + GenerateError("constant bigger than 64 bits detected!"); } return Result; } @@ -78,7 +78,7 @@ Result += C-'a'+10; if (Result < OldRes) // Uh, oh, overflow detected!!! - ThrowException("constant bigger than 64 bits detected!"); + GenerateError("constant bigger than 64 bits detected!"); } return Result; } @@ -116,7 +116,7 @@ char Tmp = BIn[3]; BIn[3] = 0; // Terminate string *BOut = (char)strtol(BIn+1, 0, 16); // Convert to number if (!AllowNull && !*BOut) - ThrowException("String literal cannot accept \\00 escape!"); + GenerateError("String literal cannot accept \\00 escape!"); BIn[3] = Tmp; // Restore character BIn += 3; // Skip over handled chars @@ -315,7 +315,7 @@ uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range if (Val > (uint64_t)INT64_MAX+1) - ThrowException("Constant too large for signed 64 bits!"); + GenerateError("Constant too large for signed 64 bits!"); llvmAsmlval.SInt64Val = -Val; return ESINT64VAL; } @@ -327,7 +327,7 @@ {EPInteger} { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) - ThrowException("Invalid value number (too large)!"); + GenerateError("Invalid value number (too large)!"); llvmAsmlval.UIntVal = unsigned(Val); return UINTVAL; } @@ -335,7 +335,7 @@ uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range if (Val > (uint64_t)INT32_MAX+1) - ThrowException("Constant too large for signed 32 bits!"); + GenerateError("Constant too large for signed 32 bits!"); llvmAsmlval.SIntVal = (int)-Val; return SINTVAL; } @@ -355,4 +355,3 @@ . { return yytext[0]; } %% - Index: llvm/lib/AsmParser/Lexer.l.cvs diff -u llvm/lib/AsmParser/Lexer.l.cvs:1.4 llvm/lib/AsmParser/Lexer.l.cvs:1.5 --- llvm/lib/AsmParser/Lexer.l.cvs:1.4 Fri May 19 16:28:53 2006 +++ llvm/lib/AsmParser/Lexer.l.cvs Fri Aug 18 03:43:06 2006 @@ -59,7 +59,7 @@ Result *= 10; Result += *Buffer-'0'; if (Result < OldRes) // Uh, oh, overflow detected!!! - ThrowException("constant bigger than 64 bits detected!"); + GenerateError("constant bigger than 64 bits detected!"); } return Result; } @@ -78,7 +78,7 @@ Result += C-'a'+10; if (Result < OldRes) // Uh, oh, overflow detected!!! - ThrowException("constant bigger than 64 bits detected!"); + GenerateError("constant bigger than 64 bits detected!"); } return Result; } @@ -116,7 +116,7 @@ char Tmp = BIn[3]; BIn[3] = 0; // Terminate string *BOut = (char)strtol(BIn+1, 0, 16); // Convert to number if (!AllowNull && !*BOut) - ThrowException("String literal cannot accept \\00 escape!"); + GenerateError("String literal cannot accept \\00 escape!"); BIn[3] = Tmp; // Restore character BIn += 3; // Skip over handled chars @@ -315,7 +315,7 @@ uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range if (Val > (uint64_t)INT64_MAX+1) - ThrowException("Constant too large for signed 64 bits!"); + GenerateError("Constant too large for signed 64 bits!"); llvmAsmlval.SInt64Val = -Val; return ESINT64VAL; } @@ -327,7 +327,7 @@ {EPInteger} { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) - ThrowException("Invalid value number (too large)!"); + GenerateError("Invalid value number (too large)!"); llvmAsmlval.UIntVal = unsigned(Val); return UINTVAL; } @@ -335,7 +335,7 @@ uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range if (Val > (uint64_t)INT32_MAX+1) - ThrowException("Constant too large for signed 32 bits!"); + GenerateError("Constant too large for signed 32 bits!"); llvmAsmlval.SIntVal = (int)-Val; return SINTVAL; } @@ -355,4 +355,3 @@ . { return yytext[0]; } %% - Index: llvm/lib/AsmParser/Parser.cpp diff -u llvm/lib/AsmParser/Parser.cpp:1.16 llvm/lib/AsmParser/Parser.cpp:1.17 --- llvm/lib/AsmParser/Parser.cpp:1.16 Thu May 19 22:25:47 2005 +++ llvm/lib/AsmParser/Parser.cpp Fri Aug 18 03:43:06 2006 @@ -15,26 +15,24 @@ #include "llvm/Module.h" using namespace llvm; -// The useful interface defined by this file... Parse an ASCII file, and return -// the internal representation in a nice slice'n'dice'able representation. -// -Module *llvm::ParseAssemblyFile(const std::string &Filename) { + +ParseError* TheParseError = 0; /// FIXME: Not threading friendly + +Module *llvm::ParseAssemblyFile(const std::string &Filename, ParseError* Err) { FILE *F = stdin; if (Filename != "-") { F = fopen(Filename.c_str(), "r"); - if (F == 0) - throw ParseException(Filename, "Could not open file '" + Filename + "'"); + if (F == 0) { + if (Err) + Err->setError(Filename,"Could not open file '" + Filename + "'"); + return 0; + } } - Module *Result; - try { - Result = RunVMAsmParser(Filename, F); - } catch (...) { - if (F != stdin) fclose(F); // Make sure to close file descriptor if an - throw; // exception is thrown - } + TheParseError = Err; + Module *Result = RunVMAsmParser(Filename, F); if (F != stdin) fclose(F); @@ -42,31 +40,37 @@ return Result; } -Module *llvm::ParseAssemblyString(const char * AsmString, Module * M) { +Module *llvm::ParseAssemblyString( + const char * AsmString, Module * M, ParseError* Err) +{ + TheParseError = Err; return RunVMAsmParser(AsmString, M); } //===------------------------------------------------------------------------=== -// ParseException Class +// ParseError Class //===------------------------------------------------------------------------=== -ParseException::ParseException(const std::string &filename, - const std::string &message, - int lineNo, int colNo) - : Filename(filename), Message(message) { - LineNo = lineNo; ColumnNo = colNo; +void ParseError::setError(const std::string &filename, + const std::string &message, + int lineNo, int colNo) +{ + Filename = filename; + Message = message; + LineNo = lineNo; + colNo = colNo; } -ParseException::ParseException(const ParseException &E) +ParseError::ParseError(const ParseError &E) : Filename(E.Filename), Message(E.Message) { LineNo = E.LineNo; ColumnNo = E.ColumnNo; } // Includes info from options -const std::string ParseException::getMessage() const { +const std::string ParseError::getMessage() const { std::string Result; char Buffer[10]; Index: llvm/lib/AsmParser/ParserInternals.h diff -u llvm/lib/AsmParser/ParserInternals.h:1.43 llvm/lib/AsmParser/ParserInternals.h:1.44 --- llvm/lib/AsmParser/ParserInternals.h:1.43 Wed Jan 25 16:26:43 2006 +++ llvm/lib/AsmParser/ParserInternals.h Fri Aug 18 03:43:06 2006 @@ -25,7 +25,8 @@ // Global variables exported from the lexer... -extern int llvmAsmlineno; +extern int llvmAsmlineno; /// FIXME: Not threading friendly +extern llvm::ParseError* TheParseError; /// FIXME: Not threading friendly extern std::string &llvmAsmTextin; @@ -40,7 +41,7 @@ namespace llvm { // Globals exported by the parser... -extern std::string CurFilename; +extern std::string CurFilename; /// FIXME: Not threading friendly class Module; Module *RunVMAsmParser(const std::string &Filename, FILE *F); @@ -51,7 +52,7 @@ // UnEscapeLexed - Run through the specified buffer and change \xx codes to the // appropriate character. If AllowNull is set to false, a \00 value will cause -// an exception to be thrown. +// an error. // // If AllowNull is set to true, the return value of the function points to the // last character of the string in memory. @@ -65,12 +66,7 @@ // This also helps me because I keep typing 'throw new ParseException' instead // of just 'throw ParseException'... sigh... // -static inline void ThrowException(const std::string &message, - int LineNo = -1) { - if (LineNo == -1) LineNo = llvmAsmlineno; - // TODO: column number in exception - throw ParseException(CurFilename, message, LineNo); -} +extern void GenerateError(const std::string &message, int LineNo = -1); /// InlineAsmDescriptor - This is a simple class that holds info about inline /// asm blocks, for use by ValID. Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.7 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.8 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.7 Wed Jun 21 11:53:00 2006 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Fri Aug 18 03:43:06 2006 @@ -1,118 +1,278 @@ +/* A Bison parser, made by GNU Bison 2.1. */ -/* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y - by GNU Bison version 1.28 */ +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -#define YYBISON 1 /* Identify Bison output. */ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Written by Richard Stallman by simplifying the original so called + ``semantic'' parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 +/* Substitute the variable and function names. */ #define yyparse llvmAsmparse -#define yylex llvmAsmlex +#define yylex llvmAsmlex #define yyerror llvmAsmerror -#define yylval llvmAsmlval -#define yychar llvmAsmchar +#define yylval llvmAsmlval +#define yychar llvmAsmchar #define yydebug llvmAsmdebug #define yynerrs llvmAsmnerrs -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define SINTVAL 259 -#define UINTVAL 260 -#define FPVAL 261 -#define VOID 262 -#define BOOL 263 -#define SBYTE 264 -#define UBYTE 265 -#define SHORT 266 -#define USHORT 267 -#define INT 268 -#define UINT 269 -#define LONG 270 -#define ULONG 271 -#define FLOAT 272 -#define DOUBLE 273 -#define TYPE 274 -#define LABEL 275 -#define VAR_ID 276 -#define LABELSTR 277 -#define STRINGCONSTANT 278 -#define IMPLEMENTATION 279 -#define ZEROINITIALIZER 280 -#define TRUETOK 281 -#define FALSETOK 282 -#define BEGINTOK 283 -#define ENDTOK 284 -#define DECLARE 285 -#define GLOBAL 286 -#define CONSTANT 287 -#define SECTION 288 -#define VOLATILE 289 -#define TO 290 -#define DOTDOTDOT 291 -#define NULL_TOK 292 -#define UNDEF 293 -#define CONST 294 -#define INTERNAL 295 -#define LINKONCE 296 -#define WEAK 297 -#define APPENDING 298 -#define OPAQUE 299 -#define NOT 300 -#define EXTERNAL 301 -#define TARGET 302 -#define TRIPLE 303 -#define ENDIAN 304 -#define POINTERSIZE 305 -#define LITTLE 306 -#define BIG 307 -#define ALIGN 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 CSRETCC_TOK 317 -#define FASTCC_TOK 318 -#define COLDCC_TOK 319 -#define RET 320 -#define BR 321 -#define SWITCH 322 -#define INVOKE 323 -#define UNWIND 324 -#define UNREACHABLE 325 -#define ADD 326 -#define SUB 327 -#define MUL 328 -#define DIV 329 -#define REM 330 -#define AND 331 -#define OR 332 -#define XOR 333 -#define SETLE 334 -#define SETGE 335 -#define SETLT 336 -#define SETGT 337 -#define SETEQ 338 -#define SETNE 339 -#define MALLOC 340 -#define ALLOCA 341 -#define FREE 342 -#define LOAD 343 -#define STORE 344 -#define GETELEMENTPTR 345 -#define PHI_TOK 346 -#define CAST 347 -#define SELECT 348 -#define SHL 349 -#define SHR 350 -#define VAARG 351 -#define EXTRACTELEMENT 352 -#define INSERTELEMENT 353 -#define SHUFFLEVECTOR 354 -#define VAARG_old 355 -#define VANEXT_old 356 -#line 14 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + OPAQUE = 300, + NOT = 301, + EXTERNAL = 302, + TARGET = 303, + TRIPLE = 304, + ENDIAN = 305, + POINTERSIZE = 306, + LITTLE = 307, + BIG = 308, + ALIGN = 309, + DEPLIBS = 310, + CALL = 311, + TAIL = 312, + ASM_TOK = 313, + MODULE = 314, + SIDEEFFECT = 315, + CC_TOK = 316, + CCC_TOK = 317, + CSRETCC_TOK = 318, + FASTCC_TOK = 319, + COLDCC_TOK = 320, + RET = 321, + BR = 322, + SWITCH = 323, + INVOKE = 324, + UNWIND = 325, + UNREACHABLE = 326, + ADD = 327, + SUB = 328, + MUL = 329, + DIV = 330, + REM = 331, + AND = 332, + OR = 333, + XOR = 334, + SETLE = 335, + SETGE = 336, + SETLT = 337, + SETGT = 338, + SETEQ = 339, + SETNE = 340, + MALLOC = 341, + ALLOCA = 342, + FREE = 343, + LOAD = 344, + STORE = 345, + GETELEMENTPTR = 346, + PHI_TOK = 347, + CAST = 348, + SELECT = 349, + SHL = 350, + SHR = 351, + VAARG = 352, + EXTRACTELEMENT = 353, + INSERTELEMENT = 354, + SHUFFLEVECTOR = 355, + VAARG_old = 356, + VANEXT_old = 357 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define SINTVAL 260 +#define UINTVAL 261 +#define FPVAL 262 +#define VOID 263 +#define BOOL 264 +#define SBYTE 265 +#define UBYTE 266 +#define SHORT 267 +#define USHORT 268 +#define INT 269 +#define UINT 270 +#define LONG 271 +#define ULONG 272 +#define FLOAT 273 +#define DOUBLE 274 +#define TYPE 275 +#define LABEL 276 +#define VAR_ID 277 +#define LABELSTR 278 +#define STRINGCONSTANT 279 +#define IMPLEMENTATION 280 +#define ZEROINITIALIZER 281 +#define TRUETOK 282 +#define FALSETOK 283 +#define BEGINTOK 284 +#define ENDTOK 285 +#define DECLARE 286 +#define GLOBAL 287 +#define CONSTANT 288 +#define SECTION 289 +#define VOLATILE 290 +#define TO 291 +#define DOTDOTDOT 292 +#define NULL_TOK 293 +#define UNDEF 294 +#define CONST 295 +#define INTERNAL 296 +#define LINKONCE 297 +#define WEAK 298 +#define APPENDING 299 +#define OPAQUE 300 +#define NOT 301 +#define EXTERNAL 302 +#define TARGET 303 +#define TRIPLE 304 +#define ENDIAN 305 +#define POINTERSIZE 306 +#define LITTLE 307 +#define BIG 308 +#define ALIGN 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 CSRETCC_TOK 318 +#define FASTCC_TOK 319 +#define COLDCC_TOK 320 +#define RET 321 +#define BR 322 +#define SWITCH 323 +#define INVOKE 324 +#define UNWIND 325 +#define UNREACHABLE 326 +#define ADD 327 +#define SUB 328 +#define MUL 329 +#define DIV 330 +#define REM 331 +#define AND 332 +#define OR 333 +#define XOR 334 +#define SETLE 335 +#define SETGE 336 +#define SETLT 337 +#define SETGT 338 +#define SETEQ 339 +#define SETNE 340 +#define MALLOC 341 +#define ALLOCA 342 +#define FREE 343 +#define LOAD 344 +#define STORE 345 +#define GETELEMENTPTR 346 +#define PHI_TOK 347 +#define CAST 348 +#define SELECT 349 +#define SHL 350 +#define SHR 351 +#define VAARG 352 +#define EXTRACTELEMENT 353 +#define INSERTELEMENT 354 +#define SHUFFLEVECTOR 355 +#define VAARG_old 356 +#define VANEXT_old 357 + + + + +/* Copy the first part of user declarations. */ +#line 14 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -129,6 +289,11 @@ #include #include +static bool TriggerError = false; +#define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYERROR; } } + +#define GEN_ERROR(msg) { GenerateError(msg); YYERROR; } + int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -205,7 +370,7 @@ UndefinedReferences += " " + I->first.first->getDescription() + " " + I->first.second.getName() + "\n"; } - ThrowException(UndefinedReferences); + GenerateError(UndefinedReferences); } // Look for intrinsic functions and CallInst that need to be upgraded @@ -262,7 +427,7 @@ // Any forward referenced blocks left? if (!BBForwardRefs.empty()) - ThrowException("Undefined reference to label " + + GenerateError("Undefined reference to label " + BBForwardRefs.begin()->first->getName()); // Resolve all forward references now. @@ -305,7 +470,7 @@ } break; default: - ThrowException("Internal parser error: Invalid symbol type reference!"); + GenerateError("Internal parser error: Invalid symbol type reference!"); } // If we reached here, we referenced either a symbol that we don't know about @@ -317,9 +482,9 @@ if (inFunctionScope()) { if (D.Type == ValID::NameVal) - ThrowException("Reference to an undefined type: '" + D.getName() + "'"); + GenerateError("Reference to an undefined type: '" + D.getName() + "'"); else - ThrowException("Reference to an undefined type: #" + itostr(D.Num)); + GenerateError("Reference to an undefined type: #" + itostr(D.Num)); } std::map::iterator I =CurModule.LateResolveTypes.find(D); @@ -344,7 +509,7 @@ // static Value *getValNonImprovising(const Type *Ty, const ValID &D) { if (isa(Ty)) - ThrowException("Functions are not values and " + GenerateError("Functions are not values and " "must be referenced as pointers"); switch (D.Type) { @@ -381,7 +546,7 @@ // value will fit into the specified type... case ValID::ConstSIntVal: // Is it a constant pool reference?? if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) - ThrowException("Signed integral constant '" + + GenerateError("Signed integral constant '" + itostr(D.ConstPool64) + "' is invalid for type '" + Ty->getDescription() + "'!"); return ConstantSInt::get(Ty, D.ConstPool64); @@ -389,7 +554,7 @@ case ValID::ConstUIntVal: // Is it an unsigned const pool reference? if (!ConstantUInt::isValueValidForType(Ty, D.UConstPool64)) { if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) { - ThrowException("Integral constant '" + utostr(D.UConstPool64) + + GenerateError("Integral constant '" + utostr(D.UConstPool64) + "' is invalid or out of range!"); } else { // This is really a signed reference. Transmogrify. return ConstantSInt::get(Ty, D.ConstPool64); @@ -400,12 +565,12 @@ case ValID::ConstFPVal: // Is it a floating point const pool reference? if (!ConstantFP::isValueValidForType(Ty, D.ConstPoolFP)) - ThrowException("FP constant invalid for type!!"); + GenerateError("FP constant invalid for type!!"); return ConstantFP::get(Ty, D.ConstPoolFP); case ValID::ConstNullVal: // Is it a null value? if (!isa(Ty)) - ThrowException("Cannot create a a non pointer null!"); + GenerateError("Cannot create a a non pointer null!"); return ConstantPointerNull::get(cast(Ty)); case ValID::ConstUndefVal: // Is it an undef value? @@ -416,7 +581,7 @@ case ValID::ConstantVal: // Fully resolved constant? if (D.ConstantValue->getType() != Ty) - ThrowException("Constant expression type different from required type!"); + GenerateError("Constant expression type different from required type!"); return D.ConstantValue; case ValID::InlineAsmVal: { // Inline asm expression @@ -424,7 +589,7 @@ const FunctionType *FTy = PTy ? dyn_cast(PTy->getElementType()) : 0; if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) - ThrowException("Invalid type for asm constraint string!"); + GenerateError("Invalid type for asm constraint string!"); InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints, D.IAD->HasSideEffects); D.destroy(); // Free InlineAsmDescriptor. @@ -447,14 +612,14 @@ // static Value *getVal(const Type *Ty, const ValID &ID) { if (Ty == Type::LabelTy) - ThrowException("Cannot use a basic block here"); + GenerateError("Cannot use a basic block here"); // See if the value has already been defined. Value *V = getValNonImprovising(Ty, ID); if (V) return V; if (!Ty->isFirstClassType() && !isa(Ty)) - ThrowException("Invalid use of a composite type!"); + GenerateError("Invalid use of a composite type!"); // If we reached here, we referenced either a symbol that we don't know about // or an id number that hasn't been read yet. We may be referencing something @@ -486,7 +651,7 @@ std::string Name; BasicBlock *BB = 0; switch (ID.Type) { - default: ThrowException("Illegal label reference " + ID.getName()); + default: GenerateError("Illegal label reference " + ID.getName()); case ValID::NumberVal: // Is it a numbered definition? if (unsigned(ID.Num) >= CurFun.NumberedBlocks.size()) CurFun.NumberedBlocks.resize(ID.Num+1); @@ -507,7 +672,7 @@ // an entry for it in the PlaceHolderInfo map. if (isDefinition && !CurFun.BBForwardRefs.erase(BB)) // The existing value was a definition, not a forward reference. - ThrowException("Redefinition of label " + ID.getName()); + GenerateError("Redefinition of label " + ID.getName()); ID.destroy(); // Free strdup'd memory. return BB; @@ -581,11 +746,11 @@ InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) - ThrowException("Reference to an invalid definition: '" +DID.getName()+ + GenerateError("Reference to an invalid definition: '" +DID.getName()+ "' of type '" + V->getType()->getDescription() + "'", PHI->second.second); else - ThrowException("Reference to an invalid definition: #" + + GenerateError("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + V->getType()->getDescription() + "'", PHI->second.second); @@ -623,12 +788,12 @@ free(NameStr); // Free old string if (V->getType() == Type::VoidTy) - ThrowException("Can't assign name '" + Name+"' to value with void type!"); + GenerateError("Can't assign name '" + Name+"' to value with void type!"); assert(inFunctionScope() && "Must be in function scope!"); SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable(); if (ST.lookup(V->getType(), Name)) - ThrowException("Redefinition of value named '" + Name + "' in the '" + + GenerateError("Redefinition of value named '" + Name + "' in the '" + V->getType()->getDescription() + "' type plane!"); // Set the name. @@ -643,7 +808,7 @@ bool isConstantGlobal, const Type *Ty, Constant *Initializer) { if (isa(Ty)) - ThrowException("Cannot declare global vars of function type!"); + GenerateError("Cannot declare global vars of function type!"); const PointerType *PTy = PointerType::get(Ty); @@ -700,7 +865,7 @@ return EGV; } - ThrowException("Redefinition of global variable named '" + Name + + GenerateError("Redefinition of global variable named '" + Name + "' in the '" + Ty->getDescription() + "' type plane!"); } } @@ -729,7 +894,7 @@ // We don't allow assigning names to void type if (T == Type::VoidTy) - ThrowException("Can't assign name '" + Name + "' to the void type!"); + GenerateError("Can't assign name '" + Name + "' to the void type!"); // Set the type name, checking for conflicts as we do so. bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T); @@ -753,7 +918,7 @@ if (Existing == T) return true; // Yes, it's equal. // Any other kind of (non-equivalent) redefinition is an error. - ThrowException("Redefinition of type named '" + Name + "' in the '" + + GenerateError("Redefinition of type named '" + Name + "' in the '" + T->getDescription() + "' type plane!"); } @@ -859,6 +1024,8 @@ CurModule.CurrentModule = M; yyparse(); // Parse the file, potentially throwing exception + if (!ParserResult) + return 0; Module *Result = ParserResult; ParserResult = 0; @@ -875,12 +1042,12 @@ } if (ObsoleteVarArgs && NewVarArgs) - ThrowException("This file is corrupt: it uses both new and old style varargs"); + GenerateError("This file is corrupt: it uses both new and old style varargs"); if(ObsoleteVarArgs) { if(Function* F = Result->getNamedFunction("llvm.va_start")) { if (F->arg_size() != 0) - ThrowException("Obsolete va_start takes 0 argument!"); + GenerateError("Obsolete va_start takes 0 argument!"); //foo = va_start() // -> @@ -907,7 +1074,7 @@ if(Function* F = Result->getNamedFunction("llvm.va_end")) { if(F->arg_size() != 1) - ThrowException("Obsolete va_end takes 1 argument!"); + GenerateError("Obsolete va_end takes 1 argument!"); //vaend foo // -> @@ -931,7 +1098,7 @@ if(Function* F = Result->getNamedFunction("llvm.va_copy")) { if(F->arg_size() != 1) - ThrowException("Obsolete va_copy takes 1 argument!"); + GenerateError("Obsolete va_copy takes 1 argument!"); //foo = vacopy(bar) // -> //a = alloca 1 of typeof(foo) @@ -988,8 +1155,28 @@ } -#line 890 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -typedef union { + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 897 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -1028,971 +1215,1424 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; } YYSTYPE; -#include +/* Line 196 of yacc.c. */ +#line 1220 "llvmAsmParser.tab.c" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 219 of yacc.c. */ +#line 1232 "llvmAsmParser.tab.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# else +# define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short int yyss; + YYSTYPE yyvs; + }; -#define YYFINAL 496 -#define YYFLAG -32768 -#define YYNTBASE 117 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 356 ? yytranslate[x] : 188) - -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, - 107, 115, 2, 104, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 111, - 103, 112, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 108, 105, 110, 2, 2, 2, 2, 2, 116, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 109, - 2, 2, 113, 2, 114, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 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 -}; +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, - 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, - 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, - 60, 62, 64, 67, 68, 70, 72, 74, 76, 77, - 78, 80, 82, 84, 86, 89, 90, 93, 94, 98, - 101, 102, 104, 105, 109, 111, 114, 116, 118, 120, - 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, - 142, 144, 146, 148, 150, 152, 154, 156, 159, 164, - 170, 176, 180, 183, 186, 188, 192, 194, 198, 200, - 201, 206, 210, 214, 219, 224, 228, 231, 234, 237, - 240, 243, 246, 249, 252, 255, 258, 265, 271, 280, - 287, 294, 301, 308, 315, 324, 333, 337, 339, 341, - 343, 345, 348, 351, 356, 359, 361, 366, 369, 374, - 375, 383, 384, 392, 396, 401, 402, 404, 406, 408, - 412, 416, 420, 424, 428, 430, 431, 433, 435, 437, - 438, 441, 445, 447, 449, 453, 455, 456, 465, 467, - 469, 473, 475, 477, 480, 481, 485, 486, 488, 490, - 492, 494, 496, 498, 500, 502, 504, 508, 510, 516, - 518, 520, 522, 524, 527, 530, 533, 537, 540, 541, - 543, 546, 549, 553, 563, 573, 582, 596, 598, 600, - 607, 613, 616, 623, 631, 633, 637, 639, 640, 643, - 645, 651, 657, 663, 666, 671, 676, 683, 688, 693, - 698, 703, 710, 717, 720, 728, 730, 733, 734, 736, - 737, 741, 748, 752, 759, 762, 767, 774 -}; +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined (__GNUC__) && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) -static const short yyrhs[] = { 5, - 0, 6, 0, 3, 0, 4, 0, 72, 0, 73, - 0, 74, 0, 75, 0, 76, 0, 77, 0, 78, - 0, 79, 0, 80, 0, 81, 0, 82, 0, 83, - 0, 84, 0, 85, 0, 95, 0, 96, 0, 16, - 0, 14, 0, 12, 0, 10, 0, 17, 0, 15, - 0, 13, 0, 11, 0, 123, 0, 124, 0, 18, - 0, 19, 0, 157, 103, 0, 0, 41, 0, 42, - 0, 43, 0, 44, 0, 0, 0, 62, 0, 63, - 0, 64, 0, 65, 0, 61, 4, 0, 0, 54, - 4, 0, 0, 104, 54, 4, 0, 34, 24, 0, - 0, 132, 0, 0, 104, 135, 134, 0, 132, 0, - 54, 4, 0, 138, 0, 8, 0, 140, 0, 8, - 0, 140, 0, 9, 0, 10, 0, 11, 0, 12, - 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, - 0, 18, 0, 19, 0, 20, 0, 21, 0, 45, - 0, 139, 0, 171, 0, 105, 4, 0, 137, 106, - 142, 107, 0, 108, 4, 109, 140, 110, 0, 111, - 4, 109, 140, 112, 0, 113, 141, 114, 0, 113, - 114, 0, 140, 115, 0, 140, 0, 141, 104, 140, - 0, 141, 0, 141, 104, 37, 0, 37, 0, 0, - 138, 108, 145, 110, 0, 138, 108, 110, 0, 138, - 116, 24, 0, 138, 111, 145, 112, 0, 138, 113, - 145, 114, 0, 138, 113, 114, 0, 138, 38, 0, - 138, 39, 0, 138, 171, 0, 138, 144, 0, 138, - 26, 0, 123, 118, 0, 124, 4, 0, 9, 27, - 0, 9, 28, 0, 126, 7, 0, 93, 106, 143, - 36, 138, 107, 0, 91, 106, 143, 185, 107, 0, - 94, 106, 143, 104, 143, 104, 143, 107, 0, 119, - 106, 143, 104, 143, 107, 0, 120, 106, 143, 104, - 143, 107, 0, 121, 106, 143, 104, 143, 107, 0, - 122, 106, 143, 104, 143, 107, 0, 98, 106, 143, - 104, 143, 107, 0, 99, 106, 143, 104, 143, 104, - 143, 107, 0, 100, 106, 143, 104, 143, 104, 143, - 107, 0, 145, 104, 143, 0, 143, 0, 32, 0, - 33, 0, 148, 0, 148, 166, 0, 148, 167, 0, - 148, 59, 58, 152, 0, 148, 25, 0, 149, 0, - 149, 127, 20, 136, 0, 149, 167, 0, 149, 59, - 58, 152, 0, 0, 149, 127, 128, 146, 143, 150, - 134, 0, 0, 149, 127, 47, 146, 138, 151, 134, - 0, 149, 48, 154, 0, 149, 55, 103, 155, 0, - 0, 24, 0, 53, 0, 52, 0, 50, 103, 153, - 0, 51, 103, 4, 0, 49, 103, 24, 0, 108, - 156, 110, 0, 156, 104, 24, 0, 24, 0, 0, - 22, 0, 24, 0, 157, 0, 0, 138, 158, 0, - 160, 104, 159, 0, 159, 0, 160, 0, 160, 104, - 37, 0, 37, 0, 0, 129, 136, 157, 106, 161, - 107, 133, 130, 0, 29, 0, 113, 0, 128, 162, - 163, 0, 30, 0, 114, 0, 174, 165, 0, 0, - 31, 168, 162, 0, 0, 60, 0, 3, 0, 4, - 0, 7, 0, 27, 0, 28, 0, 38, 0, 39, - 0, 26, 0, 111, 145, 112, 0, 144, 0, 58, - 169, 24, 104, 24, 0, 117, 0, 157, 0, 171, - 0, 170, 0, 138, 172, 0, 174, 175, 0, 164, - 175, 0, 176, 127, 177, 0, 176, 179, 0, 0, - 23, 0, 66, 173, 0, 66, 8, 0, 67, 21, - 172, 0, 67, 9, 172, 104, 21, 172, 104, 21, - 172, 0, 68, 125, 172, 104, 21, 172, 108, 178, - 110, 0, 68, 125, 172, 104, 21, 172, 108, 110, - 0, 69, 129, 136, 172, 106, 182, 107, 36, 21, - 172, 70, 21, 172, 0, 70, 0, 71, 0, 178, - 125, 170, 104, 21, 172, 0, 125, 170, 104, 21, - 172, 0, 127, 184, 0, 138, 108, 172, 104, 172, - 110, 0, 180, 104, 108, 172, 104, 172, 110, 0, - 173, 0, 181, 104, 173, 0, 181, 0, 0, 57, - 56, 0, 56, 0, 119, 138, 172, 104, 172, 0, - 120, 138, 172, 104, 172, 0, 121, 138, 172, 104, - 172, 0, 46, 173, 0, 122, 173, 104, 173, 0, - 93, 173, 36, 138, 0, 94, 173, 104, 173, 104, - 173, 0, 97, 173, 104, 138, 0, 101, 173, 104, - 138, 0, 102, 173, 104, 138, 0, 98, 173, 104, - 173, 0, 99, 173, 104, 173, 104, 173, 0, 100, - 173, 104, 173, 104, 173, 0, 92, 180, 0, 183, - 129, 136, 172, 106, 182, 107, 0, 187, 0, 104, - 181, 0, 0, 35, 0, 0, 86, 138, 131, 0, - 86, 138, 104, 15, 172, 131, 0, 87, 138, 131, - 0, 87, 138, 104, 15, 172, 131, 0, 88, 173, - 0, 186, 89, 138, 172, 0, 186, 90, 173, 104, - 138, 172, 0, 91, 138, 172, 185, 0 -}; +#endif +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short int yysigned_char; #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 1010, 1011, 1018, 1019, 1028, 1028, 1028, 1028, 1028, 1029, - 1029, 1029, 1030, 1030, 1030, 1030, 1030, 1030, 1032, 1032, - 1036, 1036, 1036, 1036, 1037, 1037, 1037, 1037, 1038, 1038, - 1039, 1039, 1042, 1045, 1049, 1049, 1050, 1051, 1052, 1055, - 1055, 1056, 1057, 1058, 1059, 1068, 1068, 1074, 1074, 1082, - 1089, 1089, 1095, 1095, 1097, 1101, 1114, 1114, 1115, 1115, - 1117, 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1127, 1127, - 1127, 1127, 1127, 1127, 1128, 1131, 1134, 1140, 1147, 1159, - 1163, 1174, 1183, 1186, 1194, 1198, 1203, 1204, 1207, 1210, - 1220, 1245, 1258, 1287, 1312, 1332, 1344, 1353, 1357, 1416, - 1422, 1430, 1435, 1440, 1443, 1446, 1453, 1463, 1494, 1501, - 1522, 1532, 1537, 1544, 1549, 1554, 1562, 1565, 1572, 1572, - 1582, 1589, 1593, 1596, 1599, 1602, 1615, 1635, 1637, 1639, - 1642, 1645, 1649, 1652, 1654, 1656, 1660, 1672, 1673, 1675, - 1678, 1686, 1691, 1693, 1697, 1701, 1709, 1709, 1710, 1710, - 1712, 1718, 1723, 1729, 1732, 1737, 1741, 1745, 1831, 1831, - 1833, 1841, 1841, 1843, 1847, 1847, 1856, 1859, 1863, 1866, - 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1911, 1914, 1927, - 1930, 1935, 1935, 1941, 1945, 1948, 1956, 1965, 1969, 1979, - 1990, 1993, 1996, 1999, 2002, 2016, 2020, 2073, 2076, 2082, - 2090, 2100, 2107, 2112, 2119, 2123, 2129, 2129, 2131, 2134, - 2140, 2152, 2163, 2173, 2185, 2192, 2199, 2206, 2211, 2230, - 2252, 2257, 2262, 2267, 2281, 2338, 2344, 2346, 2350, 2353, - 2359, 2363, 2367, 2371, 2375, 2382, 2392, 2405 +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 4 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1278 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 117 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 72 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 239 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 496 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 357 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 106, 107, 115, 2, 104, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 111, 103, 112, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 108, 105, 110, 2, 2, 2, 2, 2, 116, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 109, 2, 2, 113, 2, 114, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 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 }; -#endif +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short int yyprhs[] = +{ + 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, + 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, + 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, + 59, 61, 63, 65, 67, 70, 71, 73, 75, 77, + 79, 80, 81, 83, 85, 87, 89, 92, 93, 96, + 97, 101, 104, 105, 107, 108, 112, 114, 117, 119, + 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, + 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, + 162, 167, 173, 179, 183, 186, 189, 191, 195, 197, + 201, 203, 204, 209, 213, 217, 222, 227, 231, 234, + 237, 240, 243, 246, 249, 252, 255, 258, 261, 268, + 274, 283, 290, 297, 304, 311, 318, 327, 336, 340, + 342, 344, 346, 348, 351, 354, 359, 362, 364, 369, + 372, 377, 378, 386, 387, 395, 399, 404, 405, 407, + 409, 411, 415, 419, 423, 427, 431, 433, 434, 436, + 438, 440, 441, 444, 448, 450, 452, 456, 458, 459, + 468, 470, 472, 476, 478, 480, 483, 484, 488, 489, + 491, 493, 495, 497, 499, 501, 503, 505, 507, 511, + 513, 519, 521, 523, 525, 527, 530, 533, 536, 540, + 543, 544, 546, 549, 552, 556, 566, 576, 585, 599, + 601, 603, 610, 616, 619, 626, 634, 636, 640, 642, + 643, 646, 648, 654, 660, 666, 669, 674, 679, 686, + 691, 696, 701, 706, 713, 720, 723, 731, 733, 736, + 737, 739, 740, 744, 751, 755, 762, 765, 770, 777 +}; -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short int yyrhs[] = +{ + 148, 0, -1, 5, -1, 6, -1, 3, -1, 4, + -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, + -1, 77, -1, 78, -1, 79, -1, 80, -1, 81, + -1, 82, -1, 83, -1, 84, -1, 85, -1, 95, + -1, 96, -1, 16, -1, 14, -1, 12, -1, 10, + -1, 17, -1, 15, -1, 13, -1, 11, -1, 124, + -1, 125, -1, 18, -1, 19, -1, 158, 103, -1, + -1, 41, -1, 42, -1, 43, -1, 44, -1, -1, + -1, 62, -1, 63, -1, 64, -1, 65, -1, 61, + 4, -1, -1, 54, 4, -1, -1, 104, 54, 4, + -1, 34, 24, -1, -1, 133, -1, -1, 104, 136, + 135, -1, 133, -1, 54, 4, -1, 139, -1, 8, + -1, 141, -1, 8, -1, 141, -1, 9, -1, 10, + -1, 11, -1, 12, -1, 13, -1, 14, -1, 15, + -1, 16, -1, 17, -1, 18, -1, 19, -1, 20, + -1, 21, -1, 45, -1, 140, -1, 172, -1, 105, + 4, -1, 138, 106, 143, 107, -1, 108, 4, 109, + 141, 110, -1, 111, 4, 109, 141, 112, -1, 113, + 142, 114, -1, 113, 114, -1, 141, 115, -1, 141, + -1, 142, 104, 141, -1, 142, -1, 142, 104, 37, + -1, 37, -1, -1, 139, 108, 146, 110, -1, 139, + 108, 110, -1, 139, 116, 24, -1, 139, 111, 146, + 112, -1, 139, 113, 146, 114, -1, 139, 113, 114, + -1, 139, 38, -1, 139, 39, -1, 139, 172, -1, + 139, 145, -1, 139, 26, -1, 124, 119, -1, 125, + 4, -1, 9, 27, -1, 9, 28, -1, 127, 7, + -1, 93, 106, 144, 36, 139, 107, -1, 91, 106, + 144, 186, 107, -1, 94, 106, 144, 104, 144, 104, + 144, 107, -1, 120, 106, 144, 104, 144, 107, -1, + 121, 106, 144, 104, 144, 107, -1, 122, 106, 144, + 104, 144, 107, -1, 123, 106, 144, 104, 144, 107, + -1, 98, 106, 144, 104, 144, 107, -1, 99, 106, + 144, 104, 144, 104, 144, 107, -1, 100, 106, 144, + 104, 144, 104, 144, 107, -1, 146, 104, 144, -1, + 144, -1, 32, -1, 33, -1, 149, -1, 149, 167, + -1, 149, 168, -1, 149, 59, 58, 153, -1, 149, + 25, -1, 150, -1, 150, 128, 20, 137, -1, 150, + 168, -1, 150, 59, 58, 153, -1, -1, 150, 128, + 129, 147, 144, 151, 135, -1, -1, 150, 128, 47, + 147, 139, 152, 135, -1, 150, 48, 155, -1, 150, + 55, 103, 156, -1, -1, 24, -1, 53, -1, 52, + -1, 50, 103, 154, -1, 51, 103, 4, -1, 49, + 103, 24, -1, 108, 157, 110, -1, 157, 104, 24, + -1, 24, -1, -1, 22, -1, 24, -1, 158, -1, + -1, 139, 159, -1, 161, 104, 160, -1, 160, -1, + 161, -1, 161, 104, 37, -1, 37, -1, -1, 130, + 137, 158, 106, 162, 107, 134, 131, -1, 29, -1, + 113, -1, 129, 163, 164, -1, 30, -1, 114, -1, + 175, 166, -1, -1, 31, 169, 163, -1, -1, 60, + -1, 3, -1, 4, -1, 7, -1, 27, -1, 28, + -1, 38, -1, 39, -1, 26, -1, 111, 146, 112, + -1, 145, -1, 58, 170, 24, 104, 24, -1, 118, + -1, 158, -1, 172, -1, 171, -1, 139, 173, -1, + 175, 176, -1, 165, 176, -1, 177, 128, 178, -1, + 177, 180, -1, -1, 23, -1, 66, 174, -1, 66, + 8, -1, 67, 21, 173, -1, 67, 9, 173, 104, + 21, 173, 104, 21, 173, -1, 68, 126, 173, 104, + 21, 173, 108, 179, 110, -1, 68, 126, 173, 104, + 21, 173, 108, 110, -1, 69, 130, 137, 173, 106, + 183, 107, 36, 21, 173, 70, 21, 173, -1, 70, + -1, 71, -1, 179, 126, 171, 104, 21, 173, -1, + 126, 171, 104, 21, 173, -1, 128, 185, -1, 139, + 108, 173, 104, 173, 110, -1, 181, 104, 108, 173, + 104, 173, 110, -1, 174, -1, 182, 104, 174, -1, + 182, -1, -1, 57, 56, -1, 56, -1, 120, 139, + 173, 104, 173, -1, 121, 139, 173, 104, 173, -1, + 122, 139, 173, 104, 173, -1, 46, 174, -1, 123, + 174, 104, 174, -1, 93, 174, 36, 139, -1, 94, + 174, 104, 174, 104, 174, -1, 97, 174, 104, 139, + -1, 101, 174, 104, 139, -1, 102, 174, 104, 139, + -1, 98, 174, 104, 174, -1, 99, 174, 104, 174, + 104, 174, -1, 100, 174, 104, 174, 104, 174, -1, + 92, 181, -1, 184, 130, 137, 173, 106, 183, 107, + -1, 188, -1, 104, 182, -1, -1, 35, -1, -1, + 86, 139, 132, -1, 86, 139, 104, 15, 173, 132, + -1, 87, 139, 132, -1, 87, 139, 104, 15, 173, + 132, -1, 88, 174, -1, 187, 89, 139, 173, -1, + 187, 90, 174, 104, 139, 173, -1, 91, 139, 173, + 186, -1 +}; -static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", -"EUINT64VAL","SINTVAL","UINTVAL","FPVAL","VOID","BOOL","SBYTE","UBYTE","SHORT", -"USHORT","INT","UINT","LONG","ULONG","FLOAT","DOUBLE","TYPE","LABEL","VAR_ID", -"LABELSTR","STRINGCONSTANT","IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK", -"BEGINTOK","ENDTOK","DECLARE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO", -"DOTDOTDOT","NULL_TOK","UNDEF","CONST","INTERNAL","LINKONCE","WEAK","APPENDING", -"OPAQUE","NOT","EXTERNAL","TARGET","TRIPLE","ENDIAN","POINTERSIZE","LITTLE", -"BIG","ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK", -"CCC_TOK","CSRETCC_TOK","FASTCC_TOK","COLDCC_TOK","RET","BR","SWITCH","INVOKE", -"UNWIND","UNREACHABLE","ADD","SUB","MUL","DIV","REM","AND","OR","XOR","SETLE", -"SETGE","SETLT","SETGT","SETEQ","SETNE","MALLOC","ALLOCA","FREE","LOAD","STORE", -"GETELEMENTPTR","PHI_TOK","CAST","SELECT","SHL","SHR","VAARG","EXTRACTELEMENT", -"INSERTELEMENT","SHUFFLEVECTOR","VAARG_old","VANEXT_old","'='","','","'\\\\'", -"'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'*'","'c'","INTVAL","EINT64VAL", -"ArithmeticOps","LogicalOps","SetCondOps","ShiftOps","SIntType","UIntType","IntType", -"FPType","OptAssign","OptLinkage","OptCallingConv","OptAlign","OptCAlign","SectionString", -"OptSection","GlobalVarAttributes","GlobalVarAttribute","TypesV","UpRTypesV", -"Types","PrimType","UpRTypes","TypeListI","ArgTypeListI","ConstVal","ConstExpr", -"ConstVector","GlobalType","Module","FunctionList","ConstPool","@1","@2","AsmBlock", -"BigOrLittle","TargetDefinition","LibrariesDefinition","LibList","Name","OptName", -"ArgVal","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", -"Function","FunctionProto","@3","OptSideEffect","ConstValueRef","SymbolicValueRef", -"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", -"JumpTable","Inst","PHIList","ValueRefList","ValueRefListE","OptTailCall","InstVal", -"IndexList","OptVolatile","MemoryInst", NULL +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short int yyrline[] = +{ + 0, 1017, 1017, 1018, 1026, 1027, 1037, 1037, 1037, 1037, + 1037, 1038, 1038, 1038, 1039, 1039, 1039, 1039, 1039, 1039, + 1041, 1041, 1045, 1045, 1045, 1045, 1046, 1046, 1046, 1046, + 1047, 1047, 1048, 1048, 1051, 1055, 1060, 1061, 1062, 1063, + 1064, 1066, 1067, 1068, 1069, 1070, 1071, 1080, 1081, 1087, + 1088, 1096, 1104, 1105, 1110, 1111, 1112, 1117, 1131, 1131, + 1132, 1132, 1134, 1144, 1144, 1144, 1144, 1144, 1144, 1144, + 1145, 1145, 1145, 1145, 1145, 1145, 1146, 1150, 1154, 1161, + 1169, 1182, 1187, 1199, 1209, 1213, 1222, 1227, 1233, 1234, + 1238, 1242, 1253, 1279, 1293, 1323, 1349, 1370, 1383, 1393, + 1398, 1458, 1465, 1474, 1480, 1486, 1490, 1494, 1502, 1513, + 1545, 1553, 1575, 1586, 1592, 1600, 1606, 1612, 1621, 1625, + 1633, 1633, 1643, 1651, 1656, 1660, 1664, 1668, 1683, 1704, + 1707, 1710, 1710, 1717, 1717, 1725, 1728, 1731, 1735, 1748, + 1749, 1751, 1755, 1764, 1770, 1772, 1777, 1782, 1791, 1791, + 1792, 1792, 1794, 1801, 1807, 1814, 1818, 1824, 1829, 1834, + 1921, 1921, 1923, 1931, 1931, 1933, 1938, 1938, 1948, 1952, + 1957, 1961, 1965, 1969, 1973, 1977, 1981, 1985, 1989, 2014, + 2018, 2032, 2036, 2042, 2042, 2048, 2053, 2057, 2066, 2076, + 2081, 2092, 2104, 2108, 2112, 2116, 2120, 2135, 2140, 2194, + 2198, 2205, 2214, 2225, 2233, 2239, 2247, 2252, 2259, 2259, + 2261, 2265, 2272, 2285, 2297, 2308, 2321, 2329, 2337, 2345, + 2351, 2371, 2394, 2400, 2406, 2412, 2427, 2485, 2492, 2495, + 2500, 2504, 2511, 2516, 2521, 2526, 2531, 2539, 2550, 2564 }; #endif -static const short yyr1[] = { 0, - 117, 117, 118, 118, 119, 119, 119, 119, 119, 120, - 120, 120, 121, 121, 121, 121, 121, 121, 122, 122, - 123, 123, 123, 123, 124, 124, 124, 124, 125, 125, - 126, 126, 127, 127, 128, 128, 128, 128, 128, 129, - 129, 129, 129, 129, 129, 130, 130, 131, 131, 132, - 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, - 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 141, 141, 142, 142, 142, 142, - 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, - 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 145, 145, 146, 146, - 147, 148, 148, 148, 148, 148, 149, 149, 149, 150, - 149, 151, 149, 149, 149, 149, 152, 153, 153, 154, - 154, 154, 155, 156, 156, 156, 157, 157, 158, 158, - 159, 160, 160, 161, 161, 161, 161, 162, 163, 163, - 164, 165, 165, 166, 168, 167, 169, 169, 170, 170, - 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, - 171, 172, 172, 173, 174, 174, 175, 176, 176, 176, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, - 178, 179, 180, 180, 181, 181, 182, 182, 183, 183, - 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 185, 185, 186, 186, - 187, 187, 187, 187, 187, 187, 187, 187 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL", + "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", + "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", + "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", + "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", + "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", + "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", + "WEAK", "APPENDING", "OPAQUE", "NOT", "EXTERNAL", "TARGET", "TRIPLE", + "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN", "DEPLIBS", "CALL", + "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", + "CSRETCC_TOK", "FASTCC_TOK", "COLDCC_TOK", "RET", "BR", "SWITCH", + "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "DIV", "REM", + "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", + "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", + "CAST", "SELECT", "SHL", "SHR", "VAARG", "EXTRACTELEMENT", + "INSERTELEMENT", "SHUFFLEVECTOR", "VAARG_old", "VANEXT_old", "'='", + "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", + "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL", "ArithmeticOps", + "LogicalOps", "SetCondOps", "ShiftOps", "SIntType", "UIntType", + "IntType", "FPType", "OptAssign", "OptLinkage", "OptCallingConv", + "OptAlign", "OptCAlign", "SectionString", "OptSection", + "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV", + "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", + "ConstExpr", "ConstVector", "GlobalType", "Module", "FunctionList", + "ConstPool", "@1", "@2", "AsmBlock", "BigOrLittle", "TargetDefinition", + "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", + "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", + "END", "Function", "FunctionProto", "@3", "OptSideEffect", + "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal", + "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", + "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE", + "OptTailCall", "InstVal", "IndexList", "OptVolatile", "MemoryInst", 0 }; +#endif -static const short yyr2[] = { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 0, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 2, 0, 2, 0, 3, 2, - 0, 1, 0, 3, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, - 5, 3, 2, 2, 1, 3, 1, 3, 1, 0, - 4, 3, 3, 4, 4, 3, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 6, 5, 8, 6, - 6, 6, 6, 6, 8, 8, 3, 1, 1, 1, - 1, 2, 2, 4, 2, 1, 4, 2, 4, 0, - 7, 0, 7, 3, 4, 0, 1, 1, 1, 3, - 3, 3, 3, 3, 1, 0, 1, 1, 1, 0, - 2, 3, 1, 1, 3, 1, 0, 8, 1, 1, - 3, 1, 1, 2, 0, 3, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 1, 5, 1, - 1, 1, 1, 2, 2, 2, 3, 2, 0, 1, - 2, 2, 3, 9, 9, 8, 13, 1, 1, 6, - 5, 2, 6, 7, 1, 3, 1, 0, 2, 1, - 5, 5, 5, 2, 4, 4, 6, 4, 4, 4, - 4, 6, 6, 2, 7, 1, 2, 0, 1, 0, - 3, 6, 3, 6, 2, 4, 6, 4 +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short int yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 61, 44, 92, 40, 41, 91, 120, + 93, 60, 62, 123, 125, 42, 99 }; +# endif -static const short yydefact[] = { 136, - 39, 126, 125, 165, 35, 36, 37, 38, 0, 40, - 189, 122, 123, 189, 147, 148, 0, 0, 0, 39, - 0, 128, 40, 0, 0, 41, 42, 43, 44, 0, - 0, 190, 186, 34, 162, 163, 164, 185, 0, 0, - 0, 134, 0, 0, 0, 0, 0, 33, 166, 137, - 124, 45, 1, 2, 58, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, - 0, 0, 0, 180, 0, 0, 57, 76, 61, 181, - 77, 159, 160, 161, 230, 188, 0, 0, 0, 146, - 135, 129, 127, 119, 120, 0, 0, 78, 0, 0, - 60, 83, 85, 0, 0, 90, 84, 229, 0, 210, - 0, 0, 0, 0, 40, 198, 199, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 0, 0, 0, 0, 0, 0, 0, 19, 20, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 187, 40, 202, 0, 226, 142, 139, 138, 140, 141, - 145, 0, 132, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 0, 0, 0, 0, 130, 0, - 0, 0, 82, 157, 89, 87, 0, 0, 214, 209, - 192, 191, 0, 0, 24, 28, 23, 27, 22, 26, - 21, 25, 29, 30, 0, 0, 48, 48, 235, 0, - 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 143, 53, - 104, 105, 3, 4, 102, 103, 106, 101, 97, 98, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 100, 99, 53, 59, 59, 86, - 156, 150, 153, 154, 0, 0, 79, 169, 170, 171, - 176, 172, 173, 174, 175, 167, 0, 178, 183, 182, - 184, 0, 193, 0, 0, 0, 231, 0, 233, 228, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 144, 0, 133, - 0, 0, 0, 0, 0, 0, 92, 118, 0, 0, - 96, 0, 93, 0, 0, 0, 0, 131, 80, 81, - 149, 151, 0, 51, 88, 168, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 238, 0, 0, 216, 0, - 218, 221, 0, 0, 219, 220, 0, 0, 0, 215, - 0, 236, 0, 0, 0, 55, 53, 228, 0, 0, - 0, 0, 0, 0, 91, 94, 95, 0, 0, 0, - 0, 155, 152, 52, 46, 0, 177, 0, 0, 208, - 48, 49, 48, 205, 227, 0, 0, 0, 0, 0, - 211, 212, 213, 208, 0, 50, 56, 54, 0, 0, - 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, - 158, 0, 0, 0, 207, 0, 0, 232, 234, 0, - 0, 0, 217, 222, 223, 0, 237, 108, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 47, 179, 0, - 0, 0, 206, 203, 0, 225, 107, 0, 114, 0, - 0, 110, 111, 112, 113, 0, 196, 0, 0, 0, - 204, 0, 0, 0, 194, 0, 195, 0, 0, 109, - 115, 116, 0, 0, 0, 0, 0, 0, 201, 0, - 0, 200, 197, 0, 0, 0 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 117, 118, 118, 119, 119, 120, 120, 120, 120, + 120, 121, 121, 121, 122, 122, 122, 122, 122, 122, + 123, 123, 124, 124, 124, 124, 125, 125, 125, 125, + 126, 126, 127, 127, 128, 128, 129, 129, 129, 129, + 129, 130, 130, 130, 130, 130, 130, 131, 131, 132, + 132, 133, 134, 134, 135, 135, 136, 136, 137, 137, + 138, 138, 139, 140, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, + 141, 141, 141, 141, 141, 141, 142, 142, 143, 143, + 143, 143, 144, 144, 144, 144, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 144, 144, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, + 147, 147, 148, 149, 149, 149, 149, 149, 150, 150, + 150, 151, 150, 152, 150, 150, 150, 150, 153, 154, + 154, 155, 155, 155, 156, 157, 157, 157, 158, 158, + 159, 159, 160, 161, 161, 162, 162, 162, 162, 163, + 164, 164, 165, 166, 166, 167, 169, 168, 170, 170, + 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 172, 172, 173, 173, 174, 175, 175, 176, 177, + 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, + 178, 179, 179, 180, 181, 181, 182, 182, 183, 183, + 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, + 187, 187, 188, 188, 188, 188, 188, 188, 188, 188 }; -static const short yydefgoto[] = { 74, - 235, 251, 252, 253, 254, 175, 176, 205, 177, 20, - 10, 30, 421, 287, 366, 385, 310, 367, 75, 76, - 178, 78, 79, 104, 187, 318, 278, 319, 96, 494, - 1, 2, 257, 230, 51, 159, 42, 91, 162, 80, - 332, 263, 264, 265, 31, 84, 11, 37, 12, 13, - 23, 337, 279, 81, 281, 394, 14, 33, 34, 151, - 469, 86, 212, 425, 426, 152, 153, 346, 154, 155 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, + 0, 0, 1, 1, 1, 1, 2, 0, 2, 0, + 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 4, 5, 5, 3, 2, 2, 1, 3, 1, 3, + 1, 0, 4, 3, 3, 4, 4, 3, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 6, 5, + 8, 6, 6, 6, 6, 6, 8, 8, 3, 1, + 1, 1, 1, 2, 2, 4, 2, 1, 4, 2, + 4, 0, 7, 0, 7, 3, 4, 0, 1, 1, + 1, 3, 3, 3, 3, 3, 1, 0, 1, 1, + 1, 0, 2, 3, 1, 1, 3, 1, 0, 8, + 1, 1, 3, 1, 1, 2, 0, 3, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 5, 1, 1, 1, 1, 2, 2, 2, 3, 2, + 0, 1, 2, 2, 3, 9, 9, 8, 13, 1, + 1, 6, 5, 2, 6, 7, 1, 3, 1, 0, + 2, 1, 5, 5, 5, 2, 4, 4, 6, 4, + 4, 4, 4, 6, 6, 2, 7, 1, 2, 0, + 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 }; -static const short yypact[] = {-32768, - 181, 372,-32768,-32768,-32768,-32768,-32768,-32768, -32, 94, - 38,-32768,-32768, -14,-32768,-32768, 45, -40, 18, 44, - -25,-32768, 94, 57, 79,-32768,-32768,-32768,-32768, 1012, - -21,-32768,-32768, 22,-32768,-32768,-32768,-32768, -6, -4, - 27,-32768, 26, 57, 1012, 77, 77,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 46,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 167, - 170, 171, 524,-32768, 22, 71,-32768,-32768, -17,-32768, --32768,-32768,-32768,-32768, 1176,-32768, 154, 76, 175, 156, --32768,-32768,-32768,-32768,-32768, 1050, 1088,-32768, 73, 74, --32768,-32768, -17, -83, 78, 819,-32768,-32768, 1050,-32768, - 129, 1126, 56, 128, 94,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 1050, 1050, 1050, 1050, 1050, 1050, 1050,-32768,-32768, - 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, --32768, 94,-32768, 43,-32768,-32768,-32768,-32768,-32768,-32768, --32768, -82,-32768, 119, 146, 183, 157, 190, 159, 194, - 166, 196, 195, 197, 169, 199, 198, 406,-32768, 1050, - 1050, 1050,-32768, 857,-32768, 97, 100, 617,-32768,-32768, - 46,-32768, 617, 617,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 617, 1012, 104, 105,-32768, 617, - 103, 109, 178, 111, 122, 123, 131, 132, 133, 134, - 617, 617, 617, 135, 1012, 1050, 1050, 209,-32768, 137, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 136, 138, 139, 140, 141, 144, 895, 1088, 566, 219, - 145, 147, 148, 149,-32768,-32768, 137, -48, -88, -17, --32768, 22,-32768, 152, 150, 936,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 192, 1088,-32768,-32768,-32768, --32768, 155,-32768, 158, 617, -5,-32768, 5,-32768, 172, - 617, 153, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, - 173, 174, 176, 1050, 617, 617, 177,-32768, -20,-32768, - 1088, 1088, 1088, 1088, 1088, 1088,-32768,-32768, -62, -11, --32768, -79,-32768, 1088, 1088, 1088, 1088,-32768,-32768,-32768, --32768,-32768, 974, 224,-32768,-32768, 236, 23, 251, 252, - 180, 617, 271, 617, 1050,-32768, 179, 617,-32768, 184, --32768,-32768, 185, 186,-32768,-32768, 617, 617, 617,-32768, - 191,-32768, 1050, 258, 280,-32768, 137, 172, 256, 200, - 201, 202, 203, 1088,-32768,-32768,-32768, 204, 205, 206, - 207,-32768,-32768,-32768, 242, 208,-32768, 617, 617, 1050, - 210,-32768, 210,-32768, 216, 617, 222, 1050, 1050, 1050, --32768,-32768,-32768, 1050, 617,-32768,-32768,-32768, 220, 1050, - 1088, 1088, 1088, 1088,-32768, 1088, 1088, 1088, 1088, 294, --32768, 275, 225, 226, 216, 221, 259,-32768,-32768, 1050, - 227, 617,-32768,-32768,-32768, 223,-32768,-32768, 228, 232, - 234, 238, 239, 237, 240, 243, 244,-32768,-32768, 324, - 41, 310,-32768,-32768, 245,-32768,-32768, 1088,-32768, 1088, - 1088,-32768,-32768,-32768,-32768, 617,-32768, 715, 58, 328, --32768, 246, 247, 250,-32768, 248,-32768, 715, 617,-32768, --32768,-32768, 338, 260, 297, 617, 350, 351,-32768, 617, - 617,-32768,-32768, 376, 377,-32768 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned char yydefact[] = +{ + 137, 0, 40, 127, 1, 126, 166, 36, 37, 38, + 39, 0, 41, 190, 123, 124, 190, 148, 149, 0, + 0, 0, 40, 0, 129, 41, 0, 0, 42, 43, + 44, 45, 0, 0, 191, 187, 35, 163, 164, 165, + 186, 0, 0, 0, 135, 0, 0, 0, 0, 0, + 34, 167, 138, 125, 46, 2, 3, 59, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 0, 0, 0, 0, 181, 0, 0, 58, + 77, 62, 182, 78, 160, 161, 162, 231, 189, 0, + 0, 0, 147, 136, 130, 128, 120, 121, 0, 0, + 79, 0, 0, 61, 84, 86, 0, 0, 91, 85, + 230, 0, 211, 0, 0, 0, 0, 41, 199, 200, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, + 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 188, 41, 203, 0, 227, 143, 140, + 139, 141, 142, 146, 0, 133, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 0, 0, 0, + 0, 131, 0, 0, 0, 83, 158, 90, 88, 0, + 0, 215, 210, 193, 192, 0, 0, 25, 29, 24, + 28, 23, 27, 22, 26, 30, 31, 0, 0, 49, + 49, 236, 0, 0, 225, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 144, 54, 105, 106, 4, 5, 103, 104, 107, + 102, 98, 99, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 101, 100, 54, + 60, 60, 87, 157, 151, 154, 155, 0, 0, 80, + 170, 171, 172, 177, 173, 174, 175, 176, 168, 0, + 179, 184, 183, 185, 0, 194, 0, 0, 0, 232, + 0, 234, 229, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 145, 0, 134, 0, 0, 0, 0, 0, 0, 93, + 119, 0, 0, 97, 0, 94, 0, 0, 0, 0, + 132, 81, 82, 150, 152, 0, 52, 89, 169, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 239, 0, + 0, 217, 0, 219, 222, 0, 0, 220, 221, 0, + 0, 0, 216, 0, 237, 0, 0, 0, 56, 54, + 229, 0, 0, 0, 0, 0, 0, 92, 95, 96, + 0, 0, 0, 0, 156, 153, 53, 47, 0, 178, + 0, 0, 209, 49, 50, 49, 206, 228, 0, 0, + 0, 0, 0, 212, 213, 214, 209, 0, 51, 57, + 55, 0, 0, 0, 0, 0, 0, 118, 0, 0, + 0, 0, 0, 159, 0, 0, 0, 208, 0, 0, + 233, 235, 0, 0, 0, 218, 223, 224, 0, 238, + 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 48, 180, 0, 0, 0, 207, 204, 0, 226, 108, + 0, 115, 0, 0, 111, 112, 113, 114, 0, 197, + 0, 0, 0, 205, 0, 0, 0, 195, 0, 196, + 0, 0, 110, 116, 117, 0, 0, 0, 0, 0, + 0, 202, 0, 0, 201, 198 }; -static const short yypgoto[] = {-32768, --32768, 296, 298, 299, 300, -113, -111, -439,-32768, 345, - 362, -92,-32768, -203, 52,-32768, -244,-32768, -39,-32768, - -30,-32768, -56, 281,-32768, -95, 215, -230, 341,-32768, --32768,-32768,-32768,-32768, 353,-32768,-32768,-32768,-32768, 9, --32768, 62,-32768,-32768, 375,-32768,-32768,-32768,-32768, 397, --32768,-32768, -388, -57, 168, -105,-32768, 387,-32768,-32768, --32768,-32768,-32768, 61, -2,-32768,-32768, 39,-32768,-32768 +/* YYDEFGOTO[NTERM-NUM]. */ +static const short int yydefgoto[] = +{ + -1, 76, 237, 253, 254, 255, 256, 177, 178, 207, + 179, 22, 12, 32, 423, 289, 368, 387, 312, 369, + 77, 78, 180, 80, 81, 106, 189, 320, 280, 321, + 98, 1, 2, 3, 259, 232, 53, 161, 44, 93, + 164, 82, 334, 265, 266, 267, 33, 86, 13, 39, + 14, 15, 25, 339, 281, 83, 283, 396, 16, 35, + 36, 153, 471, 88, 214, 427, 428, 154, 155, 348, + 156, 157 }; - -#define YYLAST 1278 - - -static const short yytable[] = { 77, - 203, 179, 204, 189, 289, 93, 192, 82, 32, 342, - 21, 468, 328, 364, 77, 35, 103, 320, 322, 344, - 182, 228, 206, 330, 374, 24, 107, 229, 209, 478, - 183, 213, 214, 365, 377, 215, 216, 217, 218, 219, - 220, 374, 21, 15, 224, 16, 338, 375, 343, 103, - 195, 196, 197, 198, 199, 200, 201, 202, 343, 225, - 32, 329, 43, 45, 193, 163, 107, 195, 196, 197, - 198, 199, 200, 201, 202, 44, 194, 48, 188, 476, - 50, 188, 52, 105, 5, 6, 7, 8, -59, 484, - 46, 83, 374, 39, 40, 41, 87, 107, 88, 36, - 376, 207, 208, 188, 210, 211, 188, 188, 94, 95, - 188, 188, 188, 188, 188, 188, 221, 222, 223, 188, - 256, 307, 408, 258, 259, 260, 374, 157, 158, 89, - 280, 226, 227, 90, 387, 280, 280, 195, 196, 197, - 198, 199, 200, 201, 202, 231, 232, 280, -24, -24, - 467, -60, 280, 262, 25, 26, 27, 28, 29, -23, - -23, -22, -22, 280, 280, 280, 285, 477, -21, -21, - 98, 233, 234, 99, 100, 77, 106, 156, 160, 161, - -121, 180, 181, 184, 190, 305, -28, 428, 350, 429, - 352, 353, 354, -27, 77, 306, 188, -26, 360, -25, - 266, -31, 236, -32, 237, 3, 267, 286, 288, 260, - 291, 4, 292, 293, 294, 368, 369, 370, 371, 372, - 373, 5, 6, 7, 8, 295, 296, 280, 378, 379, - 380, 381, 308, 280, 297, 298, 299, 300, 304, 9, - 309, 311, 323, 312, 313, 314, 315, 280, 280, 316, - 324, 336, 325, 326, 327, 333, 334, 364, 339, 386, - 348, 340, 349, 188, 351, 188, 188, 188, 355, 356, - 331, 388, 389, 188, 392, 345, 357, 358, 415, 359, - 363, 406, 396, 407, 280, 390, 280, 398, 399, 400, - 280, 410, 433, 434, 435, 420, 404, 448, 449, 280, - 280, 280, 262, 411, 412, 413, 414, 416, 417, 418, - 419, 422, 343, 427, 188, 440, 441, 442, 443, 430, - 444, 445, 446, 447, 453, 432, 438, 452, 450, 456, - 280, 280, 405, 451, 457, 458, 454, 203, 280, 204, - 459, 460, 461, 462, 466, 470, 463, 280, 479, 464, - 465, 483, 480, 481, 471, 203, 482, 204, 486, 188, - 282, 283, 472, 487, 473, 474, 488, 188, 188, 188, - 490, 491, 284, 188, 280, 495, 496, 290, 85, 439, - 147, 47, 148, 149, 150, 384, 186, 97, 301, 302, - 303, -34, 255, 15, 383, 16, 92, 49, 22, 188, - 38, 436, 4, -34, -34, 395, 409, 0, 280, 0, - 53, 54, -34, -34, -34, -34, 0, 0, -34, 17, - 0, 280, 0, 0, 0, 0, 18, 15, 280, 16, - 19, 238, 280, 280, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 239, 240, 0, 0, 0, 0, 0, - 0, 0, 341, 0, 0, 0, 0, 0, 347, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 361, 362, 0, 0, 0, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 0, 0, 0, 0, 0, 241, 0, 242, 243, - 139, 140, 0, 244, 245, 246, 0, 0, 0, 391, - 0, 393, 0, 247, 0, 397, 248, 0, 249, 0, - 0, 250, 0, 0, 401, 402, 403, 0, 53, 54, - 0, 101, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 15, 0, 16, 0, 0, - 0, 0, 0, 0, 0, 423, 424, 0, 0, 0, - 0, 0, 0, 431, 0, 0, 0, 0, 69, 0, - 53, 54, 437, 101, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 67, 68, 15, 0, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 455, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69, 0, 0, 0, 0, 0, 0, 0, 0, 268, - 269, 53, 54, 270, 0, 0, 0, 0, 70, 0, - 0, 71, 0, 475, 72, 0, 73, 102, 15, 0, - 16, 0, 271, 272, 273, 0, 485, 0, 0, 0, - 0, 0, 0, 489, 274, 275, 0, 492, 493, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 70, 0, 0, 71, 276, 0, 72, 0, 73, 321, - 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 0, 0, 0, 0, 0, 241, 0, 242, - 243, 139, 140, 0, 244, 245, 246, 268, 269, 0, - 0, 270, 0, 0, 0, 0, 0, 277, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 271, 272, 273, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 0, 0, 0, 0, 0, 241, 0, 242, 243, 139, - 140, 0, 244, 245, 246, 0, 0, 0, 0, 0, - 0, 0, 0, 53, 54, 277, 101, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 15, 0, 16, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 185, 0, 0, 0, 0, - 0, 53, 54, 69, 101, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 15, 0, - 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 261, 0, 0, 0, 0, 0, 53, - 54, 69, 101, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 67, 68, 15, 0, 16, 0, - 0, 0, 0, 70, 0, 0, 71, 0, 0, 72, - 0, 73, 0, 0, 0, 0, 0, 0, 0, 69, - 53, 54, 0, 101, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 15, 0, 16, - 0, 70, 0, 0, 71, 0, 0, 72, 0, 73, - 0, 0, 335, 0, 0, 0, 0, 0, 53, 54, - 69, 101, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 15, 0, 16, 0, 70, - 0, 0, 71, 0, 317, 72, 0, 73, 0, 0, - 382, 0, 0, 0, 0, 0, 53, 54, 69, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 15, 0, 16, 0, 0, 0, 0, - 70, 0, 0, 71, 0, 0, 72, 0, 73, 0, - 0, 0, 0, 0, 53, 54, 69, 101, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 15, 0, 16, 0, 0, 0, 0, 70, 0, - 0, 71, 0, 0, 72, 0, 73, 0, 0, 0, - 0, 0, 53, 54, 69, 101, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 67, 68, 15, - 0, 16, 0, 0, 0, 0, 70, 0, 0, 71, - 0, 0, 72, 0, 73, 0, 0, 0, 0, 0, - 53, 54, 69, 191, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 15, 0, 16, - 0, 0, 0, 0, 70, 0, 0, 71, 0, 0, - 72, 0, 73, 0, 0, 0, 0, 0, 0, 0, - 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 70, 0, 0, 71, 0, 0, 72, 0, - 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 109, 0, 0, 0, 0, 0, 0, 0, 0, - 70, 110, 111, 71, 0, 0, 72, 0, 73, 0, - 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 0, 0, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -442 +static const short int yypact[] = +{ + -442, 25, 181, 372, -442, -442, -442, -442, -442, -442, + -442, -16, 33, 42, -442, -442, -14, -442, -442, 12, + -57, 18, 44, -25, -442, 33, 75, 106, -442, -442, + -442, -442, 1012, -21, -442, -442, 4, -442, -442, -442, + -442, 29, 32, 49, -442, 47, 75, 1012, 97, 97, + -442, -442, -442, -442, -442, -442, -442, 63, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, 170, 171, 173, 524, -442, 4, 72, -442, + -442, -84, -442, -442, -442, -442, -442, 1176, -442, 156, + 94, 175, 158, -442, -442, -442, -442, -442, 1050, 1088, + -442, 74, 76, -442, -442, -84, -37, 78, 819, -442, + -442, 1050, -442, 131, 1126, 14, 128, 33, -442, -442, + -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, -442, 1050, 1050, 1050, 1050, 1050, 1050, + 1050, -442, -442, 1050, 1050, 1050, 1050, 1050, 1050, 1050, + 1050, 1050, 1050, -442, 33, -442, 60, -442, -442, -442, + -442, -442, -442, -442, 23, -442, 129, 155, 190, 157, + 194, 159, 196, 167, 197, 195, 198, 169, 199, 200, + 406, -442, 1050, 1050, 1050, -442, 857, -442, 100, 101, + 617, -442, -442, 63, -442, 617, 617, -442, -442, -442, + -442, -442, -442, -442, -442, -442, -442, 617, 1012, 105, + 107, -442, 617, 118, 109, 178, 111, 123, 132, 133, + 134, 135, 137, 617, 617, 617, 138, 1012, 1050, 1050, + 209, -442, 139, -442, -442, -442, -442, -442, -442, -442, + -442, -442, -442, 140, 141, 144, 145, 146, 147, 895, + 1088, 566, 211, 148, 149, 150, 151, -442, -442, 139, + -66, -88, -84, -442, 4, -442, 154, 152, 936, -442, + -442, -442, -442, -442, -442, -442, -442, -442, 184, 1088, + -442, -442, -442, -442, 168, -442, 172, 617, 5, -442, + 6, -442, 174, 617, 153, 1050, 1050, 1050, 1050, 1050, + 1050, 1050, 1050, 176, 177, 179, 1050, 617, 617, 180, + -442, -20, -442, 1088, 1088, 1088, 1088, 1088, 1088, -442, + -442, 24, -23, -442, -24, -442, 1088, 1088, 1088, 1088, + -442, -442, -442, -442, -442, 974, 226, -442, -442, 221, + -3, 241, 252, 182, 617, 271, 617, 1050, -442, 185, + 617, -442, 186, -442, -442, 188, 192, -442, -442, 617, + 617, 617, -442, 191, -442, 1050, 253, 278, -442, 139, + 174, 250, 201, 202, 203, 204, 1088, -442, -442, -442, + 205, 206, 207, 208, -442, -442, -442, 244, 210, -442, + 617, 617, 1050, 216, -442, 216, -442, 222, 617, 223, + 1050, 1050, 1050, -442, -442, -442, 1050, 617, -442, -442, + -442, 227, 1050, 1088, 1088, 1088, 1088, -442, 1088, 1088, + 1088, 1088, 295, -442, 280, 224, 228, 222, 230, 259, + -442, -442, 1050, 219, 617, -442, -442, -442, 234, -442, + -442, 235, 231, 236, 240, 242, 238, 243, 245, 246, + -442, -442, 309, 41, 311, -442, -442, 239, -442, -442, + 1088, -442, 1088, 1088, -442, -442, -442, -442, 617, -442, + 715, 58, 330, -442, 247, 248, 257, -442, 255, -442, + 715, 617, -442, -442, -442, 336, 263, 301, 617, 351, + 355, -442, 617, 617, -442, -442 }; -static const short yycheck[] = { 30, - 114, 97, 114, 109, 208, 45, 112, 29, 23, 15, - 2, 451, 257, 34, 45, 30, 73, 248, 249, 15, - 104, 104, 115, 112, 104, 58, 115, 110, 134, 469, - 114, 137, 138, 54, 114, 141, 142, 143, 144, 145, - 146, 104, 34, 22, 150, 24, 277, 110, 54, 106, - 10, 11, 12, 13, 14, 15, 16, 17, 54, 152, - 23, 110, 103, 20, 9, 96, 115, 10, 11, 12, - 13, 14, 15, 16, 17, 58, 21, 103, 109, 468, - 24, 112, 4, 75, 41, 42, 43, 44, 106, 478, - 47, 113, 104, 49, 50, 51, 103, 115, 103, 114, - 112, 132, 133, 134, 135, 136, 137, 138, 32, 33, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 178, 227, 367, 180, 181, 182, 104, 52, 53, 103, - 188, 89, 90, 108, 112, 193, 194, 10, 11, 12, - 13, 14, 15, 16, 17, 27, 28, 205, 3, 4, - 110, 106, 210, 184, 61, 62, 63, 64, 65, 3, - 4, 3, 4, 221, 222, 223, 206, 110, 3, 4, - 4, 3, 4, 4, 4, 206, 106, 24, 4, 24, - 0, 109, 109, 106, 56, 225, 4, 391, 294, 393, - 296, 297, 298, 4, 225, 226, 227, 4, 304, 4, - 104, 7, 4, 7, 7, 25, 107, 104, 104, 266, - 108, 31, 104, 36, 104, 311, 312, 313, 314, 315, - 316, 41, 42, 43, 44, 104, 104, 285, 324, 325, - 326, 327, 24, 291, 104, 104, 104, 104, 104, 59, - 104, 106, 24, 106, 106, 106, 106, 305, 306, 106, - 106, 60, 106, 106, 106, 104, 107, 34, 104, 24, - 108, 104, 293, 294, 295, 296, 297, 298, 299, 300, - 262, 21, 21, 304, 4, 104, 104, 104, 374, 104, - 104, 24, 104, 4, 342, 106, 344, 104, 104, 104, - 348, 36, 398, 399, 400, 54, 106, 4, 24, 357, - 358, 359, 333, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 54, 104, 345, 411, 412, 413, 414, 104, - 416, 417, 418, 419, 430, 104, 107, 107, 104, 107, - 388, 389, 363, 108, 107, 104, 110, 451, 396, 451, - 107, 104, 104, 107, 21, 36, 107, 405, 21, 107, - 107, 104, 107, 107, 110, 469, 107, 469, 21, 390, - 193, 194, 458, 104, 460, 461, 70, 398, 399, 400, - 21, 21, 205, 404, 432, 0, 0, 210, 34, 410, - 85, 20, 85, 85, 85, 334, 106, 47, 221, 222, - 223, 20, 178, 22, 333, 24, 44, 23, 2, 430, - 14, 404, 31, 32, 33, 345, 368, -1, 466, -1, - 5, 6, 41, 42, 43, 44, -1, -1, 47, 48, - -1, 479, -1, -1, -1, -1, 55, 22, 486, 24, - 59, 26, 490, 491, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, - -1, -1, 285, -1, -1, -1, -1, -1, 291, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 305, 306, -1, -1, -1, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, -1, -1, -1, -1, -1, 91, -1, 93, 94, - 95, 96, -1, 98, 99, 100, -1, -1, -1, 342, - -1, 344, -1, 108, -1, 348, 111, -1, 113, -1, - -1, 116, -1, -1, 357, 358, 359, -1, 5, 6, - -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, -1, 24, -1, -1, - -1, -1, -1, -1, -1, 388, 389, -1, -1, -1, - -1, -1, -1, 396, -1, -1, -1, -1, 45, -1, - 5, 6, 405, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, -1, -1, -1, -1, -1, -1, 3, - 4, 5, 6, 7, -1, -1, -1, -1, 105, -1, - -1, 108, -1, 466, 111, -1, 113, 114, 22, -1, - 24, -1, 26, 27, 28, -1, 479, -1, -1, -1, - -1, -1, -1, 486, 38, 39, -1, 490, 491, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 105, -1, -1, 108, 58, -1, 111, -1, 113, 114, - -1, -1, -1, -1, -1, -1, -1, -1, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, -1, -1, -1, -1, -1, 91, -1, 93, - 94, 95, 96, -1, 98, 99, 100, 3, 4, -1, - -1, 7, -1, -1, -1, -1, -1, 111, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 26, 27, 28, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - -1, -1, -1, -1, -1, 91, -1, 93, 94, 95, - 96, -1, 98, 99, 100, -1, -1, -1, -1, -1, - -1, -1, -1, 5, 6, 111, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, - -1, 5, 6, 45, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, - 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 37, -1, -1, -1, -1, -1, 5, - 6, 45, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, - -1, -1, -1, 105, -1, -1, 108, -1, -1, 111, - -1, 113, -1, -1, -1, -1, -1, -1, -1, 45, - 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, - -1, 105, -1, -1, 108, -1, -1, 111, -1, 113, - -1, -1, 37, -1, -1, -1, -1, -1, 5, 6, - 45, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, -1, 24, -1, 105, - -1, -1, 108, -1, 110, 111, -1, 113, -1, -1, - 37, -1, -1, -1, -1, -1, 5, 6, 45, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, - 105, -1, -1, 108, -1, -1, 111, -1, 113, -1, - -1, -1, -1, -1, 5, 6, 45, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, -1, -1, -1, -1, 105, -1, - -1, 108, -1, -1, 111, -1, 113, -1, -1, -1, - -1, -1, 5, 6, 45, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - -1, 24, -1, -1, -1, -1, 105, -1, -1, 108, - -1, -1, 111, -1, 113, -1, -1, -1, -1, -1, - 5, 6, 45, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, - -1, -1, -1, -1, 105, -1, -1, 108, -1, -1, - 111, -1, 113, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 105, -1, -1, 108, -1, -1, 111, -1, - 113, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, - 105, 56, 57, 108, -1, -1, 111, -1, 113, -1, - -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, -1, -1, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102 +/* YYPGOTO[NTERM-NUM]. */ +static const short int yypgoto[] = +{ + -442, -442, -442, 290, 292, 294, 296, -115, -113, -441, + -442, 346, 362, -106, -442, -205, 50, -442, -246, -442, + -41, -442, -32, -442, -58, 277, -442, -97, 213, -232, + 338, -442, -442, -442, -442, -442, 342, -442, -442, -442, + -442, 7, -442, 62, -442, -442, 370, -442, -442, -442, + -442, 395, -442, -442, -387, -59, 166, -107, -442, 383, + -442, -442, -442, -442, -442, 54, -4, -442, -442, 36, + -442, -442 }; -/* -*-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. - - 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., 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 */ +/* 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 -123 +static const short int yytable[] = +{ + 79, 205, 181, 206, 191, 291, 95, 194, 84, 34, + 23, 208, 470, 330, 366, 79, 37, 105, 322, 324, + 344, 346, -60, 195, 332, 4, 17, 109, 18, 211, + 480, 109, 215, 216, 367, 196, 217, 218, 219, 220, + 221, 222, 26, 23, 331, 226, 45, 340, 227, 109, + 105, 197, 198, 199, 200, 201, 202, 203, 204, 345, + 345, 41, 42, 43, 47, 34, 165, 184, 197, 198, + 199, 200, 201, 202, 203, 204, 46, 185, 50, 190, + 376, 376, 190, 478, 107, 7, 8, 9, 10, 378, + 379, 48, 85, 486, 27, 28, 29, 30, 31, 52, + 38, 376, 209, 210, 190, 212, 213, 190, 190, 389, + 54, 190, 190, 190, 190, 190, 190, 223, 224, 225, + 190, 258, 309, 410, 260, 261, 262, 230, 376, 96, + 97, 282, 89, 231, 377, 90, 282, 282, 197, 198, + 199, 200, 201, 202, 203, 204, 159, 160, 282, 228, + 229, 469, 91, 282, 264, 92, 233, 234, -25, -25, + -24, -24, -23, -23, 282, 282, 282, 287, 479, -61, + -22, -22, 235, 236, 100, 101, 79, 102, 108, 162, + 158, -122, 163, 182, 186, 183, 307, 192, 430, 352, + 431, 354, 355, 356, -29, 79, 308, 190, -28, 362, + -27, -26, -32, 238, 268, -33, 5, 239, 269, 288, + 262, 290, 6, 294, 295, 296, 370, 371, 372, 373, + 374, 375, 7, 8, 9, 10, 293, 297, 282, 380, + 381, 382, 383, 310, 282, 325, 298, 299, 300, 301, + 11, 302, 306, 311, 338, 388, 313, 314, 282, 282, + 315, 316, 317, 318, 326, 327, 328, 329, 335, 336, + 366, 350, 390, 351, 190, 353, 190, 190, 190, 357, + 358, 333, 341, 391, 190, 394, 342, 408, 347, 417, + 359, 360, 409, 361, 365, 282, 412, 282, 392, 398, + 400, 282, 401, 435, 436, 437, 402, 406, 422, 450, + 282, 282, 282, 264, 451, 413, 414, 415, 416, 418, + 419, 420, 421, 345, 424, 190, 442, 443, 444, 445, + 429, 446, 447, 448, 449, 455, 432, 434, 452, 456, + 468, 282, 282, 407, 440, 460, 453, 454, 205, 282, + 206, 458, 459, 461, 462, 464, 463, 472, 282, 473, + 465, 481, 466, 467, 482, 483, 205, 488, 206, 485, + 190, 284, 285, 474, 484, 475, 476, 489, 190, 190, + 190, 490, 492, 286, 190, 282, 493, 149, 292, 150, + 441, 151, 87, 152, 49, 188, 386, 99, 94, 303, + 304, 305, -35, 257, 17, 51, 18, 385, 24, 40, + 190, 397, 438, 6, -35, -35, 411, 0, 0, 282, + 0, 55, 56, -35, -35, -35, -35, 0, 0, -35, + 19, 0, 282, 0, 0, 0, 0, 20, 17, 282, + 18, 21, 240, 282, 282, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 241, 242, 0, 0, 0, 0, + 0, 0, 0, 343, 0, 0, 0, 0, 0, 349, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 363, 364, 0, 0, 0, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 0, 0, 0, 0, 0, 243, 0, 244, + 245, 141, 142, 0, 246, 247, 248, 0, 0, 0, + 393, 0, 395, 0, 249, 0, 399, 250, 0, 251, + 0, 0, 252, 0, 0, 403, 404, 405, 0, 55, + 56, 0, 103, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 17, 0, 18, 0, + 0, 0, 0, 0, 0, 0, 425, 426, 0, 0, + 0, 0, 0, 0, 433, 0, 0, 0, 0, 71, + 0, 55, 56, 439, 103, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 69, 70, 17, 0, + 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 457, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, + 270, 271, 55, 56, 272, 0, 0, 0, 0, 72, + 0, 0, 73, 0, 477, 74, 0, 75, 104, 17, + 0, 18, 0, 273, 274, 275, 0, 487, 0, 0, + 0, 0, 0, 0, 491, 276, 277, 0, 494, 495, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 72, 0, 0, 73, 278, 0, 74, 0, 75, + 323, 0, 0, 0, 0, 0, 0, 0, 0, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 0, 0, 0, 0, 0, 243, 0, + 244, 245, 141, 142, 0, 246, 247, 248, 270, 271, + 0, 0, 272, 0, 0, 0, 0, 0, 279, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 273, 274, 275, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 276, 277, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 0, 0, 0, 0, 0, 243, 0, 244, 245, + 141, 142, 0, 246, 247, 248, 0, 0, 0, 0, + 0, 0, 0, 0, 55, 56, 279, 103, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 17, 0, 18, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, + 0, 0, 55, 56, 71, 103, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 17, + 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 263, 0, 0, 0, 0, 0, + 55, 56, 71, 103, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 69, 70, 17, 0, 18, + 0, 0, 0, 0, 72, 0, 0, 73, 0, 0, + 74, 0, 75, 0, 0, 0, 0, 0, 0, 0, + 71, 55, 56, 0, 103, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 17, 0, + 18, 0, 72, 0, 0, 73, 0, 0, 74, 0, + 75, 0, 0, 337, 0, 0, 0, 0, 0, 55, + 56, 71, 103, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 17, 0, 18, 0, + 72, 0, 0, 73, 0, 319, 74, 0, 75, 0, + 0, 384, 0, 0, 0, 0, 0, 55, 56, 71, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 17, 0, 18, 0, 0, 0, + 0, 72, 0, 0, 73, 0, 0, 74, 0, 75, + 0, 0, 0, 0, 0, 55, 56, 71, 103, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 17, 0, 18, 0, 0, 0, 0, 72, + 0, 0, 73, 0, 0, 74, 0, 75, 0, 0, + 0, 0, 0, 55, 56, 71, 103, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 69, 70, + 17, 0, 18, 0, 0, 0, 0, 72, 0, 0, + 73, 0, 0, 74, 0, 75, 0, 0, 0, 0, + 0, 55, 56, 71, 193, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 17, 0, + 18, 0, 0, 0, 0, 72, 0, 0, 73, 0, + 0, 74, 0, 75, 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, 0, + 0, 0, 0, 72, 0, 0, 73, 0, 0, 74, + 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 111, 0, 0, 0, 0, 0, 0, 0, + 0, 72, 112, 113, 73, 0, 0, 74, 0, 75, + 0, 0, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 0, 0, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148 +}; -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif +static const short int yycheck[] = +{ + 32, 116, 99, 116, 111, 210, 47, 114, 29, 23, + 3, 117, 453, 259, 34, 47, 30, 75, 250, 251, + 15, 15, 106, 9, 112, 0, 22, 115, 24, 136, + 471, 115, 139, 140, 54, 21, 143, 144, 145, 146, + 147, 148, 58, 36, 110, 152, 103, 279, 154, 115, + 108, 10, 11, 12, 13, 14, 15, 16, 17, 54, + 54, 49, 50, 51, 20, 23, 98, 104, 10, 11, + 12, 13, 14, 15, 16, 17, 58, 114, 103, 111, + 104, 104, 114, 470, 77, 41, 42, 43, 44, 112, + 114, 47, 113, 480, 61, 62, 63, 64, 65, 24, + 114, 104, 134, 135, 136, 137, 138, 139, 140, 112, + 4, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 180, 229, 369, 182, 183, 184, 104, 104, 32, + 33, 190, 103, 110, 110, 103, 195, 196, 10, 11, + 12, 13, 14, 15, 16, 17, 52, 53, 207, 89, + 90, 110, 103, 212, 186, 108, 27, 28, 3, 4, + 3, 4, 3, 4, 223, 224, 225, 208, 110, 106, + 3, 4, 3, 4, 4, 4, 208, 4, 106, 4, + 24, 0, 24, 109, 106, 109, 227, 56, 393, 296, + 395, 298, 299, 300, 4, 227, 228, 229, 4, 306, + 4, 4, 7, 4, 104, 7, 25, 7, 107, 104, + 268, 104, 31, 104, 36, 104, 313, 314, 315, 316, + 317, 318, 41, 42, 43, 44, 108, 104, 287, 326, + 327, 328, 329, 24, 293, 24, 104, 104, 104, 104, + 59, 104, 104, 104, 60, 24, 106, 106, 307, 308, + 106, 106, 106, 106, 106, 106, 106, 106, 104, 107, + 34, 108, 21, 295, 296, 297, 298, 299, 300, 301, + 302, 264, 104, 21, 306, 4, 104, 24, 104, 376, + 104, 104, 4, 104, 104, 344, 36, 346, 106, 104, + 104, 350, 104, 400, 401, 402, 104, 106, 54, 4, + 359, 360, 361, 335, 24, 104, 104, 104, 104, 104, + 104, 104, 104, 54, 104, 347, 413, 414, 415, 416, + 104, 418, 419, 420, 421, 432, 104, 104, 104, 110, + 21, 390, 391, 365, 107, 104, 108, 107, 453, 398, + 453, 107, 107, 107, 104, 107, 104, 36, 407, 110, + 107, 21, 107, 107, 107, 107, 471, 21, 471, 104, + 392, 195, 196, 460, 107, 462, 463, 104, 400, 401, + 402, 70, 21, 207, 406, 434, 21, 87, 212, 87, + 412, 87, 36, 87, 22, 108, 336, 49, 46, 223, + 224, 225, 20, 180, 22, 25, 24, 335, 3, 16, + 432, 347, 406, 31, 32, 33, 370, -1, -1, 468, + -1, 5, 6, 41, 42, 43, 44, -1, -1, 47, + 48, -1, 481, -1, -1, -1, -1, 55, 22, 488, + 24, 59, 26, 492, 493, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, + -1, -1, -1, 287, -1, -1, -1, -1, -1, 293, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 307, 308, -1, -1, -1, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, -1, -1, -1, -1, -1, 91, -1, 93, + 94, 95, 96, -1, 98, 99, 100, -1, -1, -1, + 344, -1, 346, -1, 108, -1, 350, 111, -1, 113, + -1, -1, 116, -1, -1, 359, 360, 361, -1, 5, + 6, -1, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, + -1, -1, -1, -1, -1, -1, 390, 391, -1, -1, + -1, -1, -1, -1, 398, -1, -1, -1, -1, 45, + -1, 5, 6, 407, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 434, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, + 3, 4, 5, 6, 7, -1, -1, -1, -1, 105, + -1, -1, 108, -1, 468, 111, -1, 113, 114, 22, + -1, 24, -1, 26, 27, 28, -1, 481, -1, -1, + -1, -1, -1, -1, 488, 38, 39, -1, 492, 493, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 105, -1, -1, 108, 58, -1, 111, -1, 113, + 114, -1, -1, -1, -1, -1, -1, -1, -1, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, -1, -1, -1, -1, -1, 91, -1, + 93, 94, 95, 96, -1, 98, 99, 100, 3, 4, + -1, -1, 7, -1, -1, -1, -1, -1, 111, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 26, 27, 28, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, -1, -1, -1, -1, -1, 91, -1, 93, 94, + 95, 96, -1, 98, 99, 100, -1, -1, -1, -1, + -1, -1, -1, -1, 5, 6, 111, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, + -1, -1, 5, 6, 45, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, + 5, 6, 45, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, + -1, -1, -1, -1, 105, -1, -1, 108, -1, -1, + 111, -1, 113, -1, -1, -1, -1, -1, -1, -1, + 45, 5, 6, -1, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, + 24, -1, 105, -1, -1, 108, -1, -1, 111, -1, + 113, -1, -1, 37, -1, -1, -1, -1, -1, 5, + 6, 45, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, + 105, -1, -1, 108, -1, 110, 111, -1, 113, -1, + -1, 37, -1, -1, -1, -1, -1, 5, 6, 45, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, + -1, 105, -1, -1, 108, -1, -1, 111, -1, 113, + -1, -1, -1, -1, -1, 5, 6, 45, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 24, -1, -1, -1, -1, 105, + -1, -1, 108, -1, -1, 111, -1, 113, -1, -1, + -1, -1, -1, 5, 6, 45, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, -1, 24, -1, -1, -1, -1, 105, -1, -1, + 108, -1, -1, 111, -1, 113, -1, -1, -1, -1, + -1, 5, 6, 45, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, + 24, -1, -1, -1, -1, 105, -1, -1, 108, -1, + -1, 111, -1, 113, -1, -1, -1, -1, -1, -1, + -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 105, -1, -1, 108, -1, -1, 111, + -1, 113, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, + -1, 105, 56, 57, 108, -1, -1, 111, -1, 113, + -1, -1, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, -1, -1, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102 +}; -/* 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 unsigned char yystos[] = +{ + 0, 148, 149, 150, 0, 25, 31, 41, 42, 43, + 44, 59, 129, 165, 167, 168, 175, 22, 24, 48, + 55, 59, 128, 158, 168, 169, 58, 61, 62, 63, + 64, 65, 130, 163, 23, 176, 177, 30, 114, 166, + 176, 49, 50, 51, 155, 103, 58, 20, 47, 129, + 103, 163, 24, 153, 4, 5, 6, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 45, 105, 108, 111, 113, 118, 137, 138, 139, + 140, 141, 158, 172, 29, 113, 164, 128, 180, 103, + 103, 103, 108, 156, 153, 137, 32, 33, 147, 147, + 4, 4, 4, 8, 114, 141, 142, 158, 106, 115, + 35, 46, 56, 57, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 120, + 121, 122, 123, 178, 184, 185, 187, 188, 24, 52, + 53, 154, 4, 24, 157, 139, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 124, 125, 127, + 139, 144, 109, 109, 104, 114, 106, 37, 142, 143, + 139, 174, 56, 8, 174, 9, 21, 10, 11, 12, + 13, 14, 15, 16, 17, 124, 125, 126, 130, 139, + 139, 174, 139, 139, 181, 174, 174, 174, 174, 174, + 174, 174, 174, 139, 139, 139, 174, 130, 89, 90, + 104, 110, 152, 27, 28, 3, 4, 119, 4, 7, + 26, 38, 39, 91, 93, 94, 98, 99, 100, 108, + 111, 113, 116, 120, 121, 122, 123, 145, 172, 151, + 141, 141, 141, 37, 139, 160, 161, 162, 104, 107, + 3, 4, 7, 26, 27, 28, 38, 39, 58, 111, + 145, 171, 172, 173, 173, 173, 173, 137, 104, 132, + 104, 132, 173, 108, 104, 36, 104, 104, 104, 104, + 104, 104, 104, 173, 173, 173, 104, 137, 139, 174, + 24, 104, 135, 106, 106, 106, 106, 106, 106, 110, + 144, 146, 146, 114, 146, 24, 106, 106, 106, 106, + 135, 110, 112, 158, 159, 104, 107, 37, 60, 170, + 146, 104, 104, 173, 15, 54, 15, 104, 186, 173, + 108, 139, 174, 139, 174, 174, 174, 139, 139, 104, + 104, 104, 174, 173, 173, 104, 34, 54, 133, 136, + 144, 144, 144, 144, 144, 144, 104, 110, 112, 114, + 144, 144, 144, 144, 37, 160, 133, 134, 24, 112, + 21, 21, 106, 173, 4, 173, 174, 182, 104, 173, + 104, 104, 104, 173, 173, 173, 106, 139, 24, 4, + 135, 186, 36, 104, 104, 104, 104, 144, 104, 104, + 104, 104, 54, 131, 104, 173, 173, 182, 183, 104, + 132, 132, 104, 173, 104, 174, 174, 174, 183, 173, + 107, 139, 144, 144, 144, 144, 144, 144, 144, 144, + 4, 24, 104, 108, 107, 174, 110, 173, 107, 107, + 104, 107, 104, 104, 107, 107, 107, 107, 21, 110, + 126, 179, 36, 110, 144, 144, 144, 173, 171, 110, + 126, 21, 107, 107, 107, 104, 171, 173, 21, 104, + 70, 173, 21, 21, 173, 173 +}; #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); \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ while (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 (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 (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) -#endif -#endif /* not YYLSP_NEEDED */ +# define YYLEX yylex () #endif -/* If nonreentrant, generate the variables here */ +/* Enable debugging if requested. */ +#if YYDEBUG -#ifndef YYPURE +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) -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 (__cplusplus) +static void +yy_stack_print (short int *bottom, short int *top) +#else +static void +yy_stack_print (bottom, top) + short int *bottom; + short int *top; #endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; #endif +{ + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", + yyrule - 1, yylno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif + -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif +{ + const char *yys = yystr; + + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; +} +# 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. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + 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) { - register char *f = from; - register char *t = to; - register int i = count; + if (*yystr == '"') + { + size_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); - while (i-- > 0) - *t++ = *f++; + return yystpcpy (yyres, yystr) - yyres; } +# endif + +#endif /* YYERROR_VERBOSE */ + + -#else /* __cplusplus */ +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ +#if defined (__STDC__) || defined (__cplusplus) static void -__yy_memcpy (char *to, char *from, unsigned int count) +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif { - register char *t = to; - register char *f = from; - register int i = count; + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + - while (i-- > 0) - *t++ = *f++; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); } +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +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 +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} -#line 217 "/usr/share/bison.simple" -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM); +# 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. | +`----------*/ -/* 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 (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) +int +yyparse (void) #else -int yyparse (void); +int +yyparse () + #endif #endif - -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; + + 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; + + /* 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. */ + short int yyssa[YYINITDEPTH]; + short int *yyss = yyssa; + short int *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else #define YYPOPSTACK (yyvsp--, yyssp--) -#endif - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; + YYSIZE_T yystacksize = YYINITDEPTH; -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ int yylen; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; @@ -2004,687 +2644,723 @@ 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: - - *++yyssp = yystate; - - 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 + 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++; + 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; + short int *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 + + { + short int *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: + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: /* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ +/* Read a look-ahead token if we need one and don't already have one. */ /* yyresume: */ - /* 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 == 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. */ - -#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. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; yystate = yyn; goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; + -/* Do a reduction. yyn is the number of a rule to reduce with. */ +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 3: +#line 1018 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { - int i; + if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! + GEN_ERROR("Value too large for type!"); + (yyval.SIntVal) = (int32_t)(yyvsp[0].UIntVal); + CHECK_FOR_ERROR +;} + break; - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + case 5: +#line 1027 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! + GEN_ERROR("Value too large for type!"); + (yyval.SInt64Val) = (int64_t)(yyvsp[0].UInt64Val); + CHECK_FOR_ERROR +;} + break; - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif + case 34: +#line 1051 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = (yyvsp[-1].StrVal); + CHECK_FOR_ERROR + ;} + break; + case 35: +#line 1055 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.StrVal) = 0; + CHECK_FOR_ERROR + ;} + break; - switch (yyn) { + case 36: +#line 1060 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} + break; -case 2: -#line 1011 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range! - ThrowException("Value too large for type!"); - yyval.SIntVal = (int32_t)yyvsp[0].UIntVal; -; - break;} -case 4: -#line 1019 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range! - ThrowException("Value too large for type!"); - yyval.SInt64Val = (int64_t)yyvsp[0].UInt64Val; -; - break;} -case 33: -#line 1042 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = yyvsp[-1].StrVal; - ; - break;} -case 34: -#line 1045 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.StrVal = 0; - ; - break;} -case 35: -#line 1049 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::InternalLinkage; ; - break;} -case 36: -#line 1050 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; - break;} -case 37: -#line 1051 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::WeakLinkage; ; - break;} -case 38: -#line 1052 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::AppendingLinkage; ; - break;} -case 39: -#line 1053 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Linkage = GlobalValue::ExternalLinkage; ; - break;} -case 40: -#line 1055 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 41: -#line 1056 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::C; ; - break;} -case 42: -#line 1057 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::CSRet; ; - break;} -case 43: -#line 1058 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Fast; ; - break;} -case 44: -#line 1059 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = CallingConv::Cold; ; - break;} -case 45: -#line 1060 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) - ThrowException("Calling conv too large!"); - yyval.UIntVal = yyvsp[0].UInt64Val; - ; - break;} -case 46: -#line 1068 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 47: -#line 1069 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) - ThrowException("Alignment must be a power of two!"); -; - break;} -case 48: -#line 1074 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.UIntVal = 0; ; - break;} -case 49: -#line 1075 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.UIntVal = yyvsp[0].UInt64Val; - if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) - ThrowException("Alignment must be a power of two!"); -; - break;} -case 50: -#line 1082 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) - if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') - ThrowException("Invalid character in section name!"); - yyval.StrVal = yyvsp[0].StrVal; -; - break;} -case 51: -#line 1089 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 52: -#line 1090 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = yyvsp[0].StrVal; ; - break;} -case 53: -#line 1095 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 54: -#line 1096 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{; - break;} -case 55: -#line 1097 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurGV->setSection(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 56: -#line 1101 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) - ThrowException("Alignment must be a power of two!"); - CurGV->setAlignment(yyvsp[0].UInt64Val); - ; - break;} -case 58: -#line 1114 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ; - break;} -case 60: -#line 1115 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ; - break;} -case 61: -#line 1117 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + case 37: +#line 1061 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} + break; + + case 38: +#line 1062 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} + break; + + case 39: +#line 1063 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} + break; + + case 40: +#line 1064 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} + break; + + case 41: +#line 1066 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 42: +#line 1067 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::C; ;} + break; + + case 43: +#line 1068 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::CSRet; ;} + break; + + case 44: +#line 1069 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Fast; ;} + break; + + case 45: +#line 1070 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = CallingConv::Cold; ;} + break; + + case 46: +#line 1071 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) + GEN_ERROR("Calling conv too large!"); + (yyval.UIntVal) = (yyvsp[0].UInt64Val); + CHECK_FOR_ERROR + ;} + break; + + case 47: +#line 1080 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 48: +#line 1081 "/proj/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 49: +#line 1087 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.UIntVal) = 0; ;} + break; + + case 50: +#line 1088 "/proj/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 51: +#line 1096 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) + if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') + GEN_ERROR("Invalid character in section name!"); + (yyval.StrVal) = (yyvsp[0].StrVal); + CHECK_FOR_ERROR +;} + break; + + case 52: +#line 1104 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 53: +#line 1105 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = (yyvsp[0].StrVal); ;} + break; + + case 54: +#line 1110 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 55: +#line 1111 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + {;} + break; + + case 56: +#line 1112 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurGV->setSection((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 57: +#line 1117 "/proj/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[0].UInt64Val)); + CHECK_FOR_ERROR + ;} + break; + + case 59: +#line 1131 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} + break; + + case 61: +#line 1132 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} + break; + + case 62: +#line 1134 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { if (!UpRefs.empty()) - ThrowException("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); - yyval.TypeVal = yyvsp[0].TypeVal; - ; - break;} -case 75: -#line 1128 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(OpaqueType::get()); - ; - break;} -case 76: -#line 1131 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); - ; - break;} -case 77: -#line 1134 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Named types are also simple types... - yyval.TypeVal = new PATypeHolder(getTypeVal(yyvsp[0].ValIDVal)); -; - break;} -case 78: -#line 1140 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Type UpReference - if (yyvsp[0].UInt64Val > (uint64_t)~0U) ThrowException("Value out of range!"); + GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); + (yyval.TypeVal) = (yyvsp[0].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 76: +#line 1146 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); + CHECK_FOR_ERROR + ;} + break; + + case 77: +#line 1150 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); + CHECK_FOR_ERROR + ;} + break; + + case 78: +#line 1154 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Named types are also simple types... + (yyval.TypeVal) = new PATypeHolder(getTypeVal((yyvsp[0].ValIDVal))); + CHECK_FOR_ERROR +;} + break; + + case 79: +#line 1161 "/proj/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[0].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"); - ; - break;} -case 79: -#line 1147 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Function derived type? + CHECK_FOR_ERROR + ;} + break; + + case 80: +#line 1169 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Function derived type? std::vector Params; - for (std::list::iterator I = yyvsp[-1].TypeList->begin(), - E = yyvsp[-1].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), + E = (yyvsp[-1].TypeList)->end(); I != E; ++I) Params.push_back(*I); bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(FunctionType::get(*yyvsp[-3].TypeVal,Params,isVarArg))); - delete yyvsp[-1].TypeList; // Delete the argument list - delete yyvsp[-3].TypeVal; // Delete the return type handle - ; - break;} -case 80: -#line 1159 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Sized array type? - yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; - ; - break;} -case 81: -#line 1163 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Packed array type? - const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); - if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) - ThrowException("Unsigned result not equal to signed result"); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FunctionType::get(*(yyvsp[-3].TypeVal),Params,isVarArg))); + delete (yyvsp[-1].TypeList); // Delete the argument list + delete (yyvsp[-3].TypeVal); // Delete the return type handle + CHECK_FOR_ERROR + ;} + break; + + case 81: +#line 1182 "/proj/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 82: +#line 1187 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Packed array type? + const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); + if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) + GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isPrimitiveType()) - ThrowException("Elemental type of a PackedType must be primitive"); - if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) - ThrowException("Vector length should be a power of 2!"); - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PackedType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); - delete yyvsp[-1].TypeVal; - ; - break;} -case 82: -#line 1174 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Structure type? + GEN_ERROR("Elemental type of a PackedType must be primitive"); + if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) + GEN_ERROR("Vector length should be a power of 2!"); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 83: +#line 1199 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Structure type? std::vector Elements; - for (std::list::iterator I = yyvsp[-1].TypeList->begin(), - E = yyvsp[-1].TypeList->end(); I != E; ++I) + for (std::list::iterator I = (yyvsp[-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[-1].TypeList; - ; - break;} -case 83: -#line 1183 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Empty structure type? - yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); - ; - break;} -case 84: -#line 1186 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Pointer type? - yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); - delete yyvsp[-1].TypeVal; - ; - break;} -case 85: -#line 1194 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeList = new std::list(); - yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ; - break;} -case 86: -#line 1198 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; - ; - break;} -case 88: -#line 1204 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeList=yyvsp[-2].TypeList)->push_back(Type::VoidTy); - ; - break;} -case 89: -#line 1207 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.TypeList = new std::list())->push_back(Type::VoidTy); - ; - break;} -case 90: -#line 1210 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TypeList = new std::list(); - ; - break;} -case 91: -#line 1220 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr - const ArrayType *ATy = dyn_cast(yyvsp[-3].TypeVal->get()); + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete (yyvsp[-1].TypeList); + CHECK_FOR_ERROR + ;} + break; + + case 84: +#line 1209 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Empty structure type? + (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ;} + break; + + case 85: +#line 1213 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Pointer type? + (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 86: +#line 1222 "/proj/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 87: +#line 1227 "/proj/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 89: +#line 1234 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(Type::VoidTy); + CHECK_FOR_ERROR + ;} + break; + + case 90: +#line 1238 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.TypeList) = new std::list())->push_back(Type::VoidTy); + CHECK_FOR_ERROR + ;} + break; + + case 91: +#line 1242 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TypeList) = new std::list(); + CHECK_FOR_ERROR + ;} + break; + + case 92: +#line 1253 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr + const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'!"); + GEN_ERROR("Cannot make array constant with type: '" + + (*(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[-1].ConstVector->size()) - ThrowException("Type mismatch: constant sized array initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) + GEN_ERROR("Type mismatch: constant sized array initialized with " + + utostr((yyvsp[-1].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()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + 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[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantArray::get(ATy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; - ; - break;} -case 92: -#line 1245 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + (yyval.ConstVal) = ConstantArray::get(ATy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + CHECK_FOR_ERROR + ;} + break; + + case 93: +#line 1279 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'!"); + GEN_ERROR("Cannot make array constant with type: '" + + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) - ThrowException("Type mismatch: constant sized array initialized with 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; - ; - break;} -case 93: -#line 1258 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const ArrayType *ATy = dyn_cast(yyvsp[-2].TypeVal->get()); + (yyval.ConstVal) = ConstantArray::get(ATy, std::vector()); + delete (yyvsp[-2].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 94: +#line 1293 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'!"); + GEN_ERROR("Cannot make array constant with type: '" + + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - if (NumElements != -1 && NumElements != (EndStr-yyvsp[0].StrVal)) - ThrowException("Can't build string constant of size " + - itostr((int)(EndStr-yyvsp[0].StrVal)) + + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + if (NumElements != -1 && NumElements != (EndStr-(yyvsp[0].StrVal))) + GEN_ERROR("Can't build string constant of size " + + itostr((int)(EndStr-(yyvsp[0].StrVal))) + " when array has size " + itostr(NumElements) + "!"); std::vector Vals; if (ETy == Type::SByteTy) { - for (signed char *C = (signed char *)yyvsp[0].StrVal; C != (signed char *)EndStr; ++C) + for (signed char *C = (signed char *)(yyvsp[0].StrVal); C != (signed char *)EndStr; ++C) Vals.push_back(ConstantSInt::get(ETy, *C)); } else if (ETy == Type::UByteTy) { - for (unsigned char *C = (unsigned char *)yyvsp[0].StrVal; + for (unsigned char *C = (unsigned char *)(yyvsp[0].StrVal); C != (unsigned char*)EndStr; ++C) Vals.push_back(ConstantUInt::get(ETy, *C)); } else { - free(yyvsp[0].StrVal); - ThrowException("Cannot build string arrays of non byte sized elements!"); + free((yyvsp[0].StrVal)); + GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } - free(yyvsp[0].StrVal); - yyval.ConstVal = ConstantArray::get(ATy, Vals); - delete yyvsp[-2].TypeVal; - ; - break;} -case 94: -#line 1287 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized arr - const PackedType *PTy = dyn_cast(yyvsp[-3].TypeVal->get()); + free((yyvsp[0].StrVal)); + (yyval.ConstVal) = ConstantArray::get(ATy, Vals); + delete (yyvsp[-2].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 95: +#line 1323 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized arr + const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (PTy == 0) - ThrowException("Cannot make packed constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'!"); + GEN_ERROR("Cannot make packed constant with type: '" + + (*(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[-1].ConstVector->size()) - ThrowException("Type mismatch: constant sized packed initialized with " + - utostr(yyvsp[-1].ConstVector->size()) + " arguments, but has size of " + + if (NumElements != -1 && NumElements != (int)(yyvsp[-1].ConstVector)->size()) + GEN_ERROR("Type mismatch: constant sized packed initialized with " + + utostr((yyvsp[-1].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()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + 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[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ConstVal = ConstantPacked::get(PTy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; - ; - break;} -case 95: -#line 1312 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-3].TypeVal->get()); + (yyval.ConstVal) = ConstantPacked::get(PTy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + CHECK_FOR_ERROR + ;} + break; + + case 96: +#line 1349 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (STy == 0) - ThrowException("Cannot make struct constant with type: '" + - (*yyvsp[-3].TypeVal)->getDescription() + "'!"); + GEN_ERROR("Cannot make struct constant with type: '" + + (*(yyvsp[-3].TypeVal))->getDescription() + "'!"); - if (yyvsp[-1].ConstVector->size() != STy->getNumContainedTypes()) - ThrowException("Illegal number of initializers for structure type!"); + 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[-1].ConstVector->size(); i != e; ++i) - if ((*yyvsp[-1].ConstVector)[i]->getType() != STy->getElementType(i)) - ThrowException("Expected type '" + + 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) + " of structure initializer!"); - yyval.ConstVal = ConstantStruct::get(STy, *yyvsp[-1].ConstVector); - delete yyvsp[-3].TypeVal; delete yyvsp[-1].ConstVector; - ; - break;} -case 96: -#line 1332 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const StructType *STy = dyn_cast(yyvsp[-2].TypeVal->get()); + (yyval.ConstVal) = ConstantStruct::get(STy, *(yyvsp[-1].ConstVector)); + delete (yyvsp[-3].TypeVal); delete (yyvsp[-1].ConstVector); + CHECK_FOR_ERROR + ;} + break; + + case 97: +#line 1370 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (STy == 0) - ThrowException("Cannot make struct constant with type: '" + - (*yyvsp[-2].TypeVal)->getDescription() + "'!"); + GEN_ERROR("Cannot make struct constant with type: '" + + (*(yyvsp[-2].TypeVal))->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) - ThrowException("Illegal number of initializers for structure type!"); + GEN_ERROR("Illegal number of initializers for structure type!"); - yyval.ConstVal = ConstantStruct::get(STy, std::vector()); - delete yyvsp[-2].TypeVal; - ; - break;} -case 97: -#line 1344 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const PointerType *PTy = dyn_cast(yyvsp[-1].TypeVal->get()); + (yyval.ConstVal) = ConstantStruct::get(STy, std::vector()); + delete (yyvsp[-2].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 98: +#line 1383 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get()); if (PTy == 0) - ThrowException("Cannot make null pointer constant with type: '" + - (*yyvsp[-1].TypeVal)->getDescription() + "'!"); + GEN_ERROR("Cannot make null pointer constant with type: '" + + (*(yyvsp[-1].TypeVal))->getDescription() + "'!"); - yyval.ConstVal = ConstantPointerNull::get(PTy); - delete yyvsp[-1].TypeVal; - ; - break;} -case 98: -#line 1353 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ConstVal = UndefValue::get(yyvsp[-1].TypeVal->get()); - delete yyvsp[-1].TypeVal; - ; - break;} -case 99: -#line 1357 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const PointerType *Ty = dyn_cast(yyvsp[-1].TypeVal->get()); + (yyval.ConstVal) = ConstantPointerNull::get(PTy); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 99: +#line 1393 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 100: +#line 1398 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get()); if (Ty == 0) - ThrowException("Global const reference must be a pointer type!"); + GEN_ERROR("Global const reference must be a pointer type!"); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -2696,7 +3372,7 @@ Function *SavedCurFn = CurFun.CurrentFunction; CurFun.CurrentFunction = 0; - Value *V = getValNonImprovising(Ty, yyvsp[0].ValIDVal); + Value *V = getValNonImprovising(Ty, (yyvsp[0].ValIDVal)); CurFun.CurrentFunction = SavedCurFn; @@ -2710,14 +3386,14 @@ // First check to see if the forward references value is already created! PerModuleInfo::GlobalRefsType::iterator I = - CurModule.GlobalRefs.find(std::make_pair(PT, yyvsp[0].ValIDVal)); + CurModule.GlobalRefs.find(std::make_pair(PT, (yyvsp[0].ValIDVal))); if (I != CurModule.GlobalRefs.end()) { V = I->second; // Placeholder already exists, use it... - yyvsp[0].ValIDVal.destroy(); + (yyvsp[0].ValIDVal).destroy(); } else { std::string Name; - if (yyvsp[0].ValIDVal.Type == ValID::NameVal) Name = yyvsp[0].ValIDVal.Name; + if ((yyvsp[0].ValIDVal).Type == ValID::NameVal) Name = (yyvsp[0].ValIDVal).Name; // Create the forward referenced global. GlobalValue *GV; @@ -2732,276 +3408,331 @@ } // 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[0].ValIDVal)), GV)); V = GV; } } - yyval.ConstVal = cast(V); - delete yyvsp[-1].TypeVal; // Free the type handle - ; - break;} -case 100: -#line 1416 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-1].TypeVal->get() != yyvsp[0].ConstVal->getType()) - ThrowException("Mismatched types for constant expression!"); - yyval.ConstVal = yyvsp[0].ConstVal; - delete yyvsp[-1].TypeVal; - ; - break;} -case 101: -#line 1422 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const Type *Ty = yyvsp[-1].TypeVal->get(); + (yyval.ConstVal) = cast(V); + delete (yyvsp[-1].TypeVal); // Free the type handle + CHECK_FOR_ERROR + ;} + break; + + case 101: +#line 1458 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) + GEN_ERROR("Mismatched types for constant expression!"); + (yyval.ConstVal) = (yyvsp[0].ConstVal); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 102: +#line 1465 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const Type *Ty = (yyvsp[-1].TypeVal)->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) - ThrowException("Cannot create a null initialized value of this type!"); - yyval.ConstVal = Constant::getNullValue(Ty); - delete yyvsp[-1].TypeVal; - ; - break;} -case 102: -#line 1430 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantSInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].SInt64Val)) - ThrowException("Constant value doesn't fit in type!"); - yyval.ConstVal = ConstantSInt::get(yyvsp[-1].PrimType, yyvsp[0].SInt64Val); - ; - break;} -case 103: -#line 1435 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // integral constants - if (!ConstantUInt::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].UInt64Val)) - ThrowException("Constant value doesn't fit in type!"); - yyval.ConstVal = ConstantUInt::get(yyvsp[-1].PrimType, yyvsp[0].UInt64Val); - ; - break;} -case 104: -#line 1440 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - yyval.ConstVal = ConstantBool::True; - ; - break;} -case 105: -#line 1443 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Boolean constants - yyval.ConstVal = ConstantBool::False; - ; - break;} -case 106: -#line 1446 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Float & Double constants - if (!ConstantFP::isValueValidForType(yyvsp[-1].PrimType, yyvsp[0].FPVal)) - ThrowException("Floating point constant invalid for type!!"); - yyval.ConstVal = ConstantFP::get(yyvsp[-1].PrimType, yyvsp[0].FPVal); - ; - break;} -case 107: -#line 1453 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!yyvsp[-3].ConstVal->getType()->isFirstClassType()) - ThrowException("cast constant expression from a non-primitive type: '" + - yyvsp[-3].ConstVal->getType()->getDescription() + "'!"); - if (!yyvsp[-1].TypeVal->get()->isFirstClassType()) - ThrowException("cast constant expression to a non-primitive type: '" + - yyvsp[-1].TypeVal->get()->getDescription() + "'!"); - yyval.ConstVal = ConstantExpr::getCast(yyvsp[-3].ConstVal, yyvsp[-1].TypeVal->get()); - delete yyvsp[-1].TypeVal; - ; - break;} -case 108: -#line 1463 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[-2].ConstVal->getType())) - ThrowException("GetElementPtr requires a pointer operand!"); + GEN_ERROR("Cannot create a null initialized value of this type!"); + (yyval.ConstVal) = Constant::getNullValue(Ty); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 103: +#line 1474 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantSInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) + GEN_ERROR("Constant value doesn't fit in type!"); + (yyval.ConstVal) = ConstantSInt::get((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val)); + CHECK_FOR_ERROR + ;} + break; + + case 104: +#line 1480 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // integral constants + if (!ConstantUInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) + GEN_ERROR("Constant value doesn't fit in type!"); + (yyval.ConstVal) = ConstantUInt::get((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val)); + CHECK_FOR_ERROR + ;} + break; + + case 105: +#line 1486 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + (yyval.ConstVal) = ConstantBool::True; + CHECK_FOR_ERROR + ;} + break; + + case 106: +#line 1490 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Boolean constants + (yyval.ConstVal) = ConstantBool::False; + CHECK_FOR_ERROR + ;} + break; + + case 107: +#line 1494 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Float & Double constants + if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) + GEN_ERROR("Floating point constant invalid for type!!"); + (yyval.ConstVal) = ConstantFP::get((yyvsp[-1].PrimType), (yyvsp[0].FPVal)); + CHECK_FOR_ERROR + ;} + break; + + case 108: +#line 1502 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!(yyvsp[-3].ConstVal)->getType()->isFirstClassType()) + GEN_ERROR("cast constant expression from a non-primitive type: '" + + (yyvsp[-3].ConstVal)->getType()->getDescription() + "'!"); + if (!(yyvsp[-1].TypeVal)->get()->isFirstClassType()) + GEN_ERROR("cast constant expression to a non-primitive type: '" + + (yyvsp[-1].TypeVal)->get()->getDescription() + "'!"); + (yyval.ConstVal) = ConstantExpr::getCast((yyvsp[-3].ConstVal), (yyvsp[-1].TypeVal)->get()); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 109: +#line 1513 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[-2].ConstVal)->getType())) + GEN_ERROR("GetElementPtr requires a pointer operand!"); // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct // indices to uint struct indices for compatibility. generic_gep_type_iterator::iterator> - GTI = gep_type_begin(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end()), - GTE = gep_type_end(yyvsp[-2].ConstVal->getType(), yyvsp[-1].ValueList->begin(), yyvsp[-1].ValueList->end()); - for (unsigned i = 0, e = yyvsp[-1].ValueList->size(); i != e && GTI != GTE; ++i, ++GTI) + GTI = gep_type_begin((yyvsp[-2].ConstVal)->getType(), (yyvsp[-1].ValueList)->begin(), (yyvsp[-1].ValueList)->end()), + GTE = gep_type_end((yyvsp[-2].ConstVal)->getType(), (yyvsp[-1].ValueList)->begin(), (yyvsp[-1].ValueList)->end()); + for (unsigned i = 0, e = (yyvsp[-1].ValueList)->size(); i != e && GTI != GTE; ++i, ++GTI) if (isa(*GTI)) // Only change struct indices - if (ConstantUInt *CUI = dyn_cast((*yyvsp[-1].ValueList)[i])) + if (ConstantUInt *CUI = dyn_cast((*(yyvsp[-1].ValueList))[i])) if (CUI->getType() == Type::UByteTy) - (*yyvsp[-1].ValueList)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + (*(yyvsp[-1].ValueList))[i] = ConstantExpr::getCast(CUI, Type::UIntTy); const Type *IdxTy = - GetElementPtrInst::getIndexedType(yyvsp[-2].ConstVal->getType(), *yyvsp[-1].ValueList, true); + GetElementPtrInst::getIndexedType((yyvsp[-2].ConstVal)->getType(), *(yyvsp[-1].ValueList), true); if (!IdxTy) - ThrowException("Index list invalid for constant getelementptr!"); + GEN_ERROR("Index list invalid for constant getelementptr!"); std::vector 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[-1].ValueList)->size(); i != e; ++i) + if (Constant *C = dyn_cast((*(yyvsp[-1].ValueList))[i])) IdxVec.push_back(C); else - ThrowException("Indices to constant getelementptr must be constants!"); + GEN_ERROR("Indices to constant getelementptr must be constants!"); - delete yyvsp[-1].ValueList; + delete (yyvsp[-1].ValueList); - yyval.ConstVal = ConstantExpr::getGetElementPtr(yyvsp[-2].ConstVal, IdxVec); - ; - break;} -case 109: -#line 1494 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-5].ConstVal->getType() != Type::BoolTy) - ThrowException("Select condition must be of boolean type!"); - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) - ThrowException("Select operand types must match!"); - yyval.ConstVal = ConstantExpr::getSelect(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 110: -#line 1501 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) - ThrowException("Binary operator types must match!"); + (yyval.ConstVal) = ConstantExpr::getGetElementPtr((yyvsp[-2].ConstVal), IdxVec); + CHECK_FOR_ERROR + ;} + break; + + case 110: +#line 1545 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-5].ConstVal)->getType() != Type::BoolTy) + GEN_ERROR("Select condition must be of boolean type!"); + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + GEN_ERROR("Select operand types must match!"); + (yyval.ConstVal) = ConstantExpr::getSelect((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 111: +#line 1553 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + GEN_ERROR("Binary operator types must match!"); // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the // broken case. See PR424 for more information. - if (!isa(yyvsp[-3].ConstVal->getType())) { - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); + if (!isa((yyvsp[-3].ConstVal)->getType())) { + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); } else { const Type *IntPtrTy = 0; switch (CurModule.CurrentModule->getPointerSize()) { case Module::Pointer32: IntPtrTy = Type::IntTy; break; case Module::Pointer64: IntPtrTy = Type::LongTy; break; - default: ThrowException("invalid pointer binary constant expr!"); + default: GEN_ERROR("invalid pointer binary constant expr!"); } - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, ConstantExpr::getCast(yyvsp[-3].ConstVal, IntPtrTy), - ConstantExpr::getCast(yyvsp[-1].ConstVal, IntPtrTy)); - yyval.ConstVal = ConstantExpr::getCast(yyval.ConstVal, yyvsp[-3].ConstVal->getType()); - } - ; - break;} -case 111: -#line 1522 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) - ThrowException("Logical operator types must match!"); - if (!yyvsp[-3].ConstVal->getType()->isIntegral()) { - if (!isa(yyvsp[-3].ConstVal->getType()) || - !cast(yyvsp[-3].ConstVal->getType())->getElementType()->isIntegral()) - ThrowException("Logical operator requires integral operands!"); - } - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 112: -#line 1532 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) - ThrowException("setcc operand types must match!"); - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 113: -#line 1537 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-1].ConstVal->getType() != Type::UByteTy) - ThrowException("Shift count for shift constant must be unsigned byte!"); - if (!yyvsp[-3].ConstVal->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); - yyval.ConstVal = ConstantExpr::get(yyvsp[-5].OtherOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 114: -#line 1544 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) - ThrowException("Invalid extractelement operands!"); - yyval.ConstVal = ConstantExpr::getExtractElement(yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 115: -#line 1549 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) - ThrowException("Invalid insertelement operands!"); - yyval.ConstVal = ConstantExpr::getInsertElement(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 116: -#line 1554 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal)) - ThrowException("Invalid shufflevector operands!"); - yyval.ConstVal = ConstantExpr::getShuffleVector(yyvsp[-5].ConstVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); - ; - break;} -case 117: -#line 1562 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - (yyval.ConstVector = yyvsp[-2].ConstVector)->push_back(yyvsp[0].ConstVal); - ; - break;} -case 118: -#line 1565 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ConstVector = new std::vector(); - yyval.ConstVector->push_back(yyvsp[0].ConstVal); - ; - break;} -case 119: -#line 1572 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = false; ; - break;} -case 120: -#line 1572 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.BoolVal = true; ; - break;} -case 121: -#line 1582 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = ParserResult = yyvsp[0].ModuleVal; + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), ConstantExpr::getCast((yyvsp[-3].ConstVal), IntPtrTy), + ConstantExpr::getCast((yyvsp[-1].ConstVal), IntPtrTy)); + (yyval.ConstVal) = ConstantExpr::getCast((yyval.ConstVal), (yyvsp[-3].ConstVal)->getType()); + } + CHECK_FOR_ERROR + ;} + break; + + case 112: +#line 1575 "/proj/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].ConstVal)->getType()->isIntegral()) { + if (!isa((yyvsp[-3].ConstVal)->getType()) || + !cast((yyvsp[-3].ConstVal)->getType())->getElementType()->isIntegral()) + GEN_ERROR("Logical operator requires integral operands!"); + } + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 113: +#line 1586 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) + GEN_ERROR("setcc operand types must match!"); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].BinaryOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 114: +#line 1592 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-1].ConstVal)->getType() != Type::UByteTy) + GEN_ERROR("Shift count for shift constant must be unsigned byte!"); + if (!(yyvsp[-3].ConstVal)->getType()->isInteger()) + GEN_ERROR("Shift constant expression requires integer operand!"); + (yyval.ConstVal) = ConstantExpr::get((yyvsp[-5].OtherOpVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 115: +#line 1600 "/proj/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].ConstVal), (yyvsp[-1].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 116: +#line 1606 "/proj/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[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 117: +#line 1612 "/proj/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[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 118: +#line 1621 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 119: +#line 1625 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ConstVector) = new std::vector(); + (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 120: +#line 1633 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = false; ;} + break; + + case 121: +#line 1633 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.BoolVal) = true; ;} + break; + + case 122: +#line 1643 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); -; - break;} -case 122: -#line 1589 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = yyvsp[-1].ModuleVal; + CHECK_FOR_ERROR +;} + break; + + case 123: +#line 1651 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); - ; - break;} -case 123: -#line 1593 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = yyvsp[-1].ModuleVal; - ; - break;} -case 124: -#line 1596 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = yyvsp[-3].ModuleVal; - ; - break;} -case 125: -#line 1599 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = yyvsp[-1].ModuleVal; - ; - break;} -case 126: -#line 1602 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ModuleVal = CurModule.CurrentModule; + CHECK_FOR_ERROR + ;} + break; + + case 124: +#line 1656 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); + CHECK_FOR_ERROR + ;} + break; + + case 125: +#line 1660 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); + CHECK_FOR_ERROR + ;} + break; + + case 126: +#line 1664 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); + CHECK_FOR_ERROR + ;} + break; + + case 127: +#line 1668 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; - if (DID.Type == ValID::NameVal) - ThrowException("Reference to an undefined type: '"+DID.getName() + "'"); - else - ThrowException("Reference to an undefined type: #" + itostr(DID.Num)); + if (DID.Type == ValID::NameVal) { + GEN_ERROR("Reference to an undefined type: '"+DID.getName() + "'"); + } else { + GEN_ERROR("Reference to an undefined type: #" + itostr(DID.Num)); + } } - ; - break;} -case 127: -#line 1615 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + CHECK_FOR_ERROR + ;} + break; + + case 128: +#line 1683 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: // @@ -3011,212 +3742,260 @@ // 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[-2].StrVal), *(yyvsp[0].TypeVal)); - if (!setTypeName(*yyvsp[0].TypeVal, yyvsp[-2].StrVal) && !yyvsp[-2].StrVal) { + if (!setTypeName(*(yyvsp[0].TypeVal), (yyvsp[-2].StrVal)) && !(yyvsp[-2].StrVal)) { // If this is a named type that is not a redefinition, add it to the slot // table. - CurModule.Types.push_back(*yyvsp[0].TypeVal); + CurModule.Types.push_back(*(yyvsp[0].TypeVal)); } - delete yyvsp[0].TypeVal; - ; - break;} -case 128: -#line 1635 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Function prototypes can be in const pool - ; - break;} -case 129: -#line 1637 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Asm blocks can be in the const pool - ; - break;} -case 130: -#line 1639 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].ConstVal == 0) ThrowException("Global value initializer is not a constant!"); - CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, yyvsp[-2].Linkage, yyvsp[-1].BoolVal, yyvsp[0].ConstVal->getType(), yyvsp[0].ConstVal); - ; - break;} -case 131: -#line 1642 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[0].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 129: +#line 1704 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Function prototypes can be in const pool + CHECK_FOR_ERROR + ;} + break; + + case 130: +#line 1707 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Asm blocks can be in the const pool + CHECK_FOR_ERROR + ;} + break; + + case 131: +#line 1710 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant!"); + CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), (yyvsp[-2].Linkage), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); + ;} + break; + + case 132: +#line 1713 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 132: -#line 1645 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurGV = ParseGlobalVariable(yyvsp[-3].StrVal, GlobalValue::ExternalLinkage, - yyvsp[-1].BoolVal, *yyvsp[0].TypeVal, 0); - delete yyvsp[0].TypeVal; - ; - break;} -case 133: -#line 1649 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + CHECK_FOR_ERROR + ;} + break; + + case 133: +#line 1717 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, + (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); + delete (yyvsp[0].TypeVal); + ;} + break; + + case 134: +#line 1721 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { CurGV = 0; - ; - break;} -case 134: -#line 1652 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ; - break;} -case 135: -#line 1654 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ; - break;} -case 136: -#line 1656 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ; - break;} -case 137: -#line 1660 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + CHECK_FOR_ERROR + ;} + break; + + case 135: +#line 1725 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CHECK_FOR_ERROR + ;} + break; + + case 136: +#line 1728 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CHECK_FOR_ERROR + ;} + break; + + case 137: +#line 1731 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + ;} + break; + + case 138: +#line 1735 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); - char *EndStr = UnEscapeLexed(yyvsp[0].StrVal, true); - std::string NewAsm(yyvsp[0].StrVal, EndStr); - free(yyvsp[0].StrVal); + char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); + std::string NewAsm((yyvsp[0].StrVal), EndStr); + free((yyvsp[0].StrVal)); if (AsmSoFar.empty()) CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); -; - break;} -case 138: -#line 1672 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Endianness = Module::BigEndian; ; - break;} -case 139: -#line 1673 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.Endianness = Module::LittleEndian; ; - break;} -case 140: -#line 1675 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setEndianness(yyvsp[0].Endianness); - ; - break;} -case 141: -#line 1678 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].UInt64Val == 32) + CHECK_FOR_ERROR +;} + break; + + case 139: +#line 1748 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Endianness) = Module::BigEndian; ;} + break; + + case 140: +#line 1749 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.Endianness) = Module::LittleEndian; ;} + break; + + case 141: +#line 1751 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->setEndianness((yyvsp[0].Endianness)); + CHECK_FOR_ERROR + ;} + break; + + case 142: +#line 1755 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[0].UInt64Val) == 32) CurModule.CurrentModule->setPointerSize(Module::Pointer32); - else if (yyvsp[0].UInt64Val == 64) + else if ((yyvsp[0].UInt64Val) == 64) CurModule.CurrentModule->setPointerSize(Module::Pointer64); else - ThrowException("Invalid pointer size: '" + utostr(yyvsp[0].UInt64Val) + "'!"); - ; - break;} -case 142: -#line 1686 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->setTargetTriple(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 144: -#line 1693 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 145: -#line 1697 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - CurModule.CurrentModule->addLibrary(yyvsp[0].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 146: -#line 1701 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - ; - break;} -case 150: -#line 1710 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.StrVal = 0; ; - break;} -case 151: -#line 1712 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (*yyvsp[-1].TypeVal == Type::VoidTy) - ThrowException("void typed arguments are invalid!"); - yyval.ArgVal = new std::pair(yyvsp[-1].TypeVal, yyvsp[0].StrVal); -; - break;} -case 152: -#line 1718 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; - yyvsp[-2].ArgList->push_back(*yyvsp[0].ArgVal); - delete yyvsp[0].ArgVal; - ; - break;} -case 153: -#line 1723 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = new std::vector >(); - yyval.ArgList->push_back(*yyvsp[0].ArgVal); - delete yyvsp[0].ArgVal; - ; - break;} -case 154: -#line 1729 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[0].ArgList; - ; - break;} -case 155: -#line 1732 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = yyvsp[-2].ArgList; - yyval.ArgList->push_back(std::pairsetTargetTriple((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 145: +#line 1772 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 146: +#line 1777 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); + free((yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 147: +#line 1782 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + CHECK_FOR_ERROR + ;} + break; + + case 151: +#line 1792 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.StrVal) = 0; ;} + break; + + case 152: +#line 1794 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (*(yyvsp[-1].TypeVal) == Type::VoidTy) + GEN_ERROR("void typed arguments are invalid!"); + (yyval.ArgVal) = new std::pair((yyvsp[-1].TypeVal), (yyvsp[0].StrVal)); + CHECK_FOR_ERROR +;} + break; + + case 153: +#line 1801 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[-2].ArgList); + (yyvsp[-2].ArgList)->push_back(*(yyvsp[0].ArgVal)); + delete (yyvsp[0].ArgVal); + CHECK_FOR_ERROR + ;} + break; + + case 154: +#line 1807 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = new std::vector >(); + (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); + delete (yyvsp[0].ArgVal); + CHECK_FOR_ERROR + ;} + break; + + case 155: +#line 1814 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[0].ArgList); + CHECK_FOR_ERROR + ;} + break; + + case 156: +#line 1818 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = (yyvsp[-2].ArgList); + (yyval.ArgList)->push_back(std::pair(new PATypeHolder(Type::VoidTy), 0)); - ; - break;} -case 156: -#line 1737 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = new std::vector >(); - yyval.ArgList->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); - ; - break;} -case 157: -#line 1741 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ArgList = 0; - ; - break;} -case 158: -#line 1746 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - UnEscapeLexed(yyvsp[-5].StrVal); - std::string FunctionName(yyvsp[-5].StrVal); - free(yyvsp[-5].StrVal); // Free strdup'd memory! + CHECK_FOR_ERROR + ;} + break; + + case 157: +#line 1824 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = new std::vector >(); + (yyval.ArgList)->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); + CHECK_FOR_ERROR + ;} + break; + + case 158: +#line 1829 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ArgList) = 0; + CHECK_FOR_ERROR + ;} + break; + + case 159: +#line 1835 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + UnEscapeLexed((yyvsp[-5].StrVal)); + std::string FunctionName((yyvsp[-5].StrVal)); + free((yyvsp[-5].StrVal)); // Free strdup'd memory! - if (!(*yyvsp[-6].TypeVal)->isFirstClassType() && *yyvsp[-6].TypeVal != Type::VoidTy) - ThrowException("LLVM functions cannot return aggregate types!"); + if (!(*(yyvsp[-6].TypeVal))->isFirstClassType() && *(yyvsp[-6].TypeVal) != Type::VoidTy) + GEN_ERROR("LLVM functions cannot return aggregate types!"); std::vector ParamTypeList; - if (yyvsp[-3].ArgList) { // If there are arguments... - for (std::vector >::iterator I = yyvsp[-3].ArgList->begin(); - I != yyvsp[-3].ArgList->end(); ++I) + if ((yyvsp[-3].ArgList)) { // If there are arguments... + for (std::vector >::iterator I = (yyvsp[-3].ArgList)->begin(); + I != (yyvsp[-3].ArgList)->end(); ++I) ParamTypeList.push_back(I->first->get()); } bool isVarArg = ParamTypeList.size() && ParamTypeList.back() == Type::VoidTy; if (isVarArg) ParamTypeList.pop_back(); - const FunctionType *FT = FunctionType::get(*yyvsp[-6].TypeVal, ParamTypeList, isVarArg); + const FunctionType *FT = FunctionType::get(*(yyvsp[-6].TypeVal), ParamTypeList, isVarArg); const PointerType *PFT = PointerType::get(FT); - delete yyvsp[-6].TypeVal; + delete (yyvsp[-6].TypeVal); ValID ID; if (!FunctionName.empty()) { @@ -3238,7 +4017,7 @@ // If this is the case, either we need to be a forward decl, or it needs // to be. if (!CurFun.isDeclare && !Fn->isExternal()) - ThrowException("Redefinition of function '" + FunctionName + "'!"); + GEN_ERROR("Redefinition of function '" + FunctionName + "'!"); // Make sure to strip off any argument names so we can't get conflicts. if (Fn->isExternal()) @@ -3253,126 +4032,154 @@ } CurFun.FunctionStart(Fn); - Fn->setCallingConv(yyvsp[-7].UIntVal); - Fn->setAlignment(yyvsp[0].UIntVal); - if (yyvsp[-1].StrVal) { - Fn->setSection(yyvsp[-1].StrVal); - free(yyvsp[-1].StrVal); + Fn->setCallingConv((yyvsp[-7].UIntVal)); + Fn->setAlignment((yyvsp[0].UIntVal)); + if ((yyvsp[-1].StrVal)) { + Fn->setSection((yyvsp[-1].StrVal)); + free((yyvsp[-1].StrVal)); } // Add all of the arguments we parsed to the function... - if (yyvsp[-3].ArgList) { // Is null if empty... + if ((yyvsp[-3].ArgList)) { // Is null if empty... if (isVarArg) { // Nuke the last entry - assert(yyvsp[-3].ArgList->back().first->get() == Type::VoidTy && yyvsp[-3].ArgList->back().second == 0&& + assert((yyvsp[-3].ArgList)->back().first->get() == Type::VoidTy && (yyvsp[-3].ArgList)->back().second == 0&& "Not a varargs marker!"); - delete yyvsp[-3].ArgList->back().first; - yyvsp[-3].ArgList->pop_back(); // Delete the last entry + delete (yyvsp[-3].ArgList)->back().first; + (yyvsp[-3].ArgList)->pop_back(); // Delete the last entry } Function::arg_iterator ArgIt = Fn->arg_begin(); - for (std::vector >::iterator I = yyvsp[-3].ArgList->begin(); - I != yyvsp[-3].ArgList->end(); ++I, ++ArgIt) { + for (std::vector >::iterator I = (yyvsp[-3].ArgList)->begin(); + I != (yyvsp[-3].ArgList)->end(); ++I, ++ArgIt) { delete I->first; // Delete the typeholder... setValueName(ArgIt, I->second); // Insert arg into symtab... InsertValue(ArgIt); } - delete yyvsp[-3].ArgList; // We're now done with the argument list + delete (yyvsp[-3].ArgList); // We're now done with the argument list } -; - break;} -case 161: -#line 1833 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = CurFun.CurrentFunction; + CHECK_FOR_ERROR +;} + break; + + case 162: +#line 1923 "/proj/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[-2].Linkage); -; - break;} -case 164: -#line 1843 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; -; - break;} -case 165: -#line 1847 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ CurFun.isDeclare = true; ; - break;} -case 166: -#line 1847 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = CurFun.CurrentFunction; + (yyval.FunctionVal)->setLinkage((yyvsp[-2].Linkage)); +;} + break; + + case 165: +#line 1933 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + CHECK_FOR_ERROR +;} + break; + + case 166: +#line 1938 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { CurFun.isDeclare = true; ;} + break; + + case 167: +#line 1938 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); -; - break;} -case 167: -#line 1856 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; - ; - break;} -case 168: -#line 1859 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; - ; - break;} -case 169: -#line 1863 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A reference to a direct constant - yyval.ValIDVal = ValID::create(yyvsp[0].SInt64Val); - ; - break;} -case 170: -#line 1866 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].UInt64Val); - ; - break;} -case 171: -#line 1869 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Perhaps it's an FP constant? - yyval.ValIDVal = ValID::create(yyvsp[0].FPVal); - ; - break;} -case 172: -#line 1872 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantBool::True); - ; - break;} -case 173: -#line 1875 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(ConstantBool::False); - ; - break;} -case 174: -#line 1878 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createNull(); - ; - break;} -case 175: -#line 1881 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::createUndef(); - ; - break;} -case 176: -#line 1884 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // A vector zero constant. - yyval.ValIDVal = ValID::createZeroInit(); - ; - break;} -case 177: -#line 1887 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Nonempty unsized packed vector - const Type *ETy = (*yyvsp[-1].ConstVector)[0]->getType(); - int NumElements = yyvsp[-1].ConstVector->size(); + CHECK_FOR_ERROR +;} + break; + + case 168: +#line 1948 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 169: +#line 1952 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; + CHECK_FOR_ERROR + ;} + break; + + case 170: +#line 1957 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // A reference to a direct constant + (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); + CHECK_FOR_ERROR + ;} + break; + + case 171: +#line 1961 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); + CHECK_FOR_ERROR + ;} + break; + + case 172: +#line 1965 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Perhaps it's an FP constant? + (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); + CHECK_FOR_ERROR + ;} + break; + + case 173: +#line 1969 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantBool::True); + CHECK_FOR_ERROR + ;} + break; + + case 174: +#line 1973 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create(ConstantBool::False); + CHECK_FOR_ERROR + ;} + break; + + case 175: +#line 1977 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createNull(); + CHECK_FOR_ERROR + ;} + break; + + case 176: +#line 1981 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::createUndef(); + CHECK_FOR_ERROR + ;} + break; + + case 177: +#line 1985 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // A vector zero constant. + (yyval.ValIDVal) = ValID::createZeroInit(); + CHECK_FOR_ERROR + ;} + break; + + case 178: +#line 1989 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Nonempty unsized packed vector + const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); + int NumElements = (yyvsp[-1].ConstVector)->size(); PackedType* pt = PackedType::get(ETy, NumElements); PATypeHolder* PTy = new PATypeHolder( @@ -3384,169 +4191,205 @@ ); // Verify all elements are correct type! - for (unsigned i = 0; i < yyvsp[-1].ConstVector->size(); i++) { - if (ETy != (*yyvsp[-1].ConstVector)[i]->getType()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + 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[-1].ConstVector)[i]->getType()->getDescription() + "'."); + (*(yyvsp[-1].ConstVector))[i]->getType()->getDescription() + "'."); } - yyval.ValIDVal = ValID::create(ConstantPacked::get(pt, *yyvsp[-1].ConstVector)); - delete PTy; delete yyvsp[-1].ConstVector; - ; - break;} -case 178: -#line 1911 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValIDVal = ValID::create(yyvsp[0].ConstVal); - ; - break;} -case 179: -#line 1914 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - char *End = UnEscapeLexed(yyvsp[-2].StrVal, true); - std::string AsmStr = std::string(yyvsp[-2].StrVal, End); - End = UnEscapeLexed(yyvsp[0].StrVal, true); - std::string Constraints = std::string(yyvsp[0].StrVal, End); - yyval.ValIDVal = ValID::createInlineAsm(AsmStr, Constraints, yyvsp[-3].BoolVal); - free(yyvsp[-2].StrVal); - free(yyvsp[0].StrVal); - ; - break;} -case 180: -#line 1927 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it an integer reference...? - yyval.ValIDVal = ValID::create(yyvsp[0].SIntVal); - ; - break;} -case 181: -#line 1930 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Is it a named reference...? - yyval.ValIDVal = ValID::create(yyvsp[0].StrVal); - ; - break;} -case 184: -#line 1941 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueVal = getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal); delete yyvsp[-1].TypeVal; - ; - break;} -case 185: -#line 1945 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.FunctionVal = yyvsp[-1].FunctionVal; - ; - break;} -case 186: -#line 1948 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Do not allow functions with 0 basic blocks - yyval.FunctionVal = yyvsp[-1].FunctionVal; - ; - break;} -case 187: -#line 1956 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - setValueName(yyvsp[0].TermInstVal, yyvsp[-1].StrVal); - InsertValue(yyvsp[0].TermInstVal); + (yyval.ValIDVal) = ValID::create(ConstantPacked::get(pt, *(yyvsp[-1].ConstVector))); + delete PTy; delete (yyvsp[-1].ConstVector); + CHECK_FOR_ERROR + ;} + break; + + case 179: +#line 2014 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); + CHECK_FOR_ERROR + ;} + break; + + case 180: +#line 2018 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); + std::string AsmStr = std::string((yyvsp[-2].StrVal), End); + End = UnEscapeLexed((yyvsp[0].StrVal), true); + std::string Constraints = std::string((yyvsp[0].StrVal), End); + (yyval.ValIDVal) = ValID::createInlineAsm(AsmStr, Constraints, (yyvsp[-3].BoolVal)); + free((yyvsp[-2].StrVal)); + free((yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 181: +#line 2032 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it an integer reference...? + (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); + CHECK_FOR_ERROR + ;} + break; + + case 182: +#line 2036 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is it a named reference...? + (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); + CHECK_FOR_ERROR + ;} + break; + + case 185: +#line 2048 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 186: +#line 2053 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + CHECK_FOR_ERROR + ;} + break; + + case 187: +#line 2057 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Do not allow functions with 0 basic blocks + (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); + CHECK_FOR_ERROR + ;} + break; + + case 188: +#line 2066 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); + InsertValue((yyvsp[0].TermInstVal)); + + (yyvsp[-2].BasicBlockVal)->getInstList().push_back((yyvsp[0].TermInstVal)); + InsertValue((yyvsp[-2].BasicBlockVal)); + (yyval.BasicBlockVal) = (yyvsp[-2].BasicBlockVal); + CHECK_FOR_ERROR + ;} + break; - yyvsp[-2].BasicBlockVal->getInstList().push_back(yyvsp[0].TermInstVal); - InsertValue(yyvsp[-2].BasicBlockVal); - yyval.BasicBlockVal = yyvsp[-2].BasicBlockVal; - ; - break;} -case 188: -#line 1965 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyvsp[-1].BasicBlockVal->getInstList().push_back(yyvsp[0].InstVal); - yyval.BasicBlockVal = yyvsp[-1].BasicBlockVal; - ; - break;} -case 189: -#line 1969 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BasicBlockVal = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); + case 189: +#line 2076 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal)); + (yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal); + CHECK_FOR_ERROR + ;} + break; + + case 190: +#line 2081 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); // Make sure to move the basic block to the correct location in the // function, instead of leaving it inserted wherever it was first // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); - ; - break;} -case 190: -#line 1979 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BasicBlockVal = CurBB = getBBVal(ValID::create(yyvsp[0].StrVal), true); + BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); + CHECK_FOR_ERROR + ;} + break; + + case 191: +#line 2092 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); // Make sure to move the basic block to the correct location in the // function, instead of leaving it inserted wherever it was first // referenced. Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); - BBL.splice(BBL.end(), BBL, yyval.BasicBlockVal); - ; - break;} -case 191: -#line 1990 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with a result... - yyval.TermInstVal = new ReturnInst(yyvsp[0].ValueVal); - ; - break;} -case 192: -#line 1993 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Return with no result... - yyval.TermInstVal = new ReturnInst(); - ; - break;} -case 193: -#line 1996 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Unconditional Branch... - yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[0].ValIDVal)); - ; - break;} -case 194: -#line 1999 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new BranchInst(getBBVal(yyvsp[-3].ValIDVal), getBBVal(yyvsp[0].ValIDVal), getVal(Type::BoolTy, yyvsp[-6].ValIDVal)); - ; - break;} -case 195: -#line 2002 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - SwitchInst *S = new SwitchInst(getVal(yyvsp[-7].PrimType, yyvsp[-6].ValIDVal), getBBVal(yyvsp[-3].ValIDVal), yyvsp[-1].JumpTable->size()); - yyval.TermInstVal = S; + BBL.splice(BBL.end(), BBL, (yyval.BasicBlockVal)); + CHECK_FOR_ERROR + ;} + break; + + case 192: +#line 2104 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Return with a result... + (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 193: +#line 2108 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Return with no result... + (yyval.TermInstVal) = new ReturnInst(); + CHECK_FOR_ERROR + ;} + break; + + case 194: +#line 2112 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Unconditional Branch... + (yyval.TermInstVal) = new BranchInst(getBBVal((yyvsp[0].ValIDVal))); + CHECK_FOR_ERROR + ;} + break; - std::vector >::iterator I = yyvsp[-1].JumpTable->begin(), - E = yyvsp[-1].JumpTable->end(); + case 195: +#line 2116 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new BranchInst(getBBVal((yyvsp[-3].ValIDVal)), getBBVal((yyvsp[0].ValIDVal)), getVal(Type::BoolTy, (yyvsp[-6].ValIDVal))); + CHECK_FOR_ERROR + ;} + break; + + case 196: +#line 2120 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + SwitchInst *S = new SwitchInst(getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)), getBBVal((yyvsp[-3].ValIDVal)), (yyvsp[-1].JumpTable)->size()); + (yyval.TermInstVal) = S; + + std::vector >::iterator I = (yyvsp[-1].JumpTable)->begin(), + E = (yyvsp[-1].JumpTable)->end(); for (; I != E; ++I) { if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else - ThrowException("Switch case is constant, but not a simple integer!"); + GEN_ERROR("Switch case is constant, but not a simple integer!"); } - delete yyvsp[-1].JumpTable; - ; - break;} -case 196: -#line 2016 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - SwitchInst *S = new SwitchInst(getVal(yyvsp[-6].PrimType, yyvsp[-5].ValIDVal), getBBVal(yyvsp[-2].ValIDVal), 0); - yyval.TermInstVal = S; - ; - break;} -case 197: -#line 2021 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + delete (yyvsp[-1].JumpTable); + CHECK_FOR_ERROR + ;} + break; + + case 197: +#line 2135 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + SwitchInst *S = new SwitchInst(getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)), getBBVal((yyvsp[-2].ValIDVal)), 0); + (yyval.TermInstVal) = S; + CHECK_FOR_ERROR + ;} + break; + + case 198: +#line 2141 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast(yyvsp[-10].TypeVal->get())) || + if (!(PFTy = dyn_cast((yyvsp[-10].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - if (yyvsp[-7].ValueList) { - for (std::vector::iterator I = yyvsp[-7].ValueList->begin(), E = yyvsp[-7].ValueList->end(); + if ((yyvsp[-7].ValueList)) { + for (std::vector::iterator I = (yyvsp[-7].ValueList)->begin(), E = (yyvsp[-7].ValueList)->end(); I != E; ++I) ParamTypes.push_back((*I)->getType()); } @@ -3554,232 +4397,273 @@ bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - Ty = FunctionType::get(yyvsp[-10].TypeVal->get(), ParamTypes, isVarArg); + Ty = FunctionType::get((yyvsp[-10].TypeVal)->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, yyvsp[-9].ValIDVal); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[-9].ValIDVal)); // Get the function we're calling... - BasicBlock *Normal = getBBVal(yyvsp[-3].ValIDVal); - BasicBlock *Except = getBBVal(yyvsp[0].ValIDVal); + BasicBlock *Normal = getBBVal((yyvsp[-3].ValIDVal)); + BasicBlock *Except = getBBVal((yyvsp[0].ValIDVal)); // Create the call node... - if (!yyvsp[-7].ValueList) { // Has no arguments? - yyval.TermInstVal = new InvokeInst(V, Normal, Except, std::vector()); + if (!(yyvsp[-7].ValueList)) { // Has no arguments? + (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, std::vector()); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified // correctly! // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = yyvsp[-7].ValueList->begin(), ArgE = yyvsp[-7].ValueList->end(); + std::vector::iterator ArgI = (yyvsp[-7].ValueList)->begin(), ArgE = (yyvsp[-7].ValueList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI)->getType() != *I) - ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" + + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - ThrowException("Invalid number of parameters detected!"); + GEN_ERROR("Invalid number of parameters detected!"); - yyval.TermInstVal = new InvokeInst(V, Normal, Except, *yyvsp[-7].ValueList); + (yyval.TermInstVal) = new InvokeInst(V, Normal, Except, *(yyvsp[-7].ValueList)); } - cast(yyval.TermInstVal)->setCallingConv(yyvsp[-11].UIntVal); + cast((yyval.TermInstVal))->setCallingConv((yyvsp[-11].UIntVal)); - delete yyvsp[-10].TypeVal; - delete yyvsp[-7].ValueList; - ; - break;} -case 198: -#line 2073 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnwindInst(); - ; - break;} -case 199: -#line 2076 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.TermInstVal = new UnreachableInst(); - ; - break;} -case 200: -#line 2082 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = yyvsp[-5].JumpTable; - Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + delete (yyvsp[-10].TypeVal); + delete (yyvsp[-7].ValueList); + CHECK_FOR_ERROR + ;} + break; + + case 199: +#line 2194 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnwindInst(); + CHECK_FOR_ERROR + ;} + break; + + case 200: +#line 2198 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.TermInstVal) = new UnreachableInst(); + CHECK_FOR_ERROR + ;} + break; + + case 201: +#line 2205 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = (yyvsp[-5].JumpTable); + Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); if (V == 0) - ThrowException("May only switch on a constant pool value!"); + GEN_ERROR("May only switch on a constant pool value!"); - yyval.JumpTable->push_back(std::make_pair(V, getBBVal(yyvsp[0].ValIDVal))); - ; - break;} -case 201: -#line 2090 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.JumpTable = new std::vector >(); - Constant *V = cast(getValNonImprovising(yyvsp[-4].PrimType, yyvsp[-3].ValIDVal)); + (yyval.JumpTable)->push_back(std::make_pair(V, getBBVal((yyvsp[0].ValIDVal)))); + CHECK_FOR_ERROR + ;} + break; + + case 202: +#line 2214 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.JumpTable) = new std::vector >(); + Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); if (V == 0) - ThrowException("May only switch on a constant pool value!"); + GEN_ERROR("May only switch on a constant pool value!"); - yyval.JumpTable->push_back(std::make_pair(V, getBBVal(yyvsp[0].ValIDVal))); - ; - break;} -case 202: -#line 2100 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.JumpTable)->push_back(std::make_pair(V, getBBVal((yyvsp[0].ValIDVal)))); + CHECK_FOR_ERROR + ;} + break; + + case 203: +#line 2225 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Is this definition named?? if so, assign the name... - setValueName(yyvsp[0].InstVal, yyvsp[-1].StrVal); - InsertValue(yyvsp[0].InstVal); - yyval.InstVal = yyvsp[0].InstVal; -; - break;} -case 203: -#line 2107 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Used for PHI nodes - yyval.PHIList = new std::list >(); - yyval.PHIList->push_back(std::make_pair(getVal(*yyvsp[-5].TypeVal, yyvsp[-3].ValIDVal), getBBVal(yyvsp[-1].ValIDVal))); - delete yyvsp[-5].TypeVal; - ; - break;} -case 204: -#line 2112 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.PHIList = yyvsp[-6].PHIList; - yyvsp[-6].PHIList->push_back(std::make_pair(getVal(yyvsp[-6].PHIList->front().first->getType(), yyvsp[-3].ValIDVal), - getBBVal(yyvsp[-1].ValIDVal))); - ; - break;} -case 205: -#line 2119 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ // Used for call statements, and memory insts... - yyval.ValueList = new std::vector(); - yyval.ValueList->push_back(yyvsp[0].ValueVal); - ; - break;} -case 206: -#line 2123 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueList = yyvsp[-2].ValueList; - yyvsp[-2].ValueList->push_back(yyvsp[0].ValueVal); - ; - break;} -case 208: -#line 2129 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ yyval.ValueList = 0; ; - break;} -case 209: -#line 2131 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; - ; - break;} -case 210: -#line 2134 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; - ; - break;} -case 211: -#line 2140 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && - !isa((*yyvsp[-3].TypeVal).get())) - ThrowException( + setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); + InsertValue((yyvsp[0].InstVal)); + (yyval.InstVal) = (yyvsp[0].InstVal); + CHECK_FOR_ERROR +;} + break; + + case 204: +#line 2233 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Used for PHI nodes + (yyval.PHIList) = new std::list >(); + (yyval.PHIList)->push_back(std::make_pair(getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)), getBBVal((yyvsp[-1].ValIDVal)))); + delete (yyvsp[-5].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 205: +#line 2239 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.PHIList) = (yyvsp[-6].PHIList); + (yyvsp[-6].PHIList)->push_back(std::make_pair(getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)), + getBBVal((yyvsp[-1].ValIDVal)))); + CHECK_FOR_ERROR + ;} + break; + + case 206: +#line 2247 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { // Used for call statements, and memory insts... + (yyval.ValueList) = new std::vector(); + (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 207: +#line 2252 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = (yyvsp[-2].ValueList); + (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 209: +#line 2259 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { (yyval.ValueList) = 0; ;} + break; + + case 210: +#line 2261 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; + CHECK_FOR_ERROR + ;} + break; + + case 211: +#line 2265 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 212: +#line 2272 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() && + !isa((*(yyvsp[-3].TypeVal)).get())) + GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); - if (isa((*yyvsp[-3].TypeVal).get()) && yyvsp[-4].BinaryOpVal == Instruction::Rem) - ThrowException("Rem not supported on packed types!"); - yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal), getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal)); - if (yyval.InstVal == 0) - ThrowException("binary operator returned null!"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 212: -#line 2152 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!(*yyvsp[-3].TypeVal)->isIntegral()) { - if (!isa(yyvsp[-3].TypeVal->get()) || - !cast(yyvsp[-3].TypeVal->get())->getElementType()->isIntegral()) - ThrowException("Logical operator requires integral operands!"); - } - yyval.InstVal = BinaryOperator::create(yyvsp[-4].BinaryOpVal, getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal), getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal)); - if (yyval.InstVal == 0) - ThrowException("binary operator returned null!"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 213: -#line 2163 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if(isa((*yyvsp[-3].TypeVal).get())) { - ThrowException( + if (isa((*(yyvsp[-3].TypeVal)).get()) && (yyvsp[-4].BinaryOpVal) == Instruction::Rem) + GEN_ERROR("Rem not supported on packed types!"); + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)), getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal))); + if ((yyval.InstVal) == 0) + GEN_ERROR("binary operator returned null!"); + delete (yyvsp[-3].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 213: +#line 2285 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!(*(yyvsp[-3].TypeVal))->isIntegral()) { + if (!isa((yyvsp[-3].TypeVal)->get()) || + !cast((yyvsp[-3].TypeVal)->get())->getElementType()->isIntegral()) + GEN_ERROR("Logical operator requires integral operands!"); + } + (yyval.InstVal) = BinaryOperator::create((yyvsp[-4].BinaryOpVal), getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)), getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal))); + if ((yyval.InstVal) == 0) + GEN_ERROR("binary operator returned null!"); + delete (yyvsp[-3].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 214: +#line 2297 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if(isa((*(yyvsp[-3].TypeVal)).get())) { + GEN_ERROR( "PackedTypes currently not supported in setcc instructions!"); } - yyval.InstVal = new SetCondInst(yyvsp[-4].BinaryOpVal, getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal), getVal(*yyvsp[-3].TypeVal, yyvsp[0].ValIDVal)); - if (yyval.InstVal == 0) - ThrowException("binary operator returned null!"); - delete yyvsp[-3].TypeVal; - ; - break;} -case 214: -#line 2173 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new SetCondInst((yyvsp[-4].BinaryOpVal), getVal(*(yyvsp[-3].TypeVal), (yyvsp[-2].ValIDVal)), getVal(*(yyvsp[-3].TypeVal), (yyvsp[0].ValIDVal))); + if ((yyval.InstVal) == 0) + GEN_ERROR("binary operator returned null!"); + delete (yyvsp[-3].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 215: +#line 2308 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { std::cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; - Value *Ones = ConstantIntegral::getAllOnesValue(yyvsp[0].ValueVal->getType()); + Value *Ones = ConstantIntegral::getAllOnesValue((yyvsp[0].ValueVal)->getType()); if (Ones == 0) - ThrowException("Expected integral type for not instruction!"); + GEN_ERROR("Expected integral type for not instruction!"); - yyval.InstVal = BinaryOperator::create(Instruction::Xor, yyvsp[0].ValueVal, Ones); - if (yyval.InstVal == 0) - ThrowException("Could not create a xor instruction!"); - ; - break;} -case 215: -#line 2185 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[0].ValueVal->getType() != Type::UByteTy) - ThrowException("Shift amount must be ubyte!"); - if (!yyvsp[-2].ValueVal->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); - yyval.InstVal = new ShiftInst(yyvsp[-3].OtherOpVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); - ; - break;} -case 216: -#line 2192 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!yyvsp[0].TypeVal->get()->isFirstClassType()) - ThrowException("cast instruction to a non-primitive type: '" + - yyvsp[0].TypeVal->get()->getDescription() + "'!"); - yyval.InstVal = new CastInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; - ; - break;} -case 217: -#line 2199 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (yyvsp[-4].ValueVal->getType() != Type::BoolTy) - ThrowException("select condition must be boolean!"); - if (yyvsp[-2].ValueVal->getType() != yyvsp[0].ValueVal->getType()) - ThrowException("select value types should match!"); - yyval.InstVal = new SelectInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); - ; - break;} -case 218: -#line 2206 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = BinaryOperator::create(Instruction::Xor, (yyvsp[0].ValueVal), Ones); + if ((yyval.InstVal) == 0) + GEN_ERROR("Could not create a xor instruction!"); + CHECK_FOR_ERROR + ;} + break; + + case 216: +#line 2321 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[0].ValueVal)->getType() != Type::UByteTy) + GEN_ERROR("Shift amount must be ubyte!"); + if (!(yyvsp[-2].ValueVal)->getType()->isInteger()) + GEN_ERROR("Shift constant expression requires integer operand!"); + (yyval.InstVal) = new ShiftInst((yyvsp[-3].OtherOpVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 217: +#line 2329 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!(yyvsp[0].TypeVal)->get()->isFirstClassType()) + GEN_ERROR("cast instruction to a non-primitive type: '" + + (yyvsp[0].TypeVal)->get()->getDescription() + "'!"); + (yyval.InstVal) = new CastInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 218: +#line 2337 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if ((yyvsp[-4].ValueVal)->getType() != Type::BoolTy) + GEN_ERROR("select condition must be boolean!"); + if ((yyvsp[-2].ValueVal)->getType() != (yyvsp[0].ValueVal)->getType()) + GEN_ERROR("select value types should match!"); + (yyval.InstVal) = new SelectInst((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 219: +#line 2345 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { NewVarArgs = true; - yyval.InstVal = new VAArgInst(yyvsp[-2].ValueVal, *yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; - ; - break;} -case 219: -#line 2211 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 220: +#line 2351 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { ObsoleteVarArgs = true; - const Type* ArgTy = yyvsp[-2].ValueVal->getType(); + const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -3790,18 +4674,20 @@ //b = vaarg foo, t AllocaInst* foo = new AllocaInst(ArgTy, 0, "vaarg.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal); + CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal)); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - yyval.InstVal = new VAArgInst(foo, *yyvsp[0].TypeVal); - delete yyvsp[0].TypeVal; - ; - break;} -case 220: -#line 2230 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + (yyval.InstVal) = new VAArgInst(foo, *(yyvsp[0].TypeVal)); + delete (yyvsp[0].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 221: +#line 2371 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { ObsoleteVarArgs = true; - const Type* ArgTy = yyvsp[-2].ValueVal->getType(); + const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); Function* NF = CurModule.CurrentModule-> getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0); @@ -3813,68 +4699,78 @@ //b = load foo AllocaInst* foo = new AllocaInst(ArgTy, 0, "vanext.fix"); CurBB->getInstList().push_back(foo); - CallInst* bar = new CallInst(NF, yyvsp[-2].ValueVal); + CallInst* bar = new CallInst(NF, (yyvsp[-2].ValueVal)); CurBB->getInstList().push_back(bar); CurBB->getInstList().push_back(new StoreInst(bar, foo)); - Instruction* tmp = new VAArgInst(foo, *yyvsp[0].TypeVal); + Instruction* tmp = new VAArgInst(foo, *(yyvsp[0].TypeVal)); CurBB->getInstList().push_back(tmp); - yyval.InstVal = new LoadInst(foo); - delete yyvsp[0].TypeVal; - ; - break;} -case 221: -#line 2252 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ExtractElementInst::isValidOperands(yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) - ThrowException("Invalid extractelement operands!"); - yyval.InstVal = new ExtractElementInst(yyvsp[-2].ValueVal, yyvsp[0].ValueVal); - ; - break;} -case 222: -#line 2257 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!InsertElementInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) - ThrowException("Invalid insertelement operands!"); - yyval.InstVal = new InsertElementInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); - ; - break;} -case 223: -#line 2262 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!ShuffleVectorInst::isValidOperands(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal)) - ThrowException("Invalid shufflevector operands!"); - yyval.InstVal = new ShuffleVectorInst(yyvsp[-4].ValueVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); - ; - break;} -case 224: -#line 2267 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const Type *Ty = yyvsp[0].PHIList->front().first->getType(); + (yyval.InstVal) = new LoadInst(foo); + delete (yyvsp[0].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 222: +#line 2394 "/proj/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].ValueVal), (yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 223: +#line 2400 "/proj/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[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 224: +#line 2406 "/proj/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[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 225: +#line 2412 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) - ThrowException("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) - ThrowException("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(); - } - delete yyvsp[0].PHIList; // Free the list... - ; - break;} -case 225: -#line 2281 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ + 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) + 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(); + } + delete (yyvsp[0].PHIList); // Free the list... + CHECK_FOR_ERROR + ;} + break; + + case 226: +#line 2427 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { const PointerType *PFTy; const FunctionType *Ty; - if (!(PFTy = dyn_cast(yyvsp[-4].TypeVal->get())) || + if (!(PFTy = dyn_cast((yyvsp[-4].TypeVal)->get())) || !(Ty = dyn_cast(PFTy->getElementType()))) { // Pull out the types of all of the arguments... std::vector ParamTypes; - if (yyvsp[-1].ValueList) { - for (std::vector::iterator I = yyvsp[-1].ValueList->begin(), E = yyvsp[-1].ValueList->end(); + if ((yyvsp[-1].ValueList)) { + for (std::vector::iterator I = (yyvsp[-1].ValueList)->begin(), E = (yyvsp[-1].ValueList)->end(); I != E; ++I) ParamTypes.push_back((*I)->getType()); } @@ -3882,390 +4778,478 @@ bool isVarArg = ParamTypes.size() && ParamTypes.back() == Type::VoidTy; if (isVarArg) ParamTypes.pop_back(); - if (!(*yyvsp[-4].TypeVal)->isFirstClassType() && *yyvsp[-4].TypeVal != Type::VoidTy) - ThrowException("LLVM functions cannot return aggregate types!"); + if (!(*(yyvsp[-4].TypeVal))->isFirstClassType() && *(yyvsp[-4].TypeVal) != Type::VoidTy) + GEN_ERROR("LLVM functions cannot return aggregate types!"); - Ty = FunctionType::get(yyvsp[-4].TypeVal->get(), ParamTypes, isVarArg); + Ty = FunctionType::get((yyvsp[-4].TypeVal)->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); } - Value *V = getVal(PFTy, yyvsp[-3].ValIDVal); // Get the function we're calling... + Value *V = getVal(PFTy, (yyvsp[-3].ValIDVal)); // Get the function we're calling... // Create the call node... - if (!yyvsp[-1].ValueList) { // Has no arguments? + if (!(yyvsp[-1].ValueList)) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) - ThrowException("No arguments passed to a function that " + GEN_ERROR("No arguments passed to a function that " "expects arguments!"); - yyval.InstVal = new CallInst(V, std::vector()); + (yyval.InstVal) = new CallInst(V, std::vector()); } else { // Has arguments? // Loop through FunctionType's arguments and ensure they are specified // correctly! // FunctionType::param_iterator I = Ty->param_begin(); FunctionType::param_iterator E = Ty->param_end(); - std::vector::iterator ArgI = yyvsp[-1].ValueList->begin(), ArgE = yyvsp[-1].ValueList->end(); + std::vector::iterator ArgI = (yyvsp[-1].ValueList)->begin(), ArgE = (yyvsp[-1].ValueList)->end(); for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI)->getType() != *I) - ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" + + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - ThrowException("Invalid number of parameters detected!"); + GEN_ERROR("Invalid number of parameters detected!"); - yyval.InstVal = new CallInst(V, *yyvsp[-1].ValueList); + (yyval.InstVal) = new CallInst(V, *(yyvsp[-1].ValueList)); } - cast(yyval.InstVal)->setTailCall(yyvsp[-6].BoolVal); - cast(yyval.InstVal)->setCallingConv(yyvsp[-5].UIntVal); - delete yyvsp[-4].TypeVal; - delete yyvsp[-1].ValueList; - ; - break;} -case 226: -#line 2338 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = yyvsp[0].InstVal; - ; - break;} -case 227: -#line 2344 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueList = yyvsp[0].ValueList; - ; - break;} -case 228: -#line 2346 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.ValueList = new std::vector(); - ; - break;} -case 229: -#line 2350 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = true; - ; - break;} -case 230: -#line 2353 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.BoolVal = false; - ; - break;} -case 231: -#line 2359 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = new MallocInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal; - ; - break;} -case 232: -#line 2363 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = new MallocInst(*yyvsp[-4].TypeVal, getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal), yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal; - ; - break;} -case 233: -#line 2367 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = new AllocaInst(*yyvsp[-1].TypeVal, 0, yyvsp[0].UIntVal); - delete yyvsp[-1].TypeVal; - ; - break;} -case 234: -#line 2371 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - yyval.InstVal = new AllocaInst(*yyvsp[-4].TypeVal, getVal(yyvsp[-2].PrimType, yyvsp[-1].ValIDVal), yyvsp[0].UIntVal); - delete yyvsp[-4].TypeVal; - ; - break;} -case 235: -#line 2375 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[0].ValueVal->getType())) - ThrowException("Trying to free nonpointer type " + - yyvsp[0].ValueVal->getType()->getDescription() + "!"); - yyval.InstVal = new FreeInst(yyvsp[0].ValueVal); - ; - break;} -case 236: -#line 2382 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[-1].TypeVal->get())) - ThrowException("Can't load from nonpointer type: " + - (*yyvsp[-1].TypeVal)->getDescription()); - if (!cast(yyvsp[-1].TypeVal->get())->getElementType()->isFirstClassType()) - ThrowException("Can't load from pointer of non-first-class type: " + - (*yyvsp[-1].TypeVal)->getDescription()); - yyval.InstVal = new LoadInst(getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal), "", yyvsp[-3].BoolVal); - delete yyvsp[-1].TypeVal; - ; - break;} -case 237: -#line 2392 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - const PointerType *PT = dyn_cast(yyvsp[-1].TypeVal->get()); + cast((yyval.InstVal))->setTailCall((yyvsp[-6].BoolVal)); + cast((yyval.InstVal))->setCallingConv((yyvsp[-5].UIntVal)); + delete (yyvsp[-4].TypeVal); + delete (yyvsp[-1].ValueList); + CHECK_FOR_ERROR + ;} + break; + + case 227: +#line 2485 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = (yyvsp[0].InstVal); + CHECK_FOR_ERROR + ;} + break; + + case 228: +#line 2492 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = (yyvsp[0].ValueList); + CHECK_FOR_ERROR + ;} + break; + + case 229: +#line 2495 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.ValueList) = new std::vector(); + CHECK_FOR_ERROR + ;} + break; + + case 230: +#line 2500 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = true; + CHECK_FOR_ERROR + ;} + break; + + case 231: +#line 2504 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.BoolVal) = false; + CHECK_FOR_ERROR + ;} + break; + + case 232: +#line 2511 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 233: +#line 2516 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)), (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 234: +#line 2521 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 235: +#line 2526 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)), (yyvsp[0].UIntVal)); + delete (yyvsp[-4].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 236: +#line 2531 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[0].ValueVal)->getType())) + GEN_ERROR("Trying to free nonpointer type " + + (yyvsp[0].ValueVal)->getType()->getDescription() + "!"); + (yyval.InstVal) = new FreeInst((yyvsp[0].ValueVal)); + CHECK_FOR_ERROR + ;} + break; + + case 237: +#line 2539 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[-1].TypeVal)->get())) + GEN_ERROR("Can't load from nonpointer type: " + + (*(yyvsp[-1].TypeVal))->getDescription()); + if (!cast((yyvsp[-1].TypeVal)->get())->getElementType()->isFirstClassType()) + GEN_ERROR("Can't load from pointer of non-first-class type: " + + (*(yyvsp[-1].TypeVal))->getDescription()); + (yyval.InstVal) = new LoadInst(getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)), "", (yyvsp[-3].BoolVal)); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 238: +#line 2550 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal)->get()); if (!PT) - ThrowException("Can't store to a nonpointer type: " + - (*yyvsp[-1].TypeVal)->getDescription()); + GEN_ERROR("Can't store to a nonpointer type: " + + (*(yyvsp[-1].TypeVal))->getDescription()); const Type *ElTy = PT->getElementType(); - if (ElTy != yyvsp[-3].ValueVal->getType()) - ThrowException("Can't store '" + yyvsp[-3].ValueVal->getType()->getDescription() + + if (ElTy != (yyvsp[-3].ValueVal)->getType()) + GEN_ERROR("Can't store '" + (yyvsp[-3].ValueVal)->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); - yyval.InstVal = new StoreInst(yyvsp[-3].ValueVal, getVal(*yyvsp[-1].TypeVal, yyvsp[0].ValIDVal), yyvsp[-5].BoolVal); - delete yyvsp[-1].TypeVal; - ; - break;} -case 238: -#line 2405 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" -{ - if (!isa(yyvsp[-2].TypeVal->get())) - ThrowException("getelementptr insn requires pointer operand!"); + (yyval.InstVal) = new StoreInst((yyvsp[-3].ValueVal), getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)), (yyvsp[-5].BoolVal)); + delete (yyvsp[-1].TypeVal); + CHECK_FOR_ERROR + ;} + break; + + case 239: +#line 2564 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + { + if (!isa((yyvsp[-2].TypeVal)->get())) + GEN_ERROR("getelementptr insn requires pointer operand!"); // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct // indices to uint struct indices for compatibility. generic_gep_type_iterator::iterator> - GTI = gep_type_begin(yyvsp[-2].TypeVal->get(), yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end()), - GTE = gep_type_end(yyvsp[-2].TypeVal->get(), yyvsp[0].ValueList->begin(), yyvsp[0].ValueList->end()); - for (unsigned i = 0, e = yyvsp[0].ValueList->size(); i != e && GTI != GTE; ++i, ++GTI) + GTI = gep_type_begin((yyvsp[-2].TypeVal)->get(), (yyvsp[0].ValueList)->begin(), (yyvsp[0].ValueList)->end()), + GTE = gep_type_end((yyvsp[-2].TypeVal)->get(), (yyvsp[0].ValueList)->begin(), (yyvsp[0].ValueList)->end()); + for (unsigned i = 0, e = (yyvsp[0].ValueList)->size(); i != e && GTI != GTE; ++i, ++GTI) if (isa(*GTI)) // Only change struct indices - if (ConstantUInt *CUI = dyn_cast((*yyvsp[0].ValueList)[i])) + if (ConstantUInt *CUI = dyn_cast((*(yyvsp[0].ValueList))[i])) if (CUI->getType() == Type::UByteTy) - (*yyvsp[0].ValueList)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); + (*(yyvsp[0].ValueList))[i] = ConstantExpr::getCast(CUI, Type::UIntTy); - if (!GetElementPtrInst::getIndexedType(*yyvsp[-2].TypeVal, *yyvsp[0].ValueList, true)) - ThrowException("Invalid getelementptr indices for type '" + - (*yyvsp[-2].TypeVal)->getDescription()+ "'!"); - yyval.InstVal = new GetElementPtrInst(getVal(*yyvsp[-2].TypeVal, yyvsp[-1].ValIDVal), *yyvsp[0].ValueList); - delete yyvsp[-2].TypeVal; delete yyvsp[0].ValueList; - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/share/bison.simple" + if (!GetElementPtrInst::getIndexedType(*(yyvsp[-2].TypeVal), *(yyvsp[0].ValueList), true)) + GEN_ERROR("Invalid getelementptr indices for type '" + + (*(yyvsp[-2].TypeVal))->getDescription()+ "'!"); + (yyval.InstVal) = new GetElementPtrInst(getVal(*(yyvsp[-2].TypeVal), (yyvsp[-1].ValIDVal)), *(yyvsp[0].ValueList)); + delete (yyvsp[-2].TypeVal); delete (yyvsp[0].ValueList); + CHECK_FOR_ERROR + ;} + break; + + + default: break; + } + +/* Line 1126 of yacc.c. */ +#line 4976 "llvmAsmParser.tab.c" yyvsp -= yylen; yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif -#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 + + 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 +#if YYERROR_VERBOSE yyn = yypact[yystate]; - if (yyn > YYFLAG && yyn < YYLAST) + if (YYPACT_NINF < yyn && 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"); + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; - if (count < 5) +#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; + 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 && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* 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 = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) { - 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++; - } + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } } - yyerror(msg); - free(msg); + yyerror (yymsg); + YYSTACK_FREE (yymsg); } else - yyerror ("parse error; also virtual memory exceeded"); + { + yyerror (YY_("syntax error")); + goto yyexhaustedlab; + } } else #endif /* YYERROR_VERBOSE */ - yyerror("parse error"); + yyerror (YY_("syntax error")); } - 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 YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ - 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 */ + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; - goto yyerrhandle; -yyerrdefault: /* current state does not do anything special for the error token. */ +/*---------------------------------------------------. +| 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 (0) + goto yyerrorlab; -#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 +yyvsp -= yylen; + yyssp -= yylen; + 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; + 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) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); +/*-------------------------------------. +| 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); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK; + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); #endif - } - return 1; + return yyresult; +} + + +#line 2588 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" + + +void llvm::GenerateError(const std::string &message, int LineNo) { + if (LineNo == -1) LineNo = llvmAsmlineno; + // TODO: column number in exception + if (TheParseError) + TheParseError->setError(CurFilename, message, LineNo); + TriggerError = 1; } -#line 2428 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" int yyerror(const char *ErrorMsg) { std::string where @@ -4276,6 +5260,7 @@ errMsg += "end-of-file."; else errMsg += "token: '" + std::string(llvmAsmtext, llvmAsmleng) + "'"; - ThrowException(errMsg); + GenerateError(errMsg); return 0; } + Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.3 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.4 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.3 Fri May 19 16:28:53 2006 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Fri Aug 18 03:43:06 2006 @@ -1,4 +1,244 @@ -typedef union { +/* A Bison parser, made by GNU Bison 2.1. */ + +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 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, 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. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ESINT64VAL = 258, + EUINT64VAL = 259, + SINTVAL = 260, + UINTVAL = 261, + FPVAL = 262, + VOID = 263, + BOOL = 264, + SBYTE = 265, + UBYTE = 266, + SHORT = 267, + USHORT = 268, + INT = 269, + UINT = 270, + LONG = 271, + ULONG = 272, + FLOAT = 273, + DOUBLE = 274, + TYPE = 275, + LABEL = 276, + VAR_ID = 277, + LABELSTR = 278, + STRINGCONSTANT = 279, + IMPLEMENTATION = 280, + ZEROINITIALIZER = 281, + TRUETOK = 282, + FALSETOK = 283, + BEGINTOK = 284, + ENDTOK = 285, + DECLARE = 286, + GLOBAL = 287, + CONSTANT = 288, + SECTION = 289, + VOLATILE = 290, + TO = 291, + DOTDOTDOT = 292, + NULL_TOK = 293, + UNDEF = 294, + CONST = 295, + INTERNAL = 296, + LINKONCE = 297, + WEAK = 298, + APPENDING = 299, + OPAQUE = 300, + NOT = 301, + EXTERNAL = 302, + TARGET = 303, + TRIPLE = 304, + ENDIAN = 305, + POINTERSIZE = 306, + LITTLE = 307, + BIG = 308, + ALIGN = 309, + DEPLIBS = 310, + CALL = 311, + TAIL = 312, + ASM_TOK = 313, + MODULE = 314, + SIDEEFFECT = 315, + CC_TOK = 316, + CCC_TOK = 317, + CSRETCC_TOK = 318, + FASTCC_TOK = 319, + COLDCC_TOK = 320, + RET = 321, + BR = 322, + SWITCH = 323, + INVOKE = 324, + UNWIND = 325, + UNREACHABLE = 326, + ADD = 327, + SUB = 328, + MUL = 329, + DIV = 330, + REM = 331, + AND = 332, + OR = 333, + XOR = 334, + SETLE = 335, + SETGE = 336, + SETLT = 337, + SETGT = 338, + SETEQ = 339, + SETNE = 340, + MALLOC = 341, + ALLOCA = 342, + FREE = 343, + LOAD = 344, + STORE = 345, + GETELEMENTPTR = 346, + PHI_TOK = 347, + CAST = 348, + SELECT = 349, + SHL = 350, + SHR = 351, + VAARG = 352, + EXTRACTELEMENT = 353, + INSERTELEMENT = 354, + SHUFFLEVECTOR = 355, + VAARG_old = 356, + VANEXT_old = 357 + }; +#endif +/* Tokens. */ +#define ESINT64VAL 258 +#define EUINT64VAL 259 +#define SINTVAL 260 +#define UINTVAL 261 +#define FPVAL 262 +#define VOID 263 +#define BOOL 264 +#define SBYTE 265 +#define UBYTE 266 +#define SHORT 267 +#define USHORT 268 +#define INT 269 +#define UINT 270 +#define LONG 271 +#define ULONG 272 +#define FLOAT 273 +#define DOUBLE 274 +#define TYPE 275 +#define LABEL 276 +#define VAR_ID 277 +#define LABELSTR 278 +#define STRINGCONSTANT 279 +#define IMPLEMENTATION 280 +#define ZEROINITIALIZER 281 +#define TRUETOK 282 +#define FALSETOK 283 +#define BEGINTOK 284 +#define ENDTOK 285 +#define DECLARE 286 +#define GLOBAL 287 +#define CONSTANT 288 +#define SECTION 289 +#define VOLATILE 290 +#define TO 291 +#define DOTDOTDOT 292 +#define NULL_TOK 293 +#define UNDEF 294 +#define CONST 295 +#define INTERNAL 296 +#define LINKONCE 297 +#define WEAK 298 +#define APPENDING 299 +#define OPAQUE 300 +#define NOT 301 +#define EXTERNAL 302 +#define TARGET 303 +#define TRIPLE 304 +#define ENDIAN 305 +#define POINTERSIZE 306 +#define LITTLE 307 +#define BIG 308 +#define ALIGN 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 CSRETCC_TOK 318 +#define FASTCC_TOK 319 +#define COLDCC_TOK 320 +#define RET 321 +#define BR 322 +#define SWITCH 323 +#define INVOKE 324 +#define UNWIND 325 +#define UNREACHABLE 326 +#define ADD 327 +#define SUB 328 +#define MUL 329 +#define DIV 330 +#define REM 331 +#define AND 332 +#define OR 333 +#define XOR 334 +#define SETLE 335 +#define SETGE 336 +#define SETLT 337 +#define SETGT 338 +#define SETEQ 339 +#define SETNE 340 +#define MALLOC 341 +#define ALLOCA 342 +#define FREE 343 +#define LOAD 344 +#define STORE 345 +#define GETELEMENTPTR 346 +#define PHI_TOK 347 +#define CAST 348 +#define SELECT 349 +#define SHL 350 +#define SHR 351 +#define VAARG 352 +#define EXTRACTELEMENT 353 +#define INSERTELEMENT 354 +#define SHUFFLEVECTOR 355 +#define VAARG_old 356 +#define VANEXT_old 357 + + + + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#line 897 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -37,106 +277,14 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; } YYSTYPE; -#define ESINT64VAL 257 -#define EUINT64VAL 258 -#define SINTVAL 259 -#define UINTVAL 260 -#define FPVAL 261 -#define VOID 262 -#define BOOL 263 -#define SBYTE 264 -#define UBYTE 265 -#define SHORT 266 -#define USHORT 267 -#define INT 268 -#define UINT 269 -#define LONG 270 -#define ULONG 271 -#define FLOAT 272 -#define DOUBLE 273 -#define TYPE 274 -#define LABEL 275 -#define VAR_ID 276 -#define LABELSTR 277 -#define STRINGCONSTANT 278 -#define IMPLEMENTATION 279 -#define ZEROINITIALIZER 280 -#define TRUETOK 281 -#define FALSETOK 282 -#define BEGINTOK 283 -#define ENDTOK 284 -#define DECLARE 285 -#define GLOBAL 286 -#define CONSTANT 287 -#define SECTION 288 -#define VOLATILE 289 -#define TO 290 -#define DOTDOTDOT 291 -#define NULL_TOK 292 -#define UNDEF 293 -#define CONST 294 -#define INTERNAL 295 -#define LINKONCE 296 -#define WEAK 297 -#define APPENDING 298 -#define OPAQUE 299 -#define NOT 300 -#define EXTERNAL 301 -#define TARGET 302 -#define TRIPLE 303 -#define ENDIAN 304 -#define POINTERSIZE 305 -#define LITTLE 306 -#define BIG 307 -#define ALIGN 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 CSRETCC_TOK 317 -#define FASTCC_TOK 318 -#define COLDCC_TOK 319 -#define RET 320 -#define BR 321 -#define SWITCH 322 -#define INVOKE 323 -#define UNWIND 324 -#define UNREACHABLE 325 -#define ADD 326 -#define SUB 327 -#define MUL 328 -#define DIV 329 -#define REM 330 -#define AND 331 -#define OR 332 -#define XOR 333 -#define SETLE 334 -#define SETGE 335 -#define SETLT 336 -#define SETGT 337 -#define SETEQ 338 -#define SETNE 339 -#define MALLOC 340 -#define ALLOCA 341 -#define FREE 342 -#define LOAD 343 -#define STORE 344 -#define GETELEMENTPTR 345 -#define PHI_TOK 346 -#define CAST 347 -#define SELECT 348 -#define SHL 349 -#define SHR 350 -#define VAARG 351 -#define EXTRACTELEMENT 352 -#define INSERTELEMENT 353 -#define SHUFFLEVECTOR 354 -#define VAARG_old 355 -#define VANEXT_old 356 - +/* Line 1447 of yacc.c. */ +#line 282 "llvmAsmParser.tab.h" +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif extern YYSTYPE llvmAsmlval; + + + Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.255 llvm/lib/AsmParser/llvmAsmParser.y:1.256 --- llvm/lib/AsmParser/llvmAsmParser.y:1.255 Sun May 28 21:33:58 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Fri Aug 18 03:43:06 2006 @@ -27,6 +27,11 @@ #include #include +static bool TriggerError = false; +#define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYERROR; } } + +#define GEN_ERROR(msg) { GenerateError(msg); YYERROR; } + int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -103,7 +108,7 @@ UndefinedReferences += " " + I->first.first->getDescription() + " " + I->first.second.getName() + "\n"; } - ThrowException(UndefinedReferences); + GenerateError(UndefinedReferences); } // Look for intrinsic functions and CallInst that need to be upgraded @@ -160,7 +165,7 @@ // Any forward referenced blocks left? if (!BBForwardRefs.empty()) - ThrowException("Undefined reference to label " + + GenerateError("Undefined reference to label " + BBForwardRefs.begin()->first->getName()); // Resolve all forward references now. @@ -203,7 +208,7 @@ } break; default: - ThrowException("Internal parser error: Invalid symbol type reference!"); + GenerateError("Internal parser error: Invalid symbol type reference!"); } // If we reached here, we referenced either a symbol that we don't know about @@ -215,9 +220,9 @@ if (inFunctionScope()) { if (D.Type == ValID::NameVal) - ThrowException("Reference to an undefined type: '" + D.getName() + "'"); + GenerateError("Reference to an undefined type: '" + D.getName() + "'"); else - ThrowException("Reference to an undefined type: #" + itostr(D.Num)); + GenerateError("Reference to an undefined type: #" + itostr(D.Num)); } std::map::iterator I =CurModule.LateResolveTypes.find(D); @@ -242,7 +247,7 @@ // static Value *getValNonImprovising(const Type *Ty, const ValID &D) { if (isa(Ty)) - ThrowException("Functions are not values and " + GenerateError("Functions are not values and " "must be referenced as pointers"); switch (D.Type) { @@ -279,7 +284,7 @@ // value will fit into the specified type... case ValID::ConstSIntVal: // Is it a constant pool reference?? if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) - ThrowException("Signed integral constant '" + + GenerateError("Signed integral constant '" + itostr(D.ConstPool64) + "' is invalid for type '" + Ty->getDescription() + "'!"); return ConstantSInt::get(Ty, D.ConstPool64); @@ -287,7 +292,7 @@ case ValID::ConstUIntVal: // Is it an unsigned const pool reference? if (!ConstantUInt::isValueValidForType(Ty, D.UConstPool64)) { if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) { - ThrowException("Integral constant '" + utostr(D.UConstPool64) + + GenerateError("Integral constant '" + utostr(D.UConstPool64) + "' is invalid or out of range!"); } else { // This is really a signed reference. Transmogrify. return ConstantSInt::get(Ty, D.ConstPool64); @@ -298,12 +303,12 @@ case ValID::ConstFPVal: // Is it a floating point const pool reference? if (!ConstantFP::isValueValidForType(Ty, D.ConstPoolFP)) - ThrowException("FP constant invalid for type!!"); + GenerateError("FP constant invalid for type!!"); return ConstantFP::get(Ty, D.ConstPoolFP); case ValID::ConstNullVal: // Is it a null value? if (!isa(Ty)) - ThrowException("Cannot create a a non pointer null!"); + GenerateError("Cannot create a a non pointer null!"); return ConstantPointerNull::get(cast(Ty)); case ValID::ConstUndefVal: // Is it an undef value? @@ -314,7 +319,7 @@ case ValID::ConstantVal: // Fully resolved constant? if (D.ConstantValue->getType() != Ty) - ThrowException("Constant expression type different from required type!"); + GenerateError("Constant expression type different from required type!"); return D.ConstantValue; case ValID::InlineAsmVal: { // Inline asm expression @@ -322,7 +327,7 @@ const FunctionType *FTy = PTy ? dyn_cast(PTy->getElementType()) : 0; if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) - ThrowException("Invalid type for asm constraint string!"); + GenerateError("Invalid type for asm constraint string!"); InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints, D.IAD->HasSideEffects); D.destroy(); // Free InlineAsmDescriptor. @@ -345,14 +350,14 @@ // static Value *getVal(const Type *Ty, const ValID &ID) { if (Ty == Type::LabelTy) - ThrowException("Cannot use a basic block here"); + GenerateError("Cannot use a basic block here"); // See if the value has already been defined. Value *V = getValNonImprovising(Ty, ID); if (V) return V; if (!Ty->isFirstClassType() && !isa(Ty)) - ThrowException("Invalid use of a composite type!"); + GenerateError("Invalid use of a composite type!"); // If we reached here, we referenced either a symbol that we don't know about // or an id number that hasn't been read yet. We may be referencing something @@ -384,7 +389,7 @@ std::string Name; BasicBlock *BB = 0; switch (ID.Type) { - default: ThrowException("Illegal label reference " + ID.getName()); + default: GenerateError("Illegal label reference " + ID.getName()); case ValID::NumberVal: // Is it a numbered definition? if (unsigned(ID.Num) >= CurFun.NumberedBlocks.size()) CurFun.NumberedBlocks.resize(ID.Num+1); @@ -405,7 +410,7 @@ // an entry for it in the PlaceHolderInfo map. if (isDefinition && !CurFun.BBForwardRefs.erase(BB)) // The existing value was a definition, not a forward reference. - ThrowException("Redefinition of label " + ID.getName()); + GenerateError("Redefinition of label " + ID.getName()); ID.destroy(); // Free strdup'd memory. return BB; @@ -479,11 +484,11 @@ InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) - ThrowException("Reference to an invalid definition: '" +DID.getName()+ + GenerateError("Reference to an invalid definition: '" +DID.getName()+ "' of type '" + V->getType()->getDescription() + "'", PHI->second.second); else - ThrowException("Reference to an invalid definition: #" + + GenerateError("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + V->getType()->getDescription() + "'", PHI->second.second); @@ -521,12 +526,12 @@ free(NameStr); // Free old string if (V->getType() == Type::VoidTy) - ThrowException("Can't assign name '" + Name+"' to value with void type!"); + GenerateError("Can't assign name '" + Name+"' to value with void type!"); assert(inFunctionScope() && "Must be in function scope!"); SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable(); if (ST.lookup(V->getType(), Name)) - ThrowException("Redefinition of value named '" + Name + "' in the '" + + GenerateError("Redefinition of value named '" + Name + "' in the '" + V->getType()->getDescription() + "' type plane!"); // Set the name. @@ -541,7 +546,7 @@ bool isConstantGlobal, const Type *Ty, Constant *Initializer) { if (isa(Ty)) - ThrowException("Cannot declare global vars of function type!"); + GenerateError("Cannot declare global vars of function type!"); const PointerType *PTy = PointerType::get(Ty); @@ -598,7 +603,7 @@ return EGV; } - ThrowException("Redefinition of global variable named '" + Name + + GenerateError("Redefinition of global variable named '" + Name + "' in the '" + Ty->getDescription() + "' type plane!"); } } @@ -627,7 +632,7 @@ // We don't allow assigning names to void type if (T == Type::VoidTy) - ThrowException("Can't assign name '" + Name + "' to the void type!"); + GenerateError("Can't assign name '" + Name + "' to the void type!"); // Set the type name, checking for conflicts as we do so. bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T); @@ -651,7 +656,7 @@ if (Existing == T) return true; // Yes, it's equal. // Any other kind of (non-equivalent) redefinition is an error. - ThrowException("Redefinition of type named '" + Name + "' in the '" + + GenerateError("Redefinition of type named '" + Name + "' in the '" + T->getDescription() + "' type plane!"); } @@ -757,6 +762,8 @@ CurModule.CurrentModule = M; yyparse(); // Parse the file, potentially throwing exception + if (!ParserResult) + return 0; Module *Result = ParserResult; ParserResult = 0; @@ -773,12 +780,12 @@ } if (ObsoleteVarArgs && NewVarArgs) - ThrowException("This file is corrupt: it uses both new and old style varargs"); + GenerateError("This file is corrupt: it uses both new and old style varargs"); if(ObsoleteVarArgs) { if(Function* F = Result->getNamedFunction("llvm.va_start")) { if (F->arg_size() != 0) - ThrowException("Obsolete va_start takes 0 argument!"); + GenerateError("Obsolete va_start takes 0 argument!"); //foo = va_start() // -> @@ -805,7 +812,7 @@ if(Function* F = Result->getNamedFunction("llvm.va_end")) { if(F->arg_size() != 1) - ThrowException("Obsolete va_end takes 1 argument!"); + GenerateError("Obsolete va_end takes 1 argument!"); //vaend foo // -> @@ -829,7 +836,7 @@ if(Function* F = Result->getNamedFunction("llvm.va_copy")) { if(F->arg_size() != 1) - ThrowException("Obsolete va_copy takes 1 argument!"); + GenerateError("Obsolete va_copy takes 1 argument!"); //foo = vacopy(bar) // -> //a = alloca 1 of typeof(foo) @@ -1010,16 +1017,18 @@ INTVAL : SINTVAL; INTVAL : UINTVAL { if ($1 > (uint32_t)INT32_MAX) // Outside of my range! - ThrowException("Value too large for type!"); + GEN_ERROR("Value too large for type!"); $$ = (int32_t)$1; + CHECK_FOR_ERROR }; EINT64VAL : ESINT64VAL; // These have same type and can't cause problems... EINT64VAL : EUINT64VAL { if ($1 > (uint64_t)INT64_MAX) // Outside of my range! - ThrowException("Value too large for type!"); + GEN_ERROR("Value too large for type!"); $$ = (int64_t)$1; + CHECK_FOR_ERROR }; // Operations that are notably excluded from this list include: @@ -1041,9 +1050,11 @@ // OptAssign - Value producing statements have an optional assignment component OptAssign : Name '=' { $$ = $1; + CHECK_FOR_ERROR } | /*empty*/ { $$ = 0; + CHECK_FOR_ERROR }; OptLinkage : INTERNAL { $$ = GlobalValue::InternalLinkage; } | @@ -1059,8 +1070,9 @@ COLDCC_TOK { $$ = CallingConv::Cold; } | CC_TOK EUINT64VAL { if ((unsigned)$2 != $2) - ThrowException("Calling conv too large!"); + GEN_ERROR("Calling conv too large!"); $$ = $2; + CHECK_FOR_ERROR }; // OptAlign/OptCAlign - An optional alignment, and an optional alignment with @@ -1069,21 +1081,24 @@ ALIGN EUINT64VAL { $$ = $2; if ($$ != 0 && !isPowerOf2_32($$)) - ThrowException("Alignment must be a power of two!"); + GEN_ERROR("Alignment must be a power of two!"); + CHECK_FOR_ERROR }; OptCAlign : /*empty*/ { $$ = 0; } | ',' ALIGN EUINT64VAL { $$ = $3; if ($$ != 0 && !isPowerOf2_32($$)) - ThrowException("Alignment must be a power of two!"); + GEN_ERROR("Alignment must be a power of two!"); + CHECK_FOR_ERROR }; SectionString : SECTION STRINGCONSTANT { for (unsigned i = 0, e = strlen($2); i != e; ++i) if ($2[i] == '"' || $2[i] == '\\') - ThrowException("Invalid character in section name!"); + GEN_ERROR("Invalid character in section name!"); $$ = $2; + CHECK_FOR_ERROR }; OptSection : /*empty*/ { $$ = 0; } | @@ -1097,11 +1112,13 @@ GlobalVarAttribute : SectionString { CurGV->setSection($1); free($1); + CHECK_FOR_ERROR } | ALIGN EUINT64VAL { if ($2 != 0 && !isPowerOf2_32($2)) - ThrowException("Alignment must be a power of two!"); + GEN_ERROR("Alignment must be a power of two!"); CurGV->setAlignment($2); + CHECK_FOR_ERROR }; //===----------------------------------------------------------------------===// @@ -1116,8 +1133,9 @@ Types : UpRTypes { if (!UpRefs.empty()) - ThrowException("Invalid upreference in type: " + (*$1)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription()); $$ = $1; + CHECK_FOR_ERROR }; @@ -1127,22 +1145,26 @@ PrimType : LONG | ULONG | FLOAT | DOUBLE | TYPE | LABEL; UpRTypes : OPAQUE { $$ = new PATypeHolder(OpaqueType::get()); + CHECK_FOR_ERROR } | PrimType { $$ = new PATypeHolder($1); + CHECK_FOR_ERROR }; UpRTypes : SymbolicValueRef { // Named types are also simple types... $$ = new PATypeHolder(getTypeVal($1)); + CHECK_FOR_ERROR }; // Include derived types in the Types production. // UpRTypes : '\\' EUINT64VAL { // Type UpReference - if ($2 > (uint64_t)~0U) ThrowException("Value out of range!"); + if ($2 > (uint64_t)~0U) GEN_ERROR("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder UpRefs.push_back(UpRefRecord((unsigned)$2, OT)); // Add to vector... $$ = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); + CHECK_FOR_ERROR } | UpRTypesV '(' ArgTypeListI ')' { // Function derived type? std::vector Params; @@ -1155,21 +1177,24 @@ $$ = new PATypeHolder(HandleUpRefs(FunctionType::get(*$1,Params,isVarArg))); delete $3; // Delete the argument list delete $1; // Delete the return type handle + CHECK_FOR_ERROR } | '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type? $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2))); delete $4; + CHECK_FOR_ERROR } | '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type? const llvm::Type* ElemTy = $4->get(); if ((unsigned)$2 != $2) - ThrowException("Unsigned result not equal to signed result"); + GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isPrimitiveType()) - ThrowException("Elemental type of a PackedType must be primitive"); + GEN_ERROR("Elemental type of a PackedType must be primitive"); if (!isPowerOf2_32($2)) - ThrowException("Vector length should be a power of 2!"); + GEN_ERROR("Vector length should be a power of 2!"); $$ = new PATypeHolder(HandleUpRefs(PackedType::get(*$4, (unsigned)$2))); delete $4; + CHECK_FOR_ERROR } | '{' TypeListI '}' { // Structure type? std::vector Elements; @@ -1179,13 +1204,16 @@ $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); delete $2; + CHECK_FOR_ERROR } | '{' '}' { // Empty structure type? $$ = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR } | UpRTypes '*' { // Pointer type? $$ = new PATypeHolder(HandleUpRefs(PointerType::get(*$1))); delete $1; + CHECK_FOR_ERROR }; // TypeList - Used for struct declarations and as a basis for function type @@ -1194,21 +1222,26 @@ TypeListI : UpRTypes { $$ = new std::list(); $$->push_back(*$1); delete $1; + CHECK_FOR_ERROR } | TypeListI ',' UpRTypes { ($$=$1)->push_back(*$3); delete $3; + CHECK_FOR_ERROR }; // ArgTypeList - List of types for a function type declaration... ArgTypeListI : TypeListI | TypeListI ',' DOTDOTDOT { ($$=$1)->push_back(Type::VoidTy); + CHECK_FOR_ERROR } | DOTDOTDOT { ($$ = new std::list())->push_back(Type::VoidTy); + CHECK_FOR_ERROR } | /*empty*/ { $$ = new std::list(); + CHECK_FOR_ERROR }; // ConstVal - The various declarations that go into the constant pool. This @@ -1220,52 +1253,54 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + + GEN_ERROR("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... if (NumElements != -1 && NumElements != (int)$3->size()) - ThrowException("Type mismatch: constant sized array initialized with " + + GEN_ERROR("Type mismatch: constant sized array initialized with " + utostr($3->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! for (unsigned i = 0; i < $3->size(); i++) { if (ETy != (*$3)[i]->getType()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ (*$3)[i]->getType()->getDescription() + "'."); } $$ = ConstantArray::get(ATy, *$3); delete $1; delete $3; + CHECK_FOR_ERROR } | Types '[' ']' { const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + + GEN_ERROR("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) - ThrowException("Type mismatch: constant sized array initialized with 0" + GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); $$ = ConstantArray::get(ATy, std::vector()); delete $1; + CHECK_FOR_ERROR } | Types 'c' STRINGCONSTANT { const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + + GEN_ERROR("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); char *EndStr = UnEscapeLexed($3, true); if (NumElements != -1 && NumElements != (EndStr-$3)) - ThrowException("Can't build string constant of size " + + GEN_ERROR("Can't build string constant of size " + itostr((int)(EndStr-$3)) + " when array has size " + itostr(NumElements) + "!"); std::vector Vals; @@ -1278,86 +1313,92 @@ Vals.push_back(ConstantUInt::get(ETy, *C)); } else { free($3); - ThrowException("Cannot build string arrays of non byte sized elements!"); + GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } free($3); $$ = ConstantArray::get(ATy, Vals); delete $1; + CHECK_FOR_ERROR } | Types '<' ConstVector '>' { // Nonempty unsized arr const PackedType *PTy = dyn_cast($1->get()); if (PTy == 0) - ThrowException("Cannot make packed constant with type: '" + + GEN_ERROR("Cannot make packed constant with type: '" + (*$1)->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... if (NumElements != -1 && NumElements != (int)$3->size()) - ThrowException("Type mismatch: constant sized packed initialized with " + + GEN_ERROR("Type mismatch: constant sized packed initialized with " + utostr($3->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! for (unsigned i = 0; i < $3->size(); i++) { if (ETy != (*$3)[i]->getType()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ (*$3)[i]->getType()->getDescription() + "'."); } $$ = ConstantPacked::get(PTy, *$3); delete $1; delete $3; + CHECK_FOR_ERROR } | Types '{' ConstVector '}' { const StructType *STy = dyn_cast($1->get()); if (STy == 0) - ThrowException("Cannot make struct constant with type: '" + + GEN_ERROR("Cannot make struct constant with type: '" + (*$1)->getDescription() + "'!"); if ($3->size() != STy->getNumContainedTypes()) - ThrowException("Illegal number of initializers for structure type!"); + 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 = $3->size(); i != e; ++i) if ((*$3)[i]->getType() != STy->getElementType(i)) - ThrowException("Expected type '" + + GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer!"); $$ = ConstantStruct::get(STy, *$3); delete $1; delete $3; + CHECK_FOR_ERROR } | Types '{' '}' { const StructType *STy = dyn_cast($1->get()); if (STy == 0) - ThrowException("Cannot make struct constant with type: '" + + GEN_ERROR("Cannot make struct constant with type: '" + (*$1)->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) - ThrowException("Illegal number of initializers for structure type!"); + GEN_ERROR("Illegal number of initializers for structure type!"); $$ = ConstantStruct::get(STy, std::vector()); delete $1; + CHECK_FOR_ERROR } | Types NULL_TOK { const PointerType *PTy = dyn_cast($1->get()); if (PTy == 0) - ThrowException("Cannot make null pointer constant with type: '" + + GEN_ERROR("Cannot make null pointer constant with type: '" + (*$1)->getDescription() + "'!"); $$ = ConstantPointerNull::get(PTy); delete $1; + CHECK_FOR_ERROR } | Types UNDEF { $$ = UndefValue::get($1->get()); delete $1; + CHECK_FOR_ERROR } | Types SymbolicValueRef { const PointerType *Ty = dyn_cast($1->get()); if (Ty == 0) - ThrowException("Global const reference must be a pointer type!"); + GEN_ERROR("Global const reference must be a pointer type!"); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -1412,57 +1453,66 @@ $$ = cast(V); delete $1; // Free the type handle + CHECK_FOR_ERROR } | Types ConstExpr { if ($1->get() != $2->getType()) - ThrowException("Mismatched types for constant expression!"); + GEN_ERROR("Mismatched types for constant expression!"); $$ = $2; delete $1; + CHECK_FOR_ERROR } | Types ZEROINITIALIZER { const Type *Ty = $1->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) - ThrowException("Cannot create a null initialized value of this type!"); + GEN_ERROR("Cannot create a null initialized value of this type!"); $$ = Constant::getNullValue(Ty); delete $1; + CHECK_FOR_ERROR }; ConstVal : SIntType EINT64VAL { // integral constants if (!ConstantSInt::isValueValidForType($1, $2)) - ThrowException("Constant value doesn't fit in type!"); + GEN_ERROR("Constant value doesn't fit in type!"); $$ = ConstantSInt::get($1, $2); + CHECK_FOR_ERROR } | UIntType EUINT64VAL { // integral constants if (!ConstantUInt::isValueValidForType($1, $2)) - ThrowException("Constant value doesn't fit in type!"); + GEN_ERROR("Constant value doesn't fit in type!"); $$ = ConstantUInt::get($1, $2); + CHECK_FOR_ERROR } | BOOL TRUETOK { // Boolean constants $$ = ConstantBool::True; + CHECK_FOR_ERROR } | BOOL FALSETOK { // Boolean constants $$ = ConstantBool::False; + CHECK_FOR_ERROR } | FPType FPVAL { // Float & Double constants if (!ConstantFP::isValueValidForType($1, $2)) - ThrowException("Floating point constant invalid for type!!"); + GEN_ERROR("Floating point constant invalid for type!!"); $$ = ConstantFP::get($1, $2); + CHECK_FOR_ERROR }; ConstExpr: CAST '(' ConstVal TO Types ')' { if (!$3->getType()->isFirstClassType()) - ThrowException("cast constant expression from a non-primitive type: '" + + GEN_ERROR("cast constant expression from a non-primitive type: '" + $3->getType()->getDescription() + "'!"); if (!$5->get()->isFirstClassType()) - ThrowException("cast constant expression to a non-primitive type: '" + + GEN_ERROR("cast constant expression to a non-primitive type: '" + $5->get()->getDescription() + "'!"); $$ = ConstantExpr::getCast($3, $5->get()); delete $5; + CHECK_FOR_ERROR } | GETELEMENTPTR '(' ConstVal IndexList ')' { if (!isa($3->getType())) - ThrowException("GetElementPtr requires a pointer operand!"); + GEN_ERROR("GetElementPtr requires a pointer operand!"); // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct // indices to uint struct indices for compatibility. @@ -1478,29 +1528,31 @@ const Type *IdxTy = GetElementPtrInst::getIndexedType($3->getType(), *$4, true); if (!IdxTy) - ThrowException("Index list invalid for constant getelementptr!"); + GEN_ERROR("Index list invalid for constant getelementptr!"); std::vector IdxVec; for (unsigned i = 0, e = $4->size(); i != e; ++i) if (Constant *C = dyn_cast((*$4)[i])) IdxVec.push_back(C); else - ThrowException("Indices to constant getelementptr must be constants!"); + GEN_ERROR("Indices to constant getelementptr must be constants!"); delete $4; $$ = ConstantExpr::getGetElementPtr($3, IdxVec); + CHECK_FOR_ERROR } | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { if ($3->getType() != Type::BoolTy) - ThrowException("Select condition must be of boolean type!"); + GEN_ERROR("Select condition must be of boolean type!"); if ($5->getType() != $7->getType()) - ThrowException("Select operand types must match!"); + GEN_ERROR("Select operand types must match!"); $$ = ConstantExpr::getSelect($3, $5, $7); + CHECK_FOR_ERROR } | ArithmeticOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) - ThrowException("Binary operator types must match!"); + GEN_ERROR("Binary operator types must match!"); // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the @@ -1512,59 +1564,68 @@ switch (CurModule.CurrentModule->getPointerSize()) { case Module::Pointer32: IntPtrTy = Type::IntTy; break; case Module::Pointer64: IntPtrTy = Type::LongTy; break; - default: ThrowException("invalid pointer binary constant expr!"); + default: GEN_ERROR("invalid pointer binary constant expr!"); } $$ = ConstantExpr::get($1, ConstantExpr::getCast($3, IntPtrTy), ConstantExpr::getCast($5, IntPtrTy)); $$ = ConstantExpr::getCast($$, $3->getType()); } + CHECK_FOR_ERROR } | LogicalOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) - ThrowException("Logical operator types must match!"); + GEN_ERROR("Logical operator types must match!"); if (!$3->getType()->isIntegral()) { if (!isa($3->getType()) || !cast($3->getType())->getElementType()->isIntegral()) - ThrowException("Logical operator requires integral operands!"); + GEN_ERROR("Logical operator requires integral operands!"); } $$ = ConstantExpr::get($1, $3, $5); + CHECK_FOR_ERROR } | SetCondOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) - ThrowException("setcc operand types must match!"); + GEN_ERROR("setcc operand types must match!"); $$ = ConstantExpr::get($1, $3, $5); + CHECK_FOR_ERROR } | ShiftOps '(' ConstVal ',' ConstVal ')' { if ($5->getType() != Type::UByteTy) - ThrowException("Shift count for shift constant must be unsigned byte!"); + GEN_ERROR("Shift count for shift constant must be unsigned byte!"); if (!$3->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); + GEN_ERROR("Shift constant expression requires integer operand!"); $$ = ConstantExpr::get($1, $3, $5); + CHECK_FOR_ERROR } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { if (!ExtractElementInst::isValidOperands($3, $5)) - ThrowException("Invalid extractelement operands!"); + GEN_ERROR("Invalid extractelement operands!"); $$ = ConstantExpr::getExtractElement($3, $5); + CHECK_FOR_ERROR } | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' { if (!InsertElementInst::isValidOperands($3, $5, $7)) - ThrowException("Invalid insertelement operands!"); + GEN_ERROR("Invalid insertelement operands!"); $$ = ConstantExpr::getInsertElement($3, $5, $7); + CHECK_FOR_ERROR } | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' { if (!ShuffleVectorInst::isValidOperands($3, $5, $7)) - ThrowException("Invalid shufflevector operands!"); + GEN_ERROR("Invalid shufflevector operands!"); $$ = ConstantExpr::getShuffleVector($3, $5, $7); + CHECK_FOR_ERROR }; // ConstVector - A list of comma separated constants. ConstVector : ConstVector ',' ConstVal { ($$ = $1)->push_back($3); + CHECK_FOR_ERROR } | ConstVal { $$ = new std::vector(); $$->push_back($1); + CHECK_FOR_ERROR }; @@ -1582,6 +1643,7 @@ Module : FunctionList { $$ = ParserResult = $1; CurModule.ModuleDone(); + CHECK_FOR_ERROR }; // FunctionList - A list of functions, preceeded by a constant pool. @@ -1589,26 +1651,32 @@ FunctionList : FunctionList Function { $$ = $1; CurFun.FunctionDone(); + CHECK_FOR_ERROR } | FunctionList FunctionProto { $$ = $1; + CHECK_FOR_ERROR } | FunctionList MODULE ASM_TOK AsmBlock { $$ = $1; + CHECK_FOR_ERROR } | FunctionList IMPLEMENTATION { $$ = $1; + CHECK_FOR_ERROR } | ConstPool { $$ = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; - if (DID.Type == ValID::NameVal) - ThrowException("Reference to an undefined type: '"+DID.getName() + "'"); - else - ThrowException("Reference to an undefined type: #" + itostr(DID.Num)); + if (DID.Type == ValID::NameVal) { + GEN_ERROR("Reference to an undefined type: '"+DID.getName() + "'"); + } else { + GEN_ERROR("Reference to an undefined type: #" + itostr(DID.Num)); + } } + CHECK_FOR_ERROR }; // ConstPool - Constants with optional names assigned to them. @@ -1631,16 +1699,20 @@ } delete $4; + CHECK_FOR_ERROR } | ConstPool FunctionProto { // Function prototypes can be in const pool + CHECK_FOR_ERROR } | ConstPool MODULE ASM_TOK AsmBlock { // Asm blocks can be in the const pool + CHECK_FOR_ERROR } | ConstPool OptAssign OptLinkage GlobalType ConstVal { - if ($5 == 0) ThrowException("Global value initializer is not a constant!"); + if ($5 == 0) GEN_ERROR("Global value initializer is not a constant!"); CurGV = ParseGlobalVariable($2, $3, $4, $5->getType(), $5); } GlobalVarAttributes { CurGV = 0; + CHECK_FOR_ERROR } | ConstPool OptAssign EXTERNAL GlobalType Types { CurGV = ParseGlobalVariable($2, GlobalValue::ExternalLinkage, @@ -1648,10 +1720,13 @@ delete $5; } GlobalVarAttributes { CurGV = 0; + CHECK_FOR_ERROR } | ConstPool TARGET TargetDefinition { + CHECK_FOR_ERROR } | ConstPool DEPLIBS '=' LibrariesDefinition { + CHECK_FOR_ERROR } | /* empty: end of list */ { }; @@ -1667,6 +1742,7 @@ CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); + CHECK_FOR_ERROR }; BigOrLittle : BIG { $$ = Module::BigEndian; }; @@ -1674,6 +1750,7 @@ TargetDefinition : ENDIAN '=' BigOrLittle { CurModule.CurrentModule->setEndianness($3); + CHECK_FOR_ERROR } | POINTERSIZE '=' EUINT64VAL { if ($3 == 32) @@ -1681,11 +1758,13 @@ else if ($3 == 64) CurModule.CurrentModule->setPointerSize(Module::Pointer64); else - ThrowException("Invalid pointer size: '" + utostr($3) + "'!"); + GEN_ERROR("Invalid pointer size: '" + utostr($3) + "'!"); + CHECK_FOR_ERROR } | TRIPLE '=' STRINGCONSTANT { CurModule.CurrentModule->setTargetTriple($3); free($3); + CHECK_FOR_ERROR }; LibrariesDefinition : '[' LibList ']'; @@ -1693,12 +1772,15 @@ LibList : LibList ',' STRINGCONSTANT { CurModule.CurrentModule->addLibrary($3); free($3); + CHECK_FOR_ERROR } | STRINGCONSTANT { CurModule.CurrentModule->addLibrary($1); free($1); + CHECK_FOR_ERROR } | /* empty: end of list */ { + CHECK_FOR_ERROR } ; @@ -1711,35 +1793,42 @@ ArgVal : Types OptName { if (*$1 == Type::VoidTy) - ThrowException("void typed arguments are invalid!"); + GEN_ERROR("void typed arguments are invalid!"); $$ = new std::pair($1, $2); + CHECK_FOR_ERROR }; ArgListH : ArgListH ',' ArgVal { $$ = $1; $1->push_back(*$3); delete $3; + CHECK_FOR_ERROR } | ArgVal { $$ = new std::vector >(); $$->push_back(*$1); delete $1; + CHECK_FOR_ERROR }; ArgList : ArgListH { $$ = $1; + CHECK_FOR_ERROR } | ArgListH ',' DOTDOTDOT { $$ = $1; $$->push_back(std::pair(new PATypeHolder(Type::VoidTy), 0)); + CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new std::vector >(); $$->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); + CHECK_FOR_ERROR } | /* empty */ { $$ = 0; + CHECK_FOR_ERROR }; FunctionHeaderH : OptCallingConv TypesV Name '(' ArgList ')' @@ -1749,7 +1838,7 @@ free($3); // Free strdup'd memory! if (!(*$2)->isFirstClassType() && *$2 != Type::VoidTy) - ThrowException("LLVM functions cannot return aggregate types!"); + GEN_ERROR("LLVM functions cannot return aggregate types!"); std::vector ParamTypeList; if ($5) { // If there are arguments... @@ -1785,7 +1874,7 @@ // If this is the case, either we need to be a forward decl, or it needs // to be. if (!CurFun.isDeclare && !Fn->isExternal()) - ThrowException("Redefinition of function '" + FunctionName + "'!"); + GEN_ERROR("Redefinition of function '" + FunctionName + "'!"); // Make sure to strip off any argument names so we can't get conflicts. if (Fn->isExternal()) @@ -1826,6 +1915,7 @@ delete $5; // We're now done with the argument list } + CHECK_FOR_ERROR }; BEGIN : BEGINTOK | '{'; // Allow BEGIN or '{' to start a function @@ -1842,11 +1932,13 @@ Function : BasicBlockList END { $$ = $1; + CHECK_FOR_ERROR }; FunctionProto : DECLARE { CurFun.isDeclare = true; } FunctionHeaderH { $$ = CurFun.CurrentFunction; CurFun.FunctionDone(); + CHECK_FOR_ERROR }; //===----------------------------------------------------------------------===// @@ -1855,34 +1947,44 @@ OptSideEffect : /* empty */ { $$ = false; + CHECK_FOR_ERROR } | SIDEEFFECT { $$ = true; + CHECK_FOR_ERROR }; ConstValueRef : ESINT64VAL { // A reference to a direct constant $$ = ValID::create($1); + CHECK_FOR_ERROR } | EUINT64VAL { $$ = ValID::create($1); + CHECK_FOR_ERROR } | FPVAL { // Perhaps it's an FP constant? $$ = ValID::create($1); + CHECK_FOR_ERROR } | TRUETOK { $$ = ValID::create(ConstantBool::True); + CHECK_FOR_ERROR } | FALSETOK { $$ = ValID::create(ConstantBool::False); + CHECK_FOR_ERROR } | NULL_TOK { $$ = ValID::createNull(); + CHECK_FOR_ERROR } | UNDEF { $$ = ValID::createUndef(); + CHECK_FOR_ERROR } | ZEROINITIALIZER { // A vector zero constant. $$ = ValID::createZeroInit(); + CHECK_FOR_ERROR } | '<' ConstVector '>' { // Nonempty unsized packed vector const Type *ETy = (*$2)[0]->getType(); @@ -1900,16 +2002,18 @@ // Verify all elements are correct type! for (unsigned i = 0; i < $2->size(); i++) { if (ETy != (*$2)[i]->getType()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + (*$2)[i]->getType()->getDescription() + "'."); } $$ = ValID::create(ConstantPacked::get(pt, *$2)); delete PTy; delete $2; + CHECK_FOR_ERROR } | ConstExpr { $$ = ValID::create($1); + CHECK_FOR_ERROR } | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT { char *End = UnEscapeLexed($3, true); @@ -1919,6 +2023,7 @@ $$ = ValID::createInlineAsm(AsmStr, Constraints, $2); free($3); free($5); + CHECK_FOR_ERROR }; // SymbolicValueRef - Reference to one of two ways of symbolically refering to @@ -1926,9 +2031,11 @@ // SymbolicValueRef : INTVAL { // Is it an integer reference...? $$ = ValID::create($1); + CHECK_FOR_ERROR } | Name { // Is it a named reference...? $$ = ValID::create($1); + CHECK_FOR_ERROR }; // ValueRef - A reference to a definition... either constant or symbolic @@ -1940,13 +2047,16 @@ // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') ResolvedVal : Types ValueRef { $$ = getVal(*$1, $2); delete $1; + CHECK_FOR_ERROR }; BasicBlockList : BasicBlockList BasicBlock { $$ = $1; + CHECK_FOR_ERROR } | FunctionHeader BasicBlock { // Do not allow functions with 0 basic blocks $$ = $1; + CHECK_FOR_ERROR }; @@ -1960,11 +2070,13 @@ $1->getInstList().push_back($3); InsertValue($1); $$ = $1; + CHECK_FOR_ERROR }; InstructionList : InstructionList Inst { $1->getInstList().push_back($2); $$ = $1; + CHECK_FOR_ERROR } | /* empty */ { $$ = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); @@ -1975,6 +2087,7 @@ Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); BBL.splice(BBL.end(), BBL, $$); + CHECK_FOR_ERROR } | LABELSTR { $$ = CurBB = getBBVal(ValID::create($1), true); @@ -1985,19 +2098,24 @@ Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); BBL.splice(BBL.end(), BBL, $$); + CHECK_FOR_ERROR }; BBTerminatorInst : RET ResolvedVal { // Return with a result... $$ = new ReturnInst($2); + CHECK_FOR_ERROR } | RET VOID { // Return with no result... $$ = new ReturnInst(); + CHECK_FOR_ERROR } | BR LABEL ValueRef { // Unconditional Branch... $$ = new BranchInst(getBBVal($3)); + CHECK_FOR_ERROR } // Conditional Branch... | BR BOOL ValueRef ',' LABEL ValueRef ',' LABEL ValueRef { $$ = new BranchInst(getBBVal($6), getBBVal($9), getVal(Type::BoolTy, $3)); + CHECK_FOR_ERROR } | SWITCH IntType ValueRef ',' LABEL ValueRef '[' JumpTable ']' { SwitchInst *S = new SwitchInst(getVal($2, $3), getBBVal($6), $8->size()); @@ -2009,13 +2127,15 @@ if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else - ThrowException("Switch case is constant, but not a simple integer!"); + GEN_ERROR("Switch case is constant, but not a simple integer!"); } delete $8; + CHECK_FOR_ERROR } | SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' { SwitchInst *S = new SwitchInst(getVal($2, $3), getBBVal($6), 0); $$ = S; + CHECK_FOR_ERROR } | INVOKE OptCallingConv TypesV ValueRef '(' ValueRefListE ')' TO LABEL ValueRef UNWIND LABEL ValueRef { @@ -2057,11 +2177,11 @@ for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI)->getType() != *I) - ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" + + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - ThrowException("Invalid number of parameters detected!"); + GEN_ERROR("Invalid number of parameters detected!"); $$ = new InvokeInst(V, Normal, Except, *$6); } @@ -2069,12 +2189,15 @@ delete $3; delete $6; + CHECK_FOR_ERROR } | UNWIND { $$ = new UnwindInst(); + CHECK_FOR_ERROR } | UNREACHABLE { $$ = new UnreachableInst(); + CHECK_FOR_ERROR }; @@ -2083,18 +2206,20 @@ $$ = $1; Constant *V = cast(getValNonImprovising($2, $3)); if (V == 0) - ThrowException("May only switch on a constant pool value!"); + GEN_ERROR("May only switch on a constant pool value!"); $$->push_back(std::make_pair(V, getBBVal($6))); + CHECK_FOR_ERROR } | IntType ConstValueRef ',' LABEL ValueRef { $$ = new std::vector >(); Constant *V = cast(getValNonImprovising($1, $2)); if (V == 0) - ThrowException("May only switch on a constant pool value!"); + GEN_ERROR("May only switch on a constant pool value!"); $$->push_back(std::make_pair(V, getBBVal($5))); + CHECK_FOR_ERROR }; Inst : OptAssign InstVal { @@ -2102,27 +2227,32 @@ setValueName($2, $1); InsertValue($2); $$ = $2; + CHECK_FOR_ERROR }; PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes $$ = new std::list >(); $$->push_back(std::make_pair(getVal(*$1, $3), getBBVal($5))); delete $1; + CHECK_FOR_ERROR } | PHIList ',' '[' ValueRef ',' ValueRef ']' { $$ = $1; $1->push_back(std::make_pair(getVal($1->front().first->getType(), $4), getBBVal($6))); + CHECK_FOR_ERROR }; ValueRefList : ResolvedVal { // Used for call statements, and memory insts... $$ = new std::vector(); $$->push_back($1); + CHECK_FOR_ERROR } | ValueRefList ',' ResolvedVal { $$ = $1; $1->push_back($3); + CHECK_FOR_ERROR }; // ValueRefListE - Just like ValueRefList, except that it may also be empty! @@ -2130,9 +2260,11 @@ OptTailCall : TAIL CALL { $$ = true; + CHECK_FOR_ERROR } | CALL { $$ = false; + CHECK_FOR_ERROR }; @@ -2140,35 +2272,38 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() && !isa((*$2).get())) - ThrowException( + GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); if (isa((*$2).get()) && $1 == Instruction::Rem) - ThrowException("Rem not supported on packed types!"); + GEN_ERROR("Rem not supported on packed types!"); $$ = BinaryOperator::create($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) - ThrowException("binary operator returned null!"); + GEN_ERROR("binary operator returned null!"); delete $2; + CHECK_FOR_ERROR } | LogicalOps Types ValueRef ',' ValueRef { if (!(*$2)->isIntegral()) { if (!isa($2->get()) || !cast($2->get())->getElementType()->isIntegral()) - ThrowException("Logical operator requires integral operands!"); + GEN_ERROR("Logical operator requires integral operands!"); } $$ = BinaryOperator::create($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) - ThrowException("binary operator returned null!"); + GEN_ERROR("binary operator returned null!"); delete $2; + CHECK_FOR_ERROR } | SetCondOps Types ValueRef ',' ValueRef { if(isa((*$2).get())) { - ThrowException( + GEN_ERROR( "PackedTypes currently not supported in setcc instructions!"); } $$ = new SetCondInst($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) - ThrowException("binary operator returned null!"); + GEN_ERROR("binary operator returned null!"); delete $2; + CHECK_FOR_ERROR } | NOT ResolvedVal { std::cerr << "WARNING: Use of eliminated 'not' instruction:" @@ -2176,37 +2311,42 @@ Value *Ones = ConstantIntegral::getAllOnesValue($2->getType()); if (Ones == 0) - ThrowException("Expected integral type for not instruction!"); + GEN_ERROR("Expected integral type for not instruction!"); $$ = BinaryOperator::create(Instruction::Xor, $2, Ones); if ($$ == 0) - ThrowException("Could not create a xor instruction!"); + GEN_ERROR("Could not create a xor instruction!"); + CHECK_FOR_ERROR } | ShiftOps ResolvedVal ',' ResolvedVal { if ($4->getType() != Type::UByteTy) - ThrowException("Shift amount must be ubyte!"); + GEN_ERROR("Shift amount must be ubyte!"); if (!$2->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); + GEN_ERROR("Shift constant expression requires integer operand!"); $$ = new ShiftInst($1, $2, $4); + CHECK_FOR_ERROR } | CAST ResolvedVal TO Types { if (!$4->get()->isFirstClassType()) - ThrowException("cast instruction to a non-primitive type: '" + + GEN_ERROR("cast instruction to a non-primitive type: '" + $4->get()->getDescription() + "'!"); $$ = new CastInst($2, *$4); delete $4; + CHECK_FOR_ERROR } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { if ($2->getType() != Type::BoolTy) - ThrowException("select condition must be boolean!"); + GEN_ERROR("select condition must be boolean!"); if ($4->getType() != $6->getType()) - ThrowException("select value types should match!"); + GEN_ERROR("select value types should match!"); $$ = new SelectInst($2, $4, $6); + CHECK_FOR_ERROR } | VAARG ResolvedVal ',' Types { NewVarArgs = true; $$ = new VAArgInst($2, *$4); delete $4; + CHECK_FOR_ERROR } | VAARG_old ResolvedVal ',' Types { ObsoleteVarArgs = true; @@ -2226,6 +2366,7 @@ CurBB->getInstList().push_back(new StoreInst(bar, foo)); $$ = new VAArgInst(foo, *$4); delete $4; + CHECK_FOR_ERROR } | VANEXT_old ResolvedVal ',' Types { ObsoleteVarArgs = true; @@ -2248,35 +2389,40 @@ CurBB->getInstList().push_back(tmp); $$ = new LoadInst(foo); delete $4; + CHECK_FOR_ERROR } | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { if (!ExtractElementInst::isValidOperands($2, $4)) - ThrowException("Invalid extractelement operands!"); + GEN_ERROR("Invalid extractelement operands!"); $$ = new ExtractElementInst($2, $4); + CHECK_FOR_ERROR } | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { if (!InsertElementInst::isValidOperands($2, $4, $6)) - ThrowException("Invalid insertelement operands!"); + GEN_ERROR("Invalid insertelement operands!"); $$ = new InsertElementInst($2, $4, $6); + CHECK_FOR_ERROR } | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal { if (!ShuffleVectorInst::isValidOperands($2, $4, $6)) - ThrowException("Invalid shufflevector operands!"); + GEN_ERROR("Invalid shufflevector operands!"); $$ = new ShuffleVectorInst($2, $4, $6); + CHECK_FOR_ERROR } | PHI_TOK PHIList { const Type *Ty = $2->front().first->getType(); if (!Ty->isFirstClassType()) - ThrowException("PHI node operands must be of first class type!"); + GEN_ERROR("PHI node operands must be of first class type!"); $$ = new PHINode(Ty); ((PHINode*)$$)->reserveOperandSpace($2->size()); while ($2->begin() != $2->end()) { if ($2->front().first->getType() != Ty) - ThrowException("All elements of a PHI node must be of the same type!"); + GEN_ERROR("All elements of a PHI node must be of the same type!"); cast($$)->addIncoming($2->front().first, $2->front().second); $2->pop_front(); } delete $2; // Free the list... + CHECK_FOR_ERROR } | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { const PointerType *PFTy; @@ -2296,7 +2442,7 @@ if (isVarArg) ParamTypes.pop_back(); if (!(*$3)->isFirstClassType() && *$3 != Type::VoidTy) - ThrowException("LLVM functions cannot return aggregate types!"); + GEN_ERROR("LLVM functions cannot return aggregate types!"); Ty = FunctionType::get($3->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); @@ -2308,7 +2454,7 @@ if (!$6) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) - ThrowException("No arguments passed to a function that " + GEN_ERROR("No arguments passed to a function that " "expects arguments!"); $$ = new CallInst(V, std::vector()); @@ -2322,11 +2468,11 @@ for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI)->getType() != *I) - ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" + + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - ThrowException("Invalid number of parameters detected!"); + GEN_ERROR("Invalid number of parameters detected!"); $$ = new CallInst(V, *$6); } @@ -2334,24 +2480,30 @@ cast($$)->setCallingConv($2); delete $3; delete $6; + CHECK_FOR_ERROR } | MemoryInst { $$ = $1; + CHECK_FOR_ERROR }; // IndexList - List of indices for GEP based instructions... IndexList : ',' ValueRefList { $$ = $2; + CHECK_FOR_ERROR } | /* empty */ { $$ = new std::vector(); + CHECK_FOR_ERROR }; OptVolatile : VOLATILE { $$ = true; + CHECK_FOR_ERROR } | /* empty */ { $$ = false; + CHECK_FOR_ERROR }; @@ -2359,52 +2511,59 @@ MemoryInst : MALLOC Types OptCAlign { $$ = new MallocInst(*$2, 0, $3); delete $2; + CHECK_FOR_ERROR } | MALLOC Types ',' UINT ValueRef OptCAlign { $$ = new MallocInst(*$2, getVal($4, $5), $6); delete $2; + CHECK_FOR_ERROR } | ALLOCA Types OptCAlign { $$ = new AllocaInst(*$2, 0, $3); delete $2; + CHECK_FOR_ERROR } | ALLOCA Types ',' UINT ValueRef OptCAlign { $$ = new AllocaInst(*$2, getVal($4, $5), $6); delete $2; + CHECK_FOR_ERROR } | FREE ResolvedVal { if (!isa($2->getType())) - ThrowException("Trying to free nonpointer type " + + GEN_ERROR("Trying to free nonpointer type " + $2->getType()->getDescription() + "!"); $$ = new FreeInst($2); + CHECK_FOR_ERROR } | OptVolatile LOAD Types ValueRef { if (!isa($3->get())) - ThrowException("Can't load from nonpointer type: " + + GEN_ERROR("Can't load from nonpointer type: " + (*$3)->getDescription()); if (!cast($3->get())->getElementType()->isFirstClassType()) - ThrowException("Can't load from pointer of non-first-class type: " + + GEN_ERROR("Can't load from pointer of non-first-class type: " + (*$3)->getDescription()); $$ = new LoadInst(getVal(*$3, $4), "", $1); delete $3; + CHECK_FOR_ERROR } | OptVolatile STORE ResolvedVal ',' Types ValueRef { const PointerType *PT = dyn_cast($5->get()); if (!PT) - ThrowException("Can't store to a nonpointer type: " + + GEN_ERROR("Can't store to a nonpointer type: " + (*$5)->getDescription()); const Type *ElTy = PT->getElementType(); if (ElTy != $3->getType()) - ThrowException("Can't store '" + $3->getType()->getDescription() + + GEN_ERROR("Can't store '" + $3->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); $$ = new StoreInst($3, getVal(*$5, $6), $1); delete $5; + CHECK_FOR_ERROR } | GETELEMENTPTR Types ValueRef IndexList { if (!isa($2->get())) - ThrowException("getelementptr insn requires pointer operand!"); + GEN_ERROR("getelementptr insn requires pointer operand!"); // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct // indices to uint struct indices for compatibility. @@ -2418,14 +2577,24 @@ (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); if (!GetElementPtrInst::getIndexedType(*$2, *$4, true)) - ThrowException("Invalid getelementptr indices for type '" + + GEN_ERROR("Invalid getelementptr indices for type '" + (*$2)->getDescription()+ "'!"); $$ = new GetElementPtrInst(getVal(*$2, $3), *$4); delete $2; delete $4; + CHECK_FOR_ERROR }; %% + +void llvm::GenerateError(const std::string &message, int LineNo) { + if (LineNo == -1) LineNo = llvmAsmlineno; + // TODO: column number in exception + if (TheParseError) + TheParseError->setError(CurFilename, message, LineNo); + TriggerError = 1; +} + int yyerror(const char *ErrorMsg) { std::string where = std::string((CurFilename == "-") ? std::string("") : CurFilename) @@ -2435,6 +2604,6 @@ errMsg += "end-of-file."; else errMsg += "token: '" + std::string(llvmAsmtext, llvmAsmleng) + "'"; - ThrowException(errMsg); + GenerateError(errMsg); return 0; } Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.7 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.8 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.7 Wed Jun 21 11:53:00 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Fri Aug 18 03:43:06 2006 @@ -27,6 +27,11 @@ #include #include +static bool TriggerError = false; +#define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYERROR; } } + +#define GEN_ERROR(msg) { GenerateError(msg); YYERROR; } + int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit int yylex(); // declaration" of xxx warnings. int yyparse(); @@ -103,7 +108,7 @@ UndefinedReferences += " " + I->first.first->getDescription() + " " + I->first.second.getName() + "\n"; } - ThrowException(UndefinedReferences); + GenerateError(UndefinedReferences); } // Look for intrinsic functions and CallInst that need to be upgraded @@ -160,7 +165,7 @@ // Any forward referenced blocks left? if (!BBForwardRefs.empty()) - ThrowException("Undefined reference to label " + + GenerateError("Undefined reference to label " + BBForwardRefs.begin()->first->getName()); // Resolve all forward references now. @@ -203,7 +208,7 @@ } break; default: - ThrowException("Internal parser error: Invalid symbol type reference!"); + GenerateError("Internal parser error: Invalid symbol type reference!"); } // If we reached here, we referenced either a symbol that we don't know about @@ -215,9 +220,9 @@ if (inFunctionScope()) { if (D.Type == ValID::NameVal) - ThrowException("Reference to an undefined type: '" + D.getName() + "'"); + GenerateError("Reference to an undefined type: '" + D.getName() + "'"); else - ThrowException("Reference to an undefined type: #" + itostr(D.Num)); + GenerateError("Reference to an undefined type: #" + itostr(D.Num)); } std::map::iterator I =CurModule.LateResolveTypes.find(D); @@ -242,7 +247,7 @@ // static Value *getValNonImprovising(const Type *Ty, const ValID &D) { if (isa(Ty)) - ThrowException("Functions are not values and " + GenerateError("Functions are not values and " "must be referenced as pointers"); switch (D.Type) { @@ -279,7 +284,7 @@ // value will fit into the specified type... case ValID::ConstSIntVal: // Is it a constant pool reference?? if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) - ThrowException("Signed integral constant '" + + GenerateError("Signed integral constant '" + itostr(D.ConstPool64) + "' is invalid for type '" + Ty->getDescription() + "'!"); return ConstantSInt::get(Ty, D.ConstPool64); @@ -287,7 +292,7 @@ case ValID::ConstUIntVal: // Is it an unsigned const pool reference? if (!ConstantUInt::isValueValidForType(Ty, D.UConstPool64)) { if (!ConstantSInt::isValueValidForType(Ty, D.ConstPool64)) { - ThrowException("Integral constant '" + utostr(D.UConstPool64) + + GenerateError("Integral constant '" + utostr(D.UConstPool64) + "' is invalid or out of range!"); } else { // This is really a signed reference. Transmogrify. return ConstantSInt::get(Ty, D.ConstPool64); @@ -298,12 +303,12 @@ case ValID::ConstFPVal: // Is it a floating point const pool reference? if (!ConstantFP::isValueValidForType(Ty, D.ConstPoolFP)) - ThrowException("FP constant invalid for type!!"); + GenerateError("FP constant invalid for type!!"); return ConstantFP::get(Ty, D.ConstPoolFP); case ValID::ConstNullVal: // Is it a null value? if (!isa(Ty)) - ThrowException("Cannot create a a non pointer null!"); + GenerateError("Cannot create a a non pointer null!"); return ConstantPointerNull::get(cast(Ty)); case ValID::ConstUndefVal: // Is it an undef value? @@ -314,7 +319,7 @@ case ValID::ConstantVal: // Fully resolved constant? if (D.ConstantValue->getType() != Ty) - ThrowException("Constant expression type different from required type!"); + GenerateError("Constant expression type different from required type!"); return D.ConstantValue; case ValID::InlineAsmVal: { // Inline asm expression @@ -322,7 +327,7 @@ const FunctionType *FTy = PTy ? dyn_cast(PTy->getElementType()) : 0; if (!FTy || !InlineAsm::Verify(FTy, D.IAD->Constraints)) - ThrowException("Invalid type for asm constraint string!"); + GenerateError("Invalid type for asm constraint string!"); InlineAsm *IA = InlineAsm::get(FTy, D.IAD->AsmString, D.IAD->Constraints, D.IAD->HasSideEffects); D.destroy(); // Free InlineAsmDescriptor. @@ -345,14 +350,14 @@ // static Value *getVal(const Type *Ty, const ValID &ID) { if (Ty == Type::LabelTy) - ThrowException("Cannot use a basic block here"); + GenerateError("Cannot use a basic block here"); // See if the value has already been defined. Value *V = getValNonImprovising(Ty, ID); if (V) return V; if (!Ty->isFirstClassType() && !isa(Ty)) - ThrowException("Invalid use of a composite type!"); + GenerateError("Invalid use of a composite type!"); // If we reached here, we referenced either a symbol that we don't know about // or an id number that hasn't been read yet. We may be referencing something @@ -384,7 +389,7 @@ std::string Name; BasicBlock *BB = 0; switch (ID.Type) { - default: ThrowException("Illegal label reference " + ID.getName()); + default: GenerateError("Illegal label reference " + ID.getName()); case ValID::NumberVal: // Is it a numbered definition? if (unsigned(ID.Num) >= CurFun.NumberedBlocks.size()) CurFun.NumberedBlocks.resize(ID.Num+1); @@ -405,7 +410,7 @@ // an entry for it in the PlaceHolderInfo map. if (isDefinition && !CurFun.BBForwardRefs.erase(BB)) // The existing value was a definition, not a forward reference. - ThrowException("Redefinition of label " + ID.getName()); + GenerateError("Redefinition of label " + ID.getName()); ID.destroy(); // Free strdup'd memory. return BB; @@ -479,11 +484,11 @@ InsertValue(V, *FutureLateResolvers); } else { if (DID.Type == ValID::NameVal) - ThrowException("Reference to an invalid definition: '" +DID.getName()+ + GenerateError("Reference to an invalid definition: '" +DID.getName()+ "' of type '" + V->getType()->getDescription() + "'", PHI->second.second); else - ThrowException("Reference to an invalid definition: #" + + GenerateError("Reference to an invalid definition: #" + itostr(DID.Num) + " of type '" + V->getType()->getDescription() + "'", PHI->second.second); @@ -521,12 +526,12 @@ free(NameStr); // Free old string if (V->getType() == Type::VoidTy) - ThrowException("Can't assign name '" + Name+"' to value with void type!"); + GenerateError("Can't assign name '" + Name+"' to value with void type!"); assert(inFunctionScope() && "Must be in function scope!"); SymbolTable &ST = CurFun.CurrentFunction->getSymbolTable(); if (ST.lookup(V->getType(), Name)) - ThrowException("Redefinition of value named '" + Name + "' in the '" + + GenerateError("Redefinition of value named '" + Name + "' in the '" + V->getType()->getDescription() + "' type plane!"); // Set the name. @@ -541,7 +546,7 @@ bool isConstantGlobal, const Type *Ty, Constant *Initializer) { if (isa(Ty)) - ThrowException("Cannot declare global vars of function type!"); + GenerateError("Cannot declare global vars of function type!"); const PointerType *PTy = PointerType::get(Ty); @@ -598,7 +603,7 @@ return EGV; } - ThrowException("Redefinition of global variable named '" + Name + + GenerateError("Redefinition of global variable named '" + Name + "' in the '" + Ty->getDescription() + "' type plane!"); } } @@ -627,7 +632,7 @@ // We don't allow assigning names to void type if (T == Type::VoidTy) - ThrowException("Can't assign name '" + Name + "' to the void type!"); + GenerateError("Can't assign name '" + Name + "' to the void type!"); // Set the type name, checking for conflicts as we do so. bool AlreadyExists = CurModule.CurrentModule->addTypeName(Name, T); @@ -651,7 +656,7 @@ if (Existing == T) return true; // Yes, it's equal. // Any other kind of (non-equivalent) redefinition is an error. - ThrowException("Redefinition of type named '" + Name + "' in the '" + + GenerateError("Redefinition of type named '" + Name + "' in the '" + T->getDescription() + "' type plane!"); } @@ -757,6 +762,8 @@ CurModule.CurrentModule = M; yyparse(); // Parse the file, potentially throwing exception + if (!ParserResult) + return 0; Module *Result = ParserResult; ParserResult = 0; @@ -773,12 +780,12 @@ } if (ObsoleteVarArgs && NewVarArgs) - ThrowException("This file is corrupt: it uses both new and old style varargs"); + GenerateError("This file is corrupt: it uses both new and old style varargs"); if(ObsoleteVarArgs) { if(Function* F = Result->getNamedFunction("llvm.va_start")) { if (F->arg_size() != 0) - ThrowException("Obsolete va_start takes 0 argument!"); + GenerateError("Obsolete va_start takes 0 argument!"); //foo = va_start() // -> @@ -805,7 +812,7 @@ if(Function* F = Result->getNamedFunction("llvm.va_end")) { if(F->arg_size() != 1) - ThrowException("Obsolete va_end takes 1 argument!"); + GenerateError("Obsolete va_end takes 1 argument!"); //vaend foo // -> @@ -829,7 +836,7 @@ if(Function* F = Result->getNamedFunction("llvm.va_copy")) { if(F->arg_size() != 1) - ThrowException("Obsolete va_copy takes 1 argument!"); + GenerateError("Obsolete va_copy takes 1 argument!"); //foo = vacopy(bar) // -> //a = alloca 1 of typeof(foo) @@ -1010,16 +1017,18 @@ INTVAL : SINTVAL; INTVAL : UINTVAL { if ($1 > (uint32_t)INT32_MAX) // Outside of my range! - ThrowException("Value too large for type!"); + GEN_ERROR("Value too large for type!"); $$ = (int32_t)$1; + CHECK_FOR_ERROR }; EINT64VAL : ESINT64VAL; // These have same type and can't cause problems... EINT64VAL : EUINT64VAL { if ($1 > (uint64_t)INT64_MAX) // Outside of my range! - ThrowException("Value too large for type!"); + GEN_ERROR("Value too large for type!"); $$ = (int64_t)$1; + CHECK_FOR_ERROR }; // Operations that are notably excluded from this list include: @@ -1041,9 +1050,11 @@ // OptAssign - Value producing statements have an optional assignment component OptAssign : Name '=' { $$ = $1; + CHECK_FOR_ERROR } | /*empty*/ { $$ = 0; + CHECK_FOR_ERROR }; OptLinkage : INTERNAL { $$ = GlobalValue::InternalLinkage; } | @@ -1059,8 +1070,9 @@ COLDCC_TOK { $$ = CallingConv::Cold; } | CC_TOK EUINT64VAL { if ((unsigned)$2 != $2) - ThrowException("Calling conv too large!"); + GEN_ERROR("Calling conv too large!"); $$ = $2; + CHECK_FOR_ERROR }; // OptAlign/OptCAlign - An optional alignment, and an optional alignment with @@ -1069,21 +1081,24 @@ ALIGN EUINT64VAL { $$ = $2; if ($$ != 0 && !isPowerOf2_32($$)) - ThrowException("Alignment must be a power of two!"); + GEN_ERROR("Alignment must be a power of two!"); + CHECK_FOR_ERROR }; OptCAlign : /*empty*/ { $$ = 0; } | ',' ALIGN EUINT64VAL { $$ = $3; if ($$ != 0 && !isPowerOf2_32($$)) - ThrowException("Alignment must be a power of two!"); + GEN_ERROR("Alignment must be a power of two!"); + CHECK_FOR_ERROR }; SectionString : SECTION STRINGCONSTANT { for (unsigned i = 0, e = strlen($2); i != e; ++i) if ($2[i] == '"' || $2[i] == '\\') - ThrowException("Invalid character in section name!"); + GEN_ERROR("Invalid character in section name!"); $$ = $2; + CHECK_FOR_ERROR }; OptSection : /*empty*/ { $$ = 0; } | @@ -1097,11 +1112,13 @@ GlobalVarAttribute : SectionString { CurGV->setSection($1); free($1); + CHECK_FOR_ERROR } | ALIGN EUINT64VAL { if ($2 != 0 && !isPowerOf2_32($2)) - ThrowException("Alignment must be a power of two!"); + GEN_ERROR("Alignment must be a power of two!"); CurGV->setAlignment($2); + CHECK_FOR_ERROR }; //===----------------------------------------------------------------------===// @@ -1116,8 +1133,9 @@ Types : UpRTypes { if (!UpRefs.empty()) - ThrowException("Invalid upreference in type: " + (*$1)->getDescription()); + GEN_ERROR("Invalid upreference in type: " + (*$1)->getDescription()); $$ = $1; + CHECK_FOR_ERROR }; @@ -1127,22 +1145,26 @@ PrimType : LONG | ULONG | FLOAT | DOUBLE | TYPE | LABEL; UpRTypes : OPAQUE { $$ = new PATypeHolder(OpaqueType::get()); + CHECK_FOR_ERROR } | PrimType { $$ = new PATypeHolder($1); + CHECK_FOR_ERROR }; UpRTypes : SymbolicValueRef { // Named types are also simple types... $$ = new PATypeHolder(getTypeVal($1)); + CHECK_FOR_ERROR }; // Include derived types in the Types production. // UpRTypes : '\\' EUINT64VAL { // Type UpReference - if ($2 > (uint64_t)~0U) ThrowException("Value out of range!"); + if ($2 > (uint64_t)~0U) GEN_ERROR("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder UpRefs.push_back(UpRefRecord((unsigned)$2, OT)); // Add to vector... $$ = new PATypeHolder(OT); UR_OUT("New Upreference!\n"); + CHECK_FOR_ERROR } | UpRTypesV '(' ArgTypeListI ')' { // Function derived type? std::vector Params; @@ -1155,21 +1177,24 @@ $$ = new PATypeHolder(HandleUpRefs(FunctionType::get(*$1,Params,isVarArg))); delete $3; // Delete the argument list delete $1; // Delete the return type handle + CHECK_FOR_ERROR } | '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type? $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2))); delete $4; + CHECK_FOR_ERROR } | '<' EUINT64VAL 'x' UpRTypes '>' { // Packed array type? const llvm::Type* ElemTy = $4->get(); if ((unsigned)$2 != $2) - ThrowException("Unsigned result not equal to signed result"); + GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isPrimitiveType()) - ThrowException("Elemental type of a PackedType must be primitive"); + GEN_ERROR("Elemental type of a PackedType must be primitive"); if (!isPowerOf2_32($2)) - ThrowException("Vector length should be a power of 2!"); + GEN_ERROR("Vector length should be a power of 2!"); $$ = new PATypeHolder(HandleUpRefs(PackedType::get(*$4, (unsigned)$2))); delete $4; + CHECK_FOR_ERROR } | '{' TypeListI '}' { // Structure type? std::vector Elements; @@ -1179,13 +1204,16 @@ $$ = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); delete $2; + CHECK_FOR_ERROR } | '{' '}' { // Empty structure type? $$ = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR } | UpRTypes '*' { // Pointer type? $$ = new PATypeHolder(HandleUpRefs(PointerType::get(*$1))); delete $1; + CHECK_FOR_ERROR }; // TypeList - Used for struct declarations and as a basis for function type @@ -1194,21 +1222,26 @@ TypeListI : UpRTypes { $$ = new std::list(); $$->push_back(*$1); delete $1; + CHECK_FOR_ERROR } | TypeListI ',' UpRTypes { ($$=$1)->push_back(*$3); delete $3; + CHECK_FOR_ERROR }; // ArgTypeList - List of types for a function type declaration... ArgTypeListI : TypeListI | TypeListI ',' DOTDOTDOT { ($$=$1)->push_back(Type::VoidTy); + CHECK_FOR_ERROR } | DOTDOTDOT { ($$ = new std::list())->push_back(Type::VoidTy); + CHECK_FOR_ERROR } | /*empty*/ { $$ = new std::list(); + CHECK_FOR_ERROR }; // ConstVal - The various declarations that go into the constant pool. This @@ -1220,52 +1253,54 @@ ConstVal: Types '[' ConstVector ']' { // Nonempty unsized arr const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + + GEN_ERROR("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); const Type *ETy = ATy->getElementType(); int NumElements = ATy->getNumElements(); // Verify that we have the correct size... if (NumElements != -1 && NumElements != (int)$3->size()) - ThrowException("Type mismatch: constant sized array initialized with " + + GEN_ERROR("Type mismatch: constant sized array initialized with " + utostr($3->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! for (unsigned i = 0; i < $3->size(); i++) { if (ETy != (*$3)[i]->getType()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ (*$3)[i]->getType()->getDescription() + "'."); } $$ = ConstantArray::get(ATy, *$3); delete $1; delete $3; + CHECK_FOR_ERROR } | Types '[' ']' { const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + + GEN_ERROR("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); if (NumElements != -1 && NumElements != 0) - ThrowException("Type mismatch: constant sized array initialized with 0" + GEN_ERROR("Type mismatch: constant sized array initialized with 0" " arguments, but has size of " + itostr(NumElements) +"!"); $$ = ConstantArray::get(ATy, std::vector()); delete $1; + CHECK_FOR_ERROR } | Types 'c' STRINGCONSTANT { const ArrayType *ATy = dyn_cast($1->get()); if (ATy == 0) - ThrowException("Cannot make array constant with type: '" + + GEN_ERROR("Cannot make array constant with type: '" + (*$1)->getDescription() + "'!"); int NumElements = ATy->getNumElements(); const Type *ETy = ATy->getElementType(); char *EndStr = UnEscapeLexed($3, true); if (NumElements != -1 && NumElements != (EndStr-$3)) - ThrowException("Can't build string constant of size " + + GEN_ERROR("Can't build string constant of size " + itostr((int)(EndStr-$3)) + " when array has size " + itostr(NumElements) + "!"); std::vector Vals; @@ -1278,86 +1313,92 @@ Vals.push_back(ConstantUInt::get(ETy, *C)); } else { free($3); - ThrowException("Cannot build string arrays of non byte sized elements!"); + GEN_ERROR("Cannot build string arrays of non byte sized elements!"); } free($3); $$ = ConstantArray::get(ATy, Vals); delete $1; + CHECK_FOR_ERROR } | Types '<' ConstVector '>' { // Nonempty unsized arr const PackedType *PTy = dyn_cast($1->get()); if (PTy == 0) - ThrowException("Cannot make packed constant with type: '" + + GEN_ERROR("Cannot make packed constant with type: '" + (*$1)->getDescription() + "'!"); const Type *ETy = PTy->getElementType(); int NumElements = PTy->getNumElements(); // Verify that we have the correct size... if (NumElements != -1 && NumElements != (int)$3->size()) - ThrowException("Type mismatch: constant sized packed initialized with " + + GEN_ERROR("Type mismatch: constant sized packed initialized with " + utostr($3->size()) + " arguments, but has size of " + itostr(NumElements) + "!"); // Verify all elements are correct type! for (unsigned i = 0; i < $3->size(); i++) { if (ETy != (*$3)[i]->getType()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '"+ (*$3)[i]->getType()->getDescription() + "'."); } $$ = ConstantPacked::get(PTy, *$3); delete $1; delete $3; + CHECK_FOR_ERROR } | Types '{' ConstVector '}' { const StructType *STy = dyn_cast($1->get()); if (STy == 0) - ThrowException("Cannot make struct constant with type: '" + + GEN_ERROR("Cannot make struct constant with type: '" + (*$1)->getDescription() + "'!"); if ($3->size() != STy->getNumContainedTypes()) - ThrowException("Illegal number of initializers for structure type!"); + 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 = $3->size(); i != e; ++i) if ((*$3)[i]->getType() != STy->getElementType(i)) - ThrowException("Expected type '" + + GEN_ERROR("Expected type '" + STy->getElementType(i)->getDescription() + "' for element #" + utostr(i) + " of structure initializer!"); $$ = ConstantStruct::get(STy, *$3); delete $1; delete $3; + CHECK_FOR_ERROR } | Types '{' '}' { const StructType *STy = dyn_cast($1->get()); if (STy == 0) - ThrowException("Cannot make struct constant with type: '" + + GEN_ERROR("Cannot make struct constant with type: '" + (*$1)->getDescription() + "'!"); if (STy->getNumContainedTypes() != 0) - ThrowException("Illegal number of initializers for structure type!"); + GEN_ERROR("Illegal number of initializers for structure type!"); $$ = ConstantStruct::get(STy, std::vector()); delete $1; + CHECK_FOR_ERROR } | Types NULL_TOK { const PointerType *PTy = dyn_cast($1->get()); if (PTy == 0) - ThrowException("Cannot make null pointer constant with type: '" + + GEN_ERROR("Cannot make null pointer constant with type: '" + (*$1)->getDescription() + "'!"); $$ = ConstantPointerNull::get(PTy); delete $1; + CHECK_FOR_ERROR } | Types UNDEF { $$ = UndefValue::get($1->get()); delete $1; + CHECK_FOR_ERROR } | Types SymbolicValueRef { const PointerType *Ty = dyn_cast($1->get()); if (Ty == 0) - ThrowException("Global const reference must be a pointer type!"); + GEN_ERROR("Global const reference must be a pointer type!"); // ConstExprs can exist in the body of a function, thus creating // GlobalValues whenever they refer to a variable. Because we are in @@ -1412,57 +1453,66 @@ $$ = cast(V); delete $1; // Free the type handle + CHECK_FOR_ERROR } | Types ConstExpr { if ($1->get() != $2->getType()) - ThrowException("Mismatched types for constant expression!"); + GEN_ERROR("Mismatched types for constant expression!"); $$ = $2; delete $1; + CHECK_FOR_ERROR } | Types ZEROINITIALIZER { const Type *Ty = $1->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) - ThrowException("Cannot create a null initialized value of this type!"); + GEN_ERROR("Cannot create a null initialized value of this type!"); $$ = Constant::getNullValue(Ty); delete $1; + CHECK_FOR_ERROR }; ConstVal : SIntType EINT64VAL { // integral constants if (!ConstantSInt::isValueValidForType($1, $2)) - ThrowException("Constant value doesn't fit in type!"); + GEN_ERROR("Constant value doesn't fit in type!"); $$ = ConstantSInt::get($1, $2); + CHECK_FOR_ERROR } | UIntType EUINT64VAL { // integral constants if (!ConstantUInt::isValueValidForType($1, $2)) - ThrowException("Constant value doesn't fit in type!"); + GEN_ERROR("Constant value doesn't fit in type!"); $$ = ConstantUInt::get($1, $2); + CHECK_FOR_ERROR } | BOOL TRUETOK { // Boolean constants $$ = ConstantBool::True; + CHECK_FOR_ERROR } | BOOL FALSETOK { // Boolean constants $$ = ConstantBool::False; + CHECK_FOR_ERROR } | FPType FPVAL { // Float & Double constants if (!ConstantFP::isValueValidForType($1, $2)) - ThrowException("Floating point constant invalid for type!!"); + GEN_ERROR("Floating point constant invalid for type!!"); $$ = ConstantFP::get($1, $2); + CHECK_FOR_ERROR }; ConstExpr: CAST '(' ConstVal TO Types ')' { if (!$3->getType()->isFirstClassType()) - ThrowException("cast constant expression from a non-primitive type: '" + + GEN_ERROR("cast constant expression from a non-primitive type: '" + $3->getType()->getDescription() + "'!"); if (!$5->get()->isFirstClassType()) - ThrowException("cast constant expression to a non-primitive type: '" + + GEN_ERROR("cast constant expression to a non-primitive type: '" + $5->get()->getDescription() + "'!"); $$ = ConstantExpr::getCast($3, $5->get()); delete $5; + CHECK_FOR_ERROR } | GETELEMENTPTR '(' ConstVal IndexList ')' { if (!isa($3->getType())) - ThrowException("GetElementPtr requires a pointer operand!"); + GEN_ERROR("GetElementPtr requires a pointer operand!"); // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct // indices to uint struct indices for compatibility. @@ -1478,29 +1528,31 @@ const Type *IdxTy = GetElementPtrInst::getIndexedType($3->getType(), *$4, true); if (!IdxTy) - ThrowException("Index list invalid for constant getelementptr!"); + GEN_ERROR("Index list invalid for constant getelementptr!"); std::vector IdxVec; for (unsigned i = 0, e = $4->size(); i != e; ++i) if (Constant *C = dyn_cast((*$4)[i])) IdxVec.push_back(C); else - ThrowException("Indices to constant getelementptr must be constants!"); + GEN_ERROR("Indices to constant getelementptr must be constants!"); delete $4; $$ = ConstantExpr::getGetElementPtr($3, IdxVec); + CHECK_FOR_ERROR } | SELECT '(' ConstVal ',' ConstVal ',' ConstVal ')' { if ($3->getType() != Type::BoolTy) - ThrowException("Select condition must be of boolean type!"); + GEN_ERROR("Select condition must be of boolean type!"); if ($5->getType() != $7->getType()) - ThrowException("Select operand types must match!"); + GEN_ERROR("Select operand types must match!"); $$ = ConstantExpr::getSelect($3, $5, $7); + CHECK_FOR_ERROR } | ArithmeticOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) - ThrowException("Binary operator types must match!"); + GEN_ERROR("Binary operator types must match!"); // HACK: llvm 1.3 and earlier used to emit invalid pointer constant exprs. // To retain backward compatibility with these early compilers, we emit a // cast to the appropriate integer type automatically if we are in the @@ -1512,59 +1564,68 @@ switch (CurModule.CurrentModule->getPointerSize()) { case Module::Pointer32: IntPtrTy = Type::IntTy; break; case Module::Pointer64: IntPtrTy = Type::LongTy; break; - default: ThrowException("invalid pointer binary constant expr!"); + default: GEN_ERROR("invalid pointer binary constant expr!"); } $$ = ConstantExpr::get($1, ConstantExpr::getCast($3, IntPtrTy), ConstantExpr::getCast($5, IntPtrTy)); $$ = ConstantExpr::getCast($$, $3->getType()); } + CHECK_FOR_ERROR } | LogicalOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) - ThrowException("Logical operator types must match!"); + GEN_ERROR("Logical operator types must match!"); if (!$3->getType()->isIntegral()) { if (!isa($3->getType()) || !cast($3->getType())->getElementType()->isIntegral()) - ThrowException("Logical operator requires integral operands!"); + GEN_ERROR("Logical operator requires integral operands!"); } $$ = ConstantExpr::get($1, $3, $5); + CHECK_FOR_ERROR } | SetCondOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) - ThrowException("setcc operand types must match!"); + GEN_ERROR("setcc operand types must match!"); $$ = ConstantExpr::get($1, $3, $5); + CHECK_FOR_ERROR } | ShiftOps '(' ConstVal ',' ConstVal ')' { if ($5->getType() != Type::UByteTy) - ThrowException("Shift count for shift constant must be unsigned byte!"); + GEN_ERROR("Shift count for shift constant must be unsigned byte!"); if (!$3->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); + GEN_ERROR("Shift constant expression requires integer operand!"); $$ = ConstantExpr::get($1, $3, $5); + CHECK_FOR_ERROR } | EXTRACTELEMENT '(' ConstVal ',' ConstVal ')' { if (!ExtractElementInst::isValidOperands($3, $5)) - ThrowException("Invalid extractelement operands!"); + GEN_ERROR("Invalid extractelement operands!"); $$ = ConstantExpr::getExtractElement($3, $5); + CHECK_FOR_ERROR } | INSERTELEMENT '(' ConstVal ',' ConstVal ',' ConstVal ')' { if (!InsertElementInst::isValidOperands($3, $5, $7)) - ThrowException("Invalid insertelement operands!"); + GEN_ERROR("Invalid insertelement operands!"); $$ = ConstantExpr::getInsertElement($3, $5, $7); + CHECK_FOR_ERROR } | SHUFFLEVECTOR '(' ConstVal ',' ConstVal ',' ConstVal ')' { if (!ShuffleVectorInst::isValidOperands($3, $5, $7)) - ThrowException("Invalid shufflevector operands!"); + GEN_ERROR("Invalid shufflevector operands!"); $$ = ConstantExpr::getShuffleVector($3, $5, $7); + CHECK_FOR_ERROR }; // ConstVector - A list of comma separated constants. ConstVector : ConstVector ',' ConstVal { ($$ = $1)->push_back($3); + CHECK_FOR_ERROR } | ConstVal { $$ = new std::vector(); $$->push_back($1); + CHECK_FOR_ERROR }; @@ -1582,6 +1643,7 @@ Module : FunctionList { $$ = ParserResult = $1; CurModule.ModuleDone(); + CHECK_FOR_ERROR }; // FunctionList - A list of functions, preceeded by a constant pool. @@ -1589,26 +1651,32 @@ FunctionList : FunctionList Function { $$ = $1; CurFun.FunctionDone(); + CHECK_FOR_ERROR } | FunctionList FunctionProto { $$ = $1; + CHECK_FOR_ERROR } | FunctionList MODULE ASM_TOK AsmBlock { $$ = $1; + CHECK_FOR_ERROR } | FunctionList IMPLEMENTATION { $$ = $1; + CHECK_FOR_ERROR } | ConstPool { $$ = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. if (!CurModule.LateResolveTypes.empty()) { const ValID &DID = CurModule.LateResolveTypes.begin()->first; - if (DID.Type == ValID::NameVal) - ThrowException("Reference to an undefined type: '"+DID.getName() + "'"); - else - ThrowException("Reference to an undefined type: #" + itostr(DID.Num)); + if (DID.Type == ValID::NameVal) { + GEN_ERROR("Reference to an undefined type: '"+DID.getName() + "'"); + } else { + GEN_ERROR("Reference to an undefined type: #" + itostr(DID.Num)); + } } + CHECK_FOR_ERROR }; // ConstPool - Constants with optional names assigned to them. @@ -1631,16 +1699,20 @@ } delete $4; + CHECK_FOR_ERROR } | ConstPool FunctionProto { // Function prototypes can be in const pool + CHECK_FOR_ERROR } | ConstPool MODULE ASM_TOK AsmBlock { // Asm blocks can be in the const pool + CHECK_FOR_ERROR } | ConstPool OptAssign OptLinkage GlobalType ConstVal { - if ($5 == 0) ThrowException("Global value initializer is not a constant!"); + if ($5 == 0) GEN_ERROR("Global value initializer is not a constant!"); CurGV = ParseGlobalVariable($2, $3, $4, $5->getType(), $5); } GlobalVarAttributes { CurGV = 0; + CHECK_FOR_ERROR } | ConstPool OptAssign EXTERNAL GlobalType Types { CurGV = ParseGlobalVariable($2, GlobalValue::ExternalLinkage, @@ -1648,10 +1720,13 @@ delete $5; } GlobalVarAttributes { CurGV = 0; + CHECK_FOR_ERROR } | ConstPool TARGET TargetDefinition { + CHECK_FOR_ERROR } | ConstPool DEPLIBS '=' LibrariesDefinition { + CHECK_FOR_ERROR } | /* empty: end of list */ { }; @@ -1667,6 +1742,7 @@ CurModule.CurrentModule->setModuleInlineAsm(NewAsm); else CurModule.CurrentModule->setModuleInlineAsm(AsmSoFar+"\n"+NewAsm); + CHECK_FOR_ERROR }; BigOrLittle : BIG { $$ = Module::BigEndian; }; @@ -1674,6 +1750,7 @@ TargetDefinition : ENDIAN '=' BigOrLittle { CurModule.CurrentModule->setEndianness($3); + CHECK_FOR_ERROR } | POINTERSIZE '=' EUINT64VAL { if ($3 == 32) @@ -1681,11 +1758,13 @@ else if ($3 == 64) CurModule.CurrentModule->setPointerSize(Module::Pointer64); else - ThrowException("Invalid pointer size: '" + utostr($3) + "'!"); + GEN_ERROR("Invalid pointer size: '" + utostr($3) + "'!"); + CHECK_FOR_ERROR } | TRIPLE '=' STRINGCONSTANT { CurModule.CurrentModule->setTargetTriple($3); free($3); + CHECK_FOR_ERROR }; LibrariesDefinition : '[' LibList ']'; @@ -1693,12 +1772,15 @@ LibList : LibList ',' STRINGCONSTANT { CurModule.CurrentModule->addLibrary($3); free($3); + CHECK_FOR_ERROR } | STRINGCONSTANT { CurModule.CurrentModule->addLibrary($1); free($1); + CHECK_FOR_ERROR } | /* empty: end of list */ { + CHECK_FOR_ERROR } ; @@ -1711,35 +1793,42 @@ ArgVal : Types OptName { if (*$1 == Type::VoidTy) - ThrowException("void typed arguments are invalid!"); + GEN_ERROR("void typed arguments are invalid!"); $$ = new std::pair($1, $2); + CHECK_FOR_ERROR }; ArgListH : ArgListH ',' ArgVal { $$ = $1; $1->push_back(*$3); delete $3; + CHECK_FOR_ERROR } | ArgVal { $$ = new std::vector >(); $$->push_back(*$1); delete $1; + CHECK_FOR_ERROR }; ArgList : ArgListH { $$ = $1; + CHECK_FOR_ERROR } | ArgListH ',' DOTDOTDOT { $$ = $1; $$->push_back(std::pair(new PATypeHolder(Type::VoidTy), 0)); + CHECK_FOR_ERROR } | DOTDOTDOT { $$ = new std::vector >(); $$->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); + CHECK_FOR_ERROR } | /* empty */ { $$ = 0; + CHECK_FOR_ERROR }; FunctionHeaderH : OptCallingConv TypesV Name '(' ArgList ')' @@ -1749,7 +1838,7 @@ free($3); // Free strdup'd memory! if (!(*$2)->isFirstClassType() && *$2 != Type::VoidTy) - ThrowException("LLVM functions cannot return aggregate types!"); + GEN_ERROR("LLVM functions cannot return aggregate types!"); std::vector ParamTypeList; if ($5) { // If there are arguments... @@ -1785,7 +1874,7 @@ // If this is the case, either we need to be a forward decl, or it needs // to be. if (!CurFun.isDeclare && !Fn->isExternal()) - ThrowException("Redefinition of function '" + FunctionName + "'!"); + GEN_ERROR("Redefinition of function '" + FunctionName + "'!"); // Make sure to strip off any argument names so we can't get conflicts. if (Fn->isExternal()) @@ -1826,6 +1915,7 @@ delete $5; // We're now done with the argument list } + CHECK_FOR_ERROR }; BEGIN : BEGINTOK | '{'; // Allow BEGIN or '{' to start a function @@ -1842,11 +1932,13 @@ Function : BasicBlockList END { $$ = $1; + CHECK_FOR_ERROR }; FunctionProto : DECLARE { CurFun.isDeclare = true; } FunctionHeaderH { $$ = CurFun.CurrentFunction; CurFun.FunctionDone(); + CHECK_FOR_ERROR }; //===----------------------------------------------------------------------===// @@ -1855,34 +1947,44 @@ OptSideEffect : /* empty */ { $$ = false; + CHECK_FOR_ERROR } | SIDEEFFECT { $$ = true; + CHECK_FOR_ERROR }; ConstValueRef : ESINT64VAL { // A reference to a direct constant $$ = ValID::create($1); + CHECK_FOR_ERROR } | EUINT64VAL { $$ = ValID::create($1); + CHECK_FOR_ERROR } | FPVAL { // Perhaps it's an FP constant? $$ = ValID::create($1); + CHECK_FOR_ERROR } | TRUETOK { $$ = ValID::create(ConstantBool::True); + CHECK_FOR_ERROR } | FALSETOK { $$ = ValID::create(ConstantBool::False); + CHECK_FOR_ERROR } | NULL_TOK { $$ = ValID::createNull(); + CHECK_FOR_ERROR } | UNDEF { $$ = ValID::createUndef(); + CHECK_FOR_ERROR } | ZEROINITIALIZER { // A vector zero constant. $$ = ValID::createZeroInit(); + CHECK_FOR_ERROR } | '<' ConstVector '>' { // Nonempty unsized packed vector const Type *ETy = (*$2)[0]->getType(); @@ -1900,16 +2002,18 @@ // Verify all elements are correct type! for (unsigned i = 0; i < $2->size(); i++) { if (ETy != (*$2)[i]->getType()) - ThrowException("Element #" + utostr(i) + " is not of type '" + + GEN_ERROR("Element #" + utostr(i) + " is not of type '" + ETy->getDescription() +"' as required!\nIt is of type '" + (*$2)[i]->getType()->getDescription() + "'."); } $$ = ValID::create(ConstantPacked::get(pt, *$2)); delete PTy; delete $2; + CHECK_FOR_ERROR } | ConstExpr { $$ = ValID::create($1); + CHECK_FOR_ERROR } | ASM_TOK OptSideEffect STRINGCONSTANT ',' STRINGCONSTANT { char *End = UnEscapeLexed($3, true); @@ -1919,6 +2023,7 @@ $$ = ValID::createInlineAsm(AsmStr, Constraints, $2); free($3); free($5); + CHECK_FOR_ERROR }; // SymbolicValueRef - Reference to one of two ways of symbolically refering to @@ -1926,9 +2031,11 @@ // SymbolicValueRef : INTVAL { // Is it an integer reference...? $$ = ValID::create($1); + CHECK_FOR_ERROR } | Name { // Is it a named reference...? $$ = ValID::create($1); + CHECK_FOR_ERROR }; // ValueRef - A reference to a definition... either constant or symbolic @@ -1940,13 +2047,16 @@ // pool references (for things like: 'ret [2 x int] [ int 12, int 42]') ResolvedVal : Types ValueRef { $$ = getVal(*$1, $2); delete $1; + CHECK_FOR_ERROR }; BasicBlockList : BasicBlockList BasicBlock { $$ = $1; + CHECK_FOR_ERROR } | FunctionHeader BasicBlock { // Do not allow functions with 0 basic blocks $$ = $1; + CHECK_FOR_ERROR }; @@ -1960,11 +2070,13 @@ $1->getInstList().push_back($3); InsertValue($1); $$ = $1; + CHECK_FOR_ERROR }; InstructionList : InstructionList Inst { $1->getInstList().push_back($2); $$ = $1; + CHECK_FOR_ERROR } | /* empty */ { $$ = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); @@ -1975,6 +2087,7 @@ Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); BBL.splice(BBL.end(), BBL, $$); + CHECK_FOR_ERROR } | LABELSTR { $$ = CurBB = getBBVal(ValID::create($1), true); @@ -1985,19 +2098,24 @@ Function::BasicBlockListType &BBL = CurFun.CurrentFunction->getBasicBlockList(); BBL.splice(BBL.end(), BBL, $$); + CHECK_FOR_ERROR }; BBTerminatorInst : RET ResolvedVal { // Return with a result... $$ = new ReturnInst($2); + CHECK_FOR_ERROR } | RET VOID { // Return with no result... $$ = new ReturnInst(); + CHECK_FOR_ERROR } | BR LABEL ValueRef { // Unconditional Branch... $$ = new BranchInst(getBBVal($3)); + CHECK_FOR_ERROR } // Conditional Branch... | BR BOOL ValueRef ',' LABEL ValueRef ',' LABEL ValueRef { $$ = new BranchInst(getBBVal($6), getBBVal($9), getVal(Type::BoolTy, $3)); + CHECK_FOR_ERROR } | SWITCH IntType ValueRef ',' LABEL ValueRef '[' JumpTable ']' { SwitchInst *S = new SwitchInst(getVal($2, $3), getBBVal($6), $8->size()); @@ -2009,13 +2127,15 @@ if (ConstantInt *CI = dyn_cast(I->first)) S->addCase(CI, I->second); else - ThrowException("Switch case is constant, but not a simple integer!"); + GEN_ERROR("Switch case is constant, but not a simple integer!"); } delete $8; + CHECK_FOR_ERROR } | SWITCH IntType ValueRef ',' LABEL ValueRef '[' ']' { SwitchInst *S = new SwitchInst(getVal($2, $3), getBBVal($6), 0); $$ = S; + CHECK_FOR_ERROR } | INVOKE OptCallingConv TypesV ValueRef '(' ValueRefListE ')' TO LABEL ValueRef UNWIND LABEL ValueRef { @@ -2057,11 +2177,11 @@ for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI)->getType() != *I) - ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" + + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - ThrowException("Invalid number of parameters detected!"); + GEN_ERROR("Invalid number of parameters detected!"); $$ = new InvokeInst(V, Normal, Except, *$6); } @@ -2069,12 +2189,15 @@ delete $3; delete $6; + CHECK_FOR_ERROR } | UNWIND { $$ = new UnwindInst(); + CHECK_FOR_ERROR } | UNREACHABLE { $$ = new UnreachableInst(); + CHECK_FOR_ERROR }; @@ -2083,18 +2206,20 @@ $$ = $1; Constant *V = cast(getValNonImprovising($2, $3)); if (V == 0) - ThrowException("May only switch on a constant pool value!"); + GEN_ERROR("May only switch on a constant pool value!"); $$->push_back(std::make_pair(V, getBBVal($6))); + CHECK_FOR_ERROR } | IntType ConstValueRef ',' LABEL ValueRef { $$ = new std::vector >(); Constant *V = cast(getValNonImprovising($1, $2)); if (V == 0) - ThrowException("May only switch on a constant pool value!"); + GEN_ERROR("May only switch on a constant pool value!"); $$->push_back(std::make_pair(V, getBBVal($5))); + CHECK_FOR_ERROR }; Inst : OptAssign InstVal { @@ -2102,27 +2227,32 @@ setValueName($2, $1); InsertValue($2); $$ = $2; + CHECK_FOR_ERROR }; PHIList : Types '[' ValueRef ',' ValueRef ']' { // Used for PHI nodes $$ = new std::list >(); $$->push_back(std::make_pair(getVal(*$1, $3), getBBVal($5))); delete $1; + CHECK_FOR_ERROR } | PHIList ',' '[' ValueRef ',' ValueRef ']' { $$ = $1; $1->push_back(std::make_pair(getVal($1->front().first->getType(), $4), getBBVal($6))); + CHECK_FOR_ERROR }; ValueRefList : ResolvedVal { // Used for call statements, and memory insts... $$ = new std::vector(); $$->push_back($1); + CHECK_FOR_ERROR } | ValueRefList ',' ResolvedVal { $$ = $1; $1->push_back($3); + CHECK_FOR_ERROR }; // ValueRefListE - Just like ValueRefList, except that it may also be empty! @@ -2130,9 +2260,11 @@ OptTailCall : TAIL CALL { $$ = true; + CHECK_FOR_ERROR } | CALL { $$ = false; + CHECK_FOR_ERROR }; @@ -2140,35 +2272,38 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() && !isa((*$2).get())) - ThrowException( + GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); if (isa((*$2).get()) && $1 == Instruction::Rem) - ThrowException("Rem not supported on packed types!"); + GEN_ERROR("Rem not supported on packed types!"); $$ = BinaryOperator::create($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) - ThrowException("binary operator returned null!"); + GEN_ERROR("binary operator returned null!"); delete $2; + CHECK_FOR_ERROR } | LogicalOps Types ValueRef ',' ValueRef { if (!(*$2)->isIntegral()) { if (!isa($2->get()) || !cast($2->get())->getElementType()->isIntegral()) - ThrowException("Logical operator requires integral operands!"); + GEN_ERROR("Logical operator requires integral operands!"); } $$ = BinaryOperator::create($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) - ThrowException("binary operator returned null!"); + GEN_ERROR("binary operator returned null!"); delete $2; + CHECK_FOR_ERROR } | SetCondOps Types ValueRef ',' ValueRef { if(isa((*$2).get())) { - ThrowException( + GEN_ERROR( "PackedTypes currently not supported in setcc instructions!"); } $$ = new SetCondInst($1, getVal(*$2, $3), getVal(*$2, $5)); if ($$ == 0) - ThrowException("binary operator returned null!"); + GEN_ERROR("binary operator returned null!"); delete $2; + CHECK_FOR_ERROR } | NOT ResolvedVal { std::cerr << "WARNING: Use of eliminated 'not' instruction:" @@ -2176,37 +2311,42 @@ Value *Ones = ConstantIntegral::getAllOnesValue($2->getType()); if (Ones == 0) - ThrowException("Expected integral type for not instruction!"); + GEN_ERROR("Expected integral type for not instruction!"); $$ = BinaryOperator::create(Instruction::Xor, $2, Ones); if ($$ == 0) - ThrowException("Could not create a xor instruction!"); + GEN_ERROR("Could not create a xor instruction!"); + CHECK_FOR_ERROR } | ShiftOps ResolvedVal ',' ResolvedVal { if ($4->getType() != Type::UByteTy) - ThrowException("Shift amount must be ubyte!"); + GEN_ERROR("Shift amount must be ubyte!"); if (!$2->getType()->isInteger()) - ThrowException("Shift constant expression requires integer operand!"); + GEN_ERROR("Shift constant expression requires integer operand!"); $$ = new ShiftInst($1, $2, $4); + CHECK_FOR_ERROR } | CAST ResolvedVal TO Types { if (!$4->get()->isFirstClassType()) - ThrowException("cast instruction to a non-primitive type: '" + + GEN_ERROR("cast instruction to a non-primitive type: '" + $4->get()->getDescription() + "'!"); $$ = new CastInst($2, *$4); delete $4; + CHECK_FOR_ERROR } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { if ($2->getType() != Type::BoolTy) - ThrowException("select condition must be boolean!"); + GEN_ERROR("select condition must be boolean!"); if ($4->getType() != $6->getType()) - ThrowException("select value types should match!"); + GEN_ERROR("select value types should match!"); $$ = new SelectInst($2, $4, $6); + CHECK_FOR_ERROR } | VAARG ResolvedVal ',' Types { NewVarArgs = true; $$ = new VAArgInst($2, *$4); delete $4; + CHECK_FOR_ERROR } | VAARG_old ResolvedVal ',' Types { ObsoleteVarArgs = true; @@ -2226,6 +2366,7 @@ CurBB->getInstList().push_back(new StoreInst(bar, foo)); $$ = new VAArgInst(foo, *$4); delete $4; + CHECK_FOR_ERROR } | VANEXT_old ResolvedVal ',' Types { ObsoleteVarArgs = true; @@ -2248,35 +2389,40 @@ CurBB->getInstList().push_back(tmp); $$ = new LoadInst(foo); delete $4; + CHECK_FOR_ERROR } | EXTRACTELEMENT ResolvedVal ',' ResolvedVal { if (!ExtractElementInst::isValidOperands($2, $4)) - ThrowException("Invalid extractelement operands!"); + GEN_ERROR("Invalid extractelement operands!"); $$ = new ExtractElementInst($2, $4); + CHECK_FOR_ERROR } | INSERTELEMENT ResolvedVal ',' ResolvedVal ',' ResolvedVal { if (!InsertElementInst::isValidOperands($2, $4, $6)) - ThrowException("Invalid insertelement operands!"); + GEN_ERROR("Invalid insertelement operands!"); $$ = new InsertElementInst($2, $4, $6); + CHECK_FOR_ERROR } | SHUFFLEVECTOR ResolvedVal ',' ResolvedVal ',' ResolvedVal { if (!ShuffleVectorInst::isValidOperands($2, $4, $6)) - ThrowException("Invalid shufflevector operands!"); + GEN_ERROR("Invalid shufflevector operands!"); $$ = new ShuffleVectorInst($2, $4, $6); + CHECK_FOR_ERROR } | PHI_TOK PHIList { const Type *Ty = $2->front().first->getType(); if (!Ty->isFirstClassType()) - ThrowException("PHI node operands must be of first class type!"); + GEN_ERROR("PHI node operands must be of first class type!"); $$ = new PHINode(Ty); ((PHINode*)$$)->reserveOperandSpace($2->size()); while ($2->begin() != $2->end()) { if ($2->front().first->getType() != Ty) - ThrowException("All elements of a PHI node must be of the same type!"); + GEN_ERROR("All elements of a PHI node must be of the same type!"); cast($$)->addIncoming($2->front().first, $2->front().second); $2->pop_front(); } delete $2; // Free the list... + CHECK_FOR_ERROR } | OptTailCall OptCallingConv TypesV ValueRef '(' ValueRefListE ')' { const PointerType *PFTy; @@ -2296,7 +2442,7 @@ if (isVarArg) ParamTypes.pop_back(); if (!(*$3)->isFirstClassType() && *$3 != Type::VoidTy) - ThrowException("LLVM functions cannot return aggregate types!"); + GEN_ERROR("LLVM functions cannot return aggregate types!"); Ty = FunctionType::get($3->get(), ParamTypes, isVarArg); PFTy = PointerType::get(Ty); @@ -2308,7 +2454,7 @@ if (!$6) { // Has no arguments? // Make sure no arguments is a good thing! if (Ty->getNumParams() != 0) - ThrowException("No arguments passed to a function that " + GEN_ERROR("No arguments passed to a function that " "expects arguments!"); $$ = new CallInst(V, std::vector()); @@ -2322,11 +2468,11 @@ for (; ArgI != ArgE && I != E; ++ArgI, ++I) if ((*ArgI)->getType() != *I) - ThrowException("Parameter " +(*ArgI)->getName()+ " is not of type '" + + GEN_ERROR("Parameter " +(*ArgI)->getName()+ " is not of type '" + (*I)->getDescription() + "'!"); if (I != E || (ArgI != ArgE && !Ty->isVarArg())) - ThrowException("Invalid number of parameters detected!"); + GEN_ERROR("Invalid number of parameters detected!"); $$ = new CallInst(V, *$6); } @@ -2334,24 +2480,30 @@ cast($$)->setCallingConv($2); delete $3; delete $6; + CHECK_FOR_ERROR } | MemoryInst { $$ = $1; + CHECK_FOR_ERROR }; // IndexList - List of indices for GEP based instructions... IndexList : ',' ValueRefList { $$ = $2; + CHECK_FOR_ERROR } | /* empty */ { $$ = new std::vector(); + CHECK_FOR_ERROR }; OptVolatile : VOLATILE { $$ = true; + CHECK_FOR_ERROR } | /* empty */ { $$ = false; + CHECK_FOR_ERROR }; @@ -2359,52 +2511,59 @@ MemoryInst : MALLOC Types OptCAlign { $$ = new MallocInst(*$2, 0, $3); delete $2; + CHECK_FOR_ERROR } | MALLOC Types ',' UINT ValueRef OptCAlign { $$ = new MallocInst(*$2, getVal($4, $5), $6); delete $2; + CHECK_FOR_ERROR } | ALLOCA Types OptCAlign { $$ = new AllocaInst(*$2, 0, $3); delete $2; + CHECK_FOR_ERROR } | ALLOCA Types ',' UINT ValueRef OptCAlign { $$ = new AllocaInst(*$2, getVal($4, $5), $6); delete $2; + CHECK_FOR_ERROR } | FREE ResolvedVal { if (!isa($2->getType())) - ThrowException("Trying to free nonpointer type " + + GEN_ERROR("Trying to free nonpointer type " + $2->getType()->getDescription() + "!"); $$ = new FreeInst($2); + CHECK_FOR_ERROR } | OptVolatile LOAD Types ValueRef { if (!isa($3->get())) - ThrowException("Can't load from nonpointer type: " + + GEN_ERROR("Can't load from nonpointer type: " + (*$3)->getDescription()); if (!cast($3->get())->getElementType()->isFirstClassType()) - ThrowException("Can't load from pointer of non-first-class type: " + + GEN_ERROR("Can't load from pointer of non-first-class type: " + (*$3)->getDescription()); $$ = new LoadInst(getVal(*$3, $4), "", $1); delete $3; + CHECK_FOR_ERROR } | OptVolatile STORE ResolvedVal ',' Types ValueRef { const PointerType *PT = dyn_cast($5->get()); if (!PT) - ThrowException("Can't store to a nonpointer type: " + + GEN_ERROR("Can't store to a nonpointer type: " + (*$5)->getDescription()); const Type *ElTy = PT->getElementType(); if (ElTy != $3->getType()) - ThrowException("Can't store '" + $3->getType()->getDescription() + + GEN_ERROR("Can't store '" + $3->getType()->getDescription() + "' into space of type '" + ElTy->getDescription() + "'!"); $$ = new StoreInst($3, getVal(*$5, $6), $1); delete $5; + CHECK_FOR_ERROR } | GETELEMENTPTR Types ValueRef IndexList { if (!isa($2->get())) - ThrowException("getelementptr insn requires pointer operand!"); + GEN_ERROR("getelementptr insn requires pointer operand!"); // LLVM 1.2 and earlier used ubyte struct indices. Convert any ubyte struct // indices to uint struct indices for compatibility. @@ -2418,14 +2577,24 @@ (*$4)[i] = ConstantExpr::getCast(CUI, Type::UIntTy); if (!GetElementPtrInst::getIndexedType(*$2, *$4, true)) - ThrowException("Invalid getelementptr indices for type '" + + GEN_ERROR("Invalid getelementptr indices for type '" + (*$2)->getDescription()+ "'!"); $$ = new GetElementPtrInst(getVal(*$2, $3), *$4); delete $2; delete $4; + CHECK_FOR_ERROR }; %% + +void llvm::GenerateError(const std::string &message, int LineNo) { + if (LineNo == -1) LineNo = llvmAsmlineno; + // TODO: column number in exception + if (TheParseError) + TheParseError->setError(CurFilename, message, LineNo); + TriggerError = 1; +} + int yyerror(const char *ErrorMsg) { std::string where = std::string((CurFilename == "-") ? std::string("") : CurFilename) @@ -2435,6 +2604,6 @@ errMsg += "end-of-file."; else errMsg += "token: '" + std::string(llvmAsmtext, llvmAsmleng) + "'"; - ThrowException(errMsg); + GenerateError(errMsg); return 0; } From reid at x10sys.com Fri Aug 18 04:00:36 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 04:00:36 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/tools/stkrc/st Message-ID: <200608180900.k7I90a42024118@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/tools/stkrc: st updated: 1.2 -> 1.3 --- Log message: Drop the -s2048 option, it is specified incorrectly and the correct specification can't be handled by llvmc (= confuses it) --- Diffs of the changes: (+2 -2) st | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/projects/Stacker/tools/stkrc/st diff -u llvm/projects/Stacker/tools/stkrc/st:1.2 llvm/projects/Stacker/tools/stkrc/st:1.3 --- llvm/projects/Stacker/tools/stkrc/st:1.2 Wed May 18 20:05:02 2005 +++ llvm/projects/Stacker/tools/stkrc/st Fri Aug 18 04:00:22 2006 @@ -25,7 +25,7 @@ # To compile stacker source, we just run the stacker # compiler with a default stack size of 2048 entries. - translator.command=%bindir%/stkrc -s2048 %in% -f -o %out% %opt% \ + translator.command=%bindir%/stkrc %in% -f -o %out% %opt% \ %time% %stats% %args% # stkrc doesn't preprocess but we set this to true so @@ -43,7 +43,7 @@ ########################################################## # For optimization, we use the LLVM "opt" program - optimizer.command=%bindir%/stkrc -s2048 %in% -f -o %out% %opt% \ + optimizer.command=%bindir%/stkrc %in% -f -o %out% %opt% \ %time% %stats% %args% optimizer.required = yes From reid at x10sys.com Fri Aug 18 04:01:23 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 04:01:23 -0500 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Message-ID: <200608180901.k7I91N6F006699@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: IndVarSimplify.cpp updated: 1.88 -> 1.89 --- Log message: Fix a grammaro in a comment. --- Diffs of the changes: (+1 -1) IndVarSimplify.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.88 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.89 --- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.88 Fri Jul 14 13:49:15 2006 +++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp Fri Aug 18 04:01:07 2006 @@ -11,7 +11,7 @@ // computations derived from them) into simpler forms suitable for subsequent // analysis and transformation. // -// This transformation make the following changes to each loop with an +// This transformation makes the following changes to each loop with an // identifiable induction variable: // 1. All loops are transformed to have a SINGLE canonical induction variable // which starts at zero and steps by one. From reid at x10sys.com Fri Aug 18 04:30:21 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 04:30:21 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Makefile Message-ID: <200608180930.k7I9ULls024100@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Makefile updated: 1.12 -> 1.13 --- Log message: For PR797: http://llvm.org/PR797 : 1. Actually turn on -fno-exceptions in libraries that do not have the REQUIRES_EH option in their Makefile. The following library file size savings were made (DEBUG): libLLVMDataStructure.a 525K libLLVMCore.a 380K libLLVMCodeGen.a 350K libLLVMTransformUtils.a 305K libLLVMScalarOpts.a 270K libLLVMAnalysis.a 247K libLLVMSelectionDAG.a 233K libLLVMipo.a 175K LLVMX86.o 123K LLVMPPC.o 81K libLLVMipa.a 17K TOTAL 2,706K Note that the savings is actually a little larger than this because I didn't count any of the libraries that had small changes. 2. Remove REQUIRES_EH from the AsmParser library as it is now exception free. This resulted in a nearly 78K drop in the size of the debug library for AsmParser. --- Diffs of the changes: (+0 -1) Makefile | 1 - 1 files changed, 1 deletion(-) Index: llvm/lib/AsmParser/Makefile diff -u llvm/lib/AsmParser/Makefile:1.12 llvm/lib/AsmParser/Makefile:1.13 --- llvm/lib/AsmParser/Makefile:1.12 Fri Jul 7 11:44:31 2006 +++ llvm/lib/AsmParser/Makefile Fri Aug 18 04:30:03 2006 @@ -10,7 +10,6 @@ LEVEL = ../.. LIBRARYNAME := LLVMAsmParser BUILD_ARCHIVE = 1 -REQUIRES_EH := 1 EXTRA_DIST := Lexer.cpp.cvs Lexer.l.cvs \ llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs From reid at x10sys.com Fri Aug 18 04:30:20 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 04:30:20 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200608180930.k7I9UKrE024097@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.393 -> 1.394 --- Log message: For PR797: http://llvm.org/PR797 : 1. Actually turn on -fno-exceptions in libraries that do not have the REQUIRES_EH option in their Makefile. The following library file size savings were made (DEBUG): libLLVMDataStructure.a 525K libLLVMCore.a 380K libLLVMCodeGen.a 350K libLLVMTransformUtils.a 305K libLLVMScalarOpts.a 270K libLLVMAnalysis.a 247K libLLVMSelectionDAG.a 233K libLLVMipo.a 175K LLVMX86.o 123K LLVMPPC.o 81K libLLVMipa.a 17K TOTAL 2,706K Note that the savings is actually a little larger than this because I didn't count any of the libraries that had small changes. 2. Remove REQUIRES_EH from the AsmParser library as it is now exception free. This resulted in a nearly 78K drop in the size of the debug library for AsmParser. --- Diffs of the changes: (+5 -0) Makefile.rules | 5 +++++ 1 files changed, 5 insertions(+) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.393 llvm/Makefile.rules:1.394 --- llvm/Makefile.rules:1.393 Mon Aug 7 18:12:15 2006 +++ llvm/Makefile.rules Fri Aug 18 04:30:03 2006 @@ -249,6 +249,11 @@ C.Flags += -D_DEBUG endif +# IF REQUIRES_EH=1 is specified then don't disable exceptions +ifndef REQUIRES_EH + CXX.Flags += -fno-exceptions +endif + CXX.Flags += $(CXXFLAGS) C.Flags += $(CFLAGS) CPP.BaseFlags += $(CPPFLAGS) From reid at x10sys.com Fri Aug 18 04:08:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 04:08:11 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/tools/stkrc/stkrc.cpp Message-ID: <200608180908.k7I98B4V010184@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/tools/stkrc: stkrc.cpp updated: 1.10 -> 1.11 --- Log message: For PR797: http://llvm.org/PR797 : Update to reflect ParseException becoming ParseError (from Parser.h) --- Diffs of the changes: (+1 -1) stkrc.cpp | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/projects/Stacker/tools/stkrc/stkrc.cpp diff -u llvm/projects/Stacker/tools/stkrc/stkrc.cpp:1.10 llvm/projects/Stacker/tools/stkrc/stkrc.cpp:1.11 --- llvm/projects/Stacker/tools/stkrc/stkrc.cpp:1.10 Sat Apr 23 16:26:10 2005 +++ llvm/projects/Stacker/tools/stkrc/stkrc.cpp Fri Aug 18 04:07:54 2006 @@ -164,7 +164,7 @@ } WriteBytecodeToFile(M.get(), *Out); - } catch (const ParseException &E) { + } catch (const ParseError &E) { std::cerr << argv[0] << ": " << E.getMessage() << "\n"; return 1; } From reid at x10sys.com Fri Aug 18 04:08:11 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 04:08:11 -0500 Subject: [llvm-commits] CVS: llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp StackerCompiler.h Message-ID: <200608180908.k7I98Bab010181@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/lib/compiler: StackerCompiler.cpp updated: 1.17 -> 1.18 StackerCompiler.h updated: 1.7 -> 1.8 --- Log message: For PR797: http://llvm.org/PR797 : Update to reflect ParseException becoming ParseError (from Parser.h) --- Diffs of the changes: (+6 -3) StackerCompiler.cpp | 5 +++-- StackerCompiler.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp diff -u llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.17 llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.18 --- llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp:1.17 Fri Jun 16 13:23:49 2006 +++ llvm/projects/Stacker/lib/compiler/StackerCompiler.cpp Fri Aug 18 04:07:54 2006 @@ -110,8 +110,9 @@ if (F == 0) { - throw ParseException(filename, - "Could not open file '" + filename + "'"); + ParseError Err; + Err.setError(filename, "Could not open file '" + filename + "'"); + throw Err; } } Index: llvm/projects/Stacker/lib/compiler/StackerCompiler.h diff -u llvm/projects/Stacker/lib/compiler/StackerCompiler.h:1.7 llvm/projects/Stacker/lib/compiler/StackerCompiler.h:1.8 --- llvm/projects/Stacker/lib/compiler/StackerCompiler.h:1.7 Sat Apr 23 16:26:10 2005 +++ llvm/projects/Stacker/lib/compiler/StackerCompiler.h Fri Aug 18 04:07:54 2006 @@ -158,7 +158,9 @@ { if (line == -1) line = Stackerlineno; // TODO: column number in exception - throw ParseException(TheInstance->CurFilename, message, line); + ParseError Err; + Err.setError(TheInstance->CurFilename, message, line); + throw Err; } private: /// @brief Generate code to increment the stack index From clattner at apple.com Fri Aug 18 11:35:16 2006 From: clattner at apple.com (Chris Lattner) Date: Fri, 18 Aug 2006 09:35:16 -0700 Subject: [llvm-commits] CVS: llvm/Makefile.rules In-Reply-To: <200608180930.k7I9UKrE024097@zion.cs.uiuc.edu> References: <200608180930.k7I9UKrE024097@zion.cs.uiuc.edu> Message-ID: <980FFFC6-9E9A-432A-A9C0-8240FC5B2F7C@apple.com> On Aug 18, 2006, at 2:30 AM, Reid Spencer wrote: > For PR797: http://llvm.org/PR797 : > 1. Actually turn on -fno-exceptions in libraries that do not have the > REQUIRES_EH option in their Makefile. The following library file > size > savings were made (DEBUG): Very cool, but... is this safe? If libsystem throws an exception, then everything between it and the tool that finally catches the exception have to be compiled with EH support on... -Chris From reid at x10sys.com Fri Aug 18 11:55:45 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 09:55:45 -0700 Subject: [llvm-commits] CVS: llvm/Makefile.rules In-Reply-To: <980FFFC6-9E9A-432A-A9C0-8240FC5B2F7C@apple.com> References: <200608180930.k7I9UKrE024097@zion.cs.uiuc.edu> <980FFFC6-9E9A-432A-A9C0-8240FC5B2F7C@apple.com> Message-ID: <1155920145.10524.332.camel@bashful.x10sys.com> Hmm .. didn't think of that, but it passed all the tests. All the tools still have top level exception handlers so its not like we'd generate an unexpected_exception error. Some memory cleanup could be missed, but the process is going to exit anyway. Temporary files that need to be cleaned up are generally done in the tool's code, so that should be okay. What else could go wrong? Reid. On Fri, 2006-08-18 at 09:35 -0700, Chris Lattner wrote: > On Aug 18, 2006, at 2:30 AM, Reid Spencer wrote: > > > For PR797: http://llvm.org/PR797 : > > 1. Actually turn on -fno-exceptions in libraries that do not have the > > REQUIRES_EH option in their Makefile. The following library file > > size > > savings were made (DEBUG): > > Very cool, but... is this safe? If libsystem throws an exception, > then everything between it and the tool that finally catches the > exception have to be compiled with EH support on... > > -Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20060818/60bd5efc/attachment.bin From clattner at apple.com Fri Aug 18 12:04:56 2006 From: clattner at apple.com (Chris Lattner) Date: Fri, 18 Aug 2006 10:04:56 -0700 Subject: [llvm-commits] CVS: llvm/Makefile.rules In-Reply-To: <1155920145.10524.332.camel@bashful.x10sys.com> References: <200608180930.k7I9UKrE024097@zion.cs.uiuc.edu> <980FFFC6-9E9A-432A-A9C0-8240FC5B2F7C@apple.com> <1155920145.10524.332.camel@bashful.x10sys.com> Message-ID: On Aug 18, 2006, at 9:55 AM, Reid Spencer wrote: > Hmm .. didn't think of that, but it passed all the tests. All the > tools > still have top level exception handlers so its not like we'd > generate an > unexpected_exception error. Some memory cleanup could be missed, > but the > process is going to exit anyway. Temporary files that need to be > cleaned > up are generally done in the tool's code, so that should be okay. What > else could go wrong? Consider: "main" has a catch block, which prints an error message and exits. main calls foo. "foo" is compiled without exception info, foo calls some llvm::sys function 'X' that can throw. "X" throws an exception on some error. We'd expect the exception to end up in main, an error printed, then the process exited. However, because "foo" has no unwind info, the unwinder will abort the process when it gets to the X frame. I think the simplest thing to do is to eliminate throws from leaf code like libsystem etc. Tools like bugpoint can continue to use EH for as long as we think is reasonable, but the libraries that are called into by other code should be EH free. -Chris From reid at x10sys.com Fri Aug 18 12:15:02 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 10:15:02 -0700 Subject: [llvm-commits] CVS: llvm/Makefile.rules In-Reply-To: References: <200608180930.k7I9UKrE024097@zion.cs.uiuc.edu> <980FFFC6-9E9A-432A-A9C0-8240FC5B2F7C@apple.com> <1155920145.10524.332.camel@bashful.x10sys.com> Message-ID: <1155921302.10524.340.camel@bashful.x10sys.com> On Fri, 2006-08-18 at 10:04 -0700, Chris Lattner wrote: > On Aug 18, 2006, at 9:55 AM, Reid Spencer wrote: > > Hmm .. didn't think of that, but it passed all the tests. All the > > tools > > still have top level exception handlers so its not like we'd > > generate an > > unexpected_exception error. Some memory cleanup could be missed, > > but the > > process is going to exit anyway. Temporary files that need to be > > cleaned > > up are generally done in the tool's code, so that should be okay. What > > else could go wrong? > > Consider: > > "main" has a catch block, which prints an error message and exits. > main calls foo. > > "foo" is compiled without exception info, foo calls some llvm::sys > function 'X' that can throw. > > "X" throws an exception on some error. > > We'd expect the exception to end up in main, an error printed, then > the process exited. However, because "foo" has no unwind info, the > unwinder will abort the process when it gets to the X frame. I was under the impression that those stack frames would just get bypassed. However, I wrote a little test program to simulate the situation and got: terminate called after throwing an instance of 'std::string' Aborted So, I'll back out the change until we get LLVM completely EH free in low-level libraries. > > I think the simplest thing to do is to eliminate throws from leaf > code like libsystem etc. Tools like bugpoint can continue to use EH > for as long as we think is reasonable, but the libraries that are > called into by other code should be EH free. Yes, that's the entire point of PR797. I was just trying to be incremental about it. Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20060818/689dbabf/attachment.bin From reid at x10sys.com Fri Aug 18 12:22:22 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 12:22:22 -0500 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200608181722.k7IHMM1V007649@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.394 -> 1.395 --- Log message: To avoid errors where a non-exception .o is on the stack between a throw and a handler, which would produce errors like: terminate called after throwing an instance of 'std::string' we must comment out setting -fno-exceptions until PR797: http://llvm.org/PR797 is completely fixed. Once libraries like lib/System and lib/Support are exception free, we can turn it back on. --- Diffs of the changes: (+5 -5) Makefile.rules | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.394 llvm/Makefile.rules:1.395 --- llvm/Makefile.rules:1.394 Fri Aug 18 04:30:03 2006 +++ llvm/Makefile.rules Fri Aug 18 12:22:07 2006 @@ -206,6 +206,11 @@ OPTIMIZE_OPTION := -O2 endif +# IF REQUIRES_EH=1 is specified then don't disable exceptions +#ifndef REQUIRES_EH +# CXX.Flags += -fno-exceptions +#endif + ifdef ENABLE_PROFILING BuildMode := Profile CXX.Flags := $(OPTIMIZE_OPTION) -pg -g @@ -249,11 +254,6 @@ C.Flags += -D_DEBUG endif -# IF REQUIRES_EH=1 is specified then don't disable exceptions -ifndef REQUIRES_EH - CXX.Flags += -fno-exceptions -endif - CXX.Flags += $(CXXFLAGS) C.Flags += $(CFLAGS) CPP.BaseFlags += $(CPPFLAGS) From clattner at apple.com Fri Aug 18 12:22:55 2006 From: clattner at apple.com (Chris Lattner) Date: Fri, 18 Aug 2006 10:22:55 -0700 Subject: [llvm-commits] CVS: llvm/Makefile.rules In-Reply-To: <1155921302.10524.340.camel@bashful.x10sys.com> References: <200608180930.k7I9UKrE024097@zion.cs.uiuc.edu> <980FFFC6-9E9A-432A-A9C0-8240FC5B2F7C@apple.com> <1155920145.10524.332.camel@bashful.x10sys.com> <1155921302.10524.340.camel@bashful.x10sys.com> Message-ID: <0F63BE76-1C1A-4DE8-B847-24A8C3654208@apple.com> >> We'd expect the exception to end up in main, an error printed, then >> the process exited. However, because "foo" has no unwind info, the >> unwinder will abort the process when it gets to the X frame. > > I was under the impression that those stack frames would just get > bypassed. However, I wrote a little test program to simulate the > situation and got: > > terminate called after throwing an instance of 'std::string' > Aborted Yep, the problem is that unwind info is needed to restore callee saved registers, etc. This is why the -fexceptions switch is needed with C code if you want to unwind across C frames. > So, I'll back out the change until we get LLVM completely EH free in > low-level libraries. Ok, thanks. >> I think the simplest thing to do is to eliminate throws from leaf >> code like libsystem etc. Tools like bugpoint can continue to use EH >> for as long as we think is reasonable, but the libraries that are >> called into by other code should be EH free. > > Yes, that's the entire point of PR797. I was just trying to be > incremental about it. Ok, thanks! -Chris From reid at x10sys.com Fri Aug 18 12:33:09 2006 From: reid at x10sys.com (Reid Spencer) Date: Fri, 18 Aug 2006 12:33:09 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y llvmAsmParser.y.cvs Message-ID: <200608181733.k7IHX9Ed008098@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.cpp.cvs updated: 1.8 -> 1.9 llvmAsmParser.h.cvs updated: 1.4 -> 1.5 llvmAsmParser.y updated: 1.256 -> 1.257 llvmAsmParser.y.cvs updated: 1.8 -> 1.9 --- Log message: Add a comment about the mechanisms used to rid AsmParser of exceptions. --- Diffs of the changes: (+244 -214) llvmAsmParser.cpp.cvs | 432 +++++++++++++++++++++++++------------------------- llvmAsmParser.h.cvs | 2 llvmAsmParser.y | 12 + llvmAsmParser.y.cvs | 12 + 4 files changed, 244 insertions(+), 214 deletions(-) Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.8 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.9 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.8 Fri Aug 18 03:43:06 2006 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Fri Aug 18 12:32:55 2006 @@ -289,9 +289,19 @@ #include #include +// The following is a gross hack. In order to rid the libAsmParser library of +// exceptions, we have to have a way of getting the yyparse function to go into +// an error situation. So, whenever we want an error to occur, the GenerateError +// function (see bottom of file) sets TriggerError. Then, at the end of each +// production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR +// (a goto) to put YACC in error state. Furthermore, several calls to +// GenerateError are made from inside productions and they must simulate the +// previous exception behavior by exiting the production immediately. We have +// replaced these with the GEN_ERROR macro which calls GeneratError and then +// immediately invokes YYERROR. This would be so much cleaner if it was a +// recursive descent parser. static bool TriggerError = false; #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYERROR; } } - #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; } int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit @@ -1175,7 +1185,7 @@ #endif #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 897 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 907 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; @@ -1216,7 +1226,7 @@ llvm::Module::Endianness Endianness; } YYSTYPE; /* Line 196 of yacc.c. */ -#line 1220 "llvmAsmParser.tab.c" +#line 1230 "llvmAsmParser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -1228,7 +1238,7 @@ /* Line 219 of yacc.c. */ -#line 1232 "llvmAsmParser.tab.c" +#line 1242 "llvmAsmParser.tab.c" #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -1556,30 +1566,30 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short int yyrline[] = { - 0, 1017, 1017, 1018, 1026, 1027, 1037, 1037, 1037, 1037, - 1037, 1038, 1038, 1038, 1039, 1039, 1039, 1039, 1039, 1039, - 1041, 1041, 1045, 1045, 1045, 1045, 1046, 1046, 1046, 1046, - 1047, 1047, 1048, 1048, 1051, 1055, 1060, 1061, 1062, 1063, - 1064, 1066, 1067, 1068, 1069, 1070, 1071, 1080, 1081, 1087, - 1088, 1096, 1104, 1105, 1110, 1111, 1112, 1117, 1131, 1131, - 1132, 1132, 1134, 1144, 1144, 1144, 1144, 1144, 1144, 1144, - 1145, 1145, 1145, 1145, 1145, 1145, 1146, 1150, 1154, 1161, - 1169, 1182, 1187, 1199, 1209, 1213, 1222, 1227, 1233, 1234, - 1238, 1242, 1253, 1279, 1293, 1323, 1349, 1370, 1383, 1393, - 1398, 1458, 1465, 1474, 1480, 1486, 1490, 1494, 1502, 1513, - 1545, 1553, 1575, 1586, 1592, 1600, 1606, 1612, 1621, 1625, - 1633, 1633, 1643, 1651, 1656, 1660, 1664, 1668, 1683, 1704, - 1707, 1710, 1710, 1717, 1717, 1725, 1728, 1731, 1735, 1748, - 1749, 1751, 1755, 1764, 1770, 1772, 1777, 1782, 1791, 1791, - 1792, 1792, 1794, 1801, 1807, 1814, 1818, 1824, 1829, 1834, - 1921, 1921, 1923, 1931, 1931, 1933, 1938, 1938, 1948, 1952, - 1957, 1961, 1965, 1969, 1973, 1977, 1981, 1985, 1989, 2014, - 2018, 2032, 2036, 2042, 2042, 2048, 2053, 2057, 2066, 2076, - 2081, 2092, 2104, 2108, 2112, 2116, 2120, 2135, 2140, 2194, - 2198, 2205, 2214, 2225, 2233, 2239, 2247, 2252, 2259, 2259, - 2261, 2265, 2272, 2285, 2297, 2308, 2321, 2329, 2337, 2345, - 2351, 2371, 2394, 2400, 2406, 2412, 2427, 2485, 2492, 2495, - 2500, 2504, 2511, 2516, 2521, 2526, 2531, 2539, 2550, 2564 + 0, 1027, 1027, 1028, 1036, 1037, 1047, 1047, 1047, 1047, + 1047, 1048, 1048, 1048, 1049, 1049, 1049, 1049, 1049, 1049, + 1051, 1051, 1055, 1055, 1055, 1055, 1056, 1056, 1056, 1056, + 1057, 1057, 1058, 1058, 1061, 1065, 1070, 1071, 1072, 1073, + 1074, 1076, 1077, 1078, 1079, 1080, 1081, 1090, 1091, 1097, + 1098, 1106, 1114, 1115, 1120, 1121, 1122, 1127, 1141, 1141, + 1142, 1142, 1144, 1154, 1154, 1154, 1154, 1154, 1154, 1154, + 1155, 1155, 1155, 1155, 1155, 1155, 1156, 1160, 1164, 1171, + 1179, 1192, 1197, 1209, 1219, 1223, 1232, 1237, 1243, 1244, + 1248, 1252, 1263, 1289, 1303, 1333, 1359, 1380, 1393, 1403, + 1408, 1468, 1475, 1484, 1490, 1496, 1500, 1504, 1512, 1523, + 1555, 1563, 1585, 1596, 1602, 1610, 1616, 1622, 1631, 1635, + 1643, 1643, 1653, 1661, 1666, 1670, 1674, 1678, 1693, 1714, + 1717, 1720, 1720, 1727, 1727, 1735, 1738, 1741, 1745, 1758, + 1759, 1761, 1765, 1774, 1780, 1782, 1787, 1792, 1801, 1801, + 1802, 1802, 1804, 1811, 1817, 1824, 1828, 1834, 1839, 1844, + 1931, 1931, 1933, 1941, 1941, 1943, 1948, 1948, 1958, 1962, + 1967, 1971, 1975, 1979, 1983, 1987, 1991, 1995, 1999, 2024, + 2028, 2042, 2046, 2052, 2052, 2058, 2063, 2067, 2076, 2086, + 2091, 2102, 2114, 2118, 2122, 2126, 2130, 2145, 2150, 2204, + 2208, 2215, 2224, 2235, 2243, 2249, 2257, 2262, 2269, 2269, + 2271, 2275, 2282, 2295, 2307, 2318, 2331, 2339, 2347, 2355, + 2361, 2381, 2404, 2410, 2416, 2422, 2437, 2495, 2502, 2505, + 2510, 2514, 2521, 2526, 2531, 2536, 2541, 2549, 2560, 2574 }; #endif @@ -2833,7 +2843,7 @@ switch (yyn) { case 3: -#line 1018 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1028 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); @@ -2843,7 +2853,7 @@ break; case 5: -#line 1027 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1037 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); @@ -2853,7 +2863,7 @@ break; case 34: -#line 1051 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1061 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[-1].StrVal); CHECK_FOR_ERROR @@ -2861,7 +2871,7 @@ break; case 35: -#line 1055 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1065 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; CHECK_FOR_ERROR @@ -2869,57 +2879,57 @@ break; case 36: -#line 1060 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1070 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} break; case 37: -#line 1061 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1071 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} break; case 38: -#line 1062 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1072 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} break; case 39: -#line 1063 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1073 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} break; case 40: -#line 1064 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1074 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} break; case 41: -#line 1066 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1076 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 42: -#line 1067 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1077 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::C; ;} break; case 43: -#line 1068 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1078 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::CSRet; ;} break; case 44: -#line 1069 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1079 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Fast; ;} break; case 45: -#line 1070 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1080 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = CallingConv::Cold; ;} break; case 46: -#line 1071 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1081 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) GEN_ERROR("Calling conv too large!"); @@ -2929,12 +2939,12 @@ break; case 47: -#line 1080 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1090 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 48: -#line 1081 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1091 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -2944,12 +2954,12 @@ break; case 49: -#line 1087 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1097 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = 0; ;} break; case 50: -#line 1088 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1098 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.UIntVal) = (yyvsp[0].UInt64Val); if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) @@ -2959,7 +2969,7 @@ break; case 51: -#line 1096 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1106 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') @@ -2970,27 +2980,27 @@ break; case 52: -#line 1104 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1114 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 53: -#line 1105 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1115 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = (yyvsp[0].StrVal); ;} break; case 54: -#line 1110 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1120 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 55: -#line 1111 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1121 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" {;} break; case 56: -#line 1112 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1122 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV->setSection((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -2999,7 +3009,7 @@ break; case 57: -#line 1117 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1127 "/proj/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!"); @@ -3009,17 +3019,17 @@ break; case 59: -#line 1131 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1141 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} break; case 61: -#line 1132 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1142 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} break; case 62: -#line 1134 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1144 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); @@ -3029,7 +3039,7 @@ break; case 76: -#line 1146 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1156 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR @@ -3037,7 +3047,7 @@ break; case 77: -#line 1150 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1160 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); CHECK_FOR_ERROR @@ -3045,7 +3055,7 @@ break; case 78: -#line 1154 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1164 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Named types are also simple types... (yyval.TypeVal) = new PATypeHolder(getTypeVal((yyvsp[0].ValIDVal))); CHECK_FOR_ERROR @@ -3053,7 +3063,7 @@ break; case 79: -#line 1161 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1171 "/proj/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 @@ -3065,7 +3075,7 @@ break; case 80: -#line 1169 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1179 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Function derived type? std::vector Params; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -3082,7 +3092,7 @@ break; case 81: -#line 1182 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1192 "/proj/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); @@ -3091,7 +3101,7 @@ break; case 82: -#line 1187 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1197 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Packed array type? const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) @@ -3107,7 +3117,7 @@ break; case 83: -#line 1199 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1209 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Structure type? std::vector Elements; for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), @@ -3121,7 +3131,7 @@ break; case 84: -#line 1209 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1219 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Empty structure type? (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); CHECK_FOR_ERROR @@ -3129,7 +3139,7 @@ break; case 85: -#line 1213 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1223 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Pointer type? (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); delete (yyvsp[-1].TypeVal); @@ -3138,7 +3148,7 @@ break; case 86: -#line 1222 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1232 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); @@ -3147,7 +3157,7 @@ break; case 87: -#line 1227 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1237 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); CHECK_FOR_ERROR @@ -3155,7 +3165,7 @@ break; case 89: -#line 1234 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1244 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(Type::VoidTy); CHECK_FOR_ERROR @@ -3163,7 +3173,7 @@ break; case 90: -#line 1238 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1248 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.TypeList) = new std::list())->push_back(Type::VoidTy); CHECK_FOR_ERROR @@ -3171,7 +3181,7 @@ break; case 91: -#line 1242 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1252 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TypeList) = new std::list(); CHECK_FOR_ERROR @@ -3179,7 +3189,7 @@ break; case 92: -#line 1253 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1263 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (ATy == 0) @@ -3209,7 +3219,7 @@ break; case 93: -#line 1279 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1289 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) @@ -3227,7 +3237,7 @@ break; case 94: -#line 1293 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1303 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const ArrayType *ATy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (ATy == 0) @@ -3261,7 +3271,7 @@ break; case 95: -#line 1323 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1333 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized arr const PackedType *PTy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (PTy == 0) @@ -3291,7 +3301,7 @@ break; case 96: -#line 1349 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1359 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[-3].TypeVal)->get()); if (STy == 0) @@ -3316,7 +3326,7 @@ break; case 97: -#line 1370 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1380 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const StructType *STy = dyn_cast((yyvsp[-2].TypeVal)->get()); if (STy == 0) @@ -3333,7 +3343,7 @@ break; case 98: -#line 1383 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1393 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const PointerType *PTy = dyn_cast((yyvsp[-1].TypeVal)->get()); if (PTy == 0) @@ -3347,7 +3357,7 @@ break; case 99: -#line 1393 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1403 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVal) = UndefValue::get((yyvsp[-1].TypeVal)->get()); delete (yyvsp[-1].TypeVal); @@ -3356,7 +3366,7 @@ break; case 100: -#line 1398 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1408 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const PointerType *Ty = dyn_cast((yyvsp[-1].TypeVal)->get()); if (Ty == 0) @@ -3420,7 +3430,7 @@ break; case 101: -#line 1458 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1468 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-1].TypeVal)->get() != (yyvsp[0].ConstVal)->getType()) GEN_ERROR("Mismatched types for constant expression!"); @@ -3431,7 +3441,7 @@ break; case 102: -#line 1465 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1475 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[-1].TypeVal)->get(); if (isa(Ty) || Ty == Type::LabelTy || isa(Ty)) @@ -3443,7 +3453,7 @@ break; case 103: -#line 1474 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1484 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantSInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].SInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); @@ -3453,7 +3463,7 @@ break; case 104: -#line 1480 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1490 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // integral constants if (!ConstantUInt::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].UInt64Val))) GEN_ERROR("Constant value doesn't fit in type!"); @@ -3463,7 +3473,7 @@ break; case 105: -#line 1486 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1496 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants (yyval.ConstVal) = ConstantBool::True; CHECK_FOR_ERROR @@ -3471,7 +3481,7 @@ break; case 106: -#line 1490 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1500 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Boolean constants (yyval.ConstVal) = ConstantBool::False; CHECK_FOR_ERROR @@ -3479,7 +3489,7 @@ break; case 107: -#line 1494 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1504 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Float & Double constants if (!ConstantFP::isValueValidForType((yyvsp[-1].PrimType), (yyvsp[0].FPVal))) GEN_ERROR("Floating point constant invalid for type!!"); @@ -3489,7 +3499,7 @@ break; case 108: -#line 1502 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1512 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!(yyvsp[-3].ConstVal)->getType()->isFirstClassType()) GEN_ERROR("cast constant expression from a non-primitive type: '" + @@ -3504,7 +3514,7 @@ break; case 109: -#line 1513 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1523 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[-2].ConstVal)->getType())) GEN_ERROR("GetElementPtr requires a pointer operand!"); @@ -3540,7 +3550,7 @@ break; case 110: -#line 1545 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1555 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-5].ConstVal)->getType() != Type::BoolTy) GEN_ERROR("Select condition must be of boolean type!"); @@ -3552,7 +3562,7 @@ break; case 111: -#line 1553 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1563 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Binary operator types must match!"); @@ -3578,7 +3588,7 @@ break; case 112: -#line 1575 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1585 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("Logical operator types must match!"); @@ -3593,7 +3603,7 @@ break; case 113: -#line 1586 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1596 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-3].ConstVal)->getType() != (yyvsp[-1].ConstVal)->getType()) GEN_ERROR("setcc operand types must match!"); @@ -3603,7 +3613,7 @@ break; case 114: -#line 1592 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1602 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-1].ConstVal)->getType() != Type::UByteTy) GEN_ERROR("Shift count for shift constant must be unsigned byte!"); @@ -3615,7 +3625,7 @@ break; case 115: -#line 1600 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1610 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid extractelement operands!"); @@ -3625,7 +3635,7 @@ break; case 116: -#line 1606 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1616 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid insertelement operands!"); @@ -3635,7 +3645,7 @@ break; case 117: -#line 1612 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1622 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-5].ConstVal), (yyvsp[-3].ConstVal), (yyvsp[-1].ConstVal))) GEN_ERROR("Invalid shufflevector operands!"); @@ -3645,7 +3655,7 @@ break; case 118: -#line 1621 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1631 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { ((yyval.ConstVector) = (yyvsp[-2].ConstVector))->push_back((yyvsp[0].ConstVal)); CHECK_FOR_ERROR @@ -3653,7 +3663,7 @@ break; case 119: -#line 1625 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1635 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ConstVector) = new std::vector(); (yyval.ConstVector)->push_back((yyvsp[0].ConstVal)); @@ -3662,17 +3672,17 @@ break; case 120: -#line 1633 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1643 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; ;} break; case 121: -#line 1633 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1643 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; ;} break; case 122: -#line 1643 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1653 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = ParserResult = (yyvsp[0].ModuleVal); CurModule.ModuleDone(); @@ -3681,7 +3691,7 @@ break; case 123: -#line 1651 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1661 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CurFun.FunctionDone(); @@ -3690,7 +3700,7 @@ break; case 124: -#line 1656 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1666 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CHECK_FOR_ERROR @@ -3698,7 +3708,7 @@ break; case 125: -#line 1660 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1670 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-3].ModuleVal); CHECK_FOR_ERROR @@ -3706,7 +3716,7 @@ break; case 126: -#line 1664 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1674 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = (yyvsp[-1].ModuleVal); CHECK_FOR_ERROR @@ -3714,7 +3724,7 @@ break; case 127: -#line 1668 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1678 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ModuleVal) = CurModule.CurrentModule; // Emit an error if there are any unresolved types left. @@ -3731,7 +3741,7 @@ break; case 128: -#line 1683 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1693 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Eagerly resolve types. This is not an optimization, this is a // requirement that is due to the fact that we could have this: @@ -3756,21 +3766,21 @@ break; case 129: -#line 1704 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1714 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Function prototypes can be in const pool CHECK_FOR_ERROR ;} break; case 130: -#line 1707 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1717 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Asm blocks can be in the const pool CHECK_FOR_ERROR ;} break; case 131: -#line 1710 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1720 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].ConstVal) == 0) GEN_ERROR("Global value initializer is not a constant!"); CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), (yyvsp[-2].Linkage), (yyvsp[-1].BoolVal), (yyvsp[0].ConstVal)->getType(), (yyvsp[0].ConstVal)); @@ -3778,7 +3788,7 @@ break; case 132: -#line 1713 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1723 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -3786,7 +3796,7 @@ break; case 133: -#line 1717 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1727 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = ParseGlobalVariable((yyvsp[-3].StrVal), GlobalValue::ExternalLinkage, (yyvsp[-1].BoolVal), *(yyvsp[0].TypeVal), 0); @@ -3795,7 +3805,7 @@ break; case 134: -#line 1721 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1731 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurGV = 0; CHECK_FOR_ERROR @@ -3803,27 +3813,27 @@ break; case 135: -#line 1725 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1735 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 136: -#line 1728 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1738 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 137: -#line 1731 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1741 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { ;} break; case 138: -#line 1735 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1745 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const std::string &AsmSoFar = CurModule.CurrentModule->getModuleInlineAsm(); char *EndStr = UnEscapeLexed((yyvsp[0].StrVal), true); @@ -3839,17 +3849,17 @@ break; case 139: -#line 1748 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1758 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Endianness) = Module::BigEndian; ;} break; case 140: -#line 1749 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1759 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.Endianness) = Module::LittleEndian; ;} break; case 141: -#line 1751 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1761 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setEndianness((yyvsp[0].Endianness)); CHECK_FOR_ERROR @@ -3857,7 +3867,7 @@ break; case 142: -#line 1755 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1765 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].UInt64Val) == 32) CurModule.CurrentModule->setPointerSize(Module::Pointer32); @@ -3870,7 +3880,7 @@ break; case 143: -#line 1764 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1774 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->setTargetTriple((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3879,7 +3889,7 @@ break; case 145: -#line 1772 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1782 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3888,7 +3898,7 @@ break; case 146: -#line 1777 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1787 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurModule.CurrentModule->addLibrary((yyvsp[0].StrVal)); free((yyvsp[0].StrVal)); @@ -3897,19 +3907,19 @@ break; case 147: -#line 1782 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1792 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CHECK_FOR_ERROR ;} break; case 151: -#line 1792 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1802 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.StrVal) = 0; ;} break; case 152: -#line 1794 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1804 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (*(yyvsp[-1].TypeVal) == Type::VoidTy) GEN_ERROR("void typed arguments are invalid!"); @@ -3919,7 +3929,7 @@ break; case 153: -#line 1801 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1811 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyvsp[-2].ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -3929,7 +3939,7 @@ break; case 154: -#line 1807 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1817 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = new std::vector >(); (yyval.ArgList)->push_back(*(yyvsp[0].ArgVal)); @@ -3939,7 +3949,7 @@ break; case 155: -#line 1814 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1824 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[0].ArgList); CHECK_FOR_ERROR @@ -3947,7 +3957,7 @@ break; case 156: -#line 1818 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1828 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = (yyvsp[-2].ArgList); (yyval.ArgList)->push_back(std::pair >(); (yyval.ArgList)->push_back(std::make_pair(new PATypeHolder(Type::VoidTy), (char*)0)); @@ -3966,7 +3976,7 @@ break; case 158: -#line 1829 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1839 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ArgList) = 0; CHECK_FOR_ERROR @@ -3974,7 +3984,7 @@ break; case 159: -#line 1835 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1845 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { UnEscapeLexed((yyvsp[-5].StrVal)); std::string FunctionName((yyvsp[-5].StrVal)); @@ -4063,7 +4073,7 @@ break; case 162: -#line 1923 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1933 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; @@ -4074,7 +4084,7 @@ break; case 165: -#line 1933 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1943 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4082,12 +4092,12 @@ break; case 166: -#line 1938 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1948 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { CurFun.isDeclare = true; ;} break; case 167: -#line 1938 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1948 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = CurFun.CurrentFunction; CurFun.FunctionDone(); @@ -4096,7 +4106,7 @@ break; case 168: -#line 1948 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1958 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4104,7 +4114,7 @@ break; case 169: -#line 1952 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1962 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4112,7 +4122,7 @@ break; case 170: -#line 1957 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1967 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // A reference to a direct constant (yyval.ValIDVal) = ValID::create((yyvsp[0].SInt64Val)); CHECK_FOR_ERROR @@ -4120,7 +4130,7 @@ break; case 171: -#line 1961 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1971 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].UInt64Val)); CHECK_FOR_ERROR @@ -4128,7 +4138,7 @@ break; case 172: -#line 1965 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1975 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Perhaps it's an FP constant? (yyval.ValIDVal) = ValID::create((yyvsp[0].FPVal)); CHECK_FOR_ERROR @@ -4136,7 +4146,7 @@ break; case 173: -#line 1969 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1979 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantBool::True); CHECK_FOR_ERROR @@ -4144,7 +4154,7 @@ break; case 174: -#line 1973 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1983 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create(ConstantBool::False); CHECK_FOR_ERROR @@ -4152,7 +4162,7 @@ break; case 175: -#line 1977 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1987 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createNull(); CHECK_FOR_ERROR @@ -4160,7 +4170,7 @@ break; case 176: -#line 1981 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1991 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::createUndef(); CHECK_FOR_ERROR @@ -4168,7 +4178,7 @@ break; case 177: -#line 1985 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1995 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // A vector zero constant. (yyval.ValIDVal) = ValID::createZeroInit(); CHECK_FOR_ERROR @@ -4176,7 +4186,7 @@ break; case 178: -#line 1989 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 1999 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Nonempty unsized packed vector const Type *ETy = (*(yyvsp[-1].ConstVector))[0]->getType(); int NumElements = (yyvsp[-1].ConstVector)->size(); @@ -4205,7 +4215,7 @@ break; case 179: -#line 2014 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2024 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValIDVal) = ValID::create((yyvsp[0].ConstVal)); CHECK_FOR_ERROR @@ -4213,7 +4223,7 @@ break; case 180: -#line 2018 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2028 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { char *End = UnEscapeLexed((yyvsp[-2].StrVal), true); std::string AsmStr = std::string((yyvsp[-2].StrVal), End); @@ -4227,7 +4237,7 @@ break; case 181: -#line 2032 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2042 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it an integer reference...? (yyval.ValIDVal) = ValID::create((yyvsp[0].SIntVal)); CHECK_FOR_ERROR @@ -4235,7 +4245,7 @@ break; case 182: -#line 2036 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2046 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Is it a named reference...? (yyval.ValIDVal) = ValID::create((yyvsp[0].StrVal)); CHECK_FOR_ERROR @@ -4243,7 +4253,7 @@ break; case 185: -#line 2048 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2058 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueVal) = getVal(*(yyvsp[-1].TypeVal), (yyvsp[0].ValIDVal)); delete (yyvsp[-1].TypeVal); CHECK_FOR_ERROR @@ -4251,7 +4261,7 @@ break; case 186: -#line 2053 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2063 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4259,7 +4269,7 @@ break; case 187: -#line 2057 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2067 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Do not allow functions with 0 basic blocks (yyval.FunctionVal) = (yyvsp[-1].FunctionVal); CHECK_FOR_ERROR @@ -4267,7 +4277,7 @@ break; case 188: -#line 2066 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2076 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { setValueName((yyvsp[0].TermInstVal), (yyvsp[-1].StrVal)); InsertValue((yyvsp[0].TermInstVal)); @@ -4280,7 +4290,7 @@ break; case 189: -#line 2076 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2086 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyvsp[-1].BasicBlockVal)->getInstList().push_back((yyvsp[0].InstVal)); (yyval.BasicBlockVal) = (yyvsp[-1].BasicBlockVal); @@ -4289,7 +4299,7 @@ break; case 190: -#line 2081 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2091 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((int)CurFun.NextBBNum++), true); @@ -4304,7 +4314,7 @@ break; case 191: -#line 2092 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2102 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BasicBlockVal) = CurBB = getBBVal(ValID::create((yyvsp[0].StrVal)), true); @@ -4319,7 +4329,7 @@ break; case 192: -#line 2104 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2114 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with a result... (yyval.TermInstVal) = new ReturnInst((yyvsp[0].ValueVal)); CHECK_FOR_ERROR @@ -4327,7 +4337,7 @@ break; case 193: -#line 2108 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2118 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Return with no result... (yyval.TermInstVal) = new ReturnInst(); CHECK_FOR_ERROR @@ -4335,7 +4345,7 @@ break; case 194: -#line 2112 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2122 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Unconditional Branch... (yyval.TermInstVal) = new BranchInst(getBBVal((yyvsp[0].ValIDVal))); CHECK_FOR_ERROR @@ -4343,7 +4353,7 @@ break; case 195: -#line 2116 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2126 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new BranchInst(getBBVal((yyvsp[-3].ValIDVal)), getBBVal((yyvsp[0].ValIDVal)), getVal(Type::BoolTy, (yyvsp[-6].ValIDVal))); CHECK_FOR_ERROR @@ -4351,7 +4361,7 @@ break; case 196: -#line 2120 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2130 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { SwitchInst *S = new SwitchInst(getVal((yyvsp[-7].PrimType), (yyvsp[-6].ValIDVal)), getBBVal((yyvsp[-3].ValIDVal)), (yyvsp[-1].JumpTable)->size()); (yyval.TermInstVal) = S; @@ -4370,7 +4380,7 @@ break; case 197: -#line 2135 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2145 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { SwitchInst *S = new SwitchInst(getVal((yyvsp[-6].PrimType), (yyvsp[-5].ValIDVal)), getBBVal((yyvsp[-2].ValIDVal)), 0); (yyval.TermInstVal) = S; @@ -4379,7 +4389,7 @@ break; case 198: -#line 2141 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2151 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -4436,7 +4446,7 @@ break; case 199: -#line 2194 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2204 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnwindInst(); CHECK_FOR_ERROR @@ -4444,7 +4454,7 @@ break; case 200: -#line 2198 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2208 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.TermInstVal) = new UnreachableInst(); CHECK_FOR_ERROR @@ -4452,7 +4462,7 @@ break; case 201: -#line 2205 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2215 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = (yyvsp[-5].JumpTable); Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); @@ -4465,7 +4475,7 @@ break; case 202: -#line 2214 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2224 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.JumpTable) = new std::vector >(); Constant *V = cast(getValNonImprovising((yyvsp[-4].PrimType), (yyvsp[-3].ValIDVal))); @@ -4479,7 +4489,7 @@ break; case 203: -#line 2225 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2235 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Is this definition named?? if so, assign the name... setValueName((yyvsp[0].InstVal), (yyvsp[-1].StrVal)); @@ -4490,7 +4500,7 @@ break; case 204: -#line 2233 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2243 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for PHI nodes (yyval.PHIList) = new std::list >(); (yyval.PHIList)->push_back(std::make_pair(getVal(*(yyvsp[-5].TypeVal), (yyvsp[-3].ValIDVal)), getBBVal((yyvsp[-1].ValIDVal)))); @@ -4500,7 +4510,7 @@ break; case 205: -#line 2239 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2249 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.PHIList) = (yyvsp[-6].PHIList); (yyvsp[-6].PHIList)->push_back(std::make_pair(getVal((yyvsp[-6].PHIList)->front().first->getType(), (yyvsp[-3].ValIDVal)), @@ -4510,7 +4520,7 @@ break; case 206: -#line 2247 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2257 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { // Used for call statements, and memory insts... (yyval.ValueList) = new std::vector(); (yyval.ValueList)->push_back((yyvsp[0].ValueVal)); @@ -4519,7 +4529,7 @@ break; case 207: -#line 2252 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2262 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[-2].ValueList); (yyvsp[-2].ValueList)->push_back((yyvsp[0].ValueVal)); @@ -4528,12 +4538,12 @@ break; case 209: -#line 2259 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2269 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = 0; ;} break; case 210: -#line 2261 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2271 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4541,7 +4551,7 @@ break; case 211: -#line 2265 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2275 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4549,7 +4559,7 @@ break; case 212: -#line 2272 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2282 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!(*(yyvsp[-3].TypeVal))->isInteger() && !(*(yyvsp[-3].TypeVal))->isFloatingPoint() && !isa((*(yyvsp[-3].TypeVal)).get())) @@ -4566,7 +4576,7 @@ break; case 213: -#line 2285 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2295 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!(*(yyvsp[-3].TypeVal))->isIntegral()) { if (!isa((yyvsp[-3].TypeVal)->get()) || @@ -4582,7 +4592,7 @@ break; case 214: -#line 2297 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2307 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if(isa((*(yyvsp[-3].TypeVal)).get())) { GEN_ERROR( @@ -4597,7 +4607,7 @@ break; case 215: -#line 2308 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2318 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { std::cerr << "WARNING: Use of eliminated 'not' instruction:" << " Replacing with 'xor'.\n"; @@ -4614,7 +4624,7 @@ break; case 216: -#line 2321 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2331 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[0].ValueVal)->getType() != Type::UByteTy) GEN_ERROR("Shift amount must be ubyte!"); @@ -4626,7 +4636,7 @@ break; case 217: -#line 2329 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2339 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!(yyvsp[0].TypeVal)->get()->isFirstClassType()) GEN_ERROR("cast instruction to a non-primitive type: '" + @@ -4638,7 +4648,7 @@ break; case 218: -#line 2337 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2347 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if ((yyvsp[-4].ValueVal)->getType() != Type::BoolTy) GEN_ERROR("select condition must be boolean!"); @@ -4650,7 +4660,7 @@ break; case 219: -#line 2345 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2355 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { NewVarArgs = true; (yyval.InstVal) = new VAArgInst((yyvsp[-2].ValueVal), *(yyvsp[0].TypeVal)); @@ -4660,7 +4670,7 @@ break; case 220: -#line 2351 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2361 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); @@ -4684,7 +4694,7 @@ break; case 221: -#line 2371 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2381 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { ObsoleteVarArgs = true; const Type* ArgTy = (yyvsp[-2].ValueVal)->getType(); @@ -4711,7 +4721,7 @@ break; case 222: -#line 2394 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2404 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ExtractElementInst::isValidOperands((yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid extractelement operands!"); @@ -4721,7 +4731,7 @@ break; case 223: -#line 2400 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2410 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!InsertElementInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid insertelement operands!"); @@ -4731,7 +4741,7 @@ break; case 224: -#line 2406 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2416 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!ShuffleVectorInst::isValidOperands((yyvsp[-4].ValueVal), (yyvsp[-2].ValueVal), (yyvsp[0].ValueVal))) GEN_ERROR("Invalid shufflevector operands!"); @@ -4741,7 +4751,7 @@ break; case 225: -#line 2412 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2422 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const Type *Ty = (yyvsp[0].PHIList)->front().first->getType(); if (!Ty->isFirstClassType()) @@ -4760,7 +4770,7 @@ break; case 226: -#line 2427 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2437 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const PointerType *PFTy; const FunctionType *Ty; @@ -4822,7 +4832,7 @@ break; case 227: -#line 2485 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2495 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = (yyvsp[0].InstVal); CHECK_FOR_ERROR @@ -4830,7 +4840,7 @@ break; case 228: -#line 2492 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2502 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = (yyvsp[0].ValueList); CHECK_FOR_ERROR @@ -4838,7 +4848,7 @@ break; case 229: -#line 2495 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2505 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.ValueList) = new std::vector(); CHECK_FOR_ERROR @@ -4846,7 +4856,7 @@ break; case 230: -#line 2500 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2510 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = true; CHECK_FOR_ERROR @@ -4854,7 +4864,7 @@ break; case 231: -#line 2504 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2514 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.BoolVal) = false; CHECK_FOR_ERROR @@ -4862,7 +4872,7 @@ break; case 232: -#line 2511 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2521 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = new MallocInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); delete (yyvsp[-1].TypeVal); @@ -4871,7 +4881,7 @@ break; case 233: -#line 2516 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2526 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = new MallocInst(*(yyvsp[-4].TypeVal), getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)), (yyvsp[0].UIntVal)); delete (yyvsp[-4].TypeVal); @@ -4880,7 +4890,7 @@ break; case 234: -#line 2521 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2531 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = new AllocaInst(*(yyvsp[-1].TypeVal), 0, (yyvsp[0].UIntVal)); delete (yyvsp[-1].TypeVal); @@ -4889,7 +4899,7 @@ break; case 235: -#line 2526 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2536 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { (yyval.InstVal) = new AllocaInst(*(yyvsp[-4].TypeVal), getVal((yyvsp[-2].PrimType), (yyvsp[-1].ValIDVal)), (yyvsp[0].UIntVal)); delete (yyvsp[-4].TypeVal); @@ -4898,7 +4908,7 @@ break; case 236: -#line 2531 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2541 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[0].ValueVal)->getType())) GEN_ERROR("Trying to free nonpointer type " + @@ -4909,7 +4919,7 @@ break; case 237: -#line 2539 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2549 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[-1].TypeVal)->get())) GEN_ERROR("Can't load from nonpointer type: " + @@ -4924,7 +4934,7 @@ break; case 238: -#line 2550 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2560 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { const PointerType *PT = dyn_cast((yyvsp[-1].TypeVal)->get()); if (!PT) @@ -4942,7 +4952,7 @@ break; case 239: -#line 2564 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2574 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" { if (!isa((yyvsp[-2].TypeVal)->get())) GEN_ERROR("getelementptr insn requires pointer operand!"); @@ -4972,7 +4982,7 @@ } /* Line 1126 of yacc.c. */ -#line 4976 "llvmAsmParser.tab.c" +#line 4986 "llvmAsmParser.tab.c" yyvsp -= yylen; yyssp -= yylen; @@ -5240,7 +5250,7 @@ } -#line 2588 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 2598 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" void llvm::GenerateError(const std::string &message, int LineNo) { Index: llvm/lib/AsmParser/llvmAsmParser.h.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.4 llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.5 --- llvm/lib/AsmParser/llvmAsmParser.h.cvs:1.4 Fri Aug 18 03:43:06 2006 +++ llvm/lib/AsmParser/llvmAsmParser.h.cvs Fri Aug 18 12:32:55 2006 @@ -237,7 +237,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 897 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 907 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" typedef union YYSTYPE { llvm::Module *ModuleVal; llvm::Function *FunctionVal; Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.256 llvm/lib/AsmParser/llvmAsmParser.y:1.257 --- llvm/lib/AsmParser/llvmAsmParser.y:1.256 Fri Aug 18 03:43:06 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Fri Aug 18 12:32:55 2006 @@ -27,9 +27,19 @@ #include #include +// The following is a gross hack. In order to rid the libAsmParser library of +// exceptions, we have to have a way of getting the yyparse function to go into +// an error situation. So, whenever we want an error to occur, the GenerateError +// function (see bottom of file) sets TriggerError. Then, at the end of each +// production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR +// (a goto) to put YACC in error state. Furthermore, several calls to +// GenerateError are made from inside productions and they must simulate the +// previous exception behavior by exiting the production immediately. We have +// replaced these with the GEN_ERROR macro which calls GeneratError and then +// immediately invokes YYERROR. This would be so much cleaner if it was a +// recursive descent parser. static bool TriggerError = false; #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYERROR; } } - #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; } int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit Index: llvm/lib/AsmParser/llvmAsmParser.y.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.8 llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.9 --- llvm/lib/AsmParser/llvmAsmParser.y.cvs:1.8 Fri Aug 18 03:43:06 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y.cvs Fri Aug 18 12:32:55 2006 @@ -27,9 +27,19 @@ #include #include +// The following is a gross hack. In order to rid the libAsmParser library of +// exceptions, we have to have a way of getting the yyparse function to go into +// an error situation. So, whenever we want an error to occur, the GenerateError +// function (see bottom of file) sets TriggerError. Then, at the end of each +// production in the grammer we use CHECK_FOR_ERROR which will invoke YYERROR +// (a goto) to put YACC in error state. Furthermore, several calls to +// GenerateError are made from inside productions and they must simulate the +// previous exception behavior by exiting the production immediately. We have +// replaced these with the GEN_ERROR macro which calls GeneratError and then +// immediately invokes YYERROR. This would be so much cleaner if it was a +// recursive descent parser. static bool TriggerError = false; #define CHECK_FOR_ERROR { if (TriggerError) { TriggerError = false; YYERROR; } } - #define GEN_ERROR(msg) { GenerateError(msg); YYERROR; } int yyerror(const char *ErrorMsg); // Forward declarations to prevent "implicit From lattner at cs.uiuc.edu Fri Aug 18 12:34:38 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 18 Aug 2006 12:34:38 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y Message-ID: <200608181734.k7IHYcjF008301@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.257 -> 1.258 --- Log message: trivial optimization --- Diffs of the changes: (+4 -1) llvmAsmParser.y | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.257 llvm/lib/AsmParser/llvmAsmParser.y:1.258 --- llvm/lib/AsmParser/llvmAsmParser.y:1.257 Fri Aug 18 12:32:55 2006 +++ llvm/lib/AsmParser/llvmAsmParser.y Fri Aug 18 12:34:24 2006 @@ -714,7 +714,10 @@ /// thus we can complete the cycle. /// static PATypeHolder HandleUpRefs(const Type *ty) { - if (!ty->isAbstract()) return ty; + // If Ty isn't abstract, or if there are no up-references in it, then there is + // nothing to resolve here. + if (!ty->isAbstract() || UpRefs.empty()) return ty; + PATypeHolder Ty(ty); UR_OUT("Type '" << Ty->getDescription() << "' newly formed. Resolving upreferences.\n" << From lattner at cs.uiuc.edu Fri Aug 18 12:35:00 2006 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 18 Aug 2006 12:35:00 -0500 Subject: [llvm-commits] CVS: llvm/lib/AsmParser/Lexer.cpp.cvs llvmAsmParser.cpp.cvs llvmAsmParser.h.cvs llvmAsmParser.y.cvs Message-ID: <200608181735.k7IHZ0SC008343@zion.cs.uiuc.edu> Changes in directory llvm/lib/AsmParser: Lexer.cpp.cvs updated: 1.6 -> 1.7 llvmAsmParser.cpp.cvs updated: 1.9 -> 1.10 llvmAsmParser.h.cvs updated: 1.5 -> 1.6 llvmAsmParser.y.cvs updated: 1.9 -> 1.10 --- Log message: regenerate --- Diffs of the changes: (+2876 -3839) Lexer.cpp.cvs | 259 +- llvmAsmParser.cpp.cvs | 6099 +++++++++++++++++++++----------------------------- llvmAsmParser.h.cvs | 352 -- llvmAsmParser.y.cvs | 5 4 files changed, 2876 insertions(+), 3839 deletions(-) Index: llvm/lib/AsmParser/Lexer.cpp.cvs diff -u llvm/lib/AsmParser/Lexer.cpp.cvs:1.6 llvm/lib/AsmParser/Lexer.cpp.cvs:1.7 --- llvm/lib/AsmParser/Lexer.cpp.cvs:1.6 Fri Aug 18 03:43:06 2006 +++ llvm/lib/AsmParser/Lexer.cpp.cvs Fri Aug 18 12:34:45 2006 @@ -17,10 +17,10 @@ #define yylineno llvmAsmlineno #line 20 "Lexer.cpp" -/* A lexical scanner generated by flex*/ +/* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.6 2006/08/18 08:43:06 reid Exp $ + * $Header: /var/cvs/llvm/llvm/lib/AsmParser/Lexer.cpp.cvs,v 1.7 2006/08/18 17:34:45 lattner Exp $ */ #define FLEX_SCANNER @@ -28,7 +28,6 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#include /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -42,6 +41,7 @@ #ifdef __cplusplus #include +#include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -153,15 +153,6 @@ #define unput(c) yyunput( c, yytext_ptr ) -/* Some routines like yy_flex_realloc() are emitted as static but are - not called by all lexers. This generates warnings in some compilers, - notably GCC. Arrange to suppress these. */ -#ifdef __GNUC__ -#define YY_MAY_BE_UNUSED __attribute__((unused)) -#else -#define YY_MAY_BE_UNUSED -#endif - /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). @@ -268,7 +259,7 @@ YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; +static inline void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer @@ -792,7 +783,7 @@ #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 1 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" #define INITIAL 0 /*===-- Lexer.l - Scanner for llvm assembly files --------------*- C++ -*--===// // @@ -807,7 +798,7 @@ // //===----------------------------------------------------------------------===*/ #define YY_NEVER_INTERACTIVE 1 -#line 28 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 28 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" #include "ParserInternals.h" #include "llvm/Module.h" #include @@ -933,7 +924,7 @@ /* HexIntConstant - Hexadecimal constant generated by the CFE to avoid forcing * it to deal with 64 bit numbers. */ -#line 937 "Lexer.cpp" +#line 928 "Lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1081,13 +1072,13 @@ YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; -#line 179 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 179 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" -#line 1091 "Lexer.cpp" +#line 1082 "Lexer.cpp" if ( yy_init ) { @@ -1180,477 +1171,477 @@ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 181 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 181 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { /* Ignore comments for now */ } YY_BREAK case 2: YY_RULE_SETUP -#line 183 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 183 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return BEGINTOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 184 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 184 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return ENDTOK; } YY_BREAK case 4: YY_RULE_SETUP -#line 185 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 185 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return TRUETOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 186 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 186 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return FALSETOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 187 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 187 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return DECLARE; } YY_BREAK case 7: YY_RULE_SETUP -#line 188 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 188 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return GLOBAL; } YY_BREAK case 8: YY_RULE_SETUP -#line 189 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 189 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return CONSTANT; } YY_BREAK case 9: YY_RULE_SETUP -#line 190 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 190 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return INTERNAL; } YY_BREAK case 10: YY_RULE_SETUP -#line 191 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 191 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return LINKONCE; } YY_BREAK case 11: YY_RULE_SETUP -#line 192 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 192 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return WEAK; } YY_BREAK case 12: YY_RULE_SETUP -#line 193 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 193 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return APPENDING; } YY_BREAK case 13: YY_RULE_SETUP -#line 194 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 194 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return EXTERNAL; } /* Deprecated, turn into external */ YY_BREAK case 14: YY_RULE_SETUP -#line 195 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 195 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return EXTERNAL; } YY_BREAK case 15: YY_RULE_SETUP -#line 196 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 196 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return IMPLEMENTATION; } YY_BREAK case 16: YY_RULE_SETUP -#line 197 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 197 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return ZEROINITIALIZER; } YY_BREAK case 17: YY_RULE_SETUP -#line 198 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 198 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return DOTDOTDOT; } YY_BREAK case 18: YY_RULE_SETUP -#line 199 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 199 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return UNDEF; } YY_BREAK case 19: YY_RULE_SETUP -#line 200 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 200 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return NULL_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 201 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 201 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return TO; } YY_BREAK case 21: YY_RULE_SETUP -#line 202 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 202 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 22: YY_RULE_SETUP -#line 203 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 203 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return NOT; } /* Deprecated, turned into XOR */ YY_BREAK case 23: YY_RULE_SETUP -#line 204 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 204 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return TAIL; } YY_BREAK case 24: YY_RULE_SETUP -#line 205 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 205 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return TARGET; } YY_BREAK case 25: YY_RULE_SETUP -#line 206 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 206 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return TRIPLE; } YY_BREAK case 26: YY_RULE_SETUP -#line 207 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 207 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return DEPLIBS; } YY_BREAK case 27: YY_RULE_SETUP -#line 208 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 208 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return ENDIAN; } YY_BREAK case 28: YY_RULE_SETUP -#line 209 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 209 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return POINTERSIZE; } YY_BREAK case 29: YY_RULE_SETUP -#line 210 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 210 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return LITTLE; } YY_BREAK case 30: YY_RULE_SETUP -#line 211 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 211 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return BIG; } YY_BREAK case 31: YY_RULE_SETUP -#line 212 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 212 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return VOLATILE; } YY_BREAK case 32: YY_RULE_SETUP -#line 213 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 213 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return ALIGN; } YY_BREAK case 33: YY_RULE_SETUP -#line 214 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 214 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return SECTION; } YY_BREAK case 34: YY_RULE_SETUP -#line 215 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 215 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return MODULE; } YY_BREAK case 35: YY_RULE_SETUP -#line 216 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 216 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return ASM_TOK; } YY_BREAK case 36: YY_RULE_SETUP -#line 217 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 217 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return SIDEEFFECT; } YY_BREAK case 37: YY_RULE_SETUP -#line 219 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 219 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return CC_TOK; } YY_BREAK case 38: YY_RULE_SETUP -#line 220 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 220 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return CCC_TOK; } YY_BREAK case 39: YY_RULE_SETUP -#line 221 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 221 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return CSRETCC_TOK; } YY_BREAK case 40: YY_RULE_SETUP -#line 222 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 222 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return FASTCC_TOK; } YY_BREAK case 41: YY_RULE_SETUP -#line 223 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 223 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return COLDCC_TOK; } YY_BREAK case 42: YY_RULE_SETUP -#line 225 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 225 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::VoidTy ; return VOID; } YY_BREAK case 43: YY_RULE_SETUP -#line 226 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 226 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::BoolTy ; return BOOL; } YY_BREAK case 44: YY_RULE_SETUP -#line 227 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 227 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::SByteTy ; return SBYTE; } YY_BREAK case 45: YY_RULE_SETUP -#line 228 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 228 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::UByteTy ; return UBYTE; } YY_BREAK case 46: YY_RULE_SETUP -#line 229 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 229 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::ShortTy ; return SHORT; } YY_BREAK case 47: YY_RULE_SETUP -#line 230 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 230 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::UShortTy; return USHORT; } YY_BREAK case 48: YY_RULE_SETUP -#line 231 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 231 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::IntTy ; return INT; } YY_BREAK case 49: YY_RULE_SETUP -#line 232 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 232 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::UIntTy ; return UINT; } YY_BREAK case 50: YY_RULE_SETUP -#line 233 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 233 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::LongTy ; return LONG; } YY_BREAK case 51: YY_RULE_SETUP -#line 234 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 234 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::ULongTy ; return ULONG; } YY_BREAK case 52: YY_RULE_SETUP -#line 235 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 235 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::FloatTy ; return FLOAT; } YY_BREAK case 53: YY_RULE_SETUP -#line 236 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 236 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::DoubleTy; return DOUBLE; } YY_BREAK case 54: YY_RULE_SETUP -#line 237 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 237 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.PrimType = Type::LabelTy ; return LABEL; } YY_BREAK case 55: YY_RULE_SETUP -#line 238 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 238 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return TYPE; } YY_BREAK case 56: YY_RULE_SETUP -#line 239 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 239 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return OPAQUE; } YY_BREAK case 57: YY_RULE_SETUP -#line 241 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 241 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Add, ADD); } YY_BREAK case 58: YY_RULE_SETUP -#line 242 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 242 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Sub, SUB); } YY_BREAK case 59: YY_RULE_SETUP -#line 243 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 243 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Mul, MUL); } YY_BREAK case 60: YY_RULE_SETUP -#line 244 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 244 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Div, DIV); } YY_BREAK case 61: YY_RULE_SETUP -#line 245 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 245 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Rem, REM); } YY_BREAK case 62: YY_RULE_SETUP -#line 246 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 246 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, And, AND); } YY_BREAK case 63: YY_RULE_SETUP -#line 247 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 247 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Or , OR ); } YY_BREAK case 64: YY_RULE_SETUP -#line 248 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 248 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, Xor, XOR); } YY_BREAK case 65: YY_RULE_SETUP -#line 249 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 249 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetNE, SETNE); } YY_BREAK case 66: YY_RULE_SETUP -#line 250 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 250 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetEQ, SETEQ); } YY_BREAK case 67: YY_RULE_SETUP -#line 251 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 251 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetLT, SETLT); } YY_BREAK case 68: YY_RULE_SETUP -#line 252 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 252 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetGT, SETGT); } YY_BREAK case 69: YY_RULE_SETUP -#line 253 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 253 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetLE, SETLE); } YY_BREAK case 70: YY_RULE_SETUP -#line 254 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 254 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(BinaryOpVal, SetGE, SETGE); } YY_BREAK case 71: YY_RULE_SETUP -#line 256 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 256 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, PHI, PHI_TOK); } YY_BREAK case 72: YY_RULE_SETUP -#line 257 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 257 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Call, CALL); } YY_BREAK case 73: YY_RULE_SETUP -#line 258 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 258 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Cast, CAST); } YY_BREAK case 74: YY_RULE_SETUP -#line 259 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 259 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Select, SELECT); } YY_BREAK case 75: YY_RULE_SETUP -#line 260 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 260 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Shl, SHL); } YY_BREAK case 76: YY_RULE_SETUP -#line 261 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 261 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, Shr, SHR); } YY_BREAK case 77: YY_RULE_SETUP -#line 262 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 262 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return VANEXT_old; } YY_BREAK case 78: YY_RULE_SETUP -#line 263 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 263 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return VAARG_old; } YY_BREAK case 79: YY_RULE_SETUP -#line 264 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 264 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, VAArg , VAARG); } YY_BREAK case 80: YY_RULE_SETUP -#line 265 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 265 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Ret, RET); } YY_BREAK case 81: YY_RULE_SETUP -#line 266 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 266 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Br, BR); } YY_BREAK case 82: YY_RULE_SETUP -#line 267 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 267 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Switch, SWITCH); } YY_BREAK case 83: YY_RULE_SETUP -#line 268 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 268 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Invoke, INVOKE); } YY_BREAK case 84: YY_RULE_SETUP -#line 269 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 269 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unwind, UNWIND); } YY_BREAK case 85: YY_RULE_SETUP -#line 270 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 270 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(TermOpVal, Unreachable, UNREACHABLE); } YY_BREAK case 86: YY_RULE_SETUP -#line 272 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 272 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Malloc, MALLOC); } YY_BREAK case 87: YY_RULE_SETUP -#line 273 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 273 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Alloca, ALLOCA); } YY_BREAK case 88: YY_RULE_SETUP -#line 274 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 274 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Free, FREE); } YY_BREAK case 89: YY_RULE_SETUP -#line 275 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 275 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Load, LOAD); } YY_BREAK case 90: YY_RULE_SETUP -#line 276 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 276 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, Store, STORE); } YY_BREAK case 91: YY_RULE_SETUP -#line 277 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 277 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(MemOpVal, GetElementPtr, GETELEMENTPTR); } YY_BREAK case 92: YY_RULE_SETUP -#line 279 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 279 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ExtractElement, EXTRACTELEMENT); } YY_BREAK case 93: YY_RULE_SETUP -#line 280 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 280 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, InsertElement, INSERTELEMENT); } YY_BREAK case 94: YY_RULE_SETUP -#line 281 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 281 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } YY_BREAK case 95: YY_RULE_SETUP -#line 284 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 284 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { UnEscapeLexed(yytext+1); llvmAsmlval.StrVal = strdup(yytext+1); // Skip % @@ -1659,7 +1650,7 @@ YY_BREAK case 96: YY_RULE_SETUP -#line 289 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 289 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-1] = 0; // nuke colon UnEscapeLexed(yytext); @@ -1669,7 +1660,7 @@ YY_BREAK case 97: YY_RULE_SETUP -#line 295 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 295 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { yytext[strlen(yytext)-2] = 0; // nuke colon, end quote UnEscapeLexed(yytext+1); @@ -1679,7 +1670,7 @@ YY_BREAK case 98: YY_RULE_SETUP -#line 302 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 302 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { // Note that we cannot unescape a string constant here! The // string constant might contain a \00 which would not be // understood by the string stuff. It is valid to make a @@ -1692,12 +1683,12 @@ YY_BREAK case 99: YY_RULE_SETUP -#line 313 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 313 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = atoull(yytext); return EUINT64VAL; } YY_BREAK case 100: YY_RULE_SETUP -#line 314 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 314 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); // +1: we have bigger negative range @@ -1709,7 +1700,7 @@ YY_BREAK case 101: YY_RULE_SETUP -#line 322 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 322 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.UInt64Val = HexIntToVal(yytext+3); return yytext[0] == 's' ? ESINT64VAL : EUINT64VAL; @@ -1717,7 +1708,7 @@ YY_BREAK case 102: YY_RULE_SETUP -#line 327 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 327 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+1); if ((unsigned)Val != Val) @@ -1728,7 +1719,7 @@ YY_BREAK case 103: YY_RULE_SETUP -#line 334 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 334 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { uint64_t Val = atoull(yytext+2); // +1: we have bigger negative range @@ -1740,16 +1731,16 @@ YY_BREAK case 104: YY_RULE_SETUP -#line 343 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 343 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = atof(yytext); return FPVAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 344 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 344 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { llvmAsmlval.FPVal = HexToFP(yytext); return FPVAL; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 346 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 346 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { /* Make sure to free the internal buffers for flex when we are * done reading our input! @@ -1760,20 +1751,20 @@ YY_BREAK case 106: YY_RULE_SETUP -#line 354 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 354 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { /* Ignore whitespace */ } YY_BREAK case 107: YY_RULE_SETUP -#line 355 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 355 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" { return yytext[0]; } YY_BREAK case 108: YY_RULE_SETUP -#line 357 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 357 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1777 "Lexer.cpp" +#line 1768 "Lexer.cpp" case YY_END_OF_BUFFER: { @@ -2149,7 +2140,6 @@ #endif /* ifndef YY_NO_UNPUT */ -#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -2223,7 +2213,7 @@ return c; } -#endif /* YY_NO_INPUT */ + #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) @@ -2334,6 +2324,11 @@ } +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) @@ -2651,5 +2646,5 @@ return 0; } #endif -#line 357 "/proj/llvm/llvm/lib/AsmParser/Lexer.l" +#line 357 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/Lexer.l" Index: llvm/lib/AsmParser/llvmAsmParser.cpp.cvs diff -u llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.9 llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.10 --- llvm/lib/AsmParser/llvmAsmParser.cpp.cvs:1.9 Fri Aug 18 12:32:55 2006 +++ llvm/lib/AsmParser/llvmAsmParser.cpp.cvs Fri Aug 18 12:34:45 2006 @@ -1,278 +1,118 @@ -/* A Bison parser, made by GNU Bison 2.1. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y + by GNU Bison version 1.28 */ - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Using locations. */ -#define YYLSP_NEEDED 0 +#define YYBISON 1 /* Identify Bison output. */ -/* 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 SINTVAL 259 +#define UINTVAL 260 +#define FPVAL 261 +#define VOID 262 +#define BOOL 263 +#define SBYTE 264 +#define UBYTE 265 +#define SHORT 266 +#define USHORT 267 +#define INT 268 +#define UINT 269 +#define LONG 270 +#define ULONG 271 +#define FLOAT 272 +#define DOUBLE 273 +#define TYPE 274 +#define LABEL 275 +#define VAR_ID 276 +#define LABELSTR 277 +#define STRINGCONSTANT 278 +#define IMPLEMENTATION 279 +#define ZEROINITIALIZER 280 +#define TRUETOK 281 +#define FALSETOK 282 +#define BEGINTOK 283 +#define ENDTOK 284 +#define DECLARE 285 +#define GLOBAL 286 +#define CONSTANT 287 +#define SECTION 288 +#define VOLATILE 289 +#define TO 290 +#define DOTDOTDOT 291 +#define NULL_TOK 292 +#define UNDEF 293 +#define CONST 294 +#define INTERNAL 295 +#define LINKONCE 296 +#define WEAK 297 +#define APPENDING 298 +#define OPAQUE 299 +#define NOT 300 +#define EXTERNAL 301 +#define TARGET 302 +#define TRIPLE 303 +#define ENDIAN 304 +#define POINTERSIZE 305 +#define LITTLE 306 +#define BIG 307 +#define ALIGN 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 CSRETCC_TOK 317 +#define FASTCC_TOK 318 +#define COLDCC_TOK 319 +#define RET 320 +#define BR 321 +#define SWITCH 322 +#define INVOKE 323 +#define UNWIND 324 +#define UNREACHABLE 325 +#define ADD 326 +#define SUB 327 +#define MUL 328 +#define DIV 329 +#define REM 330 +#define AND 331 +#define OR 332 +#define XOR 333 +#define SETLE 334 +#define SETGE 335 +#define SETLT 336 +#define SETGT 337 +#define SETEQ 338 +#define SETNE 339 +#define MALLOC 340 +#define ALLOCA 341 +#define FREE 342 +#define LOAD 343 +#define STORE 344 +#define GETELEMENTPTR 345 +#define PHI_TOK 346 +#define CAST 347 +#define SELECT 348 +#define SHL 349 +#define SHR 350 +#define VAARG 351 +#define EXTRACTELEMENT 352 +#define INSERTELEMENT 353 +#define SHUFFLEVECTOR 354 +#define VAARG_old 355 +#define VANEXT_old 356 - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ESINT64VAL = 258, - EUINT64VAL = 259, - SINTVAL = 260, - UINTVAL = 261, - FPVAL = 262, - VOID = 263, - BOOL = 264, - SBYTE = 265, - UBYTE = 266, - SHORT = 267, - USHORT = 268, - INT = 269, - UINT = 270, - LONG = 271, - ULONG = 272, - FLOAT = 273, - DOUBLE = 274, - TYPE = 275, - LABEL = 276, - VAR_ID = 277, - LABELSTR = 278, - STRINGCONSTANT = 279, - IMPLEMENTATION = 280, - ZEROINITIALIZER = 281, - TRUETOK = 282, - FALSETOK = 283, - BEGINTOK = 284, - ENDTOK = 285, - DECLARE = 286, - GLOBAL = 287, - CONSTANT = 288, - SECTION = 289, - VOLATILE = 290, - TO = 291, - DOTDOTDOT = 292, - NULL_TOK = 293, - UNDEF = 294, - CONST = 295, - INTERNAL = 296, - LINKONCE = 297, - WEAK = 298, - APPENDING = 299, - OPAQUE = 300, - NOT = 301, - EXTERNAL = 302, - TARGET = 303, - TRIPLE = 304, - ENDIAN = 305, - POINTERSIZE = 306, - LITTLE = 307, - BIG = 308, - ALIGN = 309, - DEPLIBS = 310, - CALL = 311, - TAIL = 312, - ASM_TOK = 313, - MODULE = 314, - SIDEEFFECT = 315, - CC_TOK = 316, - CCC_TOK = 317, - CSRETCC_TOK = 318, - FASTCC_TOK = 319, - COLDCC_TOK = 320, - RET = 321, - BR = 322, - SWITCH = 323, - INVOKE = 324, - UNWIND = 325, - UNREACHABLE = 326, - ADD = 327, - SUB = 328, - MUL = 329, - DIV = 330, - REM = 331, - AND = 332, - OR = 333, - XOR = 334, - SETLE = 335, - SETGE = 336, - SETLT = 337, - SETGT = 338, - SETEQ = 339, - SETNE = 340, - MALLOC = 341, - ALLOCA = 342, - FREE = 343, - LOAD = 344, - STORE = 345, - GETELEMENTPTR = 346, - PHI_TOK = 347, - CAST = 348, - SELECT = 349, - SHL = 350, - SHR = 351, - VAARG = 352, - EXTRACTELEMENT = 353, - INSERTELEMENT = 354, - SHUFFLEVECTOR = 355, - VAARG_old = 356, - VANEXT_old = 357 - }; -#endif -/* Tokens. */ -#define ESINT64VAL 258 -#define EUINT64VAL 259 -#define SINTVAL 260 -#define UINTVAL 261 -#define FPVAL 262 -#define VOID 263 -#define BOOL 264 -#define SBYTE 265 -#define UBYTE 266 -#define SHORT 267 -#define USHORT 268 -#define INT 269 -#define UINT 270 -#define LONG 271 -#define ULONG 272 -#define FLOAT 273 -#define DOUBLE 274 -#define TYPE 275 -#define LABEL 276 -#define VAR_ID 277 -#define LABELSTR 278 -#define STRINGCONSTANT 279 -#define IMPLEMENTATION 280 -#define ZEROINITIALIZER 281 -#define TRUETOK 282 -#define FALSETOK 283 -#define BEGINTOK 284 -#define ENDTOK 285 -#define DECLARE 286 -#define GLOBAL 287 -#define CONSTANT 288 -#define SECTION 289 -#define VOLATILE 290 -#define TO 291 -#define DOTDOTDOT 292 -#define NULL_TOK 293 -#define UNDEF 294 -#define CONST 295 -#define INTERNAL 296 -#define LINKONCE 297 -#define WEAK 298 -#define APPENDING 299 -#define OPAQUE 300 -#define NOT 301 -#define EXTERNAL 302 -#define TARGET 303 -#define TRIPLE 304 -#define ENDIAN 305 -#define POINTERSIZE 306 -#define LITTLE 307 -#define BIG 308 -#define ALIGN 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 CSRETCC_TOK 318 -#define FASTCC_TOK 319 -#define COLDCC_TOK 320 -#define RET 321 -#define BR 322 -#define SWITCH 323 -#define INVOKE 324 -#define UNWIND 325 -#define UNREACHABLE 326 -#define ADD 327 -#define SUB 328 -#define MUL 329 -#define DIV 330 -#define REM 331 -#define AND 332 -#define OR 333 -#define XOR 334 -#define SETLE 335 -#define SETGE 336 -#define SETLT 337 -#define SETGT 338 -#define SETEQ 339 -#define SETNE 340 -#define MALLOC 341 -#define ALLOCA 342 -#define FREE 343 -#define LOAD 344 -#define STORE 345 -#define GETELEMENTPTR 346 -#define PHI_TOK 347 -#define CAST 348 -#define SELECT 349 -#define SHL 350 -#define SHR 351 -#define VAARG 352 -#define EXTRACTELEMENT 353 -#define INSERTELEMENT 354 -#define SHUFFLEVECTOR 355 -#define VAARG_old 356 -#define VANEXT_old 357 - - - - -/* Copy the first part of user declarations. */ -#line 14 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" +#line 14 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" #include "ParserInternals.h" #include "llvm/CallingConv.h" @@ -976,7 +816,10 @@ /// thus we can complete the cycle. /// static PATypeHolder HandleUpRefs(const Type *ty) { - if (!ty->isAbstract()) return ty; + // If Ty isn't abstract, or if there are no up-references in it, then there is + // nothing to resolve here. + if (!ty->isAbstract() || UpRefs.empty()) return ty; + PATypeHolder Ty(ty); UR_OUT("Type '" << Ty->getDescription() << "' newly formed. Resolving upreferences.\n" << @@ -1165,28 +1008,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) -#line 907 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" -typedef union YYSTYPE { +#line 910 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +typedef union { llvm::Module *ModuleVal; llvm::Function *FunctionVal; std::pair *ArgVal; @@ -1225,1424 +1048,971 @@ llvm::Instruction::OtherOps OtherOpVal; llvm::Module::Endianness Endianness; } YYSTYPE; -/* Line 196 of yacc.c. */ -#line 1230 "llvmAsmParser.tab.c" -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 -#endif - - - -/* Copy the second part of user declarations. */ - - -/* Line 219 of yacc.c. */ -#line 1242 "llvmAsmParser.tab.c" - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYINCLUDED_STDLIB_H -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) -# endif -# ifdef __cplusplus -extern "C" { -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ - && (defined (__STDC__) || defined (__cplusplus))) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifdef __cplusplus -} -# endif -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#include +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - }; -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) +#define YYFINAL 496 +#define YYFLAG -32768 +#define YYNTBASE 117 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 356 ? yytranslate[x] : 188) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, + 107, 115, 2, 104, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 111, + 103, 112, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 108, 105, 110, 2, 2, 2, 2, 2, 116, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 109, + 2, 2, 113, 2, 114, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 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 +}; -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) +#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, 67, 68, 70, 72, 74, 76, 77, + 78, 80, 82, 84, 86, 89, 90, 93, 94, 98, + 101, 102, 104, 105, 109, 111, 114, 116, 118, 120, + 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, + 142, 144, 146, 148, 150, 152, 154, 156, 159, 164, + 170, 176, 180, 183, 186, 188, 192, 194, 198, 200, + 201, 206, 210, 214, 219, 224, 228, 231, 234, 237, + 240, 243, 246, 249, 252, 255, 258, 265, 271, 280, + 287, 294, 301, 308, 315, 324, 333, 337, 339, 341, + 343, 345, 348, 351, 356, 359, 361, 366, 369, 374, + 375, 383, 384, 392, 396, 401, 402, 404, 406, 408, + 412, 416, 420, 424, 428, 430, 431, 433, 435, 437, + 438, 441, 445, 447, 449, 453, 455, 456, 465, 467, + 469, 473, 475, 477, 480, 481, 485, 486, 488, 490, + 492, 494, 496, 498, 500, 502, 504, 508, 510, 516, + 518, 520, 522, 524, 527, 530, 533, 537, 540, 541, + 543, 546, 549, 553, 563, 573, 582, 596, 598, 600, + 607, 613, 616, 623, 631, 633, 637, 639, 640, 643, + 645, 651, 657, 663, 666, 671, 676, 683, 688, 693, + 698, 703, 710, 717, 720, 728, 730, 733, 734, 736, + 737, 741, 748, 752, 759, 762, 767, 774 +}; -#endif +static const short yyrhs[] = { 5, + 0, 6, 0, 3, 0, 4, 0, 72, 0, 73, + 0, 74, 0, 75, 0, 76, 0, 77, 0, 78, + 0, 79, 0, 80, 0, 81, 0, 82, 0, 83, + 0, 84, 0, 85, 0, 95, 0, 96, 0, 16, + 0, 14, 0, 12, 0, 10, 0, 17, 0, 15, + 0, 13, 0, 11, 0, 123, 0, 124, 0, 18, + 0, 19, 0, 157, 103, 0, 0, 41, 0, 42, + 0, 43, 0, 44, 0, 0, 0, 62, 0, 63, + 0, 64, 0, 65, 0, 61, 4, 0, 0, 54, + 4, 0, 0, 104, 54, 4, 0, 34, 24, 0, + 0, 132, 0, 0, 104, 135, 134, 0, 132, 0, + 54, 4, 0, 138, 0, 8, 0, 140, 0, 8, + 0, 140, 0, 9, 0, 10, 0, 11, 0, 12, + 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, + 0, 18, 0, 19, 0, 20, 0, 21, 0, 45, + 0, 139, 0, 171, 0, 105, 4, 0, 137, 106, + 142, 107, 0, 108, 4, 109, 140, 110, 0, 111, + 4, 109, 140, 112, 0, 113, 141, 114, 0, 113, + 114, 0, 140, 115, 0, 140, 0, 141, 104, 140, + 0, 141, 0, 141, 104, 37, 0, 37, 0, 0, + 138, 108, 145, 110, 0, 138, 108, 110, 0, 138, + 116, 24, 0, 138, 111, 145, 112, 0, 138, 113, + 145, 114, 0, 138, 113, 114, 0, 138, 38, 0, + 138, 39, 0, 138, 171, 0, 138, 144, 0, 138, + 26, 0, 123, 118, 0, 124, 4, 0, 9, 27, + 0, 9, 28, 0, 126, 7, 0, 93, 106, 143, + 36, 138, 107, 0, 91, 106, 143, 185, 107, 0, + 94, 106, 143, 104, 143, 104, 143, 107, 0, 119, + 106, 143, 104, 143, 107, 0, 120, 106, 143, 104, + 143, 107, 0, 121, 106, 143, 104, 143, 107, 0, + 122, 106, 143, 104, 143, 107, 0, 98, 106, 143, + 104, 143, 107, 0, 99, 106, 143, 104, 143, 104, + 143, 107, 0, 100, 106, 143, 104, 143, 104, 143, + 107, 0, 145, 104, 143, 0, 143, 0, 32, 0, + 33, 0, 148, 0, 148, 166, 0, 148, 167, 0, + 148, 59, 58, 152, 0, 148, 25, 0, 149, 0, + 149, 127, 20, 136, 0, 149, 167, 0, 149, 59, + 58, 152, 0, 0, 149, 127, 128, 146, 143, 150, + 134, 0, 0, 149, 127, 47, 146, 138, 151, 134, + 0, 149, 48, 154, 0, 149, 55, 103, 155, 0, + 0, 24, 0, 53, 0, 52, 0, 50, 103, 153, + 0, 51, 103, 4, 0, 49, 103, 24, 0, 108, + 156, 110, 0, 156, 104, 24, 0, 24, 0, 0, + 22, 0, 24, 0, 157, 0, 0, 138, 158, 0, + 160, 104, 159, 0, 159, 0, 160, 0, 160, 104, + 37, 0, 37, 0, 0, 129, 136, 157, 106, 161, + 107, 133, 130, 0, 29, 0, 113, 0, 128, 162, + 163, 0, 30, 0, 114, 0, 174, 165, 0, 0, + 31, 168, 162, 0, 0, 60, 0, 3, 0, 4, + 0, 7, 0, 27, 0, 28, 0, 38, 0, 39, + 0, 26, 0, 111, 145, 112, 0, 144, 0, 58, + 169, 24, 104, 24, 0, 117, 0, 157, 0, 171, + 0, 170, 0, 138, 172, 0, 174, 175, 0, 164, + 175, 0, 176, 127, 177, 0, 176, 179, 0, 0, + 23, 0, 66, 173, 0, 66, 8, 0, 67, 21, + 172, 0, 67, 9, 172, 104, 21, 172, 104, 21, + 172, 0, 68, 125, 172, 104, 21, 172, 108, 178, + 110, 0, 68, 125, 172, 104, 21, 172, 108, 110, + 0, 69, 129, 136, 172, 106, 182, 107, 36, 21, + 172, 70, 21, 172, 0, 70, 0, 71, 0, 178, + 125, 170, 104, 21, 172, 0, 125, 170, 104, 21, + 172, 0, 127, 184, 0, 138, 108, 172, 104, 172, + 110, 0, 180, 104, 108, 172, 104, 172, 110, 0, + 173, 0, 181, 104, 173, 0, 181, 0, 0, 57, + 56, 0, 56, 0, 119, 138, 172, 104, 172, 0, + 120, 138, 172, 104, 172, 0, 121, 138, 172, 104, + 172, 0, 46, 173, 0, 122, 173, 104, 173, 0, + 93, 173, 36, 138, 0, 94, 173, 104, 173, 104, + 173, 0, 97, 173, 104, 138, 0, 101, 173, 104, + 138, 0, 102, 173, 104, 138, 0, 98, 173, 104, + 173, 0, 99, 173, 104, 173, 104, 173, 0, 100, + 173, 104, 173, 104, 173, 0, 92, 180, 0, 183, + 129, 136, 172, 106, 182, 107, 0, 187, 0, 104, + 181, 0, 0, 35, 0, 0, 86, 138, 131, 0, + 86, 138, 104, 15, 172, 131, 0, 87, 138, 131, + 0, 87, 138, 104, 15, 172, 131, 0, 88, 173, + 0, 186, 89, 138, 172, 0, 186, 90, 173, 104, + 138, 172, 0, 91, 138, 172, 185, 0 +}; -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; #endif -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 4 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1278 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 117 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 72 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 239 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 496 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 357 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 106, 107, 115, 2, 104, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 111, 103, 112, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 108, 105, 110, 2, 2, 2, 2, 2, 116, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 109, 2, 2, 113, 2, 114, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 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 +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 1030, 1031, 1039, 1040, 1050, 1050, 1050, 1050, 1050, 1051, + 1051, 1051, 1052, 1052, 1052, 1052, 1052, 1052, 1054, 1054, + 1058, 1058, 1058, 1058, 1059, 1059, 1059, 1059, 1060, 1060, + 1061, 1061, 1064, 1068, 1073, 1073, 1074, 1075, 1076, 1079, + 1079, 1080, 1081, 1082, 1083, 1093, 1093, 1100, 1100, 1109, + 1117, 1117, 1123, 1123, 1125, 1130, 1144, 1144, 1145, 1145, + 1147, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1158, 1158, + 1158, 1158, 1158, 1158, 1159, 1163, 1167, 1174, 1182, 1195, + 1200, 1212, 1222, 1226, 1235, 1240, 1246, 1247, 1251, 1255, + 1266, 1292, 1306, 1336, 1362, 1383, 1396, 1406, 1411, 1471, + 1478, 1487, 1493, 1499, 1503, 1507, 1515, 1526, 1558, 1566, + 1588, 1599, 1605, 1613, 1619, 1625, 1634, 1638, 1646, 1646, + 1656, 1664, 1669, 1673, 1677, 1681, 1696, 1717, 1720, 1723, + 1726, 1730, 1734, 1738, 1741, 1744, 1748, 1761, 1762, 1764, + 1768, 1777, 1783, 1785, 1790, 1795, 1804, 1804, 1805, 1805, + 1807, 1814, 1820, 1827, 1831, 1837, 1842, 1847, 1934, 1934, + 1936, 1944, 1944, 1946, 1951, 1951, 1961, 1965, 1970, 1974, + 1978, 1982, 1986, 1990, 1994, 1998, 2002, 2027, 2031, 2045, + 2049, 2055, 2055, 2061, 2066, 2070, 2079, 2089, 2094, 2105, + 2117, 2121, 2125, 2129, 2133, 2148, 2153, 2207, 2211, 2218, + 2227, 2238, 2246, 2252, 2260, 2265, 2272, 2272, 2274, 2278, + 2285, 2298, 2310, 2321, 2334, 2342, 2350, 2358, 2364, 2384, + 2407, 2413, 2419, 2425, 2440, 2498, 2505, 2508, 2513, 2517, + 2524, 2529, 2534, 2539, 2544, 2552, 2563, 2577 }; +#endif -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, - 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, - 59, 61, 63, 65, 67, 70, 71, 73, 75, 77, - 79, 80, 81, 83, 85, 87, 89, 92, 93, 96, - 97, 101, 104, 105, 107, 108, 112, 114, 117, 119, - 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, - 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, - 162, 167, 173, 179, 183, 186, 189, 191, 195, 197, - 201, 203, 204, 209, 213, 217, 222, 227, 231, 234, - 237, 240, 243, 246, 249, 252, 255, 258, 261, 268, - 274, 283, 290, 297, 304, 311, 318, 327, 336, 340, - 342, 344, 346, 348, 351, 354, 359, 362, 364, 369, - 372, 377, 378, 386, 387, 395, 399, 404, 405, 407, - 409, 411, 415, 419, 423, 427, 431, 433, 434, 436, - 438, 440, 441, 444, 448, 450, 452, 456, 458, 459, - 468, 470, 472, 476, 478, 480, 483, 484, 488, 489, - 491, 493, 495, 497, 499, 501, 503, 505, 507, 511, - 513, 519, 521, 523, 525, 527, 530, 533, 536, 540, - 543, 544, 546, 549, 552, 556, 566, 576, 585, 599, - 601, 603, 610, 616, 619, 626, 634, 636, 640, 642, - 643, 646, 648, 654, 660, 666, 669, 674, 679, 686, - 691, 696, 701, 706, 713, 720, 723, 731, 733, 736, - 737, 739, 740, 744, 751, 755, 762, 765, 770, 777 -}; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 148, 0, -1, 5, -1, 6, -1, 3, -1, 4, - -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, - -1, 77, -1, 78, -1, 79, -1, 80, -1, 81, - -1, 82, -1, 83, -1, 84, -1, 85, -1, 95, - -1, 96, -1, 16, -1, 14, -1, 12, -1, 10, - -1, 17, -1, 15, -1, 13, -1, 11, -1, 124, - -1, 125, -1, 18, -1, 19, -1, 158, 103, -1, - -1, 41, -1, 42, -1, 43, -1, 44, -1, -1, - -1, 62, -1, 63, -1, 64, -1, 65, -1, 61, - 4, -1, -1, 54, 4, -1, -1, 104, 54, 4, - -1, 34, 24, -1, -1, 133, -1, -1, 104, 136, - 135, -1, 133, -1, 54, 4, -1, 139, -1, 8, - -1, 141, -1, 8, -1, 141, -1, 9, -1, 10, - -1, 11, -1, 12, -1, 13, -1, 14, -1, 15, - -1, 16, -1, 17, -1, 18, -1, 19, -1, 20, - -1, 21, -1, 45, -1, 140, -1, 172, -1, 105, - 4, -1, 138, 106, 143, 107, -1, 108, 4, 109, - 141, 110, -1, 111, 4, 109, 141, 112, -1, 113, - 142, 114, -1, 113, 114, -1, 141, 115, -1, 141, - -1, 142, 104, 141, -1, 142, -1, 142, 104, 37, - -1, 37, -1, -1, 139, 108, 146, 110, -1, 139, - 108, 110, -1, 139, 116, 24, -1, 139, 111, 146, - 112, -1, 139, 113, 146, 114, -1, 139, 113, 114, - -1, 139, 38, -1, 139, 39, -1, 139, 172, -1, - 139, 145, -1, 139, 26, -1, 124, 119, -1, 125, - 4, -1, 9, 27, -1, 9, 28, -1, 127, 7, - -1, 93, 106, 144, 36, 139, 107, -1, 91, 106, - 144, 186, 107, -1, 94, 106, 144, 104, 144, 104, - 144, 107, -1, 120, 106, 144, 104, 144, 107, -1, - 121, 106, 144, 104, 144, 107, -1, 122, 106, 144, - 104, 144, 107, -1, 123, 106, 144, 104, 144, 107, - -1, 98, 106, 144, 104, 144, 107, -1, 99, 106, - 144, 104, 144, 104, 144, 107, -1, 100, 106, 144, - 104, 144, 104, 144, 107, -1, 146, 104, 144, -1, - 144, -1, 32, -1, 33, -1, 149, -1, 149, 167, - -1, 149, 168, -1, 149, 59, 58, 153, -1, 149, - 25, -1, 150, -1, 150, 128, 20, 137, -1, 150, - 168, -1, 150, 59, 58, 153, -1, -1, 150, 128, - 129, 147, 144, 151, 135, -1, -1, 150, 128, 47, - 147, 139, 152, 135, -1, 150, 48, 155, -1, 150, - 55, 103, 156, -1, -1, 24, -1, 53, -1, 52, - -1, 50, 103, 154, -1, 51, 103, 4, -1, 49, - 103, 24, -1, 108, 157, 110, -1, 157, 104, 24, - -1, 24, -1, -1, 22, -1, 24, -1, 158, -1, - -1, 139, 159, -1, 161, 104, 160, -1, 160, -1, - 161, -1, 161, 104, 37, -1, 37, -1, -1, 130, - 137, 158, 106, 162, 107, 134, 131, -1, 29, -1, - 113, -1, 129, 163, 164, -1, 30, -1, 114, -1, - 175, 166, -1, -1, 31, 169, 163, -1, -1, 60, - -1, 3, -1, 4, -1, 7, -1, 27, -1, 28, - -1, 38, -1, 39, -1, 26, -1, 111, 146, 112, - -1, 145, -1, 58, 170, 24, 104, 24, -1, 118, - -1, 158, -1, 172, -1, 171, -1, 139, 173, -1, - 175, 176, -1, 165, 176, -1, 177, 128, 178, -1, - 177, 180, -1, -1, 23, -1, 66, 174, -1, 66, - 8, -1, 67, 21, 173, -1, 67, 9, 173, 104, - 21, 173, 104, 21, 173, -1, 68, 126, 173, 104, - 21, 173, 108, 179, 110, -1, 68, 126, 173, 104, - 21, 173, 108, 110, -1, 69, 130, 137, 173, 106, - 183, 107, 36, 21, 173, 70, 21, 173, -1, 70, - -1, 71, -1, 179, 126, 171, 104, 21, 173, -1, - 126, 171, 104, 21, 173, -1, 128, 185, -1, 139, - 108, 173, 104, 173, 110, -1, 181, 104, 108, 173, - 104, 173, 110, -1, 174, -1, 182, 104, 174, -1, - 182, -1, -1, 57, 56, -1, 56, -1, 120, 139, - 173, 104, 173, -1, 121, 139, 173, 104, 173, -1, - 122, 139, 173, 104, 173, -1, 46, 174, -1, 123, - 174, 104, 174, -1, 93, 174, 36, 139, -1, 94, - 174, 104, 174, 104, 174, -1, 97, 174, 104, 139, - -1, 101, 174, 104, 139, -1, 102, 174, 104, 139, - -1, 98, 174, 104, 174, -1, 99, 174, 104, 174, - 104, 174, -1, 100, 174, 104, 174, 104, 174, -1, - 92, 181, -1, 184, 130, 137, 173, 106, 183, 107, - -1, 188, -1, 104, 182, -1, -1, 35, -1, -1, - 86, 139, 132, -1, 86, 139, 104, 15, 173, 132, - -1, 87, 139, 132, -1, 87, 139, 104, 15, 173, - 132, -1, 88, 174, -1, 187, 89, 139, 173, -1, - 187, 90, 174, 104, 139, 173, -1, 91, 139, 173, - 186, -1 -}; +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 1027, 1027, 1028, 1036, 1037, 1047, 1047, 1047, 1047, - 1047, 1048, 1048, 1048, 1049, 1049, 1049, 1049, 1049, 1049, - 1051, 1051, 1055, 1055, 1055, 1055, 1056, 1056, 1056, 1056, - 1057, 1057, 1058, 1058, 1061, 1065, 1070, 1071, 1072, 1073, - 1074, 1076, 1077, 1078, 1079, 1080, 1081, 1090, 1091, 1097, - 1098, 1106, 1114, 1115, 1120, 1121, 1122, 1127, 1141, 1141, - 1142, 1142, 1144, 1154, 1154, 1154, 1154, 1154, 1154, 1154, - 1155, 1155, 1155, 1155, 1155, 1155, 1156, 1160, 1164, 1171, - 1179, 1192, 1197, 1209, 1219, 1223, 1232, 1237, 1243, 1244, - 1248, 1252, 1263, 1289, 1303, 1333, 1359, 1380, 1393, 1403, - 1408, 1468, 1475, 1484, 1490, 1496, 1500, 1504, 1512, 1523, - 1555, 1563, 1585, 1596, 1602, 1610, 1616, 1622, 1631, 1635, - 1643, 1643, 1653, 1661, 1666, 1670, 1674, 1678, 1693, 1714, - 1717, 1720, 1720, 1727, 1727, 1735, 1738, 1741, 1745, 1758, - 1759, 1761, 1765, 1774, 1780, 1782, 1787, 1792, 1801, 1801, - 1802, 1802, 1804, 1811, 1817, 1824, 1828, 1834, 1839, 1844, - 1931, 1931, 1933, 1941, 1941, 1943, 1948, 1948, 1958, 1962, - 1967, 1971, 1975, 1979, 1983, 1987, 1991, 1995, 1999, 2024, - 2028, 2042, 2046, 2052, 2052, 2058, 2063, 2067, 2076, 2086, - 2091, 2102, 2114, 2118, 2122, 2126, 2130, 2145, 2150, 2204, - 2208, 2215, 2224, 2235, 2243, 2249, 2257, 2262, 2269, 2269, - 2271, 2275, 2282, 2295, 2307, 2318, 2331, 2339, 2347, 2355, - 2361, 2381, 2404, 2410, 2416, 2422, 2437, 2495, 2502, 2505, - 2510, 2514, 2521, 2526, 2531, 2536, 2541, 2549, 2560, 2574 +static const char * const yytname[] = { "$","error","$undefined.","ESINT64VAL", +"EUINT64VAL","SINTVAL","UINTVAL","FPVAL","VOID","BOOL","SBYTE","UBYTE","SHORT", +"USHORT","INT","UINT","LONG","ULONG","FLOAT","DOUBLE","TYPE","LABEL","VAR_ID", +"LABELSTR","STRINGCONSTANT","IMPLEMENTATION","ZEROINITIALIZER","TRUETOK","FALSETOK", +"BEGINTOK","ENDTOK","DECLARE","GLOBAL","CONSTANT","SECTION","VOLATILE","TO", +"DOTDOTDOT","NULL_TOK","UNDEF","CONST","INTERNAL","LINKONCE","WEAK","APPENDING", +"OPAQUE","NOT","EXTERNAL","TARGET","TRIPLE","ENDIAN","POINTERSIZE","LITTLE", +"BIG","ALIGN","DEPLIBS","CALL","TAIL","ASM_TOK","MODULE","SIDEEFFECT","CC_TOK", +"CCC_TOK","CSRETCC_TOK","FASTCC_TOK","COLDCC_TOK","RET","BR","SWITCH","INVOKE", +"UNWIND","UNREACHABLE","ADD","SUB","MUL","DIV","REM","AND","OR","XOR","SETLE", +"SETGE","SETLT","SETGT","SETEQ","SETNE","MALLOC","ALLOCA","FREE","LOAD","STORE", +"GETELEMENTPTR","PHI_TOK","CAST","SELECT","SHL","SHR","VAARG","EXTRACTELEMENT", +"INSERTELEMENT","SHUFFLEVECTOR","VAARG_old","VANEXT_old","'='","','","'\\\\'", +"'('","')'","'['","'x'","']'","'<'","'>'","'{'","'}'","'*'","'c'","INTVAL","EINT64VAL", +"ArithmeticOps","LogicalOps","SetCondOps","ShiftOps","SIntType","UIntType","IntType", +"FPType","OptAssign","OptLinkage","OptCallingConv","OptAlign","OptCAlign","SectionString", +"OptSection","GlobalVarAttributes","GlobalVarAttribute","TypesV","UpRTypesV", +"Types","PrimType","UpRTypes","TypeListI","ArgTypeListI","ConstVal","ConstExpr", +"ConstVector","GlobalType","Module","FunctionList","ConstPool","@1","@2","AsmBlock", +"BigOrLittle","TargetDefinition","LibrariesDefinition","LibList","Name","OptName", +"ArgVal","ArgListH","ArgList","FunctionHeaderH","BEGIN","FunctionHeader","END", +"Function","FunctionProto","@3","OptSideEffect","ConstValueRef","SymbolicValueRef", +"ValueRef","ResolvedVal","BasicBlockList","BasicBlock","InstructionList","BBTerminatorInst", +"JumpTable","Inst","PHIList","ValueRefList","ValueRefListE","OptTailCall","InstVal", +"IndexList","OptVolatile","MemoryInst", NULL }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL", - "UINTVAL", "FPVAL", "VOID", "BOOL", "SBYTE", "UBYTE", "SHORT", "USHORT", - "INT", "UINT", "LONG", "ULONG", "FLOAT", "DOUBLE", "TYPE", "LABEL", - "VAR_ID", "LABELSTR", "STRINGCONSTANT", "IMPLEMENTATION", - "ZEROINITIALIZER", "TRUETOK", "FALSETOK", "BEGINTOK", "ENDTOK", - "DECLARE", "GLOBAL", "CONSTANT", "SECTION", "VOLATILE", "TO", - "DOTDOTDOT", "NULL_TOK", "UNDEF", "CONST", "INTERNAL", "LINKONCE", - "WEAK", "APPENDING", "OPAQUE", "NOT", "EXTERNAL", "TARGET", "TRIPLE", - "ENDIAN", "POINTERSIZE", "LITTLE", "BIG", "ALIGN", "DEPLIBS", "CALL", - "TAIL", "ASM_TOK", "MODULE", "SIDEEFFECT", "CC_TOK", "CCC_TOK", - "CSRETCC_TOK", "FASTCC_TOK", "COLDCC_TOK", "RET", "BR", "SWITCH", - "INVOKE", "UNWIND", "UNREACHABLE", "ADD", "SUB", "MUL", "DIV", "REM", - "AND", "OR", "XOR", "SETLE", "SETGE", "SETLT", "SETGT", "SETEQ", "SETNE", - "MALLOC", "ALLOCA", "FREE", "LOAD", "STORE", "GETELEMENTPTR", "PHI_TOK", - "CAST", "SELECT", "SHL", "SHR", "VAARG", "EXTRACTELEMENT", - "INSERTELEMENT", "SHUFFLEVECTOR", "VAARG_old", "VANEXT_old", "'='", - "','", "'\\\\'", "'('", "')'", "'['", "'x'", "']'", "'<'", "'>'", "'{'", - "'}'", "'*'", "'c'", "$accept", "INTVAL", "EINT64VAL", "ArithmeticOps", - "LogicalOps", "SetCondOps", "ShiftOps", "SIntType", "UIntType", - "IntType", "FPType", "OptAssign", "OptLinkage", "OptCallingConv", - "OptAlign", "OptCAlign", "SectionString", "OptSection", - "GlobalVarAttributes", "GlobalVarAttribute", "TypesV", "UpRTypesV", - "Types", "PrimType", "UpRTypes", "TypeListI", "ArgTypeListI", "ConstVal", - "ConstExpr", "ConstVector", "GlobalType", "Module", "FunctionList", - "ConstPool", "@1", "@2", "AsmBlock", "BigOrLittle", "TargetDefinition", - "LibrariesDefinition", "LibList", "Name", "OptName", "ArgVal", - "ArgListH", "ArgList", "FunctionHeaderH", "BEGIN", "FunctionHeader", - "END", "Function", "FunctionProto", "@3", "OptSideEffect", - "ConstValueRef", "SymbolicValueRef", "ValueRef", "ResolvedVal", - "BasicBlockList", "BasicBlock", "InstructionList", "BBTerminatorInst", - "JumpTable", "Inst", "PHIList", "ValueRefList", "ValueRefListE", - "OptTailCall", "InstVal", "IndexList", "OptVolatile", "MemoryInst", 0 +static const short yyr1[] = { 0, + 117, 117, 118, 118, 119, 119, 119, 119, 119, 120, + 120, 120, 121, 121, 121, 121, 121, 121, 122, 122, + 123, 123, 123, 123, 124, 124, 124, 124, 125, 125, + 126, 126, 127, 127, 128, 128, 128, 128, 128, 129, + 129, 129, 129, 129, 129, 130, 130, 131, 131, 132, + 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, + 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 140, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 141, 141, 142, 142, 142, 142, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, + 144, 144, 144, 144, 144, 144, 145, 145, 146, 146, + 147, 148, 148, 148, 148, 148, 149, 149, 149, 150, + 149, 151, 149, 149, 149, 149, 152, 153, 153, 154, + 154, 154, 155, 156, 156, 156, 157, 157, 158, 158, + 159, 160, 160, 161, 161, 161, 161, 162, 163, 163, + 164, 165, 165, 166, 168, 167, 169, 169, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, + 171, 172, 172, 173, 174, 174, 175, 176, 176, 176, + 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, + 178, 179, 180, 180, 181, 181, 182, 182, 183, 183, + 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 185, 185, 186, 186, + 187, 187, 187, 187, 187, 187, 187, 187 }; -#endif -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 61, 44, 92, 40, 41, 91, 120, - 93, 60, 62, 123, 125, 42, 99 +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, 2, 0, 1, 1, 1, 1, 0, 0, + 1, 1, 1, 1, 2, 0, 2, 0, 3, 2, + 0, 1, 0, 3, 1, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, + 5, 3, 2, 2, 1, 3, 1, 3, 1, 0, + 4, 3, 3, 4, 4, 3, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 6, 5, 8, 6, + 6, 6, 6, 6, 8, 8, 3, 1, 1, 1, + 1, 2, 2, 4, 2, 1, 4, 2, 4, 0, + 7, 0, 7, 3, 4, 0, 1, 1, 1, 3, + 3, 3, 3, 3, 1, 0, 1, 1, 1, 0, + 2, 3, 1, 1, 3, 1, 0, 8, 1, 1, + 3, 1, 1, 2, 0, 3, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 1, 5, 1, + 1, 1, 1, 2, 2, 2, 3, 2, 0, 1, + 2, 2, 3, 9, 9, 8, 13, 1, 1, 6, + 5, 2, 6, 7, 1, 3, 1, 0, 2, 1, + 5, 5, 5, 2, 4, 4, 6, 4, 4, 4, + 4, 6, 6, 2, 7, 1, 2, 0, 1, 0, + 3, 6, 3, 6, 2, 4, 6, 4 }; -# endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 117, 118, 118, 119, 119, 120, 120, 120, 120, - 120, 121, 121, 121, 122, 122, 122, 122, 122, 122, - 123, 123, 124, 124, 124, 124, 125, 125, 125, 125, - 126, 126, 127, 127, 128, 128, 129, 129, 129, 129, - 129, 130, 130, 130, 130, 130, 130, 131, 131, 132, - 132, 133, 134, 134, 135, 135, 136, 136, 137, 137, - 138, 138, 139, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, - 141, 141, 141, 141, 141, 141, 142, 142, 143, 143, - 143, 143, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, - 147, 147, 148, 149, 149, 149, 149, 149, 150, 150, - 150, 151, 150, 152, 150, 150, 150, 150, 153, 154, - 154, 155, 155, 155, 156, 157, 157, 157, 158, 158, - 159, 159, 160, 161, 161, 162, 162, 162, 162, 163, - 164, 164, 165, 166, 166, 167, 169, 168, 170, 170, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 172, 172, 173, 173, 174, 175, 175, 176, 177, - 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 179, 179, 180, 181, 181, 182, 182, 183, 183, - 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, - 187, 187, 188, 188, 188, 188, 188, 188, 188, 188 +static const short yydefact[] = { 136, + 39, 126, 125, 165, 35, 36, 37, 38, 0, 40, + 189, 122, 123, 189, 147, 148, 0, 0, 0, 39, + 0, 128, 40, 0, 0, 41, 42, 43, 44, 0, + 0, 190, 186, 34, 162, 163, 164, 185, 0, 0, + 0, 134, 0, 0, 0, 0, 0, 33, 166, 137, + 124, 45, 1, 2, 58, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, + 0, 0, 0, 180, 0, 0, 57, 76, 61, 181, + 77, 159, 160, 161, 230, 188, 0, 0, 0, 146, + 135, 129, 127, 119, 120, 0, 0, 78, 0, 0, + 60, 83, 85, 0, 0, 90, 84, 229, 0, 210, + 0, 0, 0, 0, 40, 198, 199, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 0, 0, 0, 0, 0, 0, 0, 19, 20, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 187, 40, 202, 0, 226, 142, 139, 138, 140, 141, + 145, 0, 132, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 0, 0, 0, 0, 130, 0, + 0, 0, 82, 157, 89, 87, 0, 0, 214, 209, + 192, 191, 0, 0, 24, 28, 23, 27, 22, 26, + 21, 25, 29, 30, 0, 0, 48, 48, 235, 0, + 0, 224, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 143, 53, + 104, 105, 3, 4, 102, 103, 106, 101, 97, 98, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 100, 99, 53, 59, 59, 86, + 156, 150, 153, 154, 0, 0, 79, 169, 170, 171, + 176, 172, 173, 174, 175, 167, 0, 178, 183, 182, + 184, 0, 193, 0, 0, 0, 231, 0, 233, 228, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 144, 0, 133, + 0, 0, 0, 0, 0, 0, 92, 118, 0, 0, + 96, 0, 93, 0, 0, 0, 0, 131, 80, 81, + 149, 151, 0, 51, 88, 168, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 238, 0, 0, 216, 0, + 218, 221, 0, 0, 219, 220, 0, 0, 0, 215, + 0, 236, 0, 0, 0, 55, 53, 228, 0, 0, + 0, 0, 0, 0, 91, 94, 95, 0, 0, 0, + 0, 155, 152, 52, 46, 0, 177, 0, 0, 208, + 48, 49, 48, 205, 227, 0, 0, 0, 0, 0, + 211, 212, 213, 208, 0, 50, 56, 54, 0, 0, + 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, + 158, 0, 0, 0, 207, 0, 0, 232, 234, 0, + 0, 0, 217, 222, 223, 0, 237, 108, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 47, 179, 0, + 0, 0, 206, 203, 0, 225, 107, 0, 114, 0, + 0, 110, 111, 112, 113, 0, 196, 0, 0, 0, + 204, 0, 0, 0, 194, 0, 195, 0, 0, 109, + 115, 116, 0, 0, 0, 0, 0, 0, 201, 0, + 0, 200, 197, 0, 0, 0 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, - 0, 0, 1, 1, 1, 1, 2, 0, 2, 0, - 3, 2, 0, 1, 0, 3, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 4, 5, 5, 3, 2, 2, 1, 3, 1, 3, - 1, 0, 4, 3, 3, 4, 4, 3, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 6, 5, - 8, 6, 6, 6, 6, 6, 8, 8, 3, 1, - 1, 1, 1, 2, 2, 4, 2, 1, 4, 2, - 4, 0, 7, 0, 7, 3, 4, 0, 1, 1, - 1, 3, 3, 3, 3, 3, 1, 0, 1, 1, - 1, 0, 2, 3, 1, 1, 3, 1, 0, 8, - 1, 1, 3, 1, 1, 2, 0, 3, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 5, 1, 1, 1, 1, 2, 2, 2, 3, 2, - 0, 1, 2, 2, 3, 9, 9, 8, 13, 1, - 1, 6, 5, 2, 6, 7, 1, 3, 1, 0, - 2, 1, 5, 5, 5, 2, 4, 4, 6, 4, - 4, 4, 4, 6, 6, 2, 7, 1, 2, 0, - 1, 0, 3, 6, 3, 6, 2, 4, 6, 4 +static const short yydefgoto[] = { 74, + 235, 251, 252, 253, 254, 175, 176, 205, 177, 20, + 10, 30, 421, 287, 366, 385, 310, 367, 75, 76, + 178, 78, 79, 104, 187, 318, 278, 319, 96, 494, + 1, 2, 257, 230, 51, 159, 42, 91, 162, 80, + 332, 263, 264, 265, 31, 84, 11, 37, 12, 13, + 23, 337, 279, 81, 281, 394, 14, 33, 34, 151, + 469, 86, 212, 425, 426, 152, 153, 346, 154, 155 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned char yydefact[] = -{ - 137, 0, 40, 127, 1, 126, 166, 36, 37, 38, - 39, 0, 41, 190, 123, 124, 190, 148, 149, 0, - 0, 0, 40, 0, 129, 41, 0, 0, 42, 43, - 44, 45, 0, 0, 191, 187, 35, 163, 164, 165, - 186, 0, 0, 0, 135, 0, 0, 0, 0, 0, - 34, 167, 138, 125, 46, 2, 3, 59, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 0, 0, 0, 0, 181, 0, 0, 58, - 77, 62, 182, 78, 160, 161, 162, 231, 189, 0, - 0, 0, 147, 136, 130, 128, 120, 121, 0, 0, - 79, 0, 0, 61, 84, 86, 0, 0, 91, 85, - 230, 0, 211, 0, 0, 0, 0, 41, 199, 200, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, - 0, 20, 21, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 188, 41, 203, 0, 227, 143, 140, - 139, 141, 142, 146, 0, 133, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 0, 0, 0, - 0, 131, 0, 0, 0, 83, 158, 90, 88, 0, - 0, 215, 210, 193, 192, 0, 0, 25, 29, 24, - 28, 23, 27, 22, 26, 30, 31, 0, 0, 49, - 49, 236, 0, 0, 225, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 144, 54, 105, 106, 4, 5, 103, 104, 107, - 102, 98, 99, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 101, 100, 54, - 60, 60, 87, 157, 151, 154, 155, 0, 0, 80, - 170, 171, 172, 177, 173, 174, 175, 176, 168, 0, - 179, 184, 183, 185, 0, 194, 0, 0, 0, 232, - 0, 234, 229, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 145, 0, 134, 0, 0, 0, 0, 0, 0, 93, - 119, 0, 0, 97, 0, 94, 0, 0, 0, 0, - 132, 81, 82, 150, 152, 0, 52, 89, 169, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 239, 0, - 0, 217, 0, 219, 222, 0, 0, 220, 221, 0, - 0, 0, 216, 0, 237, 0, 0, 0, 56, 54, - 229, 0, 0, 0, 0, 0, 0, 92, 95, 96, - 0, 0, 0, 0, 156, 153, 53, 47, 0, 178, - 0, 0, 209, 49, 50, 49, 206, 228, 0, 0, - 0, 0, 0, 212, 213, 214, 209, 0, 51, 57, - 55, 0, 0, 0, 0, 0, 0, 118, 0, 0, - 0, 0, 0, 159, 0, 0, 0, 208, 0, 0, - 233, 235, 0, 0, 0, 218, 223, 224, 0, 238, - 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 48, 180, 0, 0, 0, 207, 204, 0, 226, 108, - 0, 115, 0, 0, 111, 112, 113, 114, 0, 197, - 0, 0, 0, 205, 0, 0, 0, 195, 0, 196, - 0, 0, 110, 116, 117, 0, 0, 0, 0, 0, - 0, 202, 0, 0, 201, 198 +static const short yypact[] = {-32768, + 181, 372,-32768,-32768,-32768,-32768,-32768,-32768, -32, 94, + 38,-32768,-32768, -14,-32768,-32768, 45, -40, 18, 44, + -25,-32768, 94, 57, 79,-32768,-32768,-32768,-32768, 1012, + -21,-32768,-32768, 22,-32768,-32768,-32768,-32768, -6, -4, + 27,-32768, 26, 57, 1012, 77, 77,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 46,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 167, + 170, 171, 524,-32768, 22, 71,-32768,-32768, -17,-32768, +-32768,-32768,-32768,-32768, 1176,-32768, 154, 76, 175, 156, +-32768,-32768,-32768,-32768,-32768, 1050, 1088,-32768, 73, 74, +-32768,-32768, -17, -83, 78, 819,-32768,-32768, 1050,-32768, + 129, 1126, 56, 128, 94,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, 1050, 1050, 1050, 1050, 1050, 1050, 1050,-32768,-32768, + 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, +-32768, 94,-32768, 43,-32768,-32768,-32768,-32768,-32768,-32768, +-32768, -82,-32768, 119, 146, 183, 157, 190, 159, 194, + 166, 196, 195, 197, 169, 199, 198, 406,-32768, 1050, + 1050, 1050,-32768, 857,-32768, 97, 100, 617,-32768,-32768, + 46,-32768, 617, 617,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 617, 1012, 104, 105,-32768, 617, + 103, 109, 178, 111, 122, 123, 131, 132, 133, 134, + 617, 617, 617, 135, 1012, 1050, 1050, 209,-32768, 137, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 136, 138, 139, 140, 141, 144, 895, 1088, 566, 219, + 145, 147, 148, 149,-32768,-32768, 137, -48, -88, -17, +-32768, 22,-32768, 152, 150, 936,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768, 192, 1088,-32768,-32768,-32768, +-32768, 155,-32768, 158, 617, -5,-32768, 5,-32768, 172, + 617, 153, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, + 173, 174, 176, 1050, 617, 617, 177,-32768, -20,-32768, + 1088, 1088, 1088, 1088, 1088, 1088,-32768,-32768, -62, -11, +-32768, -79,-32768, 1088, 1088, 1088, 1088,-32768,-32768,-32768, +-32768,-32768, 974, 224,-32768,-32768, 236, 23, 251, 252, + 180, 617, 271, 617, 1050,-32768, 179, 617,-32768, 184, +-32768,-32768, 185, 186,-32768,-32768, 617, 617, 617,-32768, + 191,-32768, 1050, 258, 280,-32768, 137, 172, 256, 200, + 201, 202, 203, 1088,-32768,-32768,-32768, 204, 205, 206, + 207,-32768,-32768,-32768, 242, 208,-32768, 617, 617, 1050, + 210,-32768, 210,-32768, 216, 617, 222, 1050, 1050, 1050, +-32768,-32768,-32768, 1050, 617,-32768,-32768,-32768, 220, 1050, + 1088, 1088, 1088, 1088,-32768, 1088, 1088, 1088, 1088, 294, +-32768, 275, 225, 226, 216, 221, 259,-32768,-32768, 1050, + 227, 617,-32768,-32768,-32768, 223,-32768,-32768, 228, 232, + 234, 238, 239, 237, 240, 243, 244,-32768,-32768, 324, + 41, 310,-32768,-32768, 245,-32768,-32768, 1088,-32768, 1088, + 1088,-32768,-32768,-32768,-32768, 617,-32768, 715, 58, 328, +-32768, 246, 247, 250,-32768, 248,-32768, 715, 617,-32768, +-32768,-32768, 338, 260, 297, 617, 350, 351,-32768, 617, + 617,-32768,-32768, 376, 377,-32768 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 76, 237, 253, 254, 255, 256, 177, 178, 207, - 179, 22, 12, 32, 423, 289, 368, 387, 312, 369, - 77, 78, 180, 80, 81, 106, 189, 320, 280, 321, - 98, 1, 2, 3, 259, 232, 53, 161, 44, 93, - 164, 82, 334, 265, 266, 267, 33, 86, 13, 39, - 14, 15, 25, 339, 281, 83, 283, 396, 16, 35, - 36, 153, 471, 88, 214, 427, 428, 154, 155, 348, - 156, 157 +static const short yypgoto[] = {-32768, +-32768, 296, 298, 299, 300, -113, -111, -439,-32768, 345, + 362, -92,-32768, -203, 52,-32768, -244,-32768, -39,-32768, + -30,-32768, -56, 281,-32768, -95, 215, -230, 341,-32768, +-32768,-32768,-32768,-32768, 353,-32768,-32768,-32768,-32768, 9, +-32768, 62,-32768,-32768, 375,-32768,-32768,-32768,-32768, 397, +-32768,-32768, -388, -57, 168, -105,-32768, 387,-32768,-32768, +-32768,-32768,-32768, 61, -2,-32768,-32768, 39,-32768,-32768 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -442 -static const short int yypact[] = -{ - -442, 25, 181, 372, -442, -442, -442, -442, -442, -442, - -442, -16, 33, 42, -442, -442, -14, -442, -442, 12, - -57, 18, 44, -25, -442, 33, 75, 106, -442, -442, - -442, -442, 1012, -21, -442, -442, 4, -442, -442, -442, - -442, 29, 32, 49, -442, 47, 75, 1012, 97, 97, - -442, -442, -442, -442, -442, -442, -442, 63, -442, -442, - -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, - -442, -442, 170, 171, 173, 524, -442, 4, 72, -442, - -442, -84, -442, -442, -442, -442, -442, 1176, -442, 156, - 94, 175, 158, -442, -442, -442, -442, -442, 1050, 1088, - -442, 74, 76, -442, -442, -84, -37, 78, 819, -442, - -442, 1050, -442, 131, 1126, 14, 128, 33, -442, -442, - -442, -442, -442, -442, -442, -442, -442, -442, -442, -442, - -442, -442, -442, -442, 1050, 1050, 1050, 1050, 1050, 1050, - 1050, -442, -442, 1050, 1050, 1050, 1050, 1050, 1050, 1050, - 1050, 1050, 1050, -442, 33, -442, 60, -442, -442, -442, - -442, -442, -442, -442, 23, -442, 129, 155, 190, 157, - 194, 159, 196, 167, 197, 195, 198, 169, 199, 200, - 406, -442, 1050, 1050, 1050, -442, 857, -442, 100, 101, - 617, -442, -442, 63, -442, 617, 617, -442, -442, -442, - -442, -442, -442, -442, -442, -442, -442, 617, 1012, 105, - 107, -442, 617, 118, 109, 178, 111, 123, 132, 133, - 134, 135, 137, 617, 617, 617, 138, 1012, 1050, 1050, - 209, -442, 139, -442, -442, -442, -442, -442, -442, -442, - -442, -442, -442, 140, 141, 144, 145, 146, 147, 895, - 1088, 566, 211, 148, 149, 150, 151, -442, -442, 139, - -66, -88, -84, -442, 4, -442, 154, 152, 936, -442, - -442, -442, -442, -442, -442, -442, -442, -442, 184, 1088, - -442, -442, -442, -442, 168, -442, 172, 617, 5, -442, - 6, -442, 174, 617, 153, 1050, 1050, 1050, 1050, 1050, - 1050, 1050, 1050, 176, 177, 179, 1050, 617, 617, 180, - -442, -20, -442, 1088, 1088, 1088, 1088, 1088, 1088, -442, - -442, 24, -23, -442, -24, -442, 1088, 1088, 1088, 1088, - -442, -442, -442, -442, -442, 974, 226, -442, -442, 221, - -3, 241, 252, 182, 617, 271, 617, 1050, -442, 185, - 617, -442, 186, -442, -442, 188, 192, -442, -442, 617, - 617, 617, -442, 191, -442, 1050, 253, 278, -442, 139, - 174, 250, 201, 202, 203, 204, 1088, -442, -442, -442, - 205, 206, 207, 208, -442, -442, -442, 244, 210, -442, - 617, 617, 1050, 216, -442, 216, -442, 222, 617, 223, - 1050, 1050, 1050, -442, -442, -442, 1050, 617, -442, -442, - -442, 227, 1050, 1088, 1088, 1088, 1088, -442, 1088, 1088, - 1088, 1088, 295, -442, 280, 224, 228, 222, 230, 259, - -442, -442, 1050, 219, 617, -442, -442, -442, 234, -442, - -442, 235, 231, 236, 240, 242, 238, 243, 245, 246, - -442, -442, 309, 41, 311, -442, -442, 239, -442, -442, - 1088, -442, 1088, 1088, -442, -442, -442, -442, 617, -442, - 715, 58, 330, -442, 247, 248, 257, -442, 255, -442, - 715, 617, -442, -442, -442, 336, 263, 301, 617, 351, - 355, -442, 617, 617, -442, -442 -}; -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -442, -442, -442, 290, 292, 294, 296, -115, -113, -441, - -442, 346, 362, -106, -442, -205, 50, -442, -246, -442, - -41, -442, -32, -442, -58, 277, -442, -97, 213, -232, - 338, -442, -442, -442, -442, -442, 342, -442, -442, -442, - -442, 7, -442, 62, -442, -442, 370, -442, -442, -442, - -442, 395, -442, -442, -387, -59, 166, -107, -442, 383, - -442, -442, -442, -442, -442, 54, -4, -442, -442, 36, - -442, -442 -}; +#define YYLAST 1278 -/* 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 -123 -static const short int yytable[] = -{ - 79, 205, 181, 206, 191, 291, 95, 194, 84, 34, - 23, 208, 470, 330, 366, 79, 37, 105, 322, 324, - 344, 346, -60, 195, 332, 4, 17, 109, 18, 211, - 480, 109, 215, 216, 367, 196, 217, 218, 219, 220, - 221, 222, 26, 23, 331, 226, 45, 340, 227, 109, - 105, 197, 198, 199, 200, 201, 202, 203, 204, 345, - 345, 41, 42, 43, 47, 34, 165, 184, 197, 198, - 199, 200, 201, 202, 203, 204, 46, 185, 50, 190, - 376, 376, 190, 478, 107, 7, 8, 9, 10, 378, - 379, 48, 85, 486, 27, 28, 29, 30, 31, 52, - 38, 376, 209, 210, 190, 212, 213, 190, 190, 389, - 54, 190, 190, 190, 190, 190, 190, 223, 224, 225, - 190, 258, 309, 410, 260, 261, 262, 230, 376, 96, - 97, 282, 89, 231, 377, 90, 282, 282, 197, 198, - 199, 200, 201, 202, 203, 204, 159, 160, 282, 228, - 229, 469, 91, 282, 264, 92, 233, 234, -25, -25, - -24, -24, -23, -23, 282, 282, 282, 287, 479, -61, - -22, -22, 235, 236, 100, 101, 79, 102, 108, 162, - 158, -122, 163, 182, 186, 183, 307, 192, 430, 352, - 431, 354, 355, 356, -29, 79, 308, 190, -28, 362, - -27, -26, -32, 238, 268, -33, 5, 239, 269, 288, - 262, 290, 6, 294, 295, 296, 370, 371, 372, 373, - 374, 375, 7, 8, 9, 10, 293, 297, 282, 380, - 381, 382, 383, 310, 282, 325, 298, 299, 300, 301, - 11, 302, 306, 311, 338, 388, 313, 314, 282, 282, - 315, 316, 317, 318, 326, 327, 328, 329, 335, 336, - 366, 350, 390, 351, 190, 353, 190, 190, 190, 357, - 358, 333, 341, 391, 190, 394, 342, 408, 347, 417, - 359, 360, 409, 361, 365, 282, 412, 282, 392, 398, - 400, 282, 401, 435, 436, 437, 402, 406, 422, 450, - 282, 282, 282, 264, 451, 413, 414, 415, 416, 418, - 419, 420, 421, 345, 424, 190, 442, 443, 444, 445, - 429, 446, 447, 448, 449, 455, 432, 434, 452, 456, - 468, 282, 282, 407, 440, 460, 453, 454, 205, 282, - 206, 458, 459, 461, 462, 464, 463, 472, 282, 473, - 465, 481, 466, 467, 482, 483, 205, 488, 206, 485, - 190, 284, 285, 474, 484, 475, 476, 489, 190, 190, - 190, 490, 492, 286, 190, 282, 493, 149, 292, 150, - 441, 151, 87, 152, 49, 188, 386, 99, 94, 303, - 304, 305, -35, 257, 17, 51, 18, 385, 24, 40, - 190, 397, 438, 6, -35, -35, 411, 0, 0, 282, - 0, 55, 56, -35, -35, -35, -35, 0, 0, -35, - 19, 0, 282, 0, 0, 0, 0, 20, 17, 282, - 18, 21, 240, 282, 282, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 241, 242, 0, 0, 0, 0, - 0, 0, 0, 343, 0, 0, 0, 0, 0, 349, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 363, 364, 0, 0, 0, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 0, 0, 0, 0, 0, 243, 0, 244, - 245, 141, 142, 0, 246, 247, 248, 0, 0, 0, - 393, 0, 395, 0, 249, 0, 399, 250, 0, 251, - 0, 0, 252, 0, 0, 403, 404, 405, 0, 55, - 56, 0, 103, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 17, 0, 18, 0, - 0, 0, 0, 0, 0, 0, 425, 426, 0, 0, - 0, 0, 0, 0, 433, 0, 0, 0, 0, 71, - 0, 55, 56, 439, 103, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 69, 70, 17, 0, - 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 457, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, - 270, 271, 55, 56, 272, 0, 0, 0, 0, 72, - 0, 0, 73, 0, 477, 74, 0, 75, 104, 17, - 0, 18, 0, 273, 274, 275, 0, 487, 0, 0, - 0, 0, 0, 0, 491, 276, 277, 0, 494, 495, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 72, 0, 0, 73, 278, 0, 74, 0, 75, - 323, 0, 0, 0, 0, 0, 0, 0, 0, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 0, 0, 0, 0, 0, 243, 0, - 244, 245, 141, 142, 0, 246, 247, 248, 270, 271, - 0, 0, 272, 0, 0, 0, 0, 0, 279, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 273, 274, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 276, 277, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 0, 0, 0, 0, 0, 243, 0, 244, 245, - 141, 142, 0, 246, 247, 248, 0, 0, 0, 0, - 0, 0, 0, 0, 55, 56, 279, 103, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 17, 0, 18, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 187, 0, 0, 0, - 0, 0, 55, 56, 71, 103, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 17, - 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 263, 0, 0, 0, 0, 0, - 55, 56, 71, 103, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 69, 70, 17, 0, 18, - 0, 0, 0, 0, 72, 0, 0, 73, 0, 0, - 74, 0, 75, 0, 0, 0, 0, 0, 0, 0, - 71, 55, 56, 0, 103, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 17, 0, - 18, 0, 72, 0, 0, 73, 0, 0, 74, 0, - 75, 0, 0, 337, 0, 0, 0, 0, 0, 55, - 56, 71, 103, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 17, 0, 18, 0, - 72, 0, 0, 73, 0, 319, 74, 0, 75, 0, - 0, 384, 0, 0, 0, 0, 0, 55, 56, 71, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 17, 0, 18, 0, 0, 0, - 0, 72, 0, 0, 73, 0, 0, 74, 0, 75, - 0, 0, 0, 0, 0, 55, 56, 71, 103, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 17, 0, 18, 0, 0, 0, 0, 72, - 0, 0, 73, 0, 0, 74, 0, 75, 0, 0, - 0, 0, 0, 55, 56, 71, 103, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 69, 70, - 17, 0, 18, 0, 0, 0, 0, 72, 0, 0, - 73, 0, 0, 74, 0, 75, 0, 0, 0, 0, - 0, 55, 56, 71, 193, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 17, 0, - 18, 0, 0, 0, 0, 72, 0, 0, 73, 0, - 0, 74, 0, 75, 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, 0, - 0, 0, 0, 72, 0, 0, 73, 0, 0, 74, - 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 111, 0, 0, 0, 0, 0, 0, 0, - 0, 72, 112, 113, 73, 0, 0, 74, 0, 75, - 0, 0, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 0, 0, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148 -}; -static const short int yycheck[] = -{ - 32, 116, 99, 116, 111, 210, 47, 114, 29, 23, - 3, 117, 453, 259, 34, 47, 30, 75, 250, 251, - 15, 15, 106, 9, 112, 0, 22, 115, 24, 136, - 471, 115, 139, 140, 54, 21, 143, 144, 145, 146, - 147, 148, 58, 36, 110, 152, 103, 279, 154, 115, - 108, 10, 11, 12, 13, 14, 15, 16, 17, 54, - 54, 49, 50, 51, 20, 23, 98, 104, 10, 11, - 12, 13, 14, 15, 16, 17, 58, 114, 103, 111, - 104, 104, 114, 470, 77, 41, 42, 43, 44, 112, - 114, 47, 113, 480, 61, 62, 63, 64, 65, 24, - 114, 104, 134, 135, 136, 137, 138, 139, 140, 112, - 4, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 180, 229, 369, 182, 183, 184, 104, 104, 32, - 33, 190, 103, 110, 110, 103, 195, 196, 10, 11, - 12, 13, 14, 15, 16, 17, 52, 53, 207, 89, - 90, 110, 103, 212, 186, 108, 27, 28, 3, 4, - 3, 4, 3, 4, 223, 224, 225, 208, 110, 106, - 3, 4, 3, 4, 4, 4, 208, 4, 106, 4, - 24, 0, 24, 109, 106, 109, 227, 56, 393, 296, - 395, 298, 299, 300, 4, 227, 228, 229, 4, 306, - 4, 4, 7, 4, 104, 7, 25, 7, 107, 104, - 268, 104, 31, 104, 36, 104, 313, 314, 315, 316, - 317, 318, 41, 42, 43, 44, 108, 104, 287, 326, - 327, 328, 329, 24, 293, 24, 104, 104, 104, 104, - 59, 104, 104, 104, 60, 24, 106, 106, 307, 308, - 106, 106, 106, 106, 106, 106, 106, 106, 104, 107, - 34, 108, 21, 295, 296, 297, 298, 299, 300, 301, - 302, 264, 104, 21, 306, 4, 104, 24, 104, 376, - 104, 104, 4, 104, 104, 344, 36, 346, 106, 104, - 104, 350, 104, 400, 401, 402, 104, 106, 54, 4, - 359, 360, 361, 335, 24, 104, 104, 104, 104, 104, - 104, 104, 104, 54, 104, 347, 413, 414, 415, 416, - 104, 418, 419, 420, 421, 432, 104, 104, 104, 110, - 21, 390, 391, 365, 107, 104, 108, 107, 453, 398, - 453, 107, 107, 107, 104, 107, 104, 36, 407, 110, - 107, 21, 107, 107, 107, 107, 471, 21, 471, 104, - 392, 195, 196, 460, 107, 462, 463, 104, 400, 401, - 402, 70, 21, 207, 406, 434, 21, 87, 212, 87, - 412, 87, 36, 87, 22, 108, 336, 49, 46, 223, - 224, 225, 20, 180, 22, 25, 24, 335, 3, 16, - 432, 347, 406, 31, 32, 33, 370, -1, -1, 468, - -1, 5, 6, 41, 42, 43, 44, -1, -1, 47, - 48, -1, 481, -1, -1, -1, -1, 55, 22, 488, - 24, 59, 26, 492, 493, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 38, 39, -1, -1, -1, -1, - -1, -1, -1, 287, -1, -1, -1, -1, -1, 293, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 307, 308, -1, -1, -1, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, -1, -1, -1, -1, -1, 91, -1, 93, - 94, 95, 96, -1, 98, 99, 100, -1, -1, -1, - 344, -1, 346, -1, 108, -1, 350, 111, -1, 113, - -1, -1, 116, -1, -1, 359, 360, 361, -1, 5, - 6, -1, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, - -1, -1, -1, -1, -1, -1, 390, 391, -1, -1, - -1, -1, -1, -1, 398, -1, -1, -1, -1, 45, - -1, 5, 6, 407, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, - 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 434, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, - 3, 4, 5, 6, 7, -1, -1, -1, -1, 105, - -1, -1, 108, -1, 468, 111, -1, 113, 114, 22, - -1, 24, -1, 26, 27, 28, -1, 481, -1, -1, - -1, -1, -1, -1, 488, 38, 39, -1, 492, 493, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 105, -1, -1, 108, 58, -1, 111, -1, 113, - 114, -1, -1, -1, -1, -1, -1, -1, -1, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, -1, -1, -1, -1, -1, 91, -1, - 93, 94, 95, 96, -1, 98, 99, 100, 3, 4, - -1, -1, 7, -1, -1, -1, -1, -1, 111, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 26, 27, 28, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, -1, -1, -1, -1, -1, 91, -1, 93, 94, - 95, 96, -1, 98, 99, 100, -1, -1, -1, -1, - -1, -1, -1, -1, 5, 6, 111, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, -1, 24, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 37, -1, -1, -1, - -1, -1, 5, 6, 45, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - -1, 24, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, - 5, 6, 45, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, - -1, -1, -1, -1, 105, -1, -1, 108, -1, -1, - 111, -1, 113, -1, -1, -1, -1, -1, -1, -1, - 45, 5, 6, -1, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, - 24, -1, 105, -1, -1, 108, -1, -1, 111, -1, - 113, -1, -1, 37, -1, -1, -1, -1, -1, 5, - 6, 45, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, - 105, -1, -1, 108, -1, 110, 111, -1, 113, -1, - -1, 37, -1, -1, -1, -1, -1, 5, 6, 45, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, -1, 24, -1, -1, -1, - -1, 105, -1, -1, 108, -1, -1, 111, -1, 113, - -1, -1, -1, -1, -1, 5, 6, 45, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, -1, 24, -1, -1, -1, -1, 105, - -1, -1, 108, -1, -1, 111, -1, 113, -1, -1, - -1, -1, -1, 5, 6, 45, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, -1, 24, -1, -1, -1, -1, 105, -1, -1, - 108, -1, -1, 111, -1, 113, -1, -1, -1, -1, - -1, 5, 6, 45, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, - 24, -1, -1, -1, -1, 105, -1, -1, 108, -1, - -1, 111, -1, 113, -1, -1, -1, -1, -1, -1, - -1, 45, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 105, -1, -1, 108, -1, -1, 111, - -1, 113, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, - -1, 105, 56, 57, 108, -1, -1, 111, -1, 113, - -1, -1, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, -1, -1, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102 +static const short yytable[] = { 77, + 203, 179, 204, 189, 289, 93, 192, 82, 32, 342, + 21, 468, 328, 364, 77, 35, 103, 320, 322, 344, + 182, 228, 206, 330, 374, 24, 107, 229, 209, 478, + 183, 213, 214, 365, 377, 215, 216, 217, 218, 219, + 220, 374, 21, 15, 224, 16, 338, 375, 343, 103, + 195, 196, 197, 198, 199, 200, 201, 202, 343, 225, + 32, 329, 43, 45, 193, 163, 107, 195, 196, 197, + 198, 199, 200, 201, 202, 44, 194, 48, 188, 476, + 50, 188, 52, 105, 5, 6, 7, 8, -59, 484, + 46, 83, 374, 39, 40, 41, 87, 107, 88, 36, + 376, 207, 208, 188, 210, 211, 188, 188, 94, 95, + 188, 188, 188, 188, 188, 188, 221, 222, 223, 188, + 256, 307, 408, 258, 259, 260, 374, 157, 158, 89, + 280, 226, 227, 90, 387, 280, 280, 195, 196, 197, + 198, 199, 200, 201, 202, 231, 232, 280, -24, -24, + 467, -60, 280, 262, 25, 26, 27, 28, 29, -23, + -23, -22, -22, 280, 280, 280, 285, 477, -21, -21, + 98, 233, 234, 99, 100, 77, 106, 156, 160, 161, + -121, 180, 181, 184, 190, 305, -28, 428, 350, 429, + 352, 353, 354, -27, 77, 306, 188, -26, 360, -25, + 266, -31, 236, -32, 237, 3, 267, 286, 288, 260, + 291, 4, 292, 293, 294, 368, 369, 370, 371, 372, + 373, 5, 6, 7, 8, 295, 296, 280, 378, 379, + 380, 381, 308, 280, 297, 298, 299, 300, 304, 9, + 309, 311, 323, 312, 313, 314, 315, 280, 280, 316, + 324, 336, 325, 326, 327, 333, 334, 364, 339, 386, + 348, 340, 349, 188, 351, 188, 188, 188, 355, 356, + 331, 388, 389, 188, 392, 345, 357, 358, 415, 359, + 363, 406, 396, 407, 280, 390, 280, 398, 399, 400, + 280, 410, 433, 434, 435, 420, 404, 448, 449, 280, + 280, 280, 262, 411, 412, 413, 414, 416, 417, 418, + 419, 422, 343, 427, 188, 440, 441, 442, 443, 430, + 444, 445, 446, 447, 453, 432, 438, 452, 450, 456, + 280, 280, 405, 451, 457, 458, 454, 203, 280, 204, + 459, 460, 461, 462, 466, 470, 463, 280, 479, 464, + 465, 483, 480, 481, 471, 203, 482, 204, 486, 188, + 282, 283, 472, 487, 473, 474, 488, 188, 188, 188, + 490, 491, 284, 188, 280, 495, 496, 290, 85, 439, + 147, 47, 148, 149, 150, 384, 186, 97, 301, 302, + 303, -34, 255, 15, 383, 16, 92, 49, 22, 188, + 38, 436, 4, -34, -34, 395, 409, 0, 280, 0, + 53, 54, -34, -34, -34, -34, 0, 0, -34, 17, + 0, 280, 0, 0, 0, 0, 18, 15, 280, 16, + 19, 238, 280, 280, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 239, 240, 0, 0, 0, 0, 0, + 0, 0, 341, 0, 0, 0, 0, 0, 347, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 361, 362, 0, 0, 0, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 0, 0, 0, 0, 0, 241, 0, 242, 243, + 139, 140, 0, 244, 245, 246, 0, 0, 0, 391, + 0, 393, 0, 247, 0, 397, 248, 0, 249, 0, + 0, 250, 0, 0, 401, 402, 403, 0, 53, 54, + 0, 101, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 15, 0, 16, 0, 0, + 0, 0, 0, 0, 0, 423, 424, 0, 0, 0, + 0, 0, 0, 431, 0, 0, 0, 0, 69, 0, + 53, 54, 437, 101, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 67, 68, 15, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 455, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 268, + 269, 53, 54, 270, 0, 0, 0, 0, 70, 0, + 0, 71, 0, 475, 72, 0, 73, 102, 15, 0, + 16, 0, 271, 272, 273, 0, 485, 0, 0, 0, + 0, 0, 0, 489, 274, 275, 0, 492, 493, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 70, 0, 0, 71, 276, 0, 72, 0, 73, 321, + 0, 0, 0, 0, 0, 0, 0, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 0, 0, 0, 0, 0, 241, 0, 242, + 243, 139, 140, 0, 244, 245, 246, 268, 269, 0, + 0, 270, 0, 0, 0, 0, 0, 277, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 271, 272, 273, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 274, 275, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 0, 0, 0, 0, 0, 241, 0, 242, 243, 139, + 140, 0, 244, 245, 246, 0, 0, 0, 0, 0, + 0, 0, 0, 53, 54, 277, 101, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 15, 0, 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 185, 0, 0, 0, 0, + 0, 53, 54, 69, 101, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 15, 0, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 261, 0, 0, 0, 0, 0, 53, + 54, 69, 101, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 67, 68, 15, 0, 16, 0, + 0, 0, 0, 70, 0, 0, 71, 0, 0, 72, + 0, 73, 0, 0, 0, 0, 0, 0, 0, 69, + 53, 54, 0, 101, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 15, 0, 16, + 0, 70, 0, 0, 71, 0, 0, 72, 0, 73, + 0, 0, 335, 0, 0, 0, 0, 0, 53, 54, + 69, 101, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 15, 0, 16, 0, 70, + 0, 0, 71, 0, 317, 72, 0, 73, 0, 0, + 382, 0, 0, 0, 0, 0, 53, 54, 69, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 15, 0, 16, 0, 0, 0, 0, + 70, 0, 0, 71, 0, 0, 72, 0, 73, 0, + 0, 0, 0, 0, 53, 54, 69, 101, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 15, 0, 16, 0, 0, 0, 0, 70, 0, + 0, 71, 0, 0, 72, 0, 73, 0, 0, 0, + 0, 0, 53, 54, 69, 101, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 67, 68, 15, + 0, 16, 0, 0, 0, 0, 70, 0, 0, 71, + 0, 0, 72, 0, 73, 0, 0, 0, 0, 0, + 53, 54, 69, 191, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 15, 0, 16, + 0, 0, 0, 0, 70, 0, 0, 71, 0, 0, + 72, 0, 73, 0, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 0, 71, 0, 0, 72, 0, + 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 108, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 109, 0, 0, 0, 0, 0, 0, 0, 0, + 70, 110, 111, 71, 0, 0, 72, 0, 73, 0, + 0, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 0, 0, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 148, 149, 150, 0, 25, 31, 41, 42, 43, - 44, 59, 129, 165, 167, 168, 175, 22, 24, 48, - 55, 59, 128, 158, 168, 169, 58, 61, 62, 63, - 64, 65, 130, 163, 23, 176, 177, 30, 114, 166, - 176, 49, 50, 51, 155, 103, 58, 20, 47, 129, - 103, 163, 24, 153, 4, 5, 6, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 45, 105, 108, 111, 113, 118, 137, 138, 139, - 140, 141, 158, 172, 29, 113, 164, 128, 180, 103, - 103, 103, 108, 156, 153, 137, 32, 33, 147, 147, - 4, 4, 4, 8, 114, 141, 142, 158, 106, 115, - 35, 46, 56, 57, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 120, - 121, 122, 123, 178, 184, 185, 187, 188, 24, 52, - 53, 154, 4, 24, 157, 139, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 124, 125, 127, - 139, 144, 109, 109, 104, 114, 106, 37, 142, 143, - 139, 174, 56, 8, 174, 9, 21, 10, 11, 12, - 13, 14, 15, 16, 17, 124, 125, 126, 130, 139, - 139, 174, 139, 139, 181, 174, 174, 174, 174, 174, - 174, 174, 174, 139, 139, 139, 174, 130, 89, 90, - 104, 110, 152, 27, 28, 3, 4, 119, 4, 7, - 26, 38, 39, 91, 93, 94, 98, 99, 100, 108, - 111, 113, 116, 120, 121, 122, 123, 145, 172, 151, - 141, 141, 141, 37, 139, 160, 161, 162, 104, 107, - 3, 4, 7, 26, 27, 28, 38, 39, 58, 111, - 145, 171, 172, 173, 173, 173, 173, 137, 104, 132, - 104, 132, 173, 108, 104, 36, 104, 104, 104, 104, - 104, 104, 104, 173, 173, 173, 104, 137, 139, 174, - 24, 104, 135, 106, 106, 106, 106, 106, 106, 110, - 144, 146, 146, 114, 146, 24, 106, 106, 106, 106, - 135, 110, 112, 158, 159, 104, 107, 37, 60, 170, - 146, 104, 104, 173, 15, 54, 15, 104, 186, 173, - 108, 139, 174, 139, 174, 174, 174, 139, 139, 104, - 104, 104, 174, 173, 173, 104, 34, 54, 133, 136, - 144, 144, 144, 144, 144, 144, 104, 110, 112, 114, - 144, 144, 144, 144, 37, 160, 133, 134, 24, 112, - 21, 21, 106, 173, 4, 173, 174, 182, 104, 173, - 104, 104, 104, 173, 173, 173, 106, 139, 24, 4, - 135, 186, 36, 104, 104, 104, 104, 144, 104, 104, - 104, 104, 54, 131, 104, 173, 173, 182, 183, 104, - 132, 132, 104, 173, 104, 174, 174, 174, 183, 173, - 107, 139, 144, 144, 144, 144, 144, 144, 144, 144, - 4, 24, 104, 108, 107, 174, 110, 173, 107, 107, - 104, 107, 104, 104, 107, 107, 107, 107, 21, 110, - 126, 179, 36, 110, 144, 144, 144, 173, 171, 110, - 126, 21, 107, 107, 107, 104, 171, 173, 21, 104, - 70, 173, 21, 21, 173, 173 +static const short yycheck[] = { 30, + 114, 97, 114, 109, 208, 45, 112, 29, 23, 15, + 2, 451, 257, 34, 45, 30, 73, 248, 249, 15, + 104, 104, 115, 112, 104, 58, 115, 110, 134, 469, + 114, 137, 138, 54, 114, 141, 142, 143, 144, 145, + 146, 104, 34, 22, 150, 24, 277, 110, 54, 106, + 10, 11, 12, 13, 14, 15, 16, 17, 54, 152, + 23, 110, 103, 20, 9, 96, 115, 10, 11, 12, + 13, 14, 15, 16, 17, 58, 21, 103, 109, 468, + 24, 112, 4, 75, 41, 42, 43, 44, 106, 478, + 47, 113, 104, 49, 50, 51, 103, 115, 103, 114, + 112, 132, 133, 134, 135, 136, 137, 138, 32, 33, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 178, 227, 367, 180, 181, 182, 104, 52, 53, 103, + 188, 89, 90, 108, 112, 193, 194, 10, 11, 12, + 13, 14, 15, 16, 17, 27, 28, 205, 3, 4, + 110, 106, 210, 184, 61, 62, 63, 64, 65, 3, + 4, 3, 4, 221, 222, 223, 206, 110, 3, 4, + 4, 3, 4, 4, 4, 206, 106, 24, 4, 24, + 0, 109, 109, 106, 56, 225, 4, 391, 294, 393, + 296, 297, 298, 4, 225, 226, 227, 4, 304, 4, + 104, 7, 4, 7, 7, 25, 107, 104, 104, 266, + 108, 31, 104, 36, 104, 311, 312, 313, 314, 315, + 316, 41, 42, 43, 44, 104, 104, 285, 324, 325, + 326, 327, 24, 291, 104, 104, 104, 104, 104, 59, + 104, 106, 24, 106, 106, 106, 106, 305, 306, 106, + 106, 60, 106, 106, 106, 104, 107, 34, 104, 24, + 108, 104, 293, 294, 295, 296, 297, 298, 299, 300, + 262, 21, 21, 304, 4, 104, 104, 104, 374, 104, + 104, 24, 104, 4, 342, 106, 344, 104, 104, 104, + 348, 36, 398, 399, 400, 54, 106, 4, 24, 357, + 358, 359, 333, 104, 104, 104, 104, 104, 104, 104, + 104, 104, 54, 104, 345, 411, 412, 413, 414, 104, + 416, 417, 418, 419, 430, 104, 107, 107, 104, 107, + 388, 389, 363, 108, 107, 104, 110, 451, 396, 451, + 107, 104, 104, 107, 21, 36, 107, 405, 21, 107, + 107, 104, 107, 107, 110, 469, 107, 469, 21, 390, + 193, 194, 458, 104, 460, 461, 70, 398, 399, 400, + 21, 21, 205, 404, 432, 0, 0, 210, 34, 410, + 85, 20, 85, 85, 85, 334, 106, 47, 221, 222, + 223, 20, 178, 22, 333, 24, 44, 23, 2, 430, + 14, 404, 31, 32, 33, 345, 368, -1, 466, -1, + 5, 6, 41, 42, 43, 44, -1, -1, 47, 48, + -1, 479, -1, -1, -1, -1, 55, 22, 486, 24, + 59, 26, 490, 491, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 38, 39, -1, -1, -1, -1, -1, + -1, -1, 285, -1, -1, -1, -1, -1, 291, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 305, 306, -1, -1, -1, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, -1, -1, -1, -1, -1, 91, -1, 93, 94, + 95, 96, -1, 98, 99, 100, -1, -1, -1, 342, + -1, 344, -1, 108, -1, 348, 111, -1, 113, -1, + -1, 116, -1, -1, 357, 358, 359, -1, 5, 6, + -1, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, -1, 24, -1, -1, + -1, -1, -1, -1, -1, 388, 389, -1, -1, -1, + -1, -1, -1, 396, -1, -1, -1, -1, 45, -1, + 5, 6, 405, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 45, -1, -1, -1, -1, -1, -1, -1, -1, 3, + 4, 5, 6, 7, -1, -1, -1, -1, 105, -1, + -1, 108, -1, 466, 111, -1, 113, 114, 22, -1, + 24, -1, 26, 27, 28, -1, 479, -1, -1, -1, + -1, -1, -1, 486, 38, 39, -1, 490, 491, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 105, -1, -1, 108, 58, -1, 111, -1, 113, 114, + -1, -1, -1, -1, -1, -1, -1, -1, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, -1, -1, -1, -1, -1, 91, -1, 93, + 94, 95, 96, -1, 98, 99, 100, 3, 4, -1, + -1, 7, -1, -1, -1, -1, -1, 111, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 26, 27, 28, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 38, 39, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + -1, -1, -1, -1, -1, 91, -1, 93, 94, 95, + 96, -1, 98, 99, 100, -1, -1, -1, -1, -1, + -1, -1, -1, 5, 6, 111, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, -1, 24, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, + -1, 5, 6, 45, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, + 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 37, -1, -1, -1, -1, -1, 5, + 6, 45, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, -1, 24, -1, + -1, -1, -1, 105, -1, -1, 108, -1, -1, 111, + -1, 113, -1, -1, -1, -1, -1, -1, -1, 45, + 5, 6, -1, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, + -1, 105, -1, -1, 108, -1, -1, 111, -1, 113, + -1, -1, 37, -1, -1, -1, -1, -1, 5, 6, + 45, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, -1, 24, -1, 105, + -1, -1, 108, -1, 110, 111, -1, 113, -1, -1, + 37, -1, -1, -1, -1, -1, 5, 6, 45, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, -1, 24, -1, -1, -1, -1, + 105, -1, -1, 108, -1, -1, 111, -1, 113, -1, + -1, -1, -1, -1, 5, 6, 45, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, -1, 24, -1, -1, -1, -1, 105, -1, + -1, 108, -1, -1, 111, -1, 113, -1, -1, -1, + -1, -1, 5, 6, 45, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + -1, 24, -1, -1, -1, -1, 105, -1, -1, 108, + -1, -1, 111, -1, 113, -1, -1, -1, -1, -1, + 5, 6, 45, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, + -1, -1, -1, -1, 105, -1, -1, 108, -1, -1, + 111, -1, 113, -1, -1, -1, -1, -1, -1, -1, + 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 105, -1, -1, 108, -1, -1, 111, -1, + 113, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, + 105, 56, 57, 108, -1, -1, 111, -1, 113, -1, + -1, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, -1, -1, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102 }; +/* -*-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. + + 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., 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); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ + { 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 (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 (0) +#ifndef YYPURE +#define YYLEX yylex() #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 +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) #endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - +#else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) +#define YYLEX yylex(&yylval, YYLEX_PARAM) #else -# define YYLEX yylex () +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ #endif -/* Enable debugging if requested. */ -#if YYDEBUG +/* If nonreentrant, generate the variables here */ -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) +#ifndef YYPURE -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ #endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - 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 yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (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. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# 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. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - 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) +/* 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 (*yystr == '"') - { - size_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); + register char *f = from; + register char *t = to; + register int i = count; - return yystpcpy (yyres, yystr) - yyres; + while (i-- > 0) + *t++ = *f++; } -# endif - -#endif /* YYERROR_VERBOSE */ - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +#else /* __cplusplus */ -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +__yy_memcpy (char *to, char *from, unsigned int count) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - + register char *t = to; + register char *f = from; + register int i = count; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); + while (i-- > 0) + *t++ = *f++; } -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -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 -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} +#endif +#line 217 "/usr/share/bison.simple" -/* Prevent warnings from -Wmissing-prototypes. */ +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# 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. | -`----------*/ +#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) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) -int -yyparse (void) +int yyparse (void *); #else -int -yyparse () - +int yyparse (void); #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; - - /* 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. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - +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--) +#else #define YYPOPSTACK (yyvsp--, yyssp--) +#endif - YYSIZE_T yystacksize = YYINITDEPTH; + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ int yylen; - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -2654,721 +2024,719 @@ 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++; - - yysetstate: - *yyssp = yystate; +/* 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: + + *++yyssp = yystate; + + 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 - if (yyss + yystacksize - 1 <= yyssp) - { /* 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; - short int *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; - - { - short int *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 look-ahead token if we need one and don't already have one. */ +/* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead 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; - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* 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'. +#if YYDEBUG != 0 + if (yydebug) + { + int i; - 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]; + 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 - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 3: -#line 1028 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range! + + switch (yyn) { + +case 2: +#line 1031 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].UIntVal > (uint32_t)INT32_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); - (yyval.SIntVal) = (int32_t)(yyvsp[0].UIntVal); + yyval.SIntVal = (int32_t)yyvsp[0].UIntVal; CHECK_FOR_ERROR -;} - break; - - case 5: -#line 1037 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range! +; + break;} +case 4: +#line 1040 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].UInt64Val > (uint64_t)INT64_MAX) // Outside of my range! GEN_ERROR("Value too large for type!"); - (yyval.SInt64Val) = (int64_t)(yyvsp[0].UInt64Val); + yyval.SInt64Val = (int64_t)yyvsp[0].UInt64Val; CHECK_FOR_ERROR -;} - break; - - case 34: -#line 1061 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = (yyvsp[-1].StrVal); +; + break;} +case 33: +#line 1064 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = yyvsp[-1].StrVal; CHECK_FOR_ERROR - ;} - break; - - case 35: -#line 1065 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.StrVal) = 0; + ; + break;} +case 34: +#line 1068 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.StrVal = 0; CHECK_FOR_ERROR - ;} - break; - - case 36: -#line 1070 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::InternalLinkage; ;} - break; - - case 37: -#line 1071 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;} - break; - - case 38: -#line 1072 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::WeakLinkage; ;} - break; - - case 39: -#line 1073 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;} - break; - - case 40: -#line 1074 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;} - break; - - case 41: -#line 1076 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 42: -#line 1077 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::C; ;} - break; - - case 43: -#line 1078 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::CSRet; ;} - break; - - case 44: -#line 1079 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Fast; ;} - break; - - case 45: -#line 1080 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = CallingConv::Cold; ;} - break; - - case 46: -#line 1081 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val)) + ; + break;} +case 35: +#line 1073 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::InternalLinkage; ; + break;} +case 36: +#line 1074 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::LinkOnceLinkage; ; + break;} +case 37: +#line 1075 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::WeakLinkage; ; + break;} +case 38: +#line 1076 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::AppendingLinkage; ; + break;} +case 39: +#line 1077 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.Linkage = GlobalValue::ExternalLinkage; ; + break;} +case 40: +#line 1079 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 41: +#line 1080 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::C; ; + break;} +case 42: +#line 1081 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::CSRet; ; + break;} +case 43: +#line 1082 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Fast; ; + break;} +case 44: +#line 1083 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = CallingConv::Cold; ; + break;} +case 45: +#line 1084 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if ((unsigned)yyvsp[0].UInt64Val != yyvsp[0].UInt64Val) GEN_ERROR("Calling conv too large!"); - (yyval.UIntVal) = (yyvsp[0].UInt64Val); + yyval.UIntVal = yyvsp[0].UInt64Val; CHECK_FOR_ERROR - ;} - break; - - case 47: -#line 1090 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 48: -#line 1091 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) + ; + break;} +case 46: +#line 1093 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 47: +#line 1094 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two!"); CHECK_FOR_ERROR -;} - break; - - case 49: -#line 1097 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.UIntVal) = 0; ;} - break; - - case 50: -#line 1098 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.UIntVal) = (yyvsp[0].UInt64Val); - if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal))) +; + break;} +case 48: +#line 1100 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.UIntVal = 0; ; + break;} +case 49: +#line 1101 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.UIntVal = yyvsp[0].UInt64Val; + if (yyval.UIntVal != 0 && !isPowerOf2_32(yyval.UIntVal)) GEN_ERROR("Alignment must be a power of two!"); CHECK_FOR_ERROR -;} - break; - - case 51: -#line 1106 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i) - if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\') +; + break;} +case 50: +#line 1109 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + for (unsigned i = 0, e = strlen(yyvsp[0].StrVal); i != e; ++i) + if (yyvsp[0].StrVal[i] == '"' || yyvsp[0].StrVal[i] == '\\') GEN_ERROR("Invalid character in section name!"); - (yyval.StrVal) = (yyvsp[0].StrVal); + yyval.StrVal = yyvsp[0].StrVal; CHECK_FOR_ERROR -;} - break; - - case 52: -#line 1114 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = 0; ;} - break; - - case 53: -#line 1115 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.StrVal) = (yyvsp[0].StrVal); ;} - break; - - case 54: -#line 1120 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 55: -#line 1121 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - {;} - break; - - case 56: -#line 1122 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - CurGV->setSection((yyvsp[0].StrVal)); - free((yyvsp[0].StrVal)); +; + break;} +case 51: +#line 1117 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = 0; ; + break;} +case 52: +#line 1118 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.StrVal = yyvsp[0].StrVal; ; + break;} +case 53: +#line 1123 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 54: +#line 1124 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{; + break;} +case 55: +#line 1125 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + CurGV->setSection(yyvsp[0].StrVal); + free(yyvsp[0].StrVal); CHECK_FOR_ERROR - ;} - break; - - case 57: -#line 1127 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val))) + ; + break;} +case 56: +#line 1130 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + if (yyvsp[0].UInt64Val != 0 && !isPowerOf2_32(yyvsp[0].UInt64Val)) GEN_ERROR("Alignment must be a power of two!"); - CurGV->setAlignment((yyvsp[0].UInt64Val)); + CurGV->setAlignment(yyvsp[0].UInt64Val); CHECK_FOR_ERROR - ;} - break; - - case 59: -#line 1141 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} - break; - - case 61: -#line 1142 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;} - break; - - case 62: -#line 1144 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { + ; + break;} +case 58: +#line 1144 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ; + break;} +case 60: +#line 1145 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); ; + break;} +case 61: +#line 1147 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ if (!UpRefs.empty()) - GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription()); - (yyval.TypeVal) = (yyvsp[0].TypeVal); + GEN_ERROR("Invalid upreference in type: " + (*yyvsp[0].TypeVal)->getDescription()); + yyval.TypeVal = yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 76: -#line 1156 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder(OpaqueType::get()); + ; + break;} +case 75: +#line 1159 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(OpaqueType::get()); CHECK_FOR_ERROR - ;} - break; - - case 77: -#line 1160 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); + ; + break;} +case 76: +#line 1163 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeVal = new PATypeHolder(yyvsp[0].PrimType); CHECK_FOR_ERROR - ;} - break; - - case 78: -#line 1164 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Named types are also simple types... - (yyval.TypeVal) = new PATypeHolder(getTypeVal((yyvsp[0].ValIDVal))); + ; + break;} +case 77: +#line 1167 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Named types are also simple types... + yyval.TypeVal = new PATypeHolder(getTypeVal(yyvsp[0].ValIDVal)); CHECK_FOR_ERROR -;} - break; - - case 79: -#line 1171 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Type UpReference - if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!"); +; + break;} +case 78: +#line 1174 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Type UpReference + if (yyvsp[0].UInt64Val > (uint64_t)~0U) GEN_ERROR("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder - UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].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 80: -#line 1179 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Function derived type? + ; + break;} +case 79: +#line 1182 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Function derived type? std::vector Params; - for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), - E = (yyvsp[-1].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-1].TypeList->begin(), + E = yyvsp[-1].TypeList->end(); I != E; ++I) Params.push_back(*I); bool isVarArg = Params.size() && Params.back() == Type::VoidTy; if (isVarArg) Params.pop_back(); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(FunctionType::get(*(yyvsp[-3].TypeVal),Params,isVarArg))); - delete (yyvsp[-1].TypeList); // Delete the argument list - delete (yyvsp[-3].TypeVal); // Delete the return type handle - CHECK_FOR_ERROR - ;} - break; - - case 81: -#line 1192 "/proj/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 82: -#line 1197 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Packed array type? - const llvm::Type* ElemTy = (yyvsp[-1].TypeVal)->get(); - if ((unsigned)(yyvsp[-3].UInt64Val) != (yyvsp[-3].UInt64Val)) + yyval.TypeVal = new PATypeHolder(HandleUpRefs(FunctionType::get(*yyvsp[-3].TypeVal,Params,isVarArg))); + delete yyvsp[-1].TypeList; // Delete the argument list + delete yyvsp[-3].TypeVal; // Delete the return type handle + CHECK_FOR_ERROR + ; + break;} +case 80: +#line 1195 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Sized array type? + yyval.TypeVal = new PATypeHolder(HandleUpRefs(ArrayType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 81: +#line 1200 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Packed array type? + const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); + if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) GEN_ERROR("Unsigned result not equal to signed result"); if (!ElemTy->isPrimitiveType()) GEN_ERROR("Elemental type of a PackedType must be primitive"); - if (!isPowerOf2_32((yyvsp[-3].UInt64Val))) + if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) GEN_ERROR("Vector length should be a power of 2!"); - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PackedType::get(*(yyvsp[-1].TypeVal), (unsigned)(yyvsp[-3].UInt64Val)))); - delete (yyvsp[-1].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PackedType::get(*yyvsp[-1].TypeVal, (unsigned)yyvsp[-3].UInt64Val))); + delete yyvsp[-1].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 83: -#line 1209 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Structure type? + ; + break;} +case 82: +#line 1212 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Structure type? std::vector Elements; - for (std::list::iterator I = (yyvsp[-1].TypeList)->begin(), - E = (yyvsp[-1].TypeList)->end(); I != E; ++I) + for (std::list::iterator I = yyvsp[-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[-1].TypeList); - CHECK_FOR_ERROR - ;} - break; - - case 84: -#line 1219 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Empty structure type? - (yyval.TypeVal) = new PATypeHolder(StructType::get(std::vector())); - CHECK_FOR_ERROR - ;} - break; - - case 85: -#line 1223 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Pointer type? - (yyval.TypeVal) = new PATypeHolder(HandleUpRefs(PointerType::get(*(yyvsp[-1].TypeVal)))); - delete (yyvsp[-1].TypeVal); + yyval.TypeVal = new PATypeHolder(HandleUpRefs(StructType::get(Elements))); + delete yyvsp[-1].TypeList; CHECK_FOR_ERROR - ;} - break; - - case 86: -#line 1232 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeList) = new std::list(); - (yyval.TypeList)->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); + ; + break;} +case 83: +#line 1222 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Empty structure type? + yyval.TypeVal = new PATypeHolder(StructType::get(std::vector())); + CHECK_FOR_ERROR + ; + break;} +case 84: +#line 1226 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Pointer type? + yyval.TypeVal = new PATypeHolder(HandleUpRefs(PointerType::get(*yyvsp[-1].TypeVal))); + delete yyvsp[-1].TypeVal; + CHECK_FOR_ERROR + ; + break;} +case 85: +#line 1235 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeList = new std::list(); + yyval.TypeList->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 87: -#line 1237 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(*(yyvsp[0].TypeVal)); delete (yyvsp[0].TypeVal); + ; + break;} +case 86: +#line 1240 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(*yyvsp[0].TypeVal); delete yyvsp[0].TypeVal; CHECK_FOR_ERROR - ;} - break; - - case 89: -#line 1244 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList)=(yyvsp[-2].TypeList))->push_back(Type::VoidTy); + ; + break;} +case 88: +#line 1247 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList=yyvsp[-2].TypeList)->push_back(Type::VoidTy); CHECK_FOR_ERROR - ;} - break; - - case 90: -#line 1248 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - ((yyval.TypeList) = new std::list())->push_back(Type::VoidTy); + ; + break;} +case 89: +#line 1251 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + (yyval.TypeList = new std::list())->push_back(Type::VoidTy); CHECK_FOR_ERROR - ;} - break; - - case 91: -#line 1252 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { - (yyval.TypeList) = new std::list(); + ; + break;} +case 90: +#line 1255 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ + yyval.TypeList = new std::list(); CHECK_FOR_ERROR - ;} - break; - - case 92: -#line 1263 "/proj/llvm/llvm/lib/AsmParser/llvmAsmParser.y" - { // Nonempty unsized arr - const ArrayType *ATy = dyn_cast((yyvsp[-3].TypeVal)->get()); + ; + break;} +case 91: +#line 1266 "/Volumes/ProjectsDisk/cvs/llvm/lib/AsmParser/llvmAsmParser.y" +{ // Nonempty unsized arr +