]> granicus.if.org Git - clang/commit
Support and use token kinds as diagnostic arguments
authorAlp Toker <alp@nuanti.com>
Tue, 24 Dec 2013 09:48:30 +0000 (09:48 +0000)
committerAlp Toker <alp@nuanti.com>
Tue, 24 Dec 2013 09:48:30 +0000 (09:48 +0000)
commitaf9a02c0cdaafab155de9b2f43bfad33a28429c3
tree3d5e84d0ab2eb60845820ac10f12d0157912bb61
parent2a59b1c79ae68b9db35a3fb87a8d729164131735
Support and use token kinds as diagnostic arguments

Introduce proper facilities to render token spellings using the diagnostic
formatter.

Replaces most of the hard-coded diagnostic messages related to expected tokens,
which all shared the same semantics but had to be multiply defined due to
variations in token order or quote marks.

The associated parser changes are largely mechanical but they expose
commonality in whole chunks of the parser that can now be factored away.

This commit uses C++11 typed enums along with a speculative legacy fallback
until the transition is complete.

Requires corresponding changes in LLVM r197895.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197972 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/clang/Basic/Diagnostic.h
include/clang/Basic/DiagnosticCommonKinds.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/TokenKinds.h
include/clang/Parse/Parser.h
lib/Basic/Diagnostic.cpp
lib/Lex/PPExpressions.cpp
lib/Lex/PPMacroExpansion.cpp
lib/Parse/ParseCXXInlineMethods.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseDeclCXX.cpp
lib/Parse/ParseExpr.cpp
lib/Parse/ParseExprCXX.cpp
lib/Parse/ParseInit.cpp
lib/Parse/ParseObjc.cpp
lib/Parse/ParseOpenMP.cpp
lib/Parse/ParsePragma.cpp
lib/Parse/ParseStmt.cpp
lib/Parse/ParseTemplate.cpp
lib/Parse/Parser.cpp
lib/Sema/SemaExprObjC.cpp