diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-11-11 23:11:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-11-11 23:11:34 +0000 |
commit | a448fb2da03ece39978784793eea68760e8205a1 (patch) | |
tree | cb518bc50150fa941f164a2ae77193b77ca23259 /lib/CodeGen/CGObjC.cpp | |
parent | 5e08ad3cc62ab94649959ae227a9a411a729bf49 (diff) |
Rework IRgen invariant w.r.t. current insert point.
- EmitStmt is no longer required to finish with a current insertion
point defined (i.e. it does not need to make dummy
blocks). Instead, it can clear the insertion point in the builder
which indicates that the current insertion point is unreachable.
- CodeGenFunction provides HaveInsertPoint and EnsureInsertPoint
which respectively test if there is an insert point and ensure an
insertion point exists (by making a dummy block).
- Clearly mark functions in CodeGenFunction which can be called with
no insertion point defined. Currently this is a limited set, and
EmitStmt simply EnsureInsertPoint()s before emitting subsequent IR.
Remove EmitDummyBlock, which is no longer needed. Clients who haven't
already cleared the insertion point (typically via EmitBranch) can do
so by hand.
Remove isDummyBlock, which has effectively been renamed to
HaveInsertPoint.
The main thrust of this change is that we no longer have create dummy
blocks just to destroy them a short time later in EmitBlock in the
common case that there is no unreachable code following something like
a goto.
Additionally, this means that we are not using the hokey condition in
isDummyBlock that a block without a name is a dummy block. Guess how
well that works when we never emit block names!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59089 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 9079284052..3ffdb4d866 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -334,6 +334,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S) if (const DeclStmt *SD = dyn_cast<DeclStmt>(S.getElement())) { EmitStmt(SD); + assert(HaveInsertPoint() && "DeclStmt destroyed insert point!"); const ScopedDecl* D = SD->getSolitaryDecl(); ElementTy = cast<ValueDecl>(D)->getType(); DeclAddress = LocalDeclMap[D]; |