From 4f05b362855cd10b35608a36b18a04647920309c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 20 Jun 2017 01:31:53 +0000 Subject: [PATCH] Turn off "disable free" mode when preprocessing imported module files in -frewrite-imports mode. This could end up accumulating a very large amount of intermediate state. Clear it out after each module file is processed. llvm-svn: 305764 --- clang/lib/Frontend/Rewrite/FrontendActions.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/lib/Frontend/Rewrite/FrontendActions.cpp b/clang/lib/Frontend/Rewrite/FrontendActions.cpp index 2ccdc263951b..f64fbdafd597 100644 --- a/clang/lib/Frontend/Rewrite/FrontendActions.cpp +++ b/clang/lib/Frontend/Rewrite/FrontendActions.cpp @@ -243,6 +243,7 @@ public: Instance.createDiagnostics( new ForwardingDiagnosticConsumer(CI.getDiagnosticClient()), /*ShouldOwnClient=*/true); + Instance.getFrontendOpts().DisableFree = false; Instance.getFrontendOpts().Inputs.clear(); Instance.getFrontendOpts().Inputs.emplace_back( Filename, InputKind(InputKind::Unknown, InputKind::Precompiled));