summaryrefslogtreecommitdiffstats
path: root/clang/unittests/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* More unit-test fixesDouglas Gregor2012-10-232-0/+2
| | | | llvm-svn: 166511
* Fixup unit tests for DiagnosticOptions changeDouglas Gregor2012-10-232-2/+2
| | | | llvm-svn: 166509
* [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
* Patch for decl printer test of objective-c methods.Fariborz Jahanian2012-10-181-6/+36
| | | | | | Patch by Dmitri Gribenko. llvm-svn: 166209
* structured document comment: patch to provide comment for overriding functionFariborz Jahanian2012-10-151-1/+1
| | | | | | | template when comment is comming from overridden declaration. // rdar://12378793 llvm-svn: 165953
* [Doc parsing] This patch searches overridden objc/c++Fariborz Jahanian2012-10-101-1/+1
| | | | | | | | | | 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-1/+1
| | | | | | | use it to suggest appropriate macro for __attribute__((deprecated)) in -Wdocumentation-deprecated-sync. llvm-svn: 164892
* unittests/AST/StmtPrinterTest.cpp: Suppress a LP64-assumed test, ↵NAKAMURA Takumi2012-09-241-2/+0
| | | | | | | | "0x100000000i128 => 4294967296L", for now. LONG_MAX is 2147483647L on common 32 bit and LLP64 (Windows x64). llvm-svn: 164478
* As a followup for r164303, add some tests for printing literals that testDmitri Gribenko2012-09-232-0/+175
| | | | | | printing directly rather than through a complicated machinery of ObjC rewriter. llvm-svn: 164477
* Comment parsing: don't parse comment marker followed by a digit as a commandDmitri Gribenko2012-09-141-3/+31
| | | | | | since no Doxygen command starts with a digit. llvm-svn: 163909
* Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.Dmitri Gribenko2012-09-102-89/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-011-1/+2
| | | | | | | 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
* Remove the useless CommentOptions class.Dmitri Gribenko2012-08-312-2/+2
| | | | llvm-svn: 162986
* DeclPrinter tests: simplify the code by using the new runToolOnCodeWithArgsDmitri Gribenko2012-08-311-27/+10
| | | | | | function from Tooling. llvm-svn: 162976
* DeclPrinter tests: since now some platforms use C++11 by default, make itDmitri Gribenko2012-08-311-105/+97
| | | | | | explicitly visible in test cases which language variant is used. llvm-svn: 162974
* Reland r160052: Default to -std=c++11 on Windows.Nico Weber2012-08-301-0/+2
| | | | | | Also update the tests that rely on c++98 to explicitly mention that. llvm-svn: 162890
* ASTTests: Suppress TestCXXConstructorDecl11 on msvc for now. It seems ↵NAKAMURA Takumi2012-08-251-1/+2
| | | | | | incompatible. llvm-svn: 162631
* Use LLVM's plugin registry to enable registering new compilationDaniel Jasper2012-08-241-1/+1
| | | | | | | databases. Move JSONCompilationDatabase.h to its own files and register it as plugin. llvm-svn: 162541
* Rename the ASTMatchers to better match AST nodes. Now, allDaniel Jasper2012-08-241-46/+46
| | | | | | | | | ASTMatchers have the same name as the corresponding AST nodes but are lower case. The only exceptions are the "CXX" prefixes which are not copied over to the matcher names as the goal is to actually remove these prefixes from the AST node names. llvm-svn: 162536
* DeclPrinter tests: mark test case we get wrong currently with WRONG.Dmitri Gribenko2012-08-241-1/+1
| | | | llvm-svn: 162512
* DeclPrinter tests: add two more tests.Dmitri Gribenko2012-08-241-0/+23
| | | | llvm-svn: 162511
* Comment parsing: parse "<blah" as an HTML tag only if "blah" is a known tagDmitri Gribenko2012-08-221-78/+94
| | | | | | | | | | name. This should reduce the amount of warning false positives about bad HTML in comments when the comment author intended to put a reference to a template. This change will also enable us parse the comment as intended in these cases. Fixes part 1 of PR13374. llvm-svn: 162407
* DeclPrinter, terse mode: don't print function bodiesDmitri Gribenko2012-08-211-17/+34
| | | | llvm-svn: 162294
* Rename PrintingPolicy::DontRecurseInDeclContext to PrintingPolicy::TerseOutputDmitri Gribenko2012-08-211-1/+1
| | | | | | to reflect the intention, not the implementation. llvm-svn: 162293
* DeclPrinter: add terse output mode and lots of testsDmitri Gribenko2012-08-203-3/+1207
| | | | | | | | | | | | | | Add a flag PrintingPolicy::DontRecurseInDeclContext to provide "terse" output from DeclPrinter. The motivation is to use DeclPrinter to print declarations in user-friendly format, without overwhelming user with inner detail of the declaration being printed. Also add many tests for DeclPrinter. There are quite a few things that we print incorrectly: search for WRONG in DeclPrinterTest.cpp -- and these tests check our output against incorrect output, so that we can fix/refactor/rewrite the DeclPrinter later. llvm-svn: 162245
* Comment parsing: extract TableGen'able pieces into new CommandTraits class.Dmitri Gribenko2012-08-092-4/+8
| | | | llvm-svn: 161548
* Comment parsing: fix crash on \tparam followed immediately by another blockDmitri Gribenko2012-08-061-8/+56
| | | | | | command, for example: \tparam\brief. llvm-svn: 161361
* Comment parser tests: test that we allow placing no whitespace between \paramDmitri Gribenko2012-08-011-0/+3
| | | | | | and [direction]. llvm-svn: 161146
* Comment parsing: add support for \tparam command on all levels.Dmitri Gribenko2012-07-311-0/+60
| | | | | | | | | | 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
* Comment parser: add one more testDmitri Gribenko2012-07-301-4/+23
| | | | llvm-svn: 160965
* Implement resolving of HTML character references (named: &amp;, decimal: &#42;,Dmitri Gribenko2012-07-272-2/+321
| | | | | | | | | hex: &#x1a;) during comment parsing. Now internal representation of plain text in comment AST does not contain character references, but the characters themselves. llvm-svn: 160891
* Comment parsing: allow newlines between \param, direction specification (e.g.,Dmitri Gribenko2012-07-241-44/+82
| | | | | | [in]), parameter name and description paragraph. llvm-svn: 160682
* Comment parsing: retokenized text tokens are now pushed back in correct (notDmitri Gribenko2012-07-241-0/+25
| | | | | | reverse) order llvm-svn: 160675
* Comment parser unit tests: split a huge test caseDmitri Gribenko2012-07-231-34/+51
| | | | llvm-svn: 160649
* Comment parser unit tests: reduce code duplicationDmitri Gribenko2012-07-231-122/+45
| | | | llvm-svn: 160647
* add AST unittests to CMake build systemDmitri Gribenko2012-07-231-0/+1
| | | | llvm-svn: 160640
* Fix PR13411: Comment parsing: failed assertion on unterminated verbatim block.Dmitri Gribenko2012-07-201-15/+58
| | | | | | | | | | The assertion was wrong in case we have a verbatim block without a closing command. Also add tests for closing command name in a verbatim block, since now it can be empty in such cases. llvm-svn: 160568
* Comment parsing: don't parse whitespace before \endverbatim as a separate ↵Dmitri Gribenko2012-07-182-35/+59
| | | | | | line of whitespace. llvm-svn: 160464
* Comment AST nodes: rename getXXXCount() methods to getNumXXXs() to be in ↵Dmitri Gribenko2012-07-131-15/+15
| | | | | | line with Statement AST nodes. llvm-svn: 160182
* Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML ↵Dmitri Gribenko2012-07-132-157/+157
| | | | | | start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec. llvm-svn: 160153
* Enable comment parsing and semantic analysis to emit diagnostics. A fewDmitri Gribenko2012-07-113-10/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostics implemented -- see testcases. I created a new TableGen file for comment diagnostics, DiagnosticCommentKinds.td, because comment diagnostics don't logically fit into AST diagnostics file. But I don't feel strongly about it. This also implements support for self-closing HTML tags in comment lexer and parser (for example, <br />). In order to issue precise diagnostics CommentSema needs to know the declaration the comment is attached to. There is no easy way to find a decl by comment, so we match comments and decls in lockstep: after parsing one declgroup we check if we have any new, not yet attached comments. If we do -- then we do the usual comment-finding process. It is interesting that this automatically handles trailing comments. We pick up not only comments that precede the declaration, but also comments that *follow* the declaration -- thanks to the lookahead in the lexer: after parsing the declgroup we've consumed the semicolon and looked ahead through comments. Added -Wdocumentation-html flag for semantic HTML errors to allow the user to disable only HTML warnings (but not HTML parse errors, which we emit as warnings in -Wdocumentation). llvm-svn: 160078
* Comment lexing: fix lexing to actually work in non-error cases.Dmitri Gribenko2012-07-091-12/+107
| | | | llvm-svn: 159963
* Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko2012-07-062-26/+1290
| | | | | | | | | | | | | | very simple semantic analysis that just builds the AST; minor changes for lexer to pick up source locations I didn't think about before. Comments AST is modelled along the ideas of HTML AST: block and inline content. * Block content is a paragraph or a command that has a paragraph as an argument or verbatim command. * Inline content is placed within some block. Inline content includes plain text, inline commands and HTML as tag soup. llvm-svn: 159790
* Fix an infinite loop in comment lexer: we were not advancing in the input ↵Dmitri Gribenko2012-06-271-10/+32
| | | | | | character stream when we saw a '<' that is not a start of an HTML tag. llvm-svn: 159303
* Remove unsigned and a pointer from a comment token (so that each token can ↵Dmitri Gribenko2012-06-271-29/+32
| | | | | | have only one semantic string value attached to it), at a cost of adding an additional token. llvm-svn: 159270
* Implement a lexer for structured comments.Dmitri Gribenko2012-06-263-0/+1032
| | | | llvm-svn: 159223
* C++11 constexpr: Add note stacks containing backtraces if constant evaluationRichard Smith2011-12-162-98/+0
| | | | | | | | | | fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit argument to driver and frontend, to control the maximum number of notes so produced (default 10). Fix APValue printing to be able to pretty-print all APValue types, and move the testing for this functionality from a unittest to a -verify test now that it's visible in clang's output. llvm-svn: 146749
* Attempt to fix unit testsDouglas Gregor2011-09-291-0/+4
| | | | llvm-svn: 140748
* Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie2011-09-261-1/+1
| | | | llvm-svn: 140493
* Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie2011-09-251-1/+1
| | | | llvm-svn: 140479
OpenPOWER on IntegriCloud