Owen Anderson resistor at mac.com
Wed Jul 8 08:47:40 PDT 2009

On Jul 8, 2009, at 7:57 AM, John Criswell wrote:

> Owen Anderson wrote:
> Can you give a brief example of where to find the LLVMContext within a
> ModulePass or FunctionPass?  Is this just the context stored within  
> the
> Module or Function passed to runOnModule/runOnFunction?

Passes have a protected Context member, which is set for them by the  
PassManager, if you don't override doInitialization.  If you do, yes,  
you can fetch it from the Module or the Function.

> If the above is true, then does the GlobalVariable constructor need to
> take a Context argument?  It seems it should be able to infer it from
> the Module argument.

The GlobalVariables can be (and are, for the create_sentinel()  
methods) constructed with null for the Module argument.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090708/e790aa1b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090708/e790aa1b/attachment.bin>

More information about the llvm-dev mailing list