[llvm-commits] appendToGlobalCtors
Chris Lattner
clattner at apple.com
Fri Oct 28 22:38:13 PDT 2011
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/20111028/f9aa6133/attachment.html>
More information about the llvm-commits
mailing list