1 /* { dg-do compile } */
4 typedef long unsigned int size_t;
10 template < typename T > double is_class_helper (...);
12 template < typename T > struct is_class
15 { value = sizeof (char) == sizeof (dont_use::is_class_helper < T > (0)) };
17 template < typename T > struct isPodLike
19 static const bool value = !is_class < T >::value;
22 namespace std __attribute__ ((__visibility__ ("default")))
24 template < typename _Iterator > struct iterator_traits
27 template < typename _Tp > struct iterator_traits <_Tp * >
29 typedef _Tp value_type;
33 namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
35 template < typename _Tp > class new_allocator
37 public:typedef size_t size_type;
38 typedef const _Tp & const_reference;
42 namespace std __attribute__ ((__visibility__ ("default")))
44 template < typename _Tp > class allocator:public __gnu_cxx::new_allocator <
47 public:typedef size_t size_type;
48 template < typename _Tp1 > struct rebind
50 typedef allocator < _Tp1 > other;
53 template < typename _Tp, typename _Alloc > struct _Vector_base
55 typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type;
57 template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp,
61 typedef _Vector_base < _Tp, _Alloc > _Base;
62 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
63 public:typedef _Tp value_type;
64 typedef typename _Tp_alloc_type::const_reference const_reference;
65 typedef size_t size_type;
66 size_type size () const
68 } const_reference operator[] (size_type __n) const
75 struct LandingPadInfo;
78 static bool PadLT (const LandingPadInfo * L, const LandingPadInfo * R);
82 void EmitExceptionTable ();
85 namespace std __attribute__ ((__visibility__ ("default")))
87 template < typename _RandomAccessIterator,
89 void __unguarded_linear_insert (_RandomAccessIterator __last,
92 typename iterator_traits < _RandomAccessIterator >::value_type __val =
94 _RandomAccessIterator __next = __last;
95 while (__comp (__val, *__next))
99 template < typename _RandomAccessIterator,
100 typename _Compare > void __insertion_sort (_RandomAccessIterator __first,
101 _RandomAccessIterator __last,
104 for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
106 if (__comp (*__i, *__first))
110 std::__unguarded_linear_insert (__i, __comp);
114 { _S_threshold = 16 };
115 template < typename _RandomAccessIterator,
117 void __final_insertion_sort (_RandomAccessIterator __first,
118 _RandomAccessIterator __last,
121 if (__last - __first > int (_S_threshold))
123 std::__insertion_sort (__first, __first + int (_S_threshold), __comp);
126 template < typename _RandomAccessIterator,
127 typename _Compare > inline void sort (_RandomAccessIterator __first,
128 _RandomAccessIterator __last,
131 if (__first != __last)
133 std::__final_insertion_sort (__first, __last, __comp);
140 class SmallVectorBase
142 protected:void *BeginX, *EndX, *CapacityX;
146 protected: SmallVectorBase (size_t Size):BeginX (&FirstEl), EndX (&FirstEl),
147 CapacityX ((char *) &FirstEl + Size)
150 template < typename T > class SmallVectorTemplateCommon:public
153 public: SmallVectorTemplateCommon (size_t Size):SmallVectorBase (Size)
155 } typedef size_t size_type;
161 } size_type size () const
164 template < typename T, bool isPodLike > class SmallVectorTemplateBase:public SmallVectorTemplateCommon <
167 public: SmallVectorTemplateBase (size_t Size):SmallVectorTemplateCommon < T >
171 template < typename T > class SmallVectorImpl:public SmallVectorTemplateBase < T,
172 isPodLike < T >::value >
174 typedef SmallVectorTemplateBase < T, isPodLike < T >::value > SuperClass;
175 public:typedef typename SuperClass::iterator iterator;
176 explicit SmallVectorImpl (unsigned N):SmallVectorTemplateBase < T,
177 isPodLike < T >::value > (N * sizeof (T))
181 template < typename T,
182 unsigned N > class SmallVector:public SmallVectorImpl < T >
184 typedef typename SmallVectorImpl < T >::U U;
187 (static_cast < unsigned int >(sizeof (T)) * N + static_cast <
188 unsigned int >(sizeof (U)) - 1) /static_cast <
189 unsigned int >(sizeof (U)), NumInlineEltsElts =
190 MinUs > 1 ? (MinUs - 1) : 1, NumTsAvailable =
191 (NumInlineEltsElts + 1) * static_cast <
192 unsigned int >(sizeof (U)) / static_cast <
193 unsigned int >(sizeof (T)) };
194 public: SmallVector ():SmallVectorImpl < T > (NumTsAvailable)
198 struct LandingPadInfo
200 std::vector < int >TypeIds;
207 using namespace llvm;
209 DwarfException::PadLT (const LandingPadInfo * L, const LandingPadInfo * R)
211 const std::vector < int >&LIds = L->TypeIds, &RIds = R->TypeIds;
212 unsigned LSize = LIds.size (), RSize = RIds.size ();
213 unsigned MinSize = LSize < RSize ? LSize : RSize;
214 for (unsigned i = 0; i != MinSize; ++i)
215 if (LIds[i] != RIds[i])
216 return LIds[i] < RIds[i];
220 DwarfException::EmitExceptionTable ()
222 SmallVector < const LandingPadInfo *, 64 > LandingPads;
223 std::sort (LandingPads.begin (), LandingPads.end (), PadLT);
224 SmallVector < CallSiteEntry, 64 > CallSites;
225 for (unsigned i = 0, e = CallSites.size (); i < e; ++i)