================ @@ -85,6 +123,23 @@ class PrototypeParser { if (Substitution.empty()) PrintFatalError(Loc, "Not a template"); ParseType(Substitution); + } else if (T.consume_front("_ExtVector")) { + // Clang extended vector types are mangled as follows: + // + // '_ExtVector<' <lanes> ',' <scalar type> '>' + if (!T.consume_front("<")) + PrintFatalError(Loc, "Expected '<' after '_ExtVector'"); + unsigned long long Lanes; + if (llvm::consumeUnsignedInteger(T, 10, Lanes)) + PrintFatalError(Loc, "Expected number of lanes after '_ExtVector<'"); + Type += "E" + std::to_string(Lanes); + if (!T.consume_front(",")) + PrintFatalError(Loc, + "Expected ',' after number of lanes in '_ExtVector<'"); + if (!T.consume_back(">")) + PrintFatalError( + Loc, "Expected '>' after scalar type in '_ExtVector<N, type>'"); + ParseType(T); ---------------- fpetrogalli wrote:
We need to do that because ParseType do not accept anything other than types. The whole string `_ExtVector<N,type>` is a type (maybe we can call it top-level type?) Once we have verified that we have the whole `_ExtVector<N,type>`, we can narrow down and parse `type`. https://github.com/llvm/llvm-project/pull/83584 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits