[PATCH] D36806: Switch to cantFail(), since it does the same assertion.

2017-10-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. LGTM... https://reviews.llvm.org/D36806 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36347: Add new script to launch lldb and set breakpoints for diagnostics all diagnostics seen.

2017-10-20 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In https://reviews.llvm.org/D36347#901885, @zturner wrote: > One possible reason for why this never got any traction is that > `lldb-commits` wasn't added as a subscriber. While it's true that the tagged > people should have chimed in, having the whole commits list wi

[PATCH] D36347: Add new script to launch lldb and set breakpoints for diagnostics all diagnostics seen.

2017-10-23 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. Thanks for all the feedback. I'll report back once I've addressed all your suggestions. Thanks again... https://reviews.llvm.org/D36347 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D47912: [CMake] Consider LLVM_APPEND_VC_REV when generating SVNVersion.inc

2018-09-09 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. Sorry for the late comment... Are you amending an llvm commit or a clang commit? The reason I ask is that if I amend an llvm commit, I have to update around 78 targets (llvm + clang + libcxx + libcxxabi + libunwind), but if I amend a clang commit, I only have to upda

[PATCH] D17215: [Sema] Fix PR14211 Crash for explicit instantiation of overloaded template function within class template

2017-06-05 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 101482. hintonda added a comment. Fixes PR14211. Since getMostSpecialized only handles FunctionTemplateDecl matches, keep track of non-FunctionTemplateDecl matches and only call getMostSpecialized if no non-FunctionTemplateDecl matches are found. Added test

[PATCH] D17215: [Sema] Fix PR14211 Crash for explicit instantiation of overloaded template function within class template

2017-06-05 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 101503. hintonda added a comment. - Addressed comments. https://reviews.llvm.org/D17215 Files: lib/Sema/SemaTemplate.cpp test/CXX/temp/temp.decls/temp.mem/p5.cpp Index: test/CXX/temp/temp.decls/temp.mem/p5.cpp

[PATCH] D17215: [Sema] Fix PR14211 Crash for explicit instantiation of overloaded template function within class template

2017-06-05 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. Great, thanks John. Yes, that's correct -- I do not have commit access. https://reviews.llvm.org/D17215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-06 Thread don hinton via Phabricator via cfe-commits
hintonda reopened this revision. hintonda added a comment. This revision is now accepted and ready to land. Reopening due to test failures on Linux -- was rolled back. https://reviews.llvm.org/D20693 ___ cfe-commits mailing list cfe-commits@lists.ll

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-06 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 101659. hintonda added a comment. Herald added a subscriber: xazax.hun. In order to fix diagnostic corruption in some of the buildbot tests (unable to reproduce locally): - make NoexceptMacro a static variable so it's lifetime doesn't end when UseNoexceptCh

[PATCH] D17215: [Sema] Fix PR14211 Crash for explicit instantiation of overloaded template function within class template

2017-06-06 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. Since I don't have commit access, could you commit this for me? thanks... don https://reviews.llvm.org/D17215 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 101708. hintonda added a comment. - Rollback to previous version: rebased + r293218 and r293234. https://reviews.llvm.org/D20693 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseNoexceptC

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. Unfortunately, the logs are no longer available, and I don't have copies. However, I think I know what's going on, so I'll try to submit a fix later today. https://reviews.llvm.org/D20693 ___ cfe-commits mailing list cfe-

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 101722. hintonda added a comment. - Only pass %2 parameter if %2 is included in format. https://reviews.llvm.org/D20693 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseNoexceptCheck.cp

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. I have not, as yet, been able to reproduce the buildbot failures. They were essentially intermittent seg-faults, and corrupt diag output. I will work on creating a test that can reproduce the problem. https://reviews.llvm.org/D20693 ___

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 101819. hintonda added a comment. - Rollback last change. https://reviews.llvm.org/D20693 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseNoexceptCheck.cpp clang-tidy/modernize/UseNoex

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. Just ran asan on linux and we have a heap-use-after-free in the std::string ctor. Here's a partial stack dump: 4980==ERROR: AddressSanitizer: heap-use-after-free on address 0x60424328 at pc 0x0057ad32 bp 0x7ffd240a7f50 sp 0x7ffd240a7700 ---

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. btw, here's how I built it, in case that matters... CC=../../4.0.0/build/Release/bin/clang CXX=../../4.0.0/build/Release/bin/clang++ \ cmake ../../llvm/ \ -GNinja \ -DLLVM_USE_SANITIZER=Address \ -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_TARGETS_TO_BUILD="X86" \ -DLLVM_P

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. Here's a simple example that demonstrates the corruption I'm seeing: #include "llvm/ADT/StringRef.h" int main() { std::string ss = ""; llvm::StringRef Ref = true ? "noexcept" : ss; std::string s = Ref; return 0; } https://reviews.llvm.org/D20693 _

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-07 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 101860. hintonda added a comment. - Make sure types for ternary operator are the same. https://reviews.llvm.org/D20693 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UseNoexceptCheck.cpp

[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

2017-06-08 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. Great, thanks for you help. Could you commit this for me? https://reviews.llvm.org/D20693 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-09 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 102049. hintonda added a comment. Rebase and move test to existing file. https://reviews.llvm.org/D17143 Files: lib/Sema/SemaExprCXX.cpp test/SemaCXX/nested-name-spec.cpp Index: test/SemaCXX/nested-name-spec.cpp ==

[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-09 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 102103. hintonda added a comment. - Addressed comments. https://reviews.llvm.org/D17143 Files: lib/Sema/SemaExprCXX.cpp test/SemaCXX/nested-name-spec.cpp Index: test/SemaCXX/nested-name-spec.cpp ===

[PATCH] D17143: [Sema] PR25156 Crash when parsing dtor call on incomplete type

2017-06-11 Thread don hinton via Phabricator via cfe-commits
hintonda closed this revision. hintonda added a comment. Committed in r305169. https://reviews.llvm.org/D17143 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D16971: [Sema] PR26077 Fixed crash when partial specialization is missing required parameters

2017-06-12 Thread don hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 102292. hintonda added a comment. Rebase, fix test, and add FIXME note. https://reviews.llvm.org/D16971 Files: lib/Sema/SemaTemplate.cpp test/SemaTemplate/partial-spec-fully-specified.cpp Index: test/SemaTemplate/partial-spec-fully-specified.cpp

[PATCH] D34179: [SEMA] PR32318 Handle -ast-dump-all properly.

2017-06-13 Thread don hinton via Phabricator via cfe-commits
hintonda created this revision. Handle -ast-dump-all when passed as the only option. https://reviews.llvm.org/D34179 Files: lib/Frontend/ASTConsumers.cpp test/Coverage/ast-printing.c test/Coverage/ast-printing.cpp Index: test/Coverage/ast-printing.cpp ===

[PATCH] D34179: [Frontend] PR32318 Handle -ast-dump-all properly.

2017-06-14 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. Great, thanks Aaron. Could you commit it for me when you get a chance? https://reviews.llvm.org/D34179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34179: [Frontend] PR32318 Handle -ast-dump-all properly.

2017-06-14 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. I have, but just haven't heard back yet... Thanks again... https://reviews.llvm.org/D34179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D16971: [Sema] PR26077 Fixed crash when partial specialization is missing required parameters

2017-06-19 Thread don hinton via Phabricator via cfe-commits
hintonda added a comment. ping... https://reviews.llvm.org/D16971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D34383: [Sema] PR32953: Fix hard crash of implicit instantiation of undefined template preceeded by scoped variable

2017-06-19 Thread don hinton via Phabricator via cfe-commits
hintonda created this revision. Reset ScopeSpec when parsing class, struct, etc.. Fixes PR32953. https://reviews.llvm.org/D34383 Files: lib/Parse/ParseDecl.cpp test/SemaTemplate/instantiate-complete.cpp Index: test/SemaTemplate/instantiate-complete.cpp ===

[PATCH] D41248: [libcxx] Suppress unused warning on apple.

2017-12-14 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added a reviewer: EricWF. This warning is already suppressed on non-apple platforms, so this change just suppresses it on apple as well. Repository: rCXX libc++ https://reviews.llvm.org/D41248 Files: src/experimental/filesystem/operations.cpp Inde

[PATCH] D41259: [debuginfo] Remove temporary FIXME.

2017-12-14 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: zturner, aprantl. Herald added a subscriber: JDevlieghere. Now that r320495, "[debuginfo-tests] Support moving debuginfo-tests to llvm/projects," has landed, remove temporary FIXME that supported the old mechanism. Repository: rC Clang

[PATCH] D24933: Enable configuration files in clang

2017-12-14 Thread Don Hinton via Phabricator via cfe-commits
hintonda added inline comments. Comment at: include/clang/Config/config.h.cmake:40 +#cmakedefine CLANG_CONFIG_FILE_SYSTEM_DIR ${CLANG_CONFIG_FILE_SYSTEM_DIR} +#cmakedefine CLANG_CONFIG_FILE_USER_DIR ${CLANG_CONFIG_FILE_USER_DIR} + These need to be in quotes since

[PATCH] D41248: [libcxx] Suppress unused warning on apple.

2017-12-24 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. ping... Repository: rCXX libc++ https://reviews.llvm.org/D41248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41621: [cmake] Fix path problems when cross compiling.

2017-12-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: EricWF, compnerd, phosek, beanz. Herald added a subscriber: mgorny. When cross compiling, users can set CMAKE_FIND_ROOT_PATH to the sysroot of the TARGET system which adds the sysroot prefix to the paths used in the FIND_XXX commands. Sinc

[PATCH] D41622: [cmake] Fix path and flag problems when cross compiling.

2017-12-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: EricWF, compnerd, phosek, vkalintiris, beanz. Herald added a subscriber: mgorny. When cross compiling, users can set CMAKE_FIND_ROOT_PATH to the sysroot of the TARGET system which adds the sysroot prefix to the paths used in the FIND_XXX co

[PATCH] D41623: [cmake] Fix path problems when cross compiling.

2017-12-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: EricWF, compnerd, phosek, beanz. Herald added a subscriber: mgorny. When cross compiling, users can set CMAKE_FIND_ROOT_PATH to the sysroot of the TARGET system which adds the sysroot prefix to the paths used in the FIND_XXX commands. Sinc

[PATCH] D41623: [cmake] [libcxxabi] Fix path problems when cross compiling.

2017-12-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In https://reviews.llvm.org/D41623#965271, @compnerd wrote: > I think that it might be better to handle this as a single global change: > > if(CMAKE_FIND_ROOT_PATH) > set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER) > endif() When I cross compile on Darwin and targ

[PATCH] D41622: [cmake] [libcxx] Fix path and flag problems when cross compiling.

2017-12-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In https://reviews.llvm.org/D41622#965280, @phosek wrote: > Would it be possible to split the `CMAKE_REQUIRED_FLAGS` fix into a separate > change since it's unrelated to the `CMAKE_FIND_ROOT_PATH` bit? Sure, but both are needed to actually work. This fixes cross comp

[PATCH] D41622: [cmake] [libcxx] Fix path and flag problems when cross compiling.

2017-12-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. Btw, here's the WIP toolchain file I"m using, which might help clear up why these changes is necessary: https://github.com/donhinton/misc/blob/master/cmake/linux-toolchain.cmake Repository: rCXX libc++ https://reviews.llvm.org/D41622 __

[PATCH] D41660: [cmake] Add new linux toolchain file

2018-01-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: compnerd, beanz, phosek. Herald added a subscriber: mgorny. Add new linux toolchain file that allows cross compiling to linux from other systems, e.g., Darwin. Also, add a new variable, ADDITIONAL_CLANG_BOOTSTRAP_DEPS, which allows adding

[PATCH] D41660: [cmake] Add new linux toolchain file

2018-01-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In https://reviews.llvm.org/D41660#965656, @smeenai wrote: > Why is this a cache file rather than a toolchain file (but passing itself as > a toolchain file to CMake under some circumstances?) Aren't toolchain files > traditionally used for cross-compilation? Thanks

[PATCH] D41660: [cmake] Add new linux toolchain file

2018-01-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 128409. hintonda added a comment. Use CMAKE_(C|CXX)_COMPILER_TARGET instead of CMAKE_(C|CXX)_COMPILER_ARG1, and pass all target variables via CLANG_BOOTSTRAP_CMAKE_ARGS. Add variable tests and Fix/update comments. Repository: rC Clang https://reviews.ll

[PATCH] D41660: [cmake] Add new linux toolchain file

2018-01-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In https://reviews.llvm.org/D41660#965877, @beanz wrote: > You should split the CMake cache file you created into two files, (1) a CMake > Cache to manage the build configuration and (2) a tool chain file for > targeting Linux. As @semeenai pointed out we absolutly wan

[PATCH] D41660: [cmake] Add new linux toolchain file

2018-01-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In https://reviews.llvm.org/D41660#965935, @hintonda wrote: > In https://reviews.llvm.org/D41660#965877, @beanz wrote: > > > You should split the CMake cache file you created into two files, (1) a > > CMake Cache to manage the build configuration and (2) a tool chain fi

[PATCH] D41660: [cmake] Add new linux toolchain file

2018-01-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In https://reviews.llvm.org/D41660#966023, @phosek wrote: > @hintonda I think this should be a platform file in > https://github.com/llvm-mirror/llvm/tree/master/cmake/platforms rather than > Clang cache file. Platform files are concerned with the host platform > (inc

[PATCH] D41660: [cmake] Add new linux toolchain file

2018-01-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda abandoned this revision. hintonda added a comment. Thanks for all your suggestions. Planning to rework and move the toolchain specific part to llvm/cmake/platform and abandon the cache part altogether. Repository: rC Clang https://reviews.llvm.org/D41660

[PATCH] D41807: [cmake] Delete redundant install command for clang-refactor.

2018-01-06 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: arphaman, beanz. Herald added a subscriber: mgorny. Delete redundant install command for clang-refactor. Install targets for clang tools are controled by CLANG_BUILD_TOOLS, and when OFF, cmake issues the following warning: WARNING: Target

[PATCH] D41623: [cmake] [libcxxabi] Fix path problems when cross compiling.

2018-01-06 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. ping... Repository: rCXXA libc++abi https://reviews.llvm.org/D41623 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41622: [cmake] [libcxx] Fix path and flag problems when cross compiling.

2018-01-06 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. ping... Repository: rCXX libc++ https://reviews.llvm.org/D41622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41621: [cmake] [libunwind] Fix path problems when cross compiling.

2018-01-06 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. ping... https://reviews.llvm.org/D41621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D41829: [cmake] Add cache file to bootstrap 2-stage linux cross compile on Darwin.

2018-01-08 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: beanz, compnerd, phosek, smeenai. Herald added a subscriber: mgorny. Add cache file to bootstrap 2-stage linux cross compile on Darwin. Repository: rC Clang https://reviews.llvm.org/D41829 Files: cmake/caches/Linux.cmake Index: cm

[PATCH] D41829: [cmake] Add cache file to bootstrap 2-stage linux cross compile on Darwin.

2018-01-08 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 129028. hintonda added a comment. - Also pass LLVM_CONFIG_EXE. Repository: rC Clang https://reviews.llvm.org/D41829 Files: cmake/caches/Linux.cmake Index: cmake/caches/Linux.cmake === -

[PATCH] D59529: Refactor cast<>'s in if conditionals, which can only assert on failure.

2019-03-18 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added a reviewer: rjmccall. Herald added a reviewer: martong. Herald added a reviewer: shafik. Herald added a project: clang. This patch refactors several instances of cast<> used in if conditionals. Since cast<> asserts on failure, the else branch can nev

[PATCH] D17407: [Sema] PR25755 Fix crash when initializing out-of-order struct references

2019-03-22 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 191828. hintonda added a comment. Herald added a subscriber: jdoerfert. Herald added a project: clang. - Initial checkin from original D17407 . - Refactored code and simplify tests based on review comments. Repository: rG

[PATCH] D17407: [Sema] PR25755 Handle out of order designated initializers

2019-03-22 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D17407#1439029 , @xbolva00 wrote: > Please check also https://bugs.llvm.org/show_bug.cgi?id=40030 Thanks for pointing that out. I was mainly handling asserts, but will add the restrictions as well. Repository: rG LLVM G

[PATCH] D17407: [Sema] PR25755 Handle out of order designated initializers

2019-03-22 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. I took a look at C++ designator restrictions shown here aggregate initialization , and believe it to be orthogonal to this change. Thus, I'd prefer to put that in a separate patch. However, based o

[PATCH] D17407: [Sema] PR25755 Handle out of order designated initializers

2019-03-23 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D17407#1439029 , @xbolva00 wrote: > Please check also https://bugs.llvm.org/show_bug.cgi?id=40030 If you compile with -pedantic, you'll get the following warning: `warning: designated initializers are a C99 feature [-Wc99-e

[PATCH] D59746: [LibTooling] Fix '-h' option

2019-03-24 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added a reviewer: alexfh. Herald added a project: clang. LibTooling's '-h' option was intended to be as an alias for '-help', but since the '-help' option is declared as a function scoped static, it isn't visible, leaving it to individual clients to handle

[PATCH] D59746: [LibTooling] Fix '-h' option

2019-03-24 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. A better alternative would have been to add a cl::aliasopt for '-h' in llvm's CommandLineParser when '-help' was first added. However, that's no longer possible since some llvm based tools already use '-h' for other purposes. Repository: rG LLVM Github Monorepo CH

[PATCH] D59754: [Sema] Add c++2a designator initializer warnings

2019-03-24 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: rsmith, xbolva00. Herald added a project: clang. Basic designator initializers are allowed in c++2a, so only issue warnings for the extended ones that aren't allowed: - out of order - nested - arrays - mixed Repository: rG LLVM Githu

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-24 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192049. hintonda added a comment. - Fix variable typo/spellings, and add missing flag assignment and additional test to catch it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked 2 inline comments as done. hintonda added a comment. Thanks for the review. Comment at: clang/lib/Sema/SemaInit.cpp:2017 + auto LastIdx = Field != FieldEnd + ? Field->getFieldIndex() Rakete wrote: > Can `Field`

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:30 +// out of order designators +A a1 = {.y = 1, .x = 2}; // expected-warning {{designated initializers are a C99 feature}} + --

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda created this revision. hintonda added reviewers: alexfh, rjmccall. Herald added subscribers: xazax.hun, mgorny. Herald added a project: clang. Finds cases of cast<> used as the condition of a conditional statements which will assert on failure in Debug builds. The use of cast<> implies t

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:23 -typedef llvm::SmallSet HeaderFileExtensionsSet; +typedef SmallSet HeaderFileExtensionsSet; Eugene.Zelenko

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:23 -typedef llvm::SmallSet HeaderFileExtensionsSet; +typedef SmallSet HeaderFileExtensionsSet; hintonda wrote

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp:30 +// out of order designators +A a1 = {.y = 1, .x = 2}; // expected-warning {{designated initializers are a C99 feature}} + --

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:2044 + : std::distance(RD->field_begin(), RD->field_end()); + if (VerifyOnly && (LastIdx >= NextIdx || HasNonDesignatedInit) && +

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192232. hintonda added a comment. - Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.org/D59754 Files: clang/lib/Sema/SemaInit.cpp clang/test/SemaCXX/cxx2a-i

[PATCH] D59754: [Sema] Add c++2a designated initializer warnings

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192233. hintonda added a comment. - Missed one set of braces. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59754/new/ https://reviews.llvm.org/D59754 Files: clang/lib/Sema/SemaInit.cpp clang/test/SemaCXX

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192234. hintonda added a comment. - Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-tidy/llvm/AvoidCastInConditional

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:17 +using llvm::SmallSet; + Eugene.Zelenko wrote: > It'll be easier to use llvm::SmallSet in using statement. U

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:17 +using llvm::SmallSet; + hintonda wrote: > Eugene.Zelenko wrote: > > It'll be easier to use llvm::SmallSet i

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-25 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192238. hintonda added a comment. - Address additional comments, and move to LLVM.h. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-26 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D59802#1443340 , @aaron.ballman wrote: > Should this check also try to find this pattern: > > if (dyn_cast(Bobble)) > ... > > > in order to recommend the proper replacement: > > if (isa(Bobble)) > ... > > > I ask b

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-26 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D59802#1443451 , @hintonda wrote: > In D59802#1443340 , @aaron.ballman > wrote: > > > Should this check also try to find this pattern: > > > > if (dyn_cast(Bobble)) > > ... > > >

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-26 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D59802#1443527 , @aaron.ballman wrote: > Would it make sense to transform `if (dyn_cast_or_null(Obj))` into `if > (Obj && isa(Obj))` or are there bad transformations from that? Sure, that sounds reasonable. I only see abo

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-26 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192370. hintonda added a comment. - Address additional comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-tidy/llvm/AvoidCastIn

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-27 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192416. hintonda added a comment. - Added dyn_cast and dyn_cast_or_null, and provided fixit's for all of them. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files:

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. I looked at the IR generated at `-O2`, and found that while `if (isa(y))` is a modest win over `if (dyn_cast(y)`, `if (dyn_cast_or_null(y))` generates exactly the same IR that `if(y && isa(y))` does. Also, if `y` is actually an expression that makes a function call,

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192577. hintonda added a comment. - Removed the dyn_cast_or_null replacements. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-tidy/ll

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192754. hintonda added a comment. - Add replacement of `y && cast(y)` with `dyn_cast_or_null(y)`, which is at least as efficient, and can be a big win if `y` is a function call. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192756. hintonda added a comment. - Remove commented code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-tidy/llvm/AvoidCastInCondit

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added a comment. Comment at: clang-tools-extra/clang-tidy/llvm/AvoidCastInConditionalCheck.cpp:73 + Result.Nodes.getNodeAs("cast-assign")) { +auto StartLoc = MatchedDecl->getCallee()->getExprLoc(); +auto EndL

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D59802#1447127 , @Eugene.Zelenko wrote: > In D59802#1447108 , @hintonda wrote: > > > > > > It's good idea to follow modernize-use-auto convention without introducing > exceptions. No

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192761. hintonda added a comment. - Remove spurious auto's. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-tidy/llvm/AvoidCastInCondi

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. If the `dyn_cast_or_null<>` replacement is acceptable, I'll update the documentation and warning message -- suggestions are appreciated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D5

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-28 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192778. hintonda added a comment. - Add isa and dyn_cast when matching for dyn_cast_or_null replacement. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192844. hintonda marked 3 inline comments as done. hintonda added a comment. - Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-e

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D59802#1447560 , @aaron.ballman wrote: > In D59802#1445566 , @hintonda wrote: > > > I looked at the IR generated at `-O2`, and found that while `if > > (isa(y))` is a modest win over `

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192854. hintonda added a comment. - Improve warning message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-tidy/llvm/AvoidCastInCond

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 192939. hintonda added a comment. - Added matcher, and reordered tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D59802 Files: clang-tools-extra/clang-tidy/llvm/Avo

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-03-29 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a comment. In D59802#1448574 , @hintonda wrote: > - Added matcher, and reordered tests. Commandline ate my ticks... ;-( Should be added `isMacroID` matcher. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-04-01 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:21 -typedef llvm::SmallSet HeaderFileExtensionsSet; +using HeaderFileExtensionsSet = ::llvm::SmallSet; aaron.

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-04-01 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/HeaderFileExtensionsUtils.h:21 -typedef llvm::SmallSet HeaderFileExtensionsSet; +using HeaderFileExtensionsSet = ::llvm::SmallSet; aaron.

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-04-01 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/llvm/AvoidCastInConditionalCheck.cpp:125-126 + +diag(MatchedDecl->getBeginLoc(), "return value from dyn_cast<> not used") +<< FixItHint::CreateReplacem

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-04-01 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/llvm/AvoidCastInConditionalCheck.cpp:145 + +diag(MatchedDecl->getBeginLoc(), "use dyn_cast_or_null") +<< FixItHint::CreateReplacement(SourceRange(Match

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-04-01 Thread Don Hinton via Phabricator via cfe-commits
hintonda updated this revision to Diff 193176. hintonda added a comment. - Defer HeaderFileExtionsUtils.h bugfix to separate patch. - Simplify code per comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59802/new/ https://reviews.llvm.org/D598

[PATCH] D59746: [LibTooling] Fix '-h' option

2019-04-01 Thread Don Hinton via Phabricator via cfe-commits
hintonda added a subscriber: arphaman. hintonda added a comment. @arphaman, since you added the `-h` option in D37618 , could you let me know if this change is okay with you? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D59802: [clang-tidy] Add new checker: llvm-avoid-cast-in-conditional

2019-04-02 Thread Don Hinton via Phabricator via cfe-commits
hintonda marked an inline comment as done. hintonda added inline comments. Comment at: clang-tools-extra/clang-tidy/llvm/AvoidCastInConditionalCheck.cpp:18 + +AST_MATCHER(Expr, isMacroID) { return Node.getExprLoc().isMacroID(); } +} // namespace ast_matchers @aar

  1   2   3   4   >