diff options
author | Steve Naroff <snaroff@apple.com> | 2009-03-13 15:38:40 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-03-13 15:38:40 +0000 |
commit | 846b1ec40f829bdfc5047128a9131e66a1a6aaf7 (patch) | |
tree | d69ae62d2031b61504a148df158e305136f65985 /clang/lib/Sema/SemaDecl.cpp | |
parent | ec94f08dcea55cc18e2c7d9692b555c7286b13c6 (diff) | |
download | bcm5719-llvm-846b1ec40f829bdfc5047128a9131e66a1a6aaf7.tar.gz bcm5719-llvm-846b1ec40f829bdfc5047128a9131e66a1a6aaf7.zip |
Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).
Will replace with something better today...
llvm-svn: 66893
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index f3983aee453..51b2b853a8b 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2631,8 +2631,6 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclTy *D) { Decl *decl = static_cast<Decl*>(D); FunctionDecl *FD = cast<FunctionDecl>(decl); - ActiveScope = FnBodyScope; - // See if this is a redefinition. const FunctionDecl *Definition; if (FD->getBody(Definition)) { @@ -2784,29 +2782,17 @@ Sema::DeclTy *Sema::ActOnFinishFunctionBody(DeclTy *D, StmtArg BodyArg) { return 0; } PopDeclContext(); - - // FIXME: Temporary hack to workaround nested C++ functions. For example: - // class C2 { - // void f() { - // class LC1 { - // int m() { return 1; } - // }; - // } - // }; - if (ActiveScope == 0) - return D; - // Verify and clean out per-function state. - bool HaveLabels = !ActiveScope->LabelMap.empty(); + bool HaveLabels = !LabelMap.empty(); // Check goto/label use. - for (Scope::LabelMapTy::iterator I = ActiveScope->LabelMap.begin(), - E = ActiveScope->LabelMap.end(); I != E; ++I) { + for (llvm::DenseMap<IdentifierInfo*, LabelStmt*>::iterator + I = LabelMap.begin(), E = LabelMap.end(); I != E; ++I) { // Verify that we have no forward references left. If so, there was a goto // or address of a label taken, but no definition of it. Label fwd // definitions are indicated with a null substmt. - LabelStmt *L = static_cast<LabelStmt*>(I->second); - if (L->getSubStmt() == 0) { + if (I->second->getSubStmt() == 0) { + LabelStmt *L = I->second; // Emit error. Diag(L->getIdentLoc(), diag::err_undeclared_label_use) << L->getName(); @@ -2828,8 +2814,7 @@ Sema::DeclTy *Sema::ActOnFinishFunctionBody(DeclTy *D, StmtArg BodyArg) { } } } - // This reset is for both functions and methods. - ActiveScope = 0; + LabelMap.clear(); if (!Body) return D; |