diff options
author | Richard Trieu <rtrieu@google.com> | 2015-07-28 20:53:46 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2015-07-28 20:53:46 +0000 |
commit | 914e18e546953affccf24a4ba190676c96c08bc0 (patch) | |
tree | 63af1f3681677dc525f09c53622f77392ae8bff8 /include/clang/Frontend/DiagnosticRenderer.h | |
parent | 6ea88b600f597e6dbbaa1d6d5db9ab5e122cac5a (diff) |
Use an iterative method instead of recursion for printing macro backtraces.
Store the locations for a macro expansion in a vector, then iterate over them
instead of using recursion. This simplifies the logic around the backtrace
limit and gives easier access to the source locations. No functionality change.
Patch by Zhengkai Wu.
Differential Revision: http://reviews.llvm.org/D11542
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@243477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/DiagnosticRenderer.h')
-rw-r--r-- | include/clang/Frontend/DiagnosticRenderer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/clang/Frontend/DiagnosticRenderer.h b/include/clang/Frontend/DiagnosticRenderer.h index 84a0f50823..c372fdd087 100644 --- a/include/clang/Frontend/DiagnosticRenderer.h +++ b/include/clang/Frontend/DiagnosticRenderer.h @@ -117,13 +117,15 @@ private: void emitCaret(SourceLocation Loc, DiagnosticsEngine::Level Level, ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Hints, const SourceManager &SM); + void emitSingleMacroExpansion(SourceLocation Loc, + DiagnosticsEngine::Level Level, + ArrayRef<CharSourceRange> Ranges, + const SourceManager &SM); void emitMacroExpansions(SourceLocation Loc, DiagnosticsEngine::Level Level, ArrayRef<CharSourceRange> Ranges, ArrayRef<FixItHint> Hints, - const SourceManager &SM, - unsigned &MacroDepth, - unsigned OnMacroInst = 0); + const SourceManager &SM); public: /// \brief Emit a diagnostic. /// |