summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CommentCommandTraits.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix for PR21254 - Assertion in comment parserDario Domizioli2014-10-151-0/+4
| | | | | | | | | | | | | The size of the ID field in CommandInfo was narrow, leading to potential wrap-around of command IDs, causing misinterpretation later on. The patch does the following: - It extends the ID bitfield from 8 to 20 bits. - It provides a DRY definition of the number of bits for the field to avoid using literal numbers in different files. - It introduces a new assertion that checks for the wrap-around. - It adds the testcase from PR21254. llvm-svn: 219802
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-2/+2
| | | | llvm-svn: 208517
* Fix dead store and simplify. No functionality change (although the code is nowRichard Smith2014-03-061-36/+31
| | | | | | correct if MaxEditDistance were increased to something greater than 1). llvm-svn: 203153
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-151-1/+1
| | | | llvm-svn: 186300
* [doc parsing]: make single character command imposturesFariborz Jahanian2013-05-091-0/+5
| | | | | | warn in pedantic mode. llvm-svn: 181523
* [doc parsing]: So, in this patch, single characterFariborz Jahanian2013-05-091-4/+0
| | | | | | | | 'commands' will not go through typo fixit logic, preserving the old behavior (no typo, no diagnostics). // rdar://12381408 llvm-svn: 181521
* [doc parsing]: don't attempt to fix single characterFariborz Jahanian2013-05-091-0/+4
| | | | | | commands (\t \n are common). \\ rdar://12381408 llvm-svn: 181517
* [doc parsing]: Also do typo correction forFariborz Jahanian2013-05-081-19/+30
| | | | | | | dynamically registered commands. // rdar://12381408 llvm-svn: 181477
* documentation parsing. Patch to do typo correction for Fariborz Jahanian2013-05-081-0/+27
| | | | | | | | documentation commands. Patch was reviewed, along with great suggestions for improvement, by Doug. // rdar://12381408 llvm-svn: 181458
* Comment parsing: add CommentOptions to allow specifying custom comment block ↵Dmitri Gribenko2013-02-221-5/+29
| | | | | | | | | | | | | | | | commands Add an ability to specify custom documentation block comment commands via a new class CommentOptions. The intention is that this class will hold future customizations for comment parsing, including defining documentation comments with specific numbers of parameters, etc. CommentOptions instance is a member of LangOptions. CommentOptions is controlled by a new command-line parameter -fcomment-block-commands=Foo,Bar,Baz. llvm-svn: 175892
* Comment parsing: handle non-builtin commands correctly. After semanticDmitri Gribenko2012-09-111-0/+1
| | | | | | | | | | | 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
* Fix buffer overflow.Eli Friedman2012-09-111-2/+2
| | | | llvm-svn: 163578
* Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.Dmitri Gribenko2012-09-101-101/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* CommentCommandTraits: rename BeginName -> StartName for consistency.Dmitri Gribenko2012-08-161-5/+5
| | | | llvm-svn: 162044
* Comment to HTML and XML conversion: ignore commands that contain a declarationDmitri Gribenko2012-08-091-8/+32
| | | | | | as their argument. For example, \fn, \function, \typedef, \method, \class etc. llvm-svn: 161601
* Comment parsing: extract TableGen'able pieces into new CommandTraits class.Dmitri Gribenko2012-08-091-0/+110
llvm-svn: 161548
OpenPOWER on IntegriCloud