diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-20 16:28:04 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-20 16:28:04 +0000 |
commit | 1f6b2b5c82b2d2d3935b0db76352a04e9877b73f (patch) | |
tree | 3e13bde8bfb2c3bab74a8c5062361b750429dee6 /lib/Frontend/CompilerInstance.cpp | |
parent | b7ff74a6764ad837ce348bc7dd0f0804e4dbf492 (diff) |
Extract the (InputKind, std::string) pair used to describe inputs to
the front end into its own class, FrontendInputFile, to make it easier
to introduce new per-input data. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 1f0d87c062..c3f3e3711a 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -648,13 +648,11 @@ 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; - // 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, getFrontendOpts().Inputs[i])) { Act.Execute(); Act.EndSourceFile(); } @@ -1019,7 +1017,8 @@ static void compileModule(CompilerInstance &ImportingInstance, if (const FileEntry *ModuleMapFile = ModMap.getContainingModuleMapFile(Module)) { // Use the module map where this module resides. - FrontendOpts.Inputs.push_back(std::make_pair(IK, ModuleMapFile->getName())); + FrontendOpts.Inputs.push_back(FrontendInputFile(ModuleMapFile->getName(), + IK)); } else { // Create a temporary module map file. TempModuleMapFileName = Module->Name; @@ -1037,7 +1036,7 @@ static void compileModule(CompilerInstance &ImportingInstance, llvm::raw_fd_ostream OS(FD, /*shouldClose=*/true); Module->print(OS); FrontendOpts.Inputs.push_back( - std::make_pair(IK, TempModuleMapFileName.str().str())); + FrontendInputFile(TempModuleMapFileName.str().str(), IK)); } // Don't free the remapped file buffers; they are owned by our caller. |