[llvm-commits] r133216 - in /llvm/trunk: include/llvm/Target/TargetRegisterInfo.h lib/CodeGen/AllocationOrder.cpp lib/CodeGen/RegAllocLinearScan.cpp lib/Target/ARM/ARMBaseRegisterInfo.cpp lib/Target/ARM/ARMBaseRegisterInfo.h

Richard Smith richard at metafoo.co.uk
Thu Jun 16 17:15:09 PDT 2011


Hi,

> Author: stoklund
> Date: Thu Jun 16 18:31:16 2011
> New Revision: 133216
>
> URL: http://llvm.org/viewvc/llvm-project?rev=133216&view=rev
> Log:
> Rename TRI::getAllocationOrder() to getRawAllocationOrder().
>
> Also switch the return type to ArrayRef<unsigned> which works out nicely
> for ARM's implementation of this function because of the clever ArrayRef
> constructors.

Unfortunately, they're too clever for g++4.4, which appears to decay the
array to a pointer before trying the implicit conversion to ArrayRef:

src/lib/Target/ARM/ARMBaseRegisterInfo.cpp: In member function ‘virtual
llvm::ArrayRef<unsigned int>
llvm::ARMBaseRegisterInfo::getRawAllocationOrder(const
llvm::TargetRegisterClass*, unsigned int, unsigned int, const
llvm::MachineFunction&) const’:
src/lib/Target/ARM/ARMBaseRegisterInfo.cpp:482: error: conversion from
‘const unsigned int*’ to non-scalar type ‘llvm::ArrayRef<unsigned int>’
requested
[etc.]

See this buildbot:

http://google1.osuosl.org:8011/builders/llvm-gcc-i686-pc-linux-gnu-cross-arm-eabi-hard-float/builds/4883

g++4.4 is smart enough to cope with this pattern:

  return ArrayRef<unsigned>(GPREven1);

Regards,
Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arrayref-return.diff
Type: text/x-patch
Size: 1791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110617/78658e7e/attachment.bin>


More information about the llvm-commits mailing list