Re: [PATCH] D11778: Improvements on Diagnostic in Macro Expansions

2015-08-10 Thread Zhengkai Wu via cfe-commits
zhengkai added a comment. The helper function checkRangesForMacroArgExpansion is to check if the current Loc and Ranges are expansions of a macro's arguments. If so, the IgnoredEnd will record this position and thus omitting all later expanded macros (Later expanded macros are showed on top of

Re: [PATCH] D11778: Improvements on Diagnostic in Macro Expansions

2015-08-10 Thread Zhengkai Wu via cfe-commits
zhengkai added a comment. The example our method doesn't work: https://llvm.org/bugs/show_bug.cgi?id=24424 http://reviews.llvm.org/D11778 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-08-26 Thread Zhengkai Wu via cfe-commits
zhengkai created this revision. zhengkai added a reviewer: rtrieu. zhengkai added a subscriber: cfe-commits. Use a new algorithm to find map back the ranges to its spelling locations. But the function is not working properly either, and it breaks a test. In the last case in the test file

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-14 Thread Zhengkai Wu via cfe-commits
zhengkai added a comment. In http://reviews.llvm.org/D12379#245849, @rtrieu wrote: > Why are you leaking the raw encoding of locations from the SourceManager? > This is an internal implementation detail and should not be relied on > externally. SourceLocation is the typical way to use

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-14 Thread Zhengkai Wu via cfe-commits
zhengkai added a comment. In http://reviews.llvm.org/D12379#245861, @rtrieu wrote: > In http://reviews.llvm.org/D12379#245850, @zhengkai wrote: > > > In http://reviews.llvm.org/D12379#245849, @rtrieu wrote: > > > > > Why are you leaking the raw encoding of locations from the SourceManager? > >

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-15 Thread Zhengkai Wu via cfe-commits
zhengkai added a comment. In http://reviews.llvm.org/D12379#245892, @rtrieu wrote: > In http://reviews.llvm.org/D12379#245868, @zhengkai wrote: > > > In http://reviews.llvm.org/D12379#245861, @rtrieu wrote: > > > > > In http://reviews.llvm.org/D12379#245850, @zhengkai wrote: > > > > > > > In

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-16 Thread Zhengkai Wu via cfe-commits
zhengkai updated this revision to Diff 34943. zhengkai marked 8 inline comments as done. http://reviews.llvm.org/D12379 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/DiagnosticRenderer.cpp test/Index/fix-its.m test/Misc/caret-diags-macros.c

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-16 Thread Zhengkai Wu via cfe-commits
zhengkai added inline comments. Comment at: lib/Frontend/DiagnosticRenderer.cpp:312 @@ +311,3 @@ + +static bool retrieveBeginLocation(SourceLocation , + FileID , rtrieu wrote: > Why not return a SourceLocation instead of passing one in

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-17 Thread Zhengkai Wu via cfe-commits
zhengkai marked 2 inline comments as done. Comment at: lib/Frontend/DiagnosticRenderer.cpp:455 @@ -419,1 +454,3 @@ +static bool checkLocForMacroArgExpansion(SourceLocation Loc, + const SourceManager , Because the function

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-23 Thread Zhengkai Wu via cfe-commits
zhengkai updated this revision to Diff 35561. http://reviews.llvm.org/D12379 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/DiagnosticRenderer.cpp test/Index/fix-its.m test/Misc/caret-diags-macros.c test/Misc/diag-macro-backtrace2.c

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-23 Thread Zhengkai Wu via cfe-commits
zhengkai added inline comments. Comment at: lib/Frontend/DiagnosticRenderer.cpp:442 @@ -419,1 +441,3 @@ +/// Check if the current location fit in the macro argument expansion +/// Especially, it should fit in the same argument with all the other locations

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-23 Thread Zhengkai Wu via cfe-commits
zhengkai updated this revision to Diff 35556. http://reviews.llvm.org/D12379 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/DiagnosticRenderer.cpp test/Index/fix-its.m test/Misc/caret-diags-macros.c test/Misc/diag-macro-backtrace2.c

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-23 Thread Zhengkai Wu via cfe-commits
zhengkai marked an inline comment as done. Comment at: lib/Frontend/DiagnosticRenderer.cpp:442 @@ -419,1 +441,3 @@ +static bool checkLocForMacroArgExpansion(SourceLocation Loc, + const SourceManager , I have stated that I

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-23 Thread Zhengkai Wu via cfe-commits
zhengkai updated this revision to Diff 35554. zhengkai marked 11 inline comments as done. http://reviews.llvm.org/D12379 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/DiagnosticRenderer.cpp test/Index/fix-its.m test/Misc/caret-diags-macros.c

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-23 Thread Zhengkai Wu via cfe-commits
zhengkai updated this revision to Diff 35574. http://reviews.llvm.org/D12379 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/DiagnosticRenderer.cpp test/Index/fix-its.m test/Misc/caret-diags-macros.c test/Misc/diag-macro-backtrace2.c

Re: [PATCH] D12379: Fix the bugs in the mapDiagnosticRanges (Still in progress)

2015-09-23 Thread Zhengkai Wu via cfe-commits
zhengkai updated this revision to Diff 35573. http://reviews.llvm.org/D12379 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Frontend/DiagnosticRenderer.cpp test/Index/fix-its.m test/Misc/caret-diags-macros.c test/Misc/diag-macro-backtrace2.c