summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [ObjC][Modules] Don't perform property lookup in hidden class extensionsAlex Lorenz2017-02-222-0/+11
| | | | | | rdar://30603803 llvm-svn: 295903
* [CodeGen] Add param info for ctors with ABI args.George Burgess IV2017-02-221-0/+15
| | | | | | This fixes a few assertion failures. Please see the added test case. llvm-svn: 295894
* [ODRHash] static_cast and Stmt hashing.Richard Trieu2017-02-221-1/+71
| | | | | | | | | | Add support for static_cast in classes. Add pointer-independent profiling for Stmt's, sharing most of the logic with Stmt::Profile. This is the first of the deep sub-Decl diffing for error messages. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295890
* PR32034: Evaluate _Atomic(T) in-place when T is a class or array type.Richard Smith2017-02-221-0/+9
| | | | | | | | This is necessary in order for the evaluation of an _Atomic initializer for those types to have an associated object, which an initializer for class or array type needs. llvm-svn: 295886
* AMDGPU: Add fmed3 half builtinMatt Arsenault2017-02-223-2/+24
| | | | llvm-svn: 295874
* stop using associative comdats for SEH filter functionsBob Haarman2017-02-221-3/+3
| | | | | | | | | | | | Summary: We implement structured exception handling (SEH) by generating filter functions for functions that use exceptions. Currently, we use associative comdats to ensure that the filter functions are preserved if and only if the functions we generated them for are preserved. This can lead to problems when generating COFF objects - LLVM may decide to inline a function that uses SEH and remove its body, at which point we will end up with a comdat that COFF cannot represent. To avoid running into that situation, this change makes us not use associative comdats for SEH filter functions. We can still get the benefits we used the associative comdats for: we will always preserve filter functions we use, and dead stripping can eliminate the ones we don't use. Reviewers: rnk, pcc, ruiu Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D30117 llvm-svn: 295872
* Improve support for 'decltype(auto)' in template template parameter matching.Richard Smith2017-02-221-6/+7
| | | | | | | | | | | | | | | A 'decltype(auto)' parameter can match any other kind of non-type template parameter, so should be usable in place of any other parameter in a template template argument. The standard is sadly extremely unclear on how this is supposed to work, but this seems like the obviously-correct result. It's less clear whether an 'auto' parameter should be able to match 'decltype(auto)', since the former cannot be used if the latter turns out to be used for a reference type, but if we disallow that then consistency suggests we should also disallow 'auto' matching 'T' for the same reason, defeating intended use cases of the feature. llvm-svn: 295866
* [OpenCL] r600 needs OpenCL kernel calling conventionJan Vesely2017-02-221-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D30236 llvm-svn: 295843
* [OpenMP] Generate better diagnostics for cancel and cancellation pointJonas Hahnfeld2017-02-222-0/+16
| | | | | | | | | | | | | | | checkNestingOfRegions uses CancelRegion to determine whether cancel and cancellation point are valid in the given nesting. This leads to unuseful diagnostics if CancelRegion is invalid. The given test case has produced: region cannot be closely nested inside 'parallel' region As a solution, introduce checkCancelRegion and call it first to get the expected error: one of 'for', 'parallel', 'sections' or 'taskgroup' is expected Differential Revision: https://reviews.llvm.org/D30135 llvm-svn: 295808
* Call the correct @llvm.objectsize.George Burgess IV2017-02-221-0/+26
| | | | | | | | | | | | | | | | | | The following code would crash clang: void foo(unsigned *const __attribute__((pass_object_size(0)))); void bar(unsigned *i) { foo(i); } This is because we were always selecting the version of `@llvm.objectsize` that takes an i8* in CodeGen. Passing an i32* as an i8* makes LLVM very unhappy. (Yes, I'm surprised that this remained uncaught for so long, too. :) ) As an added bonus, we'll now also use the appropriate address space when emitting @llvm.objectsize calls. llvm-svn: 295805
* Add more ODR checking.Richard Trieu2017-02-221-0/+412
| | | | | | | | | | Add the basics for the ODRHash class, which will only process Decl's from a whitelist, which currently only has AccessSpecDecl. Different access specifiers in merged classes can now be detected. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295800
* Fix assertion failure when generating debug information for a variableRichard Smith2017-02-221-0/+17
| | | | | | | | | | declaration declared using class template argument deduction. Patch by Eric Fiselier (who is busy and asked me to commit this on his behalf)! Differential Revision: https://reviews.llvm.org/D30082 llvm-svn: 295794
* [c++1z] Mark constexpr lambdas as done on status page and start advertisingRichard Smith2017-02-211-2/+2
| | | | | | | | them via feature test macro __cpp_constexpr. Thanks to Faisal for implementing this feature! llvm-svn: 295791
* Fix deduction of type of pack-expanded non-type template parameter.Richard Smith2017-02-212-7/+17
| | | | | | | | | We need to look through the PackExpansionType in the parameter type when deducing, and we need to consider the possibility of deducing arguments for packs that are not lexically mentioned in the pattern (but are nonetheless deducible) when figuring out which packs are covered by a pack deduction scope. llvm-svn: 295790
* Hook up OpenBSD AArch64 supportBrad Smith2017-02-212-1/+194
| | | | llvm-svn: 295786
* Declare lgamma library builtins as never being constJacob Gravelle2017-02-211-3/+12
| | | | | | | | | | | | | | | Summary: POSIX requires lgamma writes to an external global variable, signgam. This prevents annotating lgamma with readnone, which is incorrect on targets that write to signgam. Reviewers: efriedma, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29778 llvm-svn: 295781
* Fix for pr31836 - pp_nonportable_path on absolute paths: broken delimitersTaewook Oh2017-02-211-0/+9
| | | | | | | | | | | | | | Summary: This is a patch for PR31836. As the bug replaces the path separators in the included file name with the characters following them, the test script makes sure that there's no "Ccase-insensitive-include-pr31836.h" in the warning message. Reviewers: rsmith, eric_niebler Reviewed By: eric_niebler Subscribers: karies, cfe-commits Differential Revision: https://reviews.llvm.org/D30000 llvm-svn: 295779
* [XRay] Merge xray clang flag tests, and add powerpc64le.Tim Shen2017-02-213-29/+6
| | | | | | | | | | | | Summary: I'm not sure why they were in different files, but it's kind of harder to maintain. I create this patch partially for initiate a discussion. Reviewers: dberris Subscribers: nemanjai, cfe-commits Differential Revision: https://reviews.llvm.org/D30118 llvm-svn: 295778
* Only enable AddDiscriminator pass when -fdebug-info-for-profiling is trueDehao Chen2017-02-211-3/+2
| | | | | | | | | | | | | | Summary: AddDiscriminator pass is only useful for sample pgo. This patch restricts AddDiscriminator to -fdebug-info-for-profiling so that it does not introduce unecessary debug size increases for non-sample-pgo builds. Reviewers: dblaikie, aprantl Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30220 llvm-svn: 295764
* [mips] Define macros related to -mabicalls in the preprocessorSimon Dardis2017-02-211-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Historically, NetBSD, FreeBSD and OpenBSD have defined the macro ABICALLS in the preprocessor when -mabicalls is in effect. Mainline GCC later defined __mips_abicalls when -mabicalls is in effect. This patch teaches the preprocessor to define these macros when appropriate. NetBSD does not require the ABICALLS macro. This resolves PR/31694. Thanks to Sean Bruno for highlighting this issue! Reviewers: slthakur, seanbruno Reviewed By: seanbruno Subscribers: joerg, brad, emaste, seanbruno, cfe-commits Differential Revision: https://reviews.llvm.org/D29032 llvm-svn: 295728
* Fix lookup through injected-class-names in implicit deduction guides in theRichard Smith2017-02-211-4/+17
| | | | | | | | | | case where the class template has a parameter pack. Checking of the template arguments expects an "as-written" template argument list, which in particular does not have any parameter packs. So flatten the packs into separate arguments before passing them in. llvm-svn: 295710
* When deducing an array bound from the length of an initializer list, don'tRichard Smith2017-02-212-6/+46
| | | | | | assume the bound has a non-dependent integral type. llvm-svn: 295698
* PR32010: Fix template argument depth mixup when forming implicit constructorRichard Smith2017-02-212-0/+39
| | | | | | | | | | | | | template deduction guides for class template argument deduction. Ensure that we have a local instantiation scope for tracking the instantiated parameters. Additionally, unusually, we're substituting at depth 1 and leaving depth 0 alone; make sure that we don't reduce template parameter depth by 2 for inner parameters in the process. (This is probably also broken for alias templates in the case where they're expanded within a dependent context, but this patch doesn't fix that.) llvm-svn: 295696
* Add template parameter depth and index to -ast-dump output.Richard Smith2017-02-212-5/+5
| | | | llvm-svn: 295689
* Sema: use PropertyDecl for property selectorSaleem Abdulrasool2017-02-201-0/+9
| | | | | | | | | | | Using the constructed name for the class properties with dot syntax may yield an inappropriate selector (i.e. if it is specified via property attributes). Prefer the declaration for the selector, falling back to the constructed name otherwise. Patch by David Herzka! llvm-svn: 295683
* [Sema][ObjC] perform-selector ARC check should see @selector in parensAlex Lorenz2017-02-201-0/+1
| | | | llvm-svn: 295674
* [ASTImporter] Support default argument initialization of ParmVarDeclsAleksei Sidorin2017-02-202-0/+6
| | | | | | | | Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D29612 llvm-svn: 295654
* [ARM] Add regression tests for Cortex-M23 and Cortex-M33Sanne Wouda2017-02-202-0/+31
| | | | | | | | | | | | Reviewers: rengolin, t.p.northover Reviewed By: t.p.northover Subscribers: aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D30100 llvm-svn: 295647
* [analyzer] Do not duplicate call graph nodes for functions that have ↵Aleksei Sidorin2017-02-201-1/+11
| | | | | | | | | | definition and forward declaration Patch by Ivan Sidorenko! Differential Revision: https://reviews.llvm.org/D29643 llvm-svn: 295644
* Enable support for __float128 in Clang on OpenBSD/X86Brad Smith2017-02-201-0/+4
| | | | | | | /usr/local/include/c++/4.9.4/type_traits:279:39: error: __float128 is not supported on this target llvm-svn: 295635
* Always use --eh-frame-hdr on OpenBSD, even for -staticBrad Smith2017-02-191-0/+6
| | | | llvm-svn: 295614
* Link static PIE programs against rcrt0.o on OpenBSDBrad Smith2017-02-191-0/+23
| | | | | | Patch by Stefan Kempf. llvm-svn: 295610
* [CUDA] Don't pass -stack-protector to NVPTX compilations.Justin Lebar2017-02-191-0/+23
| | | | | | | | | We can't support stack-protector on NVPTX because NVPTX doesn't expose a stack to the compiler! Fixes PR32009. llvm-svn: 295609
* [X86] Replace XOP vpcmov builtins with native vector logical operations.Craig Topper2017-02-181-2/+8
| | | | llvm-svn: 295570
* AMDGPU: Add gfx900 and gfx901 processorsMatt Arsenault2017-02-181-0/+4
| | | | llvm-svn: 295556
* [analyzer] Revert 295545. There are buildbot failures.Daniel Marjamaki2017-02-181-5/+0
| | | | llvm-svn: 295548
* [analyzer] Fix crash in CastToStruct when there is no record definitionDaniel Marjamaki2017-02-181-0/+5
| | | | | | | | This crash was reported in https://bugs.llvm.org//show_bug.cgi?id=31173 Differential Revision: https://reviews.llvm.org/D28297 llvm-svn: 295545
* Process attributes 'ifunc' and 'alias' when checking for redefinitionSerge Pavlov2017-02-182-2/+5
| | | | | | | | | | These attributes effectively turn a non-defining declaration into a definition, so the case when the declaration already has a body must be diagnosed properly. Differential Revision: https://reviews.llvm.org/D30032 llvm-svn: 295541
* [profiling] Make a test more explicit. NFC.Vedant Kumar2017-02-181-7/+15
| | | | | | | | The cxx-structors.cpp test checks that some instrumentation doesn't appear, but it should be more explicit about which instrumentation it actually expects to appear. llvm-svn: 295532
* [profiling] Tighten test cases which refer to "profn" vars. NFC.Vedant Kumar2017-02-182-7/+7
| | | | | | | | The frontend can't see "__profn" profile name variables after IRGen because llvm throws these away now. Tighten up some test cases which checked for the non-existence of those variables. llvm-svn: 295528
* Handle deduction guides better in -ast-print.Richard Smith2017-02-181-2/+8
| | | | llvm-svn: 295521
* Retry^2: [ubsan] Reduce null checking of C++ object pointers (PR27581)Vedant Kumar2017-02-174-23/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda. Previously, given a load of a member variable from an instance method ('this->x'), ubsan would insert a null check for 'this', and another null check for '&this->x', before allowing the load to occur. Similarly, given a call to a method from another method bound to the same instance ('this->foo()'), ubsan would a redundant null check for 'this'. There is also a redundant null check in the case where the object pointer is a reference ('Ref.foo()'). This patch teaches ubsan to remove the redundant null checks identified above. Testing: check-clang, check-ubsan, and a stage2 ubsan build. I also compiled X86FastISel.cpp with -fsanitize=null using patched/unpatched clangs based on r293572. Here are the number of null checks emitted: ------------------------------------- | Setup | # of null checks | ------------------------------------- | unpatched, -O0 | 21767 | | patched, -O0 | 10758 | ------------------------------------- Changes since the initial commit: - Don't introduce any unintentional object-size or alignment checks. - Don't rely on IRGen of C labels in the test. Differential Revision: https://reviews.llvm.org/D29530 llvm-svn: 295515
* Revert "Retry: [ubsan] Reduce null checking of C++ object pointers (PR27581)"Vedant Kumar2017-02-173-197/+23
| | | | | | | | This reverts commit r295401. It breaks the ubsan self-host. It inserts object size checks once per C++ method which fire when the structure is empty. llvm-svn: 295494
* [Test] Make Lit tests C++11 compatible - miscCharles Li2017-02-175-18/+38
| | | | | | | | Updated 5 tests. Differential Revision: https://reviews.llvm.org/D24812 llvm-svn: 295484
* [OpenMP] Fix cancellation point in task with no cancelJonas Hahnfeld2017-02-171-0/+15
| | | | | | | | | With tasks, the cancel may happen in another task. This has a different region info which means that we can't find it here. Differential Revision: https://reviews.llvm.org/D30091 llvm-svn: 295474
* [OpenMP] Remove barriers at cancel and cancellation pointJonas Hahnfeld2017-02-172-20/+4
| | | | | | | | | | | | | | | | This resolves a deadlock with the cancel directive when there is no explicit cancellation point. In that case, the implicit barrier acts as cancellation point. After removing the barrier after cancel, the now unmatched barrier for the explicit cancellation point has to go as well. This has probably worked before rL255992: With the calls for the explicit barrier, it was sure that all threads passed a barrier before exiting. Reported by Simon Convent and Joachim Protze! Differential Revision: https://reviews.llvm.org/D30088 llvm-svn: 295473
* Revert r295421, new ODR checker for modules, to fix build bot.Richard Trieu2017-02-172-1161/+0
| | | | llvm-svn: 295427
* Add better ODR checking for modules.Richard Trieu2017-02-172-0/+1161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A slightly weaker form of ODR checking than previous attempts, but hopefully won't break the modules build bot. Future work will be needed to catch all cases. When objects are imported for modules, there is a chance that a name collision will cause an ODR violation. Previously, only a small number of such violations were detected. This patch provides a stronger check based on AST nodes. The information needed to uniquely identify an object is taken from the AST and put into a one-dimensional byte stream. This stream is then hashed to give a value to represent the object, which is stored with the other object data in the module. When modules are loaded, and Decl's are merged, the hash values of the two Decl's are compared. Only Decl's with matched hash values will be merged. Mismatch hashes will generate a module error, and if possible, point to the first difference between the two objects. The transform from AST to byte stream is a modified depth first algorithm. Due to references between some AST nodes, a pure depth first algorithm could generate loops. For Stmt nodes, a straight depth first processing occurs. For Type and Decl nodes, they are replaced with an index number and only on first visit will these nodes be processed. As an optimization, boolean values are saved and stored together in reverse order at the end of the byte stream to lower the ammount of data that needs to be hashed. Compile time impact was measured at 1.5-2.0% during module building, and negligible during builds without module building. Differential Revision: https://reviews.llvm.org/D21675 llvm-svn: 295421
* [index] Improvde how we handle synthesized ObjC properties and the ↵Argyrios Kyrtzidis2017-02-173-12/+100
| | | | | | | | | | | | associated ivars. Related synthesized properties with the ivar they use with the 'accessor' relation, and make sure we mark them 'implicit' when appropriate. Patch by Nathan Hawes! https://reviews.llvm.org/D30012 llvm-svn: 295416
* Retry: [ubsan] Reduce null checking of C++ object pointers (PR27581)Vedant Kumar2017-02-173-23/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch teaches ubsan to insert exactly one null check for the 'this' pointer per method/lambda. Previously, given a load of a member variable from an instance method ('this->x'), ubsan would insert a null check for 'this', and another null check for '&this->x', before allowing the load to occur. Similarly, given a call to a method from another method bound to the same instance ('this->foo()'), ubsan would a redundant null check for 'this'. There is also a redundant null check in the case where the object pointer is a reference ('Ref.foo()'). This patch teaches ubsan to remove the redundant null checks identified above. Testing: check-clang and check-ubsan. I also compiled X86FastISel.cpp with -fsanitize=null using patched/unpatched clangs based on r293572. Here are the number of null checks emitted: ------------------------------------- | Setup | # of null checks | ------------------------------------- | unpatched, -O0 | 21767 | | patched, -O0 | 10758 | ------------------------------------- Changes since the initial commit: don't rely on IRGen of C labels in the test. Differential Revision: https://reviews.llvm.org/D29530 llvm-svn: 295401
OpenPOWER on IntegriCloud