[PATCH] D49045: PR15730/PR16986 Allow dependently typed vector_size types.

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 13 10:03:02 PDT 2018


erichkeane added inline comments.


================
Comment at: include/clang/AST/ASTContext.h:1327-1329
+  QualType getDependentVectorType(QualType VectorType, Expr *SizeExpr,
+                                       SourceLocation AttrLoc,
+                                       VectorType::VectorKind VecKind) const;
----------------
aaron.ballman wrote:
> The formatting looks off here. Did clang-format do this?
It DID, then I renamed it and forgot to rerun :/


================
Comment at: include/clang/AST/Type.h:3105
+public:
+  Expr *getSizeExpr() const { return SizeExpr; }
+  QualType getElementType() const { return ElementType; }
----------------
aaron.ballman wrote:
> Can this return `const Expr *` and have a non-const overload to return the non-const `Expr *`?
Done, but unfortunately, TypeLoc visitation (RecursiveASTVisitor) lacks const correctness in a bunch of places so a cast was required there :/  Additionally, TreeTransform has similar issues, so a const-cast was required as well.  Both end up being a bit of a cleanup, perhaps more than I can tackle at the moment.


================
Comment at: lib/AST/ItaniumMangle.cpp:3007-3008
+void CXXNameMangler::mangleNeonVectorType(const DependentVectorType *T) {
+  llvm_unreachable(
+      "Mangling for Dependent Sized Neon Vector not yet implemented");
+}
----------------
aaron.ballman wrote:
> This seems reachable.
I don't think it IS actually (since we never create one of these), but point made :)


https://reviews.llvm.org/D49045





More information about the cfe-commits mailing list