summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-23 07:18:56 +0000
committerChris Lattner <sabre@nondot.org>2009-04-23 07:18:56 +0000
commit324f80b12a21d98c813e8cb4af9c3535b1a02d67 (patch)
treeb93ae6f396f3b843373b71748a026a943065a873
parent4645707034aa609960dcf1be20adf3ef8b99e526 (diff)
downloadbcm5719-llvm-324f80b12a21d98c813e8cb4af9c3535b1a02d67.tar.gz
bcm5719-llvm-324f80b12a21d98c813e8cb4af9c3535b1a02d67.zip
fix a problem producing debug info with global blocks.
llvm-svn: 69875
-rw-r--r--clang/include/clang/AST/Expr.h5
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index d22cdab70df..122d9b9433b 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -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) {
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index a042c6a4ed5..8ab4a44f40b 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -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());
OpenPOWER on IntegriCloud