eliminate EmitAnyExpr, inlining it and simplifying it into its only caller.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41468 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGStmt.cpp b/CodeGen/CGStmt.cpp
index 32d5f47..04c9c1d 100644
--- a/CodeGen/CGStmt.cpp
+++ b/CodeGen/CGStmt.cpp
@@ -28,10 +28,15 @@
switch (S->getStmtClass()) {
default:
- // Must be an expression in a stmt context. Emit the value and ignore the
- // result.
+ // Must be an expression in a stmt context. Emit the value (to get
+ // side-effects) and ignore the result.
if (const Expr *E = dyn_cast<Expr>(S)) {
- EmitAnyExpr(E, false);
+ if (!hasAggregateLLVMType(E->getType()))
+ EmitScalarExpr(E);
+ else if (E->getType()->isComplexType())
+ EmitComplexExpr(E);
+ else
+ EmitAggExpr(E, 0, false);
} else {
printf("Unimplemented stmt!\n");
S->dump();