29.07.2013, 18:43, "Yang Chen" <[email protected]>:
> Hi Konstantin,
>
> I start traveling today and won't have constant internet access until
> Thursday. I will investigate it soon. Thanks!
>
> - Yang
>
> On 7/29/13 6:13 AM, Konstantin Tokarev wrote:
>
>> 29.07.2013, 12:42, "Konstantin Tokarev"<[email protected]>:
>>> Hi all,
>>>
>>> A couple of times I got clang_delta running infinitely with 100% CPU load.
>>> It would be great if there was some pre-defined or adpative time limit for
>>> it.
>> Attached test case for clang_delta hanging.
Attached reduced test case.
We have infinite recursion on operator<< here:
operator<<
CXXMethodDecl 0x3417b00 <clang_delta_hang.cpp:8:3, col:35> operator<< 'class
basic_ostream<char, int> (_Bool)'
`-ParmVarDecl 0x3417a40 <col:30, col:35> '_Bool'
gdb trace:
0x00000000006d332d in
clang::RecursiveASTVisitor<RNFStatementVisitor>::getDerived (this=0x166a470) at
/usr/local/include/clang/AST/RecursiveASTVisitor.h:143
143 Derived &getDerived() { return *static_cast<Derived*>(this); }
(gdb) bt
#0 0x00000000006d332d in
clang::RecursiveASTVisitor<RNFStatementVisitor>::getDerived (this=0x166a470) at
/usr/local/include/clang/AST/RecursiveASTVisitor.h:143
#1 0x00000000006ef68d in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromImplicitCastExpr
(this=0x166a470, S=0x1685500) at /usr/local/include/clang/AST/StmtNodes.inc:393
#2 0x00000000006d98af in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseImplicitCastExpr
(this=0x166a470, S=0x1685500) at
/usr/local/include/clang/AST/RecursiveASTVisitor.h:1993
#3 0x0000000000684e9e in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x1685500) at /usr/local/include/clang/AST/StmtNodes.inc:393
#4 0x00000000006d991a in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseImplicitCastExpr
(this=0x166a470, S=0x1685518) at
/usr/local/include/clang/AST/RecursiveASTVisitor.h:1993
#5 0x0000000000684e9e in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x1685518) at /usr/local/include/clang/AST/StmtNodes.inc:393
#6 0x000000000068148c in RNFStatementVisitor::VisitCallExpr (this=0x166a470,
CallE=0x1685570) at RemoveNestedFunction.cpp:142
#7 0x00000000006eff7a in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCallExpr
(this=0x166a470, S=0x1685570) at /usr/local/include/clang/AST/StmtNodes.inc:299
#8 0x00000000006f0007 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCXXOperatorCallExpr
(this=0x166a470, S=0x1685570) at /usr/local/include/clang/AST/StmtNodes.inc:315
#9 0x00000000006f9f76 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverseNode
(this=0x166a470, S=0x1685570, EnqueueChildren=@0x7ffffffeb30f: true) at
/usr/local/include/clang/AST/StmtNodes.inc:315
#10 0x00000000006d3511 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverse (this=0x166a470,
S=0x1685678) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:453
#11 0x0000000000683615 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x1685678) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:541
#12 0x000000000068148c in RNFStatementVisitor::VisitCallExpr (this=0x166a470,
CallE=0x1685820) at RemoveNestedFunction.cpp:142
#13 0x00000000006eff7a in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCallExpr
(this=0x166a470, S=0x1685820) at /usr/local/include/clang/AST/StmtNodes.inc:299
#14 0x00000000006f0007 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCXXOperatorCallExpr
(this=0x166a470, S=0x1685820) at /usr/local/include/clang/AST/StmtNodes.inc:315
#15 0x00000000006f9f76 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverseNode
(this=0x166a470, S=0x1685820, EnqueueChildren=@0x7ffffffedf9f: true) at
/usr/local/include/clang/AST/StmtNodes.inc:315
#16 0x00000000006d3511 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverse (this=0x166a470,
S=0x1685820) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:453
#17 0x0000000000683615 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x1685820) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:541
#18 0x000000000068148c in RNFStatementVisitor::VisitCallExpr (this=0x166a470,
CallE=0x1685928) at RemoveNestedFunction.cpp:142
#19 0x00000000006eff7a in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCallExpr
(this=0x166a470, S=0x1685928) at /usr/local/include/clang/AST/StmtNodes.inc:299
#20 0x00000000006f0007 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCXXOperatorCallExpr
(this=0x166a470, S=0x1685928) at /usr/local/include/clang/AST/StmtNodes.inc:315
#21 0x00000000006f9f76 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverseNode
(this=0x166a470, S=0x1685928, EnqueueChildren=@0x7fffffff0c2f: true) at
/usr/local/include/clang/AST/StmtNodes.inc:315
#22 0x00000000006d3511 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverse (this=0x166a470,
S=0x1685928) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:453
#23 0x0000000000683615 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x1685928) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:541
#24 0x000000000068148c in RNFStatementVisitor::VisitCallExpr (this=0x166a470,
CallE=0x1685ad0) at RemoveNestedFunction.cpp:142
#25 0x00000000006eff7a in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCallExpr
(this=0x166a470, S=0x1685ad0) at /usr/local/include/clang/AST/StmtNodes.inc:299
#26 0x00000000006f0007 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCXXOperatorCallExpr
(this=0x166a470, S=0x1685ad0) at /usr/local/include/clang/AST/StmtNodes.inc:315
#27 0x00000000006f9f76 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverseNode
(this=0x166a470, S=0x1685ad0, EnqueueChildren=@0x7fffffff38bf: true) at
/usr/local/include/clang/AST/StmtNodes.inc:315
#28 0x00000000006d3511 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverse (this=0x166a470,
S=0x1685d90) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:453
#29 0x0000000000683615 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x1685d90) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:541
#30 0x000000000068148c in RNFStatementVisitor::VisitCallExpr (this=0x166a470,
CallE=0x1685e98) at RemoveNestedFunction.cpp:142
#31 0x00000000006eff7a in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCallExpr
(this=0x166a470, S=0x1685e98) at /usr/local/include/clang/AST/StmtNodes.inc:299
#32 0x00000000006f0007 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCXXOperatorCallExpr
(this=0x166a470, S=0x1685e98) at /usr/local/include/clang/AST/StmtNodes.inc:315
#33 0x00000000006f9f76 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverseNode
(this=0x166a470, S=0x1685e98, EnqueueChildren=@0x7fffffff654f: true) at
/usr/local/include/clang/AST/StmtNodes.inc:315
#34 0x00000000006d3511 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverse (this=0x166a470,
S=0x16860c8) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:453
#35 0x0000000000683615 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x16860c8) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:541
#36 0x000000000068148c in RNFStatementVisitor::VisitCallExpr (this=0x166a470,
CallE=0x1686218) at RemoveNestedFunction.cpp:142
#37 0x00000000006eff7a in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCallExpr
(this=0x166a470, S=0x1686218) at /usr/local/include/clang/AST/StmtNodes.inc:299
#38 0x00000000006f0007 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::WalkUpFromCXXOperatorCallExpr
(this=0x166a470, S=0x1686218) at /usr/local/include/clang/AST/StmtNodes.inc:315
#39 0x00000000006f9f76 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverseNode
(this=0x166a470, S=0x1686218, EnqueueChildren=@0x7fffffff91df: true) at
/usr/local/include/clang/AST/StmtNodes.inc:315
#40 0x00000000006d3511 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::dataTraverse (this=0x166a470,
S=0x1686888) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:453
#41 0x0000000000683615 in
clang::RecursiveASTVisitor<RNFStatementVisitor>::TraverseStmt (this=0x166a470,
S=0x1686888) at /usr/local/include/clang/AST/RecursiveASTVisitor.h:541
#42 0x000000000068148c in RNFStatementVisitor::VisitCallExpr (this=0x166a470,
CallE=0x16869b0) at RemoveNestedFunction.cpp:142
--
Regards,
Konstantin typedef int pthread_mutex_t;
enum __rw_fmtflags { __rw_boolalpha , __rw_dec , __rw_fixed , __rw_hex , __rw_internal , __rw_left , __rw_oct , __rw_right , __rw_scientific , __rw_showbase , __rw_showpoint , __rw_showpos , __rw_skipws , __rw_unitbuf , __rw_uppercase , __rw_bin , __rw_basefield , __rw_adjustfield , __rw_floatfield , __rw_nolock , __rw_nolockbuf };
enum __rw_iostate { __rw_goodbit , __rw_badbit , __rw_eofbit , __rw_failbit , _ };
enum __rw_openmode { __rw_app , __rw_binary , __rw_in , __rw_out , __rw_in_out , __rw_trunc , __rw_ate , __rw_nocreate , __rw_noreplace , __rw_stdio , __rw_native };
inline __rw_openmode& operator|= (__rw_openmode &__lhs, __rw_openmode __rhs) { return __lhs = __rw_openmode (long (__lhs) | __rhs); }
;
inline __rw_openmode operator| (__rw_openmode __lhs, __rw_openmode __rhs) { return __lhs |= __rhs; }
enum __rw_seekdir { __rw_beg , __rw_cur , __rw_end };
namespace std { template <class _Iterator> struct iterator_traits ; struct input_iterator_tag { }; struct forward_iterator_tag : public input_iterator_tag { }; struct random_access_iterator_tag : public forward_iterator_tag { }; template <class _TypeT> struct iterator_traits { typedef long difference_type; typedef int& reference; typedef random_access_iterator_tag iterator_category; }; template <class _TypeT> struct iterator_traits<const _TypeT*> { typedef _TypeT value_type; typedef long difference_type; typedef const value_type* pointer; typedef const value_type& reference; typedef random_access_iterator_tag iterator_category; }; struct iterator { typedef void reference; }; template <class _TypeT> void __iterator_category (void) ; template <class _Category, class _TypeT, class _Distance, class _Pointer, class _Reference> void __iterator_category (void) ; template <class _Tag> void __is_input_iterator (void) ; template <class _Tag> void __is_bidirectional_iterator (void) ; template <class _Tag> void __is_random_access_iterator (void) ; ; template <class _Iterator> void __value_type (void) ; template <class _Iterator> void __distance_type (void) ; template <class _InputIterator, class _Distance> inline void __advance (_InputIterator &__it, _Distance __n, input_iterator_tag) ; template <class _ForwardIterator, class _Distance> inline void __advance ( void) ; template <class _BidirectionalIterator, class _Distance> inline void __advance (void) ; template <class _RandomAccessIterator, class _Distance> inline void __advance (_RandomAccessIterator& __it, _Distance __n, random_access_iterator_tag) { __it += __n; } template <class _InputIterator, class _Distance> inline void advance (_InputIterator& __it, _Distance __n) { __advance (__it, __n, typename std::iterator_traits< _InputIterator >::iterator_category ()); } template <class _InputIterator, class _Distance> inline void __distance (const _InputIterator &__first, const _InputIterator &__last, _Distance &__n, input_iterator_tag) ; template <class _ForwardIterator, class _Distance> inline void __distance ( void) ; template <class _BidirectionalIterator, class _Distance> inline void __distance ( void) ; template <class _RandomAccessIterator, class _Distance> inline void __distance (const _RandomAccessIterator &__first, const _RandomAccessIterator &__last, _Distance &__n, random_access_iterator_tag) { __n = __last - __first; } template <class _ForwardIterator> inline typename iterator_traits<_ForwardIterator>::difference_type distance (_ForwardIterator __first, _ForwardIterator __last) { typename iterator_traits<_ForwardIterator>::difference_type __n = 0; __distance (__first, __last, __n, typename std::iterator_traits< _ForwardIterator >::iterator_category ()); return __n; } template <class _ForwardIterator, class _Distance> inline void distance ( void) ; }
namespace std { template <class _Iterator> class reverse_iterator : public iterator { typedef _Iterator traits_type; public: typedef typename traits_type::difference_type difference_type; typedef typename traits_type::value_type value_type; typedef typename traits_type::pointer pointer; typedef typename traits_type::reference reference; template <class _TypeU> void base () const ; ; ; protected: _Iterator current; }; template <class _Iterator> void operator== (const reverse_iterator <_Iterator>& __x, const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void operator< (const reverse_iterator <_Iterator>& __x, const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void operator!= (const reverse_iterator <_Iterator>& __x, const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void operator> (const reverse_iterator <_Iterator>& __x, const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void operator>= (const reverse_iterator <_Iterator>& __x, const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void operator<= (const reverse_iterator <_Iterator>& __x, const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void operator- (const reverse_iterator <_Iterator>& __x, const reverse_iterator <_Iterator>& __y) ; template <class _Iterator> void operator+ (typename iterator_traits<_Iterator>::difference_type __n, const reverse_iterator <_Iterator>& __x) ; class back_insert_iterator: public iterator { public: ; protected: int container; }; class front_insert_iterator: public iterator { public: ; protected: int container; }; template <class _Container> void front_inserter (void) ; template <class _Container> class insert_iterator: public iterator { public: typedef _Container container_type; ; protected: typename container_type::iterator iter; container_type container; }; template <class _Container, class _Iterator> void inserter ( void) ; }
void __rw_throw (int, ...);
template <class _TypeT> struct __rw_select_int { typedef void* _SelectT; };
template struct __rw_select_int<long long> ;
template struct __rw_select_int<wchar_t> ;
template <class _Container> inline typename _Container::size_type __rw_new_capacity (typename _Container::size_type __size, const _Container*) { typedef typename _Container::size_type _RWSizeT; const _RWSizeT __ratio = _RWSizeT (8 < 0) / 1000; const _RWSizeT __cap = __size > 0 * __ratio + (0 * __ratio >> 0); return __size += 2 > __cap; }
namespace std { template <class _TypeT> class allocator; template<> class allocator<void> { public: typedef void value_type; typedef value_type* pointer; typedef const value_type* const_pointer; }; template <class _TypeT> class allocator { public: typedef unsigned long size_type; typedef long difference_type; typedef _TypeT value_type; typedef value_type* pointer; typedef const value_type* const_pointer; typedef value_type& reference; typedef const value_type& const_reference; allocator () ; struct rebind ; template <class _TypeU> allocator (void) ; template <class _TypeU> void operator= (const allocator&) ; ; pointer allocate (size_type __n, allocator<void>::const_pointer = 0) ; void deallocate (pointer __p, size_type __n) ; ; ; void destroy (pointer __p) ; }; template <class _TypeT> class allocator ; template <class _TypeT, class _TypeU> inline bool operator== (const allocator<_TypeT>&, const allocator<_TypeU>&) { return true; } template <class _TypeT, class _TypeU> void operator!= (const allocator<_TypeT>& __x, const allocator<_TypeU>& __y) ; }
namespace std { class exception ; }
using std::exception;
class __rw_mutex { public: public: ; ; ; private: ; ; pthread_mutex_t _C_mutex;};
struct __rw_synchronized { };
namespace std { template <class _CharT> struct char_traits; template <class _CharT> struct char_traits ; template<> struct char_traits<char> { typedef int int_type; typedef long off_type; typedef int pos_type; static int_type eof ; ; static bool lt ; ; static unsigned long length (const char *__s) { return __builtin_strlen (__s); } static char copy ; static bool eq_int_type ; static char to_char_type ; static int_type to_int_type ; }; template<> struct char_traits<wchar_t> { typedef unsigned int_type; typedef long off_type; typedef int pos_type; static bool eq ; }; }
struct __null_ref { int _C_eos; ; ; ; };
namespace std { template < class _Traits, class _Allocator> class basic_string: private std::allocator<char> { public: typedef char value_type; typedef __null_ref _C_string_ref_type; typedef std::allocator<char> _C_ref_alloc_type; typedef long difference_type; typedef typename std::allocator<char>::reference reference; typedef typename std::allocator<char>::const_reference const_reference; typedef typename std::allocator<char>::pointer iterator; ; typedef std::reverse_iterator<iterator> reverse_iterator; static const unsigned long npos = typename std::allocator<char>::size_type (446744073709551615); explicit basic_string (const std::allocator<char> &__alloc = std::allocator<char> ()) : _C_data () { } ; ; ; ; ; template <class _InputIter> basic_string (void); ; iterator begin ; iterator end ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; template<class _InputIter> basic_string& append ( void) ; template<class _InputIter> void append ( void) ; ; ; ; ; template<class _InputIter> void assign (void) ; template<class _InputIter> basic_string& assign ( void) ; ; ; ; template<class _InputIter> void insert ( void) ; template <class _InputIter> void insert (iterator __p) ; ; ; ; private: static unsigned long _C_min ; public: template <class _InputIter> void __replace_aux (void); ; public: ; ; ; ; ; template<class _InputIter> void replace ( iterator __last1); template<class _InputIter> void replace ( void) ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; private: ; ; ; ; friend struct __null_ref; static __null_ref _C_null_ref; static __null_ref _C_nullref ; _C_string_ref_type _C_get_rep ; typename std::allocator<char>::pointer _C_data; }; template <class _CharT, class _Traits , class _Allocator> void operator+ (const basic_string< _Traits, _Allocator> &__lhs, const basic_string< _Traits, _Allocator> &__rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator+ (const _CharT* __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator+ (_CharT __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator+ (const basic_string< _Traits, _Allocator>& __lhs, const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator+ (const basic_string< _Traits, _Allocator>& __lhs, _CharT __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator== (const basic_string< _Traits, _Allocator>& __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> inline bool operator== (const _CharT* __lhs, const basic_string< _Traits, _Allocator>& __rhs) { unsigned long __trans_tmp_1; const char *__s = __lhs; __trans_tmp_1 = __builtin_strlen (__s); const typename _Allocator::size_type __n = __trans_tmp_1; return 0 == __n && !0; } template <class _CharT, class _Traits , class _Allocator> inline bool operator== (const basic_string< _Traits, _Allocator>& __lhs, const _CharT* __rhs) { return __rhs == __lhs; } template <class _CharT, class _Traits , class _Allocator> void operator< (const basic_string< _Traits, _Allocator>& __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator< (const _CharT* __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator< (const basic_string< _Traits, _Allocator>& __lhs, const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator!= (const basic_string< _Traits, _Allocator>& __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator> (const basic_string< _Traits, _Allocator>& __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator<= (const basic_string< _Traits, _Allocator>& __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator>= (const basic_string< _Traits, _Allocator>& __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits, class _Allocator> inline void swap ( void) ; template <class _CharT, class _Traits , class _Allocator> void operator!= (const _CharT* __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator!= (const basic_string< _Traits, _Allocator>& __lhs, const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator> (const _CharT* __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator> (const basic_string< _Traits, _Allocator>& __lhs, const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator<= (const _CharT* __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator<= (const basic_string< _Traits, _Allocator>& __lhs, const _CharT* __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator>= (const _CharT* __lhs, const basic_string< _Traits, _Allocator>& __rhs) ; template <class _CharT, class _Traits , class _Allocator> void operator>= (const basic_string< _Traits, _Allocator>& __lhs, const _CharT* __rhs) ; }
namespace std { template <class _TypeT> class allocator; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ios; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_streambuf; template <class _CharT > class basic_istream; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_iostream; typedef basic_iostream<char> iostream; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ostream; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_stringbuf; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_istringstream; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_ostringstream; template <class _CharT, class _Traits = char_traits<_CharT> > class basic_stringstream; typedef int fstream; }
enum __rw_locale_category { __rw_cat_none , __rw_cat_collate , __rw_cat_ctype , __rw_cat_monetary , __rw_cat_numeric , __rw_cat_time , __rw_cat_messages , __rw_cat_all };
namespace std { template <class _Facet> void use_facet (void ) ; template <class _Facet> void has_facet (void ) ; template < class _Iter> struct money_get; struct num_get; struct num_put; struct time_put; template <class _CharT> class messages; struct locale { static const int none = __rw_cat_none; static const int collate = __rw_cat_collate; static const int ctype = __rw_cat_ctype; static const int monetary = __rw_cat_monetary; static const int numeric = __rw_cat_numeric; static const int time = __rw_cat_time; static const int messages = __rw_cat_messages; static const int a = __rw_cat_all; ; ; ; ; template <class _Facet> locale (void); template <class _Facet> void combine (void) const; template <class _CharT, class _Traits, class _Allocator> void operator() (const basic_string< _Traits, _Allocator>&, const basic_string< _Traits, _Allocator>&) const; ; ~locale() ; ; ; ; ; static const locale& classic ; private: ; ; ; friend class __rw_locale; friend struct __rw_access; ; ; }; }
namespace std { struct ios_base: __rw_synchronized { static const __rw_fmtflags boolalpha = __rw_boolalpha; static const __rw_fmtflags c = __rw_dec; static const __rw_fmtflags fixed = __rw_fixed; static const __rw_fmtflags hex = __rw_hex; static const __rw_fmtflags internal = __rw_internal; static const __rw_fmtflags left = __rw_left; static const __rw_fmtflags oct = __rw_oct; static const __rw_fmtflags right = __rw_right; static const __rw_fmtflags scientific = __rw_scientific; static const __rw_fmtflags showbase = __rw_showbase; static const __rw_fmtflags showpoint = __rw_showpoint; static const __rw_fmtflags showpos = __rw_showpos; static const __rw_fmtflags skipws = __rw_skipws; static const __rw_fmtflags unitbuf = __rw_unitbuf; static const __rw_fmtflags uppercase = __rw_uppercase; static const __rw_fmtflags bin = __rw_bin; static const __rw_fmtflags basefield = __rw_basefield; static const __rw_fmtflags adjustfield = __rw_adjustfield; static const __rw_fmtflags floatfield = __rw_floatfield; static const __rw_fmtflags nolock = __rw_nolock; static const __rw_fmtflags nolockbuf = __rw_nolockbuf; static const __rw_iostate goodbit = __rw_goodbit; static const __rw_iostate badbit = __rw_badbit; static const __rw_iostate eofbit = __rw_eofbit; static const __rw_iostate failbit = __rw_failbit; typedef __rw_openmode openmode; static const openmode app = __rw_app; static const openmode binary = __rw_binary; static const openmode in = __rw_in; static const openmode out = __rw_out; static const openmode trunc = __rw_trunc; static const openmode ate = __rw_ate; static const openmode nocreate = __rw_nocreate; static const openmode noreplace = __rw_noreplace; static const openmode stdio = __rw_stdio; static const openmode native = __rw_native; static const __rw_seekdir beg = __rw_beg; static const __rw_seekdir cur = __rw_cur; static const __rw_seekdir end = __rw_end; struct Init ; ; ; ; ; ; ; ; ; ; ; ; static int xalloc ; ; enum event { }; typedef void *event_callback; ; static bool sync_with_stdio ; virtual ~ios_base (); protected: ; ; ; ; ; static bool _C_sync_with_stdio; private: ; public: struct _C_usr_data; protected: _C_usr_data *_C_usr; friend struct Init; friend struct _C_usr_data; }; }
namespace std { template<class _CharT, class _Traits> class basic_streambuf: public __rw_synchronized { public: typedef _Traits traits_type; typedef typename traits_type::int_type int_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::off_type off_type; ; locale pubimbue ; locale& getloc ; basic_streambuf* pubsetbuf ; ; long in_avail ; int_type sbumpc ; long sgetn ; int_type sputbackc ; int_type sungetc ; int_type sputc ; ; protected: basic_streambuf (ios_base::openmode = __rw_in | __rw_out); ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; enum { _C_unbuffered }; void _C_own_buf (bool __own) ; ; ; ; int _C_buffer; unsigned long _C_bufsize; int _C_state; private: int _C_eback; int _C_gptr; int _C_egptr; int _C_pbase; int _C_pptr; int _C_epptr; locale _C_locale; friend class basic_istreamchar_type; friend class basic_ostream<int, traits_type>; template <class _Char2, class _Traits2, class _Allocator> void getline ( void); template <class _Char2, class _Traits2, class _Allocator> friend basic_istream<_Char2>& operator> (basic_istream<_Char2>&, basic_string< _Traits2, _Allocator>&); }; }
namespace std { template <class _TypeT> void min(void) ; template <class _TypeT, class _Compare> void min( void) ; inline const unsigned long& max(const unsigned long& __a, const unsigned long& __b) { return __b; } template <class _TypeT, class _Compare> void max( void) ; template <class _InputIter, class _OutputIter> inline _OutputIter copy (_InputIter __first, _InputIter __last, _OutputIter __res) { ; for (; !(__first == __last); ++__first,++__res) *__res = *__first; return __res; } template <class _BidirIter1, class _BidirIter2> void copy_backward ( void) ; template <class _FwdIter, class _TypeT> void fill (void) ; template <class _FwdIter, class _TypeT> void fill ( void) ; template <class _OutputIter, class _Size, class _TypeT> void fill_n ( void) ; template <class _OutputIter, class _Size, class _TypeT> void fill_n ( void) ; }
namespace std { template <class _CharT, class _Traits> class basic_ios: public ios_base { public: typedef _Traits traits_type; typedef typename traits_type::pos_type pos_type; typedef typename traits_type::int_type off_type; protected: typedef basic_streambuf<int, traits_type> streambuf_type; typedef basic_ostream<int, traits_type> ostream_type; public: private: public: ; ; ; ; ; ; ; ; ; basic_ios& copyfmt ; ; int fill ; ; ; protected: basic_ios () ; ; ; private: ; ; typename traits_type::int_type _C_fill; }; }
namespace std { extern template class basic_ios<char, char_traits<char> >; extern template class basic_ios<wchar_t, char_traits<wchar_t> >; }
template<class _CharT, class _Traits, class _StringT> void __rw_insert (std::basic_ostream<_CharT, _Traits> &__strm, const _StringT *__s, long __len, long __width);
void usage (void) { //argv[0] = "bigfib";
cerr << "USAGE : " << endl << " " << &usage_argv_0 << " " << setw () << std::left << "all" << " ---> Fibonacci [0 - N]" << endl << " " << &usage_argv_0 << " " << std::left << setw () << "th" << " ---> Fibonacci [N]" << endl << " " << &usage_argv_0 << " " << std::left << setw () << "some" << " [ ...] ---> Fibonacci [N1], Fibonacci [N2], ..." << endl << " " << &usage_argv_0 << " " << std::left << setw () << "rand" << " [] ---> K random Fibonacci numbers < M; Default = " << 5000 << " " << endl; }
unsigned int main_N;
bool main___trans_tmp_5;
bool main___trans_tmp_3;
bool main___trans_tmp_4;
int main (int argc, char **argv) { basic_string< char_traits<char>, allocator<char> > option ; if (0) ; else ; const basic_string< std::char_traits<char>, std::allocator<char> > &__lhs = option; const char *__rhs = "all"; main___trans_tmp_3 = __rhs == __lhs; if (main___trans_tmp_3) if (main___trans_tmp_4) if (main___trans_tmp_5) if (option == "rand") { const int max_rand_fib = argc == 0; Fibonacci fib; for (unsigned int i = 0; 0 < main_N; i++) fib.show_number (0%max_rand_fib); } return 0; }
// this should reproduce the crash:
// /home/kostya/src/git/creduce/creduce/../clang_delta/clang_delta --transformation=remove-nested-function --counter=1 /home/kostya/projects/psclang/reduce/bigfib-stdcxx_3/clang_delta_crash_tmp_filey37UB2.cpp