Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IncludeTree: Always check for full name of the header #66

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions libcextract/IncludeTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,14 @@ void IncludeTree::Build_Header_Tree(std::vector<std::string> const &must_expand)
bool expand = In_Set(must_expand_set, id->getFileName().str(), /*remove=*/true) ||
In_Set(must_expand_set, id->getFile()->getName().str(),
/*remove=*/true);
#if CLANG_VERSION_MAJOR >= 18
/* Starting from LLVM-18, the behaviour of FileEntry::getName() changed.
* Now it returns the full path of the file rather than the relative path
* to it, so here we account it for now onwards.

/* Starting from LLVM-18 and in some platforms (s390x), the behaviour of
* FileEntry::getName() changed. Now it returns the full path of the file
* rather than the relative path to it, so here we account it for now onwards.
*/
expand |= In_Set(must_expand_set,
id->getFile()->getFileEntry().tryGetRealPathName().str(),
/*remove=*/true);
#endif

bool output = already_seen_main && current->Should_Be_Expanded()
&& !expand;
Expand Down
Loading