summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix stack-use-after-scope in CheckExplicitlyDefaultedMemberExceptionSpecVitaly Buka2016-12-051-2/+2
| | | | | | | | | | | | | | | Summary: Similar to r288685. getExceptionSpec returned structure with pointers to temporarily object created by computeImplicitExceptionSpec. Reviewers: rsmith Subscribers: aizatsky, cfe-commits Differential Revision: https://reviews.llvm.org/D27422 llvm-svn: 288689
* Fix stack-use-after-scope in EvaluateImplicitExceptionSpecVitaly Buka2016-12-051-1/+2
| | | | | | | | | | | | | | Summary: getExceptionSpec returns structure with pointers to temporarily object created by computeImplicitExceptionSpec. Reviewers: rsmith Subscribers: aizatsky, cfe-commits Differential Revision: https://reviews.llvm.org/D27420 llvm-svn: 288685
* [Sema] Respect DLL attributes more faithfullyShoaib Meenai2016-12-053-15/+60
| | | | | | | | | | | On MSVC, if an implicit instantiation already exists and an explicit instantiation definition with a DLL attribute is created, the DLL attribute still takes effect. Make clang match this behavior for exporting. Differential Revision: https://reviews.llvm.org/D26657 llvm-svn: 288682
* [analyzer] ObjCGenerics: Warn only on mismatch for invariant type parametersDevin Coughlin2016-12-052-6179/+6262
| | | | | | | | | | | | | | | | | | | | | | | | | | On a method call, the ObjCGenerics checker uses the type tracked by DynamicTypePropagation for the receiver to to infer substituted parmeter types for the called methods and warns when the argument type does not match the parameter. Unfortunately, using the tracked type can result in false positives when the receiver has a non-invariant type parameter and has been intentionally upcast. For example, becaue NSArray's type parameter is covaraint, the following code is perfectly safe: NSArray<NSString *> *allStrings = ... NSDate *date = ...; NSArray<NSObject *> *allObjects = allStrings; NSArray<NSObject *> *moreObjects = [allObjects arrayByAddingObject:date]; but the checker currently warns that the date parameter is not an NSString *. To avoid this kind of false positive, the checker will now only warn when the class defining the called method has only invariant type parameters. rdar://problem/28803951 llvm-svn: 288677
* CFGBuilder: Fix crash when visiting delete expression on dependent typeMartin Bohme2016-12-052-28/+52
| | | | | | | | | | | | | | Summary: CXXDeleteExpr::getDestroyedType() can return a null QualType if the destroyed type is a dependent type. This patch protects against this. Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27350 llvm-svn: 288665
* Clean out unused diagnostics. NFC.Benjamin Kramer2016-12-052-8/+0
| | | | llvm-svn: 288664
* DR1213: element access on an array xvalue or prvalue produces an xvalue. In theRichard Smith2016-12-0513-42/+147
| | | | | | | | | | | | | | latter case, a temporary array object is materialized, and can be lifetime-extended by binding a reference to the member access. Likewise, in an array-to-pointer decay, an rvalue array is materialized before being converted into a pointer. This caused IR generation to stop treating file-scope array compound literals as having static storage duration in some cases in C++; that has been rectified by modeling such a compound literal as an lvalue. This also improves clang's compatibility with GCC for those cases. llvm-svn: 288654
* Adapt to llvm/TableGen DagInit changes.Matthias Braun2016-12-051-15/+20
| | | | llvm-svn: 288645
* IRGen: Remove an unused overload of CreateAlignedLoad.Peter Collingbourne2016-12-051-5/+0
| | | | llvm-svn: 288629
* Revert "Recover better from an incompatible .pcm file being provided by ↵Daniel Jasper2016-12-044-51/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually." This reverts commit r288449. I believe that this is currently faulty wrt. modules being imported inside namespaces. Adding these lines to the new test: namespace n { #include "foo.h" } Makes it break with fatal error: import of module 'M' appears within namespace 'n' However, I believe it should fail with error: redundant #include of module 'M' appears within namespace 'n' I have tracked this down to us now inserting a tok::annot_module_begin instead of a tok::annot_module_include in Preprocessor::HandleIncludeDirective() and then later in Parser::parseMisplacedModuleImport(), we hit the code path for tok::annot_module_begin, which doesn't set FromInclude of checkModuleImportContext to true (thus leading to the "wrong" diagnostic). llvm-svn: 288626
* TableGen: Adapt to llvm r288612Matthias Braun2016-12-042-4/+4
| | | | llvm-svn: 288614
* Add the --no-color option to the git call in the doc when using ↵Sylvestre Ledru2016-12-032-2/+2
| | | | | | clang-format-diff llvm-svn: 288605
* [WebAssembly] Revert r288447.Dan Gohman2016-12-032-6/+0
| | | | | | | Revert r288447 which introduced -mdirect. It turns out we don't need a custom flag for this, as the information we need is in the target triple. llvm-svn: 288604
* [libclang] Fix python testsSergey Kalinichev2016-12-032-2/+2
| | | | | | It was broken in r286421 llvm-svn: 288582
* Sema: delay the DLL exported member referencingSaleem Abdulrasool2016-12-032-1/+20
| | | | | | | | | | | | | | An explicit template specialization can cause the implicit template specialization of a type which inherits the attributes. In such a case, we would end up with a delayed template specialization for a dll exported type which we would fail to reference. This would trigger an assertion. We now propagate the dll storage attributes through the inheritance chain. Only after having done so do we reference the delayed template specializations. This allows any implicit specializations which inherit dll storage to also be referenced. llvm-svn: 288570
* [Sema] Don't perform aggregate initialization for types with explicit ↵Eric Fiselier2016-12-034-15/+101
| | | | | | | | | | | | | | | | constructors Summary: The C++17 rules for aggregate initialization changed to disallow types with explicit constructors [dcl.init.aggr]p1. This patch implements that new rule. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25654 llvm-svn: 288565
* DR616, and part of P0135R1: member access (or pointer-to-member access) on aRichard Smith2016-12-0318-45/+99
| | | | | | | temporary produces an xvalue, not a prvalue. Support this by materializing the temporary prior to performing the member access. llvm-svn: 288563
* PR31244: Use the exception specification from the callee's type directly toRichard Smith2016-12-032-17/+43
| | | | | | | compute whether a call is noexcept, even if we can't map the callee expression to a called declaration. llvm-svn: 288558
* More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_.Richard Smith2016-12-028-19/+20
| | | | | | In passing, add a warning group for "ignored qualifier in inline assembly" warnings. llvm-svn: 288548
* CodeGen: export typeinfo and typeinfo name on itaniumSaleem Abdulrasool2016-12-022-7/+44
| | | | | | | | When a C++ record is marked with dllexport mark both the typeinfo and the typeinfo name as being exported. Handle dllimport as the inverse. This applies to the itanium environment and not the MinGW environment. llvm-svn: 288546
* Mass-rename the handful of error_* diagnostics to err_*.Richard Smith2016-12-0211-84/+84
| | | | llvm-svn: 288545
* [Sema] Reset a BumpPtrAllocator on clear(). NFC.George Burgess IV2016-12-021-0/+1
| | | | | | Looks like the reset() call was omitted by accident. llvm-svn: 288534
* With LTO and profile-use, enable hotness info in opt remarksAdam Nemet2016-12-022-7/+24
| | | | | | | | | | This is to match the behavior of non-LTO; when -fsave-optimization-record is passed and PGO is available we enable the generation of hotness information in the optimization records. Differential Revision: https://reviews.llvm.org/D27332 llvm-svn: 288520
* [CUDA] Forward sanitizer support to host toolchainJason Henline2016-12-021-6/+10
| | | | | | | | | | | | | | | | | | | | Summary: This is an improvement on rL288448 where address sanitization was listed as supported for the CudaToolChain. Since the intent is for the CudaToolChain not to reject any flags supported by the host compiler, this patch switches to forwarding the CudaToolChain sanitizer support to the host toolchain rather than explicitly whitelisting address sanitization. Thanks to hfinkel for this suggestion. Reviewers: jlebar Subscribers: hfinkel, cfe-commits Differential Revision: https://reviews.llvm.org/D27351 llvm-svn: 288512
* [ClangFormat] Only insert #include into the #include block in the beginning ↵Eric Liu2016-12-023-31/+195
| | | | | | | | | | | | | | | | | | of the file. Summary: This avoid inserting #include into: - raw string literals containing #include. - #if block. - Special #include among declarations (e.g. functions). Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D26909 llvm-svn: 288493
* [Frontend] Fix an issue where a quoted search path is incorrectlyAlex Lorenz2016-12-022-1/+13
| | | | | | | | | | | | | | | removed as a duplicate header search path The commit r126167 started passing the First index into RemoveDuplicates, but forgot to update 0 to First in the loop that looks for the duplicate. This resulted in a bug where an -iquoted search path was incorrectly removed if you passed in the same path into -iquote and more than one time into -isystem. rdar://23991350 Differential Revision: https://reviews.llvm.org/D27298 llvm-svn: 288491
* clang/test/Driver/defsym.s: Appease targeting msc. It is incapable of ↵NAKAMURA Takumi2016-12-021-1/+1
| | | | | | external assembler in trunk. llvm-svn: 288478
* [CUDA] Fix faulty test from rL288448Jason Henline2016-12-021-1/+1
| | | | | | | | | | | | | | | | | | Summary: The test introduced by rL288448 is currently failing because unimportant but unexpected errors appear as output from a test compile line. This patch looks for a more specific error message, in order to avoid false positives. Reviewers: jlebar Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27328 Switch to more specific error llvm-svn: 288453
* p0012r1: define corresponding feature test macroRichard Smith2016-12-022-3/+2
| | | | llvm-svn: 288452
* Recover better from an incompatible .pcm file being provided by -fmodule-file=.Richard Smith2016-12-024-15/+51
| | | | | | | | | | | We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually. llvm-svn: 288449
* [CUDA] "Support" ASAN arguments in CudaToolChainJason Henline2016-12-023-0/+12
| | | | | | | | | | | | | | | | | | | | | | This fixes a bug that was introduced in rL287285. The bug made it illegal to pass -fsanitize=address during CUDA compilation because the CudaToolChain class was switched from deriving from the Linux toolchain class to deriving directly from the ToolChain toolchain class. When CudaToolChain derived from Linux, it used Linux's getSupportedSanitizers method, and that method allowed ASAN, but when it switched to deriving directly from ToolChain, it inherited a getSupportedSanitizers method that didn't allow for ASAN. This patch fixes that bug by creating a getSupportedSanitizers method for CudaToolChain that supports ASAN. This patch also fixes the test that checks that -fsanitize=address is passed correctly for CUDA builds. That test didn't used to notice if an error message was emitted, and that's why it didn't catch this bug when it was first introduced. With the fix from this patch, that test will now catch any similar bug in the future. llvm-svn: 288448
* [WebAssembly] Add an -mdirect flag for the direct wasm object feature.Dan Gohman2016-12-022-0/+6
| | | | | | | Add a target flag for enabling the new direct wasm object emission feature. llvm-svn: 288447
* Delete tautological assertion.Jonathan Roelofs2016-12-021-1/+0
| | | | | | | | After r256463, both the LHS and RHS now refer to the same variable. Before, they referred to the member, the parameter respectively. Now GCC6's -Wtautological-compare complains. llvm-svn: 288444
* Struct GEPs must use i32, not whatever size_t is. It should be safeJohn McCall2016-12-011-2/+4
| | | | | | | to do this unconditionally, given that the indices will always be small constant integers anyway. llvm-svn: 288440
* [libclang] Add APIs to check the result of an integer expression in ↵Argyrios Kyrtzidis2016-12-015-6/+81
| | | | | | | | | CXEvalResult without overflow Patch by Emilio Cobos Álvarez! See https://reviews.llvm.org/D26788 llvm-svn: 288438
* Extend CompilationDatabase by a field for the output filenameJoerg Sonnenberger2016-12-016-9/+31
| | | | | | | | | | | | | | In bigger projects like an Operating System, the same source code is often compiled in slightly different ways. This could be the difference between PIC and non-PIC code for static vs dynamic libraries, it could also be the difference between size optimised versions of tools for ramdisk images. At the moment, the compilation database has no way to distinguish such cases. As first step, add a field in the JSON format for it and process it accordingly. Differential Revision: https://reviews.llvm.org/D27138 llvm-svn: 288436
* Add a space in a run line. NFC.George Burgess IV2016-12-011-1/+1
| | | | llvm-svn: 288414
* Send compiler output to /dev/null in defsym.s test.Artem Belevich2016-12-011-2/+2
| | | | | | Fixes test failures if tests are run in a read-only source tree. llvm-svn: 288406
* [CodeGen][ARM] Make sure the value and type used to create a bitcastAkira Hatanaka2016-12-012-10/+44
| | | | | | | | | | | have the same size. This fixes an asset that is triggered when an address of a boolean variable is passed to __builtin_arm_ldrex or __builtin_arm_strex. rdar://problem/29269006 llvm-svn: 288404
* [clang] Implement support for -defsym assembler optionMandeep Singh Grang2016-12-014-0/+39
| | | | | | | | | | | | | | | | | Summary: Adds support for -Wa,-defsym,abc=1 option. Related llvm patch: https://reviews.llvm.org/D26214 Reviewers: rafael, t.p.northover, colinl, echristo, compnerd, rengolin Subscribers: mehdi_amini Tags: #clang-c Differential Revision: https://reviews.llvm.org/D26213 llvm-svn: 288397
* swiftcc: Add an api to query whether a target ABI stores swifterror in a ↵Arnold Schwaighofer2016-12-014-0/+31
| | | | | | register llvm-svn: 288394
* Fix VS2015 build of clang-format-vsix by using NuGet to pull in required ↵Hans Wennborg2016-12-015-24/+138
| | | | | | | | | | assemblies Also added a gitignore to help track the right items to commit. Patch by Antonio Maiorano <amaiorano@gmail.com>! llvm-svn: 288393
* [TableGen] Ignore fake args for parsing-related arg counts.George Burgess IV2016-12-012-0/+6
| | | | | | | | | | | | | | | | | | We should complain about the following: ``` void foo() __attribute__((unavailable("a", "b"))); ``` Instead, we currently just ignore "b". (...We also end up ignoring "a", because we assume elsewhere that this attribute can only have 1 or 0 args.) This happens because `unavailable` has a fake enum arg, and `AttributeList::{getMinArgs,getMaxArgs}` include fake args in their counts. llvm-svn: 288388
* [analyzer] Drop explicit mention of range constraint solverDominic Chen2016-12-0132-40/+40
| | | | | | | | | | | | Summary: The basic constraint solver was dropped in rL162384, leaving the range constraint solver as the default and only constraint solver. Explicitly specifying it is unnecessary, and makes it difficult to test with other solver backends. Reviewers: zaks.anna, dcoughlin Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26694 llvm-svn: 288372
* Adds hasUnqualifiedDesugaredType to allow matching through type sugar.Manuel Klimek2016-12-014-124/+162
| | | | | | Differential Revision: https://reviews.llvm.org/D27207 llvm-svn: 288366
* [ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expressionAlex Lorenz2016-12-012-1/+34
| | | | | | | | | | | | This patch ensures that the typo fixit for the @try/@finally/@autoreleasepool {} directive is shown only when we're parsing an actual statement where such directives can actually be present. rdar://19669565 Differential Revision: https://reviews.llvm.org/D26916 llvm-svn: 288334
* [OpenCL] Refactor read_only/write_only pipes.Joey Gouly2016-12-017-84/+40
| | | | | | | | | | | This adds the access qualifier to the Pipe Type, rather than using a class hierarchy. It also fixes mergeTypes for Pipes, by disallowing merges. Only identical pipe types can be merged. The test case in invalid-pipes-cl2.0.cl is added to check that. llvm-svn: 288332
* Fix crash with unsupported architectures in Linux/Gnu target triples.Florian Hahn2016-12-012-3/+33
| | | | | | | | | | | | Summary: This patch adds a check and an error message to gnutools::Linker::ConstructJob in case the architecture is not supported. For most other operating systems, the error message is created in lib/Basic/Targets.cpp:AllocateTarget, but when construction the linker arguments for the gnutools linker a supported architecture is required. Reviewers: rafael, joerg, echristo Subscribers: mehdi_amini, joerg, dschuff, cfe-commits Differential Revision: https://reviews.llvm.org/D27066 llvm-svn: 288327
* Teach ConstantBuilder how to emit a reference to the current positionJohn McCall2016-12-011-0/+40
| | | | | | that will be filled in when the initializer is set. llvm-svn: 288313
* P0012R1: add Itanium ABI support for throwing non-noexcept function pointers ↵Richard Smith2016-12-013-44/+66
| | | | | | and catching as noexcept. llvm-svn: 288305
OpenPOWER on IntegriCloud