summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [ARC] Ignore qualifiers in copy-restore expressionsVedant Kumar2016-10-031-1/+1
| | | | | | | | | | | | | | | | 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-031-3/+52
| | | | | | | | | | | | __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
* Wdocumentation fixSimon Pilgrim2016-10-031-1/+1
| | | | llvm-svn: 283106
* Fix PR 28885: Fix AST Printer output for the inherited constructor usingAlex Lorenz2016-10-031-0/+11
| | | | | | | | | | | | | 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-031-11/+0
| | | | llvm-svn: 283104
* Fix PR 28885: Fix AST Printer output for the inherited constructor usingAlex Lorenz2016-10-031-0/+11
| | | | | | | | | | | | | 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
* [StaticAnalyzer] Fix UnreachableCode false positives.Daniel Marjamaki2016-10-031-11/+10
| | | | | | | | 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-032-60/+70
| | | | | | | | | | | | | | | | | | 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-031-3/+29
| | | | | | | | | | 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-037-54/+164
| | | | | | | | | | | | | | | | | | | | 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
* [AVX-512] Use native IR for masked 512-bit add/sub/mul/div ps/pd intrinsics ↵Craig Topper2016-10-021-86/+48
| | | | | | when rounding mode isn't used. llvm-svn: 283073
* [CUDA] Allow extern __shared__ on empty-length arrays.Justin Lebar2016-10-021-1/+3
| | | | | | "extern __shared__ int x[]" is OK. llvm-svn: 283068
* [coroutines] Rename driver flag -fcoroutines to -fcoroutines-tsGor Nishanov2016-10-025-4/+10
| | | | | | | | | | | | | | | 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-021-8/+6
| | | | | | | | | | | | | | | 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-022-16/+21
| | | | | | | | | | 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
* Use StringRef for MemoryBuffer identifier API (NFC)Mehdi Amini2016-10-0110-29/+28
| | | | llvm-svn: 283043
* Use StringRef in Registry API (NFC)Mehdi Amini2016-10-011-1/+1
| | | | llvm-svn: 283039
* Use StringRef in Pass/PassManager APIs (NFC)Mehdi Amini2016-10-011-1/+1
| | | | llvm-svn: 283004
* Use StringRef in Triple API (NFC)Mehdi Amini2016-10-011-4/+5
| | | | llvm-svn: 282996
* [CUDA] Harmonize asserts in SemaCUDA, NFC.Justin Lebar2016-09-301-3/+3
| | | | llvm-svn: 282987
* [CUDA] Disallow __constant__ local variables.Justin Lebar2016-09-301-2/+14
| | | | | | | | | | Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25129 llvm-svn: 282986
* [CUDA] Disallow 'extern __shared__' variables.Justin Lebar2016-09-301-2/+14
| | | | | | | | | | | | | | | | | | Also add a test that we disallow __constant__ __shared__ int x; because it's possible to break this without breaking __shared__ __constant__ int x; Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25125 llvm-svn: 282985
* Fix bogus "inline namespace cannot be reopened as non-inline" diagnostic toRichard Smith2016-09-301-1/+1
| | | | | | | just warn that the second declaration is missing the 'inline' keyword. This is valid, and we shouldn't be suggesting otherwise. llvm-svn: 282981
* CodeGen: inherit DLLExport attribute in Windows ItaniumSaleem Abdulrasool2016-09-301-11/+19
| | | | | | | | When emitting the fundamental type information constants, inherit the DLLExportAttr from `__fundamental_type_info`. We would previously not honor the `__declspec(dllexport)` on the type information. llvm-svn: 282980
* P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, weRichard Smith2016-09-306-2/+53
| | | | | | | | | assume that ::operator new provides no more alignment than is necessary for any primitive type, except when we're on a GNU OS, where glibc's malloc guarantees to provide 64-bit alignment on 32-bit systems and 128-bit alignment on 64-bit systems. This can be controlled by the command-line -fnew-alignment flag. llvm-svn: 282974
* [coroutines] Diagnose when 'main' is declared as a coroutine.Eric Fiselier2016-09-301-0/+5
| | | | | | | | | | | | Summary: The title says it all. Reviewers: rsmith, GorNishanov Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D25078 llvm-svn: 282973
* [Sema] Support lax conversions for compound assignmentsBruno Cardoso Lopes2016-09-301-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support lax convertions on compound assignment expressions like: typedef __attribute__((vector_size(8))) double float64x1_t; typedef __attribute__((vector_size(16))) double float64x2_t; float64x1_t vget_low_f64(float64x2_t __p0); double c = 3.0; float64x2_t v = {0.0, 1.0}; c += vget_low_f64(v); This restores one more valid behavior pre r266366, and is a incremental follow up from work committed in r274646. While here, make the check more strict, add FIXMEs, clean up variable names to match what they can actually be and update testcases to reflect that. We now reject: typedef float float2 __attribute__ ((vector_size (8))); double d; f2 += d; which doesn't fit as a direct bitcast anyway. Differential Revision: https://reviews.llvm.org/D24472 rdar://problem/28033929 llvm-svn: 282968
* Add missing std::move in Replacements::addAlexander Shaposhnikov2016-09-301-1/+1
| | | | | | | | | | | This diff adds std::move to avoid copying of the Replacement NewR in the method Replacements::add. Test plan: make -j8 check-all Differential revision: https://reviews.llvm.org/D25049 llvm-svn: 282949
* [CUDA] Remove incorrect comment in CUDASetLambdaAttrs.Justin Lebar2016-09-301-4/+0
| | | | | | | | | I'd said that nvcc doesn't allow you to add __host__ or __device__ attributes on lambdas in all circumstances, but I believe this was user error on my part. I can't reproduce these warnings/errors if I pass --expt-extended-lambda to nvcc. llvm-svn: 282912
* [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after ↵Justin Lebar2016-09-301-0/+16
| | | | | | | | | | | | | | | | | | | | | | | '(...)'. Summary: This is probably the sane place for the attribute to go, but nvcc specifically rejects it. Other GNU-style attributes are allowed in this position (although judging from the warning it emits for host/device/global, those attributes are applied to the lambda's anonymous struct, not to the function itself). It would be nice to have a FixIt message here, but doing so, or even just getting the correct range for the attribute, including its '((' and '))'s, is apparently Hard. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25115 llvm-svn: 282911
* [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes ↵Justin Lebar2016-09-301-5/+3
| | | | | | | | | | | | | | on CUDA lambdas. Summary: There's an overload that we can use to make this a bit cleaner. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25114 llvm-svn: 282910
* [MS] Implement __iso_volatile loads/stores as builtinsMartin Storsjo2016-09-301-0/+35
| | | | | | | | | | | | | | | | | | | | These are supposed to produce the same as normal volatile pointer loads/stores. When -volatile:ms is specified, normal volatile pointers are forced to have atomic semantics (as is the default on x86 in MSVC mode). In that case, these builtins should still produce non-atomic volatile loads/stores without acquire/release semantics, which the new test verifies. These are only available on ARM (and on AArch64, although clang doesn't support AArch64/Windows yet). This implements what is missing for PR30394, making it possible to compile C++ for ARM in MSVC mode with MSVC headers. Differential Revision: https://reviews.llvm.org/D24986 llvm-svn: 282900
* [CUDA] Make lambdas inherit __host__ and __device__ attributes from the ↵Justin Lebar2016-09-302-1/+25
| | | | | | | | | | | | | | scope in which they're created. Summary: NVCC compat. Fixes bug 30567. Reviewers: tra Subscribers: cfe-commits, rnk Differential Revision: https://reviews.llvm.org/D25105 llvm-svn: 282880
* [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).Justin Lebar2016-09-301-7/+12
| | | | | | | | | | | | Summary: This is ugh, but it makes us compatible with NVCC. Fixes bug 26341. Reviewers: rnk Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D25103 llvm-svn: 282879
* [CUDA][OpenMP] Add a generic offload action builderSamuel Antao2016-09-302-162/+558
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch proposes a new class to generate and record action dependences related with offloading. The builder provides three main functionalities: - Add device dependences to host actions. - Add host dependence to device actions. - Register device top-level actions. The constructor of the builder detect the programming models that should be supported, and generates a specialized builder for each. If a new programming model is to be added in the future, only a new specialized builder has to be implemented. When the specialized builder is generated, it produces programming-model-specific diagnostics. A CUDA specialized builder is proposed in the patch that mostly consists of the partition of the current `buildCudaAction` by the three different functionalities. Reviewers: tra, echristo, ABataev, jlebar, hfinkel Subscribers: Hahnfeld, whchung, guansong, jlebar, mehdi_amini, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D18172 llvm-svn: 282865
* Strip trailing whitespace (NFCI)Simon Pilgrim2016-09-301-167/+167
| | | | llvm-svn: 282858
* Fix int <= bool comparison warning on MSVCSimon Pilgrim2016-09-301-2/+5
| | | | llvm-svn: 282857
* Cosmetic fix: deleted unnecessary line break in comment.Victor Leschuk2016-09-301-2/+1
| | | | llvm-svn: 282846
* Move UTF functions into namespace llvm.Justin Lebar2016-09-308-66/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This lets people link against LLVM and their own version of the UTF library. I determined this only affects llvm, clang, lld, and lldb by running $ git grep -wl 'UTF[0-9]\+\|\bConvertUTF\bisLegalUTF\|getNumBytesFor' | cut -f 1 -d '/' | sort | uniq clang lld lldb llvm Tested with ninja lldb ninja check-clang check-llvm check-lld (ninja check-lldb doesn't complete for me with or without this patch.) Reviewers: rnk Subscribers: klimek, beanz, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D24996 llvm-svn: 282822
* P0035R4: add std::align_val_t overloads of operator new/delete in C++17 mode.Richard Smith2016-09-296-58/+85
| | | | llvm-svn: 282800
* [Coroutines] Fix assertion about uncorrected typos in ↵Eric Fiselier2016-09-291-1/+14
| | | | | | co_await/co_yield/co_return expressions llvm-svn: 282792
* Switch to a different workaround for unimplementability of P0145R3 in MS ABIs.Richard Smith2016-09-294-37/+64
| | | | | | | | | | | | | | | | | | | Instead of ignoring the evaluation order rule, ignore the "destroy parameters in reverse construction order" rule for the small number of problematic cases. This only causes incorrect behavior in the rare case where both parameters to an overloaded operator <<, >>, ->*, &&, ||, or comma are of class type with non-trivial destructor, and the program is depending on those parameters being destroyed in reverse construction order. We could do a little better here by reversing the order of parameter destruction for those functions (and reversing the argument evaluation order for all direct calls, not just those with operator syntax), but that is not a complete solution to the problem, as the same situation can be reached by an indirect function call. Approach reviewed off-line by rnk. llvm-svn: 282777
* [Myriad] Silently ignore -fno-split-dwarf-inliningDouglas Katzman2016-09-291-6/+8
| | | | llvm-svn: 282757
* Revert "[PR30341] Alias must point to a definition"Aditya Kumar2016-09-291-6/+8
| | | | | | | | This reverts commit r282679. Ninja check fails, reverting to debug the issue. llvm-svn: 282710
* [PR30341] Alias must point to a definitionAditya Kumar2016-09-291-8/+6
| | | | | | | | | | | | | 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: 282679
* Mark P0127R3 as done, and replace its __has_feature check with the ↵Richard Smith2016-09-292-5/+6
| | | | | | corresponding SD-6 macro. llvm-svn: 282652
* P0127R2: Support type deduction for types of non-type template parameters inRichard Smith2016-09-285-29/+107
| | | | | | | | C++1z. Patch by James Touton! Some bugfixes and rebasing by me. llvm-svn: 282651
* [CUDA] Disallow variable-length arrays in CUDA device code.Justin Lebar2016-09-282-0/+24
| | | | | | | | | | Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D25050 llvm-svn: 282647
* [CUDA] Disallow exceptions in device code.Justin Lebar2016-09-283-0/+32
| | | | | | | | | | Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D25036 llvm-svn: 282646
OpenPOWER on IntegriCloud