Commit Graph

1105 Commits

Author SHA1 Message Date
swift-ci
cdc5aae3ab Merge remote-tracking branch 'origin/main' into rebranch 2024-05-03 13:15:56 -07:00
Augusto Noronha
ef5aae1fea Merge pull request #72445 from augusto2112/zero-unsub-types-main
[DebugInfo] Always emit unsubsituted generic types with size 0
2024-05-03 13:13:59 -07:00
swift-ci
a51df69c93 Merge remote-tracking branch 'origin/main' into rebranch 2024-04-29 10:34:28 -07:00
Emil Pedersen
84dae7c37a [DebugInfo] Add support for constant debug values 2024-04-26 16:31:16 -07:00
Emil Pedersen
8ad3066011 [DebugInfo] Fix implicit deref on arithmetic expressions 2024-04-26 16:31:16 -07:00
swift-ci
3ea8b187bb Merge remote-tracking branch 'origin/main' into rebranch 2024-04-25 16:54:34 -07:00
Emil Pedersen
584d1db307 [IRGen] [DebugInfo] Ignore autogenerated flag for variables 2024-04-24 18:25:43 -07:00
Nate Chandler
c43f87101f Merge branch 'main' into rebranch
Conflicts:
      lib/Basic/Platform.cpp

```
diff --git a/lib/Basic/Platform.cpp b/lib/Basic/Platform.cpp
index 240edfa144a..1797c87635f 100644
--- a/lib/Basic/Platform.cpp
+++ b/lib/Basic/Platform.cpp
@@ -200,10 +200,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {
   case llvm::Triple::CUDA:
   case llvm::Triple::DragonFly:
   case llvm::Triple::DriverKit:
-<<<<<<< HEAD
   case llvm::Triple::ELFIAMCU:
-=======
->>>>>>> main
   case llvm::Triple::Emscripten:
   case llvm::Triple::Fuchsia:
   case llvm::Triple::HermitCore:
```
2024-04-17 13:32:48 -07:00
Augusto Noronha
bc4eeb861c Merge pull request #72963 from augusto2112/declaration-by-rep
[DebugInfo] Emit declaration by checking both type and SIL func repr
2024-04-17 10:19:20 -07:00
Emil Pedersen
3136d2eac4 [DebugInfo] [IRGen] Use instruction column number for variables
The source location for the variable should be the value in VarInfo if set,
otherwise it should use the location of the instruction. Both ways should
be consistent, and as we use column number if VarInfo is set, we have to do
it if isnt, too.
2024-04-16 10:28:02 -07:00
Augusto Noronha
e0e7a08a31 [DebugInfo] Emit declaration by checking both type and SIL func repr 2024-04-10 16:13:57 -07:00
Ben Barham
8bf89a421e [IRGen] Rename FindDbgDeclareUses to findDbgDeclares
Renamed in LLVM 2d9d9a1a556a5f8845a7a9e19dc52346b825989e.
2024-04-08 08:58:59 -07:00
Ben Barham
5193b4f915 [IRGen] Update DbgIntrinsicEmitter::insert functions to DbgInstPtr
The various `DIBuilder` inserts now return a `DbgInsertPtr`, update
`DbgIntrinsicEmitter` to as well.
2024-04-08 08:58:59 -07:00
Adrian Prantl
1deaf0b538 Merge pull request #72466 from adrian-prantl/cleanup-replaceable
Cleanup uses of replaceable metadata types (NFC)
2024-04-05 13:38:51 -07:00
Adrian Prantl
1b5d61b8fa Merge pull request #72467 from adrian-prantl/123923517
Work around a memory leak caught by the LSAN bot.
2024-04-03 13:49:05 -07:00
Ben Barham
1fdda023b3 Rename StringRef::endswith references to StringRef::ends_with
Missed this when doing the `startswith` renaming. `endswith` has also
been deprecated upstream (and presumably soon to be removed).
2024-04-01 10:59:16 -07:00
Alex Lorenz
8484c61f19 [debuginfo][codeview] avoid using line zero artificial location for traps when emitting codeview
This fixes an issue where the debug locations for Swift traps were dropped in the produced PDB files, as they were pointing to line 0

I validated this on a sample project using WinDbgx, which can now correctly trap on the same line in multiple places
2024-03-25 13:35:24 -07:00
Konrad `ktoso` Malawski
6132386371 [Distributed] Complete handling of protocol calls and witnesses using adjusted mangling scheme (#72416) 2024-03-23 23:54:23 +09:00
Adrian Prantl
0742c01806 Work around a memory leak caught by the LSAN bot.
Fundamentally the problem here is that SILPassManager is creating an IRGenModule
without calling finalize() on it under some circumstances. It would be better to
fix that instead.

rdar://123923517
2024-03-20 13:02:46 -07:00
Adrian Prantl
2ee8156d75 Cleanup uses of replaceable metadata types (NFC) 2024-03-20 13:00:43 -07:00
Augusto Noronha
128d452371 [DebugInfo] Always emit unsubsituted generic types with size 0
Unsubstituted generic types shouldn't have a size, precisely because
the generic parameters aren't substituted in. Always emit them with a
size 0.
2024-03-19 16:32:12 -07:00
Augusto Noronha
0e2c41cb8b Merge pull request #72338 from augusto2112/deb-specialized-types
[DebugInfo] Generate debug info for specialized types
2024-03-19 10:43:10 -07:00
Augusto Noronha
ae5e341db4 [DebugInfo] Generate debug info for specialized types
Specialized types are generic types, or types whose parent is
specialized.

IRGenDebugInfo was previously mistankenly emitting debug info for
nominal specialized types as if they regular nominal types, which caused
problems as that code path does not handle references to generic
parameters.
2024-03-18 15:43:38 -07:00
Ben Barham
cbcfc85777 Merge pull request #72323 from bnbarham/rename-startswith
Rename startswith to starts_with
2024-03-14 09:06:54 -07:00
Ben Barham
9779c18da3 Rename startswith to starts_with
LLVM is presumably moving towards `std::string_view` -
`StringRef::startswith` is deprecated on tip. `SmallString::startswith`
was just renamed there (maybe with some small deprecation inbetween, but
if so, we've missed it).

The `SmallString::startswith` references were moved to
`.str().starts_with()`, rather than adding the `starts_with` on
`stable/20230725` as we only had a few of them. Open to switching that
over if anyone feels strongly though.
2024-03-13 22:25:47 -07:00
Adrian Prantl
e3197e971f Merge pull request #72200 from adrian-prantl/124233848
Root the virtual <compiler-generated> file in the root directory.
2024-03-13 14:38:11 -07:00
Emil Pedersen
ffb8ece8e0 [DebugInfo] Fix crash on empty tuple fragments
rdar://124408249
2024-03-12 17:38:00 -07:00
Adrian Prantl
aab0cb09cc Root the virtual <compiler-generated> file in the root directory.
Using CWD gives a false sense of accuracy.

rdar://124233848
2024-03-12 16:57:04 -07:00
Emil Pedersen
8df1abe111 Merge pull request #72158 from Snowy1803/simplify-dbg-type-size
[DebugInfo] Move type size information to CompletedDebugTypeInfo
2024-03-11 10:31:45 -07:00
Adrian Prantl
654df59161 Detect methods by their scope rather than their representation.
In the end this condition exists to avoid a BitCode Verifyer check that operates
off the scope, so looking for that directly is more future-proof.

rdar://123334375
2024-03-08 13:29:44 -08:00
Emil Pedersen
653e8fd036 [DebugInfo] Add labels when constructing DebugTypeInfo (NFC) 2024-03-07 15:52:17 -08:00
Emil Pedersen
4ede40e2f7 [DebugInfo] Remove passing of the unused SizeIsFragmentSize (NFC) 2024-03-07 15:21:44 -08:00
Emil Pedersen
456b5a0ac8 [DebugInfo] Move type size information to CompletedDebugTypeInfo (NFC) 2024-03-07 13:07:43 -08:00
Emil Pedersen
75015b5050 [DebugInfo] Remove accessor for type size in DebugTypeInfo 2024-03-06 17:42:40 -08:00
Emil Pedersen
01c752e6db [DebugInfo] Use LLVM type size instead of an estimate for types 2024-03-06 17:23:26 -08:00
Emil Pedersen
7c9a8769a1 Merge pull request #72072 from Snowy1803/tuple-fragments
Add support for op_tuple_fragment in SIL DIExpression and SIL SROA
2024-03-06 15:20:08 -08:00
Adrian Prantl
b5d83afaba Avoid copy of loop temporary 2024-03-05 12:16:14 -08:00
Emil Pedersen
35e346fd8d Add support for op_tuple_fragment in SIL DIExpression and SIL SROA
rdar://124034536
2024-03-04 15:46:02 -08:00
Augusto Noronha
76853717c2 Merge pull request #71939 from augusto2112/fix-specify-of-2
[DebugInfo] Fix bound generic types debug info generation
2024-03-01 16:40:31 -08:00
Augusto Noronha
9178c4a346 Merge pull request #71962 from augusto2112/embedded-flag
[DebugInfo] Emit embedded swift into DW_AT_APPLE_flags
2024-03-01 15:12:39 -08:00
Adrian Prantl
8a25294f50 Merge pull request #71965 from augusto2112/fix-lto-decl
[DebugInfo] Emit witness and objc method declarations in debug info
2024-03-01 09:26:02 -08:00
Augusto Noronha
0b8abda060 [DebugInfo] Emit embedded swift into DW_AT_APPLE_flags
To properly initialize the compiler instance on LLDB when debugging
embedded Swift programs, emit "-enable-embedded-swift" into the
DW_AT_APPLE_flags attribute of the compile unit.
2024-02-29 16:37:13 -08:00
Augusto Noronha
53d1844396 [DebugInfo] Emit witness and objc method declarations in debug info
When emitting a method definition in debug info, the compiler should
also emit the method's declaration, because LLVM LTO can't unify type
definitions when a child DIE is a full subprogram definition. This is
already the behavior for standard methods, this patch implements the
same behavior for witness and objc methods as well.

rdar://123334375
2024-02-29 10:13:10 -08:00
Adrian Prantl
23e6e54ca1 Merge pull request #71925 from Snowy1803/recursive-sroa
[DebugInfo] Add debug info support for recursive SIL SROA
2024-02-28 20:05:57 -08:00
Emil Pedersen
0faa055c11 [DebugInfo] Add debug info support for recursive SIL SROA
This removes the restriction that only one fragment is allowed at
the end of a SIL DIExpression.

rdar://100046900
2024-02-28 12:48:17 -08:00
Augusto Noronha
10d263b388 [DebugInfo] Fix bound generic types debug info generation
When generating full debug info for generic types, emit the
specification type as an opaque struct with the collection of
substituted generic parameters.
2024-02-27 17:49:27 -08:00
Adrian Prantl
1e50be370d Emit original-source-range comment in inline macro expansion files.
rdar://123117522
2024-02-27 15:30:24 -08:00
Ben Barham
1de479d4c1 Remove the last few llvm::Optional
Not sure how I missed these in the previous lot, but actually remove all
this time.
2024-02-23 16:42:30 -08:00
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Augusto Noronha
393849290b [DebugInfo] Emit full DWARF info for generic classes and enums 2024-02-20 20:03:14 -08:00