llvm-project/clang/utils/TableGen
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
..
CMakeLists.txt Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp. 2012-09-10 20:32:42 +00:00
ClangASTNodesEmitter.cpp Make clang-tblgen backends functions instead of TableGenBackends. 2012-06-13 05:12:41 +00:00
ClangAttrEmitter.cpp Don't constant-fold when pretty-printing alignment attribute. This fixes a 2012-08-16 02:43:29 +00:00
ClangCommentCommandInfoEmitter.cpp Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp. 2012-09-10 20:32:42 +00:00
ClangCommentHTMLTagsEmitter.cpp Comment HTML tag name machers: move from StringSwitch to an efficient 2012-08-31 02:21:44 +00:00
ClangDiagnosticsEmitter.cpp Fix horrible regression in control of warnings caused by introduction of -Wpedantic. 2012-08-10 20:50:00 +00:00
ClangSACheckersEmitter.cpp Make clang-tblgen backends functions instead of TableGenBackends. 2012-06-13 05:12:41 +00:00
Makefile
NeonEmitter.cpp Placate the mingw32 buildbot by suffixing 64-bit constants with ULL. 2012-08-14 03:55:16 +00:00
OptParserEmitter.cpp Dont cast away const needlessly. Found by gcc48 -Wcast-qual. 2012-09-06 15:59:27 +00:00
TableGen.cpp Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp. 2012-09-10 20:32:42 +00:00
TableGenBackends.h Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp. 2012-09-10 20:32:42 +00:00