Граф коммитов

348 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis c1d2239362 [Modules] Resolve top-headers of modules lazily.
This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176975 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13 21:13:43 +00:00
Argyrios Kyrtzidis 6f09c3d69f [libclang] Change clang_findReferencesInFile and clang_findIncludesInFile to return an enum,
as suggested by Jordan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176732 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 22:47:41 +00:00
Argyrios Kyrtzidis 389dc5603f [libclang] Modify clang_findReferencesInFile and clang_findIncludesInFile to return a value.
Possible values are:
 1  : if a parameter was invalid
 -1 : if the callback returned CXVisit_Break,
 otherwise returns 0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176716 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 20:42:33 +00:00
Argyrios Kyrtzidis ee2d5fd7a3 [libclang] Introduce clang_findIncludesInFile, that can be used to retrieve all #import/#include directives in a specific file.
It passes to the visitor, that the caller provides, CXCursor_InclusionDirective cursors for
all the include directives in a particular file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176682 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 02:32:34 +00:00
Peter Collingbourne 7728cddd78 Revert r175912, "Add support for coldcc to clang" at John's request.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175936 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-23 00:06:18 +00:00
Peter Collingbourne 4c67aa9640 Add support for coldcc to clang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175912 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22 19:24:35 +00:00
Dmitri Gribenko ae03d8e52d libclang: add clang_getTypeSpelling(CXType CT)
Adds a function clang_getTypeSpelling(CXType CT) that returns
a CXString containing the underlying type.

Patch by Ben Gertzfield.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 21:15:49 +00:00
Argyrios Kyrtzidis db84e7a44d [libclang] Introduce clang_getFileUniqueID which returns a struct
for a CXFile containing device/inode/modification time.

Intended to be useful as a key associated with a unique file across
an indexing session.

rdar://13091837

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173559 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 04:52:52 +00:00
Dmitri Gribenko 689d747a49 libclang: constness for CXString
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172270 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 23:08:18 +00:00
Argyrios Kyrtzidis e2748288a0 [libclang] Add some constness in CXSourceLocation and CXSourceRange.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 22:29:47 +00:00
Dmitri Gribenko 67812b2f94 libclang: change CXCursor to store 'const void *' pointers for
const-correctness, and update all users


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172252 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 21:01:49 +00:00
NAKAMURA Takumi f9c21665fa clang-c/Index.h: Clarify empty argument with (void) for C89.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172037 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 02:12:38 +00:00
Argyrios Kyrtzidis 2d5c133d3d [libclang] Introduce clang_getFileLocation.
Uses of clang_getSpellingLocation should eventually move to calling
clang_getFileLocation, and clang_getSpellingLocation should do what
its name represents and actually point at the 'spelling' location, e.g.
inside a macro definition if the spelling of a token came from that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171486 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 18:30:13 +00:00
Guy Benyei 38980086c0 Add intel_ocl_bicc calling convention as a function attribute to clang. The calling convention is already implemented in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-25 08:53:55 +00:00
Bill Wendling ad017fa7a4 Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170721 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20 19:22:21 +00:00
Bill Wendling 094dbf9171 Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170500 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-19 07:18:12 +00:00
Argyrios Kyrtzidis 838eb7e865 [libclang] Introduce a new indexing mode where we skip function bodies
that were already parsed in the same "indexing session".

An indexing session is defined as using the same CXIndexAction object
for multiple clang_indexSourceFile calls.
Passing CXIndexOpt_SkipParsedBodiesInSession as an indexing option will
enable the mode where we try to skip bodies that were already parsed in
another translation unit.

If a function's body was skipped, the "flags" field in the CXIdxDeclInfo
structure will have "CXIdxDeclFlag_Skipped" bit was set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06 19:41:16 +00:00
Dmitri Gribenko 1eb60825f0 libclang: Add a function to libclang for retrieving the bit width value
Patch by Jyun-Yan You.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169276 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 15:13:46 +00:00
Argyrios Kyrtzidis 7e96bfb4d5 Introduce CompilationDatabase::getAllCompileCommands() that returns all
compile commands of the database and expose it via the libclang API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 07:26:44 +00:00
Argyrios Kyrtzidis 4d9eff53c4 [libclang] Add some comments about the version constants for the libclang API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167489 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 21:21:49 +00:00
Argyrios Kyrtzidis e4a990f349 [libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167201 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 02:01:34 +00:00
Argyrios Kyrtzidis bf69d7146a [libclang] Bump the version number of the libclang API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166984 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 23:53:52 +00:00
Argyrios Kyrtzidis ca9805a79d [libclang] Introduce a version constant for the libclang API.
rdar://12587974

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-29 23:24:44 +00:00
Argyrios Kyrtzidis 8d7a24e94b [libclang] Invoke a ppIncludedFile callback when indexing implicit module imports.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18 00:17:05 +00:00
Derek Schuff 263366f924 Add pnaclcall convention to Native Client targets.
Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16 22:30:41 +00:00
Argyrios Kyrtzidis 900ab95e12 [libclang] Improve AST serialization done by ASTUnit::Save().
The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165717 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 16:05:00 +00:00
Argyrios Kyrtzidis d29245ce5e [libclang] Fix the comments, as suggested by Dmitri.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165353 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-06 01:18:38 +00:00
Argyrios Kyrtzidis 134d1e8a0b [libclang] Now that we have a CXModule object, pass it to the
importedASTFile indexing callback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 00:22:40 +00:00
Argyrios Kyrtzidis 5d04b1af7b [libclang] Introduce new C functions that provide information about modules:
clang_Cursor_getModule
clang_Module_getParent
clang_Module_getName
clang_Module_getFullName
clang_Module_getNumTopLevelHeaders
clang_Module_getTopLevelHeader

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165280 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 00:22:37 +00:00
Argyrios Kyrtzidis 6a01012e6b [libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
import declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165277 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-05 00:22:24 +00:00
Argyrios Kyrtzidis 37f2f52fbc [libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03 21:05:44 +00:00
Argyrios Kyrtzidis 2c3e05c266 [libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165020 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02 16:10:38 +00:00
Argyrios Kyrtzidis 526d24444c [libclang] Remove the ParentKind cursor kind from code-completion results.
This is to reduce dependency to cursors for the code-completion results.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-26 16:39:56 +00:00
Argyrios Kyrtzidis 5e02f6525d [libclang] Bring CXCursor_AsmStmt back as an alias for CXCursor_GCCAsmStmt.
This was renamed in r162632 which was badness because the C API needs to be stable.
rdar://12360096

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164547 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-24 19:27:20 +00:00
Dmitri Gribenko 1824d54df8 Fix Doxygen misuse: refer to parameter names in paragraphs correctly (\arg is
not what most people want -- it starts a new paragraph).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13 13:11:20 +00:00
Dmitri Gribenko e4330a302a Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.
Now we have a list of all commands.  This is a good thing in itself, but it
also enables us to easily implement typo correction for command names.

With this change we have objects that contain information about each command,
so it makes sense to resolve command name just once during lexing (currently we
store command names as strings and do a linear search every time some property
value is needed).  Thus comment token and AST nodes were changed to contain a
command ID -- index into a tables of builtin and registered commands.  Unknown
commands are registered during parsing and thus are also uniformly assigned an
ID.  Using an ID instead of a StringRef is also a nice memory optimization
since ID is a small integer that fits into a common bitfield in Comment class.

This change implies that to get any information about a command (even a command
name) we need a CommandTraits object to resolve the command ID to CommandInfo*.
Currently a fresh temporary CommandTraits object is created whenever it is
needed since it does not have any state.  But with this change it has state --
new commands can be registered, so a CommandTraits object was added to
ASTContext.

Also, in libclang CXComment has to be expanded to include a CXTranslationUnit
so that all functions working on comment AST nodes can get a CommandTraits
object.  This breaks binary compatibility of CXComment APIs.

Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't
need TU parameter anymore, so it was removed.  This is a source-incompatible
change for this C API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163540 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-10 20:32:42 +00:00
Joao Matos 4c5fa4292a Revert r163099 per chandlerc's request.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163147 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-04 17:33:09 +00:00
Joao Matos ac067454ad Added a new cursor for SEHLeaveStmt to libclang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-03 00:23:40 +00:00
Joao Matos 17d35c36fb Normalize line endings of r163013 (part 2).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-31 22:18:20 +00:00
Joao Matos 6666ed4ed2 Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-31 18:45:21 +00:00
Chad Rosier df5faf5e7a [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162632 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-25 00:11:56 +00:00
Dmitri Gribenko 70517ca5c0 Fix a bunch of -Wdocumentation warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162452 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23 17:58:28 +00:00
Dmitri Gribenko f303d4cb10 libclang API for comment-to-xml conversion.
The implementation also includes a Relax NG schema and tests for the schema
itself.  The schema is used in c-index-test to verify that XML documents we
produce are valid.  In order to do the validation, we add an optional libxml2
dependency for c-index-test.

Credits for CMake part go to Doug Gregor.  Credits for Autoconf part go to Eric
Christopher.  Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07 17:54:38 +00:00
Dmitri Gribenko 6a425525e5 Comment to HTML conversion: correct typo in CSS class name: taram -> tparam
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161145 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-01 23:47:30 +00:00
Dmitri Gribenko 96b0986749 Comment parsing: add support for \tparam command on all levels.
The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this
breaks libclang binary compatibility, but should not be a problem since API is
so new.

This also fixes PR13372 as a side-effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161087 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31 22:37:06 +00:00
Dmitri Gribenko 2d66a5016d Comment AST: add InlineContentComment::RenderKind to specify a default
rendering mode for clients that don't want to interpret Doxygen commands.

Also add a libclang API to query this information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160633 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 16:43:01 +00:00
Sylvestre Ledru bed28ac1d1 Fix a typo (the the => the)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-23 08:59:39 +00:00
Dmitri Gribenko 3e63d332ba Comment to HTML conversion: add more CSS classes to identify function arguments
by index.  This is useful if the user does not document all arguments, and we
can't find a particular argument by index via :nth-of-type() CSS selector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-21 01:47:43 +00:00
Dmitri Gribenko ae99b75fbb 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160577 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20 21:34:34 +00:00
Arnaud A. de Grandmaison c70851b74c [libclang] CompilationDatabase naming and comment fixes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159682 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03 20:38:12 +00:00