Commit Graph

16 Commits

Author SHA1 Message Date
Han Sangjin
e06c7136cb Porting to Cygwin. rebased and squashed 2016-02-22 13:20:21 +09:00
practicalswift
1339b5403b Consistent use of header comment format.
Correct format:
//===--- Name of file - Description ----------------------------*- Lang -*-===//
2016-01-04 13:26:31 +01:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Jordan Rose
f866e56388 [swift-demangle] Filter mode: '$' is a valid mangled name character.
rdar://problem/21001459

Swift SVN r32229
2015-09-25 17:53:43 +00:00
Jordan Rose
bc91897806 Remove LLVM_INITIALIZE from swift-demangle.
There were dependencies missing, but it turns out it doesn't actually need
any of it.

Swift SVN r31860
2015-09-10 21:15:31 +00:00
Michael Gottesman
e864f02690 In all executables make sure to completely initialize LLVM.
I also added a macro called INITIALIZE_LLVM(argc, argv) which moves this logic
into one place and should be used at the beginning of *all* binaries. It
initializes an LLVM shutdown object, sets up the pretty stack trace, and then
initializes all of the parts of LLVM. This will make it easy to update this in
the future.

The reason why a macro was required was because of llvm_shutdown_obj, an RAII
object that cleans up LLVM. It has to be at the function level scope of the main
function.

Swift SVN r31815
2015-09-09 04:37:38 +00:00
David Farler
b460aa0c86 Further shorten demangled names in simplified mode
Break up "Simplified" demangling mode (shortened demangled descriptions
for the sake of displaying in UI with small areas) into more
fine-grained options instead of an opaque "Simplified" option and
provide a static preset of options for displaying stack traces in
Xcode UI and other tools, for example.

- Don't print unmangled suffixes
- Don't print module names
- Shorten various generic specialization descriptions as just
  "specialized"
- Don't display long protocol conformances
- Truncate where clauses
- Don't display so-called "entity" types
- Shorten "partial apply *"
- Shorten thunk phrases
- Shorten value witness phrases
- Truncate archetype references

rdar://problem/21753651

Swift SVN r30247
2015-07-16 03:35:46 +00:00
David Farler
4d71001aa4 Provide 'Simplified' demangling mode
To support UI applications displaying demangled names in a limited
amount of screen space, provide a new SwiftDemangle API and Demangler
option to do the following:

- Skip all module name prefixes when printing contexts
- Don't print implicit self/metatype parameters when printing
function types

Add a '-simplified' flag to swift-demangle to support testing at the
command line.

Swift SVN r28727
2015-05-18 22:48:30 +00:00
John McCall
a0d3214e4c Test that the remangler round-trips successfully.
To get this to work, delay some "cleanup" work in the
demangler.  For example, we now preserve in the tree
whether something was mangled as an allocating
initializer, and we only special-case the class vs.
non-class cases in the pretty printer.

Also fixes a number of remangling bugs, of course.

Swift SVN r24534
2015-01-19 23:12:58 +00:00
John McCall
bb675b6ac9 Add a basic "re-mangler", which turns a parsed
demangling tree back into a mangled string.

Also, extend the demangling API in a few obvious
ways, and simplify testing for failure in the
node-returning APIs by having them simply return
null instead of a spurious Failure node.

Also, preserve slightly more information in the
demangling tree.  The goal here is eventually to
always allow a perfect round-trip through the
demangler parse tree.  This patch gets us close,
but we're not quite there yet.

Tests to follow.

Swift SVN r24473
2015-01-16 06:33:08 +00:00
Enrico Granata
bd81003632 The --tree-only option to swift-demangle was not doing what it promised to do, instead refusing to print anything. Fix it
Swift SVN r20862
2014-08-01 00:14:16 +00:00
Dmitri Hrybenko
26277fc41d Demangler: remove StringRef dependencies in the demangler interface and
PrettyStackTrace dependencies in the implementation


Swift SVN r20248
2014-07-21 12:46:58 +00:00
Jordan Rose
270cf80a6c [swift-demangle] Teach swift-demangle to filter stdin if given no arguments.
That is, teach swift-demangle to also be swift-filt.

Swift SVN r20231
2014-07-20 18:24:06 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Enrico Granata
efcd17f604 This commit implements the Demangler API in C++ and de facto deprecates the existing Demangle.swift
The new demangler is in the "swift/SIL/Demangle.{h|cpp}" files, and in the swift::Demangle namespace, which has two public entry points:

std::string demangleSymbol(llvm::StringRef mangled);
std::string demangleType(llvm::StringRef mangled);

This was necessary to support the need for LLDB to demangle Swift symbol (and type) names

Test case is included



Swift SVN r6547
2013-07-24 17:52:27 +00:00