[PATCH] D14441: [OpenCL] Pipe types support.

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 06:37:54 PST 2015


Anastasia added inline comments.

================
Comment at: include/clang/AST/Type.h:5019
@@ +5018,3 @@
+///
+class PipeType : public Type, public llvm::FoldingSetNode {
+  QualType ElementType;
----------------
Not related to this change though, but I was just thinking that it might be possible to avoid a lot of code repetition by moving common functionality of most special type classes into a base class. For example, AtomicType, BlockPointerType, ComplexType, PointerType, PipeType  all share similar functionality being some sort of a wrapper/container of another type. 

It will also avoid a lot of code replication in ASTContext (for example get{Atomic|BlockPointer|Pointer|Complex|Pipe}Type methods) as we could have some common factory pattern like template method for creating these types and filling the type caches. It seems they are mostly done in similar way.

Would be a nice refactoring task I think.


http://reviews.llvm.org/D14441





More information about the cfe-commits mailing list