[llvm-commits] [llvm] r86748 - in /llvm/trunk: include/llvm/Analysis/ include/llvm/CodeGen/ include/llvm/Transforms/Utils/ lib/Analysis/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Transforms/Utils/

Jeffrey Yasskin jyasskin at google.com
Sat Mar 6 14:40:56 PST 2010


On Tue, Nov 10, 2009 at 3:06 PM, Devang Patel <dpatel at apple.com> wrote:
> Author: dpatel
> Date: Tue Nov 10 17:06:00 2009
> New Revision: 86748
>
> URL: http://llvm.org/viewvc/llvm-project?rev=86748&view=rev
> Log:
> Implement support to debug inlined functions.
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Nov 10 17:06:00 2009
> +  AbstractScopes[N] = AScope;
> +  if (DIDescriptor(N).isSubprogram())
> +    AbstractScopesList.push_back(AScope);
> +  return AScope;
> +}

>   // Clear debug info
> -  if (FunctionDbgScope) {
> -    delete FunctionDbgScope;
> +  if (CurrentFnDbgScope) {
> +    CurrentFnDbgScope = NULL;
>     DbgScopeMap.clear();
>     DbgScopeBeginMap.clear();
>     DbgScopeEndMap.clear();
> +    ConcreteScopes.clear();
> +    AbstractScopesList.clear();

Why do you clear AbstractScopesList here but not AbstractScopes? Since
AbstractScopesList only gets a value added to it when AbstractScopes
is missing that value, it seems like this will produce a wrong
AbstractScopesList in subsequent functions.

> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Nov 10 17:06:00 2009
> @@ -134,52 +134,52 @@
> +  /// AbstractScopes - Tracks the abstract scopes a module. These scopes are
> +  /// not included DbgScopeMap.
> +  ValueMap<MDNode *, DbgScope *> AbstractScopes;
> +  SmallVector<DbgScope *, 4>AbstractScopesList;

Reading this comment and the variable names, I'd think that every
DbgScope in AbstractScopes should appear in the AbstractScopesList.
However, only the subprograms do. Could you add a comment and/or
rename the variable?

Thanks,
Jeffrey




More information about the llvm-commits mailing list