aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Expr.h5
-rw-r--r--lib/CodeGen/CGBlocks.cpp3
2 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index d22cdab70d..122d9b9433 100644
--- a/include/clang/AST/Expr.h
+++ b/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/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index a042c6a4ed..8ab4a44f40 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/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());