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
4ff3ee2f
Commit
4ff3ee2f
authored
Aug 05, 2010
by
Roberto Raggi
Committed by
Oswald Buddenhagen
Aug 05, 2010
Browse files
Use Prototype instead of Function.
parent
9aa991d6
Changes
11
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/LookupContext.cpp
View file @
4ff3ee2f
...
...
@@ -280,7 +280,7 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
}
}
}
else
if
(
scope
->
is
Function
Scope
())
{
}
else
if
(
scope
->
is
Prototype
Scope
())
{
Function
*
fun
=
scope
->
owner
()
->
asFunction
();
bindings
()
->
lookupInScope
(
name
,
fun
->
members
(),
&
candidates
,
/*templateId = */
0
,
/*binding=*/
0
);
...
...
src/libs/cplusplus/ResolveExpression.cpp
View file @
4ff3ee2f
...
...
@@ -316,7 +316,7 @@ void ResolveExpression::thisObject()
{
Scope
*
scope
=
_scope
;
for
(;
scope
;
scope
=
scope
->
enclosingScope
())
{
if
(
scope
->
is
Function
Scope
())
{
if
(
scope
->
is
Prototype
Scope
())
{
Function
*
fun
=
scope
->
owner
()
->
asFunction
();
if
(
Scope
*
cscope
=
scope
->
enclosingClassScope
())
{
Class
*
klass
=
cscope
->
owner
()
->
asClass
();
...
...
src/plugins/cppeditor/cppeditor.cpp
View file @
4ff3ee2f
...
...
@@ -1078,10 +1078,10 @@ void CPPEditor::switchDeclarationDefinition()
Symbol
*
lastVisibleSymbol
=
thisDocument
->
lastVisibleSymbolAt
(
line
,
column
);
Scope
*
functionScope
=
0
;
if
(
scope
->
is
Function
Scope
())
if
(
scope
->
is
Prototype
Scope
())
functionScope
=
scope
;
else
functionScope
=
scope
->
enclosing
Function
Scope
();
functionScope
=
scope
->
enclosing
Prototype
Scope
();
if
(
!
functionScope
&&
lastVisibleSymbol
)
{
if
(
Function
*
def
=
lastVisibleSymbol
->
asFunction
())
...
...
src/plugins/cppeditor/cpplocalsymbols.cpp
View file @
4ff3ee2f
...
...
@@ -130,7 +130,7 @@ protected:
Scope
*
scope
=
_doc
->
scopeAt
(
line
,
column
);
while
(
scope
)
{
if
(
scope
->
is
Function
Scope
())
{
if
(
scope
->
is
Prototype
Scope
())
{
Function
*
fun
=
scope
->
owner
()
->
asFunction
();
if
(
findMember
(
fun
->
members
(),
ast
,
line
,
column
))
return
false
;
...
...
@@ -176,7 +176,7 @@ protected:
Scope
*
scope
=
_doc
->
scopeAt
(
line
,
column
);
while
(
scope
)
{
if
(
scope
->
is
Function
Scope
())
{
if
(
scope
->
is
Prototype
Scope
())
{
Function
*
fun
=
scope
->
owner
()
->
asFunction
();
if
(
findMember
(
fun
->
members
(),
ast
,
line
,
column
))
return
false
;
...
...
src/plugins/cpptools/abstracteditorsupport.cpp
View file @
4ff3ee2f
...
...
@@ -68,7 +68,7 @@ QString AbstractEditorSupport::functionAt(const CppModelManagerInterface *modelM
return
QString
();
if
(
const
CPlusPlus
::
Symbol
*
symbol
=
document
->
lastVisibleSymbolAt
(
line
,
column
))
if
(
const
CPlusPlus
::
Scope
*
scope
=
symbol
->
scope
())
if
(
const
CPlusPlus
::
Scope
*
functionScope
=
scope
->
enclosing
Function
Scope
())
if
(
const
CPlusPlus
::
Scope
*
functionScope
=
scope
->
enclosing
Prototype
Scope
())
if
(
const
CPlusPlus
::
Symbol
*
function
=
functionScope
->
owner
())
{
const
CPlusPlus
::
Overview
o
;
QString
rc
=
o
.
prettyName
(
function
->
name
());
...
...
src/plugins/cpptools/cppcodecompletion.cpp
View file @
4ff3ee2f
...
...
@@ -1068,7 +1068,7 @@ void CppCodeCompletion::globalCompletion(Scope *currentScope)
}
}
}
}
else
if
(
scope
->
is
Function
Scope
()
||
scope
->
isClassScope
()
||
scope
->
isNamespaceScope
())
{
}
else
if
(
scope
->
is
Prototype
Scope
()
||
scope
->
isClassScope
()
||
scope
->
isNamespaceScope
())
{
currentBinding
=
context
.
lookupType
(
scope
->
owner
());
break
;
}
...
...
@@ -1079,7 +1079,7 @@ void CppCodeCompletion::globalCompletion(Scope *currentScope)
for
(
unsigned
i
=
0
;
i
<
scope
->
symbolCount
();
++
i
)
{
addCompletionItem
(
scope
->
symbolAt
(
i
));
}
}
else
if
(
scope
->
is
Function
Scope
())
{
}
else
if
(
scope
->
is
Prototype
Scope
())
{
Function
*
fun
=
scope
->
owner
()
->
asFunction
();
for
(
unsigned
i
=
0
;
i
<
fun
->
argumentCount
();
++
i
)
{
addCompletionItem
(
fun
->
argumentAt
(
i
));
...
...
src/plugins/debugger/watchutils.cpp
View file @
4ff3ee2f
...
...
@@ -120,7 +120,7 @@ QDebug operator<<(QDebug d, const Scope &scope)
str
<<
" enum"
;
if
(
scope
.
isBlockScope
())
str
<<
" block"
;
if
(
scope
.
is
Function
Scope
())
if
(
scope
.
is
Prototype
Scope
())
str
<<
" function"
;
if
(
scope
.
isPrototypeScope
())
str
<<
" prototype"
;
...
...
@@ -374,7 +374,7 @@ int getUninitializedVariablesI(const CPlusPlus::Snapshot &snapshot,
if
(
CPlusPlus
::
Block
*
block
=
function
->
memberAt
(
0
)
->
asBlock
())
innerMostScope
=
block
->
members
();
}
else
{
if
(
const
CPlusPlus
::
Scope
*
functionScope
=
symbolAtLine
->
enclosing
Function
Scope
())
{
if
(
const
CPlusPlus
::
Scope
*
functionScope
=
symbolAtLine
->
enclosing
Prototype
Scope
())
{
function
=
functionScope
->
owner
()
->
asFunction
();
innerMostScope
=
symbolAtLine
->
isBlock
()
?
symbolAtLine
->
asBlock
()
->
members
()
:
...
...
src/shared/cplusplus/Scope.cpp
View file @
4ff3ee2f
...
...
@@ -118,7 +118,7 @@ Scope *Scope::enclosingEnumScope() const
return
scope
;
}
Scope
*
Scope
::
enclosing
Function
Scope
()
const
Scope
*
Scope
::
enclosing
Prototype
Scope
()
const
{
Scope
*
scope
=
enclosingScope
();
for
(;
scope
;
scope
=
scope
->
enclosingScope
())
{
...
...
@@ -166,11 +166,6 @@ bool Scope::isBlockScope() const
return
false
;
}
bool
Scope
::
isPrototypeScope
()
const
{
return
isFunctionScope
();
}
bool
Scope
::
isObjCClassScope
()
const
{
if
(
_owner
)
...
...
@@ -185,7 +180,7 @@ bool Scope::isObjCProtocolScope() const
return
false
;
}
bool
Scope
::
is
Function
Scope
()
const
bool
Scope
::
is
Prototype
Scope
()
const
{
if
(
_owner
)
return
_owner
->
isFunction
();
...
...
src/shared/cplusplus/Scope.h
View file @
4ff3ee2f
...
...
@@ -87,8 +87,8 @@ public:
/// Returns the enclosing enum scope.
Scope
*
enclosingEnumScope
()
const
;
/// Rerturns the enclosing
function
scope.
Scope
*
enclosing
Function
Scope
()
const
;
/// Rerturns the enclosing
prototype
scope.
Scope
*
enclosing
Prototype
Scope
()
const
;
/// Rerturns the enclosing Block scope.
Scope
*
enclosingBlockScope
()
const
;
...
...
@@ -105,9 +105,6 @@ public:
/// Returns true if this scope's owner is a Block Symbol.
bool
isBlockScope
()
const
;
/// Returns true if this scope's owner is a Function Symbol.
bool
isFunctionScope
()
const
;
/// Returns true if this scope's owner is a Prototype Symbol.
bool
isPrototypeScope
()
const
;
...
...
src/shared/cplusplus/Symbol.cpp
View file @
4ff3ee2f
...
...
@@ -283,15 +283,15 @@ Scope *Symbol::enclosingEnumScope() const
return
_scope
->
enclosingEnumScope
();
}
Scope
*
Symbol
::
enclosing
Function
Scope
()
const
Scope
*
Symbol
::
enclosing
Prototype
Scope
()
const
{
if
(
!
_scope
)
return
0
;
else
if
(
_scope
->
is
Function
Scope
())
else
if
(
_scope
->
is
Prototype
Scope
())
return
_scope
;
return
_scope
->
enclosing
Function
Scope
();
return
_scope
->
enclosing
Prototype
Scope
();
}
Scope
*
Symbol
::
enclosingBlockScope
()
const
...
...
src/shared/cplusplus/Symbol.h
View file @
4ff3ee2f
...
...
@@ -295,8 +295,8 @@ public:
/// Returns the enclosing enum scope.
Scope
*
enclosingEnumScope
()
const
;
/// Returns the enclosing
function
scope.
Scope
*
enclosing
Function
Scope
()
const
;
/// Returns the enclosing
prototype
scope.
Scope
*
enclosing
Prototype
Scope
()
const
;
/// Returns the enclosing Block scope.
Scope
*
enclosingBlockScope
()
const
;
...
...
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