]> granicus.if.org Git - clang/commitdiff
Only use the MS record layout when using the MS C++ ABI
authorReid Kleckner <reid@kleckner.net>
Fri, 11 Oct 2013 21:10:11 +0000 (21:10 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 11 Oct 2013 21:10:11 +0000 (21:10 +0000)
We're not ready to use it everywhere we use a win32 triple yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192502 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/RecordLayoutBuilder.cpp

index 575ef316043181407c35c7a6c6c04f662abccc0c..10c7b5d88fbde04162c841a2211bc3e2c588d7a6 100644 (file)
@@ -2345,11 +2345,11 @@ static bool mustSkipTailPadding(TargetCXXABI ABI, const CXXRecordDecl *RD) {
 }
 
 static bool isMsLayout(const RecordDecl* D) {
-  return (D->getASTContext().getTargetInfo().getCXXABI().isMicrosoft() ||
-          D->getASTContext().getTargetInfo().getTriple().getOS() ==
-          llvm::Triple::Win32) &&
-          D->getASTContext().getTargetInfo().getPointerWidth(0) == 32;
-  // FIXME: we intend to enable 64 bit mode once it's been verified.
+  // FIXME: Use MS record layout for x64 code and remove MS C++ support from the
+  // Itanium record layout code.
+  return D->getASTContext().getTargetInfo().getCXXABI().isMicrosoft() &&
+         D->getASTContext().getTargetInfo().getTriple().getArch() ==
+             llvm::Triple::x86;
 }
 
 // This section contains an implementation of struct layout that is, up to the