aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-11-12 08:21:33 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-11-12 08:21:33 +0000
commit0912425f79418a215c2fbd2d8fc9511244a4aa46 (patch)
tree0666e7f72c85a70f23d1362680f021de8e276ebf /lib/CodeGen/CodeGenFunction.h
parent552f4c45ba4f4a01f86d585edabd871a27829867 (diff)
IRgen improvements on unreachable code:
- Split out "simple" statements which can easily handle IR generation when there is no insert point. These are generally statements which start by emitting a new block or are only containers for other statements. - This fixes a regression in emitting dummy blocks, notably for case statements. - This also fixes spurious emission of a number of debug stoppoint intrinsic instructions. Remove unneeded sw.body block, just clear the insertion point. Lift out CodeGenFunction::EmitStopPoint which calls into the CGDebugInfo class when generating debug info. Normalize definitions of Emit{Break,Continue}Stmt and usage of ErrorUnsupported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r--lib/CodeGen/CodeGenFunction.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index d867c3f380..3489b78239 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -346,6 +346,10 @@ public:
// Statement Emission
//===--------------------------------------------------------------------===//
+ /// EmitStopPoint - Emit a debug stoppoint if we are emitting debug
+ /// info.
+ void EmitStopPoint(const Stmt *S);
+
/// EmitStmt - Emit the code for the statement \arg S. It is legal
/// to call this function even if there is no current insertion
/// point.
@@ -356,6 +360,14 @@ public:
/// EmitStmt.
void EmitStmt(const Stmt *S);
+ /// EmitSimpleStmt - Try to emit a "simple" statement which does not
+ /// necessarily require an insertion point or debug information;
+ /// typically because the statement amounts to a jump or a container
+ /// of other statements.
+ ///
+ /// \return True if the statement was handled.
+ bool EmitSimpleStmt(const Stmt *S);
+
RValue EmitCompoundStmt(const CompoundStmt &S, bool GetLast = false,
llvm::Value *AggLoc = 0, bool isAggVol = false);
@@ -373,8 +385,8 @@ public:
void EmitForStmt(const ForStmt &S);
void EmitReturnStmt(const ReturnStmt &S);
void EmitDeclStmt(const DeclStmt &S);
- void EmitBreakStmt();
- void EmitContinueStmt();
+ void EmitBreakStmt(const BreakStmt &S);
+ void EmitContinueStmt(const ContinueStmt &S);
void EmitSwitchStmt(const SwitchStmt &S);
void EmitDefaultStmt(const DefaultStmt &S);
void EmitCaseStmt(const CaseStmt &S);