[llvm-commits] appendToGlobalCtors

Devang Patel dpatel at apple.com
Mon Oct 31 17:01:29 PDT 2011


On Oct 29, 2011, at 9:39 AM, Kostya Serebryany wrote:

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

Applied. r143405
Thanks!
-
Devang

> --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
> 
> 
> 
> 
> <issue5330046_14001.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111031/c4c5cd22/attachment.html>


More information about the llvm-commits mailing list