--- Reverse-merging r80147 into '.':
authorBill Wendling <isanbard@gmail.com>
Thu, 27 Aug 2009 03:29:26 +0000 (03:29 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 27 Aug 2009 03:29:26 +0000 (03:29 +0000)
A    include/llvm/ADT/iterator.cmake
U    autoconf/configure.ac
--- Reverse-merging r80161 into '.':
U    cmake/config-ix.cmake
--- Reverse-merging r80171 into '.':
U    Makefile
--- Reverse-merging r80173 into '.':
U    configure
U    include/llvm/Config/config.h.in
--- Reverse-merging r80180 into '.':
A    include/llvm/ADT/iterator.h.in

Despite common miscomceptions, iterator.h is alive and well. It broke the build
bots for several hours. And yet no one bothered to look at them.

Gabor and Doug, please review your changes and make sure that they actually
build before resubmitting them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80197 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile
autoconf/configure.ac
cmake/config-ix.cmake
configure
include/llvm/ADT/iterator.cmake [new file with mode: 0644]
include/llvm/ADT/iterator.h.in [new file with mode: 0644]
include/llvm/CodeGen/AsmPrinter.h
include/llvm/Config/config.h.in
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/DwarfException.cpp

index 5d10f8e237f1ea3448444c16ce10acc75b2f34cb..700b02d02e83ed6f1916357bd6de78e454814781 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -117,6 +117,7 @@ debug-opt-prof:
 dist-hook::
        $(Echo) Eliminating files constructed by configure
        $(Verb) $(RM) -f \
+         $(TopDistDir)/include/llvm/ADT/iterator.h  \
          $(TopDistDir)/include/llvm/Config/config.h  \
          $(TopDistDir)/include/llvm/Support/DataTypes.h  \
          $(TopDistDir)/include/llvm/Support/ThreadSupport.h
@@ -135,7 +136,8 @@ FilesToConfig := \
   include/llvm/Config/config.h \
   include/llvm/Config/Targets.def \
        include/llvm/Config/AsmPrinters.def \
-  include/llvm/Support/DataTypes.h
+  include/llvm/Support/DataTypes.h \
+  include/llvm/ADT/iterator.h
 FilesToConfigPATH  := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
 
 all-local:: $(FilesToConfigPATH)
index 49ab0376ef3430b59f30c01e09a0daac9fbbc204..173341a054cfec40a334ecaa0ec454b3d4644780 100644 (file)
@@ -1314,6 +1314,7 @@ AC_CONFIG_FILES([include/llvm/Config/Targets.def])
 AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def])
 AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def])
 AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
+AC_CONFIG_HEADERS([include/llvm/ADT/iterator.h])
 
 dnl Configure the makefile's configuration data
 AC_CONFIG_FILES([Makefile.config])
index 85f947087451d7d1d52a41cd7af83e7f00fbe8cc..52025a9ee2c12ecf41fdf5c4e8759d2679f0cc7d 100755 (executable)
@@ -180,6 +180,11 @@ configure_file(
   ${LLVM_BINARY_DIR}/include/llvm/Config/config.h
   )
 
+configure_file(
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT/iterator.cmake
+  ${LLVM_BINARY_DIR}/include/llvm/ADT/iterator.h
+  )
+
 configure_file(
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake
   ${LLVM_BINARY_DIR}/include/llvm/Support/DataTypes.h
index bc46356bcfcbedcb9d197b4f01b8a8469eb63d82..64566fbb1b7f114ab1fe80a4001bd2cd28932981 100755 (executable)
--- a/configure
+++ b/configure
@@ -834,6 +834,7 @@ CVSBUILD
 ENABLE_OPTIMIZED
 ENABLE_PROFILING
 DISABLE_ASSERTIONS
+LLVM_COMPACT_SENTINELS
 ENABLE_EXPENSIVE_CHECKS
 EXPENSIVE_CHECKS
 DEBUG_RUNTIME
@@ -4845,6 +4846,21 @@ else
 
 fi
 
+if test ${ENABLE_OPTIMIZED},${DISABLE_ASSERTIONS} = "ENABLE_OPTIMIZED=1,DISABLE_ASSERTIONS=1" ; then
+  LLVM_COMPACT_SENTINELS=1
+
+else
+  LLVM_COMPACT_SENTINELS=0
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define LLVM_COMPACT_SENTINELS $LLVM_COMPACT_SENTINELS
+_ACEOF
+
+
+
 # Check whether --enable-expensive-checks was given.
 if test "${enable_expensive_checks+set}" = set; then
   enableval=$enable_expensive_checks;
@@ -10972,7 +10988,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 10975 "configure"
+#line 10991 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13116,7 +13132,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 13119 "configure"' > conftest.$ac_ext
+  echo '#line 13135 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -14834,11 +14850,11 @@ else
    -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:14837: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14853: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14841: \$? = $ac_status" >&5
+   echo "$as_me:14857: \$? = $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.
@@ -15102,11 +15118,11 @@ else
    -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:15105: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15121: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15109: \$? = $ac_status" >&5
+   echo "$as_me:15125: \$? = $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.
@@ -15206,11 +15222,11 @@ else
    -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:15209: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15225: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15213: \$? = $ac_status" >&5
+   echo "$as_me:15229: \$? = $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
@@ -17658,7 +17674,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17661 "configure"
+#line 17677 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17758,7 +17774,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17761 "configure"
+#line 17777 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -20126,11 +20142,11 @@ else
    -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:20129: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:20145: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:20133: \$? = $ac_status" >&5
+   echo "$as_me:20149: \$? = $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.
@@ -20230,11 +20246,11 @@ else
    -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:20233: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:20249: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:20237: \$? = $ac_status" >&5
+   echo "$as_me:20253: \$? = $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
@@ -21800,11 +21816,11 @@ else
    -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:21803: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21819: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:21807: \$? = $ac_status" >&5
+   echo "$as_me:21823: \$? = $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.
@@ -21904,11 +21920,11 @@ else
    -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:21907: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21923: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:21911: \$? = $ac_status" >&5
+   echo "$as_me:21927: \$? = $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
@@ -24139,11 +24155,11 @@ else
    -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:24142: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:24158: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:24146: \$? = $ac_status" >&5
+   echo "$as_me:24162: \$? = $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.
@@ -24407,11 +24423,11 @@ else
    -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:24410: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:24426: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:24414: \$? = $ac_status" >&5
+   echo "$as_me:24430: \$? = $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.
@@ -24511,11 +24527,11 @@ else
    -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:24514: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:24530: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:24518: \$? = $ac_status" >&5
+   echo "$as_me:24534: \$? = $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
@@ -35300,6 +35316,8 @@ ac_config_files="$ac_config_files include/llvm/Config/AsmParsers.def"
 
 ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h"
 
+ac_config_headers="$ac_config_headers include/llvm/ADT/iterator.h"
+
 
 ac_config_files="$ac_config_files Makefile.config"
 
@@ -35926,6 +35944,7 @@ do
     "include/llvm/Config/AsmPrinters.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmPrinters.def" ;;
     "include/llvm/Config/AsmParsers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmParsers.def" ;;
     "include/llvm/Support/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Support/DataTypes.h" ;;
+    "include/llvm/ADT/iterator.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator.h" ;;
     "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" ;;
@@ -36085,6 +36104,7 @@ CVSBUILD!$CVSBUILD$ac_delim
 ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
 ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
 DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
+LLVM_COMPACT_SENTINELS!$LLVM_COMPACT_SENTINELS$ac_delim
 ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
 EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
 DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
@@ -36103,7 +36123,6 @@ BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim
 ENABLE_LLVMC_DYNAMIC!$ENABLE_LLVMC_DYNAMIC$ac_delim
 ENABLE_LLVMC_DYNAMIC_PLUGINS!$ENABLE_LLVMC_DYNAMIC_PLUGINS$ac_delim
 CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -36145,6 +36164,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+CXXFLAGS!$CXXFLAGS$ac_delim
 ac_ct_CXX!$ac_ct_CXX$ac_delim
 NM!$NM$ac_delim
 ifGNUmake!$ifGNUmake$ac_delim
@@ -36238,7 +36258,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 92; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/include/llvm/ADT/iterator.cmake b/include/llvm/ADT/iterator.cmake
new file mode 100644 (file)
index 0000000..55df8ce
--- /dev/null
@@ -0,0 +1,79 @@
+//===-- llvm/ADT/iterator - Portable wrapper around <iterator> --*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides a wrapper around the mysterious <iterator> header file.
+// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
+// friends), instead of the standard iterator class.  In GCC 3.1, the
+// bidirectional_iterator class got moved out and the new, standards compliant,
+// iterator<> class was added.  Because there is nothing that we can do to get
+// correct behavior on both compilers, we have this header with #ifdef's.  Gross
+// huh?
+//
+// By #includ'ing this file, you get the contents of <iterator> plus the
+// following classes in the global namespace:
+//
+//   1. bidirectional_iterator
+//   2. forward_iterator
+//
+// The #if directives' expressions are filled in by Autoconf.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_ITERATOR
+#define LLVM_ADT_ITERATOR
+
+#include <iterator>
+
+#undef HAVE_BI_ITERATOR
+#undef HAVE_STD_ITERATOR
+#undef HAVE_FWD_ITERATOR
+
+// defined by Kevin
+#define HAVE_STD_ITERATOR 1
+
+#ifdef _MSC_VER
+#  define HAVE_BI_ITERATOR 0
+#  define HAVE_STD_ITERATOR 1
+#  define HAVE_FWD_ITERATOR 0
+#endif
+
+#if !HAVE_BI_ITERATOR
+# if HAVE_STD_ITERATOR
+/// If the bidirectional iterator is not defined, we attempt to define it in
+/// terms of the C++ standard iterator. Otherwise, we import it with a "using"
+/// statement.
+///
+template<class Ty, class PtrDiffTy>
+struct bidirectional_iterator
+  : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
+};
+# else
+#  error "Need to have standard iterator to define bidirectional iterator!"
+# endif
+#else
+using std::bidirectional_iterator;
+#endif
+
+#if !HAVE_FWD_ITERATOR
+# if HAVE_STD_ITERATOR
+/// If the forward iterator is not defined, attempt to define it in terms of
+/// the C++ standard iterator. Otherwise, we import it with a "using" statement.
+///
+template<class Ty, class PtrDiffTy>
+struct forward_iterator
+  : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
+};
+# else
+#  error "Need to have standard iterator to define forward iterator!"
+# endif
+#else
+using std::forward_iterator;
+#endif
+
+#endif
diff --git a/include/llvm/ADT/iterator.h.in b/include/llvm/ADT/iterator.h.in
new file mode 100644 (file)
index 0000000..dce7462
--- /dev/null
@@ -0,0 +1,76 @@
+//==-- llvm/ADT/iterator.h - Portable wrapper around <iterator> --*- C++ -*-==//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides a wrapper around the mysterious <iterator> header file.
+// In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
+// friends), instead of the standard iterator class.  In GCC 3.1, the
+// bidirectional_iterator class got moved out and the new, standards compliant,
+// iterator<> class was added.  Because there is nothing that we can do to get
+// correct behavior on both compilers, we have this header with #ifdef's.  Gross
+// huh?
+//
+// By #includ'ing this file, you get the contents of <iterator> plus the
+// following classes in the global namespace:
+//
+//   1. bidirectional_iterator
+//   2. forward_iterator
+//
+// The #if directives' expressions are filled in by Autoconf.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_ITERATOR_H
+#define LLVM_ADT_ITERATOR_H
+
+#include <iterator>
+
+#undef HAVE_BI_ITERATOR
+#undef HAVE_STD_ITERATOR
+#undef HAVE_FWD_ITERATOR
+
+#ifdef _MSC_VER
+#  define HAVE_BI_ITERATOR 0
+#  define HAVE_STD_ITERATOR 1
+#  define HAVE_FWD_ITERATOR 0
+#endif
+
+#if !HAVE_BI_ITERATOR
+# if HAVE_STD_ITERATOR
+/// If the bidirectional iterator is not defined, we attempt to define it in
+/// terms of the C++ standard iterator. Otherwise, we import it with a "using"
+/// statement.
+///
+template<class Ty, class PtrDiffTy>
+struct bidirectional_iterator
+  : public std::iterator<std::bidirectional_iterator_tag, Ty, PtrDiffTy> {
+};
+# else
+#  error "Need to have standard iterator to define bidirectional iterator!"
+# endif
+#else
+using std::bidirectional_iterator;
+#endif
+
+#if !HAVE_FWD_ITERATOR
+# if HAVE_STD_ITERATOR
+/// If the forward iterator is not defined, attempt to define it in terms of
+/// the C++ standard iterator. Otherwise, we import it with a "using" statement.
+///
+template<class Ty, class PtrDiffTy>
+struct forward_iterator
+  : public std::iterator<std::forward_iterator_tag, Ty, PtrDiffTy> {
+};
+# else
+#  error "Need to have standard iterator to define forward iterator!"
+# endif
+#else
+using std::forward_iterator;
+#endif
+
+#endif // LLVM_ADT_ITERATOR_H
index 55fc3b0da86b658f5801e6e7bd00ecc5a0605aa1..6832d01399f6aa9c55710e770ff6c3bd71707048 100644 (file)
@@ -268,6 +268,8 @@ namespace llvm {
     void EOL() const;
     void EOL(const std::string &Comment) const;
     void EOL(const char* Comment) const;
+    void EOL(const std::string &Comment, unsigned DatFormat) const;
+    void EOL(const char* Comment, unsigned DataFormat) const;
     
     /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
     /// unsigned leb128 value.
index f32f4038ffaea3e1c2e589a956ae65593c38907c..6a28326cdff3bc4becbc5c46cf4f639df0eca8b4 100644 (file)
@@ -3,14 +3,6 @@
 /* Define if dlopen(0) will open the symbols of the program */
 #undef CAN_DLOPEN_SELF
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
 /* Define if CBE is enabled for printf %a output */
 #undef ENABLE_CBE_PRINTF_A
 
 /* Define if threads enabled */
 #undef ENABLE_THREADS
 
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-#undef HAVE_ALLOCA_H
-
 /* Define to 1 if you have the `argz_append' function. */
 #undef HAVE_ARGZ_APPEND
 
 /* Installation directory for binary executables */
 #undef LLVM_BINDIR
 
+/* Define to 1 for ilist sentinel compaction */
+#undef LLVM_COMPACT_SENTINELS
+
 /* Time at which LLVM was configured */
 #undef LLVM_CONFIGTIME
 
index c8099c8b18880dfe92e9aca5f1df66efcbe278f7..6b773c2e0208f91f8702962d60eadbdafdd51602 100644 (file)
@@ -604,6 +604,186 @@ void AsmPrinter::EOL(const char* Comment) const {
   O << '\n';
 }
 
+static const char *GetDataFormatName(unsigned DataFormat) {
+#ifndef HAVE_DESIGNATED_INITIALIZERS
+#define HAVE_DESIGNATED_INITIALIZERS                \
+  ((!defined(__cplusplus) && (GCC_VERSION >= 2007)) \
+   || (__STDC_VERSION__ >= 199901L))
+#endif
+
+#if HAVE_DESIGNATED_INITIALIZERS
+#define S(p, v)  [p] = v,
+#else
+#define S(p, v)  case p: return v;
+#endif
+
+#if HAVE_DESIGNATED_INITIALIZERS
+  __extension__ static const char * const FormatNames[256] = {
+#else
+  switch (DataFormat) {
+#endif
+
+  S(dwarf::DW_EH_PE_absptr,  "absolute")
+  S(dwarf::DW_EH_PE_omit,    "omit")
+  S(dwarf::DW_EH_PE_aligned, "aligned absolute")
+
+  S(dwarf::DW_EH_PE_uleb128, "uleb128")
+  S(dwarf::DW_EH_PE_udata2,  "udata2")
+  S(dwarf::DW_EH_PE_udata4,  "udata4")
+  S(dwarf::DW_EH_PE_udata8,  "udata8")
+  S(dwarf::DW_EH_PE_sleb128, "sleb128")
+  S(dwarf::DW_EH_PE_sdata2,  "sdata2")
+  S(dwarf::DW_EH_PE_sdata4,  "sdata4")
+  S(dwarf::DW_EH_PE_sdata8,  "sdata8")
+
+  S(dwarf::DW_EH_PE_absptr  | dwarf::DW_EH_PE_pcrel,   "pcrel")
+  S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_pcrel,   "pcrel uleb128")
+  S(dwarf::DW_EH_PE_udata2  | dwarf::DW_EH_PE_pcrel,   "pcrel udata2")
+  S(dwarf::DW_EH_PE_udata4  | dwarf::DW_EH_PE_pcrel,   "pcrel udata4")
+  S(dwarf::DW_EH_PE_udata8  | dwarf::DW_EH_PE_pcrel,   "pcrel udata8")
+  S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_pcrel,   "pcrel sleb128")
+  S(dwarf::DW_EH_PE_sdata2  | dwarf::DW_EH_PE_pcrel,   "pcrel sdata2")
+  S(dwarf::DW_EH_PE_sdata4  | dwarf::DW_EH_PE_pcrel,   "pcrel sdata4")
+  S(dwarf::DW_EH_PE_sdata8  | dwarf::DW_EH_PE_pcrel,   "pcrel sdata8")
+
+  S(dwarf::DW_EH_PE_absptr  | dwarf::DW_EH_PE_textrel, "textrel")
+  S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_textrel, "textrel uleb128")
+  S(dwarf::DW_EH_PE_udata2  | dwarf::DW_EH_PE_textrel, "textrel udata2")
+  S(dwarf::DW_EH_PE_udata4  | dwarf::DW_EH_PE_textrel, "textrel udata4")
+  S(dwarf::DW_EH_PE_udata8  | dwarf::DW_EH_PE_textrel, "textrel udata8")
+  S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_textrel, "textrel sleb128")
+  S(dwarf::DW_EH_PE_sdata2  | dwarf::DW_EH_PE_textrel, "textrel sdata2")
+  S(dwarf::DW_EH_PE_sdata4  | dwarf::DW_EH_PE_textrel, "textrel sdata4")
+  S(dwarf::DW_EH_PE_sdata8  | dwarf::DW_EH_PE_textrel, "textrel sdata8")
+
+  S(dwarf::DW_EH_PE_absptr  | dwarf::DW_EH_PE_datarel, "datarel")
+  S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_datarel, "datarel uleb128")
+  S(dwarf::DW_EH_PE_udata2  | dwarf::DW_EH_PE_datarel, "datarel udata2")
+  S(dwarf::DW_EH_PE_udata4  | dwarf::DW_EH_PE_datarel, "datarel udata4")
+  S(dwarf::DW_EH_PE_udata8  | dwarf::DW_EH_PE_datarel, "datarel udata8")
+  S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_datarel, "datarel sleb128")
+  S(dwarf::DW_EH_PE_sdata2  | dwarf::DW_EH_PE_datarel, "datarel sdata2")
+  S(dwarf::DW_EH_PE_sdata4  | dwarf::DW_EH_PE_datarel, "datarel sdata4")
+  S(dwarf::DW_EH_PE_sdata8  | dwarf::DW_EH_PE_datarel, "datarel sdata8")
+
+  S(dwarf::DW_EH_PE_absptr  | dwarf::DW_EH_PE_funcrel, "funcrel")
+  S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_funcrel, "funcrel uleb128")
+  S(dwarf::DW_EH_PE_udata2  | dwarf::DW_EH_PE_funcrel, "funcrel udata2")
+  S(dwarf::DW_EH_PE_udata4  | dwarf::DW_EH_PE_funcrel, "funcrel udata4")
+  S(dwarf::DW_EH_PE_udata8  | dwarf::DW_EH_PE_funcrel, "funcrel udata8")
+  S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_funcrel, "funcrel sleb128")
+  S(dwarf::DW_EH_PE_sdata2  | dwarf::DW_EH_PE_funcrel, "funcrel sdata2")
+  S(dwarf::DW_EH_PE_sdata4  | dwarf::DW_EH_PE_funcrel, "funcrel sdata4")
+  S(dwarf::DW_EH_PE_sdata8  | dwarf::DW_EH_PE_funcrel, "funcrel sdata8")
+
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr  |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel uleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2  |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel udata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4  |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel udata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8  |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel udata8")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel sleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2  |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel sdata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4  |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel sdata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8  |dwarf::DW_EH_PE_pcrel,
+    "indirect pcrel sdata8")
+
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr  |dwarf::DW_EH_PE_textrel,
+    "indirect textrel")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_textrel,
+    "indirect textrel uleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2  |dwarf::DW_EH_PE_textrel,
+    "indirect textrel udata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4  |dwarf::DW_EH_PE_textrel,
+    "indirect textrel udata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8  |dwarf::DW_EH_PE_textrel,
+    "indirect textrel udata8")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_textrel,
+    "indirect textrel sleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2  |dwarf::DW_EH_PE_textrel,
+    "indirect textrel sdata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4  |dwarf::DW_EH_PE_textrel,
+    "indirect textrel sdata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8  |dwarf::DW_EH_PE_textrel,
+    "indirect textrel sdata8")
+
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr  |dwarf::DW_EH_PE_datarel,
+    "indirect datarel")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_datarel,
+    "indirect datarel uleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2  |dwarf::DW_EH_PE_datarel,
+    "indirect datarel udata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4  |dwarf::DW_EH_PE_datarel,
+    "indirect datarel udata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8  |dwarf::DW_EH_PE_datarel,
+    "indirect datarel udata8")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_datarel,
+    "indirect datarel sleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2  |dwarf::DW_EH_PE_datarel,
+    "indirect datarel sdata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4  |dwarf::DW_EH_PE_datarel,
+    "indirect datarel sdata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8  |dwarf::DW_EH_PE_datarel,
+    "indirect datarel sdata8")
+
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr  |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel uleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2  |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel udata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4  |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel udata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8  |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel udata8")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel sleb128")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2  |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel sdata2")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4  |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel sdata4")
+  S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8  |dwarf::DW_EH_PE_funcrel,
+    "indirect funcrel sdata8")
+
+#if HAVE_DESIGNATED_INITIALIZERS
+  };
+
+  assert(DataFormat >= 0 && DataFormat < 0x100 && FormatNames[DataFormat] &&
+         "Invalid DWARF data format!");
+  return FormatNames[DataFormat];
+#else
+  }
+  llvm_unreachable("Invalid DWARF data format!");
+  return 0;
+#endif
+#undef HAVE_DESIGNATED_INITIALIZERS
+}
+
+void AsmPrinter::EOL(const std::string &Comment, unsigned DataFormat) const {
+  if (VerboseAsm && !Comment.empty()) {
+    O.PadToColumn(MAI->getCommentColumn());
+    O << MAI->getCommentString()
+      << ' ' << Comment << " (" << GetDataFormatName(DataFormat) << ')'; 
+  }
+  O << '\n';
+}
+
+void AsmPrinter::EOL(const char* Comment, unsigned DataFormat) const {
+  if (VerboseAsm && *Comment) {
+    O.PadToColumn(MAI->getCommentColumn());
+    O << MAI->getCommentString()
+      << ' ' << Comment << " (" << GetDataFormatName(DataFormat) << ')'; 
+  }
+  O << '\n';
+}
+
 /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
 /// unsigned leb128 value.
 void AsmPrinter::EmitULEB128Bytes(unsigned Value) const {
index 170ca241b6a388ff40177103a55b26d4367ba80f..761686a4dd329e68995446b2ac7421619c5a9531 100644 (file)
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file contains support for writing dwarf exception info into asm files.
+// This file contains support for writing DWARF exception info into asm files.
 //
 //===----------------------------------------------------------------------===//
 
@@ -98,16 +98,19 @@ void DwarfException::EmitCIE(const Function *Personality, unsigned Index) {
 
   // If there is a personality, we need to indicate the function's location.
   if (Personality) {
+    unsigned Encoding = 0;
     Asm->EmitULEB128Bytes(7);
     Asm->EOL("Augmentation Size");
 
     if (MAI->getNeedsIndirectEncoding()) {
-      Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
-                    dwarf::DW_EH_PE_indirect);
-      Asm->EOL("Personality (pcrel sdata4 indirect)");
+      Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
+        dwarf::DW_EH_PE_indirect;
+      Asm->EmitInt8(Encoding);
+      Asm->EOL("Personality", Encoding);
     } else {
-      Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
-      Asm->EOL("Personality (pcrel sdata4)");
+      Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+      Asm->EmitInt8(Encoding);
+      Asm->EOL("Personality", Encoding);
     }
 
     PrintRelDirective(true);
@@ -118,17 +121,20 @@ void DwarfException::EmitCIE(const Function *Personality, unsigned Index) {
       O << "-" << MAI->getPCSymbol();
     Asm->EOL("Personality");
 
-    Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
-    Asm->EOL("LSDA Encoding (pcrel sdata4)");
+    Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("LSDA Encoding", Encoding);
 
-    Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
-    Asm->EOL("FDE Encoding (pcrel sdata4)");
+    Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("FDE Encoding", Encoding);
   } else {
     Asm->EmitULEB128Bytes(1);
     Asm->EOL("Augmentation Size");
 
-    Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
-    Asm->EOL("FDE Encoding (pcrel sdata4)");
+    unsigned Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("FDE Encoding", Encoding);
   }
 
   // Indicate locations of general callee saved registers in frame.
@@ -598,15 +604,17 @@ void DwarfException::EmitExceptionTable() {
   }
 
   // Emit the header.
-  Asm->EmitInt8(dwarf::DW_EH_PE_omit);
-  Asm->EOL("@LPStart format (DW_EH_PE_omit)");
+  unsigned Encoding = dwarf::DW_EH_PE_omit;
+  Asm->EmitInt8(Encoding);
+  Asm->EOL("@LPStart format", Encoding);
 
 #if 0
   if (TypeInfos.empty() && FilterIds.empty()) {
     // If there are no typeinfos or filters, there is nothing to emit, optimize
     // by specifying the "omit" encoding.
-    Asm->EmitInt8(dwarf::DW_EH_PE_omit);
-    Asm->EOL("@TType format (DW_EH_PE_omit)");
+    Encoding = dwarf::DW_EH_PE_omit;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("@TType format", Encoding);
   } else {
     // Okay, we have actual filters or typeinfos to emit.  As such, we need to
     // pick a type encoding for them.  We're about to emit a list of pointers to
@@ -634,12 +642,13 @@ void DwarfException::EmitExceptionTable() {
     //
     if (LSDASection->isWritable() ||
         Asm->TM.getRelocationModel() == Reloc::Static) {
-      Asm->EmitInt8(DW_EH_PE_absptr);
-      Asm->EOL("TType format (DW_EH_PE_absptr)");
+      Encoding = DW_EH_PE_absptr;
+      Asm->EmitInt8(Encoding);
+      Asm->EOL("TType format", Encoding);
     } else {
+      Encoding = DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
       Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
-      Asm->EOL("TType format (DW_EH_PE_pcrel | DW_EH_PE_indirect"
-               " | DW_EH_PE_sdata4)");
+      Asm->EOL("TType format", Encoding);
     }
     Asm->EmitULEB128Bytes(TypeOffset);
     Asm->EOL("TType base offset");
@@ -649,11 +658,13 @@ void DwarfException::EmitExceptionTable() {
   // say that we're omitting that bit.
   // FIXME: does this apply to Dwarf also? The above #if 0 implies yes?
   if (!HaveTTData) {
-    Asm->EmitInt8(dwarf::DW_EH_PE_omit);
-    Asm->EOL("@TType format (DW_EH_PE_omit)");
+    Encoding = dwarf::DW_EH_PE_omit;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("@TType format", Encoding);
   } else {
-    Asm->EmitInt8(dwarf::DW_EH_PE_absptr);
-    Asm->EOL("@TType format (DW_EH_PE_absptr)");
+    Encoding = dwarf::DW_EH_PE_absptr;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("@TType format", Encoding);
     Asm->EmitULEB128Bytes(TypeOffset);
     Asm->EOL("@TType base offset");
   }
@@ -661,8 +672,9 @@ void DwarfException::EmitExceptionTable() {
 
   // SjLj Exception handilng
   if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
-    Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
-    Asm->EOL("Call site format (DW_EH_PE_udata4)");
+    Encoding = dwarf::DW_EH_PE_udata4;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("Call site format", Encoding);
     Asm->EmitULEB128Bytes(SizeSites);
     Asm->EOL("Call site table length");
 
@@ -714,8 +726,9 @@ void DwarfException::EmitExceptionTable() {
     // will call `terminate()'.
 
     // Emit the landing pad call site table.
-    Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
-    Asm->EOL("Call site format (DW_EH_PE_udata4)");
+    Encoding = dwarf::DW_EH_PE_udata4;
+    Asm->EmitInt8(Encoding);
+    Asm->EOL("Call site format", Encoding);
     Asm->EmitULEB128Bytes(SizeSites);
     Asm->EOL("Call site table size");