Skip to content

Commit fb88ace

Browse files
authored
Merge pull request #40143 from apple/revert-40010-importSourceLoc
Revert "Implement ClangImporter importSourceLoc and importSourceRange"
2 parents 04f6062 + c6474b9 commit fb88ace

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,13 +2265,14 @@ ClangImporter::Implementation::exportSourceLoc(SourceLoc loc) {
22652265

22662266
SourceLoc
22672267
ClangImporter::Implementation::importSourceLoc(clang::SourceLocation loc) {
2268-
return getBufferImporterForDiagnostics().resolveSourceLocation(
2269-
getClangASTContext().getSourceManager(), loc);
2268+
// FIXME: Implement!
2269+
return SourceLoc();
22702270
}
22712271

22722272
SourceRange
22732273
ClangImporter::Implementation::importSourceRange(clang::SourceRange loc) {
2274-
return SourceRange(importSourceLoc(loc.getBegin()), importSourceLoc(loc.getEnd()));
2274+
// FIXME: Implement!
2275+
return SourceRange();
22752276
}
22762277

22772278
#pragma mark Importing names

lib/ClangImporter/ImportDecl.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3376,11 +3376,8 @@ namespace {
33763376
if (alreadyImportedResult != Impl.ImportedDecls.end())
33773377
return alreadyImportedResult->second;
33783378
result = Impl.createDeclWithClangNode<StructDecl>(
3379-
decl, AccessLevel::Public,
3380-
SourceLoc(), // FIXME: Impl.importSourceLoc(decl->getBeginLoc()) results in a bad import: SR-15440
3381-
name,
3382-
SourceLoc(), // FIXME: Impl.importSourceLoc(decl->getLocation()) result in a bad import: SR-15440
3383-
None, nullptr, dc);
3379+
decl, AccessLevel::Public, Impl.importSourceLoc(decl->getBeginLoc()),
3380+
name, Impl.importSourceLoc(decl->getLocation()), None, nullptr, dc);
33843381
Impl.ImportedDecls[{decl->getCanonicalDecl(), getVersion()}] = result;
33853382

33863383
// FIXME: Figure out what to do with superclasses in C++. One possible
@@ -4218,7 +4215,7 @@ namespace {
42184215
Impl.createDeclWithClangNode<VarDecl>(decl, AccessLevel::Public,
42194216
/*IsStatic*/ false,
42204217
VarDecl::Introducer::Var,
4221-
SourceLoc(), // FIXME: Impl.importSourceLoc(decl->getLocation()) result in a bad import: SR-15440
4218+
Impl.importSourceLoc(decl->getLocation()),
42224219
name, dc);
42234220
if (decl->getType().isConstQualified()) {
42244221
// Note that in C++ there are ways to change the values of const
@@ -6942,7 +6939,7 @@ ConstructorDecl *SwiftDeclConverter::importConstructor(
69426939
assert(!importedName.getAsyncInfo());
69436940
auto result = Impl.createDeclWithClangNode<ConstructorDecl>(
69446941
objcMethod, AccessLevel::Public, importedName.getDeclName(),
6945-
/*NameLoc=*/Impl.importSourceLoc(objcMethod->getBeginLoc()), failability, /*FailabilityLoc=*/SourceLoc(),
6942+
/*NameLoc=*/SourceLoc(), failability, /*FailabilityLoc=*/SourceLoc(),
69466943
/*Async=*/false, /*AsyncLoc=*/SourceLoc(),
69476944
/*Throws=*/importedName.getErrorInfo().hasValue(),
69486945
/*ThrowsLoc=*/SourceLoc(), bodyParams,

0 commit comments

Comments
 (0)