summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderStmt.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/ASTReaderStmt.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/ASTReaderStmt.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderStmt.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index 93664452d92..9c6d4b96dd8 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -239,6 +239,9 @@ void ASTStmtReader::VisitSwitchStmt(SwitchStmt *S) {
S->setCond(Reader.ReadSubExpr());
S->setBody(Reader.ReadSubStmt());
S->setSwitchLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ if (Record[Idx++])
+ S->setAllEnumCasesCovered();
+
SwitchCase *PrevSC = 0;
for (unsigned N = Record.size(); Idx != N; ++Idx) {
SwitchCase *SC = Reader.getSwitchCaseWithID(Record[Idx]);
OpenPOWER on IntegriCloud