]> granicus.if.org Git - clang/commit
When creating the CFGBlocks for a switch statement, we now have the "default"
authorTed Kremenek <kremenek@apple.com>
Wed, 13 Feb 2008 22:05:39 +0000 (22:05 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 13 Feb 2008 22:05:39 +0000 (22:05 +0000)
commiteef5a9ac59f4f8b868ef0657ccf6bec81b4fe37a
treede24ba351af8164be55aa32fa7429d1f0b4c5653
parent295222c1f0926d84de77f076e79903523eeb5dbf
When creating the CFGBlocks for a switch statement, we now have the "default"
branch ALWAYS be the last successor for a switch-terminated block. This allows
clients to distinguish cases like the following:

switch(...)
  case XXX:
    switch(...) {
      case YYY: ...
    }

  case ZZZ: ..
}

In this case, the block with "case ZZZ:" is the default block for the inner
switch statement, but that case is associated with the outer switch statement,
and not the inner one. Clients can test for this behavior by checking if a
successor block is the last one (and thus just assume that this is the "default"
case).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47088 91177308-0d34-0410-b5e6-96231b3b80d8
AST/CFG.cpp