summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash on noreturn conversion in unprototyped function type. Thanks to KeithRichard Smith2016-10-202-2/+13
| | | | | | Walker for spotting the bug. llvm-svn: 284673
* Extend hack to work around bad exception specifications for 'swap' members toRichard Smith2016-10-192-10/+37
| | | | | | also cover libstdc++'s std::__debug::array and std::__profile::array. llvm-svn: 284669
* Use noexcept instead of LLVM_NOEXCEPT now that all compilers support itReid Kleckner2016-10-1910-36/+34
| | | | llvm-svn: 284667
* [cmake] Follow LLVM's lead in creating exported tool targets for clang tools.Michael Gottesman2016-10-191-0/+1
| | | | | | | | | | | | This is needed by downstream projects such as swift to get proper cmake dependency information for LLVM/Clang targets. A few months ago I added support for exporting this information for Clang libraries. In order to be incremental, I did not add support for exporting clang tools as well at that time. Now such support is needed, so I am committing this incremental code. llvm-svn: 284658
* Add optimization to sizeof...(X) handling: if none of parameter pack X'sRichard Smith2016-10-194-1/+130
| | | | | | | | | | | | | | | | | | | | | corresponding arguments are unexpanded pack expansions, we can compute the result without substituting them. This significantly improves the memory usage and performance of make_integer_sequence implementations that do this kind of thing: using result = integer_sequence<T, Ns ..., sizeof...(Ns) + Ns ...>; ... but note that such an implementation will still perform O(sizeof...(Ns)^2) work while building the second pack expansion (we just have a somewhat lower constant now). In principle we could get this down to linear time by caching whether the number of expansions of a pack is constant, or checking whether we're within an alias template before scanning the pack for pack expansions (since that's the only case in which we do substitutions within a dependent context at the moment), but this patch doesn't attempt that. llvm-svn: 284653
* Don't crash generating debug info for VLA in function prototype.Eli Friedman2016-10-192-7/+17
| | | | | | | | Fixes regression from r279445. Differential Revision: https://reviews.llvm.org/D25793 llvm-svn: 284652
* DebugInfo: use uint32_t for alignment variables.Victor Leschuk2016-10-191-17/+17
| | | | | | | | | LLVM now uses uint32_t for DebugInfo alignment for space efficiency, in this patch we change frontend DebugInfo-related variables to uint32_t too. Differential Revision: https://reviews.llvm.org/D25621 llvm-svn: 284651
* [CMake] Add clang-bootstrap-deps targetChris Bieneman2016-10-191-11/+13
| | | | | | | | Having this target allows other parts of the build system to add to the bootstrap dependencies without needing to be defined before the bootstrap targets are created. This will specifically be used connect the builtins build from the LLVM runtimes directory as a dependency of the next build stage. llvm-svn: 284648
* [CUDA] When we emit an error that might have been deferred, also print a ↵Justin Lebar2016-10-1910-82/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | callstack. Summary: Previously, when you did something not allowed in a host+device function and then caused it to be codegen'ed, we would print out an error telling you that you did something bad, but we wouldn't tell you how we decided that the function needed to be codegen'ed. This change causes us to print out a callstack when emitting deferred errors. This is immensely helpful when debugging highly-templated code, where it's often unclear how a function became known-emitted. We only print the callstack once per function, after we print the all deferred errors. This patch also switches all of our hashtables to using canonical FunctionDecls instead of regular FunctionDecls. This prevents a number of bugs, some of which are caught by tests added here, in which we assume that two FDs for the same function have the same pointer value. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25704 llvm-svn: 284647
* [CMake] Support thin LTO in PGO CMake cacheChris Bieneman2016-10-191-2/+2
| | | | | | This allows you to set PGO_INSTRUMENT_LTO=Thin and have it work correctly. llvm-svn: 284646
* [AST] Add CanonicalDeclPtr<T>.Justin Lebar2016-10-191-1/+63
| | | | | | | | | | | | | | | | | | Summary: CanonicalDeclPtr<T> is just like a T*, except it calls T::getCanonicalDecl() on construction. This is useful as the key in a "set of canonical Decls" -- it's much less error-prone than calling getCanonicalDecl() every time you touch the set. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25703 llvm-svn: 284644
* [CUDA] Emit errors for wrong-side calls made on the same line as ↵Justin Lebar2016-10-193-8/+49
| | | | | | | | | | | | | | | | | | | | | | | non-wrong-side calls. Summary: This fixes two related bugs: 1) Previously, if you had a non-wrong side call at some source code location L, we wouldn't emit errors for wrong-side calls that appeared at L. 2) We'd only emit one wrong-side error per source code location, when we actually want to emit it twice if we hit this line more than once due to e.g. template instantiation. Reviewers: tra Subscribers: rnk, cfe-commits Differential Revision: https://reviews.llvm.org/D25702 llvm-svn: 284643
* [ubsan] Drop dependency on a 64-bit arch in a test (NFC)Vedant Kumar2016-10-191-14/+14
| | | | | | | | This should fix: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/46184 llvm-svn: 284642
* [ubsan] Re-work check lines to try to appease a bot (NFC)Vedant Kumar2016-10-191-17/+10
| | | | | | | | | | This bot does not produce the IR I expect -- it's missing some 'handler.dynamic_type_cache_miss:' labels. We don't need to rely on those labels, so get rid of them in hopes of making the bot happy. http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55493 llvm-svn: 284639
* New clang option -mpie-copy-relocations to use copy relocations for PIE builds.Sriraman Tallam2016-10-195-0/+17
| | | | | | Differential Revision: https://reviews.llvm.org/D19996 llvm-svn: 284638
* [ubsan] Use the object pointer's type info for devirtualized callsVedant Kumar2016-10-192-6/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ubsan reports a false positive 'invalid member call' diagnostic on the following example (PR30478): struct Base1 { virtual int f1() { return 1; } }; struct Base2 { virtual int f1() { return 2; } }; struct Derived2 final : Base1, Base2 { int f1() override { return 3; } }; int t1() { Derived2 d; return static_cast<Base2 *>(&d)->f1(); } Adding the "final" attribute to a most-derived class allows clang to devirtualize member calls into an instance of that class. We should pass along the type info of the object pointer to avoid the FP. In this case, that means passing along the type info for 'Derived2' instead of 'Base2' when checking the dynamic type of static_cast<Base2 *>(&d2). Differential Revision: https://reviews.llvm.org/D25448 llvm-svn: 284636
* MS ABI: Fix assert when generating virtual function call with virtual bases ↵Hans Wennborg2016-10-192-9/+23
| | | | | | | | | | | | and -flto (PR30731) getClassAtVTableLocation() was calling ASTRecordLayout::getBaseClassOffset() on a virtual base, causing an assert. Differential Revision: https://reviews.llvm.org/D25779 llvm-svn: 284624
* [mips][msa] Range check MSA intrinsics with immediatesSimon Dardis2016-10-195-56/+671
| | | | | | | | | | | | | | | | This patch teaches clang to range check immediates for MIPS MSA instrinsics. This checking is done strictly in comparison to some existing GCC implementations. E.g. msa_andvi_b(var, 257) does not result in andvi $wX, 1. Similarily msa_ldi_b takes a range of -128 to 127. As part of this effort, correct the existing MSA test as it has both illegal types and immediates. Reviewers: vkalintiris Differential Revision: https://reviews.llvm.org/D25017 llvm-svn: 284620
* [Myriad] Find libc++ headers next to clang binaryDouglas Katzman2016-10-192-11/+18
| | | | llvm-svn: 284617
* Remove unused diagnostics. NFC.Benjamin Kramer2016-10-191-5/+0
| | | | llvm-svn: 284595
* Don't copy replacements in for-range loop. NFC.Benjamin Kramer2016-10-191-1/+1
| | | | llvm-svn: 284589
* [cmake] Use LLVM_CMAKE_PATH for GetSVN scriptMichal Gorny2016-10-191-1/+1
| | | | | | | | Use the LLVM_CMAKE_PATH variable to locate the GetSVN.cmake script. The variable was already available in stand-alone builds, and is also set by LLVM since r284581. llvm-svn: 284582
* [Sema] Gcc compatibility of vector shiftAndrey Bokhanko2016-10-194-10/+71
| | | | | | | | | | | Gcc prints error if elements of left and right parts of a shift have different sizes. This patch is provided the GCC compatibility. Patch by Vladimir Yakovlev. Differential Revision: https://reviews.llvm.org/D24669 llvm-svn: 284579
* [modules] Do not report missing definitions of demoted constexpr variable ↵Vassil Vassilev2016-10-196-1/+43
| | | | | | | | | | | | | | templates. This is a followup to regression introduced in r284284. This should fix our libstdc++ modules builds. https://reviews.llvm.org/D25678 Reviewed by Richard Smith! llvm-svn: 284577
* [clang-format] Add comment manipulation headerEric Liu2016-10-194-15/+71
| | | | | | | | | | | | | | | | | | | Summary: Introduces a separate target for comment manipulation. Currently, comment manipulation is in BreakableComment.cpp. Towards implementing comment reflowing, we want to factor out the comment-related functionality, so it can be reused. Start simple by just moving out getLineCommentIndentPrefix. Patch by Krasimir Georgiev! Reviewers: djasper Subscribers: klimek, beanz, mgorny, modocache Differential Revision: https://reviews.llvm.org/D25725 llvm-svn: 284573
* Resolve exception specifications when selecting an overloaded operator.Richard Smith2016-10-192-0/+4
| | | | llvm-svn: 284556
* [CUDA] Rework tests now that we emit deferred diagnostics during sema. ↵Justin Lebar2016-10-1912-141/+89
| | | | | | | | | | | | | | | | | | | | | | Test-only change. Summary: Previously we had to split out a lot of our tests into a test that checked only immediate errors and a test that checked only deferred errors. This was because, if you emitted any immediate errors, we wouldn't run codegen, where the deferred errors were emitted. We've fixed this, and now emit deferred errors during sema. This lets us merge a bunch of tests, and lets us convert some other tests to -fsyntax-only. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25755 llvm-svn: 284553
* DR1330: instantiate exception-specifications when "needed". We previously didRichard Smith2016-10-188-34/+154
| | | | | | | | | | | | | | | | | | | | not instantiate exception specifications of functions if they were only used in unevaluated contexts (other than 'noexcept' expressions). In C++17 onwards, this becomes essential since the exception specification is now part of the function's type. Note that this means that constructs like the following no longer work: struct A { static T f() noexcept(...); decltype(f()) *p; }; ... because the decltype expression now needs the exception specification of 'f', which has not yet been parsed. llvm-svn: 284549
* Add missing warning for use of C++1z init-statements in C++14 and before.Richard Smith2016-10-183-0/+18
| | | | llvm-svn: 284530
* [c++1z] Fix corner case where we could create a function type whose ↵Richard Smith2016-10-183-9/+26
| | | | | | canonical type is not actually canonical. llvm-svn: 284528
* When two function types have equivalent (but distinct) noexcept ↵Richard Smith2016-10-183-30/+83
| | | | | | specifications, create separate type sugar nodes. This is necessary so that substitution into the exception specification will substitute into the correct expression. llvm-svn: 284519
* Fix clang testsMandeep Singh Grang2016-10-185-0/+10
| | | | | | | | | | | | | | | Summary: Add REQUIRES for target specific tests. Patch by Azharuddin Mohammed. Reviewers: apazos, weimingz, rsmith, ddunbar, spop, mgrang Subscribers: sebpop, llvm-commits Differential Revision: https://reviews.llvm.org/D25574 llvm-svn: 284517
* [CodeGen][ObjC] Do not call objc_storeStrong when initializing aAkira Hatanaka2016-10-186-36/+31
| | | | | | | | | | | | | | | | | | constexpr variable. When compiling a constexpr NSString initialized with an objective-c string literal, CodeGen emits objc_storeStrong on an uninitialized alloca, which causes a crash. This patch folds the code in EmitScalarInit into EmitStoreThroughLValue and fixes the crash by calling objc_retain on the string instead of using objc_storeStrong. rdar://problem/28562009 Differential Revision: https://reviews.llvm.org/D25547 llvm-svn: 284516
* Drop a redundant ".get()" call (NFC)Vedant Kumar2016-10-181-1/+1
| | | | | | Pointed out by Malcolm Parsons. llvm-svn: 284510
* [cmake] Update lit search to match the one in LLVMMichal Gorny2016-10-181-2/+5
| | | | | | | | | | | Update the lit search logic to support all names supported in LLVM (since r283029). The search order (i.e. PATHS vs HINTS) does no really matter since the established path is not used, except for determining whether lit is available. Differential Revision: https://reviews.llvm.org/D23745 llvm-svn: 284496
* Revert r284265 "[Sema] Refactor context checking for availability diagnostics"Erik Pilkington2016-10-185-99/+123
| | | | | | This has a bug in it, pointed out by Bob Wilson! llvm-svn: 284486
* alpha.core.UnreachableCode - don't warn about unreachable code inside macroDaniel Marjamaki2016-10-182-0/+15
| | | | | | | | In macros, 'do {...} while (0)' is often used. Don't warn about the condition 0 when it is unreachable. Differential Revision: https://reviews.llvm.org/D25606 llvm-svn: 284477
* [analyzer] Add NumberObjectConversion checker.Artem Dergachev2016-10-186-0/+431
| | | | | | | | | | | | | | | | | When dealing with objects that represent numbers, such as Objective-C NSNumber, the language provides little protection from accidentally interpreting the value of a pointer to such object as the value of the number represented by the object. Results of such mis-interpretation may be unexpected. The checker attempts to fill this gap in cases when the code is obviously incorrect. With "Pedantic" option enabled, this checker enforces a coding style to completely prevent errors of this kind (off by default). Differential Revision: https://reviews.llvm.org/D22968 llvm-svn: 284473
* [CodeCompletion] Add a block property setter completion resultAlex Lorenz2016-10-187-28/+153
| | | | | | | | | | | | | | | | | | This commit changes code completion results for Objective-C block properties: clang now suggests an additional completion result that displays the block property together with '=' and the block literal placeholder for the appropriate readwrite block properties. This commit uses a simple heuristic to determine when it's appropriate to suggest a setter completion for block properties: the additional block setter completion is provided iff the member access that's being completed is a standalone statement. rdar://28481726 Differential Revision: https://reviews.llvm.org/D25520 llvm-svn: 284472
* [CodeCompletion][NFC] Extract a function that formats block placeholders.Alex Lorenz2016-10-181-12/+35
| | | | | | | | | | This commit extracts a new function named `formatBlockPlaceholder` from the function `FormatFunctionParameter` so that it can be reused in follow-up commits that improve code completion for block property setters. Differential Revision: https://reviews.llvm.org/D25519 llvm-svn: 284468
* [CodeCompletion][NFC] Extract a function that looks for block decl type locs.Alex Lorenz2016-10-181-37/+50
| | | | | | | | | | This commit extracts a new function named `findTypeLocationForBlockDecl` from the function `FormatFunctionParameter` so that it can be reused in follow-up commits that improve code completion for block property setters. Differential Revision: https://reviews.llvm.org/D25519 llvm-svn: 284467
* [libclang] Add missing cursor kinds to python bindings.Igor Kudrin2016-10-181-0/+128
| | | | | | Differential Revision: https://reviews.llvm.org/D25673 llvm-svn: 284464
* [libclang] Fix a failure in a test for python bindings on ↵Igor Kudrin2016-10-181-1/+2
| | | | | | | | | | CursorKind.OVERLOAD_CANDIDATE. The test fails because the value does not lay in any existing group. Differential Revision: https://reviews.llvm.org/D25470 llvm-svn: 284463
* [c++1z] Include "noexcept" in builtin function types where appropriate. FixesRichard Smith2016-10-183-1/+13
| | | | | | | an assertion failure looking up a matching ::operator delete for __builtin_operator_delete. llvm-svn: 284458
* [c++1z] Use canonical expression equivalence to determine whether two differentRichard Smith2016-10-184-15/+29
| | | | | | | | | dependent noexcept specifications result in the same canonical function type. We still use non-canonical hashing when deduplicating type sugar so that diagnostics will point to the right place. llvm-svn: 284457
* [analyzer] Update alpha and potential checker documentation, esp. alpha.valistDominic Chen2016-10-182-65/+78
| | | | | | | | | | | | | | | Summary: Move alpha.valist from potential to alpha since it was implemented in D15227 Cleanup some HTML comments, add a missing link Reviewers: jordan_rose, zaks.anna Subscribers: cfe-commits, xazax.hun Differential Revision: https://reviews.llvm.org/D25663 llvm-svn: 284445
* [CMake] Add a few default passthrough variables for bootstrap buildsChris Bieneman2016-10-181-1/+3
| | | | | | This just passes through a few missing CMake variables for multi-stage builds. llvm-svn: 284443
* [Basic] unique_ptr-ify SourceManager::MacroArgsCacheMap (NFC)Vedant Kumar2016-10-182-11/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D25711 llvm-svn: 284442
* [Driver] Use stem rather than filename for executable namePetr Hosek2016-10-171-1/+1
| | | | | | | | | | When comparing the linker name in Fuchsia driver, use stem rather than filename to get the name of the linker becase on Windows, the filename will have an extension. Differential Revision: https://reviews.llvm.org/D25700 llvm-svn: 284430
* Explicitly pass an isysroot to avoid the SDKROOT overriding the deployment ↵Adrian Prantl2016-10-171-2/+7
| | | | | | | | target. This fixes the green dragon builders after r284416. llvm-svn: 284423
OpenPOWER on IntegriCloud