[lldb-dev] [PATCH] IRToDWARF and IRForTarget

William Lynch wlynch at wlynch.cx
Tue Aug 17 20:32:53 PDT 2010


Hi,

IRToDWARF and IRForTarget current are subclasses of ModulePass. The
constructors of these two methods look like the following:

    //------------------------------------------------------------------
    /// Constructor
    ///
    /// @param[in] pid
    ///     A unique identifier for this pass.  I'm not sure what this does;
    ///     it just gets passed down to ModulePass's constructor.
    ///
    /// @param[in] decl_map
    ///     The list of externally-referenced variables for the expression,
    ///     for use in looking up globals and allocating the argument
    ///     struct.  See the documentation for ClangExpressionDeclMap.
    ///
    /// @param[in] target_data
    ///     The data layout information for the target.  This information is
    ///     used to determine the sizes of types that have been lowered into
    ///     IR types.
    //------------------------------------------------------------------
    IRForTarget(lldb_private::ClangExpressionDeclMap *decl_map, const
llvm::TargetData *target_data) : ModulePass(pid);

Judging from ModulePasses from LLVM, the pid parameter should actually be
the same char over all instances of this Pass. It's basically a unique spot
in memory. The following two patches implement this.

As an aside, I'm compiling LLDB against LLVM trunk (not the zip file), so
this might need an update of that as well.

Enjoy,
Bill Lynch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20100817/c66921c9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch1.patch
Type: application/octet-stream
Size: 1399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20100817/c66921c9/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch2.patch
Type: application/octet-stream
Size: 2949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20100817/c66921c9/attachment-0001.obj>


More information about the lldb-dev mailing list