[cfe-commits] r68414 - in /cfe/trunk: include/clang/AST/Attr.h lib/CodeGen/CGCall.cpp lib/CodeGen/CodeGenModule.cpp lib/Sema/SemaDeclAttr.cpp

Eli Friedman eli.friedman at gmail.com
Fri Apr 3 21:04:17 PDT 2009


On Fri, Apr 3, 2009 at 5:49 PM, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> @@ -1718,8 +1729,16 @@
>           Attributes |= llvm::Attribute::ZExt;
>         }
>       }
> +      if (RegParm > 0 &&
> +          (ParamType->isIntegerType() || ParamType->isPointerType())) {
> +        RegParm -=
> +          (Context.getTypeSize(ParamType) + PointerWidth - 1) / PointerWidth;
> +        if (RegParm >= 0)
> +          Attributes |= llvm::Attribute::InReg;
> +      }
> +      // FIXME: handle sseregparm someday...
>       break;

The current support will miscompile some calls passing structs/unions
by value; should we try to detect that case and output an unsupported
error?

-Eli




More information about the cfe-commits mailing list