[libcxxabi] r193169 - Move local Db type out to namespace scope.

Howard Hinnant hhinnant at apple.com
Tue Oct 22 09:45:48 PDT 2013


Author: hhinnant
Date: Tue Oct 22 11:45:48 2013
New Revision: 193169

URL: http://llvm.org/viewvc/llvm-project?rev=193169&view=rev
Log:
Move local Db type out to namespace scope.

Modified:
    libcxxabi/trunk/src/cxa_demangle.cpp

Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=193169&r1=193168&r2=193169&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Tue Oct 22 11:45:48 2013
@@ -4591,6 +4591,29 @@ struct string_pair
     String move_full() {return std::move(first) + std::move(second);}
 };
 
+struct Db
+{
+    typedef String String;
+    typedef Vector<string_pair> sub_type;
+    typedef Vector<sub_type> template_param_type;
+    Vector<string_pair> names;
+    Vector<sub_type> subs;
+    Vector<template_param_type> template_param;
+    unsigned cv;
+    unsigned ref;
+    bool parsed_ctor_dtor_cv;
+    bool tag_templates;
+    bool fix_forward_references;
+    bool try_to_parse_template_args;
+
+    template <size_t N>
+    Db(arena<N>& ar) :
+        names(ar),
+        subs(0, names, ar),
+        template_param(0, subs, ar)
+    {}
+};
+
 }  // unnamed namespace
 
 __attribute__ ((__visibility__("default")))
@@ -4606,28 +4629,6 @@ __cxa_demangle(const char* mangled_name,
     }
     size_t internal_size = buf != nullptr ? *n : 0;
     arena<bs> a;
-    struct Db
-    {
-        typedef String String;
-        typedef Vector<string_pair> sub_type;
-        typedef Vector<sub_type> template_param_type;
-        Vector<string_pair> names;
-        Vector<sub_type> subs;
-        Vector<template_param_type> template_param;
-        unsigned cv;
-        unsigned ref;
-        bool parsed_ctor_dtor_cv;
-        bool tag_templates;
-        bool fix_forward_references;
-        bool try_to_parse_template_args;
-
-        template <size_t N>
-        Db(arena<N>& ar) :
-            names(ar),
-            subs(0, names, ar),
-            template_param(0, subs, ar)
-        {}
-    };
     Db db(a);
     db.cv = 0;
     db.ref = 0;





More information about the cfe-commits mailing list