Skip to content

Commit

Permalink
[APINotes] Fix failing tests after a PCM logic change
Browse files Browse the repository at this point in the history
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
  • Loading branch information
egorzhdan committed Mar 11, 2024
1 parent a84eb24 commit 878097d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/APINotes/APINotesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 878097d

Please sign in to comment.