[llvm-commits] [llvm] r89701 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Devang Patel devang.patel at gmail.com
Mon Nov 23 15:26:22 PST 2009


Dan,

On Mon, Nov 23, 2009 at 1:29 PM, Dan Gohman <gohman at apple.com> wrote:
> Author: djg
> Date: Mon Nov 23 15:29:08 2009
> New Revision: 89701
>
> URL: http://llvm.org/viewvc/llvm-project?rev=89701&view=rev
> Log:
> Print the debug info line and column in MachineInstr::print even when there's
> no filename. This situation is apparently fairly common right now.
>
> Modified:
>    llvm/trunk/lib/CodeGen/MachineInstr.cpp
>
> Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=89701&r1=89700&r2=89701&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Mon Nov 23 15:29:08 2009
> @@ -1149,9 +1149,10 @@
>
>     DebugLocTuple DLT = MF->getDebugLocTuple(debugLoc);
>     DICompileUnit CU(DLT.Scope);
> +    OS << " dbg:";
>     if (!CU.isNull())

This will always be null, because DLT.Scope is not DICompileUnit. It
is a DIScope, which may be a DILexicalScope or a DISubprogram. You
want to use DIScope::getFilename() and DIScope::getDirectory() here.

-
Devang




More information about the llvm-commits mailing list