Commit Graph

20 Commits

Author SHA1 Message Date
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
David Ungar
2ede6f2b82 Silence unused warnings 2019-09-13 17:16:19 -07:00
moatom
2e95a0d265 Fix include guards 2019-06-02 12:10:43 +09:00
David Ungar
2f65ac3735 Cosmetic cleanups 2019-01-30 17:16:49 -08:00
David Ungar
1fa76b97da Rm debugging code 2019-01-28 15:59:55 -08:00
David Ungar
14ba2a1b60 Format 2019-01-28 15:56:18 -08:00
David Ungar
fc4b7963ee 1st rough cut, frontend tracks defs not uses 2019-01-28 15:32:47 -08:00
David Ungar
2514383fc8 1st untested unfmt cut at more specific usesByDef including integration redo 2019-01-28 13:08:37 -08:00
David Ungar
ba768175f1 checkpoint usesByDef 2019-01-28 11:10:04 -08:00
David Ungar
8275de7cd7 Clean up with out fix yet, unfmt. 2019-01-28 10:19:06 -08:00
David Ungar
afe428a5bf untested, unformatted tracing cleanup 2019-01-28 09:40:29 -08:00
David Ungar
ae46aa918a Various fixes + debug unfmt 2019-01-27 19:12:59 -08:00
David Ungar
89f77175d0 Format 2019-01-27 09:15:25 -08:00
David Ungar
3d8779efba Fix print bugs unfmt 2019-01-26 21:47:52 -08:00
David Ungar
1c3e2fc872 Format 2019-01-26 18:52:28 -08:00
David Ungar
e912642304 1st cut dependency tracing 2019-01-26 18:50:41 -08:00
David Ungar
93db5f44ef wip 2019-01-26 09:46:12 -08:00
David Ungar
9d84bc2af1 WIP tracer 2019-01-26 09:36:40 -08:00
David Ungar
323c42c532 Fomat 2019-01-24 18:46:49 -08:00
David Ungar
b520b242dc Collapsed lots of changes. 2019-01-24 18:46:49 -08:00