Permalink
Browse files

Changed configuration mechanism to directly access options in order t…

…o improve performance
  • Loading branch information...
Dimitri van Heesch
Dimitri van Heesch committed Jan 17, 2016
1 parent 4dfc588 commit a93ec7221d1a258f0268e0c081782478372efe0b
Showing with 2,894 additions and 2,648 deletions.
  1. +38 −21 src/CMakeLists.txt
  2. +10 −10 src/cite.cpp
  3. +8 −8 src/clangparser.cpp
  4. +69 −69 src/classdef.cpp
  5. +7 −7 src/classlist.cpp
  6. +12 −12 src/code.l
  7. +3 −3 src/commentcnv.l
  8. +3 −3 src/commentscan.l
  9. +1 −1 src/condparser.cpp
  10. +53 −556 src/config.h
  11. +129 −4 src/configgen.py
  12. +570 −0 src/configimpl.h
  13. +304 −262 src/{config.l → configimpl.l}
  14. +2 −2 src/configoptions.h
  15. +81 −72 src/context.cpp
  16. +1 −1 src/defgen.cpp
  17. +1 −1 src/define.cpp
  18. +19 −19 src/definition.cpp
  19. +2 −2 src/dia.cpp
  20. +2 −2 src/diagram.cpp
  21. +15 −15 src/dirdef.cpp
  22. +37 −37 src/docbookgen.cpp
  23. +11 −11 src/docbookvisitor.cpp
  24. +26 −26 src/docparser.cpp
  25. +11 −11 src/docsets.cpp
  26. +1 −1 src/doctokenizer.l
  27. +59 −59 src/dot.cpp
  28. +189 −189 src/doxygen.cpp
  29. +0 −3 src/doxygen.h
  30. +5 −5 src/eclipsehelp.cpp
  31. +2 −2 src/entry.cpp
  32. +39 −39 src/filedef.cpp
  33. +2 −2 src/filename.cpp
  34. +5 −5 src/formula.cpp
  35. +3 −3 src/fortrancode.l
  36. +3 −3 src/fortranscanner.l
  37. +6 −6 src/ftvhelp.cpp
  38. +26 −26 src/groupdef.cpp
  39. +6 −6 src/htags.cpp
  40. +12 −12 src/htmldocvisitor.cpp
  41. +69 −69 src/htmlgen.cpp
  42. +14 −14 src/htmlhelp.cpp
  43. +4 −4 src/image.cpp
  44. +59 −59 src/index.cpp
  45. +22 −22 src/latexdocvisitor.cpp
  46. +77 −77 src/latexgen.cpp
  47. +14 −14 src/layout.cpp
  48. +2 −2 src/mandocvisitor.cpp
  49. +10 −10 src/mangen.cpp
  50. +3 −3 src/markdown.cpp
  51. +53 −53 src/memberdef.cpp
  52. +6 −6 src/memberlist.cpp
  53. +18 −18 src/message.cpp
  54. +3 −3 src/msc.cpp
  55. +24 −24 src/namespacedef.cpp
  56. +5 −5 src/pagedef.cpp
  57. +7 −7 src/perlmodgen.cpp
  58. +4 −4 src/plantuml.cpp
  59. +9 −9 src/pre.l
  60. +3 −3 src/pycode.l
  61. +1 −1 src/pyscanner.l
  62. +9 −9 src/qhp.cpp
  63. +1 −1 src/resourcemgr.cpp
  64. +17 −17 src/rtfdocvisitor.cpp
  65. +28 −28 src/rtfgen.cpp
  66. +27 −27 src/scanner.l
  67. +9 −9 src/searchindex.cpp
  68. +1 −1 src/sqlite3gen.cpp
  69. +13 −16 src/tclscanner.l
  70. +1 −1 src/tooltip.cpp
  71. +15 −15 src/translator_am.h
  72. +14 −14 src/translator_ar.h
  73. +14 −14 src/translator_br.h
  74. +14 −14 src/translator_ca.h
  75. +14 −14 src/translator_cn.h
  76. +13 −13 src/translator_cz.h
  77. +12 −12 src/translator_de.h
  78. +14 −14 src/translator_dk.h
  79. +14 −14 src/translator_en.h
  80. +14 −14 src/translator_eo.h
  81. +14 −14 src/translator_es.h
  82. +12 −12 src/translator_fa.h
  83. +14 −14 src/translator_fi.h
  84. +14 −14 src/translator_fr.h
  85. +14 −14 src/translator_gr.h
  86. +6 −6 src/translator_hr.h
  87. +14 −14 src/translator_hu.h
  88. +14 −14 src/translator_id.h
  89. +12 −12 src/translator_it.h
  90. +13 −13 src/translator_jp.h
  91. +14 −14 src/translator_kr.h
  92. +14 −14 src/translator_lt.h
  93. +14 −14 src/translator_lv.h
  94. +14 −14 src/translator_mk.h
  95. +14 −14 src/translator_no.h
  96. +14 −14 src/translator_pl.h
  97. +13 −13 src/translator_pt.h
  98. +14 −14 src/translator_ro.h
  99. +14 −14 src/translator_ru.h
  100. +14 −14 src/translator_sc.h
  101. +1 −1 src/translator_si.h
  102. +12 −12 src/translator_sk.h
  103. +14 −14 src/translator_sr.h
  104. +14 −14 src/translator_sv.h
  105. +14 −14 src/translator_tr.h
  106. +14 −14 src/translator_tw.h
  107. +14 −14 src/translator_ua.h
  108. +14 −14 src/translator_vi.h
  109. +14 −14 src/translator_za.h
  110. +49 −66 src/util.cpp
  111. +1 −1 src/util.h
  112. +3 −3 src/vhdlcode.l
  113. +10 −10 src/vhdldocgen.cpp
  114. +1 −1 src/vhdljjparser.cpp
  115. +1 −1 src/xmldocvisitor.cpp
  116. +14 −14 src/xmlgen.cpp
  117. +10 −1 vhdlparser/CMakeLists.txt
  118. +2 −2 vhdlparser/VhdlParser.cc
  119. +2 −2 vhdlparser/vhdlparser.jj
@@ -36,6 +36,21 @@ file(GENERATE OUTPUT ${GENERATED_SRC}/version.cpp
)
set_source_files_properties(${GENERATED_SRC}/version.cpp PROPERTIES GENERATED 1)
# configvalues.h
add_custom_command(
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maph ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.h
DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py
OUTPUT ${GENERATED_SRC}/configvalues.h
)
set_source_files_properties(${GENERATED_SRC}/configvalues.h PROPERTIES GENERATED 1)
# configvalues.cpp
add_custom_command(
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maps ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.cpp
DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py
OUTPUT ${GENERATED_SRC}/configvalues.cpp
)
set_source_files_properties(${GENERATED_SRC}/configvalues.cpp PROPERTIES GENERATED 1)
# configoptions.cpp
add_custom_command(
@@ -85,31 +100,32 @@ add_custom_command(
set_source_files_properties(${GENERATED_SRC}/layout_default.xml.h PROPERTIES GENERATED 1)
# Targets for flex/bison generated files
FLEX_TARGET(scanner scanner.l ${GENERATED_SRC}/scanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PscannerYY")
FLEX_TARGET(code code.l ${GENERATED_SRC}/code.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PcodeYY")
FLEX_TARGET(pyscanner pyscanner.l ${GENERATED_SRC}/pyscanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PpyscannerYY")
FLEX_TARGET(pycode pycode.l ${GENERATED_SRC}/pycode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PpycodeYY")
FLEX_TARGET(fortranscanner fortranscanner.l ${GENERATED_SRC}/fortranscanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PfortranscannerYY -i")
FLEX_TARGET(fortrancode fortrancode.l ${GENERATED_SRC}/fortrancode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PfortrancodeYY -i")
FLEX_TARGET(vhdlcode vhdlcode.l ${GENERATED_SRC}/vhdlcode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PvhdlcodeYY -i")
FLEX_TARGET(tclscanner tclscanner.l ${GENERATED_SRC}/tclscanner.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PtclscannerYY -i")
FLEX_TARGET(pre pre.l ${GENERATED_SRC}/pre.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PpreYY")
FLEX_TARGET(declinfo declinfo.l ${GENERATED_SRC}/declinfo.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PdeclinfoYY")
FLEX_TARGET(defargs defargs.l ${GENERATED_SRC}/defargs.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PdefargsYY")
FLEX_TARGET(doctokenizer doctokenizer.l ${GENERATED_SRC}/doctokenizer.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PdoctokenizerYY")
FLEX_TARGET(commentcnv commentcnv.l ${GENERATED_SRC}/commentcnv.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PcommentcnvYY")
FLEX_TARGET(commentscan commentscan.l ${GENERATED_SRC}/commentscan.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PcommentscanYY")
FLEX_TARGET(constexp constexp.l ${GENERATED_SRC}/constexp.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PconstexpYY")
FLEX_TARGET(xmlcode xmlcode.l ${GENERATED_SRC}/xmlcode.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PxmlcodeYY")
FLEX_TARGET(config config.l ${GENERATED_SRC}/config.cpp COMPILE_FLAGS "$(LEX_FLAGS) -PconfigYY")
BISON_TARGET(vhdlparser vhdlparser.y ${GENERATED_SRC}/vhdlparser.cpp COMPILE_FLAGS "$(YACC_FLAGS) -l -p vhdlscannerYY")
BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "$(YACC_FLAGS) -l -p constexpYY")
FLEX_TARGET(scanner scanner.l ${GENERATED_SRC}/scanner.cpp COMPILE_FLAGS "${LEX_FLAGS} -PscannerYY")
FLEX_TARGET(code code.l ${GENERATED_SRC}/code.cpp COMPILE_FLAGS "${LEX_FLAGS} -PcodeYY")
FLEX_TARGET(pyscanner pyscanner.l ${GENERATED_SRC}/pyscanner.cpp COMPILE_FLAGS "${LEX_FLAGS} -PpyscannerYY")
FLEX_TARGET(pycode pycode.l ${GENERATED_SRC}/pycode.cpp COMPILE_FLAGS "${LEX_FLAGS} -PpycodeYY")
FLEX_TARGET(fortranscanner fortranscanner.l ${GENERATED_SRC}/fortranscanner.cpp COMPILE_FLAGS "${LEX_FLAGS} -PfortranscannerYY -i")
FLEX_TARGET(fortrancode fortrancode.l ${GENERATED_SRC}/fortrancode.cpp COMPILE_FLAGS "${LEX_FLAGS} -PfortrancodeYY -i")
FLEX_TARGET(vhdlcode vhdlcode.l ${GENERATED_SRC}/vhdlcode.cpp COMPILE_FLAGS "${LEX_FLAGS} -PvhdlcodeYY -i")
FLEX_TARGET(tclscanner tclscanner.l ${GENERATED_SRC}/tclscanner.cpp COMPILE_FLAGS "${LEX_FLAGS} -PtclscannerYY -i")
FLEX_TARGET(pre pre.l ${GENERATED_SRC}/pre.cpp COMPILE_FLAGS "${LEX_FLAGS} -PpreYY")
FLEX_TARGET(declinfo declinfo.l ${GENERATED_SRC}/declinfo.cpp COMPILE_FLAGS "${LEX_FLAGS} -PdeclinfoYY")
FLEX_TARGET(defargs defargs.l ${GENERATED_SRC}/defargs.cpp COMPILE_FLAGS "${LEX_FLAGS} -PdefargsYY")
FLEX_TARGET(doctokenizer doctokenizer.l ${GENERATED_SRC}/doctokenizer.cpp COMPILE_FLAGS "${LEX_FLAGS} -PdoctokenizerYY")
FLEX_TARGET(commentcnv commentcnv.l ${GENERATED_SRC}/commentcnv.cpp COMPILE_FLAGS "${LEX_FLAGS} -PcommentcnvYY")
FLEX_TARGET(commentscan commentscan.l ${GENERATED_SRC}/commentscan.cpp COMPILE_FLAGS "${LEX_FLAGS} -PcommentscanYY")
FLEX_TARGET(constexp constexp.l ${GENERATED_SRC}/constexp.cpp COMPILE_FLAGS "${LEX_FLAGS} -PconstexpYY")
FLEX_TARGET(xmlcode xmlcode.l ${GENERATED_SRC}/xmlcode.cpp COMPILE_FLAGS "${LEX_FLAGS} -PxmlcodeYY")
FLEX_TARGET(configimpl configimpl.l ${GENERATED_SRC}/configimpl.cpp COMPILE_FLAGS "${LEX_FLAGS} -PconfigimplYY")
BISON_TARGET(vhdlparser vhdlparser.y ${GENERATED_SRC}/vhdlparser.cpp COMPILE_FLAGS "${YACC_FLAGS} -l -p vhdlscannerYY")
BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "${YACC_FLAGS} -l -p constexpYY")
add_library(doxycfg STATIC
${GENERATED_SRC}/lang_cfg.h
${GENERATED_SRC}/config.cpp
${GENERATED_SRC}/configimpl.cpp
${GENERATED_SRC}/configoptions.cpp
${GENERATED_SRC}/configvalues.cpp
portable.cpp
portable_c.c
)
@@ -121,6 +137,7 @@ add_library(_doxygen STATIC
${GENERATED_SRC}/layout_default.xml.h
${GENERATED_SRC}/version.cpp
${GENERATED_SRC}/ce_parse.h
${GENERATED_SRC}/configvalues.h
${GENERATED_SRC}/resources.cpp
# generated by flex/bison
${GENERATED_SRC}/scanner.cpp
@@ -43,26 +43,26 @@ void CiteDict::writeLatexBibliography(FTextStream &t)
if (m_entries.isEmpty())
return;
QCString style = Config_getString("LATEX_BIB_STYLE");
QCString style = Config_getString(LATEX_BIB_STYLE);
if (style.isEmpty())
style="plain";
QCString unit;
if (Config_getBool("COMPACT_LATEX"))
if (Config_getBool(COMPACT_LATEX))
unit = "section";
else
unit = "chapter";
t << "% Bibliography\n"
"\\newpage\n"
"\\phantomsection\n";
bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
if (!pdfHyperlinks)
{
t << "\\clearemptydoublepage\n";
t << "\\addcontentsline{toc}{" << unit << "}{" << theTranslator->trCiteReferences() << "}\n";
}
t << "\\bibliographystyle{" << style << "}\n"
"\\bibliography{";
QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
QStrList &citeDataList = Config_getList(CITE_BIB_FILES);
int i = 0;
const char *bibdata = citeDataList.first();
while (bibdata)
@@ -107,7 +107,7 @@ void CiteDict::clear()
bool CiteDict::isEmpty() const
{
QStrList &citeBibFiles = Config_getList("CITE_BIB_FILES");
QStrList &citeBibFiles = Config_getList(CITE_BIB_FILES);
return (citeBibFiles.count()==0 || m_entries.isEmpty());
}
@@ -120,7 +120,7 @@ void CiteDict::generatePage() const
// 1. generate file with markers and citations to OUTPUT_DIRECTORY
QFile f;
QCString outputDir = Config_getString("OUTPUT_DIRECTORY");
QCString outputDir = Config_getString(OUTPUT_DIRECTORY);
QCString citeListFile = outputDir+"/citelist.doc";
f.setName(citeListFile);
if (!f.open(IO_WriteOnly))
@@ -154,7 +154,7 @@ void CiteDict::generatePage() const
// so bibtex can find them without path (bibtex doesn't support paths or
// filenames with spaces!)
// Strictly not required when only latex is generated
QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
QStrList &citeDataList = Config_getList(CITE_BIB_FILES);
QCString bibOutputDir = outputDir+"/"+bibTmpDir;
QCString bibOutputFiles = "";
QDir thisDir;
@@ -251,11 +251,11 @@ void CiteDict::generatePage() const
// 8. for latex we just copy the bib files to the output and let
// latex do this work.
if (Config_getBool("GENERATE_LATEX"))
if (Config_getBool(GENERATE_LATEX))
{
// copy bib files to the latex output dir
QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
QCString latexOutputDir = Config_getString("LATEX_OUTPUT")+"/";
QStrList &citeDataList = Config_getList(CITE_BIB_FILES);
QCString latexOutputDir = Config_getString(LATEX_OUTPUT)+"/";
int i = 0;
const char *bibdata = citeDataList.first();
while (bibdata)
@@ -64,7 +64,7 @@ class ClangParser::Private
static QCString detab(const QCString &s)
{
static int tabSize = Config_getInt("TAB_SIZE");
static int tabSize = Config_getInt(TAB_SIZE);
GrowBuf out;
int size = s.length();
const char *data = s.data();
@@ -157,9 +157,9 @@ void ClangParser::determineInputFilesInSameTu(QStrList &files)
void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit)
{
static bool clangAssistedParsing = Config_getBool("CLANG_ASSISTED_PARSING");
static QStrList &includePath = Config_getList("INCLUDE_PATH");
static QStrList clangOptions = Config_getList("CLANG_OPTIONS");
static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
static QStrList &includePath = Config_getList(INCLUDE_PATH);
static QStrList clangOptions = Config_getList(CLANG_OPTIONS);
if (!clangAssistedParsing) return;
//printf("ClangParser::start(%s)\n",fileName);
p->fileName = fileName;
@@ -230,7 +230,7 @@ void ClangParser::start(const char *fileName,QStrList &filesInTranslationUnit)
// provide the input and and its dependencies as unsaved files so we can
// pass the filtered versions
argv[argc++]=strdup(fileName);
static bool filterSourceFiles = Config_getBool("FILTER_SOURCE_FILES");
static bool filterSourceFiles = Config_getBool(FILTER_SOURCE_FILES);
//printf("source %s ----------\n%s\n-------------\n\n",
// fileName,p->source.data());
uint numUnsavedFiles = filesInTranslationUnit.count()+1;
@@ -339,7 +339,7 @@ void ClangParser::switchToFile(const char *fileName)
void ClangParser::finish()
{
static bool clangAssistedParsing = Config_getBool("CLANG_ASSISTED_PARSING");
static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
if (!clangAssistedParsing) return;
if (p->tu)
{
@@ -381,7 +381,7 @@ QCString ClangParser::lookup(uint line,const char *symbol)
//printf("ClangParser::lookup(%d,%s)\n",line,symbol);
QCString result;
if (symbol==0) return result;
static bool clangAssistedParsing = Config_getBool("CLANG_ASSISTED_PARSING");
static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
if (!clangAssistedParsing) return result;
int sl = strlen(symbol);
@@ -615,7 +615,7 @@ static void writeMultiLineCodeLink(CodeOutputInterface &ol,
Definition *d,
const char *text)
{
static bool sourceTooltips = Config_getBool("SOURCE_TOOLTIPS");
static bool sourceTooltips = Config_getBool(SOURCE_TOOLTIPS);
TooltipManager::instance()->addTooltip(d);
QCString ref = d->getReference();
QCString file = d->getOutputFileBase();
Oops, something went wrong.

0 comments on commit a93ec72

Please sign in to comment.