Skip to content

Commit

Permalink
IncludeTree: Always check for full name of the header
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Paulo de Souza <[email protected]>
  • Loading branch information
marcosps authored and giulianobelinassi committed Jul 4, 2024
1 parent 6af9caa commit 16ab0bf
Showing 1 changed file with 4 additions and 5 deletions.
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

0 comments on commit 16ab0bf

Please sign in to comment.