summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-09-06 01:13:30 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-09-06 01:13:30 +0000
commitbc8c734fa715cbad78d76707d0699366e28b46ec (patch)
tree05cba5651685b736bdddd432e1707779e985b608
parent8227b9f69c4e1ff8d05fabe08e62f3c91ee42ade (diff)
downloadbcm5719-llvm-bc8c734fa715cbad78d76707d0699366e28b46ec.tar.gz
bcm5719-llvm-bc8c734fa715cbad78d76707d0699366e28b46ec.zip
Reduce stack usage of TreeTransform.
Without this patch, TreeTransform::TransformExpr uses a ridiculous amount of stack space (around 5000 bytes). Preventing inlining brings the stack usage down to something sane. On a testcase I have, on my computer, this allows changing -ftemplate-depth from 210 to around 750 before we crash. I'm not sure I should commit the testcase, though: I don't want to cause test failures on platforms with less stack space available. <rdar://problem/14098189>. llvm-svn: 190114
-rw-r--r--clang/lib/Sema/TreeTransform.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 165a1aff3b4..cd0ffdd8e96 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -598,14 +598,19 @@ public:
ExprResult TransformDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *E,
bool IsAddressOfOperand);
+// FIXME: We use LLVM_ATTRIBUTE_NOINLINE because inlining causes a ridiculous
+// amount of stack usage with clang.
#define STMT(Node, Parent) \
+ LLVM_ATTRIBUTE_NOINLINE \
StmtResult Transform##Node(Node *S);
#define EXPR(Node, Parent) \
+ LLVM_ATTRIBUTE_NOINLINE \
ExprResult Transform##Node(Node *E);
#define ABSTRACT_STMT(Stmt)
#include "clang/AST/StmtNodes.inc"
#define OPENMP_CLAUSE(Name, Class) \
+ LLVM_ATTRIBUTE_NOINLINE \
OMPClause *Transform ## Class(Class *S);
#include "clang/Basic/OpenMPKinds.def"
OpenPOWER on IntegriCloud