1 /* { dg-do compile } */
2 /* { dg-additional-options "-Wno-return-type" } */
6 typedef long unsigned int size_t;
12 template < typename T > double is_class_helper (...);
14 template < typename T > struct is_class
17 { value = sizeof (char) == sizeof (dont_use::is_class_helper < T > (0)) };
19 template < typename T > struct isPodLike
21 static const bool value = !is_class < T >::value;
24 namespace std __attribute__ ((__visibility__ ("default")))
26 template < typename _Iterator > struct iterator_traits
29 template < typename _Tp > struct iterator_traits <_Tp * >
31 typedef _Tp value_type;
35 namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
37 template < typename _Tp > class new_allocator
39 public:typedef size_t size_type;
40 typedef const _Tp & const_reference;
44 namespace std __attribute__ ((__visibility__ ("default")))
46 template < typename _Tp > class allocator:public __gnu_cxx::new_allocator <
49 public:typedef size_t size_type;
50 template < typename _Tp1 > struct rebind
52 typedef allocator < _Tp1 > other;
55 template < typename _Tp, typename _Alloc > struct _Vector_base
57 typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type;
59 template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp,
63 typedef _Vector_base < _Tp, _Alloc > _Base;
64 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
65 public:typedef _Tp value_type;
66 typedef typename _Tp_alloc_type::const_reference const_reference;
67 typedef size_t size_type;
68 size_type size () const
70 } const_reference operator[] (size_type __n) const
77 struct LandingPadInfo;
80 static bool PadLT (const LandingPadInfo * L, const LandingPadInfo * R);
84 void EmitExceptionTable ();
87 namespace std __attribute__ ((__visibility__ ("default")))
89 template < typename _RandomAccessIterator,
91 void __unguarded_linear_insert (_RandomAccessIterator __last,
94 typename iterator_traits < _RandomAccessIterator >::value_type __val =
96 _RandomAccessIterator __next = __last;
97 while (__comp (__val, *__next))
101 template < typename _RandomAccessIterator,
102 typename _Compare > void __insertion_sort (_RandomAccessIterator __first,
103 _RandomAccessIterator __last,
106 for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
108 if (__comp (*__i, *__first))
112 std::__unguarded_linear_insert (__i, __comp);
116 { _S_threshold = 16 };
117 template < typename _RandomAccessIterator,
119 void __final_insertion_sort (_RandomAccessIterator __first,
120 _RandomAccessIterator __last,
123 if (__last - __first > int (_S_threshold))
125 std::__insertion_sort (__first, __first + int (_S_threshold), __comp);
128 template < typename _RandomAccessIterator,
129 typename _Compare > inline void sort (_RandomAccessIterator __first,
130 _RandomAccessIterator __last,
133 if (__first != __last)
135 std::__final_insertion_sort (__first, __last, __comp);
142 class SmallVectorBase
144 protected:void *BeginX, *EndX, *CapacityX;
148 protected: SmallVectorBase (size_t Size):BeginX (&FirstEl), EndX (&FirstEl),
149 CapacityX ((char *) &FirstEl + Size)
152 template < typename T > class SmallVectorTemplateCommon:public
155 public: SmallVectorTemplateCommon (size_t Size):SmallVectorBase (Size)
157 } typedef size_t size_type;
163 } size_type size () const
166 template < typename T, bool isPodLike > class SmallVectorTemplateBase:public SmallVectorTemplateCommon <
169 public: SmallVectorTemplateBase (size_t Size):SmallVectorTemplateCommon < T >
173 template < typename T > class SmallVectorImpl:public SmallVectorTemplateBase < T,
174 isPodLike < T >::value >
176 typedef SmallVectorTemplateBase < T, isPodLike < T >::value > SuperClass;
177 public:typedef typename SuperClass::iterator iterator;
178 explicit SmallVectorImpl (unsigned N):SmallVectorTemplateBase < T,
179 isPodLike < T >::value > (N * sizeof (T))
183 template < typename T,
184 unsigned N > class SmallVector:public SmallVectorImpl < T >
186 typedef typename SmallVectorImpl < T >::U U;
189 (static_cast < unsigned int >(sizeof (T)) * N + static_cast <
190 unsigned int >(sizeof (U)) - 1) /static_cast <
191 unsigned int >(sizeof (U)), NumInlineEltsElts =
192 MinUs > 1 ? (MinUs - 1) : 1, NumTsAvailable =
193 (NumInlineEltsElts + 1) * static_cast <
194 unsigned int >(sizeof (U)) / static_cast <
195 unsigned int >(sizeof (T)) };
196 public: SmallVector ():SmallVectorImpl < T > (NumTsAvailable)
200 struct LandingPadInfo
202 std::vector < int >TypeIds;
209 using namespace llvm;
211 DwarfException::PadLT (const LandingPadInfo * L, const LandingPadInfo * R)
213 const std::vector < int >&LIds = L->TypeIds, &RIds = R->TypeIds;
214 unsigned LSize = LIds.size (), RSize = RIds.size ();
215 unsigned MinSize = LSize < RSize ? LSize : RSize;
216 for (unsigned i = 0; i != MinSize; ++i)
217 if (LIds[i] != RIds[i])
218 return LIds[i] < RIds[i];
222 DwarfException::EmitExceptionTable ()
224 SmallVector < const LandingPadInfo *, 64 > LandingPads;
225 std::sort (LandingPads.begin (), LandingPads.end (), PadLT);
226 SmallVector < CallSiteEntry, 64 > CallSites;
227 for (unsigned i = 0, e = CallSites.size (); i < e; ++i)