diff mbox

Two tiny libstdc++ cleanups

Message ID 20151003120939.GD12094@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely Oct. 3, 2015, 12:09 p.m. UTC
This fixes some misleading comments (getenv isn't used in those files)
and removes pretty-printer support for experimental::any objects that
use allocators, as the allocator feature was removed from the TS and
dropped in r218709 before it was included in a GCC release.

Tested powerpc64le-linux, committed to trunk.
diff mbox

Patch

commit f1c83d9bbd77d4c22b22051b409efbe12968d653
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Oct 3 00:56:55 2015 +0100

    Remove pretty printing for 'any' with allocators
    
    	* python/libstdcxx/v6/printers.py (StdExpAnyPrinter): Remove support
    	for _Manager_alloc.

diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 2d16786..12e732e 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -945,10 +945,6 @@  class StdExpAnyPrinter(SingleObjContainerPrinter):
                 valptr = self.val['_M_storage']['_M_buffer'].address
             elif '::_Manager_external' in mgrname:
                 valptr = self.val['_M_storage']['_M_ptr']
-            elif '::_Manager_alloc' in mgrname:
-                datatype = gdb.lookup_type(mgrname + '::_Data')
-                valptr = self.val['_M_storage']['_M_ptr'].cast(datatype.pointer())
-                valptr = valptr.dereference()['_M_data'].address
             else:
                 raise ValueError("Unknown manager function in std::experimental::any")
             contained_value = valptr.cast(self.contained_type.pointer()).dereference()

commit 934867ab0ab9b2648ce89daa43012bd3c8190e01
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat Oct 3 00:49:29 2015 +0100

    Fix comments saying why headers are included
    
    	* src/c++98/locale.cc: Fix comment.
    	* src/c++98/locale_init.cc: Likewise.

diff --git a/libstdc++-v3/src/c++98/locale.cc b/libstdc++-v3/src/c++98/locale.cc
index 1c29a56..3395c93 100644
--- a/libstdc++-v3/src/c++98/locale.cc
+++ b/libstdc++-v3/src/c++98/locale.cc
@@ -23,7 +23,6 @@ 
 #define _GLIBCXX_USE_CXX11_ABI 1
 #include <clocale>
 #include <cstring>
-#include <cstdlib>     // For getenv
 #include <cctype>
 #include <cwctype>     // For towupper, etc.
 #include <locale>
diff --git a/libstdc++-v3/src/c++98/locale_init.cc b/libstdc++-v3/src/c++98/locale_init.cc
index 0a95b9f..be7fd90 100644
--- a/libstdc++-v3/src/c++98/locale_init.cc
+++ b/libstdc++-v3/src/c++98/locale_init.cc
@@ -23,7 +23,7 @@ 
 #define _GLIBCXX_USE_CXX11_ABI 1
 #include <clocale>
 #include <cstring>
-#include <cstdlib>     // For getenv, free.
+#include <cstdlib>     // For free.
 #include <cctype>
 #include <cwctype>     // For towupper, etc.
 #include <locale>