diff options
author | Mike Stump <mrs@apple.com> | 2009-09-22 02:12:52 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-09-22 02:12:52 +0000 |
commit | 39605b4eab472a37cec287f9d4663805e60346f3 (patch) | |
tree | 5db6475b48f715470975dd4bf9f080edd39fd89c /lib/CodeGen/CGDecl.cpp | |
parent | e4feb834fb1a6b03291ed78fd32d13729b5a3c4a (diff) |
Improve debug info generation for __block variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 31e74f05e4..d1f6b27624 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -213,8 +213,9 @@ unsigned CodeGenFunction::getByRefValueLLVMField(const ValueDecl *VD) const { /// void *__forwarding; /// int32_t __flags; /// int32_t __size; -/// void *__copy_helper; -/// void *__destroy_helper; +/// void *__copy_helper; // only if needed +/// void *__destroy_helper; // only if needed +/// char padding[X]; // only if needed /// T x; /// } x /// @@ -390,21 +391,6 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { DI->setLocation(D.getLocation()); if (Target.useGlobalsForAutomaticVariables()) { DI->EmitGlobalVariable(static_cast<llvm::GlobalVariable *>(DeclPtr), &D); - } else if (isByRef) { - // FIXME: This code is broken and will not emit debug info for the - // variable. The right way to do this would be to tell LLVM that this is a - // byref pointer, and what the offset is. Unfortunately, right now it's - // not possible unless we create a DIType that corresponds to the byref - // struct. - /* - llvm::Value *Loc; - bool needsCopyDispose = BlockRequiresCopying(Ty); - Loc = Builder.CreateStructGEP(DeclPtr, 1, "forwarding"); - Loc = Builder.CreateLoad(Loc, false); - Loc = Builder.CreateBitCast(Loc, DeclPtr->getType()); - Loc = Builder.CreateStructGEP(Loc, needsCopyDispose*2+4, "x"); - DI->EmitDeclareOfAutoVariable(&D, Loc, Builder); - */ } else DI->EmitDeclareOfAutoVariable(&D, DeclPtr, Builder); } |