summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Disable -Wweak-vtables when there are no key functionsReid Kleckner2016-12-061-1/+4
| | | | | | | | | | | | Our -Wweak-vtables diagnostic is powered by our key function calculation, which checks if key functions are enabled. We won't find any key functions in C++ ABIs that lack key functions, so -Wweak-vtables was warning on every dynamic class before this change. So, turn off this warning in ABIs without key functions. Addresses PR31220 llvm-svn: 288850
* [OpenMP] Fix typo in the test case. NFC.Kelvin Li2016-12-061-2/+1
| | | | llvm-svn: 288838
* Fix FileCheck pattern.Joerg Sonnenberger2016-12-061-2/+2
| | | | llvm-svn: 288828
* Allow additional output since e.g. OSX appends flags likeJoerg Sonnenberger2016-12-061-2/+2
| | | | | | | | "-mlinker-version=264.3.102" automatically. Wiring down a target on the other hand is problematic as this actually needs to run codegen and doesn't work with -###. llvm-svn: 288827
* [MS ABI] Implement more of the Itanium mangling rulesDavid Majnemer2016-12-061-0/+25
| | | | | | | | | | | | We didn't implement handle corner cases like: - lambdas used to initialize a field - lambdas in default argument initializers This fixes PR31197. Differential Revision: https://reviews.llvm.org/D27226 llvm-svn: 288826
* Make test case slightly more robust by explicitly passing --sysroot.Joerg Sonnenberger2016-12-061-3/+3
| | | | | | Otherwise it would change when DEFAULT_SYSROOT is provided. llvm-svn: 288823
* Allow clang to write compilation database records.Joerg Sonnenberger2016-12-061-0/+10
| | | | | | | | | | | | | | | | | | | | When integrating compilation database output into existing build systems, two approaches dominate so far. Ad-hoc implementation of the JSON output rules or using compiler wrappers. This patch adds a new option "-MJ foo.json" which gives a slightly cleaned up compilation record. The output is a fragment, i.e. you still need to add the array markers, but it allows multiple files to be easy merged. This way the only change in a build system is adding the option with potentially a per-target output file and merging the files with something like (echo '['; cat *.o.json; echo ']' > compilation_database.json or some additional filtering to remove the trailing comma for strict JSON compliance. Differential Revision: https://reviews.llvm.org/D27140 llvm-svn: 288821
* Also recognize -std=iso9899:201xBenjamin Kramer2016-12-061-0/+3
| | | | | | | | | | | It should already be handled but a typo in the LANGSTANDARD() definition was introduced in r147220. Patch by Alexander Richardson, test case by me. Differential Revision:https://reviews.llvm.org/D27427 llvm-svn: 288793
* [clang] Fix D26214: Move error handling out of MC and to the callers.Mandeep Singh Grang2016-12-061-2/+17
| | | | | | | | | | | | | | Summary: Related llvm patch: https://reviews.llvm.org/D27359 Reviewers: echristo, t.p.northover, rengolin, grosbach, compnerd Subscribers: mehdi_amini, cfe-commits, llvm-commits Tags: #clang-c Differential Revision: https://reviews.llvm.org/D27360 llvm-svn: 288762
* Revert r288626, which reverts r288449. Original commit message:Richard Smith2016-12-061-0/+13
| | | | | | Recover better from an incompatible .pcm file being provided by -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. llvm-svn: 288741
* Add test for r288732, warn on unsigned zero in std::maxRichard Trieu2016-12-061-0/+55
| | | | llvm-svn: 288740
* Additional test file missed from r288737.Richard Smith2016-12-061-0/+12
| | | | llvm-svn: 288738
* [modules] Use the "redundant #include" diagnostic rather than the "moduleRichard Smith2016-12-061-1/+4
| | | | | | | | import can't appear here" diagnostic if an already-visible module is textually entered (because we have the module map but not the AST file) within a function/namespace scope. llvm-svn: 288737
* CodeGen: fix windows itanium RTTI in EH modeSaleem Abdulrasool2016-12-051-1/+9
| | | | | | | | | When emitting RTTI for EH only, we would mark the locally defined (LinkOnceODR) RTTI definition as dllimport, which is incorrect. Ensure that if we are generating the type information for EH only, it is marked as LinkOnceODR and we do not make it dllimport. llvm-svn: 288721
* [analyzer] Print type for SymbolRegionValues when dumping to streamDominic Chen2016-12-051-1/+1
| | | | | | | | | | Reviewers: NoQ, dcoughlin, zaks.anna Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27365 llvm-svn: 288696
* [Sema] Respect DLL attributes more faithfullyShoaib Meenai2016-12-052-0/+12
| | | | | | | | | | | 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-051-6179/+6231
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* DR1213: element access on an array xvalue or prvalue produces an xvalue. In theRichard Smith2016-12-056-16/+80
| | | | | | | | | | | | | | 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
* Revert "Recover better from an incompatible .pcm file being provided by ↵Daniel Jasper2016-12-041-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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
* Sema: delay the DLL exported member referencingSaleem Abdulrasool2016-12-031-0/+18
| | | | | | | | | | | | | | 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-033-0/+85
| | | | | | | | | | | | | | | | 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-038-23/+40
| | | | | | | 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-031-0/+15
| | | | | | | 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-021-3/+1
| | | | | | 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-021-1/+20
| | | | | | | | 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
* With LTO and profile-use, enable hotness info in opt remarksAdam Nemet2016-12-021-0/+5
| | | | | | | | | | 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
* [Frontend] Fix an issue where a quoted search path is incorrectlyAlex Lorenz2016-12-021-0/+12
| | | | | | | | | | | | | | | 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-021-2/+1
| | | | llvm-svn: 288452
* Recover better from an incompatible .pcm file being provided by -fmodule-file=.Richard Smith2016-12-021-0/+10
| | | | | | | | | | | 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-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* [libclang] Add APIs to check the result of an integer expression in ↵Argyrios Kyrtzidis2016-12-011-0/+14
| | | | | | | | | CXEvalResult without overflow Patch by Emilio Cobos Álvarez! See https://reviews.llvm.org/D26788 llvm-svn: 288438
* 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-011-0/+24
| | | | | | | | | | | 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-011-0/+22
| | | | | | | | | | | | | | | | | 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
* [TableGen] Ignore fake args for parsing-related arg counts.George Burgess IV2016-12-011-0/+2
| | | | | | | | | | | | | | | | | | 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
* [ObjC] Avoid a @try/@finally/@autoreleasepool fixit when parsing an expressionAlex Lorenz2016-12-011-0/+28
| | | | | | | | | | | | 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-011-0/+9
| | | | | | | | | | | 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-011-0/+25
| | | | | | | | | | | | 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
* P0012R1: add Itanium ABI support for throwing non-noexcept function pointers ↵Richard Smith2016-12-011-0/+23
| | | | | | and catching as noexcept. llvm-svn: 288305
* Revert r285664, cxx-abi-dev chose to go in a different direction for the ABI ↵Richard Smith2016-12-011-51/+0
| | | | | | here. llvm-svn: 288304
* PR31081: ignore exception specifications when deducing function templateRichard Smith2016-12-011-2/+46
| | | | | | | arguments from a declaration; despite what the standard says, this form of deduction should not be considering exception specifications. llvm-svn: 288301
* [OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragmaKelvin Li2016-11-3021-7/+4597
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute parallel for simd' pragma. Differential Revision: https://reviews.llvm.org/D27084 llvm-svn: 288294
* [Sema] Teach -Wcast-align to look at the aligned attribute of theAkira Hatanaka2016-11-301-0/+20
| | | | | | | | | | | | | declared variables. Teach Sema to check the aligned attribute attached to variable declarations so that it doesn't issue spurious warnings. rdar://problem/26517471 Differential revision: https://reviews.llvm.org/D21099 llvm-svn: 288267
* [analyzer] Construct temporary objects of correct types, destroy them properly.Artem Dergachev2016-11-301-0/+46
| | | | | | | | | | | | | | | | | | | | | | | When constructing a temporary object region, which represents the result of MaterializeTemporaryExpr, track down the sub-expression for which the temporary is necessary with a trick similar to the approach used in CodeGen, namely by using Expr::skipRValueSubobjectAdjustments(). Then, create the temporary object region with type of that sub-expression. That type would propagate further in a path-sensitive manner. During destruction of lifetime-extened temporaries, consult the type of the temporary object region, rather than the type of the lifetime-extending variable, in order to call the correct destructor (fixes pr17001) and, at least, not to crash by trying to call a destructor of a plain type (fixes pr19539). rdar://problem/29131302 rdar://problem/29131576 Differential Revision: https://reviews.llvm.org/D26839 llvm-svn: 288263
* [analyzer] SValExplainer: Support ObjC ivars and __block variables.Artem Dergachev2016-11-302-1/+28
| | | | | | | Additionally, explain the difference between normal and heap-based symbolic regions. llvm-svn: 288260
* [analyzer] Minor fixes and improvements to debug.ExprInspectionArtem Dergachev2016-11-302-0/+26
| | | | | | | | | | | | | | | | | | - Fix the bug with transition handling in ExprInspectionChecker's checkDeadSymbols implementation. - Test this bug by adding a new function clang_analyzer_numTimesReached() to catch number of passes through the code, which should be handy for testing against unintended state splits. - Add two more functions should help debugging issues quickly without running the debugger or dumping exploded graphs - clang_analyzer_dump() which dump()s an SVal argument to a warning message, and clang_analyzer_printState(), which dump()s the current program state to stderr. Differential Revision: https://reviews.llvm.org/D26835 llvm-svn: 288257
OpenPOWER on IntegriCloud