diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-05-22 13:54:25 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-05-22 13:54:25 +0000 |
commit | 47e296149e0ad321188e7adf0cf165a5d46e5df6 (patch) | |
tree | be90e9e2551c588401f2e5761bf24c0215717b71 /clang/lib | |
parent | 12179bc014fe1edc7e9e6cca92ff93b1f321c9d1 (diff) | |
download | bcm5719-llvm-47e296149e0ad321188e7adf0cf165a5d46e5df6.tar.gz bcm5719-llvm-47e296149e0ad321188e7adf0cf165a5d46e5df6.zip |
Targets like PIC16 generate Static decls for automatic variables, emit the appropriate debug descriptor as well in that case.
llvm-svn: 72261
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index d01e578ffc2..52bb90e7f89 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -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"); |