Re: [PATCH] D20329: [clang-include-fixer] Added Vim integration for clang-include-fixer.

2016-05-18 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg http://reviews.llvm.org/D20329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[PATCH] D20372: [include-fixer] Also look up prefixes of queries.

2016-05-18 Thread Benjamin Kramer via cfe-commits
bkramer created this revision. bkramer added reviewers: hokein, ioeric. bkramer added a subscriber: cfe-commits. This is used to find nested classes. For a nested name foo::bar::qux we will first look up foo::bar::qux, then foo::bar, then foo unless we find a result. This is used to support nested

[clang-tools-extra] r269956 - [include-fixer] Also look up prefixes of queries.

2016-05-18 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Wed May 18 11:42:38 2016 New Revision: 269956 URL: http://llvm.org/viewvc/llvm-project?rev=269956&view=rev Log: [include-fixer] Also look up prefixes of queries. This is used to find nested classes. For a nested name foo::bar::qux we will first look up foo::bar::qux, then foo::b

Re: [PATCH] D20370: [include-fixer] Sort headers after inserting new headers.

2016-05-19 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lgtm http://reviews.llvm.org/D20370 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

r270039 - [Sema] Allow an external sema source to handle delayed typo corrections.

2016-05-19 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu May 19 05:46:10 2016 New Revision: 270039 URL: http://llvm.org/viewvc/llvm-project?rev=270039&view=rev Log: [Sema] Allow an external sema source to handle delayed typo corrections. This probably isn't perfectly perfect but allows correcting function calls again. Modified:

[clang-tools-extra] r270045 - [include-fixer] Remove obsolete windows hack.

2016-05-19 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu May 19 06:39:56 2016 New Revision: 270045 URL: http://llvm.org/viewvc/llvm-project?rev=270045&view=rev Log: [include-fixer] Remove obsolete windows hack. Modified: clang-tools-extra/trunk/unittests/include-fixer/IncludeFixerTest.cpp Modified: clang-tools-extra/trunk/uni

[PATCH] D20424: [include-fixer] Make search handle fully qualified names correctly.

2016-05-19 Thread Benjamin Kramer via cfe-commits
bkramer created this revision. bkramer added reviewers: hokein, ioeric. bkramer added a subscriber: cfe-commits. If a search string starts with "::" we don't want to return any results for suffixes of that string. http://reviews.llvm.org/D20424 Files: include-fixer/SymbolIndexManager.cpp uni

[clang-tools-extra] r270055 - [include-fixer] Make search handle fully qualified names correctly.

2016-05-19 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu May 19 07:41:56 2016 New Revision: 270055 URL: http://llvm.org/viewvc/llvm-project?rev=270055&view=rev Log: [include-fixer] Make search handle fully qualified names correctly. If a search string starts with "::" we don't want to return any results for suffixes of that string

Re: [PATCH] D20420: [find-all-symbol] Add macro support.

2016-05-19 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. In the future I'd prefer to do renaming changes (ResultReporter->SymbolReporter) in a separate change, but this is fine now. Comment at: include-fixer/find-all-symbols/Symb

[clang-tools-extra] r270082 - [include-fixer] Fix unused variable warning in Release builds.

2016-05-19 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu May 19 11:57:57 2016 New Revision: 270082 URL: http://llvm.org/viewvc/llvm-project?rev=270082&view=rev Log: [include-fixer] Fix unused variable warning in Release builds. Modified: clang-tools-extra/trunk/include-fixer/IncludeFixer.cpp Modified: clang-tools-extra/trunk/

r270085 - Don't rely on value numbers in test, those are fragile and change in Release (no asserts) builds.

2016-05-19 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu May 19 12:57:35 2016 New Revision: 270085 URL: http://llvm.org/viewvc/llvm-project?rev=270085&view=rev Log: Don't rely on value numbers in test, those are fragile and change in Release (no asserts) builds. Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c Modified: c

r270144 - [Sema] Fix use after move. Found by ubsan.

2016-05-19 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu May 19 16:53:33 2016 New Revision: 270144 URL: http://llvm.org/viewvc/llvm-project?rev=270144&view=rev Log: [Sema] Fix use after move. Found by ubsan. Modified: cfe/trunk/include/clang/Sema/SemaInternal.h cfe/trunk/lib/Sema/SemaLookup.cpp Modified: cfe/trunk/include

Re: r270039 - [Sema] Allow an external sema source to handle delayed typo corrections.

2016-05-19 Thread Benjamin Kramer via cfe-commits
2016 at 3:52 AM, Benjamin Kramer via cfe-commits > wrote: >> Author: d0k >> Date: Thu May 19 05:46:10 2016 >> New Revision: 270039 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=270039&view=rev >> Log: >> [Sema] Allow an external sema source to hand

Re: [PATCH] D20465: [find-all-symbol] Ignore inline namespace context.

2016-05-20 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg http://reviews.llvm.org/D20465 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

r270224 - Add all the avx512 flavors to __builtin_cpu_supports's list.

2016-05-20 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri May 20 10:21:08 2016 New Revision: 270224 URL: http://llvm.org/viewvc/llvm-project?rev=270224&view=rev Log: Add all the avx512 flavors to __builtin_cpu_supports's list. This is matching what trunk gcc is accepting. Also adds a missing ssse3 case. PR27779. The amount of dupli

Re: [PATCH] D15729: Load compiler plugins in ASTUnit, too

2016-03-30 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. If we really want to go down this route we should drop the exports file, putting random symbols in there is not going to fly. I'm not sure what that would break for libclang users though. Also make sure that your building without BUILD_SHARED_LIBS, otherwise you'll get

r265125 - [Lexer] Don't read out of bounds if a conflict marker is at the end of a file

2016-04-01 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri Apr 1 04:58:45 2016 New Revision: 265125 URL: http://llvm.org/viewvc/llvm-project?rev=265125&view=rev Log: [Lexer] Don't read out of bounds if a conflict marker is at the end of a file This can happen as we look for '' while scanning tokens but then expect '\n' to t

r265126 - [Lexer] Let the compiler infer string lengths. No functionality change intended.

2016-04-01 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri Apr 1 05:04:07 2016 New Revision: 265126 URL: http://llvm.org/viewvc/llvm-project?rev=265126&view=rev Log: [Lexer] Let the compiler infer string lengths. No functionality change intended. Modified: cfe/trunk/lib/Lex/Lexer.cpp Modified: cfe/trunk/lib/Lex/Lexer.cpp URL:

Re: [PATCH] D18319: Add a PragmaHandler Registry for plugins to add PragmaHandlers to

2016-04-04 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. > OK to commit then? Yeah, looks good. Repository: rL LLVM http://reviews.llvm.org/D18319 ___ cfe-commits mailing list cfe-commits@lists.l

Re: [PATCH] D4619: [SKX] Enabling SKX target (Skylake server chip) in clang

2016-04-04 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. This landed way back in http://reviews.llvm.org/rL214306. http://reviews.llvm.org/D4619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D18783: [clang-tidy] add new checker for string literal with NUL character.

2016-04-05 Thread Benjamin Kramer via cfe-commits
bkramer added a subscriber: bkramer. Comment at: clang-tidy/misc/StringLiteralWithEmbeddedNulCheck.cpp:21 @@ +20,3 @@ +// Retrieve the character at offset |offset| of the string literal |SL|. +static unsigned int GetCharAt(const StringLiteral *SL, size_t offset) { + if (offset >=

r265654 - Move class into an anonymous namespace. NFC.

2016-04-07 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu Apr 7 05:14:54 2016 New Revision: 265654 URL: http://llvm.org/viewvc/llvm-project?rev=265654&view=rev Log: Move class into an anonymous namespace. NFC. Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp URL: http://llvm.org/v

[clang-tools-extra] r265680 - [clang-tidy] Remove unnecessary getName() on Decls and Types feeding into a DiagnosticBuilder

2016-04-07 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu Apr 7 09:55:25 2016 New Revision: 265680 URL: http://llvm.org/viewvc/llvm-project?rev=265680&view=rev Log: [clang-tidy] Remove unnecessary getName() on Decls and Types feeding into a DiagnosticBuilder Going through a string removes some of the smarts of the diagnosic print

r265918 - Remove redundant conditions of the form (A || (!A && B)) -> (A || B)

2016-04-11 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Mon Apr 11 03:26:13 2016 New Revision: 265918 URL: http://llvm.org/viewvc/llvm-project?rev=265918&view=rev Log: Remove redundant conditions of the form (A || (!A && B)) -> (A || B) Found by cppcheck! PR27286 PR27287 PR27288 PR27289 Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp

r265926 - Don't clutter the test directory with temporary IR files.

2016-04-11 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Mon Apr 11 05:16:37 2016 New Revision: 265926 URL: http://llvm.org/viewvc/llvm-project?rev=265926&view=rev Log: Don't clutter the test directory with temporary IR files. -emit-llvm emits a file, -emit-llvm-only doesn't. Modified: cfe/trunk/test/Sema/attr-ifunc.c Modified:

r265934 - [clang-format] Walk backwards from end() instead of forwards from rend().

2016-04-11 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Mon Apr 11 07:19:19 2016 New Revision: 265934 URL: http://llvm.org/viewvc/llvm-project?rev=265934&view=rev Log: [clang-format] Walk backwards from end() instead of forwards from rend(). This should've been forwards from rbegin(), reverse iterators are just too confusing to be us

Re: r265934 - [clang-format] Walk backwards from end() instead of forwards from rend().

2016-04-11 Thread Benjamin Kramer via cfe-commits
On Mon, Apr 11, 2016 at 6:48 PM, David Blaikie wrote: > > > On Mon, Apr 11, 2016 at 5:19 AM, Benjamin Kramer via cfe-commits > wrote: >> >> Author: d0k >> Date: Mon Apr 11 07:19:19 2016 >> New Revision: 265934 >> >> URL: http://llvm.org/viewvc/ll

Re: r265934 - [clang-format] Walk backwards from end() instead of forwards from rend().

2016-04-11 Thread Benjamin Kramer via cfe-commits
On Mon, Apr 11, 2016 at 11:15 PM, Martin Probst wrote: >> > Was/is the 2 correct then? (if it was next(rbegin, 2) that'd be >> > equivalent >> > to prev(end, 3), yes?) >> >> I think it is from looking at the test case, looping in martin to see >> whether I'm right :) > > > At that point in the cod

r266057 - Remove unused diagnostics. NFC.

2016-04-12 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue Apr 12 06:49:52 2016 New Revision: 266057 URL: http://llvm.org/viewvc/llvm-project?rev=266057&view=rev Log: Remove unused diagnostics. NFC. Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Modified: c

[PATCH] D19314: [include-fixer] Add a prototype for a new include fixing tool.

2016-04-20 Thread Benjamin Kramer via cfe-commits
bkramer created this revision. bkramer added a reviewer: djasper. bkramer added subscribers: cfe-commits, hokein, ioeric. The goal of this tool is fairly simple, look up unknown identifiers in a global database and add the corresponding #include line. It accomplishes this by hooking into Sema as a

Re: [PATCH] D19314: [include-fixer] Add a prototype for a new include fixing tool.

2016-04-20 Thread Benjamin Kramer via cfe-commits
bkramer updated this revision to Diff 54342. bkramer added a comment. - FixedXrefsDB -> FakeXrefsDB - FakeXrefsDB is now configurable - Cosmetic & comment fixes. - Moved query to private methods. - Always insert new includes at the top, let clang-format sort out the rest (not yet implemented in t

Re: [PATCH] D19314: [include-fixer] Add a prototype for a new include fixing tool.

2016-04-20 Thread Benjamin Kramer via cfe-commits
bkramer updated this revision to Diff 54344. bkramer added a comment. From now on you shall be known as InMemoryXrefsDB. http://reviews.llvm.org/D19314 Files: CMakeLists.txt include-fixer/CMakeLists.txt include-fixer/InMemoryXrefsDB.cpp include-fixer/InMemoryXrefsDB.h include-fixer/In

Re: [PATCH] D19314: [include-fixer] Add a prototype for a new include fixing tool.

2016-04-20 Thread Benjamin Kramer via cfe-commits
bkramer marked 8 inline comments as done. Comment at: include-fixer/IncludeFixer.cpp:132 @@ +131,3 @@ + +private: + /// Query the database for a given identifier. klimek wrote: > Can we sort this so the public interface comes first? Also, why is the public > int

[clang-tools-extra] r266870 - [include-fixer] Add a prototype for a new include fixing tool.

2016-04-20 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Wed Apr 20 07:43:43 2016 New Revision: 266870 URL: http://llvm.org/viewvc/llvm-project?rev=266870&view=rev Log: [include-fixer] Add a prototype for a new include fixing tool. Summary: The goal of this tool is fairly simple, look up unknown identifiers in a global database and ad

Re: [PATCH] D19323: Fix cast compiler warning message in include-fixer.

2016-04-20 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. Looks good, thanks! Repository: rL LLVM http://reviews.llvm.org/D19323 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D19356: [Tooling] Inject -resource-dir instead of overwriting argv[0].

2016-04-21 Thread Benjamin Kramer via cfe-commits
bkramer created this revision. bkramer added a reviewer: klimek. bkramer added a subscriber: cfe-commits. Herald added a subscriber: klimek. This allows using a different standard library (the one from argv[0] in the compilation database) with the correct builtins. http://reviews.llvm.org/D19356

r266973 - [Tooling] Inject -resource-dir instead of overwriting argv[0].

2016-04-21 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu Apr 21 05:18:18 2016 New Revision: 266973 URL: http://llvm.org/viewvc/llvm-project?rev=266973&view=rev Log: [Tooling] Inject -resource-dir instead of overwriting argv[0]. This allows using a different standard library (the one from argv[0] in the compilation database) with t

r266975 - Back out the test case for r266973 for now.

2016-04-21 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Thu Apr 21 05:46:14 2016 New Revision: 266975 URL: http://llvm.org/viewvc/llvm-project?rev=266975&view=rev Log: Back out the test case for r266973 for now. It breaks on windows, need to investigate. It's not testing the important part of that change anyways. Modified: cfe/t

Re: [PATCH] D19482: [include-fixer] Add a find-all-symbols tool for include-fixer.

2016-04-26 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. First, please run this through clang-format with LLVM style. This aligns all the & and * to the name instead of the type. There are also some underscore_names left that need conversion to PascalCase. Comment at: include-fixer/find-all-symbols/FindAllSy

Re: [PATCH] D19482: [include-fixer] Add a find-all-symbols tool for include-fixer.

2016-04-26 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg with some minor comments remaining. Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:47 @@ +46,3 @@ + const auto *RD = llvm::dyn_cast(Context); + a

Re: [PATCH] D20496: [include-fixer] Added find-stl-symbols to retrieve symbols (with the correct include header name) from C++ standard STL headers.

2016-05-23 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/find-all-symbols/FindAllSymbols.h:47 @@ +46,3 @@ +protected: + // The way SymbolInfo of a decl is reported can be overrided. + virtual void reportDecl(const SourceManager &SM, const clang::NamedDecl *ND, o

Re: [PATCH] D20566: [find-all-symbols] Added hardcode header mapping from header postfix to header name for STL symbols.

2016-05-24 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/find-all-symbols/tool/STLPostfixHeaderMap.cpp:15 @@ +14,3 @@ + +const HeaderMapCollector::HeaderMap STLPostfixHeaderMap = { +{"include/__stddef_max_align_t.h", ""}, I wonder if it's worth lazy-initializi

[clang-tools-extra] r270581 - [clang-tidy] Don't rely on being available.

2016-05-24 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 24 11:54:26 2016 New Revision: 270581 URL: http://llvm.org/viewvc/llvm-project?rev=270581&view=rev Log: [clang-tidy] Don't rely on being available. The STL isn't necessarily around when running tests. Make our own fake std::array to test this. Modified: clang-tools

[clang-tools-extra] r270682 - [clang-tidy] Fix typo in test file name.

2016-05-25 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Wed May 25 04:44:35 2016 New Revision: 270682 URL: http://llvm.org/viewvc/llvm-project?rev=270682&view=rev Log: [clang-tidy] Fix typo in test file name. polo Added: clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value-macro-header.cpp - copied, changed fro

[clang-tools-extra] r270701 - Include local header with quotes instead of angle brackets.

2016-05-25 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Wed May 25 09:14:52 2016 New Revision: 270701 URL: http://llvm.org/viewvc/llvm-project?rev=270701&view=rev Log: Include local header with quotes instead of angle brackets. This works by accident because we pass '-I.' Modified: clang-tools-extra/trunk/include-fixer/find-all-

r270704 - [AVX512] Don't rely on value names. They're different in release builds.

2016-05-25 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Wed May 25 09:30:01 2016 New Revision: 270704 URL: http://llvm.org/viewvc/llvm-project?rev=270704&view=rev Log: [AVX512] Don't rely on value names. They're different in release builds. Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c Modified: cfe/trunk/test/CodeGen/avx5

Re: [PATCH] D20621: [include-fixer] Create a mode in vim integration to show multiple potential headers.

2016-05-25 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. Can you add some lit tests for the various command line modes clang-include-fixer has now. We can't reasonably test the vim integration but we can tests the bits it's composed of. http://reviews.llvm.org/D20621 ___ cfe-com

Re: [PATCH] D20621: [include-fixer] Create a mode in vim integration to show multiple potential headers.

2016-05-25 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/IncludeFixer.h:51 @@ -50,6 +50,3 @@ - /// Headers to be added. - std::set &Headers; - - /// Replacements are written here. - std::vector &Replacements; + /// The context that contains all information about queried sym

Re: [PATCH] D20621: [include-fixer] Create a mode in vim integration to show multiple potential headers.

2016-05-25 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/tool/clang-include-fixer.py:84 @@ +83,3 @@ +index = 1; +for header in lines[1:]: + choices_message += "&" + str(index) + header + "\n" ioeric wrote: > If there is only one candidate, it doesn't

r270983 - Convert assert to static_assert. NFC.

2016-05-27 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri May 27 06:48:53 2016 New Revision: 270983 URL: http://llvm.org/viewvc/llvm-project?rev=270983&view=rev Log: Convert assert to static_assert. NFC. Modified: cfe/trunk/include/clang/AST/Type.h Modified: cfe/trunk/include/clang/AST/Type.h URL: http://llvm.org/viewvc/llvm-

[clang-tools-extra] r270989 - [include-fixer] Add a missing .h.

2016-05-27 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri May 27 07:49:58 2016 New Revision: 270989 URL: http://llvm.org/viewvc/llvm-project?rev=270989&view=rev Log: [include-fixer] Add a missing .h. Modified: clang-tools-extra/trunk/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp Modified: clang-tools-extra/trunk/inc

r270991 - [Frontend] StringRefize and fix bad indentation.

2016-05-27 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri May 27 07:52:19 2016 New Revision: 270991 URL: http://llvm.org/viewvc/llvm-project?rev=270991&view=rev Log: [Frontend] StringRefize and fix bad indentation. NFC intended. Modified: cfe/trunk/lib/Frontend/HeaderIncludeGen.cpp Modified: cfe/trunk/lib/Frontend/HeaderInclu

r270994 - Turn copies into references as suggested by clang-tidy's performance-unnecessary-copy-initialization.

2016-05-27 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri May 27 08:36:58 2016 New Revision: 270994 URL: http://llvm.org/viewvc/llvm-project?rev=270994&view=rev Log: Turn copies into references as suggested by clang-tidy's performance-unnecessary-copy-initialization. Modified: cfe/trunk/lib/Analysis/CFG.cpp cfe/trunk/lib/D

r270996 - Apply clang-tidy's misc-move-constructor-init throughout Clang.

2016-05-27 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri May 27 09:27:13 2016 New Revision: 270996 URL: http://llvm.org/viewvc/llvm-project?rev=270996&view=rev Log: Apply clang-tidy's misc-move-constructor-init throughout Clang. No functionality change intended, maybe a tiny performance improvement. Modified: cfe/trunk/includ

r271182 - Avoid unnecessary std::string copies. NFC.

2016-05-29 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Sun May 29 06:04:56 2016 New Revision: 271182 URL: http://llvm.org/viewvc/llvm-project?rev=271182&view=rev Log: Avoid unnecessary std::string copies. NFC. Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp cfe/trunk/lib/Tooling/Refactoring.cpp Modified: cfe/trunk/l

Re: [clang-tools-extra] r271207 - [clang-tidy] Fix script adding new clang-tidy check

2016-05-30 Thread Benjamin Kramer via cfe-commits
On Mon, May 30, 2016 at 5:05 PM, Etienne Bergeron via cfe-commits wrote: > Author: etienneb > Date: Mon May 30 10:05:10 2016 > New Revision: 271207 > > URL: http://llvm.org/viewvc/llvm-project?rev=271207&view=rev > Log: > [clang-tidy] Fix script adding new clang-tidy check > > Summary: > The `getN

Re: [PATCH] D20792: [clang-tidy] Remove redundant quote in add_new_check script

2016-05-30 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg, thanks! http://reviews.llvm.org/D20792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

Re: [PATCH] D20734: [clang-format] insert new #includes into correct blocks when cleaning up Replacement with cleanupAroundReplacements().

2016-05-30 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: lib/Format/Format.cpp:1283 @@ +1282,3 @@ + // Returns the priority of the category which \p IncludeName belongs to, and + // if \p CheckMainHeader is true and \p IncldueName is a + // main header, returns 0. Otherwise, returns INT_MAX

Re: [PATCH] D20621: [include-fixer] Create a mode in vim integration to show multiple potential headers.

2016-05-30 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/IncludeFixer.h:71 @@ +70,3 @@ +/// \param FirstIncludeOffset The insertion point for new include directives. +/// -1U(UINT_MAX) indicates uninitialization, which will insert the header at +/// first line. If there is no #inc

Re: [PATCH] D20621: [include-fixer] Create a mode in vim integration to show multiple potential headers.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. LG. Can't wait to use it myself :) http://reviews.llvm.org/D20621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org

Re: [PATCH] D20382: Add postorder support to RecursiveASTVisitor

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. Having postorder traversal makes sense to me. The thing I'm worried about is how much this will bloat object code. RecursiveASTVisitor is already a major contributor to the size of clang's binary and we've hit issues with it in the past (hitting .obj size limits on Wind

Re: [PATCH] D20804: [include-fixer] collect the number of times a symbols is found in an indexing run and use it for symbols popularity ranking.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp:91 @@ -90,2 +90,3 @@ std::set UniqueSymbols; + std::map NumOccurrences; std::mutex SymbolMutex; Can we remove the set now? 2 copies of all SymbolInfos seem

Re: [PATCH] D20804: [include-fixer] collect the number of times a symbols is found in an indexing run and use it for symbols popularity ranking.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg http://reviews.llvm.org/D20804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

r271262 - [CommonOptionsParser] Return source paths as const ref.

2016-05-31 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 31 05:17:46 2016 New Revision: 271262 URL: http://llvm.org/viewvc/llvm-project?rev=271262&view=rev Log: [CommonOptionsParser] Return source paths as const ref. This saves a superfluous copy and makes managing the lifetime of the returned strings a bit easier. Modified:

[clang-tools-extra] r271266 - Make the vim integration output a bit prettier and drop the -debug flag.

2016-05-31 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 31 06:28:34 2016 New Revision: 271266 URL: http://llvm.org/viewvc/llvm-project?rev=271266&view=rev Log: Make the vim integration output a bit prettier and drop the -debug flag. Modified: clang-tools-extra/trunk/include-fixer/tool/clang-include-fixer.py Modified: cla

Re: [PATCH] D20808: [include-fixer] Code cleanup.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg http://reviews.llvm.org/D20808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang-tools-extra] r271270 - [find-all-symbols] Add a test to make sure merging actually works.

2016-05-31 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 31 07:12:19 2016 New Revision: 271270 URL: http://llvm.org/viewvc/llvm-project?rev=271270&view=rev Log: [find-all-symbols] Add a test to make sure merging actually works. Added: clang-tools-extra/trunk/test/include-fixer/Inputs/merge/ clang-tools-extra/trunk/test

Re: [PATCH] D20813: [include-fixer] use tooling::Replacements since the order of replacements don't matter anymore.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. nice cleanup http://reviews.llvm.org/D20813 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D20814: [include-fixer] Rank symbols based on the number of occurrences we found while merging.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer created this revision. bkramer added reviewers: ioeric, djasper. bkramer added a subscriber: cfe-commits. This sorts based on the popularity of the header, not the symbol. If there are mutliple matching symbols in one header we take the maximum popularity for that header and deduplicate. I

r271280 - Avoid unused variable warning in release builds.

2016-05-31 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 31 09:14:42 2016 New Revision: 271280 URL: http://llvm.org/viewvc/llvm-project?rev=271280&view=rev Log: Avoid unused variable warning in release builds. Modified: cfe/trunk/lib/Format/Format.cpp Modified: cfe/trunk/lib/Format/Format.cpp URL: http://llvm.org/viewvc/

[clang-tools-extra] r271283 - [include-fixer] Rank symbols based on the number of occurrences we found while merging.

2016-05-31 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 31 09:33:28 2016 New Revision: 271283 URL: http://llvm.org/viewvc/llvm-project?rev=271283&view=rev Log: [include-fixer] Rank symbols based on the number of occurrences we found while merging. This sorts based on the popularity of the header, not the symbol. If there are

[clang-tools-extra] r271284 - [include-fixer] Use a DenseMap, order doesn't matter here.

2016-05-31 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 31 09:37:10 2016 New Revision: 271284 URL: http://llvm.org/viewvc/llvm-project?rev=271284&view=rev Log: [include-fixer] Use a DenseMap, order doesn't matter here. Modified: clang-tools-extra/trunk/include-fixer/SymbolIndexManager.cpp Modified: clang-tools-extra/trun

[clang-tools-extra] r271285 - [include-fixer] Inline trivial methods.

2016-05-31 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Tue May 31 09:40:10 2016 New Revision: 271285 URL: http://llvm.org/viewvc/llvm-project?rev=271285&view=rev Log: [include-fixer] Inline trivial methods. Putting them into the .cpp file is both more verbose and slower than having them in the header. No functional change intended.

Re: [PATCH] D20816: [include-fixer] use clang-format cleaner to insert header.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. Look at all this annoying preprocessor code going away! I love it. http://reviews.llvm.org/D20816 ___ cfe-commits mailing list cfe-commits@list

Re: [PATCH] D20819: [find-all-symbols] remove dots in SymbolInfo file paths.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. Adding Manuel as a second opinion. I think this is fine but paths are a messy problem, in particular removing .. can break symlinked directories. http://reviews.llvm.org/D20819 ___ cfe-commits mailing list cfe-commits@lists

Re: [PATCH] D20827: [include-fixer] Use YAML format in -output-headers and -insert-header mode.

2016-05-31 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/tool/ClangIncludeFixer.cpp:80 @@ +79,3 @@ +cl::desc("Print the symbol being queried and all its relevant headers in\n" + "the YAML format to stdout:\n" + " ---\n" drop 'the' ===

Re: [PATCH] D20827: [include-fixer] Use YAML format in -output-headers and -insert-header mode.

2016-06-01 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/tool/ClangIncludeFixer.cpp:160 @@ +159,3 @@ + for (const auto &Header : Context.Headers) { +// Escape double quote. +if (Header.front() == '"') Can you just llvm::yaml::escape the string? http://r

Re: [PATCH] D20827: [include-fixer] Use YAML format in -output-headers and -insert-header mode.

2016-06-01 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/tool/ClangIncludeFixer.cpp:160 @@ +159,3 @@ + for (const auto &Header : Context.Headers) { +// Escape double quote. +if (Header.front() == '"') I think we should do the escaping always and not just

Re: [PATCH] D20855: [include-fixer] use includer of .inc header to be the file path of a symbol from .inc header.

2016-06-01 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. This revision is now accepted and ready to land. Comment at: include-fixer/find-all-symbols/PathConfig.cpp:20 @@ +19,3 @@ + llvm::StringRef FilePath; + while (true) { +if (!Loc.isValid() || SM.isInMainFile(Loc)) Maybe add a co

Re: [PATCH] D20902: [include-fixer] added GNU symbols hardcoded header mapping.

2016-06-02 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. Can we limit this to actual glibc headers, i.e. the output of `dpkg-query -L libc6-dev` on Debian/Ubuntu? There are some unrelated headers in there, I don't think we should have them in this list. http://reviews.llvm.org/D20902 __

Re: [PATCH] D20902: [include-fixer] added GNU symbols hardcoded header mapping.

2016-06-03 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. There are still headers in this list that aren't part of glibc, like curses. I'd rather have those not in the list right now and add stuff as-needed later. I hope that other packages usually found in /usr/include are saner so we don't need to add a header map for them.

Re: [PATCH] D20902: [include-fixer] added GNU symbols hardcoded header mapping.

2016-06-03 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg, thanks! http://reviews.llvm.org/D20902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listin

Re: [PATCH] D20950: [include-fixer] Don't add missing header if the unindentified symbol isn't from the main file.

2016-06-03 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. LG. It's a bit sad but I guess the cases where that legitimately can happen due to template weirdness are far outweighed by the cases where we have a non-self contained header. The cases I'v

[PATCH] D20960: [include-fixer] Be smarter about inserting symbols for a prefix.

2016-06-03 Thread Benjamin Kramer via cfe-commits
bkramer created this revision. bkramer added reviewers: hokein, ioeric. bkramer added a subscriber: cfe-commits. If prefix search finds something where nothing can be nested under (e.g. a variable or macro) don't add it to the result. This is for cases like: header.h: extern int a; file.cc: na

[clang-tools-extra] r271671 - [include-fixer] Be smarter about inserting symbols for a prefix.

2016-06-03 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Fri Jun 3 09:07:38 2016 New Revision: 271671 URL: http://llvm.org/viewvc/llvm-project?rev=271671&view=rev Log: [include-fixer] Be smarter about inserting symbols for a prefix. If prefix search finds something where nothing can be nested under (e.g. a variable or macro) don't ad

Re: [PATCH] D20966: [include-fixer] Add the missing header to the file where the unidentified symbol comes from.

2016-06-06 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: include-fixer/IncludeFixer.cpp:104 @@ -103,3 @@ -// class Bar; -// Foo foo; -// Does this patch do the right thing for the test case in the comment? Otherwise we'll try add includes to system headers all

Re: [PATCH] D20467: [include-fixer] Mention more details in the document.

2016-06-06 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. Sorry, this patch somehow got buried in my mail. Comment at: docs/include-fixer.rst:69 @@ +68,3 @@ +Make sure the path of :program:`clang-include-fixer` is in the environment PATH +variable. + Maybe also describe the g:clang_include_fixe

Re: [PATCH] D20467: [include-fixer] Mention more details in the document.

2016-06-06 Thread Benjamin Kramer via cfe-commits
bkramer added inline comments. Comment at: docs/ReleaseNotes.rst:47 @@ -46,2 +46,3 @@ -- Feature1... +- :program:`clang-include-fixer`, a tool provides an automated way of adding + ``#include`` directives for missing symbols in one translation unit. a tool **th

Re: [PATCH] D20467: [include-fixer] Mention more details in the document.

2016-06-06 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. Two more nits, looks good otherwise :) Comment at: docs/include-fixer.rst:73 @@ +72,3 @@ + +You can custonmize the number of headers being showed by setting +``let g:clang_i

Re: [PATCH] D20382: Add postorder support to RecursiveASTVisitor

2016-06-07 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. IMO a 20% release binary size increase is not acceptable. Is there a way to compile in support only if it's actually used? Maybe some constexpr or template magic? http://reviews.llvm.org/D20382 ___ cfe-commits mailing list

Re: [PATCH] D21019: [include-fixer] try to make vim header selection more friendly.

2016-06-07 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. Nice! Can we somehow make the user not press enter after putting in the number? getchar() maybe? http://reviews.llvm.org/D21019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/l

Re: [PATCH] D21019: [include-fixer] try to make vim header selection more friendly.

2016-06-07 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg then. http://reviews.llvm.org/D21019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/

Re: [PATCH] D21132: [include-fixer] Keep dot dot in SymbolInfo file paths.

2016-06-08 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. Ok, let's try this. Maybe it will solve our path problems once and for all. ONCE AND FOR ALL. http://reviews.llvm.org/D21132 ___ cfe-commits m

Re: [clang-tools-extra] r272152 - [include-fixer] Keep dot dot in SymbolInfo file paths.

2016-06-08 Thread Benjamin Kramer via cfe-commits
Turns out that this is causing weirdness when path minimization is disabled, we will insert includes with .. in that case. I don't know how to solve that, maybe still clean up the path in the fixer if minimization is off? On Wed, Jun 8, 2016 at 5:10 PM, Haojian Wu via cfe-commits wrote: > Author:

r272156 - Prune away some unused using decls. NFC.

2016-06-08 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Wed Jun 8 10:34:36 2016 New Revision: 272156 URL: http://llvm.org/viewvc/llvm-project?rev=272156&view=rev Log: Prune away some unused using decls. NFC. Found by clang's misc-unused-using-decls. Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.c

Re: [PATCH] D18081: Make sizeof and alignof a CXCursor_UnaryExpr

2016-06-09 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. lg http://reviews.llvm.org/D18081 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

Re: [PATCH] D18080: CIndex: add support for static_assert

2016-06-09 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. This is fine http://reviews.llvm.org/D18080 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

Re: [PATCH] D21175: [include-fixer] do not index friend function declaration.

2016-06-09 Thread Benjamin Kramer via cfe-commits
bkramer accepted this revision. bkramer added a comment. This revision is now accepted and ready to land. Makes sense. http://reviews.llvm.org/D21175 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

Re: [PATCH] D21181: [include-fixer] give users an option to show N more headers in case there are too many candidates.

2016-06-10 Thread Benjamin Kramer via cfe-commits
bkramer added a comment. I'm not convinced that this use case is common enough to make the interface more complex. Should we remove (a) in favor of this? http://reviews.llvm.org/D21181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

r272520 - Add some std::move where the value is only read otherwise.

2016-06-12 Thread Benjamin Kramer via cfe-commits
Author: d0k Date: Sun Jun 12 15:05:23 2016 New Revision: 272520 URL: http://llvm.org/viewvc/llvm-project?rev=272520&view=rev Log: Add some std::move where the value is only read otherwise. This mostly affects smart pointers. No functionality change intended. Modified: cfe/trunk/include/clang

<    3   4   5   6   7   8   9   10   >