summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CommentSema.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-5/+6
| | | | llvm-svn: 208517
* Comment parsing: remove HTML attribute validationDmitri Gribenko2014-04-301-13/+8
| | | | | | | | | | | | Since the community says that a blacklist is not good enough, and I don't have enough time now to implement a proper whitelist, let's just remove the attribute validation. But, nevertheless, we can still communicate in the generated XML if our parser found an issue with the HTML. But this bit is best-effort and is specifically called out in the schema as such. llvm-svn: 207712
* Comment parsing: in the generated XML file, mark HTML that is safe to passDmitri Gribenko2014-04-221-4/+29
| | | | | | | | | | | through to the output even if the input comment comes from an untrusted source Attribute filtering is currently based on a blacklist, which right now includes all event handler attributes (they contain JavaScipt code). It should be switched to a whitelist, but going over all of the HTML5 spec requires a significant amount of time. llvm-svn: 206882
* Comment parsing: recognize \param ... on function templates with variadicDmitri Gribenko2014-03-191-1/+4
| | | | | | | | parameters Patch by Joe Ranieri. llvm-svn: 204235
* Comment parsing: don't crash while parsing \deprecated in a standalone commentDmitri Gribenko2014-01-271-2/+11
| | | | | | | | | | | (comment without a decl). I think this can not happen during normal compilation with -Wdocumentation, only while using Clang APIs to parse comments outside of a source file. Based on a patch by Olivier Goffart. llvm-svn: 200230
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-1/+1
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Fix strange indentation and remove trailing whitespace on empty linesDmitri Gribenko2013-12-171-10/+10
| | | | llvm-svn: 197513
* Avoid double StringMap lookups. No functionality change.Benjamin Kramer2013-11-101-5/+3
| | | | llvm-svn: 194355
* CommentSema: Factor code better. No functionality change.Benjamin Kramer2013-11-101-44/+28
| | | | llvm-svn: 194354
* Use pop_back_val() instead of both back() and pop_back().Robert Wilhelm2013-08-231-2/+1
| | | | | | No functionality change intended. llvm-svn: 189112
* Comment parsing: allow "\param ..." to describe variadic argumentsDmitri Gribenko2013-06-241-1/+19
| | | | | | | | Original patch by Fariborz Jahanian; extended by me. Fixes rdar://14124644 llvm-svn: 184688
* Move comment on Sema::isFunctionPointerVarDecl() to the header fileDmitri Gribenko2013-06-241-3/+1
| | | | llvm-svn: 184677
* Comment parsing: followup to r184610: allow multiple \returnsDmitri Gribenko2013-06-221-7/+1
| | | | | | | | | 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-3/+2
| | | | | | | commands. Render them properly in XML output. // rdar://14207725 llvm-svn: 184610
* documentation parsing: patch to make @class work forFariborz Jahanian2013-06-191-3/+21
| | | | | | | class templates; and similarly, @function works for function templates. // rdar://14124702 llvm-svn: 184329
* Revert r184249, "doc. parsing: Allow parameter name "..." for variadic ↵NAKAMURA Takumi2013-06-191-15/+1
| | | | | | | | | | | functions/methods." It crashes in the case; /// Without any "param"s in the description. int printf(const char *format, ...); llvm-svn: 184283
* doc. parsing: Allow parameter name "..." for variadic functions/methods.Fariborz Jahanian2013-06-181-1/+15
| | | | | | // rdar://14124644 llvm-svn: 184249
* doc. parsing. HeaderDoc documentaton allows use ofFariborz Jahanian2013-05-201-0/+5
| | | | | | | @class command on an @interface declaration. Turn off the warning for this case. // rdar://13927330 llvm-svn: 182334
* documentation comment parsing. Added couple of Fariborz Jahanian2013-03-181-2/+8
| | | | | | | | top-level HeaderDoc tags @functiongroup and @methodgroup to doc. tags recognized. // rdar://12379114 llvm-svn: 177358
* Documentation parsing. Some refactoring and codeFariborz Jahanian2013-03-081-36/+81
| | | | | | improvements per Dmtiri's comments. // rdar://12379114 llvm-svn: 176739
* HeaderDoc: Support more of HeaderDoc documentation Fariborz Jahanian2013-03-071-2/+100
| | | | | | | | commands; top level tags such as @interface and their 2nd level tags such as @coclass, etc. // rdar://12379114 llvm-svn: 176667
* say objective-C in the warning and streamlineFariborz Jahanian2013-03-061-9/+8
| | | | | | several diagnostics into one. // rdar://13094352 llvm-svn: 176560
* fix a missing check in my last patch.Fariborz Jahanian2013-03-051-3/+11
| | | | | | // rdar://13094352 llvm-svn: 176529
* doc. parsing. Improve on diagnostics on my last patch.Fariborz Jahanian2013-03-051-7/+19
| | | | | | // rdar://13094352. llvm-svn: 176525
* Fix this checkin.Fariborz Jahanian2013-03-051-1/+1
| | | | llvm-svn: 176510
* doc parsing. Add @method and @callback forFariborz Jahanian2013-03-051-3/+21
| | | | | | | checkings and few other refactoring/cleanup. // rdar://13094352. llvm-svn: 176509
* doc parsing. We want to issue a strong warning whenFariborz Jahanian2013-03-051-0/+9
| | | | | | | an @function comment is not followed by a function decl. // rdar://13094352 llvm-svn: 176468
* Comment parsing: refactor handling of command markers in ASTDmitri Gribenko2013-03-041-23/+29
| | | | | | | | | | | | | | | * Use the term 'command marker', because the semantics of 'backslash' and 'at' commands are the same. (Talking about 'at commands' makes them look like a special entity.) * Sink the flag down into bitfields, reducing the size of AST nodes. * Change the flag into an enum for clarity. Boolean function parameters are not very clear. * Add unittests for new tok::at_command tokens. llvm-svn: 176461
* [comment parsing] source fidelity for tparam command too.Fariborz Jahanian2013-03-041-0/+1
| | | | | | // rdar://13066276 llvm-svn: 176448
* comment parsing. Missed a case of referringFariborz Jahanian2013-03-041-0/+1
| | | | | | to original command in diagnostic. // rdar://13066276 llvm-svn: 176444
* Some refactoring in my patch on documentFariborz Jahanian2013-03-021-12/+15
| | | | | | command source fidelity. // rdar://13066276 llvm-svn: 176401
* comment parsing. Keep the original command format Fariborz Jahanian2013-03-011-0/+6
| | | | | | | in AST for source fidelity and use it in diagnostics to refer to the original format. // rdar://13066276 llvm-svn: 176387
* comment parsing: Properties are considered like methods, and people Fariborz Jahanian2013-02-271-0/+11
| | | | | | | think of them as having return values that may be computed. Don't warn when using @return in their comment. // rdar://13189938 llvm-svn: 176147
* [Comment parsing] Add support for recognizingFariborz Jahanian2013-01-311-1/+8
| | | | | | | | \headerfile command and representing it in an xml document. Patch reviewed by Dmitri Gribenko. // rdar://12397511 llvm-svn: 174109
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-3/+3
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-011-1/+2
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* [doc parsing] use getParamName to access parameter Fariborz Jahanian2012-10-181-2/+2
| | | | | | | for current(rewritten) comment and getParamNameAsWritten to access param name coming with \param marker. llvm-svn: 166231
* search for overridden methods with comment when overriding methodFariborz Jahanian2012-10-111-1/+1
| | | | | | | 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-6/+6
| | | | | | | | | | 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
* Move the 'find macro by spelling' infrastructure to the Preprocessor class andDmitri Gribenko2012-09-291-3/+21
| | | | | | | use it to suggest appropriate macro for __attribute__((deprecated)) in -Wdocumentation-deprecated-sync. llvm-svn: 164892
* Comment sema: warn when comment has \deprecated but declaration does not have aDmitri Gribenko2012-09-221-0/+34
| | | | | | | | | deprecation attribute ('deprecated', 'availability' or 'unavailable'). This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it can be turned off easily while leaving other -Wdocumentation warnings on. llvm-svn: 164467
* Comment parsing: handle \deprecated command. It is a block command, but itDmitri Gribenko2012-09-131-0/+3
| | | | | | | should be fine to use it without further explanations in the attached paragraph, so the warning about empty paragraph was turned off for it. llvm-svn: 163836
* Comment parsing: handle non-builtin commands correctly. After semanticDmitri Gribenko2012-09-111-2/+8
| | | | | | | | | | | analysis registers a command, it becomes a "known" command for the lexer, since it has an ID. Having this freedom of choice to register a command is a good thing since BriefParser does not need this. But the parser should still invoke the correct semantic analysis method (actOnUnknownCommand) in this case. llvm-svn: 163646
* Remove redundant semicolons which are null statements.Dmitri Gribenko2012-09-101-1/+1
| | | | llvm-svn: 163546
* Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.Dmitri Gribenko2012-09-101-34/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 HTML tag name machers: move from StringSwitch to an efficientDmitri Gribenko2012-08-311-25/+4
| | | | | | TableGen-generated string matcher. llvm-svn: 162969
* Comment diagnostics: for unresolved parameters, do not suggest parameter fixitDmitri Gribenko2012-08-241-52/+88
| | | | | | | | with parameter that is documented. Fixes PR13670, <rdar://problem/12155840>. llvm-svn: 162570
* Comment parsing: extract TableGen'able pieces into new CommandTraits class.Dmitri Gribenko2012-08-091-55/+7
| | | | llvm-svn: 161548
* Comment AST: DeclInfo: collapse a bunch of boolean flags into an enum.Dmitri Gribenko2012-08-061-4/+4
| | | | llvm-svn: 161352
OpenPOWER on IntegriCloud