From f51f20fa34654da75d15a9e2a1a0cd2fc0d8603d Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 30 Apr 2010 21:51:10 +0000 Subject: [PATCH] Rename 'CIndex' to 'libclang', since it has basically become our stable public (C) API, and will likely grow further in this direction in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102779 91177308-0d34-0410-b5e6-96231b3b80d8 --- bindings/python/README.txt | 5 ++--- bindings/python/clang/cindex.py | 6 +++--- tools/CMakeLists.txt | 2 +- tools/Makefile | 4 ++-- tools/c-index-test/CMakeLists.txt | 2 +- tools/c-index-test/Makefile | 2 +- tools/{CIndex => libclang}/CIndex.cpp | 0 tools/{CIndex => libclang}/CIndexCodeCompletion.cpp | 0 tools/{CIndex => libclang}/CIndexDiagnostic.cpp | 0 tools/{CIndex => libclang}/CIndexDiagnostic.h | 0 tools/{CIndex => libclang}/CIndexInclusionStack.cpp | 0 tools/{CIndex => libclang}/CIndexUSRs.cpp | 0 tools/{CIndex => libclang}/CIndexer.cpp | 0 tools/{CIndex => libclang}/CIndexer.h | 0 tools/{CIndex => libclang}/CMakeLists.txt | 11 ++++++----- tools/{CIndex => libclang}/CXCursor.cpp | 0 tools/{CIndex => libclang}/CXCursor.h | 0 tools/{CIndex => libclang}/CXSourceLocation.h | 0 tools/{CIndex => libclang}/Makefile | 6 +++--- .../libclang.darwin.exports} | 0 .../CIndex.exports => libclang/libclang.exports} | 0 21 files changed, 19 insertions(+), 19 deletions(-) rename tools/{CIndex => libclang}/CIndex.cpp (100%) rename tools/{CIndex => libclang}/CIndexCodeCompletion.cpp (100%) rename tools/{CIndex => libclang}/CIndexDiagnostic.cpp (100%) rename tools/{CIndex => libclang}/CIndexDiagnostic.h (100%) rename tools/{CIndex => libclang}/CIndexInclusionStack.cpp (100%) rename tools/{CIndex => libclang}/CIndexUSRs.cpp (100%) rename tools/{CIndex => libclang}/CIndexer.cpp (100%) rename tools/{CIndex => libclang}/CIndexer.h (100%) rename tools/{CIndex => libclang}/CMakeLists.txt (77%) rename tools/{CIndex => libclang}/CXCursor.cpp (100%) rename tools/{CIndex => libclang}/CXCursor.h (100%) rename tools/{CIndex => libclang}/CXSourceLocation.h (100%) rename tools/{CIndex => libclang}/Makefile (93%) rename tools/{CIndex/CIndex.darwin.exports => libclang/libclang.darwin.exports} (100%) rename tools/{CIndex/CIndex.exports => libclang/libclang.exports} (100%) diff --git a/bindings/python/README.txt b/bindings/python/README.txt index ccc2619ccf..742cf8fbb8 100644 --- a/bindings/python/README.txt +++ b/bindings/python/README.txt @@ -2,10 +2,9 @@ // Clang Python Bindings //===----------------------------------------------------------------------===// -This directory implements Python bindings for Clang. Currently, only bindings -for the CIndex C API exist. +This directory implements Python bindings for Clang. -You may need to alter LD_LIBRARY_PATH so that the CIndex library can be +You may need to alter LD_LIBRARY_PATH so that the Clang library can be found. The unit tests are designed to be run with 'nosetests'. For example: -- $ env PYTHONPATH=$(echo ~/llvm/tools/clang/bindings/python/) \ diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py index f4409aec33..f0f81b5d69 100644 --- a/bindings/python/clang/cindex.py +++ b/bindings/python/clang/cindex.py @@ -71,11 +71,11 @@ def get_cindex_library(): import platform name = platform.system() if name == 'Darwin': - return cdll.LoadLibrary('libCIndex.dylib') + return cdll.LoadLibrary('libclang.dylib') elif name == 'Windows': - return cdll.LoadLibrary('libCIndex.dll') + return cdll.LoadLibrary('libclang.dll') else: - return cdll.LoadLibrary('libCIndex.so') + return cdll.LoadLibrary('libclang.so') # ctypes doesn't implicitly convert c_void_p to the appropriate wrapper # object. This is a problem, because it means that from_parameter will see an diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 64c3a213cd..ae33b782d4 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,3 +1,3 @@ -add_subdirectory(CIndex) +add_subdirectory(libclang) add_subdirectory(c-index-test) add_subdirectory(driver) diff --git a/tools/Makefile b/tools/Makefile index bfd5ad12f9..8407dfdedd 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -8,12 +8,12 @@ ##===----------------------------------------------------------------------===## LEVEL := ../../.. -DIRS := driver CIndex c-index-test +DIRS := driver libclang c-index-test include $(LEVEL)/Makefile.config ifeq ($(OS), $(filter $(OS), Cygwin MingW)) -DIRS := $(filter-out CIndex c-index-test, $(DIRS)) +DIRS := $(filter-out libclang c-index-test, $(DIRS)) endif include $(LEVEL)/Makefile.common diff --git a/tools/c-index-test/CMakeLists.txt b/tools/c-index-test/CMakeLists.txt index f0a34a5798..d965fd2b51 100644 --- a/tools/c-index-test/CMakeLists.txt +++ b/tools/c-index-test/CMakeLists.txt @@ -1,7 +1,7 @@ set(LLVM_NO_RTTI 1) set( LLVM_USED_LIBS - CIndex + libclang clangIndex clangFrontend clangDriver diff --git a/tools/c-index-test/Makefile b/tools/c-index-test/Makefile index 1412563617..24fed16006 100644 --- a/tools/c-index-test/Makefile +++ b/tools/c-index-test/Makefile @@ -17,7 +17,7 @@ TOOL_NO_EXPORTS = 1 include $(LEVEL)/Makefile.config LINK_COMPONENTS := bitreader mc core -USEDLIBS = CIndex.a clangIndex.a clangFrontend.a clangDriver.a clangSema.a \ +USEDLIBS = clang.a clangIndex.a clangFrontend.a clangDriver.a clangSema.a \ clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a include $(LLVM_SRC_ROOT)/Makefile.rules diff --git a/tools/CIndex/CIndex.cpp b/tools/libclang/CIndex.cpp similarity index 100% rename from tools/CIndex/CIndex.cpp rename to tools/libclang/CIndex.cpp diff --git a/tools/CIndex/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp similarity index 100% rename from tools/CIndex/CIndexCodeCompletion.cpp rename to tools/libclang/CIndexCodeCompletion.cpp diff --git a/tools/CIndex/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp similarity index 100% rename from tools/CIndex/CIndexDiagnostic.cpp rename to tools/libclang/CIndexDiagnostic.cpp diff --git a/tools/CIndex/CIndexDiagnostic.h b/tools/libclang/CIndexDiagnostic.h similarity index 100% rename from tools/CIndex/CIndexDiagnostic.h rename to tools/libclang/CIndexDiagnostic.h diff --git a/tools/CIndex/CIndexInclusionStack.cpp b/tools/libclang/CIndexInclusionStack.cpp similarity index 100% rename from tools/CIndex/CIndexInclusionStack.cpp rename to tools/libclang/CIndexInclusionStack.cpp diff --git a/tools/CIndex/CIndexUSRs.cpp b/tools/libclang/CIndexUSRs.cpp similarity index 100% rename from tools/CIndex/CIndexUSRs.cpp rename to tools/libclang/CIndexUSRs.cpp diff --git a/tools/CIndex/CIndexer.cpp b/tools/libclang/CIndexer.cpp similarity index 100% rename from tools/CIndex/CIndexer.cpp rename to tools/libclang/CIndexer.cpp diff --git a/tools/CIndex/CIndexer.h b/tools/libclang/CIndexer.h similarity index 100% rename from tools/CIndex/CIndexer.h rename to tools/libclang/CIndexer.h diff --git a/tools/CIndex/CMakeLists.txt b/tools/libclang/CMakeLists.txt similarity index 77% rename from tools/CIndex/CMakeLists.txt rename to tools/libclang/CMakeLists.txt index 609719e627..df4884be61 100644 --- a/tools/CIndex/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt @@ -18,7 +18,7 @@ set( LLVM_LINK_COMPONENTS core ) -add_clang_library(CIndex +add_clang_library(libclang CIndex.cpp CIndexCodeCompletion.cpp CIndexDiagnostic.cpp @@ -28,6 +28,7 @@ add_clang_library(CIndex CXCursor.cpp ../../include/clang-c/Index.h ) +set_target_properties(libclang PROPERTIES OUTPUT_NAME clang) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # FIXME: Deal with LLVM_SUBMIT_VERSION? @@ -36,9 +37,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # get underscore-prefixed names. It would be better to have build rules # which know how to produce a darwin-suitable exports file from the # regular exports file. - set_target_properties(CIndex + set_target_properties(libclang PROPERTIES - LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/CIndex.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000" + LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/libclang.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000" INSTALL_NAME_DIR "@executable_path/../lib" ) endif() @@ -47,10 +48,10 @@ if(MSVC) # windows.h doesn't compile with /Za get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS) string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) - set_target_properties(CIndex PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) + set_target_properties(libclang PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS}) endif(MSVC) -set_target_properties(CIndex +set_target_properties(libclang PROPERTIES LINKER_LANGUAGE CXX DEFINE_SYMBOL _CINDEX_LIB_) diff --git a/tools/CIndex/CXCursor.cpp b/tools/libclang/CXCursor.cpp similarity index 100% rename from tools/CIndex/CXCursor.cpp rename to tools/libclang/CXCursor.cpp diff --git a/tools/CIndex/CXCursor.h b/tools/libclang/CXCursor.h similarity index 100% rename from tools/CIndex/CXCursor.h rename to tools/libclang/CXCursor.h diff --git a/tools/CIndex/CXSourceLocation.h b/tools/libclang/CXSourceLocation.h similarity index 100% rename from tools/CIndex/CXSourceLocation.h rename to tools/libclang/CXSourceLocation.h diff --git a/tools/CIndex/Makefile b/tools/libclang/Makefile similarity index 93% rename from tools/CIndex/Makefile rename to tools/libclang/Makefile index 391746d4d4..a7877bf8e1 100644 --- a/tools/CIndex/Makefile +++ b/tools/libclang/Makefile @@ -1,4 +1,4 @@ -##===- tools/CIndex/Makefile -------------------------------*- Makefile -*-===## +##===- tools/libclang/Makefile -----------------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -8,9 +8,9 @@ ##===----------------------------------------------------------------------===## LEVEL = ../../../.. -LIBRARYNAME = CIndex +LIBRARYNAME = clang -EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/CIndex.exports +EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/libclang.exports CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include diff --git a/tools/CIndex/CIndex.darwin.exports b/tools/libclang/libclang.darwin.exports similarity index 100% rename from tools/CIndex/CIndex.darwin.exports rename to tools/libclang/libclang.darwin.exports diff --git a/tools/CIndex/CIndex.exports b/tools/libclang/libclang.exports similarity index 100% rename from tools/CIndex/CIndex.exports rename to tools/libclang/libclang.exports