Commit Graph

76 Commits

Author SHA1 Message Date
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
Chad Rosier bf40d6b6a5 [ms-inline asm] Add various MC components to clang build to support MS-style inline assembly.
llvm-svn: 161594
2012-08-09 17:17:01 +00:00
NAKAMURA Takumi a9a35c67e1 libclang, examples: [CMake] Add dependencies to tblgen'd headers.
llvm-svn: 160849
2012-07-27 06:17:56 +00:00
Dmitri Gribenko 5e4fe00e64 Add libclang APIs to walk comments ASTs and an API to convert a comment to an
HTML fragment.

For testing, c-index-test now has even more output:
* HTML rendering of a comment
* comment AST tree dump in S-expressions like Comment::dump(), but implemented
* with libclang APIs.

llvm-svn: 160577
2012-07-20 21:34:34 +00:00
Arnaud A. de Grandmaison 2b3c860397 [libclang] Make implementation filename match the header's name for CXCompilationDatabase
llvm-svn: 159493
2012-06-30 20:43:43 +00:00
Arnaud A. de Grandmaison 0fe28a1a84 [libclang] add CompilationDatabase support
llvm-svn: 159484
2012-06-30 11:27:57 +00:00
Chandler Carruth 28969b4139 Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

llvm-svn: 158888
2012-06-21 01:30:21 +00:00
Chandler Carruth 39a3e7544a Fix a big layering violation introduced by r158771.
That commit added a new library just to hold the RawCommentList. I've
started a discussion on the commit thread about whether that is really
meritted -- it certainly doesn't seem necessary at this stage.

However, the immediate problem is that the AST library has a hard
dependency on the Comment library, but the dependencies were set up
completely backward. In addition to the layering violation, this had an
unfortunate effect if scattering the Comments library dependency
throughout the build system, but inconsistently so -- several parts of
the CMake dependencies were missing and only showed up due to transitive
deps or the fact that the target wasn't being built by tho bots.

It turns out that the Comments library can't (currently) be a well
formed layer *below* the AST library either, as it has an API that
accepts an ASTContext. That parameter is currently unused, so maybe that
was a mistake?

Anyways, it really seems like this is logically part of the AST --
that's the whole point of the ASTContext providing access to it as far
as I can tell -- so I've merged it into the AST library to solve the
immediate layering violation problems and remove some of the churn from
our library dependencies.

llvm-svn: 158807
2012-06-20 09:53:52 +00:00
Dmitri Gribenko aab8383a2b Structured comment parsing, first step.
* Retain comments in the AST
* Serialize/deserialize comments
* Find comments attached to a certain Decl
* Expose raw comment text and SourceRange via libclang

llvm-svn: 158771
2012-06-20 00:34:58 +00:00
Francois Pichet b27ea02784 Zap the /Za compiler switch from MSVC projects, the option is considered harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed.
Only 1 minor code change was necessary: can't use cdecl as variable name anymore.

llvm-svn: 158063
2012-06-06 12:00:10 +00:00
Manuel Klimek 4fa6b60ced This patch fixes the cmake build to create libclang.so/libclang.a on linux
instead of liblibclang.so/liblibclang.a.

Patch by Arnaud de Grandmaison.

llvm-svn: 156809
2012-05-15 08:58:48 +00:00
Argyrios Kyrtzidis 19d09d23ac [libclang] Don't set dylib load address to 0xe000000.
Per Greg Clayton:
libclang.dylib is trying to be smart and load itself at a valid address
to be able to load faster which would work for 32 bit systems,
bit won't make any difference on 64 bit systems.
It should either pick a better 64 bit address, or just let itself be loaded at zero.

rdar://11159142

llvm-svn: 155246
2012-04-20 22:07:11 +00:00
Douglas Gregor 1840cc2cc6 Kill the last vestiges of clangIndex
llvm-svn: 154675
2012-04-13 17:26:32 +00:00
Ted Kremenek f7639e1b4a Add new code migrator support for migrating existing Objective-C code to use
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax.

This introduces a new library, libEdit, which provides a new way to support
migration of code that improves on the original ARC migrator.  We now believe
that most of its functionality can be refactored into the existing libraries,
and thus this new library may shortly disappear.

llvm-svn: 152141
2012-03-06 20:06:33 +00:00
Ted Kremenek d010ba4729 serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.
I've tested it on simple cases and it works.  Test cases to follow as well as a few tweaks.

llvm-svn: 144269
2011-11-10 08:43:12 +00:00
Ted Kremenek 4c4f08d555 [libclang] Move implementation of functions for manipulation CXSourceLocations and CXSourceRanges into a separate file.
llvm-svn: 143370
2011-10-31 22:05:42 +00:00
Ted Kremenek bb2c7101b5 [libclang] Add CXDiagnosticImpl to represent a super class for the implementation backing a CXDiagnostic. This allows CXStoredDiagnostic
to be just one possible implementation of a CXDiagnostic.

llvm-svn: 143368
2011-10-31 21:40:19 +00:00
Argyrios Kyrtzidis dc199a3152 [libclang] Introduce a new high level API for indexing clients that assumes
more of the work involved in indexing a translation unit and simplifies client
implementations.

Only C/ObjC for now, C++ (and comments) to come.

llvm-svn: 142233
2011-10-17 19:48:19 +00:00
Argyrios Kyrtzidis cddafd3969 [libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,
and a callback and finds all identifier references of the cursor in the file.

rdar://7948304

llvm-svn: 141277
2011-10-06 07:00:54 +00:00
Argyrios Kyrtzidis a59dbea017 Fix CMake.
llvm-svn: 134918
2011-07-11 20:28:59 +00:00
Argyrios Kyrtzidis 27019be903 [libclang] Fix linker error in buildbots.
llvm-svn: 134847
2011-07-09 21:35:58 +00:00
Argyrios Kyrtzidis 7fbd97f641 [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.
This is a new mode of migration, where we avoid modifying the original files but
we emit temporary files instead.

<path> will be used to keep migration process metadata. Currently the temporary files
that are produced are put in the system's temp directory but we can put them
in the <path> if is necessary.

Also introduce new ARC migration functions in libclang whose only purpose,
currently, is to accept <path> and provide pairs of original file/transformed file
to map from the originals to the files after transformations are applied.

Finally introduce the c-arcmt-test utility that exercises the new libclang functions,
update arcmt-test, and add tests for the whole process.

rdar://9735086.

llvm-svn: 134844
2011-07-09 20:00:58 +00:00
Chandler Carruth 54a2c06cf2 Remove more unnecessary dependencies now that the Frontend -> ARCMigrate
edge has been broken.

llvm-svn: 133343
2011-06-18 09:07:35 +00:00
Chandler Carruth 5dea0dc575 Remove ARCMigrate from more builds that it isn't needed in now that the
layering problem has been addressed.

llvm-svn: 133217
2011-06-16 23:53:28 +00:00
John McCall 2af9866fc9 ARCMigrate depends on libAnalysis, and on unhelpful linkers must appear
before it on the link line.

llvm-svn: 133145
2011-06-16 04:30:11 +00:00
John McCall e70c8987d3 Grr. Of course libARCMigrate depends on libRewrite. This is a lot to be
linking unnecessarily into libclang.

llvm-svn: 133129
2011-06-16 01:29:56 +00:00
John McCall 0a6ba2684f libFrontend depends on ARCMigrate, so link it into libclang.
llvm-svn: 133116
2011-06-16 00:38:00 +00:00
Oscar Fuentes 87eb515aba libclang output name is now libclang. This solves a name collision
when building with Visual Studio. `clang.dll' and `clang.exe' would
have the same `clang.ilk' and `clang.pdb'. On a serial build those
files would be overwritten as clang.exe/clang.dll are created. On a
parallel build there is a risk of both files being written at the same
time. On that case VS fails.

llvm-svn: 129239
2011-04-10 02:29:27 +00:00