[cfe-commits] r69875 - in /cfe/trunk: include/clang/AST/Expr.h lib/CodeGen/CGBlocks.cpp

Chris Lattner sabre at nondot.org
Thu Apr 23 00:18:56 PDT 2009


Author: lattner
Date: Thu Apr 23 02:18:56 2009
New Revision: 69875

URL: http://llvm.org/viewvc/llvm-project?rev=69875&view=rev
Log:
fix a problem producing debug info with global blocks.

Modified:
    cfe/trunk/include/clang/AST/Expr.h
    cfe/trunk/lib/CodeGen/CGBlocks.cpp

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=69875&r1=69874&r2=69875&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Thu Apr 23 02:18:56 2009
@@ -490,6 +490,11 @@
   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) { 

Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=69875&r1=69874&r2=69875&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Thu Apr 23 02:18:56 2009
@@ -672,8 +672,9 @@
 
   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());





More information about the cfe-commits mailing list