]> granicus.if.org Git - clang/commitdiff
Targets like PIC16 generate Static decls for automatic variables, emit the appropriat...
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Fri, 22 May 2009 13:54:25 +0000 (13:54 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Fri, 22 May 2009 13:54:25 +0000 (13:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72261 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDecl.cpp

index d01e578ffc26a4b2f0aae882d401b304bdd9adcd..52bb90e7f8955aded651d36e174f335e1acb1391 100644 (file)
@@ -317,7 +317,10 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
   // 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");