[Clang] make SVE types known to device targets too (#99446)
For the purpose of preprocessing and declarations in header files, ensure clang accepts SVE types for both device and host targets. Co-authored-by: Sander De Smalen <sander.desmalen@arm.com>
This commit is contained in:
parent
5c93a94f5a
commit
c248d05c68
@ -1384,7 +1384,8 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target,
|
||||
#include "clang/Basic/OpenCLExtensionTypes.def"
|
||||
}
|
||||
|
||||
if (Target.hasAArch64SVETypes()) {
|
||||
if (Target.hasAArch64SVETypes() ||
|
||||
(AuxTarget && AuxTarget->hasAArch64SVETypes())) {
|
||||
#define SVE_TYPE(Name, Id, SingletonId) \
|
||||
InitBuiltinType(SingletonId, BuiltinType::Id);
|
||||
#include "clang/Basic/AArch64SVEACLETypes.def"
|
||||
|
@ -469,7 +469,9 @@ void Sema::Initialize() {
|
||||
#include "clang/Basic/OpenCLExtensionTypes.def"
|
||||
}
|
||||
|
||||
if (Context.getTargetInfo().hasAArch64SVETypes()) {
|
||||
if (Context.getTargetInfo().hasAArch64SVETypes() ||
|
||||
(Context.getAuxTargetInfo() &&
|
||||
Context.getAuxTargetInfo()->hasAArch64SVETypes())) {
|
||||
#define SVE_TYPE(Name, Id, SingletonId) \
|
||||
addImplicitTypedef(Name, Context.SingletonId);
|
||||
#include "clang/Basic/AArch64SVEACLETypes.def"
|
||||
|
@ -1,6 +1,8 @@
|
||||
// RUN: %clang_cc1 -triple aarch64-linux-gnu -emit-pch -o %t %s
|
||||
// RUN: %clang_cc1 -triple aarch64-linux-gnu -include-pch %t \
|
||||
// RUN: -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -aux-triple aarch64-linux-gnu \
|
||||
// RUN: -x hip-cpp-output -emit-pch -o %t %s
|
||||
|
||||
// expected-no-diagnostics
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user