diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-03-21 19:37:38 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-03-21 19:37:38 +0000 |
commit | da60885cb4ee85d167cf704061f10b758067cf5a (patch) | |
tree | 44216d870a82ac0975973f00457a3c4c59ed90f8 /lib/Frontend/HeaderIncludeGen.cpp | |
parent | 84950c7fec2b056a424125997cb90451a3c83194 (diff) |
Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don't
really make any sense in this environment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128014 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/HeaderIncludeGen.cpp')
-rw-r--r-- | lib/Frontend/HeaderIncludeGen.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/Frontend/HeaderIncludeGen.cpp b/lib/Frontend/HeaderIncludeGen.cpp index 45ff1d2e41..b77badf77f 100644 --- a/lib/Frontend/HeaderIncludeGen.cpp +++ b/lib/Frontend/HeaderIncludeGen.cpp @@ -22,13 +22,16 @@ class HeaderIncludesCallback : public PPCallbacks { bool HasProcessedPredefines; bool OwnsOutputFile; bool ShowAllHeaders; + bool ShowDepth; public: HeaderIncludesCallback(const Preprocessor *PP, bool ShowAllHeaders_, - llvm::raw_ostream *OutputFile_, bool OwnsOutputFile_) + llvm::raw_ostream *OutputFile_, bool OwnsOutputFile_, + bool ShowDepth_) : SM(PP->getSourceManager()), OutputFile(OutputFile_), CurrentIncludeDepth(0), HasProcessedPredefines(false), - OwnsOutputFile(OwnsOutputFile_), ShowAllHeaders(ShowAllHeaders_) {} + OwnsOutputFile(OwnsOutputFile_), ShowAllHeaders(ShowAllHeaders_), + ShowDepth(ShowDepth_) {} ~HeaderIncludesCallback() { if (OwnsOutputFile) @@ -41,7 +44,7 @@ public: } void clang::AttachHeaderIncludeGen(Preprocessor &PP, bool ShowAllHeaders, - llvm::StringRef OutputPath) { + llvm::StringRef OutputPath, bool ShowDepth) { llvm::raw_ostream *OutputFile = &llvm::errs(); bool OwnsOutputFile = false; @@ -63,7 +66,8 @@ void clang::AttachHeaderIncludeGen(Preprocessor &PP, bool ShowAllHeaders, } PP.addPPCallbacks(new HeaderIncludesCallback(&PP, ShowAllHeaders, - OutputFile, OwnsOutputFile)); + OutputFile, OwnsOutputFile, + ShowDepth)); } void HeaderIncludesCallback::FileChanged(SourceLocation Loc, @@ -102,9 +106,11 @@ void HeaderIncludesCallback::FileChanged(SourceLocation Loc, Lexer::Stringify(Filename); llvm::SmallString<256> Msg; - for (unsigned i = 0; i != CurrentIncludeDepth; ++i) - Msg += '.'; - Msg += ' '; + if (ShowDepth) { + for (unsigned i = 0; i != CurrentIncludeDepth; ++i) + Msg += '.'; + Msg += ' '; + } Msg += Filename; Msg += '\n'; |