https://llvm.org/bugs/show_bug.cgi?id=25741
Bug ID: 25741 Summary: libclang/Windows: preamble file is not deleted on clang_disposeTranslationUnit() Product: clang Version: trunk Hardware: PC OS: Windows 2000 Status: NEW Severity: normal Priority: P Component: libclang Assignee: unassignedclangb...@nondot.org Reporter: nikolai.kos...@theqtcompany.com CC: kli...@google.com, llvm-bugs@lists.llvm.org Classification: Unclassified Generated preamble files are deleted on Linux, but not on Windows. As a result, the preamble files accumulate in %TEMP% until the disk is full. Preamble files up to 20MB are not unusual for some *.cpp files. Reproducible with libclang 3.6.2 and libclang from trunk (3.8, r253269). Used test code (pass in a suitable file): #include <clang-c/Index.h> #include <cstdlib> #include <cstdio> #include <vector> int main(int argc, char *argv[]) { if (argc != 2) { fprintf(stderr, "Usage: $0 <file>\n"); return 0; } const char *filePath = argv[1]; // Construct parse arguments std::vector<const char *> arguments; arguments.push_back(filePath); // Parse CXIndex index = clang_createIndex(0, /*displayDiagnostics*/ 1); const unsigned tuOptions = CXTranslationUnit_PrecompiledPreamble; CXTranslationUnit tu = clang_parseTranslationUnit(index, NULL, arguments.data(), arguments.size(), NULL, 0, tuOptions); // Re-parse in order to create the preamble file clang_reparseTranslationUnit(tu, NULL, 0, 0); // Dispose the TU + index clang_disposeTranslationUnit(tu); clang_disposeIndex(index); return 0; } -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs