Commit Graph

8 Commits

Author SHA1 Message Date
Becca Royal-Gordon
0ce403d680 [NFC] Add some pretty stack traces
These would have helped us to debug rdar://142693093 more quickly.
2025-01-21 17:33:09 -08:00
Nate Chandler
9f87e0a8c6 [SIL] Print AST types with print-module-on-error. 2025-01-12 15:32:54 -08:00
Meghana Gupta
47b728ee63 Merge pull request #68151 from meg-gupta/printmodule
Add -sil-print-module-on-error
2023-08-25 20:23:42 -07:00
Meghana Gupta
74d5c401f2 Add -sil-print-module-on-error 2023-08-25 13:53:00 -07:00
Hamish Knight
7982e4bd7e [AST] Handle null in printDeclDescription
Sink down the null Decl printing into
`printDeclDescription` such that all callers
benefit from it.

This is an attempt at fixing at least the secondary
crash in rdar://113491294, it does not address the
underlying crash.
2023-08-21 15:35:16 +01:00
Erik Eckstein
462e58d3cb SILLocation: a big refactoring and reducing its size from 3 to 2 words
My goal was to reduce the size of SILLocation. It now contains only of a storage union, which is basically a pointer and a bitfield containing the Kind, StorageKind and flags. By far, most locations are only single pointers to an AST node. For the few cases where more data needs to be stored, this data is allocated separately: with the SILModule's bump pointer allocator.

While working on this, I couldn't resist to do a major refactoring to simplify the code:

* removed unused stuff
* The term "DebugLoc" was used for 3 completely different things:
    - for `struct SILLocation::DebugLoc` -> renamed it to `FilePosition`
    - for `hasDebugLoc()`/`getDebugSourceLoc()` -> renamed it to `hasASTNodeForDebugging()`/`getSourceLocForDebugging()`
    - for `class SILDebugLocation` -> kept it as it is (though, `SILScopedLocation` would be a better name, IMO)
* made SILLocation more "functional", i.e. replaced some setters with corresponding constructors
* replaced the hand-written bitfield `KindData` with C bitfields
* updated and improved comments
2021-01-29 20:28:21 +01:00
Michael Gottesman
0750b0b203 [generics] Add an option that causes the generic specializer to validate newly specialized functions earlier when we have more information that we can put into a pretty stack trace.
I also added support for creating a PrettyStackTraceSILFunction from a twine.
2020-06-30 13:43:20 -07:00
Michael Gottesman
e1a19e4173 [sil] Split library into subfolders, while still building as a single library still.
Specifically, I split it into 3 initial categories: IR, Utils, Verifier. I just
did this quickly, we can always split it more later if we want.

I followed the model that we use in SILOptimizer: ./lib/SIL/CMakeLists.txt vends
 a macro (sil_register_sources) to the sub-folders that register the sources of
 the subdirectory with a global state variable that ./lib/SIL/CMakeLists.txt
 defines. Then after including those subdirs, the parent cmake declares the SIL
 library. So the output is the same, but we have the flexibility of having
 subdirectories to categorize source files.
2020-03-30 11:01:00 -07:00