[PATCH] D131058: [AArch64] Add an error if SVE scalable vector types are used in a context without sve
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 3 05:42:18 PDT 2022
sdesmalen added inline comments.
================
Comment at: clang/lib/Sema/SemaDecl.cpp:8497
+ // Check that SVE types are only used in functions with SVE available.
+ if (T->isVLSTBuiltinType() && CurContext->isFunctionOrMethod()) {
+ const FunctionDecl *FD = cast<FunctionDecl>(CurContext);
----------------
VLSTBuiltinType is synonymous with Vector Length Specific BuiltinType, from the docs:
/// Determines if this is a sizeless type supported by the
/// 'arm_sve_vector_bits' type attribute, which can be applied to a single
/// SVE vector or predicate, excluding tuple types such as svint32x4_t.
bool isVLSTBuiltinType() const;
Additionally, this function doesn't include the tuple types (e.g. `svint32x2_t`), so if you want this to work for SVE types in general you'll need to create a new method for this.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131058/new/
https://reviews.llvm.org/D131058
More information about the llvm-commits
mailing list