]> granicus.if.org Git - clang/commitdiff
fix a problem producing debug info with global blocks.
authorChris Lattner <sabre@nondot.org>
Thu, 23 Apr 2009 07:18:56 +0000 (07:18 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 23 Apr 2009 07:18:56 +0000 (07:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69875 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h
lib/CodeGen/CGBlocks.cpp

index d22cdab70df990c92bed6def34cdc8b928305c22..122d9b9433b4472bfc15e6937d7229f3be7264dd 100644 (file)
@@ -490,6 +490,11 @@ public:
   SourceLocation getLocation() const { return Loc; }
   void setLocation(SourceLocation L) { Loc = L; }
 
+  // FIXME: The logic for computing the value of a predefined expr should go
+  // into a method here that takes the inner-most code decl (a block, function
+  // or objc method) that the expr lives in.  This would allow sema and codegen
+  // to be consistent for things like sizeof(__func__) etc.
+  
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
 
   static bool classof(const Stmt *T) { 
index a042c6a4ed5ab6d657ef5ba17f6174ef2db3353e..8ab4a44f40b7e64887ff0ec26da7d4597cabeb5c 100644 (file)
@@ -672,8 +672,9 @@ CodeGenFunction::GenerateBlockFunction(const BlockExpr *BExpr,
 
   CGM.SetInternalFunctionAttributes(BD, Fn, FI);
 
-  StartFunction(OuterFuncDecl, ResultType, Fn, Args,
+  StartFunction(BD, ResultType, Fn, Args,
                 BExpr->getBody()->getLocEnd());
+  CurFuncDecl = OuterFuncDecl;
   CurCodeDecl = BD;
   EmitStmt(BExpr->getBody());
   FinishFunction(cast<CompoundStmt>(BExpr->getBody())->getRBracLoc());