[cfe-commits] r81057 - in /cfe/trunk: include/clang/AST/ASTContext.h include/clang/AST/Decl.h include/clang/AST/Type.h include/clang/AST/TypeNodes.def include/clang/Frontend/PCHBitCodes.h lib/AST/ASTContext.cpp lib/AST/Type.cpp lib/CodeGen/CGDebugInfo.cpp lib/Frontend/PCHReader.cpp lib/Frontend/PCHWriter.cpp lib/Sema/TreeTransform.h

Douglas Gregor dgregor at apple.com
Tue Sep 8 09:42:36 PDT 2009


On Sep 4, 2009, at 5:15 PM, John McCall wrote:

> Author: rjmccall
> Date: Fri Sep  4 19:15:47 2009
> New Revision: 81057
>
> URL: http://llvm.org/viewvc/llvm-project?rev=81057&view=rev
> Log:
> Basic support for representing elaborated type specifiers
> directly in the AST.  The current thinking is to create these
> only in C++ mode for efficiency.  But for now, they're not being
> created at all; patch to follow.
>
> This will let us do things like verify that tags match during
> template instantation, as well as signal that an elaborated type
> specifier was used for clients that actually care.

Very nice!

> Modified: cfe/trunk/lib/Sema/TreeTransform.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=81057&r1=81056&r2=81057&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- cfe/trunk/lib/Sema/TreeTransform.h (original)
> +++ cfe/trunk/lib/Sema/TreeTransform.h Fri Sep  4 19:15:47 2009
> @@ -441,6 +441,11 @@
>   QualType RebuildEnumType(EnumDecl *Enum) {
>     return SemaRef.Context.getTypeDeclType(Enum);
>   }
> +
> +  /// \brief Build a new elaborated type.
> +  QualType RebuildElaboratedType(QualType T,  
> ElaboratedType::TagKind Tag) {
> +    return SemaRef.Context.getElaboratedType(T, Tag);
> +  }


I assume that the TemplateInstantiator class will (eventually) be  
overriding RebuildElaboratedType, to complain about class-key  
mismatches? (struct vs. union, etc.)

	- Doug



More information about the cfe-commits mailing list