summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [index] Take advantage of 'external_source_symbol' attribute for indexing ↵Argyrios Kyrtzidis2017-04-211-0/+88
| | | | | | | | | 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-1/+2
| | | | llvm-svn: 300948
* [modules] Properly look up the owning module for an instantiation of a ↵Richard Smith2017-04-213-0/+37
| | | | | | | | | | | | | | | 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-0/+13
| | | | | | | | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | 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-202-0/+63
| | | | | | | | | | | | | | | | | 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/+9
| | | | | | | | | 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
* Enable leak sanitizer builds for darwinFrancis Ricci2017-04-202-0/+30
| | | | | | | | | | | | | | 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
* [Driver] Add a missing -no-canonical-prefixes to test.Benjamin Kramer2017-04-201-1/+1
| | | | llvm-svn: 300873
* Don't pass FPOpFusion::Strict to the backendAdam Nemet2017-04-201-0/+18
| | | | | | | | | | | | | | | 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
* [index] Record class template specializations using a new 'SpecializationOf'Alex Lorenz2017-04-201-0/+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-203-5/+6
| | | | | | rdar://31707804 llvm-svn: 300826
* [AVR] Add -mmcu option to the driverLeslie Zhai2017-04-201-0/+5
| | | | | | | | | | | | | | 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
* [ODRHash] clean up test and add new examples. NFCRichard Trieu2017-04-201-124/+67
| | | | | | | | | Use a macro to generate the struct with all decls. Previously, four identical changes would be needed to update this test. This macro reduces that to one location. Added two other tests for issues that triggered false positives during testing. llvm-svn: 300814
* PR32673: Don't wrap parameter packs in SubstTemplateTypeParmPackType nodes ↵Richard Smith2017-04-201-0/+35
| | | | | | | | | 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-0/+25
| | | | | | | | | | | | | | 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
* Add a triple to codegen test.Richard Smith2017-04-201-1/+1
| | | | llvm-svn: 300803
* [OpenMP] Prepare sema to support combined constructs with omp distribute and ↵Carlo Bertolli2017-04-202-1/+154
| | | | | | | | | | 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-3/+4
| | | | llvm-svn: 300767
* Corrrect warn_unused_result attribute Erich Keane2017-04-191-0/+46
| | | | | | | | | | | | 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/+21
| | | | llvm-svn: 300762
* [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-0/+13
| | | | llvm-svn: 300741
* [sanitizer-coverage] deprecate some of the stale coverage variantsKostya Serebryany2017-04-191-8/+1
| | | | llvm-svn: 300738
* [Coverage] Don't emit mappings for functions in dependent contexts (fixes ↵Vedant Kumar2017-04-191-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-0/+24
| | | | | | | | rdar://problem/31635406 Differential Revision: https://reviews.llvm.org/D32187 llvm-svn: 300722
* Add #pragma clang attribute support to the external_source_symbol attributeAlex Lorenz2017-04-192-4/+5
| | | | | | | | | | | | | | | | | | | Prior to this commit the external_source_symbol attribute wasn't supported by #pragma clang attribute for the following two reasons: - The Named attribute subject hasn't been supported by TableGen. - There was no way to specify a subject match rule for #pragma clang attribute that could operate on a set of attribute subjects (e.g. the ones that derive from NamedDecl). This commit fixes the two issues and thus adds external_source_symbol support to #pragma clang attribute. rdar://31169028 Differential Revision: https://reviews.llvm.org/D32176 llvm-svn: 300712
* [Driver] Unify linking of OpenMP runtime. NFCI.Jonas Hahnfeld2017-04-191-5/+11
| | | | | | | | While at it, extend test for FreeBSD and check for -lrt iff on Linux. Differential Revision: https://reviews.llvm.org/D30087 llvm-svn: 300689
* Avoid assert when a non-static member function is qualified with __unalignedRoger Ferrer Ibanez2017-04-191-0/+20
| | | | | | | | | | | | | | | Under -fms-extensions __unaligned is a type-qualifier that can be applied to a non-static member function declaration. This causes an assertion when mangling the name under Itanium, where that qualifier is not mangled. This patch justs makes the minimal change to avoid the crash and avoid mangling __unaligned, as it currently happens with non-member functions. Differential Revision: https://reviews.llvm.org/D31976 llvm-svn: 300686
* Add support for editor placeholders to ClangAlex Lorenz2017-04-193-5/+84
| | | | | | | | | | | | | | | | | | | | | This commit teaches Clang to recognize editor placeholders that are produced when an IDE like Xcode inserts a code-completion result that includes a placeholder. Now when the lexer sees a placeholder token, it emits an 'editor placeholder in source file' error and creates an identifier token that represents the placeholder. The parser/sema can now recognize the placeholders and can suppress the diagnostics related to the placeholders. This ensures that live issues in an IDE like Xcode won't get spurious diagnostics related to placeholders. This commit also adds a new compiler option named '-fallow-editor-placeholders' that silences the 'editor placeholder in source file' error. This is useful for an IDE like Xcode as we don't want to display those errors in live issues. rdar://31581400 Differential Revision: https://reviews.llvm.org/D32081 llvm-svn: 300667
* Revert r300653 and r300650. The underlying commit fixes one issue withChandler Carruth2017-04-192-23/+0
| | | | | | | | | | modules but exposes much more widespread issues. Example and more information is on the review thread for r300650. Original commit summary: [modules] Properly look up the owning module for an instantiation of a merged template. llvm-svn: 300659
* [modules] Properly look up the owning module for an instantiation of a ↵Richard Smith2017-04-192-0/+23
| | | | | | | | | | | | 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. llvm-svn: 300650
* [modules-ts] Fold together -x c++ and -x c++-module at -cc1 level.Richard Smith2017-04-181-1/+1
| | | | | | | | | | | | | The driver needs to know whether it's building a module interface or implementation unit because it affects which outputs it produces and how it builds the command pipeline. But the frontend doesn't need to know and should not care: all it needs to know is what action it is being asked to perform on the input. (This is in preparation for permitting -emit-obj to be used on a module interface unit to produce object code without going via a "full" PCM file.) llvm-svn: 300611
* Do not warn about whitespace between ??/ trigraph and newline in line ↵Richard Smith2017-04-181-1/+6
| | | | | | comments if trigraphs are disabled in the current language. llvm-svn: 300609
* PR30508: Downgrade error to warning if the umbrella folder doesn't exist.Vassil Vassilev2017-04-181-0/+8
| | | | | | Patch by Yuka Takahashi (D32119)! llvm-svn: 300594
* [AArch64][clang] Pass cpu/arch information to assembler for AArch64.Manoj Gupta2017-04-181-0/+27
| | | | | | | | | | | | | | | | Summary: Pass Cpu/Arch options to assembler for AArch64 with no-integrated-as. This fixes PR20019. Reviewers: richard.barton.arm, kristof.beyls, rengolin Reviewed By: rengolin Subscribers: srhines, pirama, aemerson, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D32132 llvm-svn: 300571
* mingw-w64: enable support for __declspec(selectany)Martell Malone2017-04-182-2/+3
| | | | | | | | | | Add selectany as a GCC spelling for mingw-w64 Reviewers: rnk Differential revision: https://reviews.llvm.org/D32083 llvm-svn: 300562
* [ASTPrinter] Print template parameter lists for out-of-line functionsAlex Lorenz2017-04-181-0/+41
| | | | llvm-svn: 300560
* Add #pragma clang attributeAlex Lorenz2017-04-1814-0/+1322
| | | | | | | | | | | | | | | | | This is a recommit of r300539 that was reverted in r300543 due to test failures. The original commit message is displayed below: The new '#pragma clang attribute' directive can be used to apply attributes to multiple declarations. An attribute must satisfy the following conditions to be supported by the pragma: - It must have a subject list that's defined in the TableGen file. - It must be documented. - It must not be late parsed. - It must have a GNU/C++11 spelling. Differential Revision: https://reviews.llvm.org/D30009 llvm-svn: 300556
* [ARM] Add hardware build attributes in assemblerOliver Stannard2017-04-181-0/+20
| | | | | | | | | | | | | | | | | This passes an option to the ARM assembly parser to emit build attributes for the hardware selected by command line options, when assembling an assembly file. This is not enabled for C/C++, as this would result in duplicate build attribute directives being emitted in each inline assembly block, when emitting assembly. This also adds an option to allow disabling this behaviour for assembly files, for users who were relying on the old behaviour. Differential revision: https://reviews.llvm.org/D31813 llvm-svn: 300550
* [ARM,AArch64] Define __ELF__ for arm-none-eabihf and AArch64Oliver Stannard2017-04-181-0/+3
| | | | | | | This macro is defined for arm-none-eabi as of r266625, but it should also be defined for eabihf and aarch64. llvm-svn: 300549
* Revert r300539 - Add #pragma clang attributeAlex Lorenz2017-04-1814-1322/+0
| | | | | | | Some tests fail on the Windows buildbots. I will have to investigate more. This commit reverts r300539, r300540 and r300542. llvm-svn: 300543
* Add #pragma clang attributeAlex Lorenz2017-04-1814-0/+1322
| | | | | | | | | | | | | | The new '#pragma clang attribute' directive can be used to apply attributes to multiple declarations. An attribute must satisfy the following conditions to be supported by the pragma: - It must have a subject list that's defined in the TableGen file. - It must be documented. - It must not be late parsed. - It must have a GNU/C++11 spelling. Differential Revision: https://reviews.llvm.org/D30009 llvm-svn: 300539
* [coroutines] Fix building of new/delete expressions when ↵Eric Fiselier2017-04-182-3/+66
| | | | | | | | | | | | | | | | | | | | | | get_return_object_on_allocation_failure() is present. Summary: This patch implements [dcl.fct.def.coroutine]p8: > The unqualified-id get_return_object_on_allocation_failure is looked up in the scope of > class P by class member access lookup (3.4.5). If a declaration is found, ..., and if a > global allocation function is selected, the ::operator new(size_t, nothrow_t) form shall be used. > [...] > The allocation function used in this case must have a non-throwing noexcept-specification. Reviewers: GorNishanov, rsmith, majnemer, aaron.ballman Reviewed By: GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31562 llvm-svn: 300524
* Debug Info: Remove special-casing of indirect function argument handling.Adrian Prantl2017-04-183-5/+4
| | | | | | | | | | | | LLVM has changed the semantics of dbg.declare for describing function arguments. After this patch a dbg.declare always takes the *address* of a variable as the first argument, even if the argument is not an alloca. https://bugs.llvm.org/show_bug.cgi?id=32382 rdar://problem/31205000 llvm-svn: 300523
* Fix mishandling of escaped newlines followed by newlines or nuls.Richard Smith2017-04-171-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if an escaped newline was followed by a newline or a nul, we'd lex the escaped newline as a bogus space character. This led to a bunch of different broken corner cases: For the pattern "\\\n\0#", we would then have a (horizontal) space whose spelling ends in a newline, and would decide that the '#' is at the start of a line, and incorrectly start preprocessing a directive in the middle of a logical source line. If we were already in the middle of a directive, this would result in our attempting to process multiple directives at the same time! This resulted in crashes, asserts, and hangs on invalid input, as discovered by fuzz-testing. For the pattern "\\\n" at EOF (with an implicit following nul byte), we would produce a bogus trailing space character with spelling "\\\n". This was mostly harmless, but would lead to clang-format getting confused and misformatting in rare cases. We now produce a trailing EOF token with spelling "\\\n", consistent with our handling for other similar cases -- an escaped newline is always part of the token containing the next character, if any. For the pattern "\\\n\n", this was somewhat more benign, but would produce an extraneous whitespace token to clients who care about preserving whitespace. However, it turns out that our lexing for line comments was relying on this bug due to an off-by-one error in its computation of the end of the comment, on the slow path where the comment might contain escaped newlines. llvm-svn: 300515
* Rename coroutine warning when unhandled_exception() is missingEric Fiselier2017-04-172-3/+18
| | | | llvm-svn: 300513
* Revert r300504 - [coroutines] Fix rebuilding of implicit and dependent ↵Eric Fiselier2017-04-172-66/+3
| | | | | | | | | coroutine statements. I have no idea what's happening here. The tests that fail on all of the bots pass on my machine. Further investigation needed. llvm-svn: 300511
* [ubsan] Skip null checks if they are constant-folded awayVedant Kumar2017-04-171-0/+2
| | | | | | | | | | | | | | | | | | | | | The IR builder can constant-fold null checks if the pointer operand points to a constant. If the "is-non-null" check is folded away to "true", don't emit the null check + branch. Testing: check-clang, check-ubsan. This slightly reduces the amount of null checks we emit when compiling X86ISelLowering.cpp. Here are the numbers from patched/unpatched clangs based on r300371. ------------------------------------- | Setup | # of null checks | ------------------------------------- | unpatched, -O0 | 25251 | | patched, -O0 | 23925 | (-5.3%) ------------------------------------- llvm-svn: 300509
* [ubsan] Skip null checks on pointers to the start of an allocaVedant Kumar2017-04-171-7/+19
| | | | | | | | | | | | | | | | | | | | Pointers to the start of an alloca are non-null, so we don't need to emit runtime null checks for them. Testing: check-clang, check-ubsan. This significantly reduces the amount of null checks we emit when compiling X86ISelLowering.cpp. Here are the numbers from patched / unpatched clangs based on r300371. ------------------------------------- | Setup | # of null checks | ------------------------------------- | unpatched, -O0 | 45439 | | patched, -O0 | 25251 | (-44.4%) ------------------------------------- llvm-svn: 300508
OpenPOWER on IntegriCloud