[cfe-commits] r61788 - in /cfe/trunk: include/clang/Basic/TokenKinds.def include/clang/Lex/Token.h lib/Parse/ParseDecl.cpp lib/Parse/ParseExpr.cpp lib/Parse/ParseExprCXX.cpp lib/Parse/ParseTemplate.cpp lib/Parse/ParseTentative.cpp lib/Parse/Parser.cpp
Chris Lattner
sabre at nondot.org
Mon Jan 5 21:06:21 PST 2009
Author: lattner
Date: Mon Jan 5 23:06:21 2009
New Revision: 61788
URL: http://llvm.org/viewvc/llvm-project?rev=61788&view=rev
Log:
rename tok::annot_qualtypename -> tok::annot_typename, which is both
shorter and more accurate. The type name might not be qualified.
Modified:
cfe/trunk/include/clang/Basic/TokenKinds.def
cfe/trunk/include/clang/Lex/Token.h
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Parse/ParseExpr.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
cfe/trunk/lib/Parse/ParseTentative.cpp
cfe/trunk/lib/Parse/Parser.cpp
Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Mon Jan 5 23:06:21 2009
@@ -397,7 +397,7 @@
// bycopy/byref/in/inout/oneway/out?
ANNOTATION(cxxscope) // annotation for a C++ scope spec, e.g. "::foo::bar::"
-ANNOTATION(qualtypename) // annotation for a C typedef name, a C++ (possibly
+ANNOTATION(typename) // annotation for a C typedef name, a C++ (possibly
// qualified) typename, e.g. "foo::MyClass", or
// template-id that names a type ("std::vector<int>")
ANNOTATION(template_id) // annotation for a C++ template-id that names a
Modified: cfe/trunk/include/clang/Lex/Token.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Token.h?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Token.h (original)
+++ cfe/trunk/include/clang/Lex/Token.h Mon Jan 5 23:06:21 2009
@@ -78,7 +78,7 @@
bool isNot(tok::TokenKind K) const { return Kind != (unsigned) K; }
bool isAnnotationToken() const {
- return is(tok::annot_qualtypename) ||
+ return is(tok::annot_typename) ||
is(tok::annot_cxxscope) ||
is(tok::annot_template_id);
}
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Mon Jan 5 23:06:21 2009
@@ -728,7 +728,7 @@
return false;
// simple-type-specifier:
- case tok::annot_qualtypename: {
+ case tok::annot_typename: {
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_typedef, Loc, PrevSpec,
Tok.getAnnotationValue());
DS.SetRangeEnd(Tok.getAnnotationEndLoc());
@@ -1255,7 +1255,7 @@
case tok::kw_restrict:
// typedef-name
- case tok::annot_qualtypename:
+ case tok::annot_typename:
return true;
// GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
@@ -1340,7 +1340,7 @@
case tok::kw_explicit:
// typedef-name
- case tok::annot_qualtypename:
+ case tok::annot_typename:
// GNU typeof support.
case tok::kw_typeof:
Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Mon Jan 5 23:06:21 2009
@@ -498,7 +498,7 @@
case tok::identifier: { // primary-expression: identifier
// unqualified-id: identifier
// constant: enumeration-constant
- // Turn a potentially qualified name into a annot_qualtypename or
+ // Turn a potentially qualified name into a annot_typename or
// annot_cxxscope if it would be valid. This handles things like x::y, etc.
if (getLang().CPlusPlus) {
// If TryAnnotateTypeOrScopeToken annotates the token, tail recurse.
@@ -622,7 +622,7 @@
case tok::kw_double:
case tok::kw_void:
case tok::kw_typeof:
- case tok::annot_qualtypename: {
+ case tok::annot_typename: {
if (!getLang().CPlusPlus) {
Diag(Tok, diag::err_expected_expression);
return ExprError();
Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Mon Jan 5 23:06:21 2009
@@ -449,7 +449,7 @@
abort();
// type-name
- case tok::annot_qualtypename: {
+ case tok::annot_typename: {
DS.SetTypeSpecType(DeclSpec::TST_typedef, Loc, PrevSpec,
Tok.getAnnotationValue());
break;
@@ -496,7 +496,7 @@
DS.Finish(Diags, PP.getSourceManager(), getLang());
return;
}
- if (Tok.is(tok::annot_qualtypename))
+ if (Tok.is(tok::annot_typename))
DS.SetRangeEnd(Tok.getAnnotationEndLoc());
else
DS.SetRangeEnd(Tok.getLocation());
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Mon Jan 5 23:06:21 2009
@@ -178,7 +178,7 @@
if(Tok.is(tok::kw_class) ||
(Tok.is(tok::kw_typename) &&
// FIXME: Next token has not been annotated!
- NextToken().isNot(tok::annot_qualtypename))) {
+ NextToken().isNot(tok::annot_typename))) {
return ParseTypeParameter(Depth, Position);
}
Modified: cfe/trunk/lib/Parse/ParseTentative.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTentative.cpp?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTentative.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTentative.cpp Mon Jan 5 23:06:21 2009
@@ -654,7 +654,7 @@
case tok::kw_float:
case tok::kw_double:
case tok::kw_void:
- case tok::annot_qualtypename:
+ case tok::annot_typename:
if (NextToken().is(tok::l_paren))
return TPResult::Ambiguous();
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=61788&r1=61787&r2=61788&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Mon Jan 5 23:06:21 2009
@@ -761,7 +761,7 @@
CurScope, &SS)) {
// This is a typename. Replace the current token in-place with an
// annotation type token.
- Tok.setKind(tok::annot_qualtypename);
+ Tok.setKind(tok::annot_typename);
Tok.setAnnotationValue(Ty);
Tok.setAnnotationEndLoc(Tok.getLocation());
if (SS.isNotEmpty()) // it was a C++ qualified type name.
More information about the cfe-commits
mailing list