summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterStmt.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-09-09 00:05:53 +0000
committerTed Kremenek <kremenek@apple.com>2010-09-09 00:05:53 +0000
commitc42f34515794b4cb5881d3b63a49e58111d0a46f (patch)
treee6d72bd581f368ff04bcc00bb0432e074693bb80 /clang/lib/Serialization/ASTWriterStmt.cpp
parenta5614c5fe84ce3ed9868a80972c7afb446c4e38d (diff)
downloadbcm5719-llvm-c42f34515794b4cb5881d3b63a49e58111d0a46f.tar.gz
bcm5719-llvm-c42f34515794b4cb5881d3b63a49e58111d0a46f.zip
When building SwitchStmts in Sema, record whether all the enum values of a switch(enum) where
covered by individual case statements. Flow-based analyses may wish to consult this information, and recording this in the AST allows us to obviate reconstructing this information later when we build the CFG. llvm-svn: 113447
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterStmt.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index 403311b8c1a..6ea2c4bd0c0 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -233,6 +233,7 @@ void ASTStmtWriter::VisitSwitchStmt(SwitchStmt *S) {
Writer.AddStmt(S->getCond());
Writer.AddStmt(S->getBody());
Writer.AddSourceLocation(S->getSwitchLoc(), Record);
+ Record.push_back(S->isAllEnumCasesCovered());
for (SwitchCase *SC = S->getSwitchCaseList(); SC;
SC = SC->getNextSwitchCase())
Record.push_back(Writer.RecordSwitchCaseID(SC));
OpenPOWER on IntegriCloud