From 60b65db659fe124eb2f447d234a6e74debf06091 Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Thu, 4 Jul 2024 14:54:21 -0300 Subject: [PATCH] IncludeTree: Always check for full name of the header Signed-off-by: Marcos Paulo de Souza --- libcextract/IncludeTree.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libcextract/IncludeTree.cpp b/libcextract/IncludeTree.cpp index acb4dce..b058ce4 100644 --- a/libcextract/IncludeTree.cpp +++ b/libcextract/IncludeTree.cpp @@ -123,15 +123,14 @@ void IncludeTree::Build_Header_Tree(std::vector 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;