Commit Graph

8 Commits

Author SHA1 Message Date
Saleem Abdulrasool
e9ec50132f runtime: sprinkle some linker pragmas to autolink
This prepares the runtime to be closed with its dependencies when
performing static linking. The pragma ensures that the linker will
automatically pick up the dependent libraries avoiding the need to
explicitly add the dependencies.
2025-01-17 08:58:42 -08:00
Saleem Abdulrasool
9e413bd3d2 runtime: use _strdup on Windows
Windows prefers the `_strdup` extension over `strdup`. This avoids
unnecessary warnings when building the standard library.
2024-12-12 10:36:36 -08:00
Alastair Houghton
a72c167af5 [Runtime][Win32] Further tweaks to SymbolInfo.cpp and Errors.cpp.
Fix an unused variable warning in `Errors.cpp`.

Use brace initialization syntax in `SymbolInfo.cpp` rather than using
a constructor call.

rdar://130992923
2024-07-11 11:51:59 +01:00
Alastair Houghton
418a240e80 [Runtime][Win32] Tweak SymbolInfo slightly based on review comments.
Prefer `ZeroMemory()` to `::memset()` here.

Use `sizeof(*wszBuffer)` instead of `sizeof(WCHAR)`, just in case.

Don't use `*this=other`, because that motivates tests around `::free()`,
but instead pull the shared code out into some private functions.

Also, fix `SymbolInfo()` to initialize the pointer members.

rdar://130992923
2024-07-10 12:22:35 +01:00
Alastair Houghton
8ad89c08e2 [Runtime][Win32] Fix fatalError() backtraces.
We were calling `SymInitialize()` multiple times, which is wrong, which
was making the `SymbolInfo::lookup()` call fail.  Also, we weren't
fetching the module names, so we should do that too.

rdar://130992923
2024-07-09 18:50:20 +01: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
Alastair Houghton
e73de539b8 Move _swift_win32_withDbgHelpLibrary into the new header.
It makes sense to move this function into the new Win32 header.

rdar://103397975
2022-12-21 11:44:37 +00:00
Jonathan Grynspan
26fc627ad0 Fix a use-after-free bug on Win32 when calling lookupSymbol() (#62484) 2022-12-13 09:04:34 -05:00