summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Don't actually add the __unsafe_unretained qualifier in MRC;John McCall2015-11-198-7/+275
| | | | | | | | | | | driving a canonical difference between that and an unqualified type is a really bad idea when both are valid. Instead, remember that it was there in a non-canonical way, then look for that in the one place we really care about it: block captures. The net effect closely resembles the behavior of a decl attribute, except still closely following ARC's standard qualifier parsing rules. llvm-svn: 253534
* Fix the emission of ARC-style ivar layouts in the fragile runtimeJohn McCall2015-11-192-5/+24
| | | | | | | | | to start at the offset of the first ivar instead of the rounded-up end of the superclass. The latter could include a large amount of tail padding because of a highly-aligned ivar, and subclass ivars can be laid out within that. llvm-svn: 253533
* [analyzer] Improve modeling of static initializers.Anna Zaks2015-11-192-5/+18
| | | | | | | | | | | | Conversions between unrelated pointer types (e.g. char * and void *) involve bitcasts which were not properly modeled in case of static initializers. The patch fixes this problem. The problem was originally spotted by Artem Dergachev. Patched by Yuri Gribov! Differential Revision: http://reviews.llvm.org/D14652 llvm-svn: 253532
* [MS ABI] Let arbitrary entities participate in vftable orderingDavid Majnemer2015-11-192-6/+25
| | | | | | | | | | | In the Microsoft ABI, the vftable is laid out in the order in the declaration order of the entities defined within it. Obviously, only virtual methods end up in the vftable but they will be placed into the table at the same position as the first entity with the same name. llvm-svn: 253523
* Fix debian build after r253512.Pete Cooper2015-11-181-3/+4
| | | | | | | | | | | The conversion from QuantityType to the (temporary) IntegerAlignment class was ambiguous. For now add in explicit conversion to unsigned to satisfy the clang-x86_64-debian-fast bot. I'll remove the explicit conversion when I remove the IntegerAlignment class. llvm-svn: 253519
* [analyzer] Skip checking blocks in dependent contexts.Devin Coughlin2015-11-182-3/+21
| | | | | | | | | | | Since we don't check functions in dependent contexts, we should skip blocks in those contexts as well. This avoids an assertion failure when the DeadStoresChecker attempts to evaluate an array subscript expression with a dependent name type. rdar://problem/23564220 llvm-svn: 253516
* Change memcpy/memset/memmove to have dest and source alignments.Pete Cooper2015-11-1864-284/+284
| | | | | | | | | | | | | | | | | | | | | | This is a follow on from a similar LLVM commit: r253511. Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html These intrinsics currently have an explicit alignment argument which is required to be a constant integer. It represents the alignment of the source and dest, and so must be the minimum of those. This change allows source and dest to each have their own alignments by using the alignment attribute on their arguments. The alignment argument itself is removed. The only code change to clang is hidden in CGBuilder.h which now passes both dest and source alignment to IRBuilder, instead of taking the minimum of dest and source alignments. Reviewed by Hal Finkel. llvm-svn: 253512
* [MSVC Compat] Make -Wmicrosoft-cast not an error by defaultDavid Majnemer2015-11-182-5/+3
| | | | | | Too much code is sloppy about this to error by default. llvm-svn: 253506
* [Sema] Don't work around a malformed ASTDavid Majnemer2015-11-182-3/+11
| | | | | | | | | | | | We created a malformed TemplateSpecializationType: it was dependent but had a RecordType as it's canonical type. This would lead getAs to crash. r249090 worked around this but we should fix this for real by providing a more appropriate template specialization type as the canonical type. This fixes PR24246. llvm-svn: 253495
* Removing the AST matcher test for thread_local storage duration. Not all ↵Aaron Ballman2015-11-181-5/+5
| | | | | | platforms support TLS, and on platforms that do not support it, use of thread_local causes an error. Since there's no way to determine whether the testing platform supports TLS, there's no way to know whether the test is safe to run or not. I will explore ways to enable this test, but this will appease at least one more build bot. llvm-svn: 253486
* [PGO] Test update for revision 253484.Betul Buyukkurt2015-11-181-1/+1
| | | | llvm-svn: 253485
* Re-committing r253473 after hopefully fixing the bot breakage. There was a ↵Aaron Ballman2015-11-184-0/+147
| | | | | | copy-pasta issue that my local testing did not catch. llvm-svn: 253481
* [Myriad]: fix test for WindowsDouglas Katzman2015-11-181-4/+4
| | | | llvm-svn: 253476
* Reverting r253473 while I investigate build bot failures.Aaron Ballman2015-11-184-147/+0
| | | | llvm-svn: 253475
* Adding AST matchers for VarDecl storage durations. Can now determine whether ↵Aaron Ballman2015-11-184-0/+147
| | | | | | a VarDecl has automatic, static, or thread storage duration. This also updates the documentation for matchers, which appear to be missing some previous additions. llvm-svn: 253473
* [ARM] Support +feature targeting in -mcpu/-marchBradley Smith2015-11-182-8/+45
| | | | llvm-svn: 253471
* [Myriad]: insert -L paths into linker cmd only when they exist.Douglas Katzman2015-11-187-36/+25
| | | | | | Differential Revision: http://reviews.llvm.org/D14754 llvm-svn: 253467
* [libclang] Add entry points that take a full command line including argv[0].Benjamin Kramer2015-11-187-17/+93
| | | | | | | | | | | | This provides both a more uniform interface and makes libclang behave like clang tooling wrt relative paths against argv[0]. This is necessary for finding paths to a c++ standard library relative to a clang binary given in a compilation database. It can also be used to find paths relative to libclang.so if the full path to it is passed in. Differential Revision: http://reviews.llvm.org/D14695 llvm-svn: 253466
* Fix tests in order for them to not fail after r252604.Igor Laevsky2015-11-181-2/+2
| | | | | | | | Some expected attributes appear to be incorrect after optimizations are run and llvm will strip them. Use -O0 so that llvm will not have a chance to remove them. llvm-svn: 253458
* Set flag for lldb when qualified name lookup is being doneEugene Leviant2015-11-182-1/+28
| | | | llvm-svn: 253456
* Update for llvm change.Rafael Espindola2015-11-182-2/+2
| | | | llvm-svn: 253440
* BuildUniversalActions(): Prune obsolete \param(s). [-Wdocumentation]NAKAMURA Takumi2015-11-181-2/+0
| | | | | FIXME: Describe BAInputs. llvm-svn: 253434
* [NFC] Change the evaluation context of a non-type default template argument ↵Faisal Vali2015-11-182-1/+16
| | | | | | | | | | | | | | | | from Unevaluated to ConstantEvaluated. This patch emits a more appropriate (but still noisy) diagnostic stream when a lambda-expression is encountered within a non-type default argument. For e.g. template<int N = ([] { return 5; }())> int f(); As opposed to complaining that a lambda expression is not allowed in an unevaluated operand, the patch complains about the lambda being forbidden in a constant expression context (which will be allowed in C++17 now that they have been accepted by EWG, unless of course CWG or national bodies (that have so far shown no signs of concern) rise in protest) As I start submitting patches for constexpr lambdas (http://wg21.link/P0170R0) under C++1z (OK'd by Richard Smith at Kona), this will be one less change to make. Thanks! llvm-svn: 253431
* Don't expose iterators into the list of types on the ASTContext; these areRichard Smith2015-11-182-11/+6
| | | | | | | | unsafe, since many operations on the types can trigger lazy deserialization of more types and invalidate the iterators. This fixes a crasher, but I've not been able to reduce it to a reasonable testcase yet. llvm-svn: 253420
* Try to fix leak in CXStringSet from r252853Reid Kleckner2015-11-181-0/+2
| | | | llvm-svn: 253418
* Fix for use-after-free which caused test failure in cuda-detect.cu.Artem Belevich2015-11-181-1/+1
| | | | | | Return std::string itself instead StringRef to a temporary std::string. llvm-svn: 253410
* Produce a better diagnostic for global register variables.Akira Hatanaka2015-11-1813-25/+114
| | | | | | | | | | | | | | | | | | Currently, when there is a global register variable in a program that is bound to an invalid register, clang/llvm prints an error message that is not very user-friendly. This commit improves the diagnostic and moves the check that used to be in the backend to Sema. In addition, it makes changes to error out if the size of the register doesn't match the declared variable size. e.g., volatile register int B asm ("rbp"); rdar://problem/23084219 Differential Revision: http://reviews.llvm.org/D13834 llvm-svn: 253405
* [PGO] Removed unused code. [NFC]Betul Buyukkurt2015-11-181-1/+0
| | | | llvm-svn: 253404
* [modules] When a #include is mapped to a module import and appears somewhereRichard Smith2015-11-176-13/+30
| | | | | | | | | | | | | | other than the top level, we issue an error. This breaks a fair amount of C++ code wrapping C libraries, where the C library is #included within a namespace / extern "C" combination, because the C library (probably) includes C++ standard library headers which may be within modules. Without modules, this setup is harmless if (and *only* if) the corresponding standard library module was already included outside the namespace, so downgrade the error to a default-error extension in that case, so that it can be selectively disabled for such misbehaving libraries. llvm-svn: 253398
* [Myriad]: -nostdlib implies -nostartfilesDouglas Katzman2015-11-172-1/+2
| | | | llvm-svn: 253390
* [CUDA] Make CUDA compilation usable by default.Artem Belevich2015-11-175-4/+18
| | | | | | | | | | | | | | | | | | Currently clang requires several additional command line options in order to enable new features needed during CUDA compilation. This patch makes these options default. * Automatically include cuda_runtime.h if we've found a valid CUDA installation. * Disable automatic CUDA header inclusion during unit tests. * Added test case for command line construction. * Enabled target overloads and relaxed call checks that are needed in order to include CUDA headers. * Added CUDA-7.5 installation path to the CUDA installation search list. * Define __CUDA__ macro to indicate CUDA compilation. llvm-svn: 253389
* [CUDA] Added a wrapper header for inclusion of stock CUDA headers.Artem Belevich2015-11-172-0/+180
| | | | | | | | | | | | | | | | | | | | Header files that come with CUDA are assuming split host/device compilation and are not usable by clang out of the box. With a bit of preprocessor magic it's possible to twist them into something clang can use. This wrapper always includes CUDA headers exactly the same way during host and device compilation passes and produces identical preprocessed content during host and device side compilation for sm_35 GPUs. Device compilation passes for older GPUs will see a smaller subset of device functions supported by particular GPU. The wrapper assumes specific contents of CUDA header files and works only with CUDA 7.0 and 7.5. Differential Revision: http://reviews.llvm.org/D13171 llvm-svn: 253388
* [CUDA] Detect and link with CUDA's libdevice bitcode library.Artem Belevich2015-11-176-4/+75
| | | | | | | | | | | - added detection of libdevice bitcode file and API to find one appropriate for the GPU we're compiling for. - pass additional cc1 options for linking with detected libdevice bitcode - added -nocudalib to prevent automatic linking with libdevice - added test cases to verify new functionality Differential Revision: http://reviews.llvm.org/D14556 llvm-svn: 253387
* [CUDA] added include paths for both sides of CUDA compilation.Artem Belevich2015-11-178-6/+66
| | | | | | | | | | | | | | | | | | | | | In order to compile a CUDA file clang must be able to find include files for both both host and device. This patch passes AuxToolchain to AddPreprocessingOptions and uses it to add include paths for the opposite side of compilation. We also must be able to find CUDA include files. If the driver found CUDA installation, it adds appropriate include path to CUDA headers. This can be disabled with '-nocudainc'. - Added include paths for the opposite side of compilation. - Added include paths to detected CUDA installation. - Added -nocudainc to prevent adding CUDA include path. - Added test cases to verify new functionality. Differential Revision: http://reviews.llvm.org/D13170 llvm-svn: 253386
* [CUDA] use -aux-triple to pass target triple of opposite side of compilationArtem Belevich2015-11-179-75/+109
| | | | | | | | | | | | | | | | Clang needs to know target triple for both sides of compilation so that preprocessor macros and target builtins from both sides are available. This change augments Compilation class to carry information about toolchains used during different CUDA compilation passes and refactors BuildActions to use it when it constructs CUDA jobs. Removed DeviceTriple from CudaHostAction/CudaDeviceAction as it's no longer needed. Differential Revision: http://reviews.llvm.org/D13144 llvm-svn: 253385
* Use !hasArg with two options instead of !hasArg && !hasArg.Douglas Katzman2015-11-172-92/+59
| | | | | | Thereby fixing a warning about failure to claim all args. llvm-svn: 253372
* [Lit Test] Updated 34 Lit tests to be C++11 compatible.Charles Li2015-11-1734-26/+260
| | | | | | | Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 253371
* bmiintrin.h: Allow using the tzcnt intrinsics for non-BMI targetsHans Wennborg2015-11-171-3/+9
| | | | | | | | | | | | The tzcnt intrinsics are used non non-BMI targets by code (e.g. ffmpeg) that uses it as a potentially faster BSF. The TZCNT instruction is special in that it's encoded in a backward-compatible way and behaves as BSF on non-BMI targets. Differential Revision: http://reviews.llvm.org/D14748 llvm-svn: 253358
* ARM: fix mismatch between Clang and backend on exception type.Tim Northover2015-11-172-7/+11
| | | | | | | | | | | | "-arch armv7k" is only normally used with a watchos target, but Clang doesn't stop you from giving a "-miphoneos-version-min" option too, converting the triple to "thumbv7k-apple-ios". In this case the backend will decide to use SjLj exceptions, so Clang needs to agree so it can create the correct predefines. Fortunately, there's a handy function to make the decision for us now. llvm-svn: 253355
* Add trivial utility to append -L arguments to linker step. NFCDouglas Katzman2015-11-173-35/+19
| | | | llvm-svn: 253350
* Revert "Make FP_CONTRACT ON the default."Manuel Klimek2015-11-176-192/+15
| | | | | | | | | This reverts commit r253269. This leads to assert / segfault triggering on the following reduced example: float foo(float U, float base, float cell) { return (U = 2 * base) - cell; } llvm-svn: 253337
* [Sema] Remove unnecessary typecast of bool to int when passing arguments to ↵Craig Topper2015-11-171-9/+8
| | | | | | diagnostics. NFC llvm-svn: 253316
* [Sema] Combine similar diagnostics using %select. NFCCraig Topper2015-11-174-32/+19
| | | | llvm-svn: 253315
* [Sema] Minor formatting fixes. NFCCraig Topper2015-11-174-6/+6
| | | | llvm-svn: 253314
* [modules] Fix some more cases where we used to reject a conflict between twoRichard Smith2015-11-176-8/+49
| | | | | | | declarations that are not simultaneously visible, and where at least one of them has internal/no linkage. llvm-svn: 253283
* Make FP_CONTRACT ON the default.Stephen Canon2015-11-166-15/+192
| | | | | | Differential Revision: D14200 llvm-svn: 253269
* Derive nacltools::Linker from GnuTool to get response file supportDerek Schuff2015-11-161-2/+2
| | | | | | | It could be derived from gnutools::Linker directly but this way makes it consistent with all the other toolchains around it. llvm-svn: 253259
* Correctly handle type mismatches in the __weak copy/move-initializationJohn McCall2015-11-163-2/+66
| | | | | | | | peephole I added in r250916. rdar://23559789 llvm-svn: 253255
* When producing error messages for always_inline functions with theEric Christopher2015-11-162-2/+14
| | | | | | | | | | target attribute, don't include "negative" subtarget features in the list of required features. Builtins are positive by default so don't need this change, but we pull the default list of features from the command line and so need to make sure that we only include features that are turned on for code generation in our error. llvm-svn: 253242
* [mips] Do not add arch name in the compiler-rt's components.Vasileios Kalintiris2015-11-162-3/+2
| | | | | | | Instead, use the constant "mips" since the libraries are already placed under the multilib's OS suffix. llvm-svn: 253214
OpenPOWER on IntegriCloud