diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-06-29 20:32:15 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-06-29 20:32:15 (GMT) |
commit | 3e9d9386950cc67d155a920cf8483c4d5bdcec3c (patch) | |
tree | 96383bcb228e96d52f42552cb4273a6eb2e323c6 | |
parent | 6b1543bbc7001cc67dbe55c7109c4c73fbb5f300 (diff) | |
download | Doxygen-3e9d9386950cc67d155a920cf8483c4d5bdcec3c.zip Doxygen-3e9d9386950cc67d155a920cf8483c4d5bdcec3c.tar.gz Doxygen-3e9d9386950cc67d155a920cf8483c4d5bdcec3c.tar.bz2 |
Fixed anothing compilation issue when use_libclang was not enabled
-rw-r--r-- | src/doxygen.cpp | 18 | ||||
-rw-r--r-- | src/doxygen.h | 1 | ||||
-rw-r--r-- | src/filedef.cpp | 6 | ||||
-rw-r--r-- | src/scanner.l | 28 |
4 files changed, 23 insertions, 30 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 01b47f5..089110b 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -160,6 +160,7 @@ QCString Doxygen::spaces; bool Doxygen::generatingXmlOutput = FALSE; GenericsSDict *Doxygen::genericsDict; DefinesPerFileList Doxygen::macroDefinitions; +bool Doxygen::clangAssistedParsing = FALSE; // locally accessible globals static std::unordered_map< std::string, const Entry* > g_classEntries; @@ -7477,8 +7478,7 @@ static void generateFileSources() if (!Doxygen::inputNameLinkedMap->empty()) { #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing) + if (Doxygen::clangAssistedParsing) { QDict<void> g_processedFiles(10007); @@ -9063,11 +9063,6 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser, FileDef *fd,const char *fn, bool sameTu,QStrList &filesInSameTu) { -#if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); -#else - static bool clangAssistedParsing = FALSE; -#endif QCString fileName=fn; QCString extension; int ei = fileName.findRev('.'); @@ -9114,7 +9109,7 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser, convBuf.addChar('\0'); - if (clangAssistedParsing && !sameTu) + if (Doxygen::clangAssistedParsing && !sameTu) { fd->getAllIncludeFilesRecursively(filesInSameTu); } @@ -9130,8 +9125,7 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser, static void parseFiles(const std::shared_ptr<Entry> &root) { #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing) + if (Doxygen::clangAssistedParsing) { QDict<void> g_processedFiles(10007); @@ -10707,6 +10701,10 @@ void parseInput() { atexit(exitDoxygen); +#if USE_LIBCLANG + Doxygen::clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); +#endif + // we would like to show the versionString earlier, but we first have to handle the configuration file // to know the value of the QUIET setting. QCString versionString = getFullVersion(); diff --git a/src/doxygen.h b/src/doxygen.h index 2978052..e5757c3 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -152,6 +152,7 @@ class Doxygen static bool generatingXmlOutput; static GenericsSDict *genericsDict; static DefinesPerFileList macroDefinitions; + static bool clangAssistedParsing; }; void initDoxygen(); diff --git a/src/filedef.cpp b/src/filedef.cpp index 18e5cef..08f022b 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -1212,8 +1212,7 @@ void FileDefImpl::writeSource(OutputList &ol,bool sameTu,QStrList &filesInSameTu (void)sameTu; (void)filesInSameTu; #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing && + if (Doxygen::clangAssistedParsing && (getLanguage()==SrcLangExt_Cpp || getLanguage()==SrcLangExt_ObjC)) { ol.startCodeFragment(); @@ -1276,8 +1275,7 @@ void FileDefImpl::parseSource(bool sameTu,QStrList &filesInSameTu) (void)sameTu; (void)filesInSameTu; #if USE_LIBCLANG - static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING); - if (clangAssistedParsing && + if (Doxygen::clangAssistedParsing && (getLanguage()==SrcLangExt_Cpp || getLanguage()==SrcLangExt_ObjC)) { if (!sameTu) diff --git a/src/scanner.l b/src/scanner.l index cc5428d..d26a9b2 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2045,7 +2045,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) BEGIN(FindMembers); } <FindMembers,FindMemberName>{SCOPENAME} { - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -2348,7 +2348,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) */ <Define>{ID} { //printf("Define '%s' without args\n",yytext); - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -3463,7 +3463,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } <Sharp>. { yyextra->current->type += *yytext ; } <FindFields>{ID} { - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -5334,7 +5334,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } <CompoundName>{SCOPENAME} { yyextra->current->name = yytext ; - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -5399,7 +5399,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}) } } <ClassVar>{ID} { - if (Config_getBool(CLANG_ASSISTED_PARSING) && (yyextra->insideCpp || yyextra->insideObjC)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { yyextra->current->id = ClangParser::instance()->lookup(yyextra->yyLineNr,yytext); } @@ -7255,19 +7255,15 @@ static void parseMain(yyscan_t yyscanner, yyextra->yyBegColNr = 0; yyextra->yyFileName = fileName; setContext(yyscanner); - if (Config_getBool(CLANG_ASSISTED_PARSING)) + if (Doxygen::clangAssistedParsing && (yyextra->insideCpp || yyextra->insideObjC)) { - bool processWithClang = yyextra->insideCpp || yyextra->insideObjC; - if (processWithClang) + if (!sameTranslationUnit) // new file { - if (!sameTranslationUnit) // new file - { - ClangParser::instance()->start(fileName,filesInSameTranslationUnit); - } - else - { - ClangParser::instance()->switchToFile(fileName); - } + ClangParser::instance()->start(fileName,filesInSameTranslationUnit); + } + else + { + ClangParser::instance()->switchToFile(fileName); } } rt->lang = yyextra->language; |