llvm.org GIT mirror llvm / fffb726
--- 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80197 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 11 years ago
10 changed file(s) with 437 addition(s) and 71 deletion(s). Raw diff Collapse all Expand all
116116 dist-hook::
117117 $(Echo) Eliminating files constructed by configure
118118 $(Verb) $(RM) -f \
119 $(TopDistDir)/include/llvm/ADT/iterator.h \
119120 $(TopDistDir)/include/llvm/Config/config.h \
120121 $(TopDistDir)/include/llvm/Support/DataTypes.h \
121122 $(TopDistDir)/include/llvm/Support/ThreadSupport.h
134135 include/llvm/Config/config.h \
135136 include/llvm/Config/Targets.def \
136137 include/llvm/Config/AsmPrinters.def \
137 include/llvm/Support/DataTypes.h
138 include/llvm/Support/DataTypes.h \
139 include/llvm/ADT/iterator.h
138140 FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
139141
140142 all-local:: $(FilesToConfigPATH)
13131313 AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def])
13141314 AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def])
13151315 AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
1316 AC_CONFIG_HEADERS([include/llvm/ADT/iterator.h])
13161317
13171318 dnl Configure the makefile's configuration data
13181319 AC_CONFIG_FILES([Makefile.config])
180180 )
181181
182182 configure_file(
183 ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT/iterator.cmake
184 ${LLVM_BINARY_DIR}/include/llvm/ADT/iterator.h
185 )
186
187 configure_file(
183188 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake
184189 ${LLVM_BINARY_DIR}/include/llvm/Support/DataTypes.h
185190 )
833833 ENABLE_OPTIMIZED
834834 ENABLE_PROFILING
835835 DISABLE_ASSERTIONS
836 LLVM_COMPACT_SENTINELS
836837 ENABLE_EXPENSIVE_CHECKS
837838 EXPENSIVE_CHECKS
838839 DEBUG_RUNTIME
48444845
48454846 fi
48464847
4848 if test ${ENABLE_OPTIMIZED},${DISABLE_ASSERTIONS} = "ENABLE_OPTIMIZED=1,DISABLE_ASSERTIONS=1" ; then
4849 LLVM_COMPACT_SENTINELS=1
4850
4851 else
4852 LLVM_COMPACT_SENTINELS=0
4853
4854 fi
4855
4856
4857 cat >>confdefs.h <<_ACEOF
4858 #define LLVM_COMPACT_SENTINELS $LLVM_COMPACT_SENTINELS
4859 _ACEOF
4860
4861
4862
48474863 # Check whether --enable-expensive-checks was given.
48484864 if test "${enable_expensive_checks+set}" = set; then
48494865 enableval=$enable_expensive_checks;
1097110987 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1097210988 lt_status=$lt_dlunknown
1097310989 cat > conftest.$ac_ext <
10974 #line 10975 "configure"
10990 #line 10991 "configure"
1097510991 #include "confdefs.h"
1097610992
1097710993 #if HAVE_DLFCN_H
1311513131 ;;
1311613132 *-*-irix6*)
1311713133 # Find out which ABI we are using.
13118 echo '#line 13119 "configure"' > conftest.$ac_ext
13134 echo '#line 13135 "configure"' > conftest.$ac_ext
1311913135 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1312013136 (eval $ac_compile) 2>&5
1312113137 ac_status=$?
1483314849 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1483414850 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1483514851 -e 's:$: $lt_compiler_flag:'`
14836 (eval echo "\"\$as_me:14837: $lt_compile\"" >&5)
14852 (eval echo "\"\$as_me:14853: $lt_compile\"" >&5)
1483714853 (eval "$lt_compile" 2>conftest.err)
1483814854 ac_status=$?
1483914855 cat conftest.err >&5
14840 echo "$as_me:14841: \$? = $ac_status" >&5
14856 echo "$as_me:14857: \$? = $ac_status" >&5
1484114857 if (exit $ac_status) && test -s "$ac_outfile"; then
1484214858 # The compiler can only warn and ignore the option if not recognized
1484314859 # So say no if there are warnings other than the usual output.
1510115117 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1510215118 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1510315119 -e 's:$: $lt_compiler_flag:'`
15104 (eval echo "\"\$as_me:15105: $lt_compile\"" >&5)
15120 (eval echo "\"\$as_me:15121: $lt_compile\"" >&5)
1510515121 (eval "$lt_compile" 2>conftest.err)
1510615122 ac_status=$?
1510715123 cat conftest.err >&5
15108 echo "$as_me:15109: \$? = $ac_status" >&5
15124 echo "$as_me:15125: \$? = $ac_status" >&5
1510915125 if (exit $ac_status) && test -s "$ac_outfile"; then
1511015126 # The compiler can only warn and ignore the option if not recognized
1511115127 # So say no if there are warnings other than the usual output.
1520515221 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1520615222 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1520715223 -e 's:$: $lt_compiler_flag:'`
15208 (eval echo "\"\$as_me:15209: $lt_compile\"" >&5)
15224 (eval echo "\"\$as_me:15225: $lt_compile\"" >&5)
1520915225 (eval "$lt_compile" 2>out/conftest.err)
1521015226 ac_status=$?
1521115227 cat out/conftest.err >&5
15212 echo "$as_me:15213: \$? = $ac_status" >&5
15228 echo "$as_me:15229: \$? = $ac_status" >&5
1521315229 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1521415230 then
1521515231 # The compiler can only warn and ignore the option if not recognized
1765717673 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1765817674 lt_status=$lt_dlunknown
1765917675 cat > conftest.$ac_ext <
17660 #line 17661 "configure"
17676 #line 17677 "configure"
1766117677 #include "confdefs.h"
1766217678
1766317679 #if HAVE_DLFCN_H
1775717773 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1775817774 lt_status=$lt_dlunknown
1775917775 cat > conftest.$ac_ext <
17760 #line 17761 "configure"
17776 #line 17777 "configure"
1776117777 #include "confdefs.h"
1776217778
1776317779 #if HAVE_DLFCN_H
2012520141 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2012620142 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2012720143 -e 's:$: $lt_compiler_flag:'`
20128 (eval echo "\"\$as_me:20129: $lt_compile\"" >&5)
20144 (eval echo "\"\$as_me:20145: $lt_compile\"" >&5)
2012920145 (eval "$lt_compile" 2>conftest.err)
2013020146 ac_status=$?
2013120147 cat conftest.err >&5
20132 echo "$as_me:20133: \$? = $ac_status" >&5
20148 echo "$as_me:20149: \$? = $ac_status" >&5
2013320149 if (exit $ac_status) && test -s "$ac_outfile"; then
2013420150 # The compiler can only warn and ignore the option if not recognized
2013520151 # So say no if there are warnings other than the usual output.
2022920245 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2023020246 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2023120247 -e 's:$: $lt_compiler_flag:'`
20232 (eval echo "\"\$as_me:20233: $lt_compile\"" >&5)
20248 (eval echo "\"\$as_me:20249: $lt_compile\"" >&5)
2023320249 (eval "$lt_compile" 2>out/conftest.err)
2023420250 ac_status=$?
2023520251 cat out/conftest.err >&5
20236 echo "$as_me:20237: \$? = $ac_status" >&5
20252 echo "$as_me:20253: \$? = $ac_status" >&5
2023720253 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2023820254 then
2023920255 # The compiler can only warn and ignore the option if not recognized
2179921815 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2180021816 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2180121817 -e 's:$: $lt_compiler_flag:'`
21802 (eval echo "\"\$as_me:21803: $lt_compile\"" >&5)
21818 (eval echo "\"\$as_me:21819: $lt_compile\"" >&5)
2180321819 (eval "$lt_compile" 2>conftest.err)
2180421820 ac_status=$?
2180521821 cat conftest.err >&5
21806 echo "$as_me:21807: \$? = $ac_status" >&5
21822 echo "$as_me:21823: \$? = $ac_status" >&5
2180721823 if (exit $ac_status) && test -s "$ac_outfile"; then
2180821824 # The compiler can only warn and ignore the option if not recognized
2180921825 # So say no if there are warnings other than the usual output.
2190321919 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2190421920 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2190521921 -e 's:$: $lt_compiler_flag:'`
21906 (eval echo "\"\$as_me:21907: $lt_compile\"" >&5)
21922 (eval echo "\"\$as_me:21923: $lt_compile\"" >&5)
2190721923 (eval "$lt_compile" 2>out/conftest.err)
2190821924 ac_status=$?
2190921925 cat out/conftest.err >&5
21910 echo "$as_me:21911: \$? = $ac_status" >&5
21926 echo "$as_me:21927: \$? = $ac_status" >&5
2191121927 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2191221928 then
2191321929 # The compiler can only warn and ignore the option if not recognized
2413824154 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2413924155 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2414024156 -e 's:$: $lt_compiler_flag:'`
24141 (eval echo "\"\$as_me:24142: $lt_compile\"" >&5)
24157 (eval echo "\"\$as_me:24158: $lt_compile\"" >&5)
2414224158 (eval "$lt_compile" 2>conftest.err)
2414324159 ac_status=$?
2414424160 cat conftest.err >&5
24145 echo "$as_me:24146: \$? = $ac_status" >&5
24161 echo "$as_me:24162: \$? = $ac_status" >&5
2414624162 if (exit $ac_status) && test -s "$ac_outfile"; then
2414724163 # The compiler can only warn and ignore the option if not recognized
2414824164 # So say no if there are warnings other than the usual output.
2440624422 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2440724423 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2440824424 -e 's:$: $lt_compiler_flag:'`
24409 (eval echo "\"\$as_me:24410: $lt_compile\"" >&5)
24425 (eval echo "\"\$as_me:24426: $lt_compile\"" >&5)
2441024426 (eval "$lt_compile" 2>conftest.err)
2441124427 ac_status=$?
2441224428 cat conftest.err >&5
24413 echo "$as_me:24414: \$? = $ac_status" >&5
24429 echo "$as_me:24430: \$? = $ac_status" >&5
2441424430 if (exit $ac_status) && test -s "$ac_outfile"; then
2441524431 # The compiler can only warn and ignore the option if not recognized
2441624432 # So say no if there are warnings other than the usual output.
2451024526 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2451124527 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2451224528 -e 's:$: $lt_compiler_flag:'`
24513 (eval echo "\"\$as_me:24514: $lt_compile\"" >&5)
24529 (eval echo "\"\$as_me:24530: $lt_compile\"" >&5)
2451424530 (eval "$lt_compile" 2>out/conftest.err)
2451524531 ac_status=$?
2451624532 cat out/conftest.err >&5
24517 echo "$as_me:24518: \$? = $ac_status" >&5
24533 echo "$as_me:24534: \$? = $ac_status" >&5
2451824534 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2451924535 then
2452024536 # The compiler can only warn and ignore the option if not recognized
3529935315
3530035316 ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h"
3530135317
35318 ac_config_headers="$ac_config_headers include/llvm/ADT/iterator.h"
35319
3530235320
3530335321 ac_config_files="$ac_config_files Makefile.config"
3530435322
3592535943 "include/llvm/Config/AsmPrinters.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmPrinters.def" ;;
3592635944 "include/llvm/Config/AsmParsers.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmParsers.def" ;;
3592735945 "include/llvm/Support/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Support/DataTypes.h" ;;
35946 "include/llvm/ADT/iterator.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator.h" ;;
3592835947 "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;;
3592935948 "llvm.spec") CONFIG_FILES="$CONFIG_FILES llvm.spec" ;;
3593035949 "docs/doxygen.cfg") CONFIG_FILES="$CONFIG_FILES docs/doxygen.cfg" ;;
3608436103 ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
3608536104 ENABLE_PROFILING!$ENABLE_PROFILING$ac_delim
3608636105 DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim
36106 LLVM_COMPACT_SENTINELS!$LLVM_COMPACT_SENTINELS$ac_delim
3608736107 ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
3608836108 EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
3608936109 DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
3610236122 ENABLE_LLVMC_DYNAMIC!$ENABLE_LLVMC_DYNAMIC$ac_delim
3610336123 ENABLE_LLVMC_DYNAMIC_PLUGINS!$ENABLE_LLVMC_DYNAMIC_PLUGINS$ac_delim
3610436124 CXX!$CXX$ac_delim
36105 CXXFLAGS!$CXXFLAGS$ac_delim
3610636125 _ACEOF
3610736126
3610836127 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
3614436163 ac_delim='%!_!# '
3614536164 for ac_last_try in false false false false false :; do
3614636165 cat >conf$$subs.sed <<_ACEOF
36166 CXXFLAGS!$CXXFLAGS$ac_delim
3614736167 ac_ct_CXX!$ac_ct_CXX$ac_delim
3614836168 NM!$NM$ac_delim
3614936169 ifGNUmake!$ifGNUmake$ac_delim
3623736257 LTLIBOBJS!$LTLIBOBJS$ac_delim
3623836258 _ACEOF
3623936259
36240 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 91; then
36260 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 92; then
3624136261 break
3624236262 elif $ac_last_try; then
3624336263 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
0 //===-- llvm/ADT/iterator - Portable wrapper around --*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file was developed by the LLVM research group and is distributed under
5 // the University of Illinois Open Source License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides a wrapper around the mysterious header file.
10 // In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
11 // friends), instead of the standard iterator class. In GCC 3.1, the
12 // bidirectional_iterator class got moved out and the new, standards compliant,
13 // iterator<> class was added. Because there is nothing that we can do to get
14 // correct behavior on both compilers, we have this header with #ifdef's. Gross
15 // huh?
16 //
17 // By #includ'ing this file, you get the contents of plus the
18 // following classes in the global namespace:
19 //
20 // 1. bidirectional_iterator
21 // 2. forward_iterator
22 //
23 // The #if directives' expressions are filled in by Autoconf.
24 //
25 //===----------------------------------------------------------------------===//
26
27 #ifndef LLVM_ADT_ITERATOR
28 #define LLVM_ADT_ITERATOR
29
30 #include
31
32 #undef HAVE_BI_ITERATOR
33 #undef HAVE_STD_ITERATOR
34 #undef HAVE_FWD_ITERATOR
35
36 // defined by Kevin
37 #define HAVE_STD_ITERATOR 1
38
39 #ifdef _MSC_VER
40 # define HAVE_BI_ITERATOR 0
41 # define HAVE_STD_ITERATOR 1
42 # define HAVE_FWD_ITERATOR 0
43 #endif
44
45 #if !HAVE_BI_ITERATOR
46 # if HAVE_STD_ITERATOR
47 /// If the bidirectional iterator is not defined, we attempt to define it in
48 /// terms of the C++ standard iterator. Otherwise, we import it with a "using"
49 /// statement.
50 ///
51 template
52 struct bidirectional_iterator
53 : public std::iterator {
54 };
55 # else
56 # error "Need to have standard iterator to define bidirectional iterator!"
57 # endif
58 #else
59 using std::bidirectional_iterator;
60 #endif
61
62 #if !HAVE_FWD_ITERATOR
63 # if HAVE_STD_ITERATOR
64 /// If the forward iterator is not defined, attempt to define it in terms of
65 /// the C++ standard iterator. Otherwise, we import it with a "using" statement.
66 ///
67 template
68 struct forward_iterator
69 : public std::iterator {
70 };
71 # else
72 # error "Need to have standard iterator to define forward iterator!"
73 # endif
74 #else
75 using std::forward_iterator;
76 #endif
77
78 #endif
0 //==-- llvm/ADT/iterator.h - Portable wrapper around --*- C++ -*-==//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides a wrapper around the mysterious header file.
10 // In GCC 2.95.3, the file defines a bidirectional_iterator class (and other
11 // friends), instead of the standard iterator class. In GCC 3.1, the
12 // bidirectional_iterator class got moved out and the new, standards compliant,
13 // iterator<> class was added. Because there is nothing that we can do to get
14 // correct behavior on both compilers, we have this header with #ifdef's. Gross
15 // huh?
16 //
17 // By #includ'ing this file, you get the contents of plus the
18 // following classes in the global namespace:
19 //
20 // 1. bidirectional_iterator
21 // 2. forward_iterator
22 //
23 // The #if directives' expressions are filled in by Autoconf.
24 //
25 //===----------------------------------------------------------------------===//
26
27 #ifndef LLVM_ADT_ITERATOR_H
28 #define LLVM_ADT_ITERATOR_H
29
30 #include
31
32 #undef HAVE_BI_ITERATOR
33 #undef HAVE_STD_ITERATOR
34 #undef HAVE_FWD_ITERATOR
35
36 #ifdef _MSC_VER
37 # define HAVE_BI_ITERATOR 0
38 # define HAVE_STD_ITERATOR 1
39 # define HAVE_FWD_ITERATOR 0
40 #endif
41
42 #if !HAVE_BI_ITERATOR
43 # if HAVE_STD_ITERATOR
44 /// If the bidirectional iterator is not defined, we attempt to define it in
45 /// terms of the C++ standard iterator. Otherwise, we import it with a "using"
46 /// statement.
47 ///
48 template
49 struct bidirectional_iterator
50 : public std::iterator {
51 };
52 # else
53 # error "Need to have standard iterator to define bidirectional iterator!"
54 # endif
55 #else
56 using std::bidirectional_iterator;
57 #endif
58
59 #if !HAVE_FWD_ITERATOR
60 # if HAVE_STD_ITERATOR
61 /// If the forward iterator is not defined, attempt to define it in terms of
62 /// the C++ standard iterator. Otherwise, we import it with a "using" statement.
63 ///
64 template
65 struct forward_iterator
66 : public std::iterator {
67 };
68 # else
69 # error "Need to have standard iterator to define forward iterator!"
70 # endif
71 #else
72 using std::forward_iterator;
73 #endif
74
75 #endif // LLVM_ADT_ITERATOR_H
267267 void EOL() const;
268268 void EOL(const std::string &Comment) const;
269269 void EOL(const char* Comment) const;
270 void EOL(const std::string &Comment, unsigned DatFormat) const;
271 void EOL(const char* Comment, unsigned DataFormat) const;
270272
271273 /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
272274 /// unsigned leb128 value.
22 /* Define if dlopen(0) will open the symbols of the program */
33 #undef CAN_DLOPEN_SELF
44
5 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
6 systems. This function is required for `alloca.c' support on those systems.
7 */
8 #undef CRAY_STACKSEG_END
9
10 /* Define to 1 if using `alloca.c'. */
11 #undef C_ALLOCA
12
135 /* Define if CBE is enabled for printf %a output */
146 #undef ENABLE_CBE_PRINTF_A
157
1810
1911 /* Define if threads enabled */
2012 #undef ENABLE_THREADS
21
22 /* Define to 1 if you have `alloca', as a function or macro. */
23 #undef HAVE_ALLOCA
24
25 /* Define to 1 if you have and it should be used (not on Ultrix).
26 */
27 #undef HAVE_ALLOCA_H
2813
2914 /* Define to 1 if you have the `argz_append' function. */
3015 #undef HAVE_ARGZ_APPEND
459444
460445 /* Installation directory for binary executables */
461446 #undef LLVM_BINDIR
447
448 /* Define to 1 for ilist sentinel compaction */
449 #undef LLVM_COMPACT_SENTINELS
462450
463451 /* Time at which LLVM was configured */
464452 #undef LLVM_CONFIGTIME
599599 O << MAI->getCommentString()
600600 << ' '
601601 << Comment;
602 }
603 O << '\n';
604 }
605
606 static const char *GetDataFormatName(unsigned DataFormat) {
607 #ifndef HAVE_DESIGNATED_INITIALIZERS
608 #define HAVE_DESIGNATED_INITIALIZERS \
609 ((!defined(__cplusplus) && (GCC_VERSION >= 2007)) \
610 || (__STDC_VERSION__ >= 199901L))
611 #endif
612
613 #if HAVE_DESIGNATED_INITIALIZERS
614 #define S(p, v) [p] = v,
615 #else
616 #define S(p, v) case p: return v;
617 #endif
618
619 #if HAVE_DESIGNATED_INITIALIZERS
620 __extension__ static const char * const FormatNames[256] = {
621 #else
622 switch (DataFormat) {
623 #endif
624
625 S(dwarf::DW_EH_PE_absptr, "absolute")
626 S(dwarf::DW_EH_PE_omit, "omit")
627 S(dwarf::DW_EH_PE_aligned, "aligned absolute")
628
629 S(dwarf::DW_EH_PE_uleb128, "uleb128")
630 S(dwarf::DW_EH_PE_udata2, "udata2")
631 S(dwarf::DW_EH_PE_udata4, "udata4")
632 S(dwarf::DW_EH_PE_udata8, "udata8")
633 S(dwarf::DW_EH_PE_sleb128, "sleb128")
634 S(dwarf::DW_EH_PE_sdata2, "sdata2")
635 S(dwarf::DW_EH_PE_sdata4, "sdata4")
636 S(dwarf::DW_EH_PE_sdata8, "sdata8")
637
638 S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_pcrel, "pcrel")
639 S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_pcrel, "pcrel uleb128")
640 S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_pcrel, "pcrel udata2")
641 S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_pcrel, "pcrel udata4")
642 S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_pcrel, "pcrel udata8")
643 S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_pcrel, "pcrel sleb128")
644 S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_pcrel, "pcrel sdata2")
645 S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_pcrel, "pcrel sdata4")
646 S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_pcrel, "pcrel sdata8")
647
648 S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_textrel, "textrel")
649 S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_textrel, "textrel uleb128")
650 S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_textrel, "textrel udata2")
651 S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_textrel, "textrel udata4")
652 S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_textrel, "textrel udata8")
653 S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_textrel, "textrel sleb128")
654 S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_textrel, "textrel sdata2")
655 S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_textrel, "textrel sdata4")
656 S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_textrel, "textrel sdata8")
657
658 S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_datarel, "datarel")
659 S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_datarel, "datarel uleb128")
660 S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_datarel, "datarel udata2")
661 S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_datarel, "datarel udata4")
662 S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_datarel, "datarel udata8")
663 S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_datarel, "datarel sleb128")
664 S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_datarel, "datarel sdata2")
665 S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_datarel, "datarel sdata4")
666 S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_datarel, "datarel sdata8")
667
668 S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_funcrel, "funcrel")
669 S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_funcrel, "funcrel uleb128")
670 S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_funcrel, "funcrel udata2")
671 S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_funcrel, "funcrel udata4")
672 S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_funcrel, "funcrel udata8")
673 S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_funcrel, "funcrel sleb128")
674 S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_funcrel, "funcrel sdata2")
675 S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_funcrel, "funcrel sdata4")
676 S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_funcrel, "funcrel sdata8")
677
678 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_pcrel,
679 "indirect pcrel")
680 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_pcrel,
681 "indirect pcrel uleb128")
682 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_pcrel,
683 "indirect pcrel udata2")
684 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_pcrel,
685 "indirect pcrel udata4")
686 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_pcrel,
687 "indirect pcrel udata8")
688 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_pcrel,
689 "indirect pcrel sleb128")
690 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_pcrel,
691 "indirect pcrel sdata2")
692 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_pcrel,
693 "indirect pcrel sdata4")
694 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_pcrel,
695 "indirect pcrel sdata8")
696
697 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_textrel,
698 "indirect textrel")
699 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_textrel,
700 "indirect textrel uleb128")
701 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_textrel,
702 "indirect textrel udata2")
703 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_textrel,
704 "indirect textrel udata4")
705 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_textrel,
706 "indirect textrel udata8")
707 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_textrel,
708 "indirect textrel sleb128")
709 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_textrel,
710 "indirect textrel sdata2")
711 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_textrel,
712 "indirect textrel sdata4")
713 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_textrel,
714 "indirect textrel sdata8")
715
716 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_datarel,
717 "indirect datarel")
718 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_datarel,
719 "indirect datarel uleb128")
720 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_datarel,
721 "indirect datarel udata2")
722 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_datarel,
723 "indirect datarel udata4")
724 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_datarel,
725 "indirect datarel udata8")
726 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_datarel,
727 "indirect datarel sleb128")
728 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_datarel,
729 "indirect datarel sdata2")
730 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_datarel,
731 "indirect datarel sdata4")
732 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_datarel,
733 "indirect datarel sdata8")
734
735 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_funcrel,
736 "indirect funcrel")
737 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_funcrel,
738 "indirect funcrel uleb128")
739 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_funcrel,
740 "indirect funcrel udata2")
741 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_funcrel,
742 "indirect funcrel udata4")
743 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_funcrel,
744 "indirect funcrel udata8")
745 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_funcrel,
746 "indirect funcrel sleb128")
747 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_funcrel,
748 "indirect funcrel sdata2")
749 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_funcrel,
750 "indirect funcrel sdata4")
751 S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_funcrel,
752 "indirect funcrel sdata8")
753
754 #if HAVE_DESIGNATED_INITIALIZERS
755 };
756
757 assert(DataFormat >= 0 && DataFormat < 0x100 && FormatNames[DataFormat] &&
758 "Invalid DWARF data format!");
759 return FormatNames[DataFormat];
760 #else
761 }
762 llvm_unreachable("Invalid DWARF data format!");
763 return 0;
764 #endif
765 #undef HAVE_DESIGNATED_INITIALIZERS
766 }
767
768 void AsmPrinter::EOL(const std::string &Comment, unsigned DataFormat) const {
769 if (VerboseAsm && !Comment.empty()) {
770 O.PadToColumn(MAI->getCommentColumn());
771 O << MAI->getCommentString()
772 << ' ' << Comment << " (" << GetDataFormatName(DataFormat) << ')';
773 }
774 O << '\n';
775 }
776
777 void AsmPrinter::EOL(const char* Comment, unsigned DataFormat) const {
778 if (VerboseAsm && *Comment) {
779 O.PadToColumn(MAI->getCommentColumn());
780 O << MAI->getCommentString()
781 << ' ' << Comment << " (" << GetDataFormatName(DataFormat) << ')';
602782 }
603783 O << '\n';
604784 }
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file contains support for writing dwarf exception info into asm files.
9 // This file contains support for writing DWARF exception info into asm files.
1010 //
1111 //===----------------------------------------------------------------------===//
1212
9797
9898 // If there is a personality, we need to indicate the function's location.
9999 if (Personality) {
100 unsigned Encoding = 0;
100101 Asm->EmitULEB128Bytes(7);
101102 Asm->EOL("Augmentation Size");
102103
103104 if (MAI->getNeedsIndirectEncoding()) {
104 Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
105 dwarf::DW_EH_PE_indirect);
106 Asm->EOL("Personality (pcrel sdata4 indirect)");
105 Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
106 dwarf::DW_EH_PE_indirect;
107 Asm->EmitInt8(Encoding);
108 Asm->EOL("Personality", Encoding);
107109 } else {
108 Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
109 Asm->EOL("Personality (pcrel sdata4)");
110 Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
111 Asm->EmitInt8(Encoding);
112 Asm->EOL("Personality", Encoding);
110113 }
111114
112115 PrintRelDirective(true);
117120 O << "-" << MAI->getPCSymbol();
118121 Asm->EOL("Personality");
119122
120 Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
121 Asm->EOL("LSDA Encoding (pcrel sdata4)");
122
123 Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
124 Asm->EOL("FDE Encoding (pcrel sdata4)");
123 Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
124 Asm->EmitInt8(Encoding);
125 Asm->EOL("LSDA Encoding", Encoding);
126
127 Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
128 Asm->EmitInt8(Encoding);
129 Asm->EOL("FDE Encoding", Encoding);
125130 } else {
126131 Asm->EmitULEB128Bytes(1);
127132 Asm->EOL("Augmentation Size");
128133
129 Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
130 Asm->EOL("FDE Encoding (pcrel sdata4)");
134 unsigned Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
135 Asm->EmitInt8(Encoding);
136 Asm->EOL("FDE Encoding", Encoding);
131137 }
132138
133139 // Indicate locations of general callee saved registers in frame.
597603 }
598604
599605 // Emit the header.
600 Asm->EmitInt8(dwarf::DW_EH_PE_omit);
601 Asm->EOL("@LPStart format (DW_EH_PE_omit)");
606 unsigned Encoding = dwarf::DW_EH_PE_omit;
607 Asm->EmitInt8(Encoding);
608 Asm->EOL("@LPStart format", Encoding);
602609
603610 #if 0
604611 if (TypeInfos.empty() && FilterIds.empty()) {
605612 // If there are no typeinfos or filters, there is nothing to emit, optimize
606613 // by specifying the "omit" encoding.
607 Asm->EmitInt8(dwarf::DW_EH_PE_omit);
608 Asm->EOL("@TType format (DW_EH_PE_omit)");
614 Encoding = dwarf::DW_EH_PE_omit;
615 Asm->EmitInt8(Encoding);
616 Asm->EOL("@TType format", Encoding);
609617 } else {
610618 // Okay, we have actual filters or typeinfos to emit. As such, we need to
611619 // pick a type encoding for them. We're about to emit a list of pointers to
633641 //
634642 if (LSDASection->isWritable() ||
635643 Asm->TM.getRelocationModel() == Reloc::Static) {
636 Asm->EmitInt8(DW_EH_PE_absptr);
637 Asm->EOL("TType format (DW_EH_PE_absptr)");
644 Encoding = DW_EH_PE_absptr;
645 Asm->EmitInt8(Encoding);
646 Asm->EOL("TType format", Encoding);
638647 } else {
648 Encoding = DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
639649 Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
640 Asm->EOL("TType format (DW_EH_PE_pcrel | DW_EH_PE_indirect"
641 " | DW_EH_PE_sdata4)");
650 Asm->EOL("TType format", Encoding);
642651 }
643652 Asm->EmitULEB128Bytes(TypeOffset);
644653 Asm->EOL("TType base offset");
648657 // say that we're omitting that bit.
649658 // FIXME: does this apply to Dwarf also? The above #if 0 implies yes?
650659 if (!HaveTTData) {
651 Asm->EmitInt8(dwarf::DW_EH_PE_omit);
652 Asm->EOL("@TType format (DW_EH_PE_omit)");
660 Encoding = dwarf::DW_EH_PE_omit;
661 Asm->EmitInt8(Encoding);
662 Asm->EOL("@TType format", Encoding);
653663 } else {
654 Asm->EmitInt8(dwarf::DW_EH_PE_absptr);
655 Asm->EOL("@TType format (DW_EH_PE_absptr)");
664 Encoding = dwarf::DW_EH_PE_absptr;
665 Asm->EmitInt8(Encoding);
666 Asm->EOL("@TType format", Encoding);
656667 Asm->EmitULEB128Bytes(TypeOffset);
657668 Asm->EOL("@TType base offset");
658669 }
660671
661672 // SjLj Exception handilng
662673 if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
663 Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
664 Asm->EOL("Call site format (DW_EH_PE_udata4)");
674 Encoding = dwarf::DW_EH_PE_udata4;
675 Asm->EmitInt8(Encoding);
676 Asm->EOL("Call site format", Encoding);
665677 Asm->EmitULEB128Bytes(SizeSites);
666678 Asm->EOL("Call site table length");
667679
713725 // will call `terminate()'.
714726
715727 // Emit the landing pad call site table.
716 Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
717 Asm->EOL("Call site format (DW_EH_PE_udata4)");
728 Encoding = dwarf::DW_EH_PE_udata4;
729 Asm->EmitInt8(Encoding);
730 Asm->EOL("Call site format", Encoding);
718731 Asm->EmitULEB128Bytes(SizeSites);
719732 Asm->EOL("Call site table size");
720733