summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-cl: Expose the -flto optionHans Wennborg2016-10-042-1/+2
| | | | | | | | | | | We could hook up /GL as an alias for -flto, but that might be confusing, as clang-cl in that mode would not be drop-in compatible with cl.exe /GL, as it requires the linker to be lld. Exposing -flto seems like a less confusing way to expose this functionality. llvm-svn: 283255
* [analyzer] Add PostStmt callback for ArraySubscriptExprAnna Zaks2016-10-042-9/+23
| | | | | | | | A patch by Jan Smets! Differential Revision: https://reviews.llvm.org/D25009 llvm-svn: 283253
* [clang] make reciprocal estimate codegen a function attributeSanjay Patel2016-10-043-3/+16
| | | | | | | | | | | | | | | | The motivation for the change is that we can't have pseudo-global settings for codegen living in TargetOptions because that doesn't work with LTO. Ideally, these reciprocal attributes will be moved to the instruction-level via FMF, metadata, or something else. But making them function attributes is at least an improvement over the current state. I'm committing this patch ahead of the related LLVM patch to avoid bot failures, but if that patch needs to be reverted, then this should be reverted too. Differential Revision: https://reviews.llvm.org/D24815 llvm-svn: 283251
* [ubsan] Disable bounds-check for flexible array ivarsVedant Kumar2016-10-042-0/+61
| | | | | | | | | This eliminates a class of false positives for -fsanitize=array-bounds on instrumented ObjC projects. Differential Revision: https://reviews.llvm.org/D22227 llvm-svn: 283249
* clang-format: Fix bad multi-variable for-loop formatting.Daniel Jasper2016-10-042-1/+4
| | | | | | | | | | Before: for (int*p, *q; p != q; p = p->next) { After: for (int *p, *q; p != q; p = p->next) { llvm-svn: 283246
* [sancov] documentation update after r283241Mike Aizatsky2016-10-041-1/+1
| | | | llvm-svn: 283242
* Test what happens when tag lookup and redeclaration lookup disagreeReid Kleckner2016-10-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | Clang has a diagnostic for the what happens when an elaborated type implicitly creates a tag declaration and the initial tag lookup fails, but the redeclaration lookup succeeds and finds a non-tag type. However, it wasn't tested, and looked like dead code. After much staring, we discovered how to exercise it, and are now committing the test for posterity. In this example, the tag lookup will not find A, but then when we go to insert a declaration of A at global scope, we discover the template friend, which is not a tag type. struct C { template <typename> friend struct A; }; struct B { struct A *p; }; llvm-svn: 283235
* [Sema] Format a comment line so that it fits 80 columns. NFCAlex Lorenz2016-10-041-2/+3
| | | | llvm-svn: 283228
* [MS] Move hex long long sign compat hack to -fms-compatibilityReid Kleckner2016-10-043-12/+20
| | | | | | | | | Treating large 0x*LL literals as signed instead of unsigned is not a conforming language extension, so move it out of -fms-extensions. Came up in PR30605 llvm-svn: 283227
* [OpenMP] fix segfault when a variable referenced in reduction clause is a ↵David Sheinkman2016-10-0418-1/+112
| | | | | | reference parameter\nDifferential Revision: http://reviews.llvm.org/D24524 llvm-svn: 283223
* [ThinLTO] Spell `llvm-ar` correctly.Davide Italiano2016-10-041-1/+1
| | | | llvm-svn: 283217
* Do not find friend function definitions inside non-instantiated class.Serge Pavlov2016-10-046-7/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if a file-level function was defined inside befriending template class, it always was treated as defined. For instance, the code like: ``` int func(int x); template<typename T> class C1 { friend int func(int x) { return x; } }; template<typename T> class C2 { friend int func(int x) { return x; } }; ``` could not be compiled due to function redefinition, although not of the templates is instantiated. Moreover, the body of friend function can contain use of template parameters, attempt to get definition of such function outside any instantiation causes compiler abnormal termination. Other compilers (gcc, icc) follow viewpoint that the body of the function defined in friend declaration becomes available when corresponding class is instantiated. This patch implements this viewpoint in clang. Definitions introduced by friend declarations in template classes are not added to the redeclaration chain of corresponding function. Only when the template is instantiated, instantiation of the function definition is placed to the chain. The fix was made in collaboration with Richard Smith. This change fixes PR8035, PR17923, PR22307 and PR25848. Differential Revision: http://reviews.llvm.org/D16989 llvm-svn: 283207
* Minor cleanups in clang-format.el.Manuel Klimek2016-10-041-41/+48
| | | | | | | | | | | | | | | | | | - Enable lexical binding - Formatting - Enable file name completion for the clang-format-executable variable - Add a missing docstring - When available, use bufferpos-to-filepos and filepos-to-bufferpos. These functions given more precise mapping than byte-to-position and position-bytes. - Rename arguments of clang-format-region to match the docstring - Instead of binding local variables to nil and then assigning them, bind them directly to their values - Make use of the fact that insert-file-contents returns the number of characters it inserted - Use cl-destructuring-bind to make the code a bit shorter - Use standard iteration (dolist) instead of mapc with a lambda, which is more common and shorter - Remove a message that was most likely only present for debugging purposes Patch by Philipp Stephani. llvm-svn: 283206
* Revert "[XRay] Check in Clang whether XRay supports the target when ↵Dean Michael Berris2016-10-042-17/+1
| | | | | | | | -fxray-instrument is passed" This reverts 283193 -- broke the build. llvm-svn: 283199
* Revert r283106, "Wdocumentation fix"NAKAMURA Takumi2016-10-041-1/+1
| | | | | | It should depend on r283094 and r283182. llvm-svn: 283195
* [XRay] Check in Clang whether XRay supports the target when ↵Dean Michael Berris2016-10-042-1/+17
| | | | | | | | | | | | | | | | | | -fxray-instrument is passed Added the code which explicitly emits an error in Clang in case `-fxray-instrument` is passed, but XRay is not supported for the selected target. Author: rSerge Reviewers: dberris, rsmith, aaron.ballman, rnk Subscribers: cfe-commits, iid_iunknown Differential Revision: https://reviews.llvm.org/D24799 llvm-svn: 283193
* Revert "[analyzer] Improve CloneChecker diagnostics" as its depends on ↵Vitaly Buka2016-10-0414-291/+92
| | | | | | | | reverted r283092 This reverts commit r283094. llvm-svn: 283182
* Revert "[analyzer] Add extra notes to ObjCDeallocChecker" as its depends on ↵Vitaly Buka2016-10-044-116/+12
| | | | | | | | reverted r283092 This reverts commit r283093. llvm-svn: 283181
* Revert "[analyzer] Extend bug reports with extra notes" to fix Windows bot.Vitaly Buka2016-10-0410-232/+58
| | | | | | This reverts commit r283092. llvm-svn: 283180
* Revert "[analyzer] A blind attempt to fix a buildbot" as it does not help.Vitaly Buka2016-10-041-1/+1
| | | | | | This reverts commit r283141. llvm-svn: 283179
* [coroutines] Switch to using std::experimental namespace per P0057R5Gor Nishanov2016-10-046-27/+63
| | | | | | | | | | | | | | Summary: Look for coroutine_traits and friends in std::experimental namespace. Patch (mostly) by EricWF. Reviewers: cfe-commits, EricWF, rsmith Subscribers: majnemer, mehdi_amini Differential Revision: https://reviews.llvm.org/D25068 llvm-svn: 283170
* [coroutines] Adding builtins for coroutine intrinsics and backendutil support.Gor Nishanov2016-10-039-0/+310
| | | | | | | | | | | | | Summary: With this commit simple coroutines can be created in plain C using coroutine builtins. Reviewers: rnk, EricWF, rsmith Subscribers: modocache, mgorny, mehdi_amini, beanz, cfe-commits Differential Revision: https://reviews.llvm.org/D24373 llvm-svn: 283155
* ObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.Manman Ren2016-10-033-3/+19
| | | | | | | | | | | | | | | The deserialization of redeclartion can cause seg fault since getCanonicalDecl of the redeclaration returns the lookup result on the ObjCContainerDecl, which can be null if FindExternalVisibleDeclsByName is not done updating the lookup results. The fix is to return the redeclaration itself as the canonical decl. Note that the handling for redeclaration of ObjCMethodDecl is not in line with other redeclarables. rdar://28488466 llvm-svn: 283145
* [analyzer] A blind attempt to fix a buildbot after r283092.Artem Dergachev2016-10-031-1/+1
| | | | | | The msvc compiler seems to crash compiling the BugReport class. llvm-svn: 283141
* Added more comments to tooling::Replacements.Eric Liu2016-10-031-0/+4
| | | | | | | | | | Summary: Also test phabricator commit processing. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D25207 llvm-svn: 283135
* Factor out a diagnostic kind enum for use in two %select expressionsReid Kleckner2016-10-034-25/+40
| | | | | | NFC llvm-svn: 283131
* [CUDA] Clean up some comments in Sema::IsOverload. NFCJustin Lebar2016-10-031-7/+7
| | | | llvm-svn: 283121
* [CUDA] Disallow overloading destructors.Justin Lebar2016-10-035-58/+38
| | | | | | | | | | | | | | | | | | | | | | Summary: We'd attempted to allow this, but turns out we were doing a very bad job. :) Making this work properly would be a giant change in clang. For example, we'd need to make CXXRecordDecl::getDestructor() context-sensitive, because the destructor you end up with depends on where you're calling it from. For now (and hopefully for ever), just disallow overloading of destructors in CUDA. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D24571 llvm-svn: 283120
* [ARC] Ignore qualifiers in copy-restore expressionsVedant Kumar2016-10-032-1/+15
| | | | | | | | | | | | | | | | When ARC is enabled, an ObjCIndirectCopyRestoreExpr models the passing of a function argument s.t: * The argument is copied into a temporary, * The temporary is passed into the function, and * After the function call completes, the temporary is move-assigned back to the original location of the argument. The argument type and the parameter type must agree "except possibly in qualification". This commit weakens an assertion in EmitCallArg() to actually reflect that. llvm-svn: 283116
* [OpenCL] Fix bug in __builtin_astype causing invalid LLVM cast instructionsYaxun Liu2016-10-032-3/+91
| | | | | | | | | | | | __builtin_astype is used to cast OpenCL opaque types to other types, as such, it needs to be able to handle casting from and to pointer types correctly. Current it cannot handle 1) casting between pointers of different addr spaces 2) casting between pointer type and non-pointer types. This patch fixes that. Differential Revision: https://reviews.llvm.org/D25123 llvm-svn: 283114
* This adds a separate file for the fp denormal regression tests. NFC.Sjoerd Meijer2016-10-031-0/+9
| | | | | | I forgot to svn add the new file in my previous commit. llvm-svn: 283110
* This adds a separate file for the fp denormal regression tests. NFC.Sjoerd Meijer2016-10-031-9/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D24907 llvm-svn: 283109
* Wdocumentation fixSimon Pilgrim2016-10-031-1/+1
| | | | llvm-svn: 283106
* Fix PR 28885: Fix AST Printer output for the inherited constructor usingAlex Lorenz2016-10-032-0/+19
| | | | | | | | | | | | | declarations. This commit ensures that the correct record type is printed out for the using declarations that represent C++ inherited constructors. It fixes a regression introduced in r274049 which changed the name that's stored in the using declarations that correspond to inherited constructors. Differential Revision: https://reviews.llvm.org/D25131 llvm-svn: 283105
* Revert r283102 (Typo in the phabricator link)Alex Lorenz2016-10-032-19/+0
| | | | llvm-svn: 283104
* Fix PR 28885: Fix AST Printer output for the inherited constructor usingAlex Lorenz2016-10-032-0/+19
| | | | | | | | | | | | | declarations. This commit ensures that the correct record type is printed out for the using declarations that represent C++ inherited constructors. It fixes a regression introduced in r274049 which changed the name that's stored in the using declarations that correspond to inherited constructors. Differential Revision: https://reviews.llvm.org/D25131 llvm-svn: 283102
* [StaticAnalyser] Add test case to ensure that unreachable code is found.Daniel Marjamaki2016-10-031-1/+12
| | | | | | https://reviews.llvm.org/D24905 llvm-svn: 283096
* [StaticAnalyzer] Fix UnreachableCode false positives.Daniel Marjamaki2016-10-032-11/+20
| | | | | | | | When there is 'do { } while (0);' in the code the ExplodedGraph and UnoptimizedCFG did not match. Differential Revision: https://reviews.llvm.org/D24759 llvm-svn: 283095
* [analyzer] Improve CloneChecker diagnosticsArtem Dergachev2016-10-0314-92/+291
| | | | | | | | | | | | | | | | | | Highlight code clones referenced by the warning message with the help of the extra notes feature recently introduced in r283092. Change warning text to more clang-ish. Remove suggestions from the copy-paste error checker diagnostics, because currently our suggestions are strictly 50% wrong (we do not know which of the two code clones contains the error), and for that reason we should not sound as if we're actually suggesting this. Hopefully a better solution would bring them back. Make sure the suspicious clone pair structure always mentions the correct variable for the second clone. Differential Revision: https://reviews.llvm.org/D24916 llvm-svn: 283094
* [analyzer] Add extra notes to ObjCDeallocCheckerArtem Dergachev2016-10-034-12/+116
| | | | | | | | | | The report is now highlighting instance variables and properties referenced by the warning message with the help of the extra notes feature recently introduced in r283092. Differential Revision: https://reviews.llvm.org/D24915 llvm-svn: 283093
* [analyzer] Extend bug reports with extra notesArtem Dergachev2016-10-0310-58/+232
| | | | | | | | | | | | | | | | | | | | These diagnostics are separate from the path-sensitive engine's path notes, and can be added manually on top of path-sensitive or path-insensitive reports. The new note diagnostics would appear as note:-diagnostic on console and as blue bubbles in scan-build. In plist files they currently do not appear, because format needs to be discussed with plist file users. The analyzer option "-analyzer-config notes-as-events=true" would convert notes to normal path notes, and put them at the beginning of the path. This is a temporary hack to show the new notes in plist files. A few checkers would be updated in subsequent commits, including tests for this new feature. Differential Revision: https://reviews.llvm.org/D24278 llvm-svn: 283092
* Keep the test only for Itanium abiAditya Kumar2016-10-031-1/+1
| | | | llvm-svn: 283085
* [cmake] Install 'clang-cpp' symlinkMichal Gorny2016-10-021-1/+1
| | | | | | | | | | | | | | | Install the 'clang-cpp' symlink used to spawn the preprocessor. The code handling this suffix is already included in Driver. FreeBSD is already creating such a symlink in ports, and a similar one was requested by Gentoo/FreeBSD team. The goal is to handle software that takes a C preprocessor via a variable but does not handle passing options correctly (i.e. 'clang -E' does not work). Bug: https://bugs.gentoo.org/478810 Differential Revision: https://reviews.llvm.org/D25161 llvm-svn: 283075
* [AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics ↵Craig Topper2016-10-022-102/+80
| | | | | | when rounding mode isn't used. llvm-svn: 283073
* [CUDA] Allow extern __shared__ on empty-length arrays.Justin Lebar2016-10-022-2/+13
| | | | | | "extern __shared__ int x[]" is OK. llvm-svn: 283068
* [coroutines] Rename driver flag -fcoroutines to -fcoroutines-tsGor Nishanov2016-10-0215-14/+38
| | | | | | | | | | | | | | | Summary: Also makes -fcoroutines_ts to be both a Driver and CC1 flag. Patch mostly by EricWF. Reviewers: rnk, cfe-commits, rsmith, EricWF Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D25130 llvm-svn: 283064
* Alias must point to a definitionAditya Kumar2016-10-022-8/+26
| | | | | | | | | | | | | | | Reapplying the patch after modifying the test case. Inlining the destructor caused the compiler to generate bad IR which failed the Verifier in the backend. https://llvm.org/bugs/show_bug.cgi?id=30341 This patch disables alias to available_externally definitions. Reviewers: eugenis, rsmith Differential Revision: https://reviews.llvm.org/D24682 llvm-svn: 283063
* [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-floatHal Finkel2016-10-024-26/+202
| | | | | | | | | | Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. llvm-svn: 283061
* [AVX-512] Check rounding mode for builtins that take one. Rounding mode ↵Craig Topper2016-10-011-0/+93
| | | | | | should be either _MM_FROUND_CUR_DIRECTION or a 2-bit rounding mode ORed with _MM_FROUND_NO_EXC. llvm-svn: 283054
* [AVX-512] Add _MM_FROUND_NO_EXC to test cases that pass a rounding mode ↵Craig Topper2016-10-012-120/+120
| | | | | | intrinsics. This is preparation for a follow up commit that will check validity of rounding mode argument. llvm-svn: 283053
OpenPOWER on IntegriCloud