Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
31135d57
Commit
31135d57
authored
May 14, 2010
by
Roberto Raggi
Browse files
More renaming.
parent
a2128885
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/LookupContext.cpp
View file @
31135d57
...
...
@@ -42,6 +42,11 @@
#include
<QtDebug>
namespace
{
const
bool
debug
=
!
qgetenv
(
"CPLUSPLUS_LOOKUPCONTEXT_DEBUG"
).
isEmpty
();
}
using
namespace
CPlusPlus
;
static
void
fullyQualifiedName_helper
(
Symbol
*
symbol
,
QList
<
const
Name
*>
*
names
)
...
...
@@ -162,7 +167,7 @@ ClassOrNamespace *LookupContext::globalNamespace() const
ClassOrNamespace
*
LookupContext
::
lookupType
(
const
Name
*
name
,
Scope
*
scope
)
const
{
if
(
ClassOrNamespace
*
b
=
bindings
()
->
findClassOrNamespac
e
(
scope
->
owner
()))
if
(
ClassOrNamespace
*
b
=
bindings
()
->
lookupTyp
e
(
scope
->
owner
()))
return
b
->
lookupType
(
name
);
return
0
;
...
...
@@ -170,7 +175,7 @@ ClassOrNamespace *LookupContext::lookupType(const Name *name, Scope *scope) cons
ClassOrNamespace
*
LookupContext
::
lookupType
(
Symbol
*
symbol
)
const
{
return
bindings
()
->
findClassOrNamespac
e
(
symbol
);
return
bindings
()
->
lookupTyp
e
(
symbol
);
}
QList
<
Symbol
*>
LookupContext
::
lookup
(
const
Name
*
name
,
Scope
*
scope
)
const
...
...
@@ -194,7 +199,7 @@ QList<Symbol *> LookupContext::lookup(const Name *name, Scope *scope) const
if
(
UsingNamespaceDirective
*
u
=
member
->
asUsingNamespaceDirective
())
{
if
(
Namespace
*
enclosingNamespace
=
u
->
enclosingNamespaceScope
()
->
owner
()
->
asNamespace
())
{
if
(
ClassOrNamespace
*
b
=
bindings
()
->
findClassOrNamespac
e
(
enclosingNamespace
))
{
if
(
ClassOrNamespace
*
b
=
bindings
()
->
lookupTyp
e
(
enclosingNamespace
))
{
if
(
ClassOrNamespace
*
uu
=
b
->
lookupType
(
u
->
name
()))
{
candidates
=
uu
->
lookup
(
name
);
...
...
@@ -224,7 +229,7 @@ QList<Symbol *> LookupContext::lookup(const Name *name, Scope *scope) const
path
.
append
(
name
);
}
if
(
ClassOrNamespace
*
binding
=
bindings
()
->
findClassOrNamespac
e
(
path
))
if
(
ClassOrNamespace
*
binding
=
bindings
()
->
lookupTyp
e
(
path
))
return
binding
->
lookup
(
name
);
}
...
...
@@ -236,7 +241,7 @@ QList<Symbol *> LookupContext::lookup(const Name *name, Scope *scope) const
}
else
if
(
scope
->
isClassScope
()
||
scope
->
isNamespaceScope
()
||
scope
->
isObjCClassScope
()
||
scope
->
isObjCProtocolScope
())
{
if
(
ClassOrNamespace
*
binding
=
bindings
()
->
findClassOrNamespac
e
(
scope
->
owner
()))
if
(
ClassOrNamespace
*
binding
=
bindings
()
->
lookupTyp
e
(
scope
->
owner
()))
return
binding
->
lookup
(
name
);
break
;
...
...
@@ -627,7 +632,7 @@ ClassOrNamespace *CreateBindings::globalNamespace() const
return
_globalNamespace
;
}
ClassOrNamespace
*
CreateBindings
::
findClassOrNamespac
e
(
Symbol
*
symbol
)
ClassOrNamespace
*
CreateBindings
::
lookupTyp
e
(
Symbol
*
symbol
)
{
const
QList
<
const
Name
*>
names
=
LookupContext
::
fullyQualifiedName
(
symbol
);
...
...
@@ -642,7 +647,7 @@ ClassOrNamespace *CreateBindings::findClassOrNamespace(Symbol *symbol)
return
b
;
}
ClassOrNamespace
*
CreateBindings
::
findClassOrNamespac
e
(
const
QList
<
const
Name
*>
&
path
)
ClassOrNamespace
*
CreateBindings
::
lookupTyp
e
(
const
QList
<
const
Name
*>
&
path
)
{
ClassOrNamespace
*
e
=
_globalNamespace
->
findType
(
path
);
return
e
;
...
...
src/libs/cplusplus/LookupContext.h
View file @
31135d57
...
...
@@ -124,11 +124,11 @@ public:
ClassOrNamespace
*
globalNamespace
()
const
;
/// Finds the binding associated to the given symbol.
ClassOrNamespace
*
findClassOrNamespac
e
(
Symbol
*
symbol
);
ClassOrNamespace
*
lookupTyp
e
(
Symbol
*
symbol
);
/// Find the binding with the given path.
/// \internal
ClassOrNamespace
*
findClassOrNamespac
e
(
const
QList
<
const
Name
*>
&
path
);
ClassOrNamespace
*
lookupTyp
e
(
const
QList
<
const
Name
*>
&
path
);
/// Returns the Control that must be used to create temporary symbols.
/// \internal
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment