[cfe-commits] r127755 - in /cfe/trunk: include/clang/AST/PrettyPrinter.h include/clang/Sema/DeclSpec.h lib/AST/TypePrinter.cpp lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Sema/DeclSpec.cpp lib/Sema/SemaType.cpp test/Index/annotate-nested-name-specifier.cpp test/Index/annotate-tokens.c test/Index/recursive-member-access.c test/SemaCXX/sourceranges.cpp
Douglas Gregor
dgregor at apple.com
Wed Mar 16 14:37:00 PDT 2011
On Mar 16, 2011, at 1:16 PM, Abramo Bagnara wrote:
> Author: abramo
> Date: Wed Mar 16 15:16:18 2011
> New Revision: 127755
>
> URL: http://llvm.org/viewvc/llvm-project?rev=127755&view=rev
> Log:
> Use ElaboratedType also for C.
Did you measure the impact of this change on memory usage?
- Doug
> Modified:
> cfe/trunk/include/clang/AST/PrettyPrinter.h
> cfe/trunk/include/clang/Sema/DeclSpec.h
> cfe/trunk/lib/AST/TypePrinter.cpp
> cfe/trunk/lib/Parse/ParseDecl.cpp
> cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> cfe/trunk/lib/Sema/DeclSpec.cpp
> cfe/trunk/lib/Sema/SemaType.cpp
> cfe/trunk/test/Index/annotate-nested-name-specifier.cpp
> cfe/trunk/test/Index/annotate-tokens.c
> cfe/trunk/test/Index/recursive-member-access.c
> cfe/trunk/test/SemaCXX/sourceranges.cpp
>
> Modified: cfe/trunk/include/clang/AST/PrettyPrinter.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/PrettyPrinter.h?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/AST/PrettyPrinter.h (original)
> +++ cfe/trunk/include/clang/AST/PrettyPrinter.h Wed Mar 16 15:16:18 2011
> @@ -38,7 +38,7 @@
> /// \brief Create a default printing policy for C.
> PrintingPolicy(const LangOptions &LO)
> : Indentation(2), LangOpts(LO), SuppressSpecifiers(false),
> - SuppressTag(false), SuppressScope(false),
> + SuppressTagKeyword(false), SuppressTag(false), SuppressScope(false),
> Dump(false), ConstantArraySizeAsWritten(false),
> AnonymousTagLocations(true) { }
>
> @@ -64,6 +64,16 @@
> /// "const int" type specifier and instead only print the "*y".
> bool SuppressSpecifiers : 1;
>
> + /// \brief Whether type printing should skip printing the tag keyword.
> + ///
> + /// This is used when printing the inner type of elaborated types,
> + /// (as the tag keyword is part of the elaborated type):
> + ///
> + /// \code
> + /// struct Geometry::Point;
> + /// \endcode
> + bool SuppressTagKeyword : 1;
> +
> /// \brief Whether type printing should skip printing the actual tag type.
> ///
> /// This is used when the caller needs to print a tag definition in front
>
> Modified: cfe/trunk/include/clang/Sema/DeclSpec.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DeclSpec.h?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/DeclSpec.h (original)
> +++ cfe/trunk/include/clang/Sema/DeclSpec.h Wed Mar 16 15:16:18 2011
> @@ -329,6 +329,11 @@
>
> SourceLocation StorageClassSpecLoc, SCS_threadLoc;
> SourceLocation TSWLoc, TSCLoc, TSSLoc, TSTLoc, AltiVecLoc;
> + /// TSTNameLoc - If TypeSpecType is any of class, enum, struct, union,
> + /// typename, then this is the location of the named type (if present);
> + /// otherwise, it is the same as TSTLoc. Hence, the pair TSTLoc and
> + /// TSTNameLoc provides source range info for tag types.
> + SourceLocation TSTNameLoc;
> SourceRange TypeofParensRange;
> SourceLocation TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc;
> SourceLocation FS_inlineLoc, FS_virtualLoc, FS_explicitLoc;
> @@ -431,6 +436,11 @@
> SourceLocation getTypeSpecTypeLoc() const { return TSTLoc; }
> SourceLocation getAltiVecLoc() const { return AltiVecLoc; }
>
> + SourceLocation getTypeSpecTypeNameLoc() const {
> + assert(isDeclRep((TST) TypeSpecType) || TypeSpecType == TST_typename);
> + return TSTNameLoc;
> + }
> +
> SourceRange getTypeofParensRange() const { return TypeofParensRange; }
> void setTypeofParensRange(SourceRange range) { TypeofParensRange = range; }
>
> @@ -522,6 +532,13 @@
> unsigned &DiagID, ParsedType Rep);
> bool SetTypeSpecType(TST T, SourceLocation Loc, const char *&PrevSpec,
> unsigned &DiagID, Decl *Rep, bool Owned);
> + bool SetTypeSpecType(TST T, SourceLocation TagKwLoc,
> + SourceLocation TagNameLoc, const char *&PrevSpec,
> + unsigned &DiagID, ParsedType Rep);
> + bool SetTypeSpecType(TST T, SourceLocation TagKwLoc,
> + SourceLocation TagNameLoc, const char *&PrevSpec,
> + unsigned &DiagID, Decl *Rep, bool Owned);
> +
> bool SetTypeSpecType(TST T, SourceLocation Loc, const char *&PrevSpec,
> unsigned &DiagID, Expr *Rep);
> bool SetTypeAltiVecVector(bool isAltiVecVector, SourceLocation Loc,
>
> Modified: cfe/trunk/lib/AST/TypePrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/TypePrinter.cpp (original)
> +++ cfe/trunk/lib/AST/TypePrinter.cpp Wed Mar 16 15:16:18 2011
> @@ -557,9 +557,13 @@
> std::string Buffer;
> bool HasKindDecoration = false;
>
> + // bool SuppressTagKeyword
> + // = Policy.LangOpts.CPlusPlus || Policy.SuppressTagKeyword;
> +
> // We don't print tags unless this is an elaborated type.
> // In C, we just assume every RecordType is an elaborated type.
> - if (!Policy.LangOpts.CPlusPlus && !D->getTypedefForAnonDecl()) {
> + if (!(Policy.LangOpts.CPlusPlus || Policy.SuppressTagKeyword ||
> + D->getTypedefForAnonDecl())) {
> HasKindDecoration = true;
> Buffer += D->getKindName();
> Buffer += ' ';
> @@ -701,6 +705,7 @@
>
> std::string TypeStr;
> PrintingPolicy InnerPolicy(Policy);
> + InnerPolicy.SuppressTagKeyword = true;
> InnerPolicy.SuppressScope = true;
> TypePrinter(InnerPolicy).print(T->getNamedType(), TypeStr);
>
>
> Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseDecl.cpp Wed Mar 16 15:16:18 2011
> @@ -2123,7 +2123,6 @@
>
> bool Owned = false;
> bool IsDependent = false;
> - SourceLocation TSTLoc = NameLoc.isValid()? NameLoc : StartLoc;
> const char *PrevSpec = 0;
> unsigned DiagID;
> Decl *TagDecl = Actions.ActOnTag(getCurScope(), DeclSpec::TST_enum, TUK,
> @@ -2150,8 +2149,9 @@
> return;
> }
>
> - if (DS.SetTypeSpecType(DeclSpec::TST_typename, TSTLoc, PrevSpec, DiagID,
> - Type.get()))
> + if (DS.SetTypeSpecType(DeclSpec::TST_typename, StartLoc,
> + NameLoc.isValid() ? NameLoc : StartLoc,
> + PrevSpec, DiagID, Type.get()))
> Diag(StartLoc, DiagID) << PrevSpec;
>
> return;
> @@ -2172,10 +2172,9 @@
> if (Tok.is(tok::l_brace))
> ParseEnumBody(StartLoc, TagDecl);
>
> - // FIXME: The DeclSpec should keep the locations of both the keyword
> - // and the name (if there is one).
> - if (DS.SetTypeSpecType(DeclSpec::TST_enum, TSTLoc, PrevSpec, DiagID,
> - TagDecl, Owned))
> + if (DS.SetTypeSpecType(DeclSpec::TST_enum, StartLoc,
> + NameLoc.isValid() ? NameLoc : StartLoc,
> + PrevSpec, DiagID, TagDecl, Owned))
> Diag(StartLoc, DiagID) << PrevSpec;
> }
>
>
> Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
> +++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Wed Mar 16 15:16:18 2011
> @@ -1017,19 +1017,17 @@
> ParseStructUnionBody(StartLoc, TagType, TagOrTempResult.get());
> }
>
> - // FIXME: The DeclSpec should keep the locations of both the keyword and the
> - // name (if there is one).
> - SourceLocation TSTLoc = NameLoc.isValid()? NameLoc : StartLoc;
> -
> const char *PrevSpec = 0;
> unsigned DiagID;
> bool Result;
> if (!TypeResult.isInvalid()) {
> - Result = DS.SetTypeSpecType(DeclSpec::TST_typename, TSTLoc,
> + Result = DS.SetTypeSpecType(DeclSpec::TST_typename, StartLoc,
> + NameLoc.isValid() ? NameLoc : StartLoc,
> PrevSpec, DiagID, TypeResult.get());
> } else if (!TagOrTempResult.isInvalid()) {
> - Result = DS.SetTypeSpecType(TagType, TSTLoc, PrevSpec, DiagID,
> - TagOrTempResult.get(), Owned);
> + Result = DS.SetTypeSpecType(TagType, StartLoc,
> + NameLoc.isValid() ? NameLoc : StartLoc,
> + PrevSpec, DiagID, TagOrTempResult.get(), Owned);
> } else {
> DS.SetTypeSpecError();
> return;
>
> Modified: cfe/trunk/lib/Sema/DeclSpec.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/DeclSpec.cpp?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/DeclSpec.cpp (original)
> +++ cfe/trunk/lib/Sema/DeclSpec.cpp Wed Mar 16 15:16:18 2011
> @@ -421,6 +421,14 @@
> const char *&PrevSpec,
> unsigned &DiagID,
> ParsedType Rep) {
> + return SetTypeSpecType(T, Loc, Loc, PrevSpec, DiagID, Rep);
> +}
> +
> +bool DeclSpec::SetTypeSpecType(TST T, SourceLocation TagKwLoc,
> + SourceLocation TagNameLoc,
> + const char *&PrevSpec,
> + unsigned &DiagID,
> + ParsedType Rep) {
> assert(isTypeRep(T) && "T does not store a type");
> assert(Rep && "no type provided!");
> if (TypeSpecType != TST_unspecified) {
> @@ -430,7 +438,8 @@
> }
> TypeSpecType = T;
> TypeRep = Rep;
> - TSTLoc = Loc;
> + TSTLoc = TagKwLoc;
> + TSTNameLoc = TagNameLoc;
> TypeSpecOwned = false;
> return false;
> }
> @@ -449,6 +458,7 @@
> TypeSpecType = T;
> ExprRep = Rep;
> TSTLoc = Loc;
> + TSTNameLoc = Loc;
> TypeSpecOwned = false;
> return false;
> }
> @@ -457,6 +467,14 @@
> const char *&PrevSpec,
> unsigned &DiagID,
> Decl *Rep, bool Owned) {
> + return SetTypeSpecType(T, Loc, Loc, PrevSpec, DiagID, Rep, Owned);
> +}
> +
> +bool DeclSpec::SetTypeSpecType(TST T, SourceLocation TagKwLoc,
> + SourceLocation TagNameLoc,
> + const char *&PrevSpec,
> + unsigned &DiagID,
> + Decl *Rep, bool Owned) {
> assert(isDeclRep(T) && "T does not store a decl");
> // Unlike the other cases, we don't assert that we actually get a decl.
>
> @@ -467,7 +485,8 @@
> }
> TypeSpecType = T;
> DeclRep = Rep;
> - TSTLoc = Loc;
> + TSTLoc = TagKwLoc;
> + TSTNameLoc = TagNameLoc;
> TypeSpecOwned = Owned;
> return false;
> }
> @@ -482,13 +501,13 @@
> DiagID = diag::err_invalid_decl_spec_combination;
> return true;
> }
> + TSTLoc = Loc;
> + TSTNameLoc = Loc;
> if (TypeAltiVecVector && (T == TST_bool) && !TypeAltiVecBool) {
> TypeAltiVecBool = true;
> - TSTLoc = Loc;
> return false;
> }
> TypeSpecType = T;
> - TSTLoc = Loc;
> TypeSpecOwned = false;
> if (TypeAltiVecVector && !TypeAltiVecBool && (TypeSpecType == TST_double)) {
> PrevSpec = DeclSpec::getSpecifierName((TST) TypeSpecType);
> @@ -520,6 +539,7 @@
> }
> TypeAltiVecPixel = isAltiVecPixel;
> TSTLoc = Loc;
> + TSTNameLoc = Loc;
> return false;
> }
>
> @@ -527,6 +547,7 @@
> TypeSpecType = TST_error;
> TypeSpecOwned = false;
> TSTLoc = SourceLocation();
> + TSTNameLoc = SourceLocation();
> return false;
> }
>
>
> Modified: cfe/trunk/lib/Sema/SemaType.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaType.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaType.cpp Wed Mar 16 15:16:18 2011
> @@ -728,7 +728,7 @@
> }
>
> // If the type is deprecated or unavailable, diagnose it.
> - S.DiagnoseUseOfDecl(D, DS.getTypeSpecTypeLoc());
> + S.DiagnoseUseOfDecl(D, DS.getTypeSpecTypeNameLoc());
>
> assert(DS.getTypeSpecWidth() == 0 && DS.getTypeSpecComplex() == 0 &&
> DS.getTypeSpecSign() == 0 && "No qualifiers on tag names!");
> @@ -736,12 +736,11 @@
> // TypeQuals handled by caller.
> Result = Context.getTypeDeclType(D);
>
> - // In C++, make an ElaboratedType.
> - if (S.getLangOptions().CPlusPlus) {
> - ElaboratedTypeKeyword Keyword
> - = ElaboratedType::getKeywordForTypeSpec(DS.getTypeSpecType());
> - Result = S.getElaboratedType(Keyword, DS.getTypeSpecScope(), Result);
> - }
> + // In both C and C++, make an ElaboratedType.
> + ElaboratedTypeKeyword Keyword
> + = ElaboratedType::getKeywordForTypeSpec(DS.getTypeSpecType());
> + Result = S.getElaboratedType(Keyword, DS.getTypeSpecScope(), Result);
> +
> if (D->isInvalidDecl())
> declarator.setInvalidType(true);
> break;
> @@ -2300,7 +2299,7 @@
> // If we got no declarator info from previous Sema routines,
> // just fill with the typespec loc.
> if (!TInfo) {
> - TL.initialize(Context, DS.getTypeSpecTypeLoc());
> + TL.initialize(Context, DS.getTypeSpecTypeNameLoc());
> return;
> }
>
> @@ -2377,7 +2376,7 @@
> : SourceLocation());
> const CXXScopeSpec& SS = DS.getTypeSpecScope();
> TL.setQualifierLoc(SS.getWithLocInContext(Context));
> - TL.setNameLoc(DS.getTypeSpecTypeLoc());
> + TL.setNameLoc(DS.getTypeSpecTypeNameLoc());
> }
> void VisitDependentTemplateSpecializationTypeLoc(
> DependentTemplateSpecializationTypeLoc TL) {
> @@ -2398,7 +2397,10 @@
> : SourceLocation());
> const CXXScopeSpec& SS = DS.getTypeSpecScope();
> TL.setQualifierLoc(SS.getWithLocInContext(Context));
> - TL.setNameLoc(DS.getTypeSpecTypeLoc());
> + TL.setNameLoc(DS.getTypeSpecTypeNameLoc());
> + }
> + void VisitTagTypeLoc(TagTypeLoc TL) {
> + TL.setNameLoc(DS.getTypeSpecTypeNameLoc());
> }
>
> void VisitTypeLoc(TypeLoc TL) {
>
> Modified: cfe/trunk/test/Index/annotate-nested-name-specifier.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-nested-name-specifier.cpp?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/test/Index/annotate-nested-name-specifier.cpp (original)
> +++ cfe/trunk/test/Index/annotate-nested-name-specifier.cpp Wed Mar 16 15:16:18 2011
> @@ -149,13 +149,13 @@
>
> // Base specifiers
> // CHECK: Identifier: "outer_alias" [16:19 - 16:30] NamespaceRef=outer_alias:10:11
> -// CHECK: Punctuation: "::" [16:30 - 16:32] C++ base class specifier=outer_alias::inner::vector<struct X>:4:12 [access=public isVirtual=false]
> +// CHECK: Punctuation: "::" [16:30 - 16:32] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
> // CHECK: Identifier: "inner" [16:32 - 16:37] NamespaceRef=inner:2:13
> -// CHECK: Punctuation: "::" [16:37 - 16:39] C++ base class specifier=outer_alias::inner::vector<struct X>:4:12 [access=public isVirtual=false]
> +// CHECK: Punctuation: "::" [16:37 - 16:39] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
> // CHECK: Identifier: "vector" [16:39 - 16:45] TemplateRef=vector:4:12
> -// CHECK: Punctuation: "<" [16:45 - 16:46] C++ base class specifier=outer_alias::inner::vector<struct X>:4:12 [access=public isVirtual=false]
> +// CHECK: Punctuation: "<" [16:45 - 16:46] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
> // CHECK: Identifier: "X" [16:46 - 16:47] TypeRef=struct X:12:8
> -// CHECK: Punctuation: ">" [16:47 - 16:48] C++ base class specifier=outer_alias::inner::vector<struct X>:4:12 [access=public isVirtual=false]
> +// CHECK: Punctuation: ">" [16:47 - 16:48] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
>
>
> // CHECK: Keyword: "using" [17:3 - 17:8] UsingDeclaration=iterator[5:18]
>
> Modified: cfe/trunk/test/Index/annotate-tokens.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-tokens.c?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/test/Index/annotate-tokens.c (original)
> +++ cfe/trunk/test/Index/annotate-tokens.c Wed Mar 16 15:16:18 2011
> @@ -53,7 +53,7 @@
> // CHECK: Punctuation: ")" [5:17 - 5:18] UnexposedExpr=
> // CHECK: Punctuation: ";" [5:18 - 5:19] UnexposedStmt=
> // CHECK: Comment: "/* A comment */" [6:3 - 6:18] UnexposedStmt=
> -// CHECK: Keyword: "struct" [7:3 - 7:9] UnexposedStmt=
> +// CHECK: Keyword: "struct" [7:3 - 7:9] VarDecl=x:7:12 (Definition)
> // CHECK: Identifier: "X" [7:10 - 7:11] TypeRef=struct X:2:8
> // CHECK: Identifier: "x" [7:12 - 7:13] VarDecl=x:7:12 (Definition)
> // CHECK: Punctuation: "=" [7:14 - 7:15] VarDecl=x:7:12 (Definition)
> @@ -91,7 +91,7 @@
> // CHECK: Identifier: "Int" [16:38 - 16:41] TypeRef=Int:12:13
> // CHECK: Punctuation: "," [16:41 - 16:42] UnexposedExpr=
> // CHECK: Identifier: "Int" [16:43 - 16:46] TypeRef=Int:12:13
> -// CHECK: Keyword: "struct" [18:3 - 18:9] UnexposedStmt=
> +// CHECK: Keyword: "struct" [18:3 - 18:9] VarDecl=x:18:12 (Definition)
> // CHECK: Identifier: "X" [18:10 - 18:11] TypeRef=struct X:2:8
> // CHECK: Identifier: "x" [18:12 - 18:13] VarDecl=x:18:12 (Definition)
> // CHECK: Keyword: "do" [19:3 - 19:5] UnexposedStmt=
> @@ -107,7 +107,7 @@
> // CHECK: Punctuation: "." [21:13 - 21:14] MemberRefExpr=a:2:16
> // CHECK: Identifier: "a" [21:14 - 21:15] MemberRefExpr=a:2:16
>
> -// CHECK: Keyword: "enum" [23:3 - 23:7] UnexposedStmt=
> +// CHECK: Keyword: "enum" [23:3 - 23:7] VarDecl=c:23:14 (Definition)
> // CHECK: Identifier: "Color" [23:8 - 23:13] TypeRef=enum Color:11:6
> // CHECK: Identifier: "c" [23:14 - 23:15] VarDecl=c:23:14 (Definition)
> // CHECK: Punctuation: ";" [23:15 - 23:16] UnexposedStmt=
>
> Modified: cfe/trunk/test/Index/recursive-member-access.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/recursive-member-access.c?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/test/Index/recursive-member-access.c (original)
> +++ cfe/trunk/test/Index/recursive-member-access.c Wed Mar 16 15:16:18 2011
> @@ -257,7 +257,7 @@
> // CHECK-tokens: Keyword: "struct" [1:1 - 1:7] StructDecl=rdar8650865:1:8 (Definition)
> // CHECK-tokens: Identifier: "rdar8650865" [1:8 - 1:19] StructDecl=rdar8650865:1:8 (Definition)
> // CHECK-tokens: Punctuation: "{" [1:20 - 1:21] StructDecl=rdar8650865:1:8 (Definition)
> -// CHECK-tokens: Keyword: "struct" [2:3 - 2:9] StructDecl=rdar8650865:1:8 (Definition)
> +// CHECK-tokens: Keyword: "struct" [2:3 - 2:9] FieldDecl=first:2:23 (Definition)
> // CHECK-tokens: Identifier: "rdar8650865" [2:10 - 2:21] TypeRef=struct rdar8650865:1:8
> // CHECK-tokens: Punctuation: "*" [2:22 - 2:23] FieldDecl=first:2:23 (Definition)
> // CHECK-tokens: Identifier: "first" [2:23 - 2:28] FieldDecl=first:2:23 (Definition)
> @@ -270,7 +270,7 @@
> // CHECK-tokens: Keyword: "int" [6:1 - 6:4] FunctionDecl=test_rdar8650865:6:5 (Definition)
> // CHECK-tokens: Identifier: "test_rdar8650865" [6:5 - 6:21] FunctionDecl=test_rdar8650865:6:5 (Definition)
> // CHECK-tokens: Punctuation: "(" [6:21 - 6:22] FunctionDecl=test_rdar8650865:6:5 (Definition)
> -// CHECK-tokens: Keyword: "struct" [6:22 - 6:28] FunctionDecl=test_rdar8650865:6:5 (Definition)
> +// CHECK-tokens: Keyword: "struct" [6:22 - 6:28] ParmDecl=s:6:42 (Definition)
> // CHECK-tokens: Identifier: "rdar8650865" [6:29 - 6:40] TypeRef=struct rdar8650865:1:8
> // CHECK-tokens: Punctuation: "*" [6:41 - 6:42] ParmDecl=s:6:42 (Definition)
> // CHECK-tokens: Identifier: "s" [6:42 - 6:43] ParmDecl=s:6:42 (Definition)
>
> Modified: cfe/trunk/test/SemaCXX/sourceranges.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/sourceranges.cpp?rev=127755&r1=127754&r2=127755&view=diff
> ==============================================================================
> --- cfe/trunk/test/SemaCXX/sourceranges.cpp (original)
> +++ cfe/trunk/test/SemaCXX/sourceranges.cpp Wed Mar 16 15:16:18 2011
> @@ -13,15 +13,15 @@
> }
>
> int main() {
> - // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::class A *'
> + // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::A *'
> P<foo::A> p14 = new foo::A;
> - // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::enum B *'
> + // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::B *'
> P<foo::B> p24 = new foo::B;
> // CHECK: CXXNewExpr {{0x[0-9a-fA-F]+}} <col:19, col:28> 'foo::C *'
> P<foo::C> pr4 = new foo::C;
> }
>
> foo::A getName() {
> - // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:10, col:17> 'foo::class A'
> + // CHECK: CXXConstructExpr {{0x[0-9a-fA-F]+}} <col:10, col:17> 'foo::A'
> return foo::A();
> }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list