finalize a preprocessor and free any memory still in use
| 1750 | |
| 1751 | // finalize a preprocessor and free any memory still in use |
| 1752 | static 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 |
no test coverage detected