Commit Graph

12 Commits

Author SHA1 Message Date
Adrian Prantl
ef83539c58 Add unittests for the remangler, particularly to cover error handling.
We currently don't have any tests for remangler error handling, because in
asserts builds it asserts. This patch adds a flag that only exists in !NDEBUG
builds to turn off assertions when inside the unit tests.
2022-05-13 17:55:38 -07:00
Alastair Houghton
8f74eb0bd1 Make Node::addChild(NULL, ...) always assert.
We need this in order to gather relevant information when this situation
arises; it's clearly happening (e.g. rdar://86071019), but not often
enough for it to trigger in a build with assertions enabled.

rdar://89139049
2022-02-18 12:13:56 +00:00
swift-ci
d860f560e2 Merge remote-tracking branch 'origin/main' into rebranch 2022-01-14 10:35:13 -08:00
Dave Lee
8a2513be7e fix #endif comment 2022-01-12 12:59:17 -08:00
Dave Lee
7912247ef9 flip condition order 2022-01-12 12:57:11 -08:00
Dave Lee
3fa590cece [Demangler] Remove no-op case of DEMANGLER_ASSERT 2022-01-11 09:24:34 -08:00
Ben Barham
25b1b2517e [rebranch] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
llvm-project 09529892b518c8df8c24395e68e0a7a5e8bda5fb removed
`LLVM_ATTRIBUTE_NORETURN` in favour of the C++11 `[[noreturn]]`.
2021-11-18 16:49:28 +10:00
Robert Widmann
924d15b03f [NFC] Swap LLVM_NODISCARD for LLVM_ATTRIBUTE_NORETURN
These were originally meant to be no-return functions since they're going to abort. They were accidentally changed to no-discard functions despite not having a return value.
2021-11-17 13:17:37 -08:00
zoecarver
2546406de8 [cxx-interop][nfc] Remove internal header dependency on runtime/stdlib/shims.
The internal compiler headers should not include swift shim headers. Removing this dependency allows libSwift to import Swift compiler headers (otherwise, we get name conflics, because we import SwiftShims headers twice: from the source includes and build includes).
2021-10-25 14:56:45 -07:00
Alastair Houghton
59cfe356d5 [Demangling] Improve DEMANGLE_ASSERT, enable some disabled tests.
Defining DEMANGLE_ASSERT as assert() is simple but messes up the file/line
information from assert().  Make a dedicated assertion failure function and use
that instead to fix.

Also enable some tests that were disabled because they triggered abort()
calls in the remanglers.

rdar://79725187
2021-09-07 14:08:29 +01:00
Alastair Houghton
b8a879954a [Demangler] Tidy up a bit, and add line numbers to ManglingErrors.
Because DEMANGLER_ASSERT() might cause the remanglers to return a ManglingError
with the code ManglingError::AssertionFailed, it's useful to have a line number
in the ManglingError as well as the other information.  This is also potentially
helpful for other cases where the code is used multiple times in the remanglers.

rdar://79725187
2021-09-06 17:49:55 +01:00
Alastair Houghton
227b438963 [Demangling] Added DEMANGLER_ASSERT to replace assert() calls.
This returns an error code if we're in the runtime, rather than assert()ing.

rdar://79725187
2021-09-06 17:49:50 +01:00