summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CXComment.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libclang] Remove the 'extern "C"' blocks from the implementation files.Argyrios Kyrtzidis2016-12-171-4/+0
| | | | | | | These are unnecessary, the declarations already carry the 'extern C' property, and if there is mismatch between declaration and definition then we will get linker errors via libclang.exports. llvm-svn: 290025
* [NFC] Header cleanupMehdi Amini2016-07-181-2/+1
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* [cleanup] Re-sort the #include lines using llvm/utils/sort_includes.pyChandler Carruth2015-01-141-1/+1
| | | | | | | No functionality changed, this is a purely mechanical cleanup to ensure the #include order remains consistent across the project. llvm-svn: 225975
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-081-4/+4
| | | | llvm-svn: 210422
* libclang: split out the documentation comment APIAlp Toker2014-04-281-0/+14
| | | | | | | | | | | | | | | | | 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
* Work around a bug in old gcc on the FreeBSD bot, which complains aboutDmitri Gribenko2013-11-141-3/+3
| | | | | | ambiguity between index() function and clang::index namespace. llvm-svn: 194638
* Documentation parsing: move comment-to-XML conversion routines to libIndexDmitri Gribenko2013-11-131-1110/+21
| | | | llvm-svn: 194610
* Documentation parsing: add support for \throws \throw \exception commandsDmitri Gribenko2013-11-121-0/+13
| | | | llvm-svn: 194521
* Remove unnecessary inclusion of Sema.hDavid Blaikie2013-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let me tell you a tale... Within some twisted maze of debug info I've ended up implementing an insane man's Include What You Use device. When the debugger emits debug info it really shouldn't, I find out why & then realize the code could be improved too. In this instance CIndexDiagnostics.cpp had a lot more debug info with Clang than GCC. Upon inspection a major culprit was all the debug info describing clang::Sema. This was emitted because clang::Sema is befriended by DiagnosticEngine which was rightly required, but GCC doesn't emit debug info for friends so it never emitted anything for Clang. Clang does emit debug info for friends (will be fixed/changed to reduce debug info size). But why didn't Clang just emit a declaration of Sema if this entire TU didn't require a definition? 1) Diagnostic.h did the right thing, only using a declaration of Sema and not including Sema.h at all. 2) Some other dependency of CIndexDiagnostics.cpp didn't do the right thing. ASTUnit.h, only needing a declaration, still included Sema.h (hence this commit which removes that include and adds the necessary includes to the cpp files that were relying on this) 3) -flimit-debug-info didn't save us because of EnterExpressionEvaluationContext, defined inline in Sema.h which fires the "requiresCompleteType" check/flag (since it uses nested types from Sema and calls Sema member functions) and thus, if debug info is ever emitted for the type, the whole type is emitted and not just a declaration. Improving -flimit-debug-info to account for this would be... hard. Modifying the code so that's not 'required to be complete' might be possible, but probably only by moving EnterExpressionEvaluationContext either into Sema, or out of Sema.h. That might be a bit too much of a contortion to be bothered with. Also, this is only one of the cases where emitting debug info for friends caused us to emit a lot more debug info (this change reduces Clang's DWO size by 0.93%, dropping friends entirely reduces debug info by 3.2%) - I haven't hunted down the other cases, but I assume they might be similar (Sema or something like it). IWYU or a similar tool might help us reduce build times a bit, but analyzing debug info to find these differences isn't worthwhile. I'll take the 3.2% win, provide this small improvement to the code itself, and move on. llvm-svn: 190715
* Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko2013-06-241-16/+36
| | | | | | | | Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
* Comment parsing: followup to r184610: allow multiple \returnsDmitri Gribenko2013-06-221-2/+2
| | | | | | | | | Remove unneeded member in CommentSema, add a test for the XML schema (the schema already allowed multiple paragraphs in <ResultDiscussion>, but there were no tests for that), fix HTML generation (it is not allowed to have <p> inside <dl>). llvm-svn: 184652
* [document parsing]: Allow multiple adjacent \return and the likeFariborz Jahanian2013-06-211-8/+13
| | | | | | | commands. Render them properly in XML output. // rdar://14207725 llvm-svn: 184610
* doxygen command. Add 'attention' command to list of similarFariborz Jahanian2013-02-261-0/+1
| | | | | | doxygen commands. // rdar://12379053 llvm-svn: 176127
* Comment to XML conversion: replace string comparison with command ID comparisonDmitri Gribenko2013-02-031-3/+8
| | | | llvm-svn: 174290
* libclang: remove 'using namespace cxstring'Dmitri Gribenko2013-02-031-1/+0
| | | | llvm-svn: 174285
* libclang: introduce cxstring::{createRef,createDup} for StringRefsDmitri Gribenko2013-02-021-15/+15
| | | | | | Also migrate all clients from the old API. llvm-svn: 174263
* Comment parsing: improve the fidelity of XML output for many block commandsDmitri Gribenko2013-02-011-3/+42
| | | | | | | | | | | | | | This change introduces a 'kind' attribute for the <Para> tag, that captures the kind of the parent block command. For example: \todo Meow. used to be just <Para>Meow.</Para>, but now it is <Para kind="todo">Meow.</Para> llvm-svn: 174216
* libclang: introduce cxstring::createNull()Dmitri Gribenko2013-02-011-15/+15
| | | | llvm-svn: 174173
* [Comment parsing] Add support for recognizingFariborz Jahanian2013-01-311-2/+15
| | | | | | | | \headerfile command and representing it in an xml document. Patch reviewed by Dmitri Gribenko. // rdar://12397511 llvm-svn: 174109
* libclang: type safety for CXTranslationUnitImpl::FormatContextDmitri Gribenko2013-01-261-10/+7
| | | | llvm-svn: 173589
* libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)Dmitri Gribenko2013-01-261-1/+1
| | | | | | into a getter cxtu::getASTUnit(TU) llvm-svn: 173585
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Comment to XML conversion: no, we don't want to print instantiations for theDmitri Gribenko2013-01-071-1/+1
| | | | | | <Declaration> tag llvm-svn: 171763
* Re-sort #include lines using the llvm/utils/sort_includes.py script.Chandler Carruth2013-01-021-2/+2
| | | | | | | Removes a duplicate #include as well as cleaning up some sort order regressions since I last ran the script over Clang. llvm-svn: 171364
* Add objective-C style formatting to clang format andFariborz Jahanian2012-12-201-6/+0
| | | | | | | use it to format xml declaration tags. // rdar://12378714 llvm-svn: 170727
* Audit DeclPrinter with -ast-dump on Cocoa.h andFariborz Jahanian2012-12-191-1/+1
| | | | | | | | | 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
* Increas number of iterations before a new libclang format objectFariborz Jahanian2012-12-191-1/+1
| | | | | | is created to 1000. llvm-svn: 170481
* Some code refactoring per Dimitri's comment.Fariborz Jahanian2012-12-191-39/+38
| | | | llvm-svn: 170478
* This is the libclang patch providing minimal API toFariborz Jahanian2012-12-181-4/+70
| | | | | | | | | | 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
* Sort #include lines for tools/...Chandler Carruth2012-12-041-6/+3
| | | | | | Completely automated with sort_includes.py llvm-svn: 169240
* Comment to XML conversion: avoid memory allocation while pretty-printing theDmitri Gribenko2012-10-251-18/+22
| | | | | | declaration. llvm-svn: 166707
* Remove const_casts by propagating constness down to called functions.Dmitri Gribenko2012-10-191-9/+7
| | | | llvm-svn: 166287
* [doc parsing] use getParamName to access parameter Fariborz Jahanian2012-10-181-10/+15
| | | | | | | for current(rewritten) comment and getParamNameAsWritten to access param name coming with \param marker. llvm-svn: 166231
* libclang/CXComment.cpp: Fix abuse of StringRef.NAKAMURA Takumi2012-10-181-1/+1
| | | | llvm-svn: 166163
* [Doc parsing]: This patch adds <Declaration> tag to Fariborz Jahanian2012-10-171-1/+20
| | | | | | | | | | | 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
* Fixes location of overriding declaration with no commentFariborz Jahanian2012-10-151-1/+1
| | | | | | of their own. llvm-svn: 165972
* structured document comment: patch to provide comment for overriding functionFariborz Jahanian2012-10-151-3/+3
| | | | | | | template when comment is comming from overridden declaration. // rdar://12378793 llvm-svn: 165953
* search for overridden methods with comment when overriding methodFariborz Jahanian2012-10-111-2/+2
| | | | | | | has none of its own. Factor in Doug's comments. // rdar://12378793 llvm-svn: 165771
* [Doc parsing] This patch searches overridden objc/c++Fariborz Jahanian2012-10-101-15/+22
| | | | | | | | | | 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
* Comment to XML conversion: escape XML special chars correctly; use correctDmitri Gribenko2012-10-031-11/+9
| | | | | | regex for version tuples. llvm-svn: 165104
* [Doc parse]: SUpport for message in deprecated/unavailableFariborz Jahanian2012-10-021-5/+19
| | | | | | attribute going iinto XML document. llvm-svn: 165066
* [Doc parsing]: Add available and deprecated attribute infoFariborz Jahanian2012-10-021-1/+6
| | | | | | to XML output. // rdar://12378879 llvm-svn: 165039
* availability in structured documents. TakesFariborz Jahanian2012-10-011-33/+27
| | | | | | care of comments by Dimitri and Doug. llvm-svn: 164957
* [Doc parsing] Add availability information to generated Comment XML.Fariborz Jahanian2012-09-281-1/+56
| | | | | | | (I still need to add a test once I figure it out). Reviewed off-line by Doug. // rdar://12378879 llvm-svn: 164861
* Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.Dmitri Gribenko2012-09-101-33/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Comment to HTML and XML conversion: ignore commands that contain a declarationDmitri Gribenko2012-08-091-1/+7
| | | | | | as their argument. For example, \fn, \function, \typedef, \method, \class etc. llvm-svn: 161601
* Comment to HTML and XML conversion: use CommandTraits to classify commands.Dmitri Gribenko2012-08-091-5/+9
| | | | | | | This also fixes a bug in comment to XML conversion: \result was just an ordinary paragraph, not an alias for \returns. llvm-svn: 161596
* Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy doesDmitri Gribenko2012-08-081-3/+3
| | | | | | not compress spaces in verbatim content. llvm-svn: 161531
* Comment AST: DeclInfo: add a special kind for enums.Dmitri Gribenko2012-08-071-0/+4
| | | | | | Comment XML: add a root node kind for enums. llvm-svn: 161442
* libclang API for comment-to-xml conversion.Dmitri Gribenko2012-08-071-0/+388
| | | | | | | | | | | | 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
OpenPOWER on IntegriCloud