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 | fe908a805b51d77d4fc5332aa96feb04497eb66b (patch) | |
| tree | 0c89b62df8ad5e4521d1e9952d0fd23bd941cb56 /clang/lib | |
| parent | 413e064b4556650aa9faed7e3fe5379f9fc3a999 (diff) | |
| download | llvm-fe908a805b51d77d4fc5332aa96feb04497eb66b.zip llvm-fe908a805b51d77d4fc5332aa96feb04497eb66b.tar.gz llvm-fe908a805b51d77d4fc5332aa96feb04497eb66b.tar.bz2  | |
Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don't
really make any sense in this environment.
llvm-svn: 128014
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 3 | ||||
| -rw-r--r-- | clang/lib/Frontend/HeaderIncludeGen.cpp | 20 | 
2 files changed, 15 insertions, 8 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 26d40e4..bbdfcaf 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -205,7 +205,8 @@ CompilerInstance::createPreprocessor(Diagnostic &Diags,      llvm::StringRef OutputPath = DepOpts.HeaderIncludeOutputFile;      if (OutputPath == "-")        OutputPath = ""; -    AttachHeaderIncludeGen(*PP, /*ShowAllHeaders=*/true, OutputPath); +    AttachHeaderIncludeGen(*PP, /*ShowAllHeaders=*/true, OutputPath, +                           /*ShowDepth=*/false);    }    return PP; diff --git a/clang/lib/Frontend/HeaderIncludeGen.cpp b/clang/lib/Frontend/HeaderIncludeGen.cpp index 45ff1d2..b77badf 100644 --- a/clang/lib/Frontend/HeaderIncludeGen.cpp +++ b/clang/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';  | 
