r269720 - Try to make the buildbots green again: avoid the need for class Attr to be

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon May 16 16:03:40 PDT 2016


Author: rsmith
Date: Mon May 16 18:03:40 2016
New Revision: 269720

URL: http://llvm.org/viewvc/llvm-project?rev=269720&view=rev
Log:
Try to make the buildbots green again: avoid the need for class Attr to be
complete for users of AttrVec.

Modified:
    cfe/trunk/include/clang/AST/AttrIterator.h

Modified: cfe/trunk/include/clang/AST/AttrIterator.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/AttrIterator.h?rev=269720&r1=269719&r2=269720&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/AttrIterator.h (original)
+++ cfe/trunk/include/clang/AST/AttrIterator.h Mon May 16 18:03:40 2016
@@ -23,6 +23,13 @@ namespace clang {
   class Attr;
 }
 
+namespace llvm {
+  // Explicitly opt into 4 byte alignment for Attr*, to avoid the need to
+  // include the heavyweight Attr.h to use a TinyPtrVector<Attr*>.
+  template <>
+  struct PointerLikeTypeTraits<Attr *> : PointerLikeTypeTraits<void *> {};
+}
+
 // Defined in ASTContext.h
 void *operator new(size_t Bytes, const clang::ASTContext &C,
                    size_t Alignment = 8);




More information about the cfe-commits mailing list