summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Placate MSVC's narrowing conversion unhappiness.Richard Smith2017-04-251-1/+1
| | | | llvm-svn: 301285
* [modules ts] Diagnose 'export' declarations outside of a module interface.Richard Smith2017-04-244-3/+14
| | | | llvm-svn: 301271
* [analyzer] Improve subscripting null arrays for catching null dereferences.Artem Dergachev2017-04-242-10/+12
| | | | | | | | | | | | | Array-to-pointer cast now works correctly when the pointer to the array is concrete, eg. null, which allows further symbolic calculations involving such values. Inlined defensive checks are now detected correctly when the resulting null symbol is being array-subscripted before dereference. Differential Revision: https://reviews.llvm.org/D32291 llvm-svn: 301251
* Remove a dead field. NFC.Vedant Kumar2017-04-242-8/+2
| | | | | | Suggested by Adam Folwarczny! llvm-svn: 301250
* [Coverage] Avoid null deref in skipRegionMappingForDecl (fixes PR32761)Vedant Kumar2017-04-241-0/+3
| | | | | | | | Patch by Adam Folwarczny! Differential Revision: https://reviews.llvm.org/D32406 llvm-svn: 301249
* Revert r301223Carlo Bertolli2017-04-244-471/+123
| | | | llvm-svn: 301233
* [asan] Disable ASan global-GC depending on the target and compiler flags.Evgeniy Stepanov2017-04-241-6/+30
| | | | llvm-svn: 301225
* [analyzer] Improve suppression for inlined defensive checks before operator &.Artem Dergachev2017-04-242-3/+29
| | | | | | | | | | | | | | | | | | | Null dereferences are suppressed if the lvalue was constrained to 0 for the first time inside a sub-function that was inlined during analysis, because such constraint is a valid defensive check that does not, by itself, indicate that null pointer case is anyhow special for the caller. If further operations on the lvalue are performed, the symbolic lvalue is collapsed to concrete null pointer, and we need to track where does the null pointer come from. Improve such tracking for lvalue operations involving operator &. rdar://problem/27876009 Differential Revision: https://reviews.llvm.org/D31982 llvm-svn: 301224
* [OpenMP] Initial implementation of code generation for pragma 'distribute ↵Carlo Bertolli2017-04-244-123/+471
| | | | | | | | | | | | | | | | | parallel for' on host https://reviews.llvm.org/D29508 This patch makes the following additions: 1. It abstracts away loop bound generation code from procedures associated with pragma 'for' and loops in general, in such a way that the same procedures can be used for 'distribute parallel for' without the need for a full re-implementation. 2. It implements code generation for 'distribute parallel for' and adds regression tests. It includes tests for clauses. It is important to notice that most of the clauses are implemented as part of existing procedures. For instance, firstprivate is already implemented for 'distribute' and 'for' as separate pragmas. As the implementation of 'distribute parallel for' is based on the same procedures, then we automatically obtain implementation for such clauses without the need to add new code. However, this requires regression tests that verify correctness of produced code. Looking forward to comments. llvm-svn: 301223
* Pragma: Fix DebugOverflowStack() resulting in endless loop.Matthias Braun2017-04-241-3/+3
| | | | | | | | | | Drive-by fix (noticed while working on https://reviews.llvm.org/D32205): DebugOverflowStack() is supposed to provoke a stack overflow, however LLVM was smart enough to use the red-zone and fold the load into a tail jump on x86_64 optimizing this to an endless loop instead of a stack overflow. llvm-svn: 301218
* Flag -fsanitize=fuzzer to enable libfuzzerGeorge Karpenkov2017-04-245-0/+38
| | | | | | | | | | Previously, adding libfuzzer to a project was a multi-step procedure, involving libfuzzer compilation, linking the library, and specifying coverage flags. With this change,libfuzzer can be enabled by adding a single -fsanitize=fuzzer flag instead. llvm-svn: 301212
* [index] If the 'external_source_symbol' attribute indicates 'Swift' as the ↵Argyrios Kyrtzidis2017-04-241-0/+15
| | | | | | language then report it accordingly llvm-svn: 301183
* clang-format: Fix bad corner case in formatting of function types.Daniel Jasper2017-04-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Before: std::function< LoooooooooooongTemplatedType<SomeType>*( LooooooooooooooooooooongType type)> function; After: std::function< LoooooooooooongTemplatedType< SomeType>*( LooooooooooooooooongType type)> function; clang-format generally avoids having lines like "SomeType>*(" as they lead to parameter lists that don't belong together to be aligned. However, in case it is better than the alternative, which can even be violating the column limit. llvm-svn: 301182
* [index] The relation between the declarations in template specializationsAlex Lorenz2017-04-243-4/+66
| | | | | | | | | | | | that 'override' declarations in the base template should be recorded This can be used for improved "go to definition" feature in Xcode. rdar://31604739 Differential Revision: https://reviews.llvm.org/D32020 llvm-svn: 301180
* [Devirtualization] Emit invariant.group loads with empty group mdPiotr Padlewski2017-04-241-6/+2
| | | | | | | | | | | | | | | Summary: As discussed here http://lists.llvm.org/pipermail/llvm-dev/2017-January/109332.html having different groups doesn't solve the problem entirly. Reviewers: rjmccall, rsmith Subscribers: amharc, cfe-commits Differential Revision: https://reviews.llvm.org/D32110 llvm-svn: 301178
* Move Split DWARF handling to an MC option/command line argument rather than ↵David Blaikie2017-04-214-7/+11
| | | | | | | | | | | | | | | | | | | using metadata Since Split DWARF needs to name the actual .dwo file that is generated, it can't be known at the time the llvm::Module is produced as it may be merged with other Modules before the object is generated and that object may be generated with any name. By passing the Split DWARF file name when LLVM is producing object code the .dwo file name in the object file can match correctly. The support for Split DWARF for implicit modules remains the same - using metadata to store the dwo name and dwo id so that potentially multiple skeleton CUs referring to different dwo files can be generated from one llvm::Module. llvm-svn: 301063
* P0629R0: Switch to latest proposal for distinguishing module interface from ↵Richard Smith2017-04-212-55/+55
| | | | | | | | | | | | implementation. This switches from the prototype syntax in P0273R0 ('module' and 'module implementation') to the consensus syntax 'export module' and 'module'. In passing, drop the "module declaration must be first" enforcement, since EWG seems to have changed its mind on that. llvm-svn: 301056
* [index] Take into account the category's external_symbol attr for ↵Argyrios Kyrtzidis2017-04-211-19/+45
| | | | | | namespacing its methods llvm-svn: 301051
* [ms] Give -Wmicrosoft-enum-forward-reference a chance to fire in clang-cl, ↵Nico Weber2017-04-211-1/+2
| | | | | | | | | | | | | | | | | | PR32736 clang-cl sets MicrosoftCompat. In that mode, we always give enums a fixed underlying type, and for enums with fixed underlying type we never enter the block that tries to emit ext_ms_forward_ref_enum. Fix this by requiring an explicit underlying type when we're skipping this diagnostic. We had a test for this warning, but it only ran in C++98 mode. clang-cl always enables -std=c++14, so MicrosoftCompatibiliy-cxx98.cpp is a fairly useless test. Fold it into MicrosoftCompatibility.cpp -- that way, the test checks if -Wmicrosoft-enum-forward-reference can fire in clang-cl builds. https://reviews.llvm.org/D32369 llvm-svn: 301032
* [OpenCL] Fix semantic check of ndrange_t for device_side_enqueue.Anastasia Stulova2017-04-211-1/+1
| | | | | | | | | | | Check unqualified type for ndrange argument in device_side_enqueue so device_side_enqueue accept const and volatile qualified ndranges. Differential Revision: https://reviews.llvm.org/D31458 Patch by Dmitry Borisenkov! llvm-svn: 300988
* [clang-format] Replace IncompleteFormat by a struct with LineKrasimir Georgiev2017-04-213-13/+30
| | | | | | | | | | | | | | Summary: This patch replaces the boolean IncompleteFormat that is used to notify the client if an unrecoverable syntax error occurred by a struct that also contains a line number. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D32298 llvm-svn: 300985
* [PR32667] -Wdocumentation should allow @param/@returns for fields/variablesAlex Lorenz2017-04-212-2/+43
| | | | | | | | | | | | | | | | that have a function/block pointer type This commit improves the -Wdocumentation warning by making sure that @param and @returns commands won't trigger warnings when used for fields, variables, or properties whose type is a function/block pointer type. The function/block pointer type must be specified directly with the declaration, and when a typedef is used the warning is still emitted. In the future we might also want to handle the std::function type as well. rdar://24978538 llvm-svn: 300981
* Add support for openSUSE ARM TriplesIsmail Donmez2017-04-211-1/+3
| | | | | | | | | | | | | | Summary: Add support for armv6hl-suse-linux-gnueabi and armv7hl-suse-linux-gnueabi triples used by openSUSE/SUSE. Reviewers: cfe-commits, rovka, compnerd, rengolin Reviewed By: rengolin Subscribers: aemerson, rengolin, bkramer, chandlerc Differential Revision: https://reviews.llvm.org/D32347 llvm-svn: 300969
* [index] Take advantage of 'external_source_symbol' attribute for indexing ↵Argyrios Kyrtzidis2017-04-215-42/+108
| | | | | | | | | purposes - Ignore decls marked as 'generated_declaration' - Include the 'defined_in' in the USR for additional namespacing llvm-svn: 300949
* [index] For 'transparent' tag typedefs, ignore their tag referenceArgyrios Kyrtzidis2017-04-211-2/+3
| | | | llvm-svn: 300948
* [modules] Properly look up the owning module for an instantiation of a ↵Richard Smith2017-04-213-40/+43
| | | | | | | | | | | | | | | merged template. When looking for the template instantiation pattern of a templated entity, consistently select the definition of the pattern if there is one. This means we'll pick the same owning module when we start instantiating a template that we'll later pick when determining which modules are visible during that instantiation. This reinstates r300650, reverted in r300659, with a fix for a regression reported by Chandler after commit. llvm-svn: 300938
* [analyzer] Fix assert in ExprEngine::processSwitchAlexander Shaposhnikov2017-04-211-2/+2
| | | | | | | | | | | | | | | This diff replaces getTypeSize(CondE->getType())) with getIntWidth(CondE->getType())) in ExprEngine::processSwitch. These calls are not equivalent for bool, see ASTContext.cpp Add a test case. Test plan: make check-clang-analysis make check-clang Differential revision: https://reviews.llvm.org/D32328 llvm-svn: 300936
* Use __CLANG_ATOMIC_TYPE_LOCK_FREE macros in `stdatomic.h`Eric Fiselier2017-04-201-10/+10
| | | | | | | | | | | | | | Summary: This patch makes the header `stdatomic.h` work when `-fms-compatibility` is specified. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32322 llvm-svn: 300919
* Add __CLANG_ATOMIC_<TYPE>_LOCK_FREE macros for use in MSVC compatibility mode.Eric Fiselier2017-04-201-7/+12
| | | | | | | | | | | | | | | | | Summary: Libc++ currently implements the `ATOMIC_<TYPE>_LOCK_FREE` macros using the `__GCC_ATOMIC_<TYPE>_LOCK_FREE` macros. However these are not available when MSVC compatibility is enabled even though C11 `_Atomic` is. This prevents libc++ from correctly implementing `ATOMIC_<TYPE>_LOCK_FREE`. This patch adds an alternative spelling `__CLANG_ATOMIC_<TYPE>_LOCK_FREE` that is enabled with `-fms-compatibility`. Reviewers: rsmith, aaron.ballman, majnemer, zturner, compnerd, jfb, rnk Reviewed By: rsmith Subscribers: BillyONeal, smeenai, jfb, cfe-commits, dschuff Differential Revision: https://reviews.llvm.org/D32265 llvm-svn: 300914
* Sema: protect against ObjC++ typo-correction failureSaleem Abdulrasool2017-04-201-0/+3
| | | | | | | | | ObjC++ has two different types of "pointer" types (ObjCClassPointerType and PointerType). Both can be indirected through. However, the former is not a member expression. Ensure that we do not try to rebuild the MRE in that case. llvm-svn: 300909
* Parse: cleanup some bleeding whitespaceSaleem Abdulrasool2017-04-201-2/+3
| | | | | | Clean up some bleeding whitespace that I noticed. NFC llvm-svn: 300908
* Enable leak sanitizer builds for darwinFrancis Ricci2017-04-201-0/+3
| | | | | | | | | | | | | | Summary: Support for leak sanitizer on darwin has been added to compiler-rt, this patch adds compiler support. Reviewers: dexonsmith, compnerd Subscribers: alekseyshl, kubamracek, cfe-commits Differential Revision: https://reviews.llvm.org/D32192 llvm-svn: 300894
* Don't pass FPOpFusion::Strict to the backendAdam Nemet2017-04-201-1/+3
| | | | | | | | | | | | | | | This restores the behavior prior to D31167 where the code-gen default was FPC_On which mapped to FPOpFusion::Standard. After merging the FE state (on/off) and the code-gen state (on/fast/off), the default became off to match the front-end. In other words, the front-end controls when to fuse along the language standards and the backend shouldn't override this by splitting fused intrinsics as FPOpFusion::Strict would imply. Differential Revision: https://reviews.llvm.org/D32301 llvm-svn: 300858
* Delete unused IncompleteFormat variable, NFCi.Krasimir Georgiev2017-04-201-3/+1
| | | | llvm-svn: 300841
* [index] Record class template specializations using a new 'SpecializationOf'Alex Lorenz2017-04-205-5/+20
| | | | | | | | | | relationship rdar://31603531 Differential Revision: https://reviews.llvm.org/D32010 llvm-svn: 300832
* Add #pragma clang attribute support to the availability attributeAlex Lorenz2017-04-201-3/+1
| | | | | | rdar://31707804 llvm-svn: 300826
* [AVR] Add -mmcu option to the driverLeslie Zhai2017-04-201-0/+6
| | | | | | | | | | | | | | A patch by Peter Wu! Reviewers: jroelofs, xiangzhai Reviewed By: jroelofs, dylanmckay, xiangzhai Subscribers: dlj, dylanmckay, cfe-commits Differential Revision: https://reviews.llvm.org/D29827 llvm-svn: 300818
* PR32673: Don't wrap parameter packs in SubstTemplateTypeParmPackType nodes ↵Richard Smith2017-04-201-5/+16
| | | | | | | | | when forming implicit deduction guides. Doing so thwarts template type deduction. Instead, substitute the pack directly by picking "slice 0" of the resulting expansion. llvm-svn: 300805
* [Sema] Use MSVC inner class behavior on ItaniumShoaib Meenai2017-04-201-3/+4
| | | | | | | | | | | | | | Windows Itanium aims to use MSVC export and import semantics. Inner class members shouldn't be exported on a dllexport explicit instantiation definition of the outer class, and they shouldn't be imported on a dllimport explicit instantiation declaration of the outer class (instead a local copy should be emitted). We were doing the first but not the second, and this mismatch can lead to link errors. Fix the behavior and add tests for both. Differential Revision: https://reviews.llvm.org/D32213 llvm-svn: 300804
* [OpenMP] Prepare sema to support combined constructs with omp distribute and ↵Carlo Bertolli2017-04-205-69/+137
| | | | | | | | | | omp for https://reviews.llvm.org/D32237 This patch prepares sema with additional fields to support all those composite and combined constructs of OpenMP that include pragma 'distribute' and 'for', such as 'distribute parallel for'. It also extends the regression tests for 'distribute parallel for' and adds a new one. llvm-svn: 300802
* [sanitizer-coverage] deprecate -fsanitize-coverage=trace-bbKostya Serebryany2017-04-191-5/+4
| | | | llvm-svn: 300767
* Corrrect warn_unused_result attribute Erich Keane2017-04-191-3/+1
| | | | | | | | | | | | The original idea was that if the attribute on an operator, that the return-value unused-ness wouldn't matter. However, all of the operators except postfix inc/dec return references! References don't result in this warning anyway, so those are already excluded. Differential Revision: https://reviews.llvm.org/D32207 llvm-svn: 300764
* Fix assertion failure in codegen on non-template deduction guide.Richard Smith2017-04-191-0/+4
| | | | llvm-svn: 300762
* [CodeGen] Use preincrement version of APInt::operator++ instead of ↵Craig Topper2017-04-191-1/+1
| | | | | | | | postincrement to avoid creating and immediately discarding a temporary APInt. This is preparation for a clang change to improve the [[nodiscard]] warning to not be ignored on methods that return a class marked [[nodiscard]] that are defined in the class itself. See D32207. llvm-svn: 300756
* [sanitizer-coverage] deprecate -fsanitize-coverage=8bit-countersKostya Serebryany2017-04-191-4/+3
| | | | llvm-svn: 300744
* Parse backend options during thinlto backend compile actionsDavid Blaikie2017-04-191-6/+5
| | | | llvm-svn: 300741
* [sanitizer-coverage] deprecate some of the stale coverage variantsKostya Serebryany2017-04-191-27/+5
| | | | llvm-svn: 300738
* [Coverage] Don't emit mappings for functions in dependent contexts (fixes ↵Vedant Kumar2017-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PR32679) The coverage implementation marks functions which won't be emitted as 'deferred', so that it can emit empty coverage regions for them later (once their linkages are known). Functions in dependent contexts are an exception: if there isn't a full instantiation of a function, it shouldn't be marked 'deferred'. We've been breaking that rule without much consequence because we just ended up with useless, extra, empty coverage mappings. With PR32679, this behavior finally caused a crash, because clang marked a partial template specialization as 'deferred', causing the MS mangler to choke in its delayed-template-parsing mode: error: cannot mangle this template type parameter type yet (http://bugs.llvm.org/show_bug.cgi?id=32679) Fix this by checking if a decl's context is a dependent context before marking it 'deferred'. Based on a patch by Adam Folwarczny! Differential Revision: https://reviews.llvm.org/D32144 llvm-svn: 300723
* [Sema][ObjC] Disallow jumping into ObjC fast enumeration loops.Akira Hatanaka2017-04-192-0/+10
| | | | | | | | rdar://problem/31635406 Differential Revision: https://reviews.llvm.org/D32187 llvm-svn: 300722
* Prefer addAttr(Attribute::AttrKind) over the AttributeList overloadReid Kleckner2017-04-192-17/+7
| | | | | | | | This should simplify the call sites, which typically want to tweak one attribute at a time. It should also avoid creating ephemeral AttributeLists that live forever. llvm-svn: 300718
OpenPOWER on IntegriCloud