================
@@ -2100,6 +2100,32 @@ TypeInfo ASTContext::getTypeInfo(const Type *T) const {
   return TI;
 }
 
+bool ASTContext::typeRequiresPreserveAlignUnderPragmaPack(QualType T) const {
+  T = T.getCanonicalType();
+  const llvm::Triple &Triple = Target->getTriple();
+  if (Triple.isOSWindows() && Triple.isWindowsMSVCEnvironment()) {
+    if (const auto *BT = T->getAs<BuiltinType>()) {
+      if (BT->getKind() == BuiltinType::LongDouble &&
+          &Target->getLongDoubleFormat() == 
&llvm::APFloat::x87DoubleExtended())
+        return true;
+    }
+    if (const auto *VT = T->getAs<VectorType>()) {
+      uint64_t VecWidth = getTypeSize(VT);
+      return VT->getVectorKind() == VectorKind::Generic &&
+             (VecWidth == 128 || VecWidth == 256) &&
----------------
ojhunt wrote:

It seems like we should have a method on target or similar along the lines of 
`isVectorWidthValid(..)`? I'm somewhat surprised something like that doesn't 
already exist?

https://github.com/llvm/llvm-project/pull/208256
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to