summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorcarlo <carlo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-07 03:49:43 +0000
committercarlo <carlo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-07 03:49:43 +0000
commit4046179d7de3a660e70f74d144d03d7bb2972ccb (patch)
tree13b52bfca598ec66bc4bb307fc7d109f7486639d /libstdc++-v3
parent8f892548ff168991a99aa89de6732b66f4a5f045 (diff)
downloadgcc-4046179d7de3a660e70f74d144d03d7bb2972ccb.tar.gz
* include/bits/demangle.h
(qualifier_list<Allocator>::decode_qualifiers(string_type&, string_type&, bool) const): Made const. (qualifier_list<Allocator>::M_printing_suppressed): Added mutable. (_GLIBCXX_DEMANGLER_DOUT_ENTERING3, _GLIBCXX_DEMANGLER_RETURN3, std::ostream& operator<<(std::ostream&, qualifier const&), std::ostream& operator<<(std::ostream&, qualifier_list const&), qualifier_list<Allocator>::decode_qualifiers(string_type&, string_type&, bool) const, session<Allocator>::decode_type_with_postfix(string_type&, string_type&, qualifier_list<Allocator>*)) Added and/or changed debug-only hooks and code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog15
-rw-r--r--libstdc++-v3/include/bits/demangle.h60
2 files changed, 65 insertions, 10 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 8a54ea2966c..68c8571e440 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,18 @@
+2003-11-07 Carlo Wood <carlo@alinoe.com>
+
+ * include/bits/demangle.h
+ (qualifier_list<Allocator>::decode_qualifiers(string_type&,
+ string_type&, bool) const): Made const.
+ (qualifier_list<Allocator>::M_printing_suppressed): Added mutable.
+ (_GLIBCXX_DEMANGLER_DOUT_ENTERING3, _GLIBCXX_DEMANGLER_RETURN3,
+ std::ostream& operator<<(std::ostream&, qualifier const&),
+ std::ostream& operator<<(std::ostream&, qualifier_list const&),
+ qualifier_list<Allocator>::decode_qualifiers(string_type&,
+ string_type&, bool) const,
+ session<Allocator>::decode_type_with_postfix(string_type&,
+ string_type&, qualifier_list<Allocator>*))
+ Added and/or changed debug-only hooks and code.
+
2003-11-04 Jeffrey D. Oldham <oldham@codesourcery.com>
* libsupc++/vec.cc (__cxa_vec_delete2): If given a NULL pointer,
diff --git a/libstdc++-v3/include/bits/demangle.h b/libstdc++-v3/include/bits/demangle.h
index 4d2fa395a42..901eaa7e1b8 100644
--- a/libstdc++-v3/include/bits/demangle.h
+++ b/libstdc++-v3/include/bits/demangle.h
@@ -40,10 +40,10 @@
#define _GLIBCXX_DEMANGLER_DOUT(cntrl, data)
#define _GLIBCXX_DEMANGLER_DOUT_ENTERING(x)
#define _GLIBCXX_DEMANGLER_DOUT_ENTERING2(x)
-#define _GLIBCXX_DEMANGLER_RETURN \
- return M_result
-#define _GLIBCXX_DEMANGLER_RETURN2 \
- return M_result
+#define _GLIBCXX_DEMANGLER_DOUT_ENTERING3(x)
+#define _GLIBCXX_DEMANGLER_RETURN return M_result
+#define _GLIBCXX_DEMANGLER_RETURN2 return M_result
+#define _GLIBCXX_DEMANGLER_RETURN3
#define _GLIBCXX_DEMANGLER_FAILURE \
do { M_result = false; return false; } while(0)
#else
@@ -192,6 +192,28 @@ namespace __gnu_cxx
part_of_substitution(void) const
{ return M_part_of_substitution; }
+#if _GLIBCXX_DEMANGLER_CWDEBUG
+ friend std::ostream& operator<<(std::ostream& os, qualifier const& qual)
+ {
+ os << (char)qual.M_qualifier1;
+ if (qual.M_qualifier1 == vendor_extension ||
+ qual.M_qualifier1 == array ||
+ qual.M_qualifier1 == pointer_to_member)
+ os << " [" << qual.M_optional_type << ']';
+ else if (qual.M_qualifier1 == 'K' ||
+ qual.M_qualifier1 == 'V' ||
+ qual.M_qualifier1 == 'r')
+ {
+ if (qual.M_qualifier2)
+ {
+ os << (char)qual.M_qualifier2;
+ if (qual.M_qualifier3)
+ os << (char)qual.M_qualifier3;
+ }
+ }
+ return os;
+ }
+#endif
};
template<typename Allocator>
@@ -201,7 +223,7 @@ namespace __gnu_cxx
string_type;
private:
- bool M_printing_suppressed;
+ mutable bool M_printing_suppressed;
std::vector<qualifier<Allocator>, Allocator> M_qualifier_starts;
session<Allocator>& M_demangler;
@@ -240,7 +262,7 @@ namespace __gnu_cxx
void
decode_qualifiers(string_type& prefix,
string_type& postfix,
- bool member_function_pointer_qualifiers);
+ bool member_function_pointer_qualifiers) const;
bool
suppressed(void) const
@@ -254,6 +276,23 @@ namespace __gnu_cxx
size(void) const
{ return M_qualifier_starts.size(); }
+#if _GLIBCXX_DEMANGLER_CWDEBUG
+ friend std::ostream& operator<<(std::ostream& os, qualifier_list const& list)
+ {
+ typename std::vector<qualifier<Allocator>, Allocator>::const_iterator
+ iter = list.M_qualifier_starts.begin();
+ if (iter != list.M_qualifier_starts.end())
+ {
+ os << "{ " << *iter;
+ while (++iter != list.M_qualifier_starts.end())
+ os << ", " << *iter;
+ os << " }";
+ }
+ else
+ os << "{ }";
+ return os;
+ }
+#endif
};
template<typename Allocator>
@@ -1377,10 +1416,11 @@ namespace __gnu_cxx
qualifier_list<Allocator>::decode_qualifiers(
string_type& prefix,
string_type& postfix,
- bool member_function_pointer_qualifiers = false)
+ bool member_function_pointer_qualifiers = false) const
{
+ _GLIBCXX_DEMANGLER_DOUT_ENTERING3("decode_qualifiers");
for(typename std::vector<qualifier<Allocator>, Allocator>::
- reverse_iterator iter = M_qualifier_starts.rbegin();
+ const_reverse_iterator iter = M_qualifier_starts.rbegin();
iter != M_qualifier_starts.rend();)
{
if (!member_function_pointer_qualifiers
@@ -1442,6 +1482,7 @@ namespace __gnu_cxx
++iter;
}
M_printing_suppressed = false;
+ _GLIBCXX_DEMANGLER_RETURN3;
}
//
@@ -1451,8 +1492,7 @@ namespace __gnu_cxx
string_type& prefix, string_type& postfix,
qualifier_list<Allocator>* qualifiers)
{
- _GLIBCXX_DEMANGLER_DOUT_ENTERING2
- (qualifiers ? "decode_type" : "decode_type[with qualifiers]");
+ _GLIBCXX_DEMANGLER_DOUT_ENTERING2("decode_type");
++M_inside_type;
bool recursive_template_param_or_substitution_call;
if (!(recursive_template_param_or_substitution_call = qualifiers))