Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

Issue 5330046: add utils to manipulate global ctors

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 6 months ago by kcc
Modified:
12 years, 6 months ago
Reviewers:
chandlerc, nlewycky1
CC:
chandlerc1
Base URL:
http://llvm.org/svn/llvm-project/llvm/trunk/
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : added includes #

Patch Set 3 : make it build #

Total comments: 24

Patch Set 4 : style changes #

Patch Set 5 : inline the string constant, add comments #

Patch Set 6 : style change #

Patch Set 7 : rename files to ModuleUtils #

Patch Set 8 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -0 lines) Patch
A include/llvm/Transforms/Utils/ModuleUtils.h View 1 2 3 4 5 6 7 1 chunk +30 lines, -0 lines 0 comments Download
M lib/Transforms/Utils/CMakeLists.txt View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A lib/Transforms/Utils/ModuleUtils.cpp View 1 2 3 4 5 6 7 1 chunk +55 lines, -0 lines 0 comments Download

Messages

Total messages: 4
kcc
Nick, Chris asked me to move one utility function from AddressSanitizer to llvm/Transforms/Utils. Could you ...
12 years, 6 months ago (2011-10-28 19:41:01 UTC) #1
chandlerc
http://codereview.appspot.com/5330046/diff/3001/include/llvm/Transforms/Utils/GlobalCtors.h File include/llvm/Transforms/Utils/GlobalCtors.h (right): http://codereview.appspot.com/5330046/diff/3001/include/llvm/Transforms/Utils/GlobalCtors.h#newcode22 include/llvm/Transforms/Utils/GlobalCtors.h:22: /// Return the name of the array containing global ...
12 years, 6 months ago (2011-10-28 20:02:14 UTC) #2
kcc
http://codereview.appspot.com/5330046/diff/3001/include/llvm/Transforms/Utils/GlobalCtors.h File include/llvm/Transforms/Utils/GlobalCtors.h (right): http://codereview.appspot.com/5330046/diff/3001/include/llvm/Transforms/Utils/GlobalCtors.h#newcode22 include/llvm/Transforms/Utils/GlobalCtors.h:22: /// Return the name of the array containing global ...
12 years, 6 months ago (2011-10-28 20:23:40 UTC) #3
chandlerc
12 years, 6 months ago (2011-10-28 20:27:28 UTC) #4
Cool, by all means mail upstream. =] Make sure to include some context with the
patch so folks know where you'll be using it.

http://codereview.appspot.com/5330046/diff/3001/include/llvm/Transforms/Utils...
File include/llvm/Transforms/Utils/GlobalCtors.h (right):

http://codereview.appspot.com/5330046/diff/3001/include/llvm/Transforms/Utils...
include/llvm/Transforms/Utils/GlobalCtors.h:22: /// Return the name of the array
containing global ctors.
On 2011/10/28 20:23:40, kcc wrote:
> On 2011/10/28 20:02:15, chandlerc wrote:
> > It's not immediately obvious to me why this is here, and what problem it
> solves?
> 
> Would it be better to just have a global 'const char *' object?
> Or just use "llvm.global_ctors"? 
> Right now, "llvm.global_ctors" is used in 9 different files as a 
> literal constant

I would use "llvm.global_ctors" and maybe add a FIXME comment to put it
somewhere appropriate like Support or VMCore. It shouldn't be part of this
utilitiy though.

http://codereview.appspot.com/5330046/diff/3001/include/llvm/Transforms/Utils...
include/llvm/Transforms/Utils/GlobalCtors.h:25: /// Append F to the list of
global ctors of module M with the given Priority.
On 2011/10/28 20:23:40, kcc wrote:
> On 2011/10/28 20:02:15, chandlerc wrote:
> > This needs better comments. What does 'Priority" mean? what is it actually
> used
> > for? etc.
> 
> This is documented at http://llvm.org/docs/LangRef.html#intg_global_ctors
> Shall I give a link? 

I would summarize it briefly, and give the link:

Append F to the list of global ctors of module M with the given priority. This
wraps the function in the appropriate structure and stores it along side other
global constructors. See ... for details.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b