aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-01 00:26:45 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-01 00:26:45 +0000
commitb60a77e453d32db0ab1914d28e175c2defc0eb65 (patch)
tree96a5010a106877369b4b5e4ac4973a2fe1fd9c4b /lib/Sema/Sema.cpp
parent64a15230a9e0e030bd761c6848a5876354653ded (diff)
Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function. Indirect gotos trigger the jump-checker regardless, because the conditions there are slightly more elaborate and it's too marginal a case to be worth optimizing. Turns off the jump-checker in a lot of cases in C++. rdar://problem/7702918 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109962 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 815eba051f..a9a4f5290c 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -31,7 +31,10 @@ using namespace clang;
FunctionScopeInfo::~FunctionScopeInfo() { }
void FunctionScopeInfo::Clear(unsigned NumErrors) {
- NeedsScopeChecking = false;
+ HasBranchProtectedScope = false;
+ HasBranchIntoScope = false;
+ HasIndirectGoto = false;
+
LabelMap.clear();
SwitchStack.clear();
Returns.clear();