mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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
This commit is contained in:
@@ -2398,8 +2398,9 @@ static int doPrintLocalTypes(const CompilerInvocation &InitInvok,
|
||||
auto mangling = Demangle::mangleNode(typeNode);
|
||||
if (!mangling.isSuccess()) {
|
||||
llvm::errs() << "Couldn't remangle type (failed at Node "
|
||||
<< mangling.errorNode() << " with error "
|
||||
<< mangling.errorCode() << ")\n";
|
||||
<< mangling.error().node << " with error "
|
||||
<< mangling.error().code << ":" << mangling.error().line
|
||||
<< ")\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
auto remangled = mangling.result();
|
||||
|
||||
Reference in New Issue
Block a user