Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
6a60477b
Commit
6a60477b
authored
Jul 18, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More robust extraction of scope information from tag files
parent
3a5e6ac7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
definition.cpp
src/definition.cpp
+12
-4
doxygen.cpp
src/doxygen.cpp
+13
-11
No files found.
src/definition.cpp
View file @
6a60477b
...
...
@@ -1362,13 +1362,21 @@ QCString Definition::qualifiedName() const
return
m_impl
->
qualifiedName
;
};
void
Definition
::
setOuterScope
(
Definition
*
d
)
void
Definition
::
setOuterScope
(
Definition
*
d
)
{
//printf("%s::setOuterScope(%s)\n",name().data(),d?d->name().data():"<none>");
if
(
m_impl
->
outerScope
!=
d
)
{
Definition
*
p
=
m_impl
->
outerScope
;
bool
found
=
false
;
// make sure that we are not creating a recursive scope relation.
while
(
p
&&
!
found
)
{
found
=
(
p
==
d
);
p
=
p
->
m_impl
->
outerScope
;
}
if
(
!
found
)
{
m_impl
->
qualifiedName
.
resize
(
0
);
// flush cached scope name
m_impl
->
outerScope
=
d
;
m_impl
->
outerScope
=
d
;
}
m_impl
->
hidden
=
m_impl
->
hidden
||
d
->
isHidden
();
}
...
...
src/doxygen.cpp
View file @
6a60477b
...
...
@@ -551,7 +551,7 @@ static void addSTLClasses(EntryNav *rootNav)
//----------------------------------------------------------------------------
static
Definition
*
findScopeFromQualifiedName
(
Definition
*
startScope
,
const
QCString
&
n
,
FileDef
*
fileScope
=
0
);
FileDef
*
fileScope
,
TagInfo
*
tagInfo
);
static
void
addPageToContext
(
PageDef
*
pd
,
EntryNav
*
rootNav
)
{
...
...
@@ -564,7 +564,7 @@ static void addPageToContext(PageDef *pd,EntryNav *rootNav)
}
scope
=
stripAnonymousNamespaceScope
(
scope
);
scope
+=
"::"
+
pd
->
name
();
Definition
*
d
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
scope
);
Definition
*
d
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
scope
,
0
,
rootNav
->
tagInfo
()
);
if
(
d
)
{
pd
->
setPageScope
(
d
);
...
...
@@ -708,7 +708,7 @@ static void findGroupScope(EntryNav *rootNav)
}
scope
=
stripAnonymousNamespaceScope
(
scope
);
scope
+=
"::"
+
gd
->
name
();
Definition
*
d
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
scope
);
Definition
*
d
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
scope
,
0
,
rootNav
->
tagInfo
()
);
if
(
d
)
{
gd
->
setGroupScope
(
d
);
...
...
@@ -996,7 +996,8 @@ static Definition *findScope(Entry *root,int level=0)
* full qualified name \a name. Creates an artificial scope if the scope is
* not found and set the parent/child scope relation if the scope is found.
*/
static
Definition
*
buildScopeFromQualifiedName
(
const
QCString
name
,
int
level
,
SrcLangExt
lang
,
TagInfo
*
tagInfo
)
static
Definition
*
buildScopeFromQualifiedName
(
const
QCString
name
,
int
level
,
SrcLangExt
lang
,
TagInfo
*
tagInfo
)
{
//printf("buildScopeFromQualifiedName(%s) level=%d\n",name.data(),level);
int
i
=
0
;
...
...
@@ -1018,7 +1019,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name,int level,Src
{
innerScope
=
cd
;
}
else
if
(
nd
==
0
&&
cd
==
0
)
// scope is not known
!
else
if
(
nd
==
0
&&
cd
==
0
&&
fullScope
.
find
(
'<'
)
==-
1
)
// scope is not known and could be a namespace
!
{
// introduce bogus namespace
//printf("++ adding dummy namespace %s to %s tagInfo=%p\n",nsName.data(),prevScope->name().data(),tagInfo);
...
...
@@ -1047,7 +1048,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name,int level,Src
}
static
Definition
*
findScopeFromQualifiedName
(
Definition
*
startScope
,
const
QCString
&
n
,
FileDef
*
fileScope
)
FileDef
*
fileScope
,
TagInfo
*
tagInfo
)
{
//printf("<findScopeFromQualifiedName(%s,%s)\n",startScope ? startScope->name().data() : 0, n.data());
Definition
*
resultScope
=
startScope
;
...
...
@@ -1080,7 +1081,7 @@ static Definition *findScopeFromQualifiedName(Definition *startScope,const QCStr
for
(
ni
.
toFirst
();((
nd
=
ni
.
current
())
&&
resultScope
==
0
);
++
ni
)
{
// restart search within the used namespace
resultScope
=
findScopeFromQualifiedName
(
nd
,
n
,
fileScope
);
resultScope
=
findScopeFromQualifiedName
(
nd
,
n
,
fileScope
,
tagInfo
);
}
if
(
resultScope
)
{
...
...
@@ -1112,7 +1113,8 @@ static Definition *findScopeFromQualifiedName(Definition *startScope,const QCStr
// so use this instead.
QCString
fqn
=
QCString
(
ui
.
currentKey
())
+
scope
.
right
(
scope
.
length
()
-
p
);
resultScope
=
buildScopeFromQualifiedName
(
fqn
,
fqn
.
contains
(
"::"
),
startScope
->
getLanguage
(),
0
);
resultScope
=
buildScopeFromQualifiedName
(
fqn
,
fqn
.
contains
(
"::"
),
startScope
->
getLanguage
(),
0
);
//printf("Creating scope from fqn=%s result %p\n",fqn.data(),resultScope);
if
(
resultScope
)
{
...
...
@@ -1420,7 +1422,7 @@ static void resolveClassNestingRelations()
//printf("processing=%s, iteration=%d\n",cd->name().data(),iteration);
// also add class to the correct structural context
Definition
*
d
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
name
,
cd
->
getFileDef
());
name
,
cd
->
getFileDef
()
,
0
);
if
(
d
)
{
//printf("****** adding %s to scope %s in iteration %d\n",cd->name().data(),d->name().data(),iteration);
...
...
@@ -1788,7 +1790,7 @@ static void buildNamespaceList(EntryNav *rootNav)
Doxygen
::
namespaceSDict
->
inSort
(
fullName
,
nd
);
// also add namespace to the correct structural context
Definition
*
d
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
fullName
);
Definition
*
d
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
fullName
,
0
,
tagInfo
);
//printf("adding namespace %s to context %s\n",nd->name().data(),d?d->name().data():"<none>");
if
(
d
==
0
)
// we didn't find anything, create the scope artificially
// anyway, so we can at least relate scopes properly.
...
...
@@ -4823,7 +4825,7 @@ static bool findClassRelation(
int
si
=
baseClassName
.
findRev
(
"::"
);
if
(
si
!=-
1
)
// class is nested
{
Definition
*
sd
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
baseClassName
.
left
(
si
));
Definition
*
sd
=
findScopeFromQualifiedName
(
Doxygen
::
globalScope
,
baseClassName
.
left
(
si
)
,
0
,
rootNav
->
tagInfo
()
);
if
(
sd
==
0
||
sd
==
Doxygen
::
globalScope
)
// outer scope not found
{
baseClass
->
setArtificial
(
TRUE
);
// see bug678139
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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