зеркало из https://github.com/microsoft/clang-1.git
Ensure an insertion point at the end of a statement-expression.
Fixes PR8967. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
48aef3625a
Коммит
8d3d6c9355
|
@ -368,6 +368,7 @@ void AggExprEmitter::VisitBinComma(const BinaryOperator *E) {
|
|||
|
||||
void AggExprEmitter::VisitStmtExpr(const StmtExpr *E) {
|
||||
CGF.EmitCompoundStmt(*E->getSubStmt(), true, Dest);
|
||||
CGF.EnsureInsertPoint();
|
||||
}
|
||||
|
||||
void AggExprEmitter::VisitBinaryOperator(const BinaryOperator *E) {
|
||||
|
|
|
@ -313,8 +313,7 @@ ComplexPairTy ComplexExprEmitter::VisitExpr(Expr *E) {
|
|||
ComplexPairTy ComplexExprEmitter::
|
||||
VisitImaginaryLiteral(const ImaginaryLiteral *IL) {
|
||||
llvm::Value *Imag = CGF.EmitScalarExpr(IL->getSubExpr());
|
||||
return
|
||||
ComplexPairTy(llvm::Constant::getNullValue(Imag->getType()), Imag);
|
||||
return ComplexPairTy(llvm::Constant::getNullValue(Imag->getType()), Imag);
|
||||
}
|
||||
|
||||
|
||||
|
@ -326,7 +325,9 @@ ComplexPairTy ComplexExprEmitter::VisitCallExpr(const CallExpr *E) {
|
|||
}
|
||||
|
||||
ComplexPairTy ComplexExprEmitter::VisitStmtExpr(const StmtExpr *E) {
|
||||
return CGF.EmitCompoundStmt(*E->getSubStmt(), true).getComplexVal();
|
||||
RValue result = CGF.EmitCompoundStmt(*E->getSubStmt(), true);
|
||||
CGF.EnsureInsertPoint();
|
||||
return result.getComplexVal();
|
||||
}
|
||||
|
||||
/// EmitComplexToComplexCast - Emit a cast from complex value Val to DestType.
|
||||
|
@ -635,7 +636,6 @@ ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) {
|
|||
|
||||
ComplexPairTy ComplexExprEmitter::VisitBinComma(const BinaryOperator *E) {
|
||||
CGF.EmitIgnoredExpr(E->getLHS());
|
||||
CGF.EnsureInsertPoint();
|
||||
return Visit(E->getRHS());
|
||||
}
|
||||
|
||||
|
|
|
@ -1204,8 +1204,10 @@ Value *ScalarExprEmitter::EmitCastExpr(CastExpr *CE) {
|
|||
}
|
||||
|
||||
Value *ScalarExprEmitter::VisitStmtExpr(const StmtExpr *E) {
|
||||
return CGF.EmitCompoundStmt(*E->getSubStmt(),
|
||||
!E->getType()->isVoidType()).getScalarVal();
|
||||
RValue value = CGF.EmitCompoundStmt(*E->getSubStmt(),
|
||||
!E->getType()->isVoidType());
|
||||
CGF.EnsureInsertPoint();
|
||||
return value.getScalarVal();
|
||||
}
|
||||
|
||||
Value *ScalarExprEmitter::VisitBlockDeclRefExpr(const BlockDeclRefExpr *E) {
|
||||
|
|
|
@ -166,3 +166,11 @@ void f15() {
|
|||
// CHECK-NOT: load
|
||||
// CHECK: ret void
|
||||
}
|
||||
|
||||
// PR8967: this was crashing
|
||||
// CHECK: define void @f16()
|
||||
void f16() {
|
||||
__extension__({ goto lbl; });
|
||||
lbl:
|
||||
;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче