Skip to content

Revert "Implement ClangImporter importSourceLoc and importSourceRange" #40143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/ClangImporter/ClangImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2265,13 +2265,14 @@ ClangImporter::Implementation::exportSourceLoc(SourceLoc loc) {

SourceLoc
ClangImporter::Implementation::importSourceLoc(clang::SourceLocation loc) {
return getBufferImporterForDiagnostics().resolveSourceLocation(
getClangASTContext().getSourceManager(), loc);
// FIXME: Implement!
return SourceLoc();
}

SourceRange
ClangImporter::Implementation::importSourceRange(clang::SourceRange loc) {
return SourceRange(importSourceLoc(loc.getBegin()), importSourceLoc(loc.getEnd()));
// FIXME: Implement!
return SourceRange();
}

#pragma mark Importing names
Expand Down
11 changes: 4 additions & 7 deletions lib/ClangImporter/ImportDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3376,11 +3376,8 @@ namespace {
if (alreadyImportedResult != Impl.ImportedDecls.end())
return alreadyImportedResult->second;
result = Impl.createDeclWithClangNode<StructDecl>(
decl, AccessLevel::Public,
SourceLoc(), // FIXME: Impl.importSourceLoc(decl->getBeginLoc()) results in a bad import: SR-15440
name,
SourceLoc(), // FIXME: Impl.importSourceLoc(decl->getLocation()) result in a bad import: SR-15440
None, nullptr, dc);
decl, AccessLevel::Public, Impl.importSourceLoc(decl->getBeginLoc()),
name, Impl.importSourceLoc(decl->getLocation()), None, nullptr, dc);
Impl.ImportedDecls[{decl->getCanonicalDecl(), getVersion()}] = result;

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