Commit Graph

17 Commits

Author SHA1 Message Date
Dmitri Gribenko
d4ff77550e Replaced include/swift/Basic/Algorithm.h with calls to standard algorithms
LLVM now requires C++14, and the header says the algorithms are
backported from C++14.
2020-02-24 14:52:48 +01:00
Brent Royal-Gordon
99faa033fc [NFC] Standardize dump() methods in frontend
By convention, most structs and classes in the Swift compiler include a `dump()` method which prints debugging information. This method is meant to be called only from the debugger, but this means they’re often unused and may be eliminated from optimized binaries. On the other hand, some parts of the compiler call `dump()` methods directly despite them being intended as a pure debugging aid. clang supports attributes which can be used to avoid these problems, but they’re used very inconsistently across the compiler.

This commit adds `SWIFT_DEBUG_DUMP` and `SWIFT_DEBUG_DUMPER(<name>(<params>))` macros to declare `dump()` methods with the appropriate set of attributes and adopts this macro throughout the frontend. It does not pervasively adopt this macro in SILGen, SILOptimizer, or IRGen; these components use `dump()` methods in a different way where they’re frequently called from debugging code. Nor does it adopt it in runtime components like swiftRuntime and swiftReflection, because I’m a bit worried about size.

Despite the large number of files and lines affected, this change is NFC.
2019-10-31 18:37:42 -07:00
JF Bastien
31e6a989f5 [NFC] Don't use LLVM_ALIGNAS (#26411)
It's not useful anymore, and I'm about to remove it in upstream.
2019-07-30 13:14:02 -07:00
John McCall
b75baac19d Accomodate values with non-trivial constructors in PrefixMap. 2018-03-26 01:13:45 -04:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
swift-ci
48543ed7e7 Merge pull request #1986 from danra/use_algorithm_max 2016-03-31 18:57:11 -07:00
Dan Raviv
5082ae7f3b Use constexpr max from Swift/Basic/Algorithm instead of reimplementing it 2016-03-31 21:05:34 +03:00
Chris Lattner
821c2cb98f Merge pull request #1796 from danra/swift_basic_sanitize
Canonicalize swift header files headers and footers
2016-03-29 17:31:53 -07:00
Dan Raviv
89545329b5 Consistently name stacks as 'stack' instead of 'queue'
Currently some stacks are named 'stack' and some are named 'queue' with a comment saying 'actually a stack'. Just call these a 'stack' as well.
2016-03-25 21:26:45 +03:00
danra
653b282682 Fix includes order 2016-03-25 00:49:03 +02:00
Dan Raviv
29d76f3b68 Canonize swift header files headers and footers
- Added missing ifdef guard in PointerIntEnum header
- Consistent naming convention for ifdef guards
- Consistent 'end namespace swift'
- Consistent single EOL at end of header files
2016-03-23 09:04:12 +02:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Xi Ge
5ca83d97a5 [InterfacePrint] Enhance ASTPrinter to support type-specific interface printing.
When users try to print the interface of a specific type (most often through cursor
infor query of SourceKit), we should simplify the original decls by replacing
archetypes with instantiated types, hiding extension details, and omitting
unfulfilled extension requirements. So the users can get the straight-to-the-point
"type interface". This commit builds the testing infrastructure for this feature,
and implements the first trick that wraps extension contents into the interface body.

This commit also moves some generic testing support from SourceKit to Swift.

Swift SVN r32630
2015-10-12 19:14:58 +00:00
John McCall
01933ce5b7 Switch to using Swift-specific type traits to unbreak the Linux build.
Swift SVN r32470
2015-10-06 22:58:27 +00:00
John McCall
9f7a1e7d08 Zero-initialize the root pointer.
A casualty of one too many prospective refactors, and of
zero-initialized stacks.

Swift SVN r32456
2015-10-06 03:23:39 +00:00
John McCall
cc7938ad21 Implement a trie data structure. Specifically, implement
a ternary tree with a fixed-length per-node inline key buffer.

I plan to use this for metadata path caches, where it's useful to
be able to quickly find the most-derived point along a path that
you've already cached, but it should be useful for other things
in the compiler as well, like function-with-argument-label
lookups and possibly code completion.

This is quite a bit more space-efficient (and somewhat faster)
than doing scans after a lower_bound on a std::map<std::string, T>.

I haven't implemented balancing yet, and I don't need delete at
all for metadata paths, so I don't plan to work on that.

Swift SVN r32453
2015-10-06 01:14:30 +00:00