[llvm-commits] [PATCH] SafeToDestroyConstant

Jay Foad jay.foad at gmail.com
Mon Jun 8 08:05:57 PDT 2009


GlobalDCE.cpp's SafeToDestroyConstant() isn't used anywhere. Meanwhile
GlobalOpt.cpp has a very similar function called ConstantIsDead().

This patch removes the unused function but renames ConstantIsDead to
SafeToDestroyConstant, because I think that makes the connection with
Constant::destroyConstant() clearer. Thoughts? Should
SafeToDestroyConstant() really be a method on Constant?

Incidentally I noticed that you can't call destroyConstant() on e.g. a
ConstantInt. It seems like you're only supposed to call it on a
constant that uses other constants (i.e. when getNumOperands() != 0).
Is that true? If so it could probably be documented better.

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.stdc
Type: application/octet-stream
Size: 3245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090608/10feaabe/attachment.obj>


More information about the llvm-commits mailing list