diff options
author | Egor Zhdan <e_zhdan@apple.com> | 2024-03-11 12:02:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-11 12:02:29 +0000 |
commit | 878097dff3ea4bad6b7f50017224a84bbf2af406 (patch) | |
tree | 35684684f15a4ed7300ecac4ed46db060ec66a0d /clang/lib/APINotes | |
parent | a84eb244129f288d609307ad42ab5e6c8e1cc795 (diff) | |
download | llvm-878097dff3ea4bad6b7f50017224a84bbf2af406.zip llvm-878097dff3ea4bad6b7f50017224a84bbf2af406.tar.gz llvm-878097dff3ea4bad6b7f50017224a84bbf2af406.tar.bz2 |
[APINotes] Fix failing tests after a PCM logic change
This fixes tests that are going to be upstreamed in the near future.
Currently they are failing downstream in the Apple open source fork.
Failing tests
Clang :: APINotes/retain-count-convention.m
Clang :: APINotes/types.m
Clang :: APINotes/versioned-multi.c
Clang :: APINotes/versioned.m
Since 2e5af56 got merged, Clang now enables `LangOpts.APINotesModules`
when reading a precompiled module that was built with API Notes enabled.
This is correct. The logic in APINotesManager needs to be adjusted to
handle this.
rdar://123526142
Diffstat (limited to 'clang/lib/APINotes')
-rw-r--r-- | clang/lib/APINotes/APINotesManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/APINotes/APINotesManager.cpp b/clang/lib/APINotes/APINotesManager.cpp index d3aef09..f60f09e 100644 --- a/clang/lib/APINotes/APINotesManager.cpp +++ b/clang/lib/APINotes/APINotesManager.cpp @@ -224,7 +224,7 @@ APINotesManager::getCurrentModuleAPINotes(Module *M, bool LookInModule, llvm::SmallVector<FileEntryRef, 2> APINotes; // First, look relative to the module itself. - if (LookInModule) { + if (LookInModule && M->Directory) { // Local function to try loading an API notes file in the given directory. auto tryAPINotes = [&](DirectoryEntryRef Dir, bool WantPublic) { if (auto File = findAPINotesFile(Dir, ModuleName, WantPublic)) { |