summaryrefslogtreecommitdiff
path: root/lib/Demangle
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-11-20 00:20:20 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-11-20 00:20:20 +0000
commit7f90f9e9a9cd46a28e217b4afaa20335cb5da9f0 (patch)
treed134b1c53bc2b031ffcc4c929482225c3f95183a /lib/Demangle
parentc57d1d62952f85678048ab65af49cd1a452e40f7 (diff)
Demangle: use direct member initialization (NFC)
Prefer direct member initialization over the explicit out-of-line initialization for the construction of the local type. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Demangle')
-rw-r--r--lib/Demangle/ItaniumDemangle.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/Demangle/ItaniumDemangle.cpp b/lib/Demangle/ItaniumDemangle.cpp
index 39598aad649..1a83c951fc9 100644
--- a/lib/Demangle/ItaniumDemangle.cpp
+++ b/lib/Demangle/ItaniumDemangle.cpp
@@ -4233,13 +4233,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;
Db() : subs(0, names), template_param(0, subs) {}
};
@@ -4264,14 +4264,7 @@ char *llvm::itaniumDemangle(const char *mangled_name, char *buf, size_t *n,
size_t internal_size = buf != nullptr ? *n : 0;
Db db;
- 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();
- 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);
if (internal_status == success && db.fix_forward_references &&