summaryrefslogtreecommitdiffstats
path: root/src/code.l
diff options
context:
space:
mode:
authorSergio Oller <sergioller@gmail.com>2013-09-14 18:06:06 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-09-28 22:05:33 (GMT)
commite835d4b28e1db3bdcdf3bfa718bc85445587ccd9 (patch)
tree074cf95073900a2514e1b67ce0f9db84a879cc95 /src/code.l
parent54f60c116bdb22b6ec5a11ced9888ebe2785eb2b (diff)
downloadDoxygen-e835d4b28e1db3bdcdf3bfa718bc85445587ccd9.zip
Doxygen-e835d4b28e1db3bdcdf3bfa718bc85445587ccd9.tar.gz
Doxygen-e835d4b28e1db3bdcdf3bfa718bc85445587ccd9.tar.bz2
Bug 707641 - `FILTER_SOURCE_FILES=YES` required to build CALL_GRAPHS
https://bugzilla.gnome.org/show_bug.cgi?id=707641 Add references if the file is filtered, as the parser does not know whether we are insideBody or not.
Diffstat (limited to 'src/code.l')
-rw-r--r--src/code.l22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/code.l b/src/code.l
index 693a20f..2417bf9 100644
--- a/src/code.l
+++ b/src/code.l
@@ -123,6 +123,7 @@ static bool g_lexInit = FALSE;
static QStack<int> g_classScopeLengthStack;
static Definition *g_searchCtx;
+static bool g_collectXRefs;
// context for an Objective-C method call
struct ObjCCallCtx
@@ -885,7 +886,7 @@ static bool getLinkInScope(const QCString &c, // scope
// g_currentDefinition,g_currentMemberDef,g_insideBody);
if (g_currentDefinition && g_currentMemberDef &&
- md!=g_currentMemberDef && g_insideBody)
+ md!=g_currentMemberDef && g_insideBody && g_collectXRefs)
{
addDocCrossReference(g_currentMemberDef,md);
}
@@ -1018,7 +1019,8 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
Definition *d = md->getOuterScope()==Doxygen::globalScope ?
md->getFileDef() : md->getOuterScope();
if (md->getGroupDef()) d = md->getGroupDef();
- if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef)
+ if (d && d->isLinkable() && md->isLinkable() &&
+ g_currentMemberDef && g_collectXRefs)
{
addDocCrossReference(g_currentMemberDef,md);
}
@@ -1071,7 +1073,7 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,const char *clName
}
writeMultiLineCodeLink(ol,md,text);
addToSearchIndex(clName);
- if (g_currentMemberDef)
+ if (g_currentMemberDef && g_collectXRefs)
{
addDocCrossReference(g_currentMemberDef,md);
}
@@ -1127,7 +1129,7 @@ static bool generateClassMemberLink(CodeOutputInterface &ol,MemberDef *xmd,const
{
// add usage reference
if (g_currentDefinition && g_currentMemberDef &&
- /*xmd!=g_currentMemberDef &&*/ g_insideBody)
+ /*xmd!=g_currentMemberDef &&*/ g_insideBody && g_collectXRefs)
{
addDocCrossReference(g_currentMemberDef,xmd);
}
@@ -1504,7 +1506,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
if (ctx->method && ctx->method->isLinkable())
{
writeMultiLineCodeLink(*g_code,ctx->method,pName->data());
- if (g_currentMemberDef)
+ if (g_currentMemberDef && g_collectXRefs)
{
addDocCrossReference(g_currentMemberDef,ctx->method);
}
@@ -1583,7 +1585,7 @@ static void writeObjCMethodCall(ObjCCallCtx *ctx)
else if (ctx->objectVar && ctx->objectVar->isLinkable()) // object is class variable
{
writeMultiLineCodeLink(*g_code,ctx->objectVar,pObject->data());
- if (g_currentMemberDef)
+ if (g_currentMemberDef && g_collectXRefs)
{
addDocCrossReference(g_currentMemberDef,ctx->objectVar);
}
@@ -3537,9 +3539,10 @@ void resetCCodeParserState()
}
void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
- SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
- int startLine,int endLine,bool inlineFragment,
- MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx)
+ SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
+ int startLine,int endLine,bool inlineFragment,
+ MemberDef *memberDef,bool showLineNumbers,Definition *searchCtx,
+ bool collectXRefs)
{
//printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
// exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>");
@@ -3555,6 +3558,7 @@ void parseCCode(CodeOutputInterface &od,const char *className,const QCString &s,
g_currentFontClass = 0;
g_needsTermination = FALSE;
g_searchCtx = searchCtx;
+ g_collectXRefs = collectXRefs;
g_inFunctionTryBlock = FALSE;
if (endLine!=-1)
g_inputLines = endLine+1;