Skip to content

Commit a86a26c

Browse files
authored
Merge pull request #34976 from akyrtzi/parser-only-build-fix-linker-errors
[AST] Fix linker errors when doing a 'parser only' build
2 parents 363d536 + 7ce975f commit a86a26c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/AST/ClangTypeConverter.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ const clang::Type *ClangTypeConverter::getFunctionType(
120120
ArrayRef<AnyFunctionType::Param> params, Type resultTy,
121121
AnyFunctionType::Representation repr) {
122122

123+
#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
124+
return nullptr;
125+
#endif
126+
123127
auto resultClangTy = convert(resultTy);
124128
if (resultClangTy.isNull())
125129
return nullptr;
@@ -163,6 +167,10 @@ const clang::Type *ClangTypeConverter::getFunctionType(
163167
ArrayRef<SILParameterInfo> params, Optional<SILResultInfo> result,
164168
SILFunctionType::Representation repr) {
165169

170+
#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
171+
return nullptr;
172+
#endif
173+
166174
// Using the interface type is sufficient as type parameters get mapped to
167175
// `id`, since ObjC lightweight generics use type erasure. (See also: SE-0057)
168176
auto resultClangTy = result.hasValue()

lib/AST/NameLookup.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,11 @@ AnyObjectLookupRequest::evaluate(Evaluator &evaluator, const DeclContext *dc,
18721872
using namespace namelookup;
18731873
QualifiedLookupResult decls;
18741874

1875+
#if SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
1876+
// Avoid calling `clang::ObjCMethodDecl::isDirectMethod()`.
1877+
return decls;
1878+
#endif
1879+
18751880
// Type-only lookup won't find anything on AnyObject.
18761881
if (options & NL_OnlyTypes)
18771882
return decls;

0 commit comments

Comments
 (0)