[PATCH] Fixing a bug where debug info for a local variable gets emitted at file scope

Yunzhong Gao Yunzhong_Gao at playstation.sony.com
Mon Aug 19 15:06:25 PDT 2013


  Hi David,
  Thanks for reviewing my patch. I am uploading a new patch that addresses your questions.

  > Can "VarOrInit" ever be null? If so, can you explain when/why? If not, use "dyn_cast" instead of dyn_cast_or_null.


  VarOrInit cannot be null. I have switched to using dyn_cast as you suggested.


  > if possible, even push the LinkageName stuff into the same conditional:
  if (GlobalVariable *Var = dyn_cast...) {
  setLocation
  isLocalToUnit = ...
  if (D->getDeclContext() && !isa<functionDecl> ... )
    LinkageName = Var->getName();
  }


  Fixed.

  - Gao.

http://llvm-reviews.chandlerc.com/D1281

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1281?vs=3328&id=3583#toc

Files:
  lib/CodeGen/CodeGenFunction.cpp
  lib/CodeGen/CGDebugInfo.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/CodeGen/CGDebugInfo.h
  lib/CodeGen/CGExpr.cpp
  test/CodeGen/debug-info-scope.c
  test/CodeGen/debug-info-line5.h
  test/CodeGen/debug-info-line5.cpp
  test/CodeGenCXX/debug-info-namespace.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1281.4.patch
Type: text/x-patch
Size: 12013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130819/84c41997/attachment.bin>


More information about the cfe-commits mailing list