aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-05-22 13:54:25 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-05-22 13:54:25 +0000
commit4381d4b83cdab592dbda85c54672dbe06de5b1d9 (patch)
tree7ae0b676ad647ffa8af6746695ff38c65befb3aa /lib/CodeGen
parentf58f45e6d76792df8c643ce1c6d364dce5db4826 (diff)
Targets like PIC16 generate Static decls for automatic variables, emit the appropriate debug descriptor as well in that case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index d01e578ffc..52bb90e7f8 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/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");