Commit Graph

2645 Commits

Author SHA1 Message Date
Chris Lattner 5b25f0b7a9 update header comment.
llvm-svn: 172909
2013-01-19 18:47:35 +00:00
Chris Lattner 779fe3315f these now depend on the bitcode reader too.
llvm-svn: 172906
2013-01-19 18:28:24 +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
Chandler Carruth 4b41745e05 Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncovered a subtle inclusion order dependency as CLog.h didn't
include LLVM.h to pick up using declarations it relied upon.

llvm-svn: 172892
2013-01-19 08:09:44 +00:00
NAKAMURA Takumi 8b517f1076 clang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()
llvm-svn: 172818
2013-01-18 13:46:48 +00:00
Kevin Enderby ae2ec4745f We want the dwarf AT_producer for assembly source files to match clang's
AT_producer.  Which includes clang's version information so we can tell
which version of the compiler was used.

This is second of the two steps to allow us to do this.  The first was a
change to llvm-mc with revision 172630 to provide a method to set the
AT_producer string.  This second step has the clang driver passing the value
of getClangFullVersion() via the new flag -dwarf-debug-producer when invoking
the integrated assembler on assembly source files.  Then using the new
setDwarfDebugProducer() method to set the AT_producer string.

rdar://12888242

llvm-svn: 172758
2013-01-17 21:38:06 +00:00
Argyrios Kyrtzidis da4ba87181 [libclang] In clang_reparseTranslationUnit_Impl, move the check whether TU is
null before using it.

llvm-svn: 172632
2013-01-16 18:13:00 +00:00
Argyrios Kyrtzidis fbd7c2d3b2 [libclang] In clang_getCursorType, don't crash if the translation unit is not
set on the cursor; return a null type in such a case.

llvm-svn: 172625
2013-01-16 17:04:31 +00:00
David Greene e6c9fe035d Fix Casting
Use const_cast<> to avoid a cast-away-const error.

llvm-svn: 172565
2013-01-15 22:09:51 +00:00
David Greene 02b002ac37 Fix Casting
Use const_cast<> to avoid a cast-away-const error.

llvm-svn: 172564
2013-01-15 22:09:49 +00:00
David Greene 4320e5e114 Fix Casting
Use const_cast<> to avoid a cast-away-const error.

llvm-svn: 172563
2013-01-15 22:09:48 +00:00
David Greene 0516ba604b Fix Casting
Use const_cast<> to avoid a cast-away-const error.

llvm-svn: 172562
2013-01-15 22:09:46 +00:00
Chad Rosier 5f15a35114 [driver] Warnings for warning options are handled by the frontend. The driver needs to process the
warning options to setup diagnostic state, but should not be emitting warnings as these would be
rudndant with what the frontend emits.
rdar://13001556

llvm-svn: 172497
2013-01-15 01:21:53 +00:00
Dmitri Gribenko 9c256e379e libclang: remove a few const_casts
llvm-svn: 172373
2013-01-14 00:46:27 +00:00
Dmitri Gribenko 049a4ffcb8 Constify argument of Preprocessor::getMacroInfoHistory and propagate to
callers, removing unneeded const_cast

llvm-svn: 172372
2013-01-14 00:36:42 +00:00
Dmitri Gribenko f857950d39 Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h

llvm-svn: 172323
2013-01-12 19:30:44 +00:00
Dmitri Gribenko 037f9d18ae libclang: use C++ casts in CXString.cpp
llvm-svn: 172272
2013-01-11 23:13:36 +00:00
Dmitri Gribenko ec3a16fc8c libclang: constness for CXString
llvm-svn: 172270
2013-01-11 23:08:18 +00:00
Argyrios Kyrtzidis 49d9d02947 [libclang] Add some constness in CXSourceLocation and CXSourceRange.
llvm-svn: 172261
2013-01-11 22:29:47 +00:00
Ted Kremenek 632af24eb8 Set process return code of 1 in set-xcode-analyzer when Xcode needs to be quit. Fixes <rdar://problem/12983031>.
llvm-svn: 172256
2013-01-11 21:49:36 +00:00
Dmitri Gribenko 7a7284d881 libclang: remove unneeded casts
llvm-svn: 172253
2013-01-11 21:06:06 +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
Dmitri Gribenko 2c173b4806 libclang: use getCursorTU and getCursorASTUnit instead of explicit casts
llvm-svn: 172241
2013-01-11 19:28:44 +00:00
Dmitri Gribenko 5ca49f71fd Replace more usages of __func__ with LLVM_FUNCTION_NAME
llvm-svn: 172161
2013-01-11 02:23:13 +00:00
Dmitri Gribenko 9f08be0272 libclang logging: fixup for MSVC, which does not have __func__
llvm-svn: 172158
2013-01-11 01:15:02 +00:00
Argyrios Kyrtzidis 1489ed2b68 [libclang] Address some coding style issues pointed out by Dmitri.
llvm-svn: 172096
2013-01-10 19:43:44 +00:00
Ted Kremenek 4a800f876a ccc-analyzer: Forward -msse* options to the compiler.
llvm-svn: 172094
2013-01-10 19:29:31 +00:00
Argyrios Kyrtzidis f036f1a630 [libclang] Add missing header file
llvm-svn: 172090
2013-01-10 18:58:44 +00:00
Argyrios Kyrtzidis ea47435861 [libclang] Enhance logging capabilities of libclang.
-provide a "raw_ostream'ish" class to make it convenient to output logging info.
-use macros to automate a bit the logging functionality inside libclang functions
-when logging, print a stack trace if "LIBCLANG_LOGGING=2" environment is set.
-add logging to more functions.

llvm-svn: 172089
2013-01-10 18:54:52 +00:00
Argyrios Kyrtzidis bf1be59dae [libclang] In clang_equalCursors, clear out the "FirstInDeclGroup" part in a declaration cursor
before doing the comparison.

This is because we can't set "FirstInDeclGroup" consistently; for example, when visiting a DeclStmt we will set
it but we don't set it on the result of clang_getCursorDefinition for a reference of the same declaration.

llvm-svn: 171878
2013-01-08 18:23:28 +00:00
Argyrios Kyrtzidis 68d31ce5ff [libclang] When annotating preprocessor tokens, if we are in a macro definition,
check if the token was ever a macro name and annotate it if that's the case.

llvm-svn: 171776
2013-01-07 19:16:32 +00:00
Argyrios Kyrtzidis 2d77aeb946 [libclang] Simplify annotation of preprocessing tokens and remove the AnnotateTokensData
DenseMap and the lookups associated with it.

Instead of lexing for preprocessor tokens, associating the annotation with the location in a map,
and later lookup in the map in order to adjust the cursor annotation, just annotate the cursor
while lexing for preprocessor tokens.

llvm-svn: 171775
2013-01-07 19:16:30 +00:00
Argyrios Kyrtzidis 98a8874a0d [libclang] Make token annotation of type/storage qualifiers accurate.
Previously type/storage qualifiers would not be annotated as the declaration they belonged to.
Just use the resulting source range of getRawCursorExtent() which is more correct
than what AnnotateTokensWorker::Visit() was adjusting it to.

llvm-svn: 171774
2013-01-07 19:16:27 +00:00
Argyrios Kyrtzidis 579825a50a [libclang] When getting the cursor for an identifier inside a macro definition, check if
this was ever a macro name and return a specific CXCursor_MacroExpansion cursor in such a case,
instead of the generic CXCursor_MacroDefinition.

Checking for macro name makes sure the identifier is not part of the identifier list in a
function macro.
While, in general, resolving identifiers in macro definitions to other macros may not be completely accurate,
it greatly improves functionality such as give-me-the-definition-of-this, which was not working at all
inside macro definitions.

llvm-svn: 171773
2013-01-07 19:16:25 +00:00
Dmitri Gribenko a9cc2491dd Comment to XML conversion: no, we don't want to print instantiations for the
<Declaration> tag

llvm-svn: 171763
2013-01-07 18:45:48 +00:00
NAKAMURA Takumi 0c340a96aa libclang/Makefile: Reorder USEDLIBS along driver/clang.
llvm-svn: 171750
2013-01-07 15:45:20 +00:00
Ted Kremenek 6a4c73db23 Fix set-xcode-analyzer to only modify the ExecPath for the analyzer when using --use-xcode-clang.
Turns out that the ExecPath for the ObjC migrator would also get set.

Fixes <rdar://problem/12961769>.

llvm-svn: 171607
2013-01-05 07:31:54 +00:00
Ted Kremenek 8533dd9f58 Require set-xcode-analyzer to run with Python 2.7 or later.
Addresses LLVM PR 11661.

llvm-svn: 171503
2013-01-04 19:04:42 +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
Chandler Carruth ffd5551bc7 Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

llvm-svn: 171369
2013-01-02 11:45:17 +00:00
Chandler Carruth 44eb4f66f4 Re-sort #include lines using the llvm/utils/sort_includes.py script.
Removes a duplicate #include as well as cleaning up some sort order
regressions since I last ran the script over Clang.

llvm-svn: 171364
2013-01-02 10:28:36 +00:00
Richard Smith 940a6d73ce Produce an actual error before attempting to attach notes to it when bailing out
due to FORCE_CLANG_DIAGNOSTICS_CRASH=1. Also add a test for that env var.

llvm-svn: 171074
2012-12-25 21:56:27 +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
Argyrios Kyrtzidis 9999f4f88b [libclang] Check for the 'LIBCLANG_NOTHREADS' environment variable before creating
a separate thread for code-completion.

llvm-svn: 170978
2012-12-22 04:48:07 +00:00
Fariborz Jahanian 68a542aea7 Add objective-C style formatting to clang format and
use it to format xml declaration tags. 
// rdar://12378714

llvm-svn: 170727
2012-12-20 19:54:13 +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
NAKAMURA Takumi f827eb629d c-index-test/Makefile: Add clangFormat to USEDLIBS for libclang-unavailable hosts.
llvm-svn: 170693
2012-12-20 13:30:10 +00:00
NAKAMURA Takumi 393bf4c3c8 c-index-test/Makefile: Reformat.
llvm-svn: 170692
2012-12-20 13:30:05 +00:00
Fariborz Jahanian 0389e528ab Audit DeclPrinter with -ast-dump on Cocoa.h and
fix any bad objectiveC syntax coming out of
DeclPrinter. This is on going. Also, introduce a new
PrintPolicy and use it as needed when declaration tag
is to be produced via DeclPrinter.

llvm-svn: 170606
2012-12-19 23:36:00 +00:00
Dmitri Gribenko 909eebc9ac Add a missing 'else'. Found by grep '} if'
No testcase because this did not affect correctness: a declaration can only be
ClassTemplateDecl or a FunctionTemplateDecl, not both.

llvm-svn: 170565
2012-12-19 17:29:30 +00:00
Fariborz Jahanian ae9d8aeb2b Improve on header comment suggested by James Dennet.
llvm-svn: 170555
2012-12-19 17:03:46 +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
Ted Kremenek 372735f342 Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
llvm-svn: 170487
2012-12-19 01:16:49 +00:00
Fariborz Jahanian 799d96b8b8 fixes a doxygen comment.
llvm-svn: 170485
2012-12-19 01:00:36 +00:00
Fariborz Jahanian bbdb9f2653 Increas number of iterations before a new libclang format object
is created to 1000.

llvm-svn: 170481
2012-12-19 00:35:23 +00:00
Fariborz Jahanian b67908a07b Some code refactoring per Dimitri's comment.
llvm-svn: 170478
2012-12-19 00:01:48 +00:00
Ted Kremenek e3713d3025 Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing through macros.
This fixes a subtle bug reported in <rdar://problem/12584554> where a double-nested
macro could lead to an incorrect fixit location with live issues.

This fix also uncovers a bunch of subtle bugs in our indexer test cases which
are now fixed (mostly around source ranges for attributes).

llvm-svn: 170468
2012-12-18 23:07:30 +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
Guy Benyei d8a08ea98d Re-commit r170428 changes with Linux style file endings.
Add OpenCL images as clang builtin types.

llvm-svn: 170432
2012-12-18 14:38:23 +00:00
Guy Benyei 11169dded0 Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.
llvm-svn: 170431
2012-12-18 14:30:41 +00:00
Guy Benyei b13abb952a Add OpenCL images as clang builtin types.
llvm-svn: 170428
2012-12-18 12:30:03 +00:00
Eric Christopher 45f2e71571 Add support for passing the main file name down to the assembler
for location information.

Part of PR14624

llvm-svn: 170391
2012-12-18 00:31:10 +00:00
Chandler Carruth 4d5e1a9b34 Fix PR14625 by teaching the driver to detect PWD for assembly files.
This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).

The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.

llvm-svn: 170373
2012-12-17 21:40:04 +00:00
Argyrios Kyrtzidis fdea813c4a [c-index-test] Fix warnings about unused results from chdir().
Patch from Edwin Vane!

llvm-svn: 170366
2012-12-17 20:19:56 +00:00
Edwin Vane 524741fbbd Style and Doc fix for CommonOptionsParser
- Renaming GetCompilations() and GetSourcePathList() to follow LLVM
  style.
- Updating docs to reflect name change.
- Also updating help text to not mention clang-check since this class
  can be used by any tool.

Reviewed By: Alexander Kornienko

llvm-svn: 170229
2012-12-14 18:58:25 +00:00
NAKAMURA Takumi 92eb254c3c [CMake] Move libxml2 stuff from clang to llvm/cmake.
llvm-svn: 170225
2012-12-14 18:30:20 +00:00
Roman Divacky d93c8c008e Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user
specifies not to. Dont build ASTMatchers with Rewriter disabled and
StaticAnalyzer when it's disabled.

Without all those three, the clang binary shrinks (x86_64) from ~36MB
to ~32MB (unstripped).

llvm-svn: 170135
2012-12-13 16:09:42 +00:00
Argyrios Kyrtzidis 12023e1ec3 [libclang] Make sure tokens from preprocessor directives are annotated as such,
even if the directive is inside a declaration.

Fixes rdar://11548788 & http://llvm.org/PR12970

llvm-svn: 169949
2012-12-12 01:05:25 +00:00
Argyrios Kyrtzidis 23de34d6d6 [libclang] Declarations inside anonymous namespaces have internal linkage so
their USR should contain a location.

This uniques them from other declarations with the same name but in different translation units.
rdar://10546541

llvm-svn: 169647
2012-12-07 22:41:46 +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
Argyrios Kyrtzidis f75d498a3c [c-index-test] Introduce '-index-compile-db' which accepts a compilation database file
and does an '-index-file' for all compile commands in the database.

llvm-svn: 169430
2012-12-05 21:53:37 +00:00
NAKAMURA Takumi dfaed1bfde c-index-test.c: Make C89-compliant.
llvm-svn: 169277
2012-12-04 15:32:03 +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
Chandler Carruth cc0694c8a4 Sort #include lines for tools/...
Completely automated with sort_includes.py

llvm-svn: 169240
2012-12-04 09:25:21 +00:00
Argyrios Kyrtzidis 6a33de18a3 [libclang] Avoid copying the CompileCommand related strings when wrapping them to a CXString.
llvm-svn: 169227
2012-12-04 07:26:48 +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
Jordan Rose 85ff8f281e [analyzer] scan-build: Don't forget to close our temp file for Clang's output.
Also, minor whitespace/indentation fixes.

Patch by Peeter Joot!

llvm-svn: 168805
2012-11-28 19:12:44 +00:00
Jordan Rose dbbbf55119 [analyzer] scan-build: Treat '.C' files as C++.
Part of PR14443.

llvm-svn: 168804
2012-11-28 19:12:29 +00:00
Argyrios Kyrtzidis 9923d686d0 [libclang] Remove WorkingDir field from CIndexer, it has been rendered useless.
No functionality change.

llvm-svn: 168738
2012-11-27 22:49:42 +00:00
Rafael Espindola b0448cd52a Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag and
is not used in any #ifdef.

llvm-svn: 168703
2012-11-27 16:10:37 +00:00
Jordan Rose a333f3fba1 scan-build: Respect TMPDIR on all platforms, not just Darwin (PR14438).
llvm-svn: 168672
2012-11-27 02:37:59 +00:00
Benjamin Kramer ba4c85e51d Make helpers static/anonymous.
llvm-svn: 168500
2012-11-22 15:02:44 +00:00
Daniel Dunbar cf3f2c49ea Revert r167801, "[preprocessor] When #including something that contributes no
tokens at all,". This change broke External/Nurbs in LLVM test-suite.

llvm-svn: 167858
2012-11-13 19:12:37 +00:00
Argyrios Kyrtzidis 4f10a3e9f0 [preprocessor] When #including something that contributes no tokens at all,
don't recursively continue lexing.

This avoids a stack overflow with a sequence of many empty #includes.
rdar://11988695

llvm-svn: 167801
2012-11-13 01:03:15 +00:00
Chad Rosier ad6e96d59c If we encounter a fatal error, exit with status 70. For BSD systems this is
defined as an internal software error.  This notifies the driver to report
diagnostics information.
rdar://11951540

llvm-svn: 167754
2012-11-12 21:32:24 +00:00
Chad Rosier 7ea7397ebc If we encounter a fatal error, call the interrupt handler to ensure any
temporary files are removed.
rdar://12282296

llvm-svn: 167741
2012-11-12 19:39:37 +00:00
Dmitri Gribenko 9fcad0947c Force C89 for c-index-test.c
MSVC supports only C89, so it is important to keep c-index-test.c
buildable with C89.  However, Clang defaults to C99, so while building
Clang with Clang one can introduce C99 constructs into c-index-test.c
without noticing.

Thanks to Nakamura Takumi for helping with MSVC bits.

llvm-svn: 167561
2012-11-07 23:52:25 +00:00
Jordan Rose 721567af3e [analyzer] Check that the argument to CFMakeCollectable is non-NULL.
Patch by Sean McBride!

llvm-svn: 167537
2012-11-07 17:12:37 +00:00
Argyrios Kyrtzidis d3a20f5974 [c-index-test] When building with BUILD_CLANG_ONLY=YES, include c-index-test.
It is part of libclang and has other uses besides running the clang tests.

llvm-svn: 167478
2012-11-06 19:14:25 +00:00
Ted Kremenek ccf3b4299d Remove completely irrelevant code from USR generation.
Thanks to Richard Smith for pointing this out.  This code stopped
serving its purpose during r103212 in a refactoring.  My initial
fix was to add back the logic to abort the USR generation for
InternalLinkage, but enough tests broke suspiciously that I fear
that USR generation for cursors with InternalLinkage is now expected
by some clients (where it wasn't the case when the refactoring
took place).  I don't own this code anymore and have not looked
at it for some time, but clearly this code is dead and can be removed
pending further review on the proper logic here.

llvm-svn: 167442
2012-11-06 06:36:45 +00:00
Argyrios Kyrtzidis 58a1d90d6a [c-index-test] Do install c-index-test because it's not just for tests,
it's also setup as 'INTERNAL_TOOL'.

llvm-svn: 167432
2012-11-06 02:12:21 +00:00
Richard Smith bd55daf2ee Remove first argument from Arg::getValue; it's been unused since r105760.
llvm-svn: 167211
2012-11-01 04:30:05 +00:00
Richard Smith 33fd551258 Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
and apparently unused (and since they are untested, they're presumably also
broken).

llvm-svn: 167210
2012-11-01 03:48: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
Nick Lewycky acce2f88f3 Add missing emacs major mode marker.
llvm-svn: 166914
2012-10-29 06:03:58 +00:00
Nick Lewycky f7c59696e2 Fix name of this file.
llvm-svn: 166913
2012-10-29 06:03:40 +00:00
Nick Lewycky 0380545b3d Add missing emacs major mode marker.
llvm-svn: 166912
2012-10-29 06:02:59 +00:00
Dmitri Gribenko 1c1395e902 Comment to XML conversion: avoid memory allocation while pretty-printing the
declaration.

llvm-svn: 166707
2012-10-25 18:28:26 +00:00
NAKAMURA Takumi 4deb9a9b11 c-index-test.c: Split a format string. [-Woverlength-strings]
FIXME: They are still long strings without formatter in printf(3)!
llvm-svn: 166636
2012-10-24 22:52:04 +00:00
Argyrios Kyrtzidis e26c5571b2 [libclang] Add "-index-file-full" option that recursively indexes any imported
modules/PCH files.

llvm-svn: 166605
2012-10-24 18:29:15 +00:00
Douglas Gregor 811db4eac4 Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.

llvm-svn: 166508
2012-10-23 22:26:28 +00:00
Sean Silva d901e82ec4 Fix some mdoc nits
Patch by Eitan Adler!

llvm-svn: 166482
2012-10-23 16:35:44 +00:00
Argyrios Kyrtzidis 118fafa301 [libclang] Add an environment variable to disable thread background priotity, for testing
llvm-svn: 166466
2012-10-23 04:09:38 +00:00
Dmitri Gribenko 923f305b2e Remove const_casts by propagating constness down to called functions.
llvm-svn: 166287
2012-10-19 16:51:38 +00:00
Fariborz Jahanian 9d2f1e753b [doc parsing] use getParamName to access parameter
for current(rewritten) comment and getParamNameAsWritten
to access param name coming with \param marker.

llvm-svn: 166231
2012-10-18 21:42:42 +00:00
NAKAMURA Takumi dbefa9b081 libclang/CXComment.cpp: Fix abuse of StringRef.
llvm-svn: 166163
2012-10-18 01:38:53 +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
Fariborz Jahanian a7d76d2672 [Doc parsing]: This patch adds <Declaration> tag to
XML comment for declarations which pretty-prints
declaration. I had to XFAIL one test annotate-comments.cpp.
This test is currently unmaintainable as written.
Dmitri G., can you see what we can do about this test.
We should change this test such that adding a new tag does not wreck
havoc to the test.

llvm-svn: 166130
2012-10-17 21:58:03 +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
Fariborz Jahanian bbd469bef3 Fixes location of overriding declaration with no comment
of their own.

llvm-svn: 165972
2012-10-15 20:57:52 +00:00
Fariborz Jahanian 14ec3f3acb structured document comment: patch to provide comment for overriding function
template when comment is comming from overridden declaration. 
// rdar://12378793

llvm-svn: 165953
2012-10-15 18:58:50 +00:00
Ted Kremenek 639a17a229 Further harden checking that scan-view isn't serving up pages outside
the server root.

llvm-svn: 165839
2012-10-12 22:56:38 +00:00
Ted Kremenek 3073c58cab Have scan-view guard against serving up pages outside the root directory.
llvm-svn: 165815
2012-10-12 19:16:31 +00:00
NAKAMURA Takumi e259d912ab c-index-test.c: /* Use C style comment. */
llvm-svn: 165797
2012-10-12 14:25:52 +00:00
Fariborz Jahanian 42e31323b6 search for overridden methods with comment when overriding method
has none of its own. Factor in Doug's comments.
// rdar://12378793

llvm-svn: 165771
2012-10-11 23:52:50 +00:00
Sean Silva e2bb2ff576 Remove pointless classof()'s.
Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.

llvm-svn: 165770
2012-10-11 23:31:23 +00:00
Argyrios Kyrtzidis 8585f140bf [libclang] Make sure the index_data.main_filename field is initialized
in c-index-test. index_enteredMainFile is not invoked when indexing a
module file.

llvm-svn: 165735
2012-10-11 19:38:23 +00:00
Argyrios Kyrtzidis 9f57186983 [libclang] Add tests for indexing modules and PCHs using modules.
llvm-svn: 165732
2012-10-11 19:00:44 +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
Ted Kremenek 45df60c1f3 Teach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.
llvm-svn: 165681
2012-10-11 00:40:41 +00:00
Fariborz Jahanian 1c883b9b57 [Doc parsing] This patch searches overridden objc/c++
methods looking for documentation on a particular base
class inherited by any method that overrides the base class.
In case of redeclaration, as when objc method is defined
in the implementation, it also looks up for documentation
in class/class extension being redeclared.

llvm-svn: 165643
2012-10-10 18:34:52 +00:00
Jordan Rose d01e83ab3e Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.
This more accurately reflects its use: this flag is set when a method
matches the getter or setter name for a property in the same class,
and does not actually specify whether or not the definition of the method
will be synthesized (either implicitly or explicitly with @synthesize).

This renames the setter and backing field as well, and changes the
(soon-to-be-obsolete?) XML dump format to use 'property_accessor'
instead of 'synthesized'.

llvm-svn: 165626
2012-10-10 16:42:25 +00:00
NAKAMURA Takumi e9894029ba [CMake] clang/tools/extra may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.
LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/path/to/llvm-srcroot/tools/clang/tools/extra, by default.

llvm-svn: 165620
2012-10-10 13:46:18 +00:00
Bill Wendling 59068d1302 Place temporary LTO files into their own subdirectory.
llvm-svn: 165600
2012-10-10 05:30:49 +00:00
Argyrios Kyrtzidis 15f6b8ebe8 Disable the preprocessing record when indexing a source file
and modules are not enabled.

llvm-svn: 165593
2012-10-10 02:12:50 +00:00
Argyrios Kyrtzidis e445c7236e When indexing a module file, for the ppIncludedFile callback give
an invalid location if the location points to the synthetic buffer
for the module input.

llvm-svn: 165592
2012-10-10 02:12:47 +00:00
Bob Wilson 0e504ff797 Revert "Use a special path to place the .o files in."
This reverts commit 165429 in an attempt to get our buildbots going.

llvm-svn: 165573
2012-10-09 23:57:08 +00:00
Argyrios Kyrtzidis b9556e695f Move the logic that searches for overridden methods from libclang to
ASTContext so that it can be widely available.

llvm-svn: 165473
2012-10-09 01:23:50 +00:00
Bill Wendling 99b0092a40 Use a special path to place the .o files in.
llvm-svn: 165429
2012-10-08 21:17:59 +00:00
Micah Villmow dd31ca10ef Move TargetData to DataLayout.
llvm-svn: 165395
2012-10-08 16:25:52 +00:00
Argyrios Kyrtzidis 6a80e7564f [libclang] Don't disable the preprocessing record while indexing so as
to not mess up with module building.

It was not worth trying to combine indexing without preprocessing record
and building modules with one because:

-just importing a module/PCH that was built with a pp record, enables it anyway
-the performance gain of indexing without the preprocessing record is insignificant.

llvm-svn: 165352
2012-10-06 01:18:35 +00:00
Ted Kremenek 450f9f29b2 Add color output to 'diagtool tree' to show what warnings are enabled by default.
llvm-svn: 165338
2012-10-05 22:07:14 +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
Bill Wendling 84ad5129a2 Add an explicit -object_path_lto flag during linking with a uniquified temporary
file name if building Apple-style.

llvm-svn: 165184
2012-10-03 23:49:57 +00:00
Bill Wendling a1ec84474b Remove the directory that these are already in.
llvm-svn: 165162
2012-10-03 21:08:21 +00:00
Argyrios Kyrtzidis f484b139db [libclang] When indexing, invoke the importedASTFile for PCH files as well.
llvm-svn: 165161
2012-10-03 21:05:51 +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
Benjamin Kramer 3da0563a35 clang-check: Add clangRewriteCore.a to the Makefile build to make it link again.
llvm-svn: 165119
2012-10-03 14:35:38 +00:00
Daniel Jasper 30abda1612 As opposed to the clang-fixit tool described on
http://clang.llvm.org/docs/ClangTools.html, this adds -fixit option to
clang-check. Thus, clang-check can become a general-purpose tool to run
clang capitalizing on the info stored in a compilation database.

Review: http://llvm-reviews.chandlerc.com/D51
llvm-svn: 165110
2012-10-03 13:28:43 +00:00
Dmitri Gribenko 61b1db1629 Comment to XML conversion: escape XML special chars correctly; use correct
regex for version tuples.

llvm-svn: 165104
2012-10-03 09:04:56 +00:00
Bill Wendling 766d4d22ac The top-level clang Makefile is #included into other Makefiles. (sigh) So we
can't have the logic here to add in the 'tools/{driver,libclang}' directories,
because they will be added in for ALL Makefiles which #include the top-level
one. Place the logic into the 'tools' Makefile.

llvm-svn: 165103
2012-10-03 08:39:19 +00:00
Argyrios Kyrtzidis e514b200aa Some renames to use the 'visitor' nomenclature, no functionality change.
llvm-svn: 165083
2012-10-03 01:58:28 +00:00
Fariborz Jahanian e61fc44c3d [Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.

llvm-svn: 165066
2012-10-02 23:01:04 +00:00
Argyrios Kyrtzidis 10e7846abf [libclang] When indexing an AST file, only deserialize the file level
declarations of the current primary module.

llvm-svn: 165046
2012-10-02 21:09:13 +00:00
Fariborz Jahanian de0ae1e406 [Doc parsing]: Add available and deprecated attribute info
to XML output. // rdar://12378879

llvm-svn: 165039
2012-10-02 20:05:47 +00:00
Argyrios Kyrtzidis d4fcf58070 [libclang] When indexing an AST file, only deserialize the preprocessing record
entities of the current primary module.

llvm-svn: 165023
2012-10-02 16:10:51 +00:00
Argyrios Kyrtzidis f590e094ad Add info in the preprocessing record whether an inclusion directive
resulted in an automatic module import.

llvm-svn: 165022
2012-10-02 16:10:46 +00:00
Argyrios Kyrtzidis b36ee5c592 [libclang] Even though we disable the preprocessing record during indexing,
make sure that it gets enabled for when a module needs to be created.

llvm-svn: 165021
2012-10-02 16:10:41 +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
Fariborz Jahanian c491c3f27a availability in structured documents. Takes
care of comments by Dimitri and Doug.

llvm-svn: 164957
2012-10-01 18:42:25 +00:00
Bill Wendling 446fb68894 Remove this hack in favor of another, better way of performing the same thing.
llvm-svn: 164915
2012-09-30 11:22:45 +00:00
Dmitri Gribenko 6743e04699 Move the 'find macro by spelling' infrastructure to the Preprocessor class and
use it to suggest appropriate macro for __attribute__((deprecated)) in
-Wdocumentation-deprecated-sync.

llvm-svn: 164892
2012-09-29 11:40:46 +00:00
Argyrios Kyrtzidis 19d78b743f For PPCallbacks::InclusionDirective() add a parameter for the module, whenever
an inclusion directive was automatically turned into a module import, and
PPCallbacks::moduleImport() for an explicit module import.

llvm-svn: 164874
2012-09-29 01:06:10 +00:00
Fariborz Jahanian 35760a8937 [Doc parsing] Add availability information to generated Comment XML.
(I still need to add a test once I figure it out).
Reviewed off-line by Doug. // rdar://12378879

llvm-svn: 164861
2012-09-28 22:35:49 +00:00
Argyrios Kyrtzidis 4fcd2885de Per discussion in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html
have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets.

rdar://11113134 & http://llvm.org/PR13880

llvm-svn: 164743
2012-09-27 01:42:07 +00:00
Bill Wendling 3af41e6c5f Use a variable to stop us from building clang testing tools.
<rdar://problem/11202465>

llvm-svn: 164739
2012-09-27 00:11:09 +00:00
Ted Kremenek f81b0e387a Have set-xcode-analyer report an error if no xcspec file could be found.
llvm-svn: 164713
2012-09-26 18:19:55 +00:00
Ted Kremenek 66dfa34404 Make set-xcode-analyzer more tolerant of the naming differenes reported by xcode-select.
llvm-svn: 164712
2012-09-26 18:13:03 +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 39a76387e0 Have ASTUnit::Save() return a bool to indicate save error.
Removes a dependency of ASTUnit to clang-c/Index.h.

llvm-svn: 164704
2012-09-26 16:39:46 +00:00
Eli Friedman b826a00857 Fix the AST representation for non-type template arguments to encode
enough information so we can mangle them correctly in cases involving
dependent parameter types. (This specifically impacts cases involving
null pointers and cases involving parameters of reference type.)
Fix the mangler to use this information instead of trying to scavenge
it out of the parameter declaration.

<rdar://problem/12296776>.

llvm-svn: 164656
2012-09-26 02:36:12 +00:00
Argyrios Kyrtzidis 341de09dcd [libclang] Do a AST concurrency check in clang_indexTranslationUnit_Impl.
llvm-svn: 164626
2012-09-25 19:29:50 +00:00
Benjamin Kramer 75e4bb1d87 ccc-analyzer: pass -stdlib=libc++ through to the analyzer.
Otherwise clang can't analyze code that relies on features provided by libc++.

llvm-svn: 164262
2012-09-19 22:56:24 +00:00
Roman Divacky 5bebfb7363 Follow up on llvm r164132.
llvm-svn: 164133
2012-09-18 16:09:16 +00:00
Dmitri Gribenko a664e5b88f Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
llvm-svn: 163983
2012-09-15 20:20:27 +00:00
Ted Kremenek b184a36aad Revert "Utilize new build system support in Xcode 4.5 for easier interposition"
It's not clear if this is working yet on the buildbot.  Reverting until we have
time to investigate.

llvm-svn: 163963
2012-09-15 05:51:10 +00:00
Ted Kremenek 460602e252 Utilize new build system support in Xcode 4.5 for easier interposition
of a build without needing to use ccc-analyzer.

llvm-svn: 163927
2012-09-14 19:06:33 +00:00
Jordan Rose c87e690372 scan-build: Determine the location of the clang binary before printing help.
We need the clang executable to print the list of available checkers.

llvm-svn: 163925
2012-09-14 18:59:03 +00:00
Richard Smith b15fe3a5e4 PR13811: Add a FunctionParmPackExpr node to handle references to function
parameter packs where the reference is not being expanded but the pack has
been. Previously, Clang would segfault in such cases.

llvm-svn: 163672
2012-09-12 00:56:43 +00:00
Chandler Carruth 482942ed08 Just revert r163605 for now. It broke the build and had some
questionable elements to the patch.

llvm-svn: 163609
2012-09-11 10:40:21 +00:00
David Chisnall d81825aed7 Select the correct, or, failing that, compatible, dialect when invoked as cc,
c89, c99, and so on.  No change to the default dialect when invoked as clang /
clang++.

llvm-svn: 163605
2012-09-11 09:58:54 +00:00
Argyrios Kyrtzidis 68e87e1360 [libclang] Do index 'extern' declarations inside functions.
rdar://12257073

llvm-svn: 163563
2012-09-10 22:58:04 +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
Alexander Kornienko 02f481c42f Workaround for MacOSX build failure with gcc <= 4.4
Summary:
A better solution to http://llvm.org/bugs/show_bug.cgi?id=13777
Named namespace + more unique name to make ODR violations unlikely.

Reviewers: chandlerc, doug.gregor, klimek

Reviewed By: doug.gregor

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D38

llvm-svn: 163513
2012-09-10 14:54:38 +00:00
Alexander Kornienko 767cd03bbe Fixed http://llvm.org/bugs/show_bug.cgi?id=13777
llvm-svn: 163429
2012-09-07 22:44:34 +00:00
Joao Matos 566359c0bf Revert r163083 per chandlerc's request.
llvm-svn: 163149
2012-09-04 17:49:35 +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 c32a7e4d8e Implemented parsing and AST support for the MS __leave exception statement. Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review.
llvm-svn: 163083
2012-09-02 03:45:41 +00:00
Argyrios Kyrtzidis b0b336ebe9 [libclang] Fix indexing type alias declarations. rdar://11878406
llvm-svn: 163072
2012-09-01 19:08:08 +00:00
Argyrios Kyrtzidis da188de2b6 [libclang] The annotation of tokens operation visits statement nodes code-recursively.
This can blow the stack with extremely deep hierarchies. Switch it to data-recursive.

This is implemented by introducing a post-children visitation callback that the
CursorVisitor is calling after child nodes of a cursor have been visited.
This is used by the annotate-tokens visitor to do extra work at that point.

rdar://11979525.

llvm-svn: 163071
2012-09-01 18:27:30 +00:00
Ted Kremenek 2ce4a8ff63 Comment that clang.dll is unavailable on cygming yet.
llvm-svn: 163055
2012-09-01 07:38:58 +00:00
NAKAMURA Takumi f7e150cc41 c-arcmt-test/Makefile: Restore some stuff. clang.dll is unavailable on cygming yet.
llvm-svn: 163054
2012-09-01 06:38:53 +00:00
Ted Kremenek 654a8158d1 Tweak link order to hopefully resolve a buildbot failure.
llvm-svn: 163052
2012-09-01 06:20:25 +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
Joao Matos e9a3ed4d71 Normalize line endings of r163013 (part 2).
llvm-svn: 163032
2012-08-31 22:18:20 +00:00
David Blaikie dcefd95d84 Fix the build (-Wswitch violation introduced by r163013).
llvm-svn: 163025
2012-08-31 21:55:26 +00:00
Joao Matos 251f4169da Normalize line endings of r163013.
llvm-svn: 163024
2012-08-31 21:41:22 +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
Michael Liao b94f47a8f5 Fix C++ comment in C source
llvm-svn: 162887
2012-08-30 00:45:32 +00:00
Ted Kremenek e29d2b8a66 Use double instead of single quote to expand .
llvm-svn: 162830
2012-08-29 07:22:34 +00:00
Ted Kremenek 2a226a61da Fix passing of -analyzer-max-loop from scan-build to clang.
llvm-svn: 162765
2012-08-28 16:48:48 +00:00
Argyrios Kyrtzidis 71c85b6a87 [libclang] When determining the cursor via a location, ignore synthesized ivars otherwise
if we have something like:

   @synthesize prop = _prop;

and '_prop' is not declared, we will encounter a '_prop' ivar before
encountering the 'prop' synthesize declaration and we will think that
we passed the region-of-interest, missing the cursor for 'prop'.

rdar://12172700

llvm-svn: 162715
2012-08-28 00:04:23 +00:00
Chad Rosier d9fb09a91b [ms-inline asm] Rename getClobber to getClobberStringLiteral. No functional
change intended.

llvm-svn: 162710
2012-08-27 23:28:41 +00:00
Ted Kremenek ca13244bb7 Change --with-analyzer to --use-analyzer, per sage feedback from Jordan.
llvm-svn: 162640
2012-08-25 05:24:46 +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
Ted Kremenek 12cda3384a Fix a few issues related to -with-analyzer reported by Jordan. Let's
have the option with two '--' to be consistent with other options.

llvm-svn: 162625
2012-08-24 23:42:58 +00:00
Ted Kremenek 22708504f2 Rework how scan-build picks the version of clang to use for static analysis.
Unless the user specifies, the clang used for static analysis is the one
found relative to scan-build.

If the user specifies -with-analyzer, they can pick either to use
the clang bundled with Xcode (via xcrun) or they can specify
a path to clang.

llvm-svn: 162620
2012-08-24 23:08:08 +00:00
Ted Kremenek 2f65f465bf Reformat help text for scan-build, and remove -constraints
and -store from help text because they are no longer relevant
to users.

llvm-svn: 162619
2012-08-24 23:08:06 +00:00
Ted Kremenek 7c2137a328 Revert "Go ahead and show experimental checkers in the scan-build "-h" output."
llvm-svn: 162587
2012-08-24 20:39:38 +00:00
Ted Kremenek b5e409fd20 Go ahead and show experimental checkers in the scan-build "-h" output.
They are labeled as not being enabled-by-default, and how else
are users going to test them.

Fixes <rdar://problem/11654923>

llvm-svn: 162543
2012-08-24 06:49:34 +00:00
Ted Kremenek af592eef7b On OS X, use xcrun (if present) to find the clang to use for static analysis if
no clang can be found relative to the location of scan-build.

Fixes <rdar://problem/11691794>

llvm-svn: 162535
2012-08-24 04:53:06 +00:00
Alexander Kornienko 4bcd58b87d Updated LibTooling.html, minor improvements in CommonOptionsParser
llvm-svn: 162521
2012-08-24 00:39:14 +00:00
Jordan Rose 060b163801 [scan-build] Accept -fno-objc-arc as well as -fobjc-arc.
This is how Xcode lets individual files be marked as non-ARC when the rest
of the project is ARC-enabled, so this is necessary for scan-build xcodebuild.

Patch by Paul Eipper!

llvm-svn: 162497
2012-08-23 23:16:34 +00:00
Dmitri Gribenko adba9be7c5 Fix a bunch of -Wdocumentation warnings.
llvm-svn: 162452
2012-08-23 17:58:28 +00:00
Argyrios Kyrtzidis 079ff5c6da [libclang] c-index-test: Make the printing of the overrides list of a cursor in
a deterministic order, to avoid random test failures.

llvm-svn: 162408
2012-08-22 23:15:52 +00:00
Alexander Kornienko 01387267c7 Reverted clang-check to fully supported CommandLine Library use-case: global
static variables.

llvm-svn: 162391
2012-08-22 20:52:52 +00:00
Alexander Kornienko bf4871d363 Implemented -ast-dump, -ast-print, -ast-dump-filter options in clang-check
llvm-svn: 161753
2012-08-13 10:50:08 +00:00
Dmitri Gribenko a43ec186a4 Attaching comments to declarations: find comment attached to any redeclaration
Not only look for the comment near the declaration itself, but also walk the
redeclaration chain: the previous declaration might have had a documentation
comment.

llvm-svn: 161722
2012-08-11 00:51:43 +00:00
Benjamin Kramer 3a913ed805 Fix a couple of pedantic gcc warnings.
llvm-svn: 161656
2012-08-10 10:06:13 +00:00
NAKAMURA Takumi 5c10810754 c-arcmt-test, c-index-test: Appease Cygwin, to link to libclang.a, not clang.dll.
llvm-svn: 161655
2012-08-10 06:10:58 +00:00
Chandler Carruth 6f71e24859 Temporarily revert r161612 while we figure out just what the semantics
of PARALLEL_DIRS are. They apparantly aren't what either Nick, Eric, or
I thought. ;] Should let the bots make forward progress.

llvm-svn: 161618
2012-08-09 21:02:52 +00:00
Chandler Carruth 69335414c1 Make all of the tools build in parallel. Missing this caused incremental
rebuilds to serially link each tool, which is really really slow.

We still have to build libclang serially first because c-index-test
depends on it.

llvm-svn: 161612
2012-08-09 20:40:24 +00:00
Chandler Carruth 60a232c82d Recurse into the extra tools repo the correct way from the Makefile
build system. Thanks to Nick for pointing at the actual construct which
should be used here.

llvm-svn: 161609
2012-08-09 20:21:38 +00:00
Dmitri Gribenko ba7aca3b38 Comment to HTML and XML conversion: ignore commands that contain a declaration
as their argument.  For example, \fn, \function, \typedef, \method, \class etc.

llvm-svn: 161601
2012-08-09 18:20:29 +00:00
Dmitri Gribenko dcbc8ce2b5 Comment to HTML and XML conversion: use CommandTraits to classify commands.
This also fixes a bug in comment to XML conversion: \result was just an
ordinary paragraph, not an alias for \returns.

llvm-svn: 161596
2012-08-09 17:33:20 +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
Chandler Carruth ac83232974 Allow the Makefile build system to find the extra repo if it is checked
out.

Unfortunately, the existing makefiles for the extra repo don't specify
the correct library dependencies. Fixing that next. If you're following
along, you'll get linker errors.

llvm-svn: 161549
2012-08-09 00:05:27 +00:00
Dmitri Gribenko 6cffc1928a Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy does
not compress spaces in verbatim content.

llvm-svn: 161531
2012-08-08 22:10:24 +00:00
Chad Rosier 4577cd3036 Add various MC components to clang build to support MS-style inline assembly.
llvm-svn: 161498
2012-08-08 16:27:29 +00:00
Ted Kremenek 7c88d2ae0f Teach ccc-analyze about -fobjc-legacy-dispatch and -mios-simulator-version-min
llvm-svn: 161443
2012-08-07 19:27:08 +00:00
Dmitri Gribenko 168d23414a Comment AST: DeclInfo: add a special kind for enums.
Comment XML: add a root node kind for enums.

llvm-svn: 161442
2012-08-07 18:59:04 +00:00
Dmitri Gribenko 815f72bac7 c-index-test Makefile: fix build on Linux. Reviewed by Eric Christopher.
llvm-svn: 161439
2012-08-07 18:36:33 +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
Chandler Carruth 1479492125 Initial support for recursing into the new clang-tools-extra repository
if checked out under clang/tools/extra.

This is mostly so folks other than me can start to test. Documentation,
details, and an announcement are still in the works.

llvm-svn: 161405
2012-08-07 08:37:42 +00:00
Ted Kremenek b9ddbd3daa scan-build: factor out setting of environment variables.
llvm-svn: 161343
2012-08-06 20:19:19 +00:00
Ted Kremenek 0d29bd231b Pull 'xcodebuild' wrapper logic into a separate function.
llvm-svn: 161330
2012-08-06 18:54:19 +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 3a770d0fe4 Comment to HTML conversion: refactor. Extracted a class to for FullComment
semantic parts -- this will be reused for comment to XML conversion.

llvm-svn: 161139
2012-08-01 22:48:16 +00:00
Dmitri Gribenko 307cf89b19 Comment to HTML conversion: skip \tparam commands with whitespace paragraphs
llvm-svn: 161096
2012-08-01 00:48:00 +00:00
Dmitri Gribenko 7c0456f91b Comment to HTML conversion: escape HTML special characters in command arguments
llvm-svn: 161094
2012-08-01 00:21:12 +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
David Blaikie 5ba8be0e9a Include clang-check as part of the clang installation.
This also tidies up a couple of other tools we were (partially) installing:
* c-index-test was being installed but shouldn't be (it's just a clang-dev tool)
* diagtool was being installed in cmake but not make (& shouldn't be installed in either)

Review by Manuel Klimek, Doug Gregor, and Chandler Carruth.

llvm-svn: 161073
2012-07-31 20:29:59 +00:00
Dmitri Gribenko 3af5f73344 Move comment from member operator() to class.
llvm-svn: 160980
2012-07-30 19:47:34 +00:00
Dmitri Gribenko ec551f67e5 c-index-test: remove dead store. Found by Clang static analyzer!
llvm-svn: 160974
2012-07-30 18:00:35 +00:00
Dmitri Gribenko 5de4c064c1 Add missing include for Linux buildbot
llvm-svn: 160971
2012-07-30 17:49:32 +00:00
Dmitri Gribenko a260c030b8 Add an assert to ParamCommandComment::getParamIndex() -- it should not be
called unless index is valid.

llvm-svn: 160970
2012-07-30 17:38:19 +00:00
Arnaud A. de Grandmaison e00629f777 [scan-build] Fix clang++ pathname
llvm-svn: 160871
2012-07-27 17:10:06 +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
Alexander Kornienko cdc3987ca8 Removed standalone clang-ast-dump tool.
llvm-svn: 160772
2012-07-26 01:44:18 +00:00
Dmitri Gribenko 6b375193a2 libclang comment to HTML rendering: \result is the same as \returns
llvm-svn: 160738
2012-07-25 17:14:58 +00:00
Dmitri Gribenko 378458d597 libclang comments AST: clang_ParamCommandComment_getParamName: don't assert
when a \param command does not have a parameter name, just return an empty
string instead.

llvm-svn: 160638
2012-07-23 19:41:49 +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
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 f267c87e31 Fix c-index-test to compile as C89.
llvm-svn: 160582
2012-07-20 22:00:35 +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
NAKAMURA Takumi e6c562c051 CMake: clang should depend on clang-headers, or bin/clang would not work better.
llvm-svn: 160549
2012-07-20 16:40:09 +00:00
NAKAMURA Takumi ed5bbe9020 [Win32] Rework crash-report since r145389.
- lib/Driver/Driver.cpp, tools/driver/driver.cpp: Exit status should not be propagated, although clang driver should catch exceptions.
  - test/Driver/crash-report.c: Add REQUIRES:shell for now.
    FIXME: setenv should work also on Lit.InternalShellRunner.
  - test/Driver/crash-report.c: Remove XFAIL.

Thanks to Chad, To point out the issue.

llvm-svn: 160343
2012-07-17 05:09:29 +00:00