@@ -702,33 +702,7 @@ class Qualifiers {
702702 static bool isAddressSpaceSupersetOf (LangAS A, LangAS B,
703703 const ASTContext &Ctx) {
704704 // Address spaces must match exactly.
705- return A == B ||
706- // Otherwise in OpenCLC v2.0 s6.5.5: every address space except
707- // for __constant can be used as __generic.
708- (A == LangAS::opencl_generic && B != LangAS::opencl_constant) ||
709- // We also define global_device and global_host address spaces,
710- // to distinguish global pointers allocated on host from pointers
711- // allocated on device, which are a subset of __global.
712- (A == LangAS::opencl_global && (B == LangAS::opencl_global_device ||
713- B == LangAS::opencl_global_host)) ||
714- (A == LangAS::sycl_global && (B == LangAS::sycl_global_device ||
715- B == LangAS::sycl_global_host)) ||
716- // Consider pointer size address spaces to be equivalent to default.
717- ((isPtrSizeAddressSpace (A) || A == LangAS::Default) &&
718- (isPtrSizeAddressSpace (B) || B == LangAS::Default)) ||
719- // Default is a superset of SYCL address spaces.
720- (A == LangAS::Default &&
721- (B == LangAS::sycl_private || B == LangAS::sycl_local ||
722- B == LangAS::sycl_global || B == LangAS::sycl_global_device ||
723- B == LangAS::sycl_global_host)) ||
724- // In HIP device compilation, any cuda address space is allowed
725- // to implicitly cast into the default address space.
726- (A == LangAS::Default &&
727- (B == LangAS::cuda_constant || B == LangAS::cuda_device ||
728- B == LangAS::cuda_shared)) ||
729- // Conversions from target specific address spaces may be legal
730- // depending on the target information.
731- isTargetAddressSpaceSupersetOf (A, B, Ctx);
705+ return A == B || isTargetAddressSpaceSupersetOf (A, B, Ctx);
732706 }
733707
734708 static bool isTargetAddressSpaceSupersetOf (LangAS A, LangAS B,
0 commit comments