diff options
author | Egor Zhdan <e_zhdan@apple.com> | 2023-11-21 14:36:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-21 13:36:50 +0000 |
commit | e6ef31524729fc03275b1ea4f92b66c1e1eb013e (patch) | |
tree | c25db57430b472185362836b690d3673a922d992 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 56f569049c9df7e4db6aa14eae6c4fe200350bf6 (diff) | |
download | llvm-e6ef31524729fc03275b1ea4f92b66c1e1eb013e.zip llvm-e6ef31524729fc03275b1ea4f92b66c1e1eb013e.tar.gz llvm-e6ef31524729fc03275b1ea4f92b66c1e1eb013e.tar.bz2 |
[APINotes] Introduce APINotes infrastructure in Clang Sema and Frontend
This upstreams more of the Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/llvm-project/tree/next/clang/lib/APINotes
This adds the initial Clang APINotes infrastructure to Clang Sema and
Clang Frontend.
There will shortly be a follow-up patch with the actual usages of this
API. I'm splitting these changes into separate PRs to keep the diffs
easier to review.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index d749195..be5b38d 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -747,6 +747,10 @@ void CompilerInstance::createSema(TranslationUnitKind TUKind, CodeCompleteConsumer *CompletionConsumer) { TheSema.reset(new Sema(getPreprocessor(), getASTContext(), getASTConsumer(), TUKind, CompletionConsumer)); + + // Set up API notes. + TheSema->APINotes.setSwiftVersion(getAPINotesOpts().SwiftVersion); + // Attach the external sema source if there is any. if (ExternalSemaSrc) { TheSema->addExternalSource(ExternalSemaSrc.get()); |