summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [c++1z] P0195R2: Allow multiple using-declarators in a single using-declaration.Richard Smith2016-12-162-1/+31
| | | | llvm-svn: 289905
* Update for LLVM global variable debug info API change.Adrian Prantl2016-12-1612-41/+65
| | | | llvm-svn: 289901
* Fix typo in error messages. NFC.Kelvin Li2016-12-161-4/+4
| | | | llvm-svn: 289897
* [analyzer] Teach the analyzer that pointers can escape into __cxa_demangleAnna Zaks2016-12-152-0/+23
| | | | | | | | This fixes a reported false positive in the malloc checker. Differential Revision: https://reviews.llvm.org/D27599 llvm-svn: 289886
* [analyzer] Refine the diagnostics in the nullability checker to ↵Anna Zaks2016-12-153-18/+18
| | | | | | | | | | | | differentiate between nil and null This is a big deal for ObjC, where nullability annotations are extensively used. I've also changed "Null" -> "null" and removed "is" as this is the pattern that Sema is using. Differential Revision: https://reviews.llvm.org/D27600 llvm-svn: 289885
* [analyzer] Refer to macro names in diagnostics for macros representing a literalAnna Zaks2016-12-154-1/+93
| | | | | | | | | | | | | When a macro expending to a literal is used in a comparison, use the macro name in the diagnostic rather than the literal. This improves readability of path notes. Added tests for various macro literals that could occur. Only BOOl, Int, and NULL tests have changed behavior with this patch. Differential Revision: https://reviews.llvm.org/D27726 llvm-svn: 289884
* [analyzer] Include type name in Retain Count Checker diagnosticsAnna Zaks2016-12-157-87/+87
| | | | | | | | | The more detailed diagnostic will make identifying which object the diagnostics refer to easier. Differential Revision: https://reviews.llvm.org/D27740 llvm-svn: 289883
* [analyzer] Add a new SVal to support pointer-to-member operations.Devin Coughlin2016-12-151-10/+144
| | | | | | | | | | | Add a new type of NonLoc SVal for C++ pointer-to-member operations. This SVal supports both pointers to member functions and pointers to member data. A patch by Kirill Romanenkov! Differential Revision: https://reviews.llvm.org/D25475 llvm-svn: 289873
* [test] Extend llvm_shlib_dir fix to unittestsMichal Gorny2016-12-151-5/+6
| | | | | | | | | | | | | | Extend the fix from rL286952 to unittests. The fix added clang built library directories (via llvm_shlib_dir) to LD_LIBRARY_PATH. The previous logic has used llvm_libs_dir only which points to installed LLVM when doing stand-alone builds. The patch also removes the redundant win32 code that is no longer necessary now that shlibdir is used unconditionally. Differential Revision: https://reviews.llvm.org/D27812 llvm-svn: 289865
* Fix printf specifier handling: invalid specifier should not be marked as ↵Mehdi Amini2016-12-153-5/+33
| | | | | | | | | | | | "consuming data arguments" Reviewers: rsmith, bruno, dexonsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27796 llvm-svn: 289850
* [CUDA] Add --ptxas-path= flag.Justin Lebar2016-12-151-0/+12
| | | | | | | | | | | | | | | | | Summary: This lets you build with one CUDA installation but use ptxas from another install. This is useful e.g. if you want to avoid bugs in an old ptxas without actually upgrading wholesale to a newer CUDA version. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27788 llvm-svn: 289847
* [Driver] Bump default x86 cpu to Penryn when targeting macosx10.12+.Ahmed Bougacha2016-12-151-0/+17
| | | | | | 10.12 dropped support for all pre-Penryn Macs. llvm-svn: 289839
* Revert "[TESTS] Initial commit of tests, by Andrew Tischenko"Alexey Bataev2016-12-151-27/+0
| | | | | | This reverts commit 5898c713bee5e96aae87c73e11f3f4a7d19c74ed. llvm-svn: 289812
* [TESTS] Initial commit of tests, by Andrew TischenkoAlexey Bataev2016-12-151-0/+27
| | | | llvm-svn: 289809
* Re-commit r289252 and r289285, and fix PR31374Yaxun Liu2016-12-151-0/+534
| | | | llvm-svn: 289787
* [ARM] Implement execute-only support in CodeGenPrakhar Bahuguna2016-12-151-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This implements execute-only support for ARM code generation, which prevents the compiler from generating data accesses to code sections. The following changes are involved: * Add the CodeGen option "-arm-execute-only" to the ARM code generator. * Add the clang flag "-mexecute-only" as well as the GCC-compatible alias "-mpure-code" to enable this option. * When enabled, literal pools are replaced with MOVW/MOVT instructions, with VMOV used in addition for floating-point literals. As the MOVT instruction is required, execute-only support is only available in Thumb mode for targets supporting ARMv8-M baseline or Thumb2. * Jump tables are placed in data sections when in execute-only mode. * The execute-only text section is assigned section ID 0, and is marked as unreadable with the SHF_ARM_PURECODE flag with symbol 'y'. This also overrides selection of ELF sections for globals. Reviewers: t.p.northover, rengolin Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D27450 llvm-svn: 289786
* CodeGen: fix runtime function dll storageSaleem Abdulrasool2016-12-151-0/+158
| | | | | | | | | | | | | | | | | Properly attribute DLL storage to runtime functions. When generating the runtime function, scan for an existing declaration which may provide an explicit declaration (local storage) or a DLL import or export storage from the user. Honour that if available. Otherwise, if building with a local visibility of the public or standard namespaces (-flto-visibility-public-std), give the symbols local storage (it indicates a /MT[d] link, so static runtime). Otherwise, assume that the link is dynamic, and give the runtime function dllimport storage. This allows for implementations to get the correct storage as long as they are properly declared, the user to override the import storage, and in case no explicit storage is given, use of the import storage. llvm-svn: 289776
* Revert "Fix printf specifier handling: invalid specifier should not be ↵Mehdi Amini2016-12-151-28/+0
| | | | | | | | marked as "consuming data arguments"" This reverts commit r289762, wasn't ready to be pushed, it broke the printf tests. llvm-svn: 289763
* Fix printf specifier handling: invalid specifier should not be marked as ↵Mehdi Amini2016-12-151-0/+28
| | | | | | "consuming data arguments" llvm-svn: 289762
* Fix os_log formating with arbitrary precision and field widthMehdi Amini2016-12-151-0/+49
| | | | llvm-svn: 289761
* [c++1z] Permit constant evaluation of a call through a function pointer whoseRichard Smith2016-12-151-0/+2
| | | | | | | type differs from the type of the actual function due to having a different exception specification. llvm-svn: 289754
* Move checks for creation of objects of abstract class type from the variousRichard Smith2016-12-152-0/+120
| | | | | | | | | constructs that can do so into the initialization code. This fixes a number of different cases in which we used to fail to check for abstract types. Thanks to Tim Shen for inspiring the weird code that uncovered this! llvm-svn: 289753
* Use PIC relocation mode by default for PowerPC64 ELFJoerg Sonnenberger2016-12-151-0/+3
| | | | | | | | | | | | | | Most of the PowerPC64 code generation already creates PIC access. This changes to a full PIC default, similar to what GCC is doing. Overall, a monolithic clang binary shrinks by 600KB (about 1%). This can be a slight regression for TLS access and will use the TOC more aggressively instead of synthesizing immediates. It is expected to be performance neutral. Differential Revision: https://reviews.llvm.org/D26564 llvm-svn: 289744
* Revert 289252 (and follow-up 289285), it caused PR31374Nico Weber2016-12-141-534/+0
| | | | llvm-svn: 289713
* AArch64: add architecture version feature to Clang invocation.Tim Northover2016-12-141-7/+11
| | | | | | | Otherwise we don't get the correct predefines and so on in the front-end (or the right features in the backend). llvm-svn: 289692
* [DebugInfo] Restore test case for long double constants.David Gross2016-12-141-8/+23
| | | | | | | | | | | | | | | | Summary: D27549 (partial fix for PR26619) emits a constant value in the debug metadata for a floating-point static const that does not exceed 64 bits in size. Whether or not a long double exceeds 64 bits in size depends on the target. Modify the test case so that it expects a constant value for long double if and only if the long double is no larger than 64 bits. Reviewers: cfe-commits, probinson Differential Revision: https://reviews.llvm.org/D27597 llvm-svn: 289686
* [Driver] Add tests for enabled static analyzer checkers.Devin Coughlin2016-12-141-0/+57
| | | | | | | | | | The driver passes flags to cc1 that enable various checkers based on the target triple. This commit adds tests for these flags on Darwin, Linux, and Windows. This is a test-only change. llvm-svn: 289685
* Improve our handling of tag decls in function prototypesReid Kleckner2016-12-142-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | r289225 broke AST invariants by reparenting enumerators into function decl contexts. This improves things by only reparenting TagDecls while also attempting to preserve the lexical declcontext chain. The interesting example here is: int f(struct S { enum E { a = 1 } b; } c); The semantic contexts of E and S should be f, and the lexical context of S should be f and the lexical context of E should be S. We didn't do that with r289225, but now we should. This change should also improve our behavior on this example: void f() { extern void ext(struct S { } o); // S injected here } Before r289225 we would only remove 'S' from the surrounding tag injection context if it was the TU, but now we properly reparent S from f to ext. Fixes PR31366 llvm-svn: 289678
* Fixing cast condition for removing casts from builtin FPClassification.Neil Hickey2016-12-141-0/+8
| | | | | | | | | | | The function SemaBuiltinFPClassification removed superfluous float to double casts, this was changed to also remove float to float casts but this isn't valid in all cases, for example when doing an rvaluetolvalue cast. Added a check to only remove if this was a conventional floating cast. Added additional tests into SemaOpenCL/extensions to cover these cases llvm-svn: 289650
* [c++1z] P0217R3: Allow by-value structured binding of arrays.Richard Smith2016-12-141-3/+14
| | | | llvm-svn: 289630
* [PS4] Undo dialect tweak for Objective-C.Paul Robinson2016-12-141-4/+1
| | | | | | | | In r267772, we had set the PS4's default dialect for both C and Objective-C to gnu99. Make that change only for C; we don't really support Objective-C/C++ so there's no point fiddling the dialect. llvm-svn: 289625
* When emitting a multidimensional array copy, only emit a single flattenedRichard Smith2016-12-141-12/+4
| | | | | | cleanup loop for exception handling. llvm-svn: 289623
* LTO: Add support for multi-module bitcode files.Peter Collingbourne2016-12-141-2/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D27313 llvm-svn: 289621
* Remove custom handling of array copies in lambda by-value array capture andRichard Smith2016-12-147-41/+82
| | | | | | | | | | | copy constructors of classes with array members, instead using ArrayInitLoopExpr to represent the initialization loop. This exposed a bug in the static analyzer where it was unable to differentiate between zero-initialized and unknown array values, which has also been fixed here. llvm-svn: 289618
* [CodeGen][ObjC] Emit objc_unsafeClaimAutoreleasedReturnValue forAkira Hatanaka2016-12-131-0/+3
| | | | | | | | | | fragile runtime too. Follow-up to r258962. rdar://problem/29269006 llvm-svn: 289615
* Add support for Samsung Exynos M3 (NFC)Evandro Menezes2016-12-134-0/+32
| | | | llvm-svn: 289614
* CodeGen: Start using inrange annotations on vtable getelementptr.Peter Collingbourne2016-12-1310-34/+34
| | | | | | | | | | | | This annotation allows the optimizer to split vtable groups, as permitted by a change to the Itanium ABI [1] that prevents compilers from adjusting virtual table pointers between virtual tables. [1] https://github.com/MentorEmbedded/cxx-abi/pull/7 Differential Revision: https://reviews.llvm.org/D24431 llvm-svn: 289585
* CodeGen: New vtable group representation: struct of vtable arrays.Peter Collingbourne2016-12-1332-162/+163
| | | | | | | | | In a future change, this representation will allow us to use the new inrange annotation on getelementptr to allow the optimizer to split vtable groups. Differential Revision: https://reviews.llvm.org/D22296 llvm-svn: 289584
* __uuidof() and declspec(uuid("...")) should be allowed on enumeration typesReid Kleckner2016-12-131-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although not specifically mentioned in the documentation, MSVC accepts __uuidof(…) and declspec(uuid("…")) attributes on enumeration types in addition to structs/classes. This is meaningful, as such types *do* have associated UUIDs in ActiveX typelibs, and such attributes are included by default in the wrappers generated by their #import construct, so they are not particularly unusual. clang currently rejects the declspec with a –Wignored-attributes warning, and errors on __uuidof() with “cannot call operator __uuidof on a type with no GUID” (because it rejected the uuid attribute, and therefore finds no value). This is causing problems for us while trying to use clang-tidy on a codebase that makes heavy use of ActiveX. I believe I have found the relevant places to add this functionality, this patch adds this case to clang’s implementation of these MS extensions. patch is against r285994 (or actually the git mirror 80464680ce). Both include an update to test/Parser/MicrosoftExtensions.cpp to exercise the new functionality. This is my first time contributing to LLVM, so if I’ve missed anything else needed to prepare this for review just let me know! __uuidof: https://msdn.microsoft.com/en-us/library/zaah6a61.aspx declspec(uuid("…")): https://msdn.microsoft.com/en-us/library/3b6wkewa.aspx #import: https://msdn.microsoft.com/en-us/library/8etzzkb6.aspx Reviewers: aaron.ballman, majnemer, rnk Differential Revision: https://reviews.llvm.org/D26846 llvm-svn: 289567
* [analyzer] Detect ObjC properties that are both (copy) and Mutable.Artem Dergachev2016-12-131-0/+61
| | | | | | | | | | | | | | | When an Objective-C property has a (copy) attribute, the default setter for this property performs a -copy on the object assigned. Calling -copy on a mutable NS object such as NSMutableString etc. produces an immutable object, NSString in our example. Hence the getter becomes type-incorrect. rdar://problem/21022397 Differential Revision: https://reviews.llvm.org/D27535 llvm-svn: 289554
* Fixing build failure by adding triple option to new test condition.Neil Hickey2016-12-131-1/+1
| | | | | | Adding -triple option to ensure target supports double for fpmath test. llvm-svn: 289552
* Improve handling of floating point literals in OpenCL to only use double ↵Neil Hickey2016-12-132-2/+26
| | | | | | | | | | | | | | precision if the target supports fp64. This change makes sure single-precision floating point types are used if the cl_fp64 extension is not supported by the target. Also removed the check to see whether the OpenCL version is >= 1.2, as this has been incorporated into the extension setting code. Differential Revision: https://reviews.llvm.org/D24235 llvm-svn: 289544
* [OpenCL] Improve address space diagnostics.Egor Churaev2016-12-131-3/+7
| | | | | | | | | | Reviewers: Anastasia Subscribers: bader, yaxunl, cfe-commits Differential Revision: https://reviews.llvm.org/D27671 llvm-svn: 289536
* [OpenCL] Enable unroll hint for OpenCL 1.x.Egor Churaev2016-12-132-14/+2
| | | | | | | | | | | | Summary: Although the feature was introduced only in OpenCL C v2.0 spec., it's useful for OpenCL 1.x too and doesn't require HW support. Reviewers: Anastasia Subscribers: yaxunl, cfe-commits, bader Differential Revision: https://reviews.llvm.org/D27453 llvm-svn: 289535
* Revert "[Headers] Add #include_next for tgmath.h on Darwin"Bruno Cardoso Lopes2016-12-122-16/+0
| | | | | | | | | Reverts r289181: it's currently breaking modules using simd.h in 10.12 SDK. This reverts commit 6e73e3464e96a4e00492c24aa790d36e1adb5702. llvm-svn: 289487
* [CrashReproducer] Collect PCH included via -include-pchBruno Cardoso Lopes2016-12-121-0/+43
| | | | | | | | | | | | Collect the necessary input PCH files. Do not try to validate the AST before copying it out because if the crash is in this path, we won't be able to collect it. Instead only check if it's a file containg an AST. rdar://problem/27913709 llvm-svn: 289460
* [Driver] Attempt to fix new linux-ld tests on WindowsMichal Gorny2016-12-121-3/+3
| | | | | | (broken by r289436) llvm-svn: 289440
* [Driver] Fix finding multilib gcc install on Gentoo (with gcc-config)Michal Gorny2016-12-126-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the gcc-config code to support multilib gcc installs properly. This solves two problems: -mx32 using the 64-bit gcc directory (due to matching installation triple), and -m32 not respecting gcc-config at all (due to mismatched installation triple). In order to fix the former issue, split the multilib scan out of Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple() (the code is otherwise unchanged), and call it for each installation found via gcc-config. In order to fix the latter issue, split the gcc-config processing out of Generic_GCC::GCCInstallationDetector::init() and repeat it for all triples, including extra and biarch triples. The only change in the gcc-config code itself is adding the call to multilib scan. Convert the gentoo_linux_gcc_multi_version_tree test input to multilib x86_64+32+x32 install, and add appropriate tests to linux-header-search and linux-ld. Differential Revision: https://reviews.llvm.org/D26887 llvm-svn: 289436
* [CrashReproducer] Setup a module collector callback for HeaderIncludeBruno Cardoso Lopes2016-12-111-0/+7
| | | | | | | | | Collect missing include that cannot be fetched otherwise (e.g. when using headermaps). rdar://problem/27913709 llvm-svn: 289361
* [CrashReproducer] Collect headermap filesBruno Cardoso Lopes2016-12-111-0/+48
| | | | | | | | | | Include headermaps (.hmap files) in the .cache directory and add VFS entries. All headermaps are known after HeaderSearch setup, collect them right after. rdar://problem/27913709 llvm-svn: 289360
OpenPOWER on IntegriCloud