[cfe-commits] r72261 - /cfe/trunk/lib/CodeGen/CGDecl.cpp

Sanjiv Gupta sanjiv.gupta at microchip.com
Fri May 22 06:54:27 PDT 2009


Author: sgupta
Date: Fri May 22 08:54:25 2009
New Revision: 72261

URL: http://llvm.org/viewvc/llvm-project?rev=72261&view=rev
Log:
Targets like PIC16 generate Static decls for automatic variables, emit the appropriate debug descriptor as well in that case.

Modified:
    cfe/trunk/lib/CodeGen/CGDecl.cpp

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=72261&r1=72260&r2=72261&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Fri May 22 08:54:25 2009
@@ -317,7 +317,10 @@
   // Emit debug info for local var declaration.
   if (CGDebugInfo *DI = getDebugInfo()) {
     DI->setLocation(D.getLocation());
-    if (isByRef) {
+    if (Target.useGlobalsForAutomaticVariables()) {
+      DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(DeclPtr), &D);
+    }
+    else if (isByRef) {
       llvm::Value *Loc;
       bool needsCopyDispose = BlockRequiresCopying(Ty);
       Loc = Builder.CreateStructGEP(DeclPtr, 1, "forwarding");





More information about the cfe-commits mailing list