Skip to content

Use llvm-config.h in CIndexer.cpp instead of private header #75928

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

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

abhina-sree
Copy link
Contributor

Use llvm-config.h in CIndexer.cpp instead of private header

@abhina-sree abhina-sree self-assigned this Dec 19, 2023
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Dec 19, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 19, 2023

@llvm/pr-subscribers-clang

Author: Abhina Sree (abhina-sree)

Changes

Use llvm-config.h in CIndexer.cpp instead of private header


Full diff: https://github.com/llvm/llvm-project/pull/75928.diff

2 Files Affected:

  • (modified) clang/tools/libclang/CIndexer.cpp (+1-1)
  • (modified) llvm/include/llvm/Config/llvm-config.h.cmake (+6)
diff --git a/clang/tools/libclang/CIndexer.cpp b/clang/tools/libclang/CIndexer.cpp
index 0623ae69fe01ed..430147b2aa77af 100644
--- a/clang/tools/libclang/CIndexer.cpp
+++ b/clang/tools/libclang/CIndexer.cpp
@@ -17,7 +17,7 @@
 #include "clang/Driver/Driver.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/Path.h"
diff --git a/llvm/include/llvm/Config/llvm-config.h.cmake b/llvm/include/llvm/Config/llvm-config.h.cmake
index 6605ea60df99e1..483c5adc99ca80 100644
--- a/llvm/include/llvm/Config/llvm-config.h.cmake
+++ b/llvm/include/llvm/Config/llvm-config.h.cmake
@@ -198,4 +198,10 @@
 /* Define if plugins enabled */
 #cmakedefine LLVM_ENABLE_PLUGINS
 
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H ${HAVE_DLFCN_H}
+
+/* Define if dladdr() is available on this platform. */
+#cmakedefine HAVE_DLADDR ${HAVE_DLADDR}
+
 #endif

Copy link
Contributor

@fanbo-meng fanbo-meng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhina-sree abhina-sree merged commit e86a02c into llvm:main Dec 20, 2023
@abhina-sree abhina-sree deleted the abhina/replace_private_header branch December 20, 2023 13:44
@chapuni
Copy link
Contributor

chapuni commented Dec 20, 2023

We should not expose prefix-less MACROs.

abhina-sree added a commit to abhina-sree/llvm-project that referenced this pull request Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants