<div>Hi,</div><div><br></div><div>IRToDWARF and IRForTarget current are subclasses of ModulePass. The constructors of these two methods look like the following:</div><div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace"> //------------------------------------------------------------------</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> /// Constructor</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> ///</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// @param[in] pid</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> /// A unique identifier for this pass. I'm not sure what this does;</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// it just gets passed down to ModulePass's constructor.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> ///</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// @param[in] decl_map</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// The list of externally-referenced variables for the expression,</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> /// for use in looking up globals and allocating the argument</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// struct. See the documentation for ClangExpressionDeclMap.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> ///</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// @param[in] target_data</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// The data layout information for the target. This information is</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> /// used to determine the sizes of types that have been lowered into</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> /// IR types.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace"> //------------------------------------------------------------------</font></div><div><font class="Apple-style-span" face="'courier new', monospace"> IRForTarget(lldb_private::ClangExpressionDeclMap *decl_map, const llvm::TargetData *target_data) : ModulePass(pid);</font></div>
</div><div><br></div><div>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.</div>
<div><br></div><div>As an aside, I'm compiling LLDB against LLVM trunk (not the zip file), so this might need an update of that as well.</div><div><br></div><div>Enjoy,</div><div>Bill Lynch</div>