aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-17 00:04:06 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-17 00:04:06 +0000
commit025452fa0eda63e150cfaeebe64f0a19c96b3a06 (patch)
tree187c0527f4fdd7743381dc30f67fc6bfa7852c07 /lib/AST/Stmt.cpp
parent363c184139e26ea38223b477ad64ee67b22bb9a7 (diff)
PCH support for the first batch of statements, including null,
compound, case, default, if, switch, and break statements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index ce55fae87e..8e2cf861f8 100644
--- a/lib/AST/Stmt.cpp
+++ b/lib/AST/Stmt.cpp
@@ -96,6 +96,14 @@ bool Stmt::CollectingStats(bool enable) {
return StatSwitch;
}
+void CompoundStmt::setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts) {
+ if (this->Body)
+ C.Deallocate(Body);
+ this->NumStmts = NumStmts;
+
+ Body = new (C) Stmt*[NumStmts];
+ memcpy(Body, Stmts, sizeof(Stmt *) * NumStmts);
+}
const char *LabelStmt::getName() const {
return getID()->getName();