summaryrefslogtreecommitdiff
path: root/src/cxa_demangle.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-11-18 19:01:53 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-11-18 19:01:53 +0000
commit2ecedcc0a1605ebeaa0afe3ab6fabe5dc8d5a2f8 (patch)
tree7c12919946ae856d19f2cfb584e0f317b56fd9ca /src/cxa_demangle.cpp
parente4f23d812fc3847f1cfe815c93b73397ba09f7d9 (diff)
__cxa_demangle: use default member initialization
Sink the Db initialization into the structure rather than out-of-line at the declaration size. This just makes it easier to see what initialization is being performed. NFC. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@287364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/cxa_demangle.cpp')
-rw-r--r--src/cxa_demangle.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/cxa_demangle.cpp b/src/cxa_demangle.cpp
index 4aeed1b..c488832 100644
--- a/src/cxa_demangle.cpp
+++ b/src/cxa_demangle.cpp
@@ -4952,13 +4952,13 @@ struct Db
sub_type names;
template_param_type subs;
Vector<template_param_type> template_param;
- unsigned cv;
- unsigned ref;
- unsigned encoding_depth;
- bool parsed_ctor_dtor_cv;
- bool tag_templates;
- bool fix_forward_references;
- bool try_to_parse_template_args;
+ unsigned cv = 0;
+ unsigned ref = 0;
+ unsigned encoding_depth = 0;
+ bool parsed_ctor_dtor_cv = false;
+ bool tag_templates = true;
+ bool fix_forward_references = false;
+ bool try_to_parse_template_args = true;
template <size_t N>
Db(arena<N>& ar) :
@@ -4993,14 +4993,7 @@ __cxa_demangle(const char *mangled_name, char *buf, size_t *n, int *status) {
size_t internal_size = buf != nullptr ? *n : 0;
arena<bs> a;
Db db(a);
- db.cv = 0;
- db.ref = 0;
- db.encoding_depth = 0;
- db.parsed_ctor_dtor_cv = false;
- db.tag_templates = true;
db.template_param.emplace_back(a);
- db.fix_forward_references = false;
- db.try_to_parse_template_args = true;
int internal_status = success;
demangle(mangled_name, mangled_name + len, db,
internal_status);