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 | 32fbe31246fa498c4170411dfda3ae85b7c39c4e (patch) | |
tree | 22b7aa0b9b223a4ae57b1fc8ae656357eaba9ee2 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 469214426ac525c12ec83d6a3b2e86f0ded1e57f (diff) | |
download | bcm5719-llvm-32fbe31246fa498c4170411dfda3ae85b7c39c4e.tar.gz bcm5719-llvm-32fbe31246fa498c4170411dfda3ae85b7c39c4e.zip |
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.
llvm-svn: 148546
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 1f0d87c0626..c3f3e3711ac 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/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. |