summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Refine OpenCLImageAccessAttr to OpenCLAccessAttrXiuli Pan2016-02-264-6/+23
| | | | | | | | | | | | | | | Summary: OpenCL access qualifiers are now not only used for image types, refine it to avoid misleading, Add semacheck for OpenCL access qualifier as well as test caees. Reviewers: pekka.jaaskelainen, Anastasia, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D16040 llvm-svn: 261961
* [analyzer] Shorten ObjcSuperDeallocChecker diagnostics.Devin Coughlin2016-02-261-22/+35
| | | | | | | | | Change "use of 'self' after it has been freed with call to [super dealloc]" to "use of 'self' after it has been deallocated" and "use of instance variable '_ivar' after the instance has been freed with call to [super dealloc]" to "use of instance variable '_ivar' after 'self' has been deallocated". llvm-svn: 261945
* [analyzer] Warn on use of 'self' after call to to [super dealloc].Devin Coughlin2016-02-251-19/+81
| | | | | | | | | | | | Referring to 'self' after a call to [super dealloc] is a use-after-free in Objective-C because NSObject's -dealloc frees the memory pointed to by self. This patch extends the ObjCSuperDeallocChecker to catch this error. rdar://problem/6953275 Differential Revision: http://reviews.llvm.org/D17528 llvm-svn: 261935
* [analyzer] Reapply r261917 with a fix.Devin Coughlin2016-02-254-39/+534
| | | | | | | | This reapplies "[analyzer] Make ObjCDeallocChecker path sensitive." (r261917) with a fix for an error on some bots about specializing a template from another namespace. llvm-svn: 261929
* Revert "[analyzer] Make ObjCDeallocChecker path sensitive."Devin Coughlin2016-02-254-534/+39
| | | | | | This reverts commit r261917. It broke the bots. llvm-svn: 261921
* [analyzer] Make ObjCDeallocChecker path sensitive.Devin Coughlin2016-02-254-39/+534
| | | | | | | | | | | | | | Convert the ObjCDeallocChecker to be path sensitive. The primary motivation for this change is to prevent false positives when -dealloc calls helper invalidation methods to release instance variables, but it additionally improves precision when -dealloc contains control flow. It also reduces the need for pattern matching. The check for missing -dealloc methods remains AST-based. Part of rdar://problem/6927496 Differential Revision: http://reviews.llvm.org/D17511 llvm-svn: 261917
* [Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.Akira Hatanaka2016-02-251-0/+9
| | | | | | | | | | | | | The assert isn't correct since TypeLoc::ObjCObjectTypeLoc doesn't indicate whether the type is a dependent type. The function returns false for a type like "<SomeProtocol>" which is a synonym for "id<SomeProtocol>". rdar://problem/23838912 Differential Revision: http://reviews.llvm.org/D17355 llvm-svn: 261829
* [OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.Alexey Bataev2016-02-252-3/+217
| | | | | | | | | OpenMP 4.5 allows to privatize non-static member decls in non-static member functions. Patch captures such decls by reference in general (for bitfields, by value) and then operates with this capture. For bitfields, at the end of codegen for lastprivates original bitfield is updated with the value of captured copy. llvm-svn: 261824
* [OPENMP 4.5] Support fielddecls in 'shared' clause.Alexey Bataev2016-02-251-2/+19
| | | | | | | | OpenMP 4.5 allows to use non-static data members of current class in non-static member functions in different kind of clauses. Patch adds support for data members in 'shared' clause. llvm-svn: 261820
* [OpenCL] Add Sema checks for typesXiuli Pan2016-02-254-2/+16
| | | | | | | | | | | | | | Summary: Add Sema checks for opencl type: image, pipe.... This patch is partitioned from http://reviews.llvm.org/D16047 Reviewers: Anastasia, yaxunl Subscribers: pekka.jaaskelainen, cfe-commits Differential Revision: http://reviews.llvm.org/D17437 llvm-svn: 261818
* Fix assertion failure on MaybeODRUseExprs.Manman Ren2016-02-241-0/+10
| | | | | | | | | | | | | | | | | | In VisitNonTypeTemplateParamDecl, before SubstExpr with the default argument, we should create a ConstantEvaluated ExpressionEvaluationContext. Without this, it is possible to use a PotentiallyEvaluated ExpressionEvaluationContext; and MaybeODRUseExprs will not be cleared when popping the context, causing assertion failure. This is similar to how we handle the context before SubstExpr with the default argument, in SubstDefaultTemplateArgument. Part of PR13986. rdar://24480205 Differential Revision: http://reviews.llvm.org/D17576 llvm-svn: 261803
* [CUDA] Mark all CUDA device-side function defs, decls, and calls as convergent.Justin Lebar2016-02-242-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is important for e.g. the following case: void sync() { __syncthreads(); } void foo() { do_something(); sync(); do_something_else(): } Without this change, if the optimizer does not inline sync() (which it won't because __syncthreads is also marked as noduplicate, for now anyway), it is free to perform optimizations on sync() that it would not be able to perform on __syncthreads(), because sync() is not marked as convergent. Similarly, we need a notion of convergent calls, since in the case when we can't statically determine a call's target(s), we need to know whether it's safe to perform optimizations around the call. This change is conservative; the optimizer will remove these attrs where it can, see r260318, r260319. Reviewers: majnemer Subscribers: cfe-commits, jhen, echristo, tra Differential Revision: http://reviews.llvm.org/D17056 llvm-svn: 261779
* [CUDA] do not allow attribute-based overloading for __global__ functions.Artem Belevich2016-02-241-0/+10
| | | | | | | | __global__ functions are present on both host and device side, so providing __host__ or __device__ overloads is not going to do anything useful. llvm-svn: 261778
* [CUDA] Don't specify exact line numbers in cuda-builtin-vars.cu.Justin Lebar2016-02-241-5/+5
| | | | | | | | This makes the test less fragile to changes to cuda_builtin_vars.h. Test-only change. llvm-svn: 261775
* Bail on compilation as soon as a job fails.Justin Lebar2016-02-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (Re-land of r260448, which was reverted in r260522 due to a test failure in Driver/output-file-cleanup.c that only showed up in fresh builds.) Previously we attempted to be smart; if one job failed, we'd run all jobs that didn't depend on the failing job. Problem is, this doesn't work well for e.g. CUDA compilation without -save-temps. In this case, the device-side and host-side Assemble actions (which actually are responsible for preprocess, compile, backend, and assemble, since we're not saving temps) are necessarily distinct. So our clever heuristic doesn't help us, and we repeat every error message once for host and once for each device arch. The main effect of this change, other than fixing CUDA, is that if you pass multiple cc files to one instance of clang and you get a compile error, we'll stop when the first cc1 job fails. Reviewers: echristo Subscribers: cfe-commits, jhen, echristo, tra, rafael Differential Revision: http://reviews.llvm.org/D17217 llvm-svn: 261774
* Make test/Driver/output-file-cleanup.c hermetic.Justin Lebar2016-02-241-0/+2
| | | | | | | | | | | | | | | Summary: It checks that certain files do and exist, so make sure that they don't exist at the beginning of the test. This hid a failure in r260448; to see the failure, you had to run the test with a clean-ish objdir. Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17216 llvm-svn: 261773
* Fix rejects-valid caused by r261297.Nico Weber2016-02-241-0/+33
| | | | | | | | | | | | | | | | r261297 called hasUserProvidedDefaultConstructor() to check if defining a const object is ok. This is incorrect for this example: struct X { template<typename ...T> X(T...); int n; }; const X x; // formerly OK, now bogus error Instead, track if a class has a defaulted default constructor, and disallow a const object for classes that either have defaulted default constructors or if they need an implicit constructor. Bug report and fix approach by Richard Smith, thanks! llvm-svn: 261770
* Add whole-program vtable optimization feature to Clang.Peter Collingbourne2016-02-244-13/+32
| | | | | | | | | This patch introduces the -fwhole-program-vtables flag, which enables the whole-program vtable optimization feature (D16795) in Clang. Differential Revision: http://reviews.llvm.org/D16821 llvm-svn: 261767
* Fix typo in test/CodeGen/object-size.c CHECK line.Bob Wilson2016-02-241-1/+1
| | | | llvm-svn: 261762
* AArch64: fix Cyclone CPU features list.Tim Northover2016-02-241-3/+3
| | | | | | It turns out we don't have CRC after all. Who knew? llvm-svn: 261758
* Objective-C: Add a size field to non-fragile category metadata.Manman Ren2016-02-241-1/+1
| | | | | | | | | | | This is mainly for extensibility. Note that fragile category metadata, metadata for classes and protocols all have a size field. Initial patch was provided by Greg Parker. rdar://problem/24804226 llvm-svn: 261756
* [CLANG] [AVX512] [BUILTIN] Adding PSHUF{L|H}W{128|256|512} builtin to clang .Michael Zuckerman2016-02-241-0/+38
| | | | | | Differential Revision: http://reviews.llvm.org/D17539 llvm-svn: 261755
* [WinEH] Make sure terminate handlers have funclet operandsDavid Majnemer2016-02-242-5/+6
| | | | | | | Calls to the terminate handler must be annotated within the exception region they are within. llvm-svn: 261751
* [OpenCL] Add Sema checks for OpenCL 2.0 blockXiuli Pan2016-02-241-0/+20
| | | | | | | | | | | | | | Summary: Add Sema checks for opencl 2.0 new features: Block. This patch is partitioned from http://reviews.llvm.org/D16047 Reviewers: Anastasia Subscribers: pekka.jaaskelainen, cfe-commits Differential Revision: http://reviews.llvm.org/D17436 llvm-svn: 261719
* Default vaarg lowering should support indirect struct types.James Y Knight2016-02-242-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes PR11517 for SPARC. On most targets, clang lowers va_arg itself, eschewing the use of the llvm vaarg instruction. This is necessary (at least for now) as the type argument to the vaarg instruction cannot represent all the ABI information that is needed to support complex calling conventions. However, on targets with a simpler varrags ABIs, the LLVM instruction can work just fine, and clang can simply lower to it. Unfortunately, even on such targets, vaarg with a struct argument would fail, because the default lowering to vaarg was naive: it didn't take into account the ABI attribute computed by classifyArgumentType. In particular, for the DefaultABIInfo, structs are supposed to be passed indirectly and so llvm's vaarg instruction should be emitted with a pointer argument. Now, vaarg instruction emission is able to use computed ABIArgInfo for the provided argument type, which allows the default ABI support to work for structs too. I haven't touched the EmitVAArg implementation for PPC32_SVR4 or XCore, although I believe both are now redundant, and could be switched over to use the default implementation as well. Differential Revision: http://reviews.llvm.org/D16154 llvm-svn: 261717
* [analyzer] Find ObjC 'self' decl even when block captures local named 'self'.Devin Coughlin2016-02-232-1/+36
| | | | | | | | | When looking up the 'self' decl in block captures, make sure to find the actual self declaration even when the block captures a local variable named 'self'. rdar://problem/24751280 llvm-svn: 261703
* Revert r261634 "Supporting all entities declared in lexical scope in LLVM ↵Hans Wennborg2016-02-232-33/+6
| | | | | | | | debug info." and r261657 r261634 and r261633 seems to have caused PR26715. r261657 depends on the former two. llvm-svn: 261670
* Amends r252104 to evaluate the controlling expression in an unevaluated ↵Aaron Ballman2016-02-231-0/+4
| | | | | | context. This eliminates false-positive diagnostics about null pointer dereferences (etc) in the controlling expression. llvm-svn: 261669
* Revert "[VFS] Add support for handling path traversals"Bruno Cardoso Lopes2016-02-232-130/+0
| | | | | | | | | | | | | | This reverts commit r261551 due to failing tests in windows bots: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10054 Failing Tests (4): Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName llvm-svn: 261654
* [CLANG] [AVX512] [BUILTIN] Adding prorv{d|q}{128|256|512} builtin to clang Michael Zuckerman2016-02-232-0/+108
| | | | | | Differential Revision: http://reviews.llvm.org/D17512 llvm-svn: 261641
* [CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clangMichael Zuckerman2016-02-232-0/+219
| | | | | | Differential Revision: http://reviews.llvm.org/D17506 llvm-svn: 261635
* Supporting all entities declared in lexical scope in LLVM debug info.Amjad Aboud2016-02-232-6/+33
| | | | | | Differential Revision: http://reviews.llvm.org/D15977 llvm-svn: 261634
* [analyzer] Improve pointer arithmetic checker.Gabor Horvath2016-02-235-8/+86
| | | | | | | | | | | This patch is intended to improve pointer arithmetic checker. From now on it only warns when the pointer arithmetic is likely to cause an error. For example when the pointer points to a single object, or an array of derived types. Differential Revision: http://reviews.llvm.org/D14203 llvm-svn: 261632
* [ms-inline-asm] Fixing bug in single asm statement supportMarina Yatsina2016-02-232-3/+12
| | | | | | | | | | | | | | Fixing a crash caused by trying to merge a single-line asm statement with an asm block that follows it, e.g: asm int 4 asm { int 5 } Now, only adjacent single-line asm statements that are not surrounded by braces will be merged into one asm call. Differential Revision: http://reviews.llvm.org/D17496 llvm-svn: 261618
* Revert "[VFS] Add 'overlay-relative' field to YAML files" and "[VFS] Fix ↵Bruno Cardoso Lopes2016-02-233-64/+7
| | | | | | | | | | | | | | | call to getVFSFromYAML in unittests" This reverts commit r261552 and r261556 because of failing unittests on windows: Failing Tests (4): Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName llvm-svn: 261613
* [WebAssembly] Initial driver support for standard library paths.Dan Gohman2016-02-221-6/+6
| | | | llvm-svn: 261560
* [WebAssembly] Lower va_arg in clang.Dan Gohman2016-02-221-0/+103
| | | | | | | This uses the general emitVoidPtrVAArg lowering logic for everything, since this supports all types, and we don't have any special requirements. llvm-svn: 261557
* [VFS] Add 'overlay-relative' field to YAML filesBruno Cardoso Lopes2016-02-223-7/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VFS overlay mapping between virtual paths and real paths is done through the 'external-contents' entries in YAML files, which contains hardcoded paths to the real files. When a module compilation crashes, headers are dumped into <name>.cache/vfs directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script generated for reproduction uses -ivfsoverlay pointing to file to gather the mapping between virtual paths and files inside <name>.cache/vfs. Currently, we are only capable of reproducing such crashes in the same machine as they happen, because of the hardcoded paths in 'external-contents'. To be able to reproduce a crash in another machine, this patch introduces a new option in the VFS yaml file called 'overlay-relative'. When it's equal to 'true' it means that the provided path to the YAML file through the -ivfsoverlay option should also be used to prefix the final path for every 'external-contents'. Example, given the invocation snippet "... -ivfsoverlay <name>.cache/vfs/vfs.yaml" and the following entry in the yaml file: "overlay-relative": "true", "roots": [ ... "type": "directory", "name": "/usr/include", "contents": [ { "type": "file", "name": "stdio.h", "external-contents": "/usr/include/stdio.h" }, ... Here, a file manager request for virtual "/usr/include/stdio.h", that will map into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h. This is a useful feature for debugging module crashes in machines other than the one where the error happened. Differential Revision: http://reviews.llvm.org/D17457 rdar://problem/24499339 llvm-svn: 261552
* [VFS] Add support for handling path traversalsBruno Cardoso Lopes2016-02-222-0/+130
| | | | | | | | | | | | | | | | | | | | | | Handle ".", ".." and "./" with trailing slashes while collecting files to be dumped into the vfs overlay directory. Include the support for symlinks into components. Given the path: /install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin" component is a symlink, it's not safe to use `path::remove_dots` here, and `realpath` is used to get the right answer. Since `realpath` is expensive, we only do it at collecting time (which only happens during the crash reproducer) and cache the base directory for fast lookups. Overall, this makes the input to the VFS YAML file to be canonicalized to never contain traversal components. Differential Revision: http://reviews.llvm.org/D17104 rdar://problem/24499339 llvm-svn: 261551
* Add has_feature attribute_availability_with_strict.Manman Ren2016-02-221-0/+4
| | | | | | rdar://23791325 llvm-svn: 261548
* [analyzer] Detect duplicate [super dealloc] callsDevin Coughlin2016-02-221-0/+298
| | | | | | | | | | | | | | Add an alpha path checker that warns about duplicate calls to [super dealloc]. This will form the foundation of a checker that will detect uses of 'self' after calling [super dealloc]. Part of rdar://problem/6953275. Based on a patch by David Kilzer! Differential Revision: http://reviews.llvm.org/D5238 llvm-svn: 261545
* Don't enable /GX by defaultDavid Majnemer2016-02-221-0/+3
| | | | | | | The /GX flag is disabled unless explicitly specified on the command line. This partially addresses PR26698. llvm-svn: 261537
* [MS ABI] Correctly handle dllimport'd explicit instantiation declaration w/ ↵David Majnemer2016-02-221-7/+10
| | | | | | | | | | | | | | vbases We gave a VBTable dllimport storage class and external linkage while also providing an initializer. An initializer is only valid if the VBTable has available_externally linkage. Fix this by setting the linkage to available_externally in situ while generating the initializer. This fixes PR26686. llvm-svn: 261535
* Add a test for r261425.David Majnemer2016-02-221-0/+16
| | | | llvm-svn: 261534
* Add support for Android Vector calling convention for AArch64Nirav Dave2016-02-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | This modification applies the following Android commit when we have an Android environment. This is the sole non-renderscript in the Android repo commit 9212d4fb30a3ca2f4ee966dd2748c35573d9682c Author: Tim Murray <timmurray@google.com> Date: Fri Aug 15 16:00:15 2014 -0700 Update vector calling convention for AArch64. bug 16846318 Change-Id: I3cfd167758b4bd634d8480ee6ba6bb55d61f82a7 Reviewers: srhines, jyknight Subscribers: mcrosier, aemerson, rengolin, tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D17448 llvm-svn: 261533
* [CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .Michael Zuckerman2016-02-222-2/+111
| | | | | | Differential Revision: http://reviews.llvm.org/D16985 llvm-svn: 261516
* Addressing review comments for r261163.Manman Ren2016-02-221-2/+2
| | | | | | | | | Use "strict" instead of "nopartial". Also make strictly not-introduced share the same diagnostics as Obsolete and Unavailable. rdar://23791325 llvm-svn: 261512
* Fix PR24473 : Teach clang to remember to substitute into member variable ↵Faisal Vali2016-02-221-1/+45
| | | | | | | | templates referred to within dependent qualified ids. In passing also fix a semi-related bug that allows access to variable templates through member access notation. llvm-svn: 261506
* [CLANG] [AVX512] [BUILTIN] Adding pmovzx{b|d|w}{w|d|q}{128|256|512} builtin ↵Michael Zuckerman2016-02-214-0/+370
| | | | | | | | to clang Differential Revision: http://reviews.llvm.org/D16961 llvm-svn: 261471
* Added SKL and CNL processors and features to ClangElena Demikhovsky2016-02-211-2/+140
| | | | | | Differential Revision: http://reviews.llvm.org/D16756 llvm-svn: 261467
OpenPOWER on IntegriCloud