Commit Graph

422 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 09a439d313 [libclang] Include "BuildSystem.h" along with "Index.h"
llvm-svn: 202104
2014-02-25 03:59:16 +00:00
Dmitri Gribenko ea4d1c32fb libclang: report error code for bad PCH files
This commit improves libclang to report the error condition when
CXTranslationUnit can not be created because of a stale PCH file.  This allows
the caller, for example, to rebuild the PCH file and retry the request.

There two are APIs in libclang that return a CXTranslationUnit and don't
support reporting detailed errors (the only error condition is a NULL result).
For these APIs, a second, superior, version is introduced --
clang_createTranslationUnit2 and clang_parseTranslationUnit2.  These functions
return a CXTranslationUnit indirectly and also return an error code.  Old
functions are still supported and are nothing more than convenience wrappers
that ignore extended error codes.

As a cleanup, this commit also categorizes some libclang errors in the
functions I had to modify anyway.

llvm-svn: 201249
2014-02-12 19:12:37 +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
Alp Toker 314cc81b8c Rename getResultType() on function and method declarations to getReturnType()
A return type is the declared or deduced part of the function type specified in
the declaration.

A result type is the (potentially adjusted) type of the value of an expression
that calls the function.

Rule of thumb:

  * Declarations have return types and parameters.
  * Expressions have result types and arguments.

llvm-svn: 200082
2014-01-25 16:55:45 +00:00
Alp Toker 601b22c377 Correct various uses of 'argument' that in fact refer to function parameters
Cleanup only.

llvm-svn: 199773
2014-01-21 23:35:24 +00:00
Reid Kleckner 9e3bc72b8d Remove linkage macro from the CXLanguageKind enum
Enums don't have linkage, so clang warns when this expands to dllimport.

llvm-svn: 198227
2013-12-30 17:48:49 +00:00
Argyrios Kyrtzidis 0e282ef868 [libclang] Rename CXSkippedRanges to CXSourceRangeList to make it more future-proof.
Suggested by Alp Toker.

llvm-svn: 196591
2013-12-06 18:55:45 +00:00
Argyrios Kyrtzidis 9ef5775a94 [libclang] Record ranges skipped by the preprocessor and expose them with libclang.
Patch by Erik Verbruggen!

llvm-svn: 196487
2013-12-05 08:19:32 +00:00
Sylvestre Ledru d29d97c775 Fixes a typo and changes references to the function clang_displayDiagnostic (which was removed in r96823) to clang_formatDiagnostics.
Patch by David Wiberg

llvm-svn: 194956
2013-11-17 09:46:45 +00:00
Benjamin Kramer 2501f14197 Miscellaneous speling fixes.
llvm-svn: 193046
2013-10-20 11:47:15 +00:00
Argyrios Kyrtzidis adff3ae3c8 [libclang] Introduce clang_Type_getCXXRefQualifier whichexposes ref-qualifier information of function type.
Patch by Che-Liang Chiou!

llvm-svn: 192493
2013-10-11 19:58:38 +00:00
Argyrios Kyrtzidis 7a4253b685 [libclang] Introduce clang_Type_getClassType which returns the class type of a member pointer type.
Patch by Che-Liang Chiou!

llvm-svn: 191906
2013-10-03 16:19:23 +00:00
Argyrios Kyrtzidis 16834f1cf9 [libclang] Provide location for attributes and expose 'packed' attribute.
Patch by Loïc Jaquemet!

llvm-svn: 191345
2013-09-25 00:14:38 +00:00
Charles Davis b5a214e4f3 Add ms_abi and sysv_abi attribute handling.
Based on a patch by Benno Rice!

llvm-svn: 189644
2013-08-30 04:39:01 +00:00
Dmitri Gribenko 96933de7f5 libclang: cleanup unused includes in public header
llvm-svn: 188625
2013-08-18 07:57:43 +00:00
Stefanus Du Toit db51c630ad Add clang_Location_isFromMainFile() to libclang.
Also bump the minor version number and update libclang.exports.

Reviewed by: Dmitri Gribenko, Doug Gregor

llvm-svn: 187994
2013-08-08 17:48:14 +00:00
Argyrios Kyrtzidis 0661a71698 [libclang] Expose the rest of the array types.
Patch by Che-Liang Chiou!

llvm-svn: 186967
2013-07-23 17:36:21 +00:00
Alexey Bataev 5ec3eb11fc OpenMP: basic support for #pragma omp parallel
llvm-svn: 186647
2013-07-19 03:13:43 +00:00
Argyrios Kyrtzidis 7b50fc520f [libclang] Introduce clang_Cursor_isObjCOptional, which returns whether the declaration was affected by "@optional"
rdar://14348525.

llvm-svn: 185722
2013-07-05 20:44:37 +00:00
Dmitri Gribenko 62770bea4b libclang: add a function to check whether a member function is pure virtual
Patch by Seth Fowler.

llvm-svn: 182139
2013-05-17 18:38:35 +00:00
Argyrios Kyrtzidis 12fdb9e34b [libclang] Introduce clang_Module_getASTFile function that returns the module file where a module object came from.
rdar://13743084

llvm-svn: 180643
2013-04-26 22:47:49 +00:00
Ted Kremenek c0b98663e9 Revert "Remove CXCursorSet and related APIs. There are no known clients."
Apparently there are...

llvm-svn: 180176
2013-04-24 07:17:12 +00:00
Ted Kremenek 616986f859 Remove CXCursorSet and related APIs. There are no known clients.
llvm-svn: 180174
2013-04-24 06:52:14 +00:00
Argyrios Kyrtzidis c2233beba4 [libclang] Introduce a CXCursor_ObjCSelfExpr cursor, which is the equivalent of CXCursor_CXXThisExpr for C++ code.
rdar://13717006

llvm-svn: 180127
2013-04-23 17:57:17 +00:00
Argyrios Kyrtzidis 982934e7d4 [libclang] Fix copy-paste error in comment.
llvm-svn: 179823
2013-04-19 00:51:52 +00:00
Argyrios Kyrtzidis 23814e4f49 [libclang] Introduce clang_Cursor_isVariadic, which returns non-zero if the given cursor is a variadic function or method.
rdar://13667150

llvm-svn: 179819
2013-04-18 23:53:05 +00:00
Argyrios Kyrtzidis 9d9bc01e42 [libclang] Introduce clang_Cursor_getObjCDeclQualifiers, to query for 'ObjC Qualifiers' written next to the return and
parameter types in an ObjC method declarations.

rdar://13676977

llvm-svn: 179816
2013-04-18 23:29:12 +00:00
Argyrios Kyrtzidis 9adfd8aabb [libclang] Introduce clang_Cursor_getObjCPropertyAttributes to query the written attributes in a property declaration.
rdar://13684512

llvm-svn: 179803
2013-04-18 22:15:49 +00:00
Argyrios Kyrtzidis 25f7af1aeb [libclang] Introduce clang_Location_isInSystemHeader to check if a location resides in a system header.
This is a modified patch provided from Mikołaj Siedlarek!

llvm-svn: 179384
2013-04-12 17:06:51 +00:00
Argyrios Kyrtzidis f646408ed5 [libclang] Improve a doxygen comment, as suggested by Jordan.
llvm-svn: 179300
2013-04-11 17:31:13 +00:00
Argyrios Kyrtzidis 1ab09cc883 [libclang] Have clang_getCXXAccessSpecifier() also return the access control of a C++ declaration within its parent scope.
Suggested by Stefan Seefeld.

llvm-svn: 179297
2013-04-11 17:02:10 +00:00
Argyrios Kyrtzidis e822f58db4 [libclang] Expose record layout info via new libclang functions:
clang_Type_getAlignOf
clang_Type_getSizeOf
clang_Type_getOffsetOf
clang_Cursor_isBitField

Patch by Loïc Jaquemet!

llvm-svn: 179251
2013-04-11 01:20:11 +00:00
Argyrios Kyrtzidis b2792972a2 [libclang] Make clang_Cursor_getArgument work with call-exprs.
Patch by Matthias Kleine!

llvm-svn: 178475
2013-04-01 17:38:59 +00:00
Argyrios Kyrtzidis 3c5305c15e [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.

llvm-svn: 176975
2013-03-13 21:13:43 +00:00
Argyrios Kyrtzidis 51c3318b01 [libclang] Change clang_findReferencesInFile and clang_findIncludesInFile to return an enum,
as suggested by Jordan.

llvm-svn: 176732
2013-03-08 22:47:41 +00:00
Argyrios Kyrtzidis 951f61fae2 [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.

llvm-svn: 176716
2013-03-08 20:42:33 +00:00
Argyrios Kyrtzidis 503c83ad81 [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.

llvm-svn: 176682
2013-03-08 02:32:34 +00:00
Peter Collingbourne 47f9f2d1e6 Revert r175912, "Add support for coldcc to clang" at John's request.
llvm-svn: 175936
2013-02-23 00:06:18 +00:00
Peter Collingbourne f32b3f2c55 Add support for coldcc to clang
llvm-svn: 175912
2013-02-22 19:24:35 +00:00
Dmitri Gribenko 0035372bb7 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.

llvm-svn: 175299
2013-02-15 21:15:49 +00:00
Argyrios Kyrtzidis ac08b26611 [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

llvm-svn: 173559
2013-01-26 04:52:52 +00:00
Argyrios Kyrtzidis 49d9d02947 [libclang] Add some constness in CXSourceLocation and CXSourceRange.
llvm-svn: 172261
2013-01-11 22:29:47 +00:00
Dmitri Gribenko ba2f746fea libclang: change CXCursor to store 'const void *' pointers for
const-correctness, and update all users

llvm-svn: 172252
2013-01-11 21:01:49 +00:00
NAKAMURA Takumi eacd667238 clang-c/Index.h: Clarify empty argument with (void) for C89.
llvm-svn: 172037
2013-01-10 02:12:38 +00:00
Argyrios Kyrtzidis 56be71610f [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.

llvm-svn: 171486
2013-01-04 18:30:13 +00:00
Guy Benyei f0a014bbb7 Add intel_ocl_bicc calling convention as a function attribute to clang. The calling convention is already implemented in LLVM.
llvm-svn: 171056
2012-12-25 08:53:55 +00:00
Bill Wendling 4442605f18 Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here.
llvm-svn: 170721
2012-12-20 19:22:21 +00:00
Bill Wendling 7967fc14b9 Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
llvm-svn: 170500
2012-12-19 07:18:12 +00:00
Argyrios Kyrtzidis 8b71bc7d6b [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.

llvm-svn: 169539
2012-12-06 19:41:16 +00:00
Dmitri Gribenko b506ba1d79 libclang: Add a function to libclang for retrieving the bit width value
Patch by Jyun-Yan You.

llvm-svn: 169276
2012-12-04 15:13:46 +00:00
Argyrios Kyrtzidis 251ad5e06b Introduce CompilationDatabase::getAllCompileCommands() that returns all
compile commands of the database and expose it via the libclang API.

llvm-svn: 169226
2012-12-04 07:26:44 +00:00
Argyrios Kyrtzidis 1c4db8d18c [libclang] Add some comments about the version constants for the libclang API.
llvm-svn: 167489
2012-11-06 21:21:49 +00:00
Argyrios Kyrtzidis b26a24cca2 [libclang] Introduce clang_Cursor_getReceiverType which returns the CXType for
the receiver of an ObjC message expression.

rdar://12578643

llvm-svn: 167201
2012-11-01 02:01:34 +00:00
Argyrios Kyrtzidis f7cc29519a [libclang] Bump the version number of the libclang API.
llvm-svn: 166984
2012-10-29 23:53:52 +00:00
Argyrios Kyrtzidis 5b216ed713 [libclang] Introduce a version constant for the libclang API.
rdar://12587974

llvm-svn: 166980
2012-10-29 23:24:44 +00:00
Argyrios Kyrtzidis 5e2ec486bb [libclang] Invoke a ppIncludedFile callback when indexing implicit module imports.
llvm-svn: 166161
2012-10-18 00:17:05 +00:00
Derek Schuff a202096dc0 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.

llvm-svn: 166065
2012-10-16 22:30:41 +00:00
Argyrios Kyrtzidis 0db720f0dc [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.

llvm-svn: 165717
2012-10-11 16:05:00 +00:00
Argyrios Kyrtzidis ba30d92504 [libclang] Fix the comments, as suggested by Dmitri.
llvm-svn: 165353
2012-10-06 01:18:38 +00:00
Argyrios Kyrtzidis dc78f3e7a9 [libclang] Now that we have a CXModule object, pass it to the
importedASTFile indexing callback.

llvm-svn: 165281
2012-10-05 00:22:40 +00:00
Argyrios Kyrtzidis 2b9b5bb697 [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

llvm-svn: 165280
2012-10-05 00:22:37 +00:00
Argyrios Kyrtzidis 50e5b1dab3 [libclang] Introduce CXCursor_ModuleImportDecl cursor kind, used for a module
import declaration.

llvm-svn: 165277
2012-10-05 00:22:24 +00:00
Argyrios Kyrtzidis 184b14428e [libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

llvm-svn: 165160
2012-10-03 21:05:44 +00:00
Argyrios Kyrtzidis 472eda06b0 [libclang] Implement the importedASTFile indexing callback to provide
info about imported modules.

llvm-svn: 165020
2012-10-02 16:10:38 +00:00
Argyrios Kyrtzidis 9ae3956f22 [libclang] Remove the ParentKind cursor kind from code-completion results.
This is to reduce dependency to cursors for the code-completion results.

llvm-svn: 164705
2012-09-26 16:39:56 +00:00
Argyrios Kyrtzidis 5eae073cb1 [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

llvm-svn: 164547
2012-09-24 19:27:20 +00:00
Dmitri Gribenko 8994e0c03d Fix Doxygen misuse: refer to parameter names in paragraphs correctly (\arg is
not what most people want -- it starts a new paragraph).

llvm-svn: 163793
2012-09-13 13:11:20 +00:00
Dmitri Gribenko 7acbf00f96 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.

llvm-svn: 163540
2012-09-10 20:32:42 +00:00
Joao Matos f8c8bfc1fc Revert r163099 per chandlerc's request.
llvm-svn: 163147
2012-09-04 17:33:09 +00:00
Joao Matos 102f85655f Added a new cursor for SEHLeaveStmt to libclang.
llvm-svn: 163099
2012-09-03 00:23:40 +00:00
Joao Matos e9a3ed4d71 Normalize line endings of r163013 (part 2).
llvm-svn: 163032
2012-08-31 22:18:20 +00:00
Joao Matos dc86f94f62 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.
llvm-svn: 163013
2012-08-31 18:45:21 +00:00
Chad Rosier de70e0ef45 [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.
No functional change intended.

llvm-svn: 162632
2012-08-25 00:11:56 +00:00
Dmitri Gribenko adba9be7c5 Fix a bunch of -Wdocumentation warnings.
llvm-svn: 162452
2012-08-23 17:58:28 +00:00
Dmitri Gribenko 740c0fbe0e 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!

llvm-svn: 161431
2012-08-07 17:54:38 +00:00
Dmitri Gribenko 58e4131995 Comment to HTML conversion: correct typo in CSS class name: taram -> tparam
llvm-svn: 161145
2012-08-01 23:47:30 +00:00
Dmitri Gribenko 34df220410 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.

llvm-svn: 161087
2012-07-31 22:37:06 +00:00
Dmitri Gribenko d73e4ce992 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.

llvm-svn: 160633
2012-07-23 16:43:01 +00:00
Sylvestre Ledru 830885ca64 Fix a typo (the the => the)
llvm-svn: 160622
2012-07-23 08:59:39 +00:00
Dmitri Gribenko 4c6d7a2ed2 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.

llvm-svn: 160595
2012-07-21 01:47:43 +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
Argyrios Kyrtzidis b6df682194 [libclang] Introduce clang_Cursor_isDynamicCall which,
given a cursor pointing to a C++ method call or an ObjC message,
returns non-zero if the method/message is "dynamic", meaning:

  For a C++ method: the call is virtual.
  For an ObjC message: the receiver is an object instance, not 'super' or a
  specific class.

rdar://11779185

llvm-svn: 159627
2012-07-02 23:54:36 +00:00
Dmitri Gribenko 3292d06a1b Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string.

Since extracting comments isn't free, a new code completion option is
introduced.

A new code completion option that enables including brief comments
into CodeCompletionString should be a, err, code completion option.
But because ASTUnit caches global declarations during parsing before
even completion consumer is created, the option is duplicated as a
translation unit option (in both libclang and ASTUnit, like the option
to cache code completion results).

llvm-svn: 159539
2012-07-02 17:35:10 +00:00
Arnaud A. de Grandmaison 0271b32f00 Factor CXString out of Index.h
No functionnal or interface change. This is done to prepare the landing of
CompilationDatabase in libclang.

llvm-svn: 159382
2012-06-28 22:01:06 +00:00
Dmitri Gribenko 5188c4b9cc Implement a lexer for structured comments.
llvm-svn: 159223
2012-06-26 20:39:18 +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
James Dennett 574cb4c2af Documentation cleanup for clang-c:
* Add parameter names to various \param commands;
* Ensure that \brief summaries are followed by blank lines where needed to
  prevent subsequent text being merged into the summary;
* Mark code examples with \code...\endcode so that they're appropriately
  formatted by Doxygen.
* Add qualification for links to field of structs (specifically callbacks);
* Escape #, @ and < as needed to avoid them being interpreted by Doxygen;
* Remove incorrect uses of "\see name", preferring #name;
* Fix a glitchy "\param Returns..." to be "\returns";
* Fix parameter names given to \param, typos and otherwise.

llvm-svn: 158489
2012-06-15 05:41:51 +00:00
Chad Rosier 32503020a4 Etch out the code path for MS-style inline assembly.
llvm-svn: 158325
2012-06-11 20:47:18 +00:00
James Dennett 1355bd17c6 Documentation cleanup, fixing Doxygen markup. Mostly this avoids common terms
such as "protocol" and "expression" being implicitly turned into links to
mistakenly-generated Doxygen pages:
- Escaping @ symbols when Doxygen would otherwise incorrectly interpret them;
- Escaping # symbols when they're not intended as explicit Doxygen link 
  requests, such as when discussing preprocessor directives;
- In one odd case, unescaping @ in @__experimental_modules_import, because
  Doxygen wrote '\@' to the output in that case, causing the example in the
  description of ImportDecl to be wrong; and
- Fixing a typo: @breif -> @brief.

llvm-svn: 158299
2012-06-11 06:19:40 +00:00
Benjamin Kramer 474261af7b Fix typos found by http://github.com/lyda/misspell-check
llvm-svn: 157886
2012-06-02 10:20:41 +00:00
Douglas Gregor d6225d304e Introduce a new libclang API to determine the platform availability of
a given entity, so that we can tell when the entity was
introduced/deprecated/obsoleted on each platform for which we have an
annotation. Addresses <rdar://problem/11365715>.

llvm-svn: 156347
2012-05-08 00:14:45 +00:00
Aaron Ballman 8111f16829 Simple typo fix (syntex to syntax). Fixes PR12735
llvm-svn: 156259
2012-05-06 16:07:45 +00:00
Erik Verbruggen 6e92251f9b Added a flag to the parser to skip method bodies.
llvm-svn: 154584
2012-04-12 10:11:59 +00:00
Ted Kremenek 26a6d498ee Implement clang_getDiagnosticCategoryText() to provide a way for a client of libclang to accurately
get the diagnostic category name from a serialized diagnostic when the version of libclang used
to read the diagnostic file is newer than the clang that emitted the diagnostic file.

llvm-svn: 154567
2012-04-12 00:03:31 +00:00
Argyrios Kyrtzidis 0c27e4b36b [libclang] Introduce a couple of functions to make it convenient
to get at the parameters (and their types) of a function or objc method cursor.

int clang_Cursor_getNumArguments(CXCursor C);
CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i);

rdar://11201527

llvm-svn: 154523
2012-04-11 19:32:19 +00:00
Argyrios Kyrtzidis 210f29f44b [libclang] Introduce clang_Cursor_getObjCSelectorIndex() function.
After getting a cursor with clang_getCursor for a particular source location,
allows querying the cursor in order to find out if the location points to a
selector identifier in an objc method or message expression, and which selector index it is.

rdar://11158946

llvm-svn: 153781
2012-03-30 22:15:48 +00:00
Argyrios Kyrtzidis 191a6a86ad [libclang] Introduce clang_Cursor_getSpellingNameRange().
It retrieves a source range for a piece that forms the cursors spelling name.
Most of the times there is only one range for the complete spelling but for
objc methods and objc message expressions, there are multiple pieces for each
selector identifier.

Part of rdar://11113120

llvm-svn: 153775
2012-03-30 20:58:35 +00:00
Argyrios Kyrtzidis 7317a5cbfc [libclang] Introduce options to control the priority for the threads
that libclang creates.

-Introduce CXGlobalOptFlags enum for the new options that can be
 set on the CXIndex object.

-CXGlobalOpt_ThreadBackgroundPriorityForIndexing affects:
  clang_indexSourceFile
  clang_indexTranslationUnit
  clang_parseTranslationUnit
  clang_saveTranslationUnit

-CXGlobalOpt_ThreadBackgroundPriorityForEditing affects:
  clang_reparseTranslationUnit
  clang_codeCompleteAt
  clang_annotateTokens

rdar://9075282

llvm-svn: 153562
2012-03-28 02:18:05 +00:00
Douglas Gregor 78254c8880 Introduce a new libclang API to determine the parent context of a code
completion item. For example, if the code completion itself represents
a declaration in a namespace (say, std::vector), then this API
retrieves the cursor kind and name of the namespace (std). Implements
<rdar://problem/11121951>.

llvm-svn: 153545
2012-03-27 23:34:16 +00:00
Argyrios Kyrtzidis 6c9ed7d804 [libclang] Introduce indexing option CXIndexOpt_SuppressWarnings, which
disables all compiler warnings.

rdar://11059556

llvm-svn: 153539
2012-03-27 21:38:03 +00:00