[PATCH] ARMEB: Fix function result return for composite types

Renato Golin renato.golin at linaro.org
Wed Jul 2 11:56:23 PDT 2014


With the style nitpick, LGTM, Thanks!

================
Comment at: lib/CodeGen/TargetInfo.cpp:4382
@@ -4381,7 +4381,3 @@
   if (Size <= 32) {
-    // Return in the smallest viable integer type.
-    if (Size <= 8)
-      return ABIArgInfo::getDirect(llvm::Type::getInt8Ty(getVMContext()));
-    if (Size <= 16)
-      return ABIArgInfo::getDirect(llvm::Type::getInt16Ty(getVMContext()));
-    return ABIArgInfo::getDirect(llvm::Type::getInt32Ty(getVMContext()));
+    if (getDataLayout().isLittleEndian()) {
+      // Return in the smallest viable integer type.
----------------
Maybe making the BE code return earlier, than keeping the same code for little-endian below.

  if (!getDataLayout().isLittleEndian()) {
    return ABIArgInfo::getDirect(llvm::Type::getInt32Ty(getVMContext()));
  ...

http://reviews.llvm.org/D4364






More information about the cfe-commits mailing list