File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,13 @@ class Mangled {
276
276
void Encode (DataEncoder &encoder, ConstStringTable &strtab) const ;
277
277
278
278
private:
279
- // /< The mangled version of the name.
279
+ // / If \c force is \c false, this function will re-use the previously
280
+ // / demangled name (if any). If \c force is \c true (or the mangled name
281
+ // / on this object was not previously demangled), demangle and cache the
282
+ // / name.
283
+ ConstString GetDemangledNameImpl (bool force) const ;
284
+
285
+ // / The mangled version of the name.
280
286
ConstString m_mangled;
281
287
282
288
// /< Mutable so we can get it on demand with
Original file line number Diff line number Diff line change @@ -265,19 +265,24 @@ bool Mangled::GetRichManglingInfo(RichManglingContext &context,
265
265
llvm_unreachable (" Fully covered switch above!" );
266
266
}
267
267
268
+ ConstString Mangled::GetDemangledName () const {
269
+ return GetDemangledNameImpl (/* force=*/ false );
270
+ }
271
+
268
272
// Generate the demangled name on demand using this accessor. Code in this
269
273
// class will need to use this accessor if it wishes to decode the demangled
270
274
// name. The result is cached and will be kept until a new string value is
271
275
// supplied to this object, or until the end of the object's lifetime.
272
- ConstString Mangled::GetDemangledName ( ) const {
276
+ ConstString Mangled::GetDemangledNameImpl ( bool force ) const {
273
277
if (!m_mangled)
274
278
return m_demangled;
275
279
276
280
// Re-use previously demangled names.
277
- if (!m_demangled.IsNull ())
281
+ if (!force && ! m_demangled.IsNull ())
278
282
return m_demangled;
279
283
280
- if (m_mangled.GetMangledCounterpart (m_demangled) && !m_demangled.IsNull ())
284
+ if (!force && m_mangled.GetMangledCounterpart (m_demangled) &&
285
+ !m_demangled.IsNull ())
281
286
return m_demangled;
282
287
283
288
// We didn't already mangle this name, demangle it and if all goes well
You can’t perform that action at this time.
0 commit comments