[llvm-commits] appendToGlobalCtors

Kostya Serebryany kcc at google.com
Sat Oct 29 09:39:34 PDT 2011


Done both, new patch attached.
http://codereview.appspot.com/5330046

--kcc

On Fri, Oct 28, 2011 at 10:38 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Oct 28, 2011, at 1:41 PM, Kostya Serebryany wrote:
>
> Hello,
>
> I would like to add a small utility function into llvm/Transforms/Utils.
> appendToGlobalCtors() adds a function to the list of global constructors.
> Currently it is used by AddressSanitizer; clattner suggested to move it
> to llvm/Transforms/Utils.
>
> Patch: http://codereview.appspot.com/5330046 (also in attachment).
>
>
> Great!  Thanks for working on this,  a few couple minor requests:
>
> +//===-- GlobalCtors.h - Functions to manipulate global ctors ----*- C++
> -*-===//
>
> Transforms/Utils is kind of a mess, but I think it would be better to put
> this in a "ModuleUtils.h" file, which would be more general.  The logic in
> GlobalOpt.cpp for manipulating llvm.global_ctors should be moved here
> eventually as well.
>
>
> +    GVCtor->setName("removed");
> +    GVCtor->eraseFromParent();
>
> No need for the setName call before eraseFromParent.
>
> Otherwise, looks great!
>
> -Chris
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111029/de605ffb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: issue5330046_14001.diff
Type: text/x-patch
Size: 4067 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111029/de605ffb/attachment.bin>


More information about the llvm-commits mailing list