[llvm-commits] [llvm] r80197 - in /llvm/trunk: Makefile autoconf/configure.ac cmake/config-ix.cmake configure include/llvm/ADT/iterator.cmake include/llvm/ADT/iterator.h.in include/llvm/CodeGen/AsmPrinter.h include/llvm/Config/config.h.in lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfException.cpp

Bill Wendling isanbard at gmail.com
Wed Aug 26 20:29:28 PDT 2009


Author: void
Date: Wed Aug 26 22:29:26 2009
New Revision: 80197

URL: http://llvm.org/viewvc/llvm-project?rev=80197&view=rev
Log:
--- Reverse-merging r80147 into '.':
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.

Added:
    llvm/trunk/include/llvm/ADT/iterator.cmake
      - copied unchanged from r80146, llvm/trunk/include/llvm/ADT/iterator.cmake
    llvm/trunk/include/llvm/ADT/iterator.h.in
      - copied unchanged from r80179, llvm/trunk/include/llvm/ADT/iterator.h.in
Modified:
    llvm/trunk/Makefile
    llvm/trunk/autoconf/configure.ac
    llvm/trunk/cmake/config-ix.cmake
    llvm/trunk/configure
    llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
    llvm/trunk/include/llvm/Config/config.h.in
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp

Modified: llvm/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/Makefile (original)
+++ llvm/trunk/Makefile Wed Aug 26 22:29:26 2009
@@ -117,6 +117,7 @@
 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 @@
   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)

Modified: llvm/trunk/autoconf/configure.ac
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/autoconf/configure.ac?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/autoconf/configure.ac (original)
+++ llvm/trunk/autoconf/configure.ac Wed Aug 26 22:29:26 2009
@@ -1314,6 +1314,7 @@
 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])

Modified: llvm/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/cmake/config-ix.cmake (original)
+++ llvm/trunk/cmake/config-ix.cmake Wed Aug 26 22:29:26 2009
@@ -181,6 +181,11 @@
   )
 
 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
   )

Modified: llvm/trunk/configure
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/configure?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/configure (original)
+++ llvm/trunk/configure Wed Aug 26 22:29:26 2009
@@ -834,6 +834,7 @@
 ENABLE_OPTIMIZED
 ENABLE_PROFILING
 DISABLE_ASSERTIONS
+LLVM_COMPACT_SENTINELS
 ENABLE_EXPENSIVE_CHECKS
 EXPENSIVE_CHECKS
 DEBUG_RUNTIME
@@ -4845,6 +4846,21 @@
 
 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 @@
   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 @@
   ;;
 *-*-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 @@
    -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 @@
    -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 @@
    -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 @@
   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 @@
   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 @@
    -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 @@
    -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 @@
    -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 @@
    -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 @@
    -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 @@
    -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 @@
    -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_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 @@
     "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 @@
 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 @@
 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 @@
 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 @@
 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

Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Wed Aug 26 22:29:26 2009
@@ -268,6 +268,8 @@
     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.

Modified: llvm/trunk/include/llvm/Config/config.h.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Config/config.h.in?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Config/config.h.in (original)
+++ llvm/trunk/include/llvm/Config/config.h.in Wed Aug 26 22:29:26 2009
@@ -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
 
@@ -20,13 +12,6 @@
 /* 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
 
@@ -461,6 +446,9 @@
 /* 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
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Aug 26 22:29:26 2009
@@ -604,6 +604,186 @@
   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 {

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=80197&r1=80196&r2=80197&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Wed Aug 26 22:29:26 2009
@@ -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 @@
 
   // 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 @@
       O << "-" << MAI->getPCSymbol();
     Asm->EOL("Personality");
 
-    Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
-    Asm->EOL("LSDA Encoding (pcrel sdata4)");
-
-    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("LSDA Encoding", Encoding);
+
+    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 @@
   }
 
   // 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 @@
     //
     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 @@
   // 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 @@
 
   // 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 @@
     // 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");
 





More information about the llvm-commits mailing list