Commit Graph

1045 Commits

Author SHA1 Message Date
Dmitri Gribenko 237769ede5 libclang/libIndex: USR generation: mangle source location into USRs for macros,
unless the macro comes from a system header

llvm-svn: 205064
2014-03-28 22:21:26 +00:00
Dmitri Gribenko 7233cc5f9b Comment parsing: use different comment styles in different test cases
llvm-svn: 204944
2014-03-27 16:42:56 +00:00
Dmitri Gribenko ef099dc670 Comment parsing: attach comments to enums declared using the NS_ENUM macro
Previously we would only attach comments to the typedef.

llvm-svn: 204942
2014-03-27 16:40:51 +00:00
Dmitri Gribenko abfa261a63 Add a module cache path to the test that uses -fmodules
llvm-svn: 204938
2014-03-27 16:15:30 +00:00
Dmitri Gribenko 9ee0e303d6 Comment parsing: when comment ranges are deserialized from multiple modules,
correctly order comments in SourceManager::isBeforeInTranslationUnit() order

Unfortunately, this is not as simple as it was implemented previously, and
actually requires doing a merge sort.

llvm-svn: 204936
2014-03-27 15:40:39 +00:00
NAKAMURA Takumi 2b85e546f2 clang/test/Index/preamble-reparse-warn-*.c: Stabilize on win32.
llvm-svn: 203446
2014-03-10 06:02:13 +00:00
NAKAMURA Takumi 5e9c821420 clang/test/Index/preamble-reparse-warn-*.c: Use @LINE in FileCheck.
llvm-svn: 203445
2014-03-10 06:02:03 +00:00
Argyrios Kyrtzidis b255ee91a7 [libclang] Don't pad the main buffer for the preamble.
Padding does not seem to be useful currently, and it leads to bogus location if an error
points to the end of the file.

rdar://15836513

llvm-svn: 203370
2014-03-09 04:24:57 +00:00
NAKAMURA Takumi 9cd3ce20cc retain-comments-from-system-headers.c: Flush module cache, or incremental test would fail since r203317.
llvm-svn: 203367
2014-03-09 03:56:18 +00:00
Argyrios Kyrtzidis e1974dcd92 [Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is TU_Prefix
avoid warning for unused macros.

rdar://15034698

llvm-svn: 203213
2014-03-07 07:47:58 +00:00
Argyrios Kyrtzidis f8d46fb6eb [code-completion] Add a couple of test cases suggested by Jordan, and a FIXME.
llvm-svn: 202995
2014-03-05 19:10:31 +00:00
Argyrios Kyrtzidis 0692508670 [AST] A "Class<P>" type should not have '*' when printed out.
rdar://14309030

llvm-svn: 202941
2014-03-05 06:47:57 +00:00
Argyrios Kyrtzidis 3227d86f1b [libclang] Have clang_getCursorSpelling() return the string for a CXCursor_ObjCStringLiteral or CXCursor_StringLiteral cursor.
rdar://16206459

llvm-svn: 202745
2014-03-03 19:40:52 +00:00
Dmitri Gribenko 6ede6aba28 libclang: New functions clang_Type_getNumTemplateArguments,
clang_Type_getTemplateArgument

Note that these functions don't handle variadic templates -- see tests.

Patch by Matthieu Nottale and Philippe Daouadi.

llvm-svn: 202406
2014-02-27 16:05:05 +00:00
Benjamin Kramer 2907b08219 Pretty Printer: Print constexpr and ref qualifiers. Don't print return types on destructors.
llvm-svn: 202181
2014-02-25 18:49:49 +00:00
Benjamin Kramer 00e8a1915a Reapply "Pretty Printer: Fix printing of conversion operator decls and calls."
There were many additional tests that had the bad behavior baked in.

llvm-svn: 202174
2014-02-25 18:03:55 +00:00
Argyrios Kyrtzidis d3ba410356 [Index] Make the USRs more stable.
- Only include offsets with local (in function scope) symbols, where we don't encode scoping
- Only include the filename with non-system symbols. Presumably the system headers will not provide conflicting definitions.

rdar://15976823

llvm-svn: 201990
2014-02-23 18:23:29 +00:00
Argyrios Kyrtzidis 7bbb881ad4 [code-completion] Style guideline for Cocoa has custom accessor in property declarations without spaces around '='.
rdar://16059171

llvm-svn: 201765
2014-02-20 07:55:15 +00:00
NAKAMURA Takumi 23c767102a Introduce the feature "can-remove-opened-file" to suppress tests. [PR18856]
llvm-svn: 201482
2014-02-16 10:15:34 +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
Argyrios Kyrtzidis 4a4d2b4175 [libclang] While visiting a C++ destructor decl, keep the type identifier associated with the decl,
don't turn it into a type ref.

rdar://15907618

llvm-svn: 201042
2014-02-09 08:13:47 +00:00
Benjamin Kramer 3a7cc81d52 Report a correct end location for nameless parameters.
Ranges before:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~~ ~~~~~~

Ranges after:
void test(void (*)(int), int, float);
          ~~~~~~~~~~~~~  ~~~  ~~~~~

This does not change the actual location of the ParmVarDecl, it still
points to the location where the name would be. PR17970.

llvm-svn: 200640
2014-02-02 15:28:46 +00:00
Alexey Samsonov b80effdfe1 Fix this test and don't run it in ASan bootstrap
llvm-svn: 200291
2014-01-28 06:59:32 +00:00
Richard Smith e81daee21b When formatting a C++-only declaration name, enable C++ mode in the formatter's
language options. This is not really ideal -- we should require the right
language options to be passed in, or not require language options to format a
name -- but it fixes a number of *obviously* wrong formattings. Patch by
Olivier Goffart!

llvm-svn: 199778
2014-01-22 00:27:42 +00:00
NAKAMURA Takumi ba6ea6024c clang/test/Index/recursive-cxx-member-calls.cpp: Add "-target" rather than XFAILing.
llvm-svn: 199201
2014-01-14 11:07:55 +00:00
David Majnemer a5b0999e4d Disable this test for windows builders
This test provides definitions of size_t which are at odds with
-fms-compatibility.  Disable this test on those builders (for now).

llvm-svn: 199196
2014-01-14 08:19:51 +00:00
Ben Langmuir de04923344 Preserve -fretain-comments-from-system-headers in modules
Preserves the setting of -fretain-comments-from-system-headers when
building/saving/loading module files. This allows code completion to pick up
documentation comments from system modules.

llvm-svn: 198890
2014-01-09 20:53:49 +00:00
Dmitri Gribenko 514102d24f Add a test I forgot to svn add in r197755
llvm-svn: 197756
2013-12-20 00:21:47 +00:00
Fariborz Jahanian 283bf89506 Objective-C. After providing a fix-it for a
cstring, converted to NSString, produce the
matching AST for it. This also required some
refactoring of the previous code. // rdar://14106083

llvm-svn: 197605
2013-12-18 21:04:43 +00:00
Rafael Espindola 3497069784 Switch to the new MingW ABI.
GCC 4.7 changed the MingW ABI. On the clang side this means that methods now
have the thiscall calling convention by default.

llvm-svn: 197164
2013-12-12 16:07:11 +00:00
Argyrios Kyrtzidis 5899e8916b [c-index-test] For the '-remap-file' option use a comma for separator which is more
Windows friendly than the colon.

llvm-svn: 196529
2013-12-05 20:13:27 +00:00
Alp Toker f6a24ce40f Fix a tranche of comment, test and doc typos
llvm-svn: 196510
2013-12-05 16:25:25 +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
Argyrios Kyrtzidis a60d8ae09d [c-index-test] For the '-remap-file=' option use ':' instead of ';' for separator.
lldb does not like semicolon as part of an option.

llvm-svn: 196485
2013-12-05 08:19:18 +00:00
Alp Toker d473363876 Correct hyphenations in comments and assert messages
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities in nearby lines.

llvm-svn: 196466
2013-12-05 04:47:09 +00:00
Argyrios Kyrtzidis 50126f1259 [libclang] Make sure we don't access past the tokens buffer while token annotation.
Also disable crash recovery using 'LIBCLANG_DISABLE_CRASH_RECOVERY' environment variable.

llvm-svn: 195819
2013-11-27 05:50:55 +00:00
Dmitri Gribenko ae215951a9 Comment parsing tests: XML schema: actually run the valid-function-10.xml test
It was there all the time, but I missed adding a RUN line for it.

llvm-svn: 195405
2013-11-22 01:47:15 +00:00
Dmitri Gribenko 1a1d30d43b Comment parsing tests: introduce a little more structure in testcase
llvm-svn: 195187
2013-11-20 01:23:26 +00:00
Dmitri Gribenko 8af68f9bdf Revert r195176, it is breaking buildbots for unclear reason
llvm-svn: 195184
2013-11-20 00:59:02 +00:00
Dmitri Gribenko 0ae51cb4ff Comment parsing tests: introduce a little more structure in testcase
llvm-svn: 195176
2013-11-20 00:15:58 +00:00
Dmitri Gribenko b79d4f82e8 Remove full path from CHECK line
llvm-svn: 195147
2013-11-19 19:29:32 +00:00
Dmitri Gribenko 90946ca5b5 Documentation parsing: in HeaderDoc, \abstract is equivalent to \brief
llvm-svn: 195145
2013-11-19 19:18:54 +00:00
Alp Toker 9c5ae47c94 Ignore test Inputs globally and remove redundant lit.local.cfg files
By adding a default config.excludes pattern we can avoid individual
suppressions in subdirectories.

This matches LLVM's lit.cfg which also excludes a few other common non-test
filenames for consistency.

llvm-svn: 194814
2013-11-15 13:37:49 +00:00
Dmitri Gribenko d9febeb884 Documentation parsing: add support for \throws \throw \exception commands
llvm-svn: 194521
2013-11-12 22:16:08 +00:00
Dmitri Gribenko 322654d0a7 Comment parsing: recognize \def (but processing is a no-op, like the rest of
similar commands that duplicate the declaration name)

llvm-svn: 194312
2013-11-09 03:50:37 +00:00
Alp Toker e994ebda14 Improve the missing ASM parser test for MS-style assembly
It's better to test clang-check rather than the internal c-index-test utility.

Also adds a target so we can remove the XFAILs.

Thanks to Richard Barton for spotting the test failure on ARM.

Test originally from r193685.

llvm-svn: 194249
2013-11-08 06:50:48 +00:00
Richard Barton 72c5d91171 XFAIL the test for non-x86 targets for which this message cannot be generated.
llvm-svn: 194211
2013-11-07 18:05:57 +00:00
Alp Toker 56cf2cb55a Fix triple / REQUIRES in test from r193685
llvm-svn: 193686
2013-10-30 14:38:32 +00:00
Alp Toker 45cf31f7d3 Recover instead of crashing on MS assembly when no target is loaded
It's possible to embed the frontend in applications that haven't initialized
backend targets so we need to handle this condition gracefully.

llvm-svn: 193685
2013-10-30 14:29:28 +00:00
Richard Smith a3feee2ad6 Allow a new syntax in a module requires-declaration:
requires ! feature

The purpose of this is to allow (for instance) the module map for /usr/include
to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are
instead provided by the C++ standard library in this case, and the glibc C
<tgmath.h> header would otherwise try to include <complex.h>, resulting in a
module cycle).

llvm-svn: 193549
2013-10-28 22:18:19 +00:00