| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-Wno-return-type" } */ |
| 3 |
|
| 4 |
extern "C" |
| 5 |
{ |
| 6 |
typedef long unsigned int size_t; |
| 7 |
} |
| 8 |
namespace llvm |
| 9 |
{ |
| 10 |
namespace dont_use |
| 11 |
{ |
| 12 |
template < typename T > double is_class_helper (...); |
| 13 |
} |
| 14 |
template < typename T > struct is_class |
| 15 |
{ |
| 16 |
public:enum |
| 17 |
{ value = sizeof (char) == sizeof (dont_use::is_class_helper < T > (0)) }; |
| 18 |
}; |
| 19 |
template < typename T > struct isPodLike |
| 20 |
{ |
| 21 |
static const bool value = !is_class < T >::value; |
| 22 |
}; |
| 23 |
} |
| 24 |
namespace std __attribute__ ((__visibility__ ("default"))) |
| 25 |
{ |
| 26 |
template < typename _Iterator > struct iterator_traits |
| 27 |
{ |
| 28 |
}; |
| 29 |
template < typename _Tp > struct iterator_traits <_Tp * > |
| 30 |
{ |
| 31 |
typedef _Tp value_type; |
| 32 |
}; |
| 33 |
} |
| 34 |
|
| 35 |
namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) |
| 36 |
{ |
| 37 |
template < typename _Tp > class new_allocator |
| 38 |
{ |
| 39 |
public:typedef size_t size_type; |
| 40 |
typedef const _Tp & const_reference; |
| 41 |
}; |
| 42 |
} |
| 43 |
|
| 44 |
namespace std __attribute__ ((__visibility__ ("default"))) |
| 45 |
{ |
| 46 |
template < typename _Tp > class allocator:public __gnu_cxx::new_allocator < |
| 47 |
_Tp > |
| 48 |
{ |
| 49 |
public:typedef size_t size_type; |
| 50 |
template < typename _Tp1 > struct rebind |
| 51 |
{ |
| 52 |
typedef allocator < _Tp1 > other; |
| 53 |
}; |
| 54 |
}; |
| 55 |
template < typename _Tp, typename _Alloc > struct _Vector_base |
| 56 |
{ |
| 57 |
typedef typename _Alloc::template rebind < _Tp >::other _Tp_alloc_type; |
| 58 |
}; |
| 59 |
template < typename _Tp, typename _Alloc = std::allocator < _Tp > >class vector:protected _Vector_base < _Tp, |
| 60 |
_Alloc |
| 61 |
> |
| 62 |
{ |
| 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 |
| 69 |
{ |
| 70 |
} const_reference operator[] (size_type __n) const |
| 71 |
{ |
| 72 |
}}; |
| 73 |
} |
| 74 |
|
| 75 |
namespace llvm |
| 76 |
{ |
| 77 |
struct LandingPadInfo; |
| 78 |
class DwarfException |
| 79 |
{ |
| 80 |
static bool PadLT (const LandingPadInfo * L, const LandingPadInfo * R); |
| 81 |
struct CallSiteEntry |
| 82 |
{ |
| 83 |
}; |
| 84 |
void EmitExceptionTable (); |
| 85 |
}; |
| 86 |
} |
| 87 |
namespace std __attribute__ ((__visibility__ ("default"))) |
| 88 |
{ |
| 89 |
template < typename _RandomAccessIterator, |
| 90 |
typename _Compare > |
| 91 |
void __unguarded_linear_insert (_RandomAccessIterator __last, |
| 92 |
_Compare __comp) |
| 93 |
{ |
| 94 |
typename iterator_traits < _RandomAccessIterator >::value_type __val = |
| 95 |
(*__last); |
| 96 |
_RandomAccessIterator __next = __last; |
| 97 |
while (__comp (__val, *__next)) |
| 98 |
{ |
| 99 |
} |
| 100 |
} |
| 101 |
template < typename _RandomAccessIterator, |
| 102 |
typename _Compare > void __insertion_sort (_RandomAccessIterator __first, |
| 103 |
_RandomAccessIterator __last, |
| 104 |
_Compare __comp) |
| 105 |
{ |
| 106 |
for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i) |
| 107 |
{ |
| 108 |
if (__comp (*__i, *__first)) |
| 109 |
{ |
| 110 |
} |
| 111 |
else |
| 112 |
std::__unguarded_linear_insert (__i, __comp); |
| 113 |
} |
| 114 |
} |
| 115 |
enum |
| 116 |
{ _S_threshold = 16 }; |
| 117 |
template < typename _RandomAccessIterator, |
| 118 |
typename _Compare > |
| 119 |
void __final_insertion_sort (_RandomAccessIterator __first, |
| 120 |
_RandomAccessIterator __last, |
| 121 |
_Compare __comp) |
| 122 |
{ |
| 123 |
if (__last - __first > int (_S_threshold)) |
| 124 |
{ |
| 125 |
std::__insertion_sort (__first, __first + int (_S_threshold), __comp); |
| 126 |
} |
| 127 |
} |
| 128 |
template < typename _RandomAccessIterator, |
| 129 |
typename _Compare > inline void sort (_RandomAccessIterator __first, |
| 130 |
_RandomAccessIterator __last, |
| 131 |
_Compare __comp) |
| 132 |
{ |
| 133 |
if (__first != __last) |
| 134 |
{ |
| 135 |
std::__final_insertion_sort (__first, __last, __comp); |
| 136 |
} |
| 137 |
} |
| 138 |
} |
| 139 |
|
| 140 |
namespace llvm |
| 141 |
{ |
| 142 |
class SmallVectorBase |
| 143 |
{ |
| 144 |
protected:void *BeginX, *EndX, *CapacityX; |
| 145 |
struct U |
| 146 |
{ |
| 147 |
} FirstEl; |
| 148 |
protected: SmallVectorBase (size_t Size):BeginX (&FirstEl), EndX (&FirstEl), |
| 149 |
CapacityX ((char *) &FirstEl + Size) |
| 150 |
{ |
| 151 |
}}; |
| 152 |
template < typename T > class SmallVectorTemplateCommon:public |
| 153 |
SmallVectorBase |
| 154 |
{ |
| 155 |
public: SmallVectorTemplateCommon (size_t Size):SmallVectorBase (Size) |
| 156 |
{ |
| 157 |
} typedef size_t size_type; |
| 158 |
typedef T *iterator; |
| 159 |
iterator begin () |
| 160 |
{ |
| 161 |
} iterator end () |
| 162 |
{ |
| 163 |
} size_type size () const |
| 164 |
{ |
| 165 |
}}; |
| 166 |
template < typename T, bool isPodLike > class SmallVectorTemplateBase:public SmallVectorTemplateCommon < |
| 167 |
T > |
| 168 |
{ |
| 169 |
public: SmallVectorTemplateBase (size_t Size):SmallVectorTemplateCommon < T > |
| 170 |
(Size) |
| 171 |
{ |
| 172 |
}}; |
| 173 |
template < typename T > class SmallVectorImpl:public SmallVectorTemplateBase < T, |
| 174 |
isPodLike < T >::value > |
| 175 |
{ |
| 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)) |
| 180 |
{ |
| 181 |
} |
| 182 |
}; |
| 183 |
template < typename T, |
| 184 |
unsigned N > class SmallVector:public SmallVectorImpl < T > |
| 185 |
{ |
| 186 |
typedef typename SmallVectorImpl < T >::U U; |
| 187 |
enum |
| 188 |
{ MinUs = |
| 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) |
| 197 |
{ |
| 198 |
} |
| 199 |
}; |
| 200 |
struct LandingPadInfo |
| 201 |
{ |
| 202 |
std::vector < int >TypeIds; |
| 203 |
union |
| 204 |
{ |
| 205 |
} Contents; |
| 206 |
}; |
| 207 |
} |
| 208 |
|
| 209 |
using namespace llvm; |
| 210 |
bool |
| 211 |
DwarfException::PadLT (const LandingPadInfo * L, const LandingPadInfo * R) |
| 212 |
{ |
| 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]; |
| 219 |
} |
| 220 |
|
| 221 |
void |
| 222 |
DwarfException::EmitExceptionTable () |
| 223 |
{ |
| 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) |
| 228 |
{ |
| 229 |
} |
| 230 |
} |