[PATCH] D19063: clang-format: Fixed line merging of more than two lines

2016-11-15 Thread Cameron via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286973: [clang-format] Fixed line merging of more than two lines (authored by cameron314). Changed prior to commit: https://reviews.llvm.org/D19063?vs=53572=77996#toc Repository: rL LLVM

[PATCH] D19063: clang-format: Fixed line merging of more than two lines

2016-10-06 Thread Cameron via cfe-commits
cameron314 added a comment. I'll commit this in a few days, when I have some time to reintegrate it to the trunk. Thanks! https://reviews.llvm.org/D19063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: Record ranges skipped by the preprocessor and expose them with libclang.

2016-08-18 Thread Cameron via cfe-commits
Ah, is that why! My fault, sorry. I couldn't figure out why it wouldn't link on the build machines when it worked fine for me locally (on Windows)... Thank you, I will fix this shortly. On Thu, Aug 18, 2016 at 12:52 PM, Will Dietz via cfe-commits < cfe-commits@lists.llvm.org> wrote: > (Sending

Re: [PATCH] D20132: [libclang] Add clang_getAllSkippedRanges function

2016-08-18 Thread Cameron via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL279076: [libclang] Add clang_getAllSkippedRanges function (authored by cameron314). Changed prior to commit: https://reviews.llvm.org/D20132?vs=56964=68548#toc Repository: rL LLVM

Re: [PATCH] D20132: [libclang] Add clang_getAllSkippedRanges function

2016-08-18 Thread Cameron via cfe-commits
cameron314 added inline comments. Comment at: unittests/libclang/LibclangTest.cpp:16-20 @@ -15,4 +15,7 @@ #include "gtest/gtest.h" #include #include +#include +#include +#include #define DEBUG_TYPE "libclang-test" rsmith wrote: > Please put these in

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-08-02 Thread Cameron via cfe-commits
cameron314 added a comment. Anyone have time to check this out this week? It's a one-line fix, includes a test, and is for a fairly important bug :-) https://reviews.llvm.org/D20338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-06-28 Thread Cameron via cfe-commits
cameron314 added a comment. Anyone have a few minutes to look at this? http://reviews.llvm.org/D20338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-06-16 Thread Cameron via cfe-commits
cameron314 added a comment. Ping? :-) http://reviews.llvm.org/D20338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-06-09 Thread Cameron via cfe-commits
cameron314 updated this revision to Diff 60250. cameron314 added a comment. Here's the final fix (it's the line in FileManager.cpp, plus a test). http://reviews.llvm.org/D20338 Files: include/clang/Frontend/ASTUnit.h lib/Basic/FileManager.cpp lib/Frontend/ASTUnit.cpp

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-06-09 Thread Cameron via cfe-commits
cameron314 added inline comments. Comment at: lib/Basic/FileManager.cpp:389 @@ -383,2 +388,3 @@ UFE->File.reset(); + UFE->IsVirtual = true; return UFE; rsmith wrote: > Yes. The `IsValid` flag is just supposed to mean that this file has actually > been

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-06-09 Thread Cameron via cfe-commits
cameron314 added a comment. This is a fairly important bug for anyone hosting clang as a library (e.g. IDEs). Can someone have a look at this patch when they have a free moment? http://reviews.llvm.org/D20338 ___ cfe-commits mailing list

Re: [PATCH] D20132: [libclang] Add clang_getAllSkippedRanges function

2016-06-09 Thread Cameron via cfe-commits
cameron314 added a comment. Can someone have a look at this now that there's a test? http://reviews.llvm.org/D20132 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-06-03 Thread Cameron via cfe-commits
cameron314 updated the summary for this revision. cameron314 removed rL LLVM as the repository for this revision. cameron314 updated this revision to Diff 59577. cameron314 added a comment. It took some modifications to the ASTUnit to support a virtual file system with a PCH parse/reparse

Re: [Diffusion] rL249410: [Tooling] Reuse FileManager in ASTUnit.

2016-06-01 Thread Cameron via cfe-commits
cameron314 added a subscriber: cfe-commits. http://reviews.llvm.org/rL249410 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-05-26 Thread Cameron via cfe-commits
cameron314 added a comment. Thanks @bruno, I'll have a look at using a VFS for the test. Comment at: lib/Basic/FileManager.cpp:389 @@ -383,2 +388,3 @@ UFE->File.reset(); + UFE->IsVirtual = true; return UFE; rsmith wrote: > Rather than adding this

Re: [PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-05-24 Thread Cameron via cfe-commits
cameron314 added a comment. I'm not sure how to test this (originally I found this bug by stepping through with a debugger) -- is there a way to determine if an ASTUnit used a PCH for the preamble or not? I'd call the `getMainBufferWithPrecompiledPreamble` method manually but it's private.

Re: [PATCH] D20243: [PCH] Disable inclusion of timestamps when generating pch files on windows.

2016-05-18 Thread Cameron via cfe-commits
cameron314 added a subscriber: cameron314. cameron314 added a comment. I've seen rare cases where parses using the PCH files were yielding completely invalid data, almost as if they were corrupted. I wonder now if this could be the cause. (We're on Windows too.) http://reviews.llvm.org/D20243

[PATCH] D20338: [PCH] Fixed overridden files always invalidating preamble even when unchanged

2016-05-17 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. cameron314 set the repository for this revision to rL LLVM. Remapped files would always cause the preamble's PCH to be invalidated (even if they hadn't changed) because the file

Re: [PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

2016-05-17 Thread Cameron via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL269769: [PCH] Fixed bug with preamble invalidation when overridden files change (authored by cameron314). Changed prior to commit: http://reviews.llvm.org/D20137?vs=57367=57477#toc Repository: rL

Re: [PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

2016-05-16 Thread Cameron via cfe-commits
cameron314 updated the summary for this revision. cameron314 updated this revision to Diff 57367. cameron314 added a comment. This version of the patch takes into account potential changes between filenames and their unique IDs between parses. http://reviews.llvm.org/D20137 Files:

Re: [PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

2016-05-16 Thread Cameron via cfe-commits
cameron314 added inline comments. Comment at: lib/Frontend/ASTUnit.cpp:1402-1406 @@ +1401,7 @@ + +vfs::Status Status; +if (FileMgr->getNoncachedStatValue(RB.first, Status)) { + AnyFileChanged = true; + break; +} + rsmith

Re: [PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

2016-05-13 Thread Cameron via cfe-commits
cameron314 updated this revision to Diff 57253. cameron314 added a comment. Removed workaround for case that can no longer happen. http://reviews.llvm.org/D20137 Files: include/clang/Frontend/ASTUnit.h lib/Frontend/ASTUnit.cpp Index: lib/Frontend/ASTUnit.cpp

Re: [PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

2016-05-13 Thread Cameron via cfe-commits
cameron314 added inline comments. Comment at: lib/Basic/FileManager.cpp:304-307 @@ -303,1 +303,6 @@ + if (UFE.isVirtual()) { +UFE.Name = InterndFileName; +return + } + rsmith wrote: > It looks like this is unreachable: `IsVirtual` is only ever `true`

Re: [PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

2016-05-13 Thread Cameron via cfe-commits
cameron314 updated this revision to Diff 57222. cameron314 added a comment. Updated patch to include later fixes I had made after the initial change. http://reviews.llvm.org/D20137 Files: include/clang/Basic/FileManager.h include/clang/Frontend/ASTUnit.h lib/Basic/FileManager.cpp

Re: [PATCH] D20134: [libclang] Fixed bug where ranges in spelling locations (in macro expansions) would get mangled

2016-05-12 Thread Cameron via cfe-commits
cameron314 added a comment. You're right, this breaks that test. The corner case that it exercises is arguably less important than breaking all spelling ranges, though. But I'm going to see if I can fix both with a little wizardry (ideally there wouldn't be open ranges in the first place,

Re: [PATCH] D20132: [libclang] Add clang_getAllSkippedRanges function

2016-05-11 Thread Cameron via cfe-commits
cameron314 updated this revision to Diff 56964. cameron314 added a comment. Here's a test! http://reviews.llvm.org/D20132 Files: include/clang-c/Index.h tools/libclang/CIndex.cpp unittests/libclang/LibclangTest.cpp Index: unittests/libclang/LibclangTest.cpp

Re: [PATCH] D20131: Fixed crash during code completion in file included within declaration

2016-05-11 Thread Cameron via cfe-commits
cameron314 added inline comments. Comment at: lib/Lex/PPLexerChange.cpp:380-383 @@ -379,4 +379,6 @@ CurLexer->FormTokenWithChars(Result, CurLexer->BufferEnd, tok::eof); CurLexer.reset(); +if (CurLexerKind == CLK_Lexer) + CurLexerKind =

Re: [PATCH] D20131: Fixed crash during code completion in file included within declaration

2016-05-11 Thread Cameron via cfe-commits
cameron314 updated this revision to Diff 56961. cameron314 added a comment. Ah, perfect, thanks. Behold, a test that fails without the patch and passes with it :-) http://reviews.llvm.org/D20131 Files: lib/Lex/PPLexerChange.cpp test/CodeCompletion/include-within-declaration.c Index:

Re: [PATCH] D20131: Fixed crash during code completion in file included within declaration

2016-05-11 Thread Cameron via cfe-commits
cameron314 added a comment. I fixed this last July so the details are a little hazy, but fortunately it turns out I documented what I had found: > It seems when clang parses an enum declaration, it first parses the > declaration specifiers, then stops if a semicolon is present. > The trouble

Re: [PATCH] D20125: [libclang] Added clang_getRealSpellingLocation to compensate for clang_getSpellingLocation returning the expansion location

2016-05-11 Thread Cameron via cfe-commits
cameron314 updated this revision to Diff 56917. http://reviews.llvm.org/D20125 Files: include/clang-c/Index.h tools/libclang/CXSourceLocation.cpp unittests/libclang/LibclangTest.cpp Index: unittests/libclang/LibclangTest.cpp

Re: [PATCH] D20125: [libclang] Added clang_getRealSpellingLocation to compensate for clang_getSpellingLocation returning the expansion location

2016-05-11 Thread Cameron via cfe-commits
cameron314 updated this revision to Diff 56916. cameron314 added a comment. I've added a unit test. http://reviews.llvm.org/D20125 Files: include/clang-c/Index.h tools/libclang/CXSourceLocation.cpp unittests/libclang/LibclangTest.cpp Index: unittests/libclang/LibclangTest.cpp

Re: [PATCH] D20125: [libclang] Added clang_getRealSpellingLocation to compensate for clang_getSpellingLocation returning the expansion location

2016-05-11 Thread Cameron via cfe-commits
cameron314 added a comment. Ah, I was wondering where the tests were. I found this in the CMake file: # FIXME: libclang unit tests are disabled on Windows due # to failures, mostly in libclang.VirtualFileOverlay_*. if(NOT WIN32 AND CLANG_TOOL_LIBCLANG_BUILD) add_subdirectory(libclang)

[PATCH] D20137: [PCH] Fixed bugs with preamble invalidation when files change (on Windows)

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. There were two bugs relating to remapped files, that are not specific to Windows but happen more often there: - When remapped files were changed, they would never cause the

[PATCH] D20134: [libclang] Fixed bug where ranges in spelling locations (in macro expansions) would get mangled

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. The end location of the range would be changed into its expansion location, but the beginning of the range would stay as a spelling location. This would lead to very weird ranges

[PATCH] D20132: [libclang] Add clang_getAllSkippedRanges function

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. This complements the `clang_getSkippedRanges` function which returns skipped ranges filtered by a specific file. This function is useful when all the ranges are desired (and a lot

[PATCH] D20131: Fixed crash during code completion in file included within declaration

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. When triggering code completion within a file that is included in the middle of a declaration in another file, clang would crash while parsing the code. This occurred with

[PATCH] D20129: [libclang] Properly expose linkage spec cursors

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. All the groundwork for `CXCursor_LinkageSpec` already existed, but because of a missing case in a switch, cursors of that type were never actually created for linkage

[PATCH] D20127: [libclang] Expose cursors for alias/weak attributes

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. This patch introduces `CXCursor_AliasAttr`/`CXCursor_WeakAttr` and `clang_getAliasTargetSpelling()` for inspecting alias attributes via libclang. http://reviews.llvm.org/D20127

[PATCH] D20125: [libclang] Added clang_getRealSpellingLocation to compensate for clang_getSpellingLocation returning the expansion location

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. All the libclang functions for expanding a location, namely `clang_getExpansionLocation`, `clang_getPresumedLocation`, `clang_getInstantiationLocation`, and most surprisingly

[PATCH] D20124: [PCH] Serialize skipped preprocessor ranges

2016-05-10 Thread Cameron via cfe-commits
cameron314 created this revision. cameron314 added a reviewer: rsmith. cameron314 added a subscriber: cfe-commits. cameron314 set the repository for this revision to rL LLVM. This fixes, for example, libclang's `clang_getAllSkippedRanges` returning zero ranges after reparsing a translation unit.

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Cameron via cfe-commits
cameron314 added a comment. Ooh, and I should also add, there's a non-trivial cost to grabbing the entire file contents as a string and then converting it to UTF-8. If ClangFormat was faster, this would certainly become a significant bottleneck that can't really be worked around.

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Cameron via cfe-commits
cameron314 added a comment. We did profile at one point, to see if it was something we could trivially speed up (it wasn't). Most of it was on the parsing/annotation side, yes (which makes sense, since that's the majority of the work when the format region itself is limited). I'm afraid I

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Cameron via cfe-commits
cameron314 added a comment. Too late ;-) We've successfully integrated it as the engine behind our auto-formatting feature, passing only the minimal context necessary. We tried at first to supply the full file context, but that turned out to be much too slow in larger files. (We did a fair bit

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Cameron via cfe-commits
cameron314 added a comment. Sure :-) The motivation behind this patch (and a few more upcoming ones) is to make ClangFormat (the library) more friendly for IDE integration (which is our primary use case), in particular for on-the-fly auto-formatting. In an IDE auto-format setting, it's often

Re: [PATCH] D19031: clang-format: Flexible line endings

2016-04-12 Thread Cameron via cfe-commits
cameron314 added a comment. ClangFormat still needs to know what kind of newline to insert when reformatting code. It already had the "auto-detect newline" behaviour; this patch simply allows the auto-detection to be overridden with an explicit setting. This is important for short files that