Skip to content

Commit

Permalink
Dramatically improves C++ demangling performance by introducing a new…
Browse files Browse the repository at this point in the history
… implementation that is much faster than the existing demangler. While not yet complete, the new demangler will fail gracefully when it encounters symbols it isn’t prepared to deal with. In these cases LLDB will fall back to using the full demangler to prevent a loss in functionality. On sizable code bases the fast path succeeds 95% of the time, providing a significant net win.

The new implementation is located in source/Core/FastDemangle.cpp.  It’s fairly straightforward C code with a few basic C++ extensions.  It should compile with little or no change on a variety of platforms, but of course it is still only useful for symbols that comply with the Itanium ABI mangling spec (plus a few Clang extensions.)

<rdar://problem/15397553> <rdar://problem/15794867>



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@213671 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Kate Stone committed Jul 22, 2014
1 parent 1e36446 commit 0875205
Show file tree
Hide file tree
Showing 4 changed files with 2,224 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lldb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@
26FFC19C14FC072100087D58 /* DYLDRendezvous.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FFC19614FC072100087D58 /* DYLDRendezvous.h */; };
26FFC19D14FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19714FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp */; };
26FFC19E14FC072100087D58 /* DynamicLoaderPOSIXDYLD.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FFC19814FC072100087D58 /* DynamicLoaderPOSIXDYLD.h */; };
449ACC98197DEA0B008D175E /* FastDemangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 449ACC96197DE9EC008D175E /* FastDemangle.cpp */; };
490A36C0180F0E6F00BA31F8 /* PlatformWindows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */; };
490A36C2180F0E9300BA31F8 /* PlatformWindows.h in Headers */ = {isa = PBXBuildFile; fileRef = 490A36BE180F0E6F00BA31F8 /* PlatformWindows.h */; };
490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9452573816262CEF00325455 /* SBDeclaration.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1710,6 +1711,7 @@
26FFC19614FC072100087D58 /* DYLDRendezvous.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DYLDRendezvous.h; sourceTree = "<group>"; };
26FFC19714FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderPOSIXDYLD.cpp; sourceTree = "<group>"; };
26FFC19814FC072100087D58 /* DynamicLoaderPOSIXDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderPOSIXDYLD.h; sourceTree = "<group>"; };
449ACC96197DE9EC008D175E /* FastDemangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FastDemangle.cpp; path = source/Core/FastDemangle.cpp; sourceTree = "<group>"; };
4906FD4012F2255300A2A77C /* ASTDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTDumper.cpp; path = source/Expression/ASTDumper.cpp; sourceTree = "<group>"; };
4906FD4412F2257600A2A77C /* ASTDumper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTDumper.h; path = include/lldb/Expression/ASTDumper.h; sourceTree = "<group>"; };
490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformWindows.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3074,6 +3076,7 @@
26BC7E7810F1B85900F91463 /* Error.cpp */,
26BC7D6110F1B77400F91463 /* Event.h */,
26BC7E7910F1B85900F91463 /* Event.cpp */,
449ACC96197DE9EC008D175E /* FastDemangle.cpp */,
26BD407D135D2AC400237D80 /* FileLineResolver.h */,
26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */,
26BC7D6310F1B77400F91463 /* FileSpecList.h */,
Expand Down Expand Up @@ -4649,6 +4652,7 @@
2689000113353DB600698AC0 /* BreakpointResolverAddress.cpp in Sources */,
2689000313353DB600698AC0 /* BreakpointResolverFileLine.cpp in Sources */,
26474CA818D0CB070073DEBA /* RegisterContextFreeBSD_i386.cpp in Sources */,
449ACC98197DEA0B008D175E /* FastDemangle.cpp in Sources */,
94CD705216F8F5BC00CF1E42 /* LibCxxMap.cpp in Sources */,
2689000513353DB600698AC0 /* BreakpointResolverName.cpp in Sources */,
2689000713353DB600698AC0 /* BreakpointSite.cpp in Sources */,
Expand Down
1 change: 1 addition & 0 deletions source/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ add_lldb_library(lldbCore
EmulateInstruction.cpp
Error.cpp
Event.cpp
FastDemangle.cpp
FileLineResolver.cpp
FileSpecList.cpp
History.cpp
Expand Down
Loading

0 comments on commit 0875205

Please sign in to comment.