]> granicus.if.org Git - clang/commitdiff
Remove the last remaining llvm/Config/config.h includes
authorAlp Toker <alp@nuanti.com>
Wed, 4 Jun 2014 03:28:55 +0000 (03:28 +0000)
committerAlp Toker <alp@nuanti.com>
Wed, 4 Jun 2014 03:28:55 +0000 (03:28 +0000)
This corrects long-standing misuses of LLVM's internal config.h.

In most cases the public llvm-config.h header was intended and we can now
remove the old hacks thanks to LLVM r210144.

The config.h header is private, won't be installed and should no longer be
included by clang or other modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210145 91177308-0d34-0410-b5e6-96231b3b80d8

16 files changed:
include/clang/Config/config.h.cmake
include/clang/Config/config.h.in
lib/Basic/Version.cpp
lib/Driver/Driver.cpp
lib/Driver/ToolChains.cpp
lib/Frontend/CompilerInstance.cpp
lib/Rewrite/Core/Rewriter.cpp
lib/Tooling/Tooling.cpp
tools/c-index-test/c-index-test.c
tools/driver/driver.cpp
tools/libclang/CIndex.cpp
unittests/Basic/FileManagerTest.cpp
unittests/Basic/SourceManagerTest.cpp
unittests/Lex/LexerTest.cpp
unittests/Lex/PPConditionalDirectiveRecordTest.cpp
unittests/Tooling/ToolingTest.cpp

index c18c4cc86f765b75800c7a621d145309cee70306..8fa7a52a3e427d718e76e8c869411eaa3ac18a6d 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef CONFIG_H
+#define CONFIG_H
+
 /* Bug report URL. */
 #define BUG_REPORT_URL "${BUG_REPORT_URL}"
 
@@ -12,3 +15,8 @@
 
 /* Directory where gcc is installed. */
 #define GCC_INSTALL_PREFIX "${GCC_INSTALL_PREFIX}"
+
+/* Define if we have libxml2 */
+#cmakedefine CLANG_HAVE_LIBXML ${CLANG_HAVE_LIBXML}
+
+#endif
index 8ff94178e27e53a27e3ef3a510bfcd430bf27ce3..d66b4cf68dbc126c15dbb4821ff3e43c1255ee8f 100644 (file)
@@ -1,5 +1,3 @@
-/* include/clang/Config/config.h.in. */
-
 #ifndef CONFIG_H
 #define CONFIG_H
 
@@ -21,4 +19,7 @@
 /* Directory where gcc is installed. */
 #undef GCC_INSTALL_PREFIX
 
+/* Define if we have libxml2 */
+#undef CLANG_HAVE_LIBXML
+
 #endif
index ae32c011396d0877246ce56073f5abab9e79b9ba..7973c5dd619818aad9f5a5c8d3755d286ef05d93 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "clang/Basic/Version.h"
 #include "clang/Basic/LLVM.h"
-#include "llvm/Config/config.h"
 #include "llvm/Support/raw_ostream.h"
 #include <cstdlib>
 #include <cstring>
index a0fcf413168b39461975484f0fdf3e0ff6601d05..1d7f18055436b1d2aa1fcc121a091a9ee9ab70bf 100644 (file)
@@ -11,6 +11,7 @@
 #include "InputInfo.h"
 #include "ToolChains.h"
 #include "clang/Basic/Version.h"
+#include "clang/Config/config.h"
 #include "clang/Driver/Action.h"
 #include "clang/Driver/Compilation.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include <map>
 #include <memory>
 
-// FIXME: It would prevent us from including llvm-config.h
-// if config.h were included before system_error.h.
-#include "clang/Config/config.h"
-
 using namespace clang::driver;
 using namespace clang;
 using namespace llvm::opt;
index 8d8e7c7c206c7a8d09f4cf882c68dda86dcffecd..dcbdd7175a6a21478cd899522ac10c0321713fae 100644 (file)
@@ -10,6 +10,7 @@
 #include "ToolChains.h"
 #include "clang/Basic/ObjCRuntime.h"
 #include "clang/Basic/Version.h"
+#include "clang/Config/config.h" // for GCC_INSTALL_PREFIX
 #include "clang/Driver/Compilation.h"
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/system_error.h"
 
-// FIXME: This needs to be listed last until we fix the broken include guards
-// in these files and the LLVM config.h files.
-#include "clang/Config/config.h" // for GCC_INSTALL_PREFIX
-
 #include <cstdlib> // ::getenv
 
 using namespace clang::driver;
index ac20d7a28e5832a750182849a226cd6bcbda6029..a967c0ab5467b90be3a307efb1ccf6bb31422b1e 100644 (file)
@@ -33,7 +33,6 @@
 #include "clang/Serialization/ASTReader.h"
 #include "clang/Serialization/GlobalModuleIndex.h"
 #include "llvm/ADT/Statistic.h"
-#include "llvm/Config/config.h"
 #include "llvm/Support/CrashRecoveryContext.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Host.h"
@@ -710,7 +709,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
   // Validate/process some options.
   if (getHeaderSearchOpts().Verbose)
     OS << "clang -cc1 version " CLANG_VERSION_STRING
+#ifdef PACKAGE_STRING
        << " based upon " << PACKAGE_STRING
+#endif
        << " default target " << llvm::sys::getDefaultTargetTriple() << "\n";
 
   if (getFrontendOpts().ShowTimers)
index c0f87d2a24c513c89d333d1024b69b696034b0d7..8b17b654d6c136fd9ac9b2969b66a53e46a2e9e7 100644 (file)
@@ -21,7 +21,7 @@
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/Lexer.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/raw_ostream.h"
 using namespace clang;
index 35e3eb4af2212ca52b287adf6e9bd10b5620d46e..f8247418a9b7a63117cfca5a489753c7871a02ce 100644 (file)
@@ -24,7 +24,7 @@
 #include "clang/Tooling/ArgumentsAdjusters.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Option/Option.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FileSystem.h"
index dcae6705918a35a07567c888b041f7f97330bd78..1d5cb1434c6f7fe093ca550a4549f7fdf403cb91 100644 (file)
@@ -1,10 +1,10 @@
 /* c-index-test.c */
 
+#include "clang/Config/config.h"
 #include "clang-c/Index.h"
 #include "clang-c/CXCompilationDatabase.h"
 #include "clang-c/BuildSystem.h"
 #include "clang-c/Documentation.h"
-#include "llvm/Config/config.h"
 #include <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
index fd135554a63a85977ee5f7b40c1e3120e59a6c0b..edb32bc96ba6f181298925929e9561af74871c34 100644 (file)
@@ -25,7 +25,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Option/ArgList.h"
 #include "llvm/Option/OptTable.h"
 #include "llvm/Option/Option.h"
index 22b007e2f74df34dd9dd99a8c23b324a1f20e37e..bf54fb93762f4d21d4f762ae4426c15082fb0ac6 100644 (file)
@@ -39,7 +39,7 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringSwitch.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/CrashRecoveryContext.h"
 #include "llvm/Support/Format.h"
@@ -52,7 +52,7 @@
 #include "llvm/Support/Timer.h"
 #include "llvm/Support/raw_ostream.h"
 
-#if HAVE_PTHREAD_H
+#ifdef __APPLE__
 #include <pthread.h>
 #endif
 
@@ -6962,7 +6962,7 @@ cxindex::Logger::~Logger() {
   OS << "[libclang:" << Name << ':';
 
   // FIXME: Portability.
-#if HAVE_PTHREAD_H && __APPLE__
+#ifdef __APPLE__
   mach_port_t tid = pthread_mach_thread_np(pthread_self());
   OS << tid << ':';
 #endif
index 9df85329a4d471eed915b9e2d780c35610b3ca28..ae89395f1286b2d87967c989a710d40fbd088b9b 100644 (file)
@@ -11,7 +11,7 @@
 #include "clang/Basic/FileSystemOptions.h"
 #include "clang/Basic/FileSystemStatCache.h"
 #include "gtest/gtest.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 
 using namespace llvm;
 using namespace clang;
index f227d0d6fd1894bf0562bab28470cc8dd728dea4..3f12f4743c07598677b68f0be54381ca4a8eed33 100644 (file)
@@ -20,7 +20,7 @@
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/PreprocessorOptions.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "gtest/gtest.h"
 
 using namespace llvm;
index 3d30352d4896698dc795608430fc5a4ea2477303..2b42f9cb0ee3c552d5548fe9e47977893f946de5 100644 (file)
@@ -20,7 +20,6 @@
 #include "clang/Lex/ModuleLoader.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/PreprocessorOptions.h"
-#include "llvm/Config/config.h"
 #include "gtest/gtest.h"
 
 using namespace llvm;
index f7ed8e54fc5d3822545ff4b9fbc108dd39ba550a..1be5ececa7a8c11c12119c3c9967cfe37efe47c1 100644 (file)
@@ -20,7 +20,6 @@
 #include "clang/Lex/ModuleLoader.h"
 #include "clang/Lex/Preprocessor.h"
 #include "clang/Lex/PreprocessorOptions.h"
-#include "llvm/Config/config.h"
 #include "gtest/gtest.h"
 
 using namespace llvm;
index 2d055e70859522e1693bac8402649c21f717def0..f277728ea895754ed2954c779301869aeba4029a 100644 (file)
@@ -17,7 +17,7 @@
 #include "clang/Tooling/CompilationDatabase.h"
 #include "clang/Tooling/Tooling.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "gtest/gtest.h"
 #include <string>