Commit Graph

2985 Commits

Author SHA1 Message Date
Alexander Musman f0d76e7dc3 Parsing/Sema for OMPAlignedClause.
llvm-svn: 209816
2014-05-29 14:36:25 +00:00
Eli Bendersky 2581e66e7a Expose CUDA function attributes to the C interface.
Until now all CUDA-specific attributes were represented with
CXCursor_UnexposedAttr; now they are actually implemented, including the Python
bindings.

llvm-svn: 209767
2014-05-28 19:29:58 +00:00
Alexander Musman 8bd31e69a4 Parsing/Sema for OMPCollapseClause.
Actual usage in Sema for collapsing loops will in some future patch.

llvm-svn: 209660
2014-05-27 15:12:19 +00:00
Sylvestre Ledru e8103abdbc revert "r209526 List the function/method name in the index page of scan-build "
Depends on http://reviews.llvm.org/D3762

llvm-svn: 209527
2014-05-23 16:47:42 +00:00
Sylvestre Ledru 970d3189e6 List the function/method name in the index page of scan-build
llvm-svn: 209526
2014-05-23 16:40:46 +00:00
Sylvestre Ledru df70a7ba99 Replace system() by native perl calls
llvm-svn: 209524
2014-05-23 16:10:00 +00:00
Daniel Jasper c64b09acc3 clang-format: Introduce DisableFormat that prevents formatting.
And "none" pseudo-style indicating that formatting should be not
applied.

(1) Using .clang-format with "DisableFormat: true" effectively prevents
formatting for all files within the folder containing such .clang-format
file.

(2) Using -fallback-style=none together with -style=file prevents
formatting when .clang-format is not found, which can be used in on-save
callback.

Patch by Adam Strzelecki. Thank you!

llvm-svn: 209446
2014-05-22 15:12:22 +00:00
Daniel Jasper 62f73ec1ef clang-format: Fix vim-integration for empty files.
Discovered by Ahmed Charles in http://reviews.llvm.org/D3018.

llvm-svn: 209417
2014-05-22 11:37:05 +00:00
Alp Toker fdafb94f01 RAV reunification: merge Lambda body visitation to DRAV
llvm-svn: 209246
2014-05-20 22:03:39 +00:00
Justin Bogner 9c785294fb VirtualFileSystem: Add YAMLVFSWriter to generate VFS mapping files
This moves the logic to write a JSON VFS mapping from the C api into
VirtualFileSystem, so that we can use it internally.

No functional change.

llvm-svn: 209241
2014-05-20 21:43:27 +00:00
Oliver Stannard 9b2a7d4f2d Pass -gdwarf-N options to integrated assembler
llvm-svn: 209124
2014-05-19 13:39:13 +00:00
Alp Toker 2d57cea256 Provide and use a safe Token::getRawIdentifier() accessor
llvm-svn: 209061
2014-05-17 04:53:25 +00:00
Sylvestre Ledru 3cbaa468c2 Improve a scan-build message
llvm-svn: 208951
2014-05-16 07:03:15 +00:00
Ben Langmuir 5bf828dd34 Switch another write_escaped to yaml::escape
I missed one in r206443.

llvm-svn: 208941
2014-05-16 01:38:59 +00:00
Alp Toker 1761f11801 Eliminate DefaultImageName from the Driver constructor
All callers were passing in "a.out" or garbage so a sensible default works fine
here as a cleanup.

This also brings about the possibility of adapting the value based on the
driver's compatibility mode in future.

The setting can still be changed via Driver::DefaultImageName as needed.

llvm-svn: 208926
2014-05-15 22:26:36 +00:00
Argyrios Kyrtzidis 884337f427 [libclang] Introduce clang_Module_isSystem(), which returns non-zero if the given CXModule is a system one.
llvm-svn: 208846
2014-05-15 04:44:25 +00:00
Argyrios Kyrtzidis f6d49c36b2 [liblang] Introduce clang_getModuleForFile, which given a CXFile header file, returns the module that contains it, if one exists.
llvm-svn: 208822
2014-05-14 23:14:37 +00:00
Daniel Jasper 2e8600c02b clang-format: Add clang-format-diff usage examples for SVN.
llvm-svn: 208766
2014-05-14 09:36:11 +00:00
Jordan Rose 57ee6d2cf7 [scan-build] Pass --sysroot through for both compilation and linking.
PR19704

llvm-svn: 208595
2014-05-12 17:04:44 +00:00
Nico Weber ce5528ac91 c-index-test: Don't leak diagnostic category text.
llvm-svn: 208503
2014-05-11 17:16:59 +00:00
Nico Weber 3fddae75c7 Don't leak CXStrings for replacement fix-its in c-index-test.
The loop body used to contain a switch statement; it looks like r96685 replaced
that with an if/else if/else but accidentally left one of the three break
statements from the switch behind, skipping the clang_disposeString() call
for replacements (and the rest of the loop too, which apparently doesn't make
a differences for the test cases we have).

r96685: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100215/027754.html

This too might possibly the last leak in clang (PR19521).

llvm-svn: 208483
2014-05-10 23:56:43 +00:00
Benjamin Kramer f3ca269839 Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.
Required pulling LambdaExpr::Capture into its own header.
No functionality change.

llvm-svn: 208470
2014-05-10 16:31:55 +00:00
Nico Weber 7dd96c23fd Don't leak the CXStoredDiagnostics returned by clang_codeCompleteGetDiagnostic()
r144269 changed clang_disposeDiagnostic() to be a no-op, but didn't update
code completion diagnostics.  Let CXCodeCompleteResults store all diagnostics
returned by clang_codeCompleteGetDiagnostic() and then free them up in
clang_disposeCodeCompleteResults().

Code completion diagnostics referred to data stored in CXCodeCompleteResults
before already, so it wasn't possible to refer to the results of
clang_codeCompleteGetDiagnostic() after clang_disposeCodeCompleteResults()
before this change already -- hence this should be a safe, backwards-compatible
change.

Leak found by LSan, fixes PR19690.

llvm-svn: 208454
2014-05-09 22:33:11 +00:00
Nikola Smiljanic e08a91ecd2 Enable alternative tokens by default for clang-format.
Patch by Bobby Moretti.

llvm-svn: 208269
2014-05-08 00:05:13 +00:00
Nico Weber df6860279e c-index-test: Don't leak the strings returned by makeClientContainer().
llvm-svn: 208249
2014-05-07 21:09:42 +00:00
Nico Weber 8d19dffbed Make 2 functions static, remove unneeded cast, rewrap. No behavior change.
llvm-svn: 208247
2014-05-07 21:05:22 +00:00
Rafael Espindola 9b74ec415b Update for llvm api change.
llvm-svn: 208206
2014-05-07 13:00:49 +00:00
Alexey Bataev bcbadb65ab [OPENMP] 'proc_bind' clause support - Parsing and sema analysis for OpenMP clause 'proc_bind'
llvm-svn: 208060
2014-05-06 06:04:14 +00:00
Chandler Carruth b2faa59976 [leaks] Parse the schema file every time we try to verify the XML. Yes,
this is wasteful, blah blah, but this is a test utility only. It turns
out that without doing this, libxml2 will always leak a bunch of the XML
data, and that is causing failures with LSan. This is also quite a bit
simpler and I don't think it is slow enough to really be a show stopper.
If someone yells about the runtime of c-index-test, we can do other
things to try to mitigate it, but the current strategy wasn't working
well.

llvm-svn: 207882
2014-05-02 23:30:59 +00:00
Joey Gouly 81228382cf [libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.
This bumps CINDEX_VERSION_MINOR up (to 26).

llvm-svn: 207767
2014-05-01 15:41:58 +00:00
Jordan Rose 90d09146e0 scan-build: Don't use realpath when the user provides an explicit path.
PR19583

llvm-svn: 207484
2014-04-29 01:37:19 +00:00
Nico Weber 10bf95d61b Follow-up to r207071: Let newFrontendActionFactory() return a unique_ptr.
This exposed a leak, fix that.

llvm-svn: 207396
2014-04-28 04:57:14 +00:00
Alp Toker 59c6bc5882 libclang: split out the documentation comment API
It's possible that the "comment AST" may be replaced or split out in the
midterm, any anyway this makes the headers easier to read.

Developers don't currently need to include "clang-c/Documentation.h" explicitly
and there's no macro to test for availability yet.

The raw comment and brief comment accessors have been kept in Index.h though
brief support may also move here as a separate proposal.

This is not a deprecation, just a gentle separation of concerns as we look to
simplify the built-in representation of comment nodes and support external
comment processors.

llvm-svn: 207392
2014-04-28 02:39:27 +00:00
NAKAMURA Takumi 7c301b4b86 c-arcmt-test/Makefile: Update USEDLIBS for -static.
llvm-svn: 207340
2014-04-27 03:40:51 +00:00
Alp Toker 87d3975369 libclang: remove 'CXDiagnostic_Remark'
The change was landed without review or test cases.

It trivially broke almost any stable application checking for Severity >=
CXDiagnostic_Error or indeed any other kind of severity comparison upon
encountering a 'remark'.

Mapped to CXDiagnostic_Warning until a workable solution is proposed to the
list that preserves API stability.

(It's also not clear why the rest of r202475 wasn't simply implemented as a
modifier to the existing 'warning' level.)

llvm-svn: 207319
2014-04-26 14:43:53 +00:00
Argyrios Kyrtzidis edfe07fca0 Simplify leak fix of r207076, by just disposing the previous CXString.
llvm-svn: 207081
2014-04-24 06:05:40 +00:00
Nico Weber aacf0313a5 Fix two leaks found by LSan.
A CursorPlatformAvailability can have several "unavailable" attributes, don't
leak all but the first.  I'm not sure if there can be several "deprecate"ds too,
but add the same logic there to keep the two code paths looking the same.

llvm-svn: 207076
2014-04-24 05:16:45 +00:00
Nico Weber 82098cb6df Fix two leaks in c-index-test found by LSan.
The result of clang_getCursorSpelling() needs to be clang_getCursorSpelling()ed.

llvm-svn: 207073
2014-04-24 04:14:12 +00:00
Evgeniy Stepanov eeb820f572 Update Target::createMCAsmParser calls for the LLVM interface change.
Patch by Yuri Gorshenin.

llvm-svn: 206970
2014-04-23 11:15:49 +00:00
Ben Langmuir 749323fadb Attempt to fix null ASTContext in ASTUnit error path
We don't need the ASTContext for the diagnostics, only the language
options, which we can get from the compiler invocation. It worries me
how many categorically different states the ASTUnit class can be in
depending on how it is being constructed/used.

llvm-svn: 206909
2014-04-22 17:40:12 +00:00
Alexander Musman 8dba66412b [OPENMP] parsing 'linear' clause (for directive 'omp simd')
Differential Revision: http://reviews.llvm.org/D3272

llvm-svn: 206891
2014-04-22 13:09:42 +00:00
Ted Kremenek dd21b89a25 Handle possible trailing '/' in xcode-select output. Patch by Jeff Olson.
llvm-svn: 206752
2014-04-21 14:13:22 +00:00
Justin Bogner 837a6f6f79 CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=
Update clang to use the InstrProfReader from LLVM to read
instrumentation based profile data. This also switches us from the
naive text format to the binary format, since that's what's
implemented in the reader.

llvm-svn: 206658
2014-04-18 21:52:00 +00:00
Nico Weber ffaf29a07b clang-format.py: Don't omit the first two words from error messages.
This reverts r172072.  clang-format used to use DiagnosticEngine to output
errors: http://llvm.org/viewvc/llvm-project?view=revision&revision=172071. Now
it doesn't, so this code is obsolete.

llvm-svn: 206479
2014-04-17 17:51:57 +00:00
Ben Langmuir a56071c5fb When writing YAML in libclang, use yaml::escape instead of write_escaped
The YAMLParser has its own escaped string representation, and does not
handle octal escape sequences. When writing the virtual file system to a
YAML file, use yaml::escape().

llvm-svn: 206443
2014-04-17 03:31:02 +00:00
Ben Langmuir 8832c066a2 Honour -ivfsoverlay in ASTUnit to match clang
This allows code indexing, etc. to use the VFS in the same way as the
compiler.

llvm-svn: 206309
2014-04-15 18:16:25 +00:00
Benjamin Kramer 5c323b833b Replace llvm::array_endof with C++11's std::end.
No functionality change.

llvm-svn: 206111
2014-04-12 15:42:48 +00:00
Anders Waldenborg ddce74f6f8 Make c-index-test -test-print-type include pointeekind for pointer types
The idea is to give visibility to more type kinds, especially for getting
a better grasp of what appears as unexposed type kind with libclang.

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

llvm-svn: 205921
2014-04-09 19:16:08 +00:00
Daniel Jasper dfacecbd31 clang-format: Add proto files and JavaScript to git-clang-format.
llvm-svn: 205842
2014-04-09 09:22:35 +00:00
Dmitri Gribenko e570ede5d1 libclang: add clang_CXXMethod_isConst API that allows to determine if a C++
member function or member function template is declared 'const'

Patch by Kevin Funk with testcase updates by me.

llvm-svn: 205714
2014-04-07 14:59:13 +00:00