summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-12 18:33:24 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-12 18:33:24 +0000
commit7398059c8453c17b0fef5011f1f5ac82e6ca6019 (patch)
treec220522faccaef6d4cbe3f30be8a8810c4d2898b /clang/lib/Sema/SemaDecl.cpp
parent57fc0194a84efaa7ca2a727d2306bbfd1e89a448 (diff)
downloadbcm5719-llvm-7398059c8453c17b0fef5011f1f5ac82e6ca6019.tar.gz
bcm5719-llvm-7398059c8453c17b0fef5011f1f5ac82e6ca6019.zip
API fix: All "bodies" for functions, Objective-C methods, blocks, are assumed to
be CompoundStmts. I think this is a valid assumption, and felt that the API should reflect it. Others please validate this assumption to make sure I didn't break anything. llvm-svn: 66814
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 7d3d1c68f2f..bedf05ed35e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2774,11 +2774,11 @@ Sema::DeclTy *Sema::ActOnFinishFunctionBody(DeclTy *D, StmtArg BodyArg) {
Decl *dcl = static_cast<Decl *>(D);
Stmt *Body = static_cast<Stmt*>(BodyArg.release());
if (FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(dcl)) {
- FD->setBody(Body);
+ FD->setBody(cast<CompoundStmt>(Body));
assert(FD == getCurFunctionDecl() && "Function parsing confused");
} else if (ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(dcl)) {
assert(MD == getCurMethodDecl() && "Method parsing confused");
- MD->setBody((Stmt*)Body);
+ MD->setBody(cast<CompoundStmt>(Body));
} else {
Body->Destroy(Context);
return 0;
OpenPOWER on IntegriCloud