Manna created this revision.
Manna added a reviewer: erichkeane.
Herald added a project: All.
Manna requested review of this revision.
Herald added a project: clang.

This patch uses castAs instead of getAs which will assert if the type doesn't 
match in clang::​Type::​getRVVEltType(clang::​ASTContext const &),


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151721

Files:
  clang/lib/AST/Type.cpp


Index: clang/lib/AST/Type.cpp
===================================================================
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2462,7 +2462,7 @@
 QualType Type::getRVVEltType(const ASTContext &Ctx) const {
   assert(isRVVVLSBuiltinType() && "unsupported type!");
 
-  const BuiltinType *BTy = getAs<BuiltinType>();
+  const BuiltinType *BTy = castAs<BuiltinType>();
   return Ctx.getBuiltinVectorTypeInfo(BTy).ElementType;
 }
 


Index: clang/lib/AST/Type.cpp
===================================================================
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -2462,7 +2462,7 @@
 QualType Type::getRVVEltType(const ASTContext &Ctx) const {
   assert(isRVVVLSBuiltinType() && "unsupported type!");
 
-  const BuiltinType *BTy = getAs<BuiltinType>();
+  const BuiltinType *BTy = castAs<BuiltinType>();
   return Ctx.getBuiltinVectorTypeInfo(BTy).ElementType;
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to