From b8691df825c99b0fc989fcd92a008d2500ff2e37 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 15 Nov 2011 21:49:36 +0000 Subject: Split GenerateModuleAction into its own action, which will start differing from GeneratePCHAction fairly soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144703 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/CompilerInstance.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/Frontend/CompilerInstance.cpp') diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index ea2c3bd6c6..0a32cb96f7 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -647,13 +647,14 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { llvm::EnableStatistics(); for (unsigned i = 0, e = getFrontendOpts().Inputs.size(); i != e; ++i) { - const std::string &InFile = getFrontendOpts().Inputs[i].second; - + InputKind InKind = getFrontendOpts().Inputs[i].first; + std::string InFile = getFrontendOpts().Inputs[i].second; + // Reset the ID tables if we are reusing the SourceManager. if (hasSourceManager()) getSourceManager().clearIDTables(); - if (Act.BeginSourceFile(*this, InFile, getFrontendOpts().Inputs[i].first)) { + if (Act.BeginSourceFile(*this, InFile, InKind)) { Act.Execute(); Act.EndSourceFile(); } @@ -698,7 +699,7 @@ static InputKind getSourceInputKindFromOptions(const LangOptions &LangOpts) { namespace { struct CompileModuleData { CompilerInstance &Instance; - GeneratePCHAction &CreateModuleAction; + GenerateModuleAction &CreateModuleAction; }; } @@ -1023,7 +1024,7 @@ static void compileModule(CompilerInstance &ImportingInstance, /*ShouldCloneClient=*/true); // Construct a module-generating action. - GeneratePCHAction CreateModuleAction(true); + GenerateModuleAction CreateModuleAction; // Execute the action to actually build the module in-place. Use a separate // thread so that we get a stack large enough. -- cgit v1.2.3