mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Re-land parsing and printing for Clang function types.
This reverts commit e805fe486e, which reverted
the change earlier. The problem was caused due to a simultaneous change to some
code by the PR with parsing and printing for Clang function types (#28737)
and the PR which introduced Located<T> (#28643).
This commit also includes a small change to make sure the intersecting region
is fixed: the change is limited to using the fields of Located<T> in the
`tryParseClangType` lambda.
This commit is contained in:
@@ -21,6 +21,7 @@ class CompilerInstance;
|
||||
class Preprocessor;
|
||||
class Sema;
|
||||
class TargetInfo;
|
||||
class Type;
|
||||
} // namespace clang
|
||||
|
||||
namespace swift {
|
||||
@@ -100,6 +101,16 @@ public:
|
||||
lookupRelatedEntity(StringRef clangName, ClangTypeKind kind,
|
||||
StringRef relatedEntityKind,
|
||||
llvm::function_ref<void(TypeDecl *)> receiver) = 0;
|
||||
|
||||
/// Try to parse the string as a Clang function type.
|
||||
///
|
||||
/// Returns null if there was a parsing failure.
|
||||
virtual const clang::Type *parseClangFunctionType(StringRef type,
|
||||
SourceLoc loc) const = 0;
|
||||
|
||||
/// Print the Clang type.
|
||||
virtual void printClangType(const clang::Type *type,
|
||||
llvm::raw_ostream &os) const = 0;
|
||||
};
|
||||
|
||||
} // namespace swift
|
||||
|
||||
Reference in New Issue
Block a user