From: Daniel Dunbar Date: Thu, 5 Nov 2009 01:53:23 +0000 (+0000) Subject: Simplify. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cc1a259328977c30aff3ecc1b9dc9002cac60ec;p=clang Simplify. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86104 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp index 3d44d6366a..724f060edd 100644 --- a/tools/clang-cc/clang-cc.cpp +++ b/tools/clang-cc/clang-cc.cpp @@ -2224,7 +2224,8 @@ int main(int argc, char **argv) { if (!InheritanceViewCls.empty()) // C++ visualization? ProgAction = InheritanceView; - llvm::OwningPtr SourceMgr; + // Create the source manager. + SourceManager SourceMgr; // Create a file manager object to provide access to and cache the filesystem. FileManager FileMgr; @@ -2244,12 +2245,9 @@ int main(int argc, char **argv) { continue; } - // Create a SourceManager object. This tracks and owns all the file - // buffers allocated to a translation unit. - if (!SourceMgr) - SourceMgr.reset(new SourceManager()); - else - SourceMgr->clearIDTables(); + // Reset the ID tables if we are reusing the SourceManager. + if (i) + SourceMgr.clearIDTables(); // Initialize language options, inferring file types from input filenames. LangOptions LangInfo; @@ -2266,7 +2264,7 @@ int main(int argc, char **argv) { // Set up the preprocessor with these options. llvm::OwningPtr PP(CreatePreprocessor(Diags, LangInfo, - *Target, *SourceMgr, + *Target, SourceMgr, HeaderInfo)); // Handle generating dependencies, if requested.