summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary distinction between Ref_Compatible andRichard Smith2016-10-214-20/+10
| | | | | | | Ref_Compatible_With_Added_Qualification. We always treated these two values the same way. llvm-svn: 284895
* DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.Richard Smith2016-10-2129-216/+574
| | | | | | | | | | | | | | | | | | | | | | | | | | This has two significant effects: 1) Direct relational comparisons between null pointer constants (0 and nullopt) and pointers are now ill-formed. This was always the case for C, and it appears that C++ only ever permitted by accident. For instance, cases like nullptr < &a are now rejected. 2) Comparisons and conditional operators between differently-cv-qualified pointer types now work, and produce a composite type that both source pointer types can convert to (when possible). For instance, comparison between 'int **' and 'const int **' is now valid, and uses an intermediate type of 'const int *const *'. Clang previously supported #2 as an extension. We do not accept the cases in #1 as an extension. I've tested a fair amount of code to check that this doesn't break it, but if it turns out that someone is relying on this, we can easily add it back as an extension. This is a re-commit of r284800. llvm-svn: 284890
* Switch SmallSetVector to use DenseSet when it overflows its inline space.Justin Lebar2016-10-214-7/+12
| | | | | | | | | | | | | | | | | | | | Summary: SetVector already used DenseSet, but SmallSetVector used std::set. This leads to surprising performance differences. Moreover, it means that the set of key types accepted by SetVector and SmallSetVector are quite different! In order to make this change, we had to convert some callsites that used SmallSetVector<std::string, N> to use SmallSetVector<CachedHashString, N> instead. Reviewers: timshen Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25648 llvm-svn: 284887
* [Sema] Store a SourceRange for multi-token builtin typesMalcolm Parsons2016-10-215-26/+129
| | | | | | | | | | | | | | | | | | | Summary: clang-tidy's modernize-use-auto check uses the SourceRange of a TypeLoc when replacing the type with auto. This was producing the wrong result for multi-token builtin types like long long: -long long *ll = new long long(); +auto long *ll = new long long(); Reviewers: alexfh, hokein, rsmith, Prazek, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25363 llvm-svn: 284885
* [CUDA] Simplify some repeated diagnostic expectations in CUDA tests.Justin Lebar2016-10-214-22/+7
| | | | | | | | Instead of repeating the diagnostic, use "expected-note N". Test-only change. llvm-svn: 284882
* Declare H and H new/delete.Artem Belevich2016-10-212-23/+78
| | | | llvm-svn: 284879
* Remove accidentally checked in assert.Vassil Vassilev2016-10-211-3/+0
| | | | | | Thanks to Manman for spotting this. llvm-svn: 284877
* [CUDA] Use FunctionDeclAndLoc for the Sema::LocsWithCUDACallDiags hashtable.Justin Lebar2016-10-212-8/+35
| | | | | | | | | | | | Summary: NFC Reviewers: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25797 llvm-svn: 284869
* Remove move constructors that are identical to the generated default move ctor.Benjamin Kramer2016-10-218-63/+4
| | | | llvm-svn: 284856
* Removed unused function argument. NFC.Artem Belevich2016-10-213-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D25839 llvm-svn: 284843
* Remove unnecessary x86 backend requirements from OpenMP testsReid Kleckner2016-10-2152-52/+1
| | | | | | Clang can generate LLVM IR for x86 without a registered x86 backend. llvm-svn: 284836
* Remove non-existing file from modulemap.Benjamin Kramer2016-10-211-1/+0
| | | | | | This picked up a builtin header if it happened to be available. llvm-svn: 284815
* Revert "DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' ↵Renato Golin2016-10-2129-574/+216
| | | | | | | | rules." This reverts commit r284800, as it failed all ARM/AArch64 bots. llvm-svn: 284811
* clang-format: [JS] Fix template string ASI.Martin Probst2016-10-212-3/+14
| | | | | | | | | | | | | | | | | | | Summary: Previously, automatic semicolon insertion would add an unwrapped line when a template string contained a line break. var x = `foo${ bar}`; Would be formatted with `bar...` on a separate line and no indent. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D25675 llvm-svn: 284807
* Don't try to use !Previous.empty() as a proxy for "Is this a redeclaration?" --Richard Smith2016-10-213-7/+13
| | | | | | | | | | | we don't collapse that down to a single entry if it's not a redeclaration. Instead, set the Redeclaration bit on the Declarator to indicate whether a function is a redeclaration (which may not have been linked into the redeclaration chain if it's a dependent context friend). Fixes a rejects-valid; see testcase. llvm-svn: 284802
* DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.Richard Smith2016-10-2129-216/+574
| | | | | | | | | | | | | | | | | | | | | | | | This has two significant effects: 1) Direct relational comparisons between null pointer constants (0 and nullopt) and pointers are now ill-formed. This was always the case for C, and it appears that C++ only ever permitted by accident. For instance, cases like nullptr < &a are now rejected. 2) Comparisons and conditional operators between differently-cv-qualified pointer types now work, and produce a composite type that both source pointer types can convert to (when possible). For instance, comparison between 'int **' and 'const int **' is now valid, and uses an intermediate type of 'const int *const *'. Clang previously supported #2 as an extension. We do not accept the cases in #1 as an extension. I've tested a fair amount of code to check that this doesn't break it, but if it turns out that someone is relying on this, we can easily add it back as an extension. llvm-svn: 284800
* [Driver][Darwin] Pass -no_deduplicate to ld64Bruno Cardoso Lopes2016-10-213-0/+74
| | | | | | | | | | Recent versions of ld64 run a deduplicate pass, which is on by default. Disable the pass by using -no_deduplicate in certain condition and enhance total compile time. rdar://problem/25455336 llvm-svn: 284798
* [Modules] Add 'no_undeclared_includes' module map attributeBruno Cardoso Lopes2016-10-2128-27/+196
| | | | | | | | | | | | | The 'no_undeclared_includes' attribute should be used in a module to tell that only non-modular headers and headers from used modules are accepted. The main motivation behind this is to prevent dep cycles between system libraries (such as darwin) and libc++. Patch by Richard Smith! llvm-svn: 284797
* Revert 9 changes from r284793, they still fail on some botsReid Kleckner2016-10-209-9/+12
| | | | llvm-svn: 284794
* Remove 24 instances of 'REQUIRES: shell'Reid Kleckner2016-10-2024-50/+25
| | | | | | | | | | | | | | | | | Tests fall into one of the following categories: - The requirement was unnecessary - Additional quoting was required for backslashes in paths (see "sed -e 's/\\/\\\\/g'") in the sanitizer tests. - OpenMP used 'REQUIRES: shell' as a proxy for the test failing on Windows. Those tests fail there reliably, so use XFAIL instead. I tried not to remove shell requirements that were added to suppress flaky test failures, but if I screwed up, we can add it back as needed. llvm-svn: 284793
* Re-commit r284753, reverted in r284778, with a fix for PR30749.Richard Smith2016-10-205-56/+255
| | | | | | | | | | Original commit message: [c++1z] Teach composite pointer type computation how to compute the composite pointer type of two function pointers with different noexcept specifications. While I'm here, also teach it how to merge dynamic exception specifications. llvm-svn: 284785
* [clang] Remove FileEntry copy-constructorAlexander Shaposhnikov2016-10-201-9/+1
| | | | | | | | | | | | Code cleanup: address FIXME in the file include/clang/Basic/FileManager.h and remove copy-constructor of the class FileEntry. Test plan: make check-clang Differential revision: https://reviews.llvm.org/D22712 llvm-svn: 284782
* Revert "Disable swiftcall test on windows: More brutal way to appease ↵Reid Kleckner2016-10-201-3/+0
| | | | | | | | | | | windows bots" This reverts commit r284174. The tests pass for me locally. It must have been a 2015 only crash. Fixes PR30699 llvm-svn: 284781
* Revert r284753 "[c++1z] Teach composite pointer type computation how to ↵Hans Wennborg2016-10-205-246/+56
| | | | | | | | compute the composite" It caused PR30749. llvm-svn: 284778
* Fix off-by-one error in PPCaching.cpp token annotation assertionReid Kleckner2016-10-202-1/+18
| | | | | | | | | | | This assert is intended to defend against backtracking into the middle of a sequence of tokens that is being replaced with an annotation, but it's OK if we backtrack to the exact position of the start of the annotation sequence. Use a <= comparison instead of <. Fixes PR25946 llvm-svn: 284777
* [Driver] Refactor DetectDistro() parameters to take VFS ref only. NFCMichal Gorny2016-10-201-9/+9
| | | | | | | | | | | | | | | Refactor the DetectDistro() function to take a single vfs::FileSystem reference only, instead of Driver and llvm::Triple::ArchType. The ArchType parameter was not used anyway, and Driver was only used to obtain the VFS. Aside to making the API simpler and more transparent, it makes it easier to add unit tests for the function in the future -- since the tests would need only to provide an appropriate VFS. Differential Revision: https://reviews.llvm.org/D25819 llvm-svn: 284774
* [Driver] Parse Debian version as integer when possible. NFCMichal Gorny2016-10-201-11/+24
| | | | | | | | | | | | Replace the string matching for /etc/debian_version with split integer/string matching algorithm. When the file contains 'major.minor' version number, parse the major version as integer and use a switch clause to match it. Otherwise, attempt 'codename/sid' matching using a StringSwitch. Differential Revision: https://reviews.llvm.org/D25696 llvm-svn: 284770
* [CodeGen] Devirtualize calls to methods marked final in a derived classVedant Kumar2016-10-203-24/+45
| | | | | | | | | | If we see a virtual method call to Base::foo() but can infer that the object is an instance of Derived, and that 'foo' is marked 'final' in Derived, we can devirtualize the call to Derived::foo(). Differential Revision: https://reviews.llvm.org/D25813 llvm-svn: 284766
* [c++1z] Fix assertion failure when using the wrong number of bindings for aRichard Smith2016-10-202-1/+9
| | | | | | struct with unnamed bitfields. llvm-svn: 284761
* Add more doxygen comments to emmintrin.h's intrinsics.Ekaterina Romanova2016-10-201-3/+837
| | | | | | | | | | With this patch, 75% of the intrinsics in this file will be documented now. The patches for the rest of the intrisics in this file will be send out later. The doxygen comments are automatically generated based on Sony's intrinsics document. I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Yunzhong Gao. llvm-svn: 284754
* [c++1z] Teach composite pointer type computation how to compute the compositeRichard Smith2016-10-205-56/+246
| | | | | | | pointer type of two function pointers with different noexcept specifications. While I'm here, also teach it how to merge dynamic exception specifications. llvm-svn: 284753
* [clang-cl] Fix test that shouldn't be running on non-x86Renato Golin2016-10-201-1/+1
| | | | | | | | | | | | | | | | | The clang-cl test required x86-registered-target but it defaulted to the host's triple and AArch64 still doesn't support COFF, so the test failed. The triple was "aarch64-pc-windows-msvc18.0.0" with ObjectFormat equals llvm::Triple::COFF, failing assertion: Assertion `(TT.isOSBinFormatELF() || TT.isOSBinFormatMachO()) && "Only expect Darwin and ELF targets" in AArch64MCTargetDesc.cpp:78. Making the test only run on Windows hosts obviously fixes the problem. llvm-svn: 284749
* [Format] Cleanup after replacing constructor body with = defaultMalcolm Parsons2016-10-203-1/+21
| | | | | | | | | | | | | | Summary: Remove colon and commas after replacing constructor body with = default. Fix annotation of TT_CtorInitializerColon when preceded by a comment. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D25768 llvm-svn: 284732
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-2037-235/+210
| | | | | | No functionality change intended. llvm-svn: 284730
* Clean up alignment hacks now that MSVC 2013 and GCC 4.7 are gone.Benjamin Kramer2016-10-204-13/+7
| | | | llvm-svn: 284729
* Work around MSVC rejects-valid. Apparenty (some versions of) MSVC will checkRichard Smith2016-10-201-9/+8
| | | | | | | that a member is default-initializable even if it's initialized by a default member initializer. llvm-svn: 284701
* Replace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed ↵Erik Pilkington2016-10-203-4/+4
| | | | | | from llvm/Support in r284681 llvm-svn: 284690
* Refactor and simplify Sema::FindCompositePointerType. No functionality ↵Richard Smith2016-10-201-126/+123
| | | | | | change intended. llvm-svn: 284685
* PR26276: Fix detection of non-cast-expressions as operands of fold-expressions.Richard Smith2016-10-204-1/+29
| | | | llvm-svn: 284684
* Upgrade debug-info-vla test: we do not pass default alignment nowVictor Leschuk2016-10-201-1/+0
| | | | llvm-svn: 284683
* DebugInfo: pass alignment value only if it was forcedVictor Leschuk2016-10-2024-94/+124
| | | | | | | | | | Preparation to implement DW_AT_alignment support: - We pass non-zero align value to DIBuilder only when alignment was forced - Modify tests to match this change Differential Revision: https://reviews.llvm.org/D24426 llvm-svn: 284679
* 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
OpenPOWER on IntegriCloud