[llvm-commits] [PATCH] check for blockaddress in Function::hasAddressTaken

Eli Friedman eli.friedman at gmail.com
Fri May 11 14:40:10 PDT 2012


On Fri, May 11, 2012 at 2:08 PM, Jay Foad <jay.foad at gmail.com> wrote:
> The attached patch addresses a FIXME in Function::hasAddressTaken:
>
>    // FIXME: Check for blockaddress, which does not take the address.
>
> (Eli, you added this comment in r142572.)
>
> I've adjusted GlobalOpt, which was assuming that !F->hasAddressTaken()
> implies that all users of F are Call or Invoke instructions. I suppose
> it's possible that other out-of-tree code makes the same assumption
> and will need adjusting. I've added a new test to check that
> -globalopt can now work some of its magic on a function that contains
> a blockaddress.
>
> Tested with "make check-all", LLVM and Clang, on Linux/x86-64. OK to commit?

Please update the comment in Function.h to note this.

It would be more clear in GlobalOpt to explicitly exclude
BlockAddresses, rather than implicitly excluding them using the cast
to Instruction*.

Otherwise, this looks fine.

-Eli




More information about the llvm-commits mailing list