r216507 - Re-apply r216491 (Win64 ABI shouldn't extend integer type arguments.)

Julien Lerouge jlerouge at apple.com
Tue Aug 26 17:36:55 PDT 2014


Author: jlerouge
Date: Tue Aug 26 19:36:55 2014
New Revision: 216507

URL: http://llvm.org/viewvc/llvm-project?rev=216507&view=rev
Log:
Re-apply r216491 (Win64 ABI shouldn't extend integer type arguments.)

This time though, preserve the extension for bool types since that's compatible
with what MSVC expects.

See http://reviews.llvm.org/D4380

Added:
    cfe/trunk/test/CodeGen/x86_64-arguments-win32.c
      - copied unchanged from r216495, cfe/trunk/test/CodeGen/x86_64-arguments-win32.c
Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp
    cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=216507&r1=216506&r2=216507&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Tue Aug 26 19:36:55 2014
@@ -2773,7 +2773,10 @@ ABIArgInfo WinX86_64ABIInfo::classify(Qu
     return ABIArgInfo::getDirect(llvm::IntegerType::get(getVMContext(), Size));
   }
 
-  if (Ty->isPromotableIntegerType())
+  // Bool type is always extended to the ABI, other builtin types are not
+  // extended.
+  const BuiltinType *BT = Ty->getAs<BuiltinType>();
+  if (BT && BT->getKind() == BuiltinType::Bool)
     return ABIArgInfo::getExtend();
 
   return ABIArgInfo::getDirect();

Modified: cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c?rev=216507&r1=216506&r2=216507&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c (original)
+++ cfe/trunk/test/CodeGen/2007-06-18-SextAttrAggregate.c Tue Aug 26 19:36:55 2014
@@ -1,11 +1,13 @@
 // RUN: %clang_cc1 %s -o - -emit-llvm | FileCheck %s
-// XFAIL: aarch64, arm64
+// XFAIL: aarch64, arm64, x86_64-pc-win32
 
 // PR1513
 
 // AArch64 ABI actually requires the reverse of what this is testing: the callee
 // does any extensions and remaining bits are unspecified.
 
+// Win64 ABI does expect extensions for type smaller than 64bits.
+
 // Technically this test wasn't written to test that feature, but it's a
 // valuable check nevertheless.
 





More information about the cfe-commits mailing list