[cfe-commits] r115270 - /cfe/trunk/lib/Analysis/CFG.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Thu Sep 30 20:00:16 PDT 2010
Author: zhongxingxu
Date: Thu Sep 30 22:00:16 2010
New Revision: 115270
URL: http://llvm.org/viewvc/llvm-project?rev=115270&view=rev
Log:
Simplify interface for addLocalScopeForStmt().
Modified:
cfe/trunk/lib/Analysis/CFG.cpp
Modified: cfe/trunk/lib/Analysis/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFG.cpp?rev=115270&r1=115269&r2=115270&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFG.cpp (original)
+++ cfe/trunk/lib/Analysis/CFG.cpp Thu Sep 30 22:00:16 2010
@@ -310,7 +310,7 @@
// Local scopes creation.
LocalScope* createOrReuseLocalScope(LocalScope* Scope);
- LocalScope* addLocalScopeForStmt(Stmt* S, LocalScope* Scope = NULL);
+ void addLocalScopeForStmt(Stmt* S);
LocalScope* addLocalScopeForDeclStmt(DeclStmt* DS, LocalScope* Scope = NULL);
LocalScope* addLocalScopeForVarDecl(VarDecl* VD, LocalScope* Scope = NULL);
@@ -493,11 +493,12 @@
}
/// addLocalScopeForStmt - Add LocalScope to local scopes tree for statement
-/// that should create implicit scope (e.g. if/else substatements). Will reuse
-/// Scope if not NULL.
-LocalScope* CFGBuilder::addLocalScopeForStmt(Stmt* S, LocalScope* Scope) {
+/// that should create implicit scope (e.g. if/else substatements).
+void CFGBuilder::addLocalScopeForStmt(Stmt* S) {
if (!BuildOpts.AddImplicitDtors)
- return Scope;
+ return;
+
+ LocalScope *Scope = 0;
// For compound statement we will be creating explicit scope.
if (CompoundStmt* CS = dyn_cast<CompoundStmt>(S)) {
@@ -509,7 +510,7 @@
if (DeclStmt* DS = dyn_cast<DeclStmt>(SI))
Scope = addLocalScopeForDeclStmt(DS, Scope);
}
- return Scope;
+ return;
}
// For any other statement scope will be implicit and as such will be
@@ -517,8 +518,7 @@
if (LabelStmt* LS = dyn_cast<LabelStmt>(S))
S = LS->getSubStmt();
if (DeclStmt* DS = dyn_cast<DeclStmt>(S))
- Scope = addLocalScopeForDeclStmt(DS, Scope);
- return Scope;
+ addLocalScopeForDeclStmt(DS, 0);
}
/// addLocalScopeForDeclStmt - Add LocalScope for declaration statement. Will
@@ -582,7 +582,7 @@
return;
LocalScope::const_iterator scopeBeginPos = ScopePos;
- addLocalScopeForStmt(S, NULL);
+ addLocalScopeForStmt(S);
addAutomaticObjDtors(ScopePos, scopeBeginPos, S);
}
More information about the cfe-commits
mailing list