Commit Graph

103 Commits

Author SHA1 Message Date
Benjamin Kramer 9eba7354bb Link include-fixer into libclang if clang-tools-extra is checked out.
include-fixer only slightly bloats the size of libclang, but since
libclang has no explicit plugin mechanism it's the only way of getting
this to work. Clang-tidy is already there and so far there weren't many
complaints ;)

This is designed to be easy to remove again if libclang ever grows
proper plugin support.

llvm-svn: 287229
2016-11-17 15:22:36 +00:00
NAKAMURA Takumi dd30704201 Tweak CMakeLists not for libclang to depend on the variable CLANG_TOOL_EXTRA_BUILD.
llvm-svn: 262606
2016-03-03 11:09:43 +00:00
Benjamin Kramer c1ffdab3fb [libclang] Link clang-tidy plugin into libclang if present.
This is a sad workaround for the lack of plugin support in libclang. Depends
on D17807, a tools-extra change that also contains the test case.

This is designed to be easy to remove again if libclang ever grows proper
plugin support.

Differential Revision: http://reviews.llvm.org/D17808

llvm-svn: 262596
2016-03-03 08:58:18 +00:00
NAKAMURA Takumi 93e0200e23 libclang/CMakeLists.txt: Prune IndexingContext.h out of ADDITIONAL_HEADERS. VS IDE uses it.
llvm-svn: 260802
2016-02-13 04:01:49 +00:00
Argyrios Kyrtzidis f4fb85b1c7 [libclang] Separate the underlying indexing functionality of libclang and introduce it into the clangIndex library.
It is a general goodness for libclang itself to mostly be a wrapper of functionality provided by the libraries.

llvm-svn: 260760
2016-02-12 23:10:59 +00:00
Chris Bieneman 9c92d67b78 [CMake] Move the install logic for libclang's headers into the libclang CMakelists
This makes it so if you disable building libclang you won't install the headers as part of the 'install' target.

llvm-svn: 257828
2016-01-14 22:48:45 +00:00
Argyrios Kyrtzidis e053d44309 [CMake] Setup an install component for libclang and c-index-test.
Also don't create libclang dylib symlinks on darwin.

llvm-svn: 252836
2015-11-12 00:46:57 +00:00
Chris Bieneman 767828b7bb [CMake] Add LLVM_VERSION_PATCH to the -current_version flag for libclang.
This is to match autoconf where LLVM_SUBMIT_SUBVERSION is usually set to ${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}.

llvm-svn: 250278
2015-10-14 07:50:47 +00:00
Chris Bieneman 658beb930e [CMake]Getting rid of references to LLVM_SUBMIT_VERSION and LLVM_SUBMIT_SUBVERSION in favor of LLVM_VERSION_MAJOR and LLVM_VERSION_MINOR.
LLVM_SUBMIT_VERSION and LLVM_SUBMIT_SUBVERSION are commonly used variable names in the autoconf build system. They seem to have leeched into clang's CMake in a few places, and should just be replaced by the LLVM_VERSION_* variables where appropriate.

llvm-svn: 250246
2015-10-13 23:03:54 +00:00
Adrian Prantl fb2398d0c4 Make the clang module container format selectable from the command line.
- introduces a new cc1 option -fmodule-format=[raw,obj]
  with 'raw' being the default
- supports arbitrary module container formats that libclang is agnostic to
- adds the format to the module hash to avoid collisions
- splits the old PCHContainerOperations into PCHContainerWriter and
  a PCHContainerReader.

Thanks to Richard Smith for reviewing this patch!

llvm-svn: 242499
2015-07-17 01:19:54 +00:00
NAKAMURA Takumi bbe5c4cdcd [CMake] Reorder libdeps. NFC.
llvm-svn: 241661
2015-07-08 02:06:29 +00:00
Adrian Prantl bc068586ac Revert "Revert r241620 and follow-up commits" and move the initialization
of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp.

llvm-svn: 241653
2015-07-08 01:00:30 +00:00
Adrian Prantl 142ec39739 Revert r241620 and follow-up commits while investigating linux buildbot failures.
llvm-svn: 241642
2015-07-07 23:19:46 +00:00
Adrian Prantl e50371b948 Wrap clang modules and pch files in an object file container.
This patch adds ObjectFilePCHContainerOperations uses the LLVM backend
to put the contents of a PCH into a __clangast section inside a COFF, ELF,
or Mach-O object file container.

This is done to facilitate module debugging by makeing it possible to
store the debug info for the types defined by a module alongside the AST.

rdar://problem/20091852

llvm-svn: 241620
2015-07-07 20:11:29 +00:00
Adrian Prantl cbc368c5b5 Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
llvm-svn: 230454
2015-02-25 02:44:04 +00:00
Adrian Prantl 8bf7af3de8 Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

This reapplies r230044 with a fixed configure+make build and updated
dependencies and testcase requirements. Over the last iteration this
version adds
- missing target requirements for testcases that specify an x86 triple,
- a missing clangCodeGen.a dependency to libClang.a in the make build.

rdar://problem/19104245

llvm-svn: 230423
2015-02-25 01:31:45 +00:00
Adrian Prantl a39924a1f8 Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit r230305.
Off to fix another round of missing dependencies on various platforms.

llvm-svn: 230309
2015-02-24 05:14:17 +00:00
Adrian Prantl fc360dc30b Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies. Take 3.

llvm-svn: 230305
2015-02-24 04:25:59 +00:00
Adrian Prantl 67fbfa3773 Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit 230099.

The Linux configure+make build variant still needs some work.

llvm-svn: 230103
2015-02-21 00:29:14 +00:00
Adrian Prantl f2b0cd91eb Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies. Take 2.

llvm-svn: 230089
2015-02-20 23:34:26 +00:00
Adrian Prantl 690b2f7746 Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit r230067.

Investigating another batch of problems found by the bots.

llvm-svn: 230073
2015-02-20 22:12:19 +00:00
Adrian Prantl b59bc1a528 Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

This reapplies r230044 with a fixed configure+make build and updated
dependencies.

llvm-svn: 230067
2015-02-20 21:53:12 +00:00
Adrian Prantl a4f522fa19 Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit r230044 while dealing with buildbot breakage.

Conflicts:
	test/Modules/module_container.m

llvm-svn: 230052
2015-02-20 20:00:27 +00:00
Adrian Prantl c4091aa74e Wrap clang module files in a Mach-O, ELF, or COFF container.
This is a necessary prerequisite for debugging with modules.
The .pcm files become containers that hold the serialized AST which allows
us to store debug information in the module file that can be shared by all
object files that were built importing the module.

rdar://problem/19104245

llvm-svn: 230044
2015-02-20 19:44:52 +00:00
Rafael Espindola e6fbdcedf9 Link libclang with dl if available.
This is in preparation for changing the link to use -Wl,-z,defs.

llvm-svn: 226609
2015-01-20 21:10:35 +00:00
NAKAMURA Takumi 9f99a7a417 [CMake] Prune redundant libdeps.
llvm-svn: 220893
2014-10-30 01:37:44 +00:00
NAKAMURA Takumi bef5d81a50 libclang: Update LINK_COMPONENTS.
llvm-svn: 214616
2014-08-02 06:58:39 +00:00
Alp Toker f55a306996 Fix the !CLANG_ENABLE_ARCMT build
llvm-svn: 212995
2014-07-14 22:17:16 +00:00
Rafael Espindola d0151cebcf Now that llvm's build system sets -install_name, we don't need to.
llvm-svn: 202500
2014-02-28 13:50:15 +00:00
NAKAMURA Takumi 959c64bb76 [CMake] libclang: Use llvm_add_library(SHARED STATIC).
llvm-svn: 201862
2014-02-21 15:34:01 +00:00
NAKAMURA Takumi 7da9487dd4 [CMake] Get rid of explicit dependencies to include/clang/*.inc and introduce CLANG_TABLEGEN_TARGETS.
This does;
  - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list.
  - List of targets is added to LLVM_COMMON_DEPENDS.
  - all clang libraries and targets depend on generated headers.

You might wonder this would be regression, but in fact, this is little loss.
  - Almost all of clang libraries depend on tblgen'd files and clang-tblgen.
  - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild.
  - Each library's dependencies to tblgen'd files might vary along headers' structure.
    It made hard to track and update *really optimal* dependencies.

Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS.

llvm-svn: 201842
2014-02-21 07:59:59 +00:00
Dmitri Gribenko f430da4de6 Add an option to allow Clang verify source files for a module only once during
the build

When Clang loads the module, it verifies the user source files that the module
was built from.  If any file was changed, the module is rebuilt.  There are two
problems with this:
1. correctness: we don't verify system files (there are too many of them, and
   stat'ing all of them would take a lot of time);
2. performance: the same module file is verified again and again during a
   single build.

This change allows the build system to optimize source file verification.  The
idea is based on the fact that while the project is being built, the source
files don't change.  This allows us to verify the module only once during a
single build session.  The build system passes a flag,
-fbuild-session-timestamp=, to inform Clang of the time when the build started.
The build system also requests to enable this feature by passing
-fmodules-validate-once-per-build-session.  If these flags are not passed, the
behavior is not changed.  When Clang verifies the module the first time, it
writes out a timestamp file.  Then, when Clang loads the module the second
time, it finds a timestamp file, so it can compare the verification timestamp
of the module with the time when the build started.  If the verification
timestamp is too old, the module is verified again, and the timestamp file is
updated.

llvm-svn: 201224
2014-02-12 10:33:14 +00:00
NAKAMURA Takumi 518490b949 [CMake] libclang: Update GENERATED_HEADERS with actually used.
+  ClangAttrVisitor
+  ClangCommentCommandList

llvm-svn: 199999
2014-01-24 13:40:37 +00:00
NAKAMURA Takumi 742b90c3ed [CMake] Move LIBCLANG_BUILD_STATIC above. NFC.
llvm-svn: 199903
2014-01-23 15:33:50 +00:00
NAKAMURA Takumi ac3ff26885 [CMake] Parameterize MODULE and SHARED in add_clang_library().
llvm-svn: 199902
2014-01-23 15:33:44 +00:00
NAKAMURA Takumi 9f2538d883 [CMake][MS] libclang: Invalidate LLVM_EXPORTED_SYMBOL_FILE to suppress LNK4197.
Each functions is exported as "dllexport" in include/clang-c.
See also KB835326.

llvm-svn: 199799
2014-01-22 13:02:59 +00:00
NAKAMURA Takumi bf6d1efbba [CMake] Apply ADDITIONAL_HEADERS introduced in r199639.
llvm-svn: 199640
2014-01-20 10:24:05 +00:00
Nico Weber 194c009352 Port r198088 (set NO_DEAD_STRIP for clang) from make to cmake.
Also stop setting passing -dead_strip explicitly for libclang and instead
rely on this now happening by default. (And make it happen by default for
add_clang_library, which doesn't use the library cmake functions from llvm.)

llvm-svn: 198200
2013-12-30 03:43:30 +00:00
Nico Weber 5f676dc53a Use LLVM_EXPORTED_SYMBOL_FILE in libclang's cmake build.
Now the exports file should have an effect on non-darwin too.

llvm-svn: 198176
2013-12-29 19:31:48 +00:00
NAKAMURA Takumi ac85179219 [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each CMakeLists.txt.
llvm-svn: 196916
2013-12-10 12:40:37 +00:00
Dmitri Gribenko 7244bee1a8 libclang does not depend directly on clangFormat; but clangIndex does
llvm-svn: 194611
2013-11-13 22:26:04 +00:00
Dmitri Gribenko 9e6051135a Documentation parsing: move comment-to-XML conversion routines to libIndex
llvm-svn: 194610
2013-11-13 22:16:51 +00:00
Argyrios Kyrtzidis 08b0418828 [libclang] Some changes on the linker options for libclang on a CMake build.
- Use the 'libclang.exports' file.
- Pass -Wl,-current_version
- Set install name to "@rpath"

llvm-svn: 194134
2013-11-06 08:37:50 +00:00
Argyrios Kyrtzidis 15a2fccb78 Rename libIDE to libIndex.
Per feedback from Chandler, it's better to have libraries with more specific functionality.
LibIndex will contain the indexing functionality of libclang, which includes USR generation.

llvm-svn: 188601
2013-08-17 00:40:41 +00:00
Argyrios Kyrtzidis 4b2b460893 Introduce the clangIDE library.
Libclang has a lot of functionality that is inaccessible.
The purpose of clangIDE is to move most of the functionality of libclang to it so we
can expose it and have libclang be more of a thin C wrapper over clangIDE.

Start by moving the USR generation functionality into clangIDE.

llvm-svn: 188569
2013-08-16 18:17:55 +00:00
Argyrios Kyrtzidis f7b32a0bd0 [libclang] CMake: add an option to control building libclang as a static library (off by default)
This avoids building libclang twice by default.

llvm-svn: 183437
2013-06-06 19:51:37 +00:00
Argyrios Kyrtzidis 41686481f4 [cmake] Add clang-headers as a dependency of libclang and if we have to copy them
for the IDE case, also create a symlink inside the libclang.dylib directory.

llvm-svn: 178372
2013-03-29 21:51:40 +00:00
Chris Lattner 5b313e7b2a this depends on the bitcode reader, since it is using it.
llvm-svn: 172905
2013-01-19 18:24:13 +00:00
Fariborz Jahanian 9b7ab87738 This is the libclang patch providing minimal API to
use clang's formatter. Currently, formatter is used 
to format declaration tags for xml comments. Since formatter
is in flux and its change will break several of the clang comment
tests, only a single tests is formatted using this facility.
Doug has reviewed and approved it for check-in. 

llvm-svn: 170467
2012-12-18 23:02:59 +00:00
Ted Kremenek cdf814900d Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.
This is similar to how we divide up the StaticAnalyzer libraries to separate
core functionality to what is clearly associated with Frontend actions.

llvm-svn: 163050
2012-09-01 05:09:24 +00:00