MCPcopy Create free account
hub / github.com/csyonghe/Spire / FinalizePreprocessor

Function FinalizePreprocessor

Source/SpireCore/Preprocessor.cpp:1752–1771  ·  view source on GitHub ↗

finalize a preprocessor and free any memory still in use

Source from the content-addressed store, hash-verified

1750
1751// finalize a preprocessor and free any memory still in use
1752static void FinalizePreprocessor(
1753 Preprocessor* preprocessor)
1754{
1755 // Clear out any waiting input streams
1756 PreprocessorInputStream* input = preprocessor->inputStream;
1757 while (input)
1758 {
1759 PreprocessorInputStream* parent = input->parent;
1760 DestroyInputStream(preprocessor, input);
1761 input = parent;
1762 }
1763
1764#if 0
1765 // clean up any macros that were allocated
1766 for (auto pair : preprocessor->globalEnv.macros)
1767 {
1768 DestroyMacro(preprocessor, pair.Value);
1769 }
1770#endif
1771}
1772
1773// Add a simple macro definition from a string (e.g., for a
1774// `-D` option passed on the command line

Callers 1

PreprocessSourceFunction · 0.85

Calls 2

DestroyInputStreamFunction · 0.85
DestroyMacroFunction · 0.85

Tested by

no test coverage detected