Il 25/05/2011 00:41, Sean Hunt ha scritto: > Author: coppro > Date: Tue May 24 17:41:36 2011 > New Revision: 132017 > > URL: http://llvm.org/viewvc/llvm-project?rev=132017&view=rev > Log: > Implement a new type node, UnaryTransformType, designed to represent a > type that turns one type into another. This is used as the basis to > implement __underlying_type properly - with TypeSourceInfo and proper > behavior in the face of templates.
[...] > Modified: cfe/trunk/include/clang/AST/TypeLoc.h > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=132017&r1=132016&r2=132017&view=diff > ============================================================================== > --- cfe/trunk/include/clang/AST/TypeLoc.h (original) > +++ cfe/trunk/include/clang/AST/TypeLoc.h Tue May 24 17:41:36 2011 > @@ -1410,6 +1410,53 @@ > DecltypeType> { > }; > > +struct UnaryTransformTypeLocInfo { > + // FIXME: While there's only one unary transform right now, future ones may > + // need different representations > + SourceLocation KWLoc, LParenLoc, RParenLoc; > + TypeSourceInfo *UnderlyingTInfo; > +}; Unless I am missing something obvious ... there seems to be a naming mismatch here. UTT type nodes have two types inside, the "base" (i.e., enum) type and the "transformed" (i.e., underlying) type. Here we store syntactic info, i.e., the base type rather than the underlying one. The implementation indeed stores the enum type, but the field name suggests the other way round. The name mismatch propagates to accessor methods: > +class UnaryTransformTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, [...] > + TypeSourceInfo* getUnderlyingTInfo() const { > + return getLocalData()->UnderlyingTInfo; > + } > + void setUnderlyingTInfo(TypeSourceInfo *TInfo) { > + getLocalData()->UnderlyingTInfo = TInfo; > + } Cheers, Enea. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
