diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-11 12:26:02 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-08-11 15:25:18 +0200 |
commit | 354b9712e4655040930a9f18de4e6b4c71dc42d9 (patch) | |
tree | 474bab43aa8a84893f38b8a0552f8071404e6a12 /src/libs/cplusplus/CppDocument.cpp | |
parent | 5accc9664ea247a5b9e1fa6097a04252fb57f01b (diff) | |
download | qt-creator-354b9712e4655040930a9f18de4e6b4c71dc42d9.tar.gz |
Merged ScopedSymbol and Scope.
Diffstat (limited to 'src/libs/cplusplus/CppDocument.cpp')
-rw-r--r-- | src/libs/cplusplus/CppDocument.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index 1e677f85c0..e6197884d2 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -76,13 +76,13 @@ public: } protected: - bool process(ScopedSymbol *symbol) + bool process(Scope *symbol) { if (! _scope) { - Scope *scope = symbol->members(); + Scope *scope = symbol; - for (unsigned i = 0; i < scope->symbolCount(); ++i) { - accept(scope->symbolAt(i)); + for (unsigned i = 0; i < scope->memberCount(); ++i) { + accept(scope->memberAt(i)); if (_scope) return false; @@ -388,14 +388,6 @@ Symbol *Document::globalSymbolAt(unsigned index) const return _globalNamespace->memberAt(index); } -Scope *Document::globalSymbols() const -{ - if (! _globalNamespace) - return 0; - - return _globalNamespace->members(); -} - Namespace *Document::globalNamespace() const { return _globalNamespace; @@ -411,20 +403,20 @@ Scope *Document::scopeAt(unsigned line, unsigned column) FindScopeAt findScopeAt(_translationUnit, line, column); if (Scope *scope = findScopeAt(_globalNamespace)) return scope; - return globalSymbols(); + return globalNamespace(); } Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column) const { - return lastVisibleSymbolAt(line, column, globalSymbols()); + return lastVisibleSymbolAt(line, column, globalNamespace()); } Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column, Scope *scope) const { Symbol *previousSymbol = 0; - for (unsigned i = 0; i < scope->symbolCount(); ++i) { - Symbol *symbol = scope->symbolAt(i); + for (unsigned i = 0; i < scope->memberCount(); ++i) { + Symbol *symbol = scope->memberAt(i); if (symbol->line() > line) break; @@ -432,8 +424,8 @@ Symbol *Document::lastVisibleSymbolAt(unsigned line, unsigned column, Scope *sco } if (previousSymbol) { - if (ScopedSymbol *scoped = previousSymbol->asScopedSymbol()) { - if (Symbol *member = lastVisibleSymbolAt(line, column, scoped->members())) + if (Scope *scope = previousSymbol->asScope()) { + if (Symbol *member = lastVisibleSymbolAt(line, column, scope)) return member; } } @@ -558,7 +550,7 @@ void Document::check(CheckMode mode) semantic.setSkipFunctionBodies(true); _globalNamespace = _control->newNamespace(0); - Scope *globals = _globalNamespace->members(); + Scope *globals = _globalNamespace; if (! _translationUnit->ast()) return; // nothing to do. |