|
43 | 43 | #include "swift/Basic/Assertions.h" |
44 | 44 | #include "swift/Basic/Defer.h" |
45 | 45 | #include "swift/Basic/PrettyStackTrace.h" |
| 46 | +#include "swift/Basic/SourceLoc.h" |
46 | 47 | #include "swift/Basic/Statistic.h" |
47 | 48 | #include "swift/Basic/StringExtras.h" |
48 | 49 | #include "swift/Basic/Version.h" |
@@ -1661,6 +1662,8 @@ namespace { |
1661 | 1662 | // Create the wrapper struct. |
1662 | 1663 | errorWrapper = |
1663 | 1664 | new (C) StructDecl(loc, name, loc, std::nullopt, nullptr, dc); |
| 1665 | + SourceLoc end = Impl.importSourceLoc(decl->getEndLoc()); |
| 1666 | + errorWrapper->setBraces(SourceRange(loc, end)); |
1664 | 1667 | errorWrapper->setAccess(AccessLevel::Public); |
1665 | 1668 | errorWrapper->getAttrs().add( |
1666 | 1669 | new (Impl.SwiftContext) FrozenAttr(/*IsImplicit*/true)); |
@@ -3606,9 +3609,9 @@ namespace { |
3606 | 3609 | auto *typeParam = Impl.createDeclWithClangNode<GenericTypeParamDecl>( |
3607 | 3610 | param, AccessLevel::Public, dc, |
3608 | 3611 | Impl.SwiftContext.getIdentifier(param->getName()), |
3609 | | - /*nameLoc*/ SourceLoc(), /*specifierLoc*/ SourceLoc(), |
3610 | | - /*depth*/ 0, /*index*/ i, |
3611 | | - GenericTypeParamKind::Type); |
| 3612 | + /*nameLoc*/ Impl.importSourceLoc(param->getLocation()), |
| 3613 | + /*specifierLoc*/ SourceLoc(), |
| 3614 | + /*depth*/ 0, /*index*/ i, GenericTypeParamKind::Type); |
3612 | 3615 | templateParams.push_back(typeParam); |
3613 | 3616 | (void)++i; |
3614 | 3617 | } |
@@ -6468,7 +6471,8 @@ Decl *SwiftDeclConverter::importGlobalAsInitializer( |
6468 | 6471 | } |
6469 | 6472 |
|
6470 | 6473 | auto result = Impl.createDeclWithClangNode<ConstructorDecl>( |
6471 | | - decl, AccessLevel::Public, name, /*NameLoc=*/SourceLoc(), failable, |
| 6474 | + decl, AccessLevel::Public, name, |
| 6475 | + Impl.importSourceLoc(decl->getLocation()), failable, |
6472 | 6476 | /*FailabilityLoc=*/SourceLoc(), |
6473 | 6477 | /*Async=*/false, /*AsyncLoc=*/SourceLoc(), |
6474 | 6478 | /*Throws=*/false, /*ThrowsLoc=*/SourceLoc(), /*ThrownType=*/TypeLoc(), |
@@ -6983,7 +6987,8 @@ ConstructorDecl *SwiftDeclConverter::importConstructor( |
6983 | 6987 | assert(!importedName.getAsyncInfo()); |
6984 | 6988 | auto result = Impl.createDeclWithClangNode<ConstructorDecl>( |
6985 | 6989 | objcMethod, AccessLevel::Public, importedName.getDeclName(), |
6986 | | - /*NameLoc=*/SourceLoc(), failability, /*FailabilityLoc=*/SourceLoc(), |
| 6990 | + /*NameLoc=*/Impl.importSourceLoc(objcMethod->getLocation()), failability, |
| 6991 | + /*FailabilityLoc=*/SourceLoc(), |
6987 | 6992 | /*Async=*/false, /*AsyncLoc=*/SourceLoc(), |
6988 | 6993 | /*Throws=*/importedName.getErrorInfo().has_value(), |
6989 | 6994 | /*ThrowsLoc=*/SourceLoc(), /*ThrownType=*/TypeLoc(), bodyParams, |
|
0 commit comments