summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [WebAssembly] Update wasm builtin functions to match spec changes.Dan Gohman2015-11-051-9/+3
| | | | | | | The page_size operator has been removed from the spec, and the resize_memory operator has been changed to grow_memory. llvm-svn: 252201
* After some discussion, promote -fobjc-weak to a driver option.John McCall2015-11-051-0/+27
| | | | | | rdar://problem/23415863 llvm-svn: 252187
* [analyzer] Update RegionStoreManager::getBinding to handle BlockDataRegionsDevin Coughlin2015-11-051-4483/+4849
| | | | | | | | | | | | Update RegionStoreManager::getBinding() to return UnknownVal when trying to get the binding for a BlockDataRegion. Previously, getBinding() would try to cast the BlockDataRegion to a TypedValueRegion and crash. This happened when a block was passed as a parameter to an inlined function for which StackHintGeneratorForSymbol::getMessage() tried to generate a stack hint message. rdar://problem/21291971 llvm-svn: 252185
* Allow use of private headers in different sub-modules.Manuel Klimek2015-11-053-0/+53
| | | | llvm-svn: 252170
* [x86] Additional small fix for MCU psABI supportAndrey Bokhanko2015-11-051-1/+1
| | | | | | | | This patch fixes one more thing in MCU psABI support: LongDoubleWidth should be set to 64. Differential Revision: http://reviews.llvm.org/D14285 llvm-svn: 252156
* [modules] Don't merge an anonymous enum definition into a named enum definition.Richard Smith2015-11-051-1/+16
| | | | llvm-svn: 252125
* [Lex] Add __has_builtin support for __make_integer_seqDavid Majnemer2015-11-051-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D14349 llvm-svn: 252115
* [modules] If we're given a module file, via -fmodule-file=, for a module, butRichard Smith2015-11-051-0/+4
| | | | | | | | | we can't load that file due to a configuration mismatch, and implicit module building is disabled, and the user turns off the error-by-default warning for that situation, then fall back to textual inclusion for the module rather than giving an error if any of its headers are included. llvm-svn: 252114
* Fix nullptr crash in -Wthread-safety-betaReid Kleckner2015-11-051-0/+7
| | | | llvm-svn: 252107
* The control expression for a _Generic selection expression should haveAaron Ballman2015-11-051-0/+8
| | | | | | | its type decayed and qualifiers stripped when determining which selection it matches. Fixes PR16340. llvm-svn: 252104
* [analyzer] Add 'optin' checker package and move localizability checkers into it.Devin Coughlin2015-11-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | This commit creates a new 'optin' top-level checker package and moves several of the localizability checkers into it. This package is for checkers that are not alpha and that would normally be on by default but where the driver does not have enough information to determine when they are applicable. The localizability checkers fit this criterion because the driver cannot determine whether a project is localized or not -- this is best determined at the IDE or build-system level. This new package is *not* intended for checkers that are too noisy to be on by default. The hierarchy under 'optin' mirrors that in 'alpha': checkers under 'optin' should be organized in the hierarchy they would have had if they were truly top level (e.g., optin.osx.cocoa.MyOptInChecker). Differential Revision: http://reviews.llvm.org/D14303 llvm-svn: 252080
* [modules] Generalize the workaround for multiple ambiguous definitions ofRichard Smith2015-11-043-1/+9
| | | | | | | | | | | | | internal linkage entities in different modules from r250884 to apply to all names, not just function names. This is really awkward: we don't want to merge internal-linkage symbols from separate modules, because they might not actually be defining the same entity. But we don't want to reject programs that use such an ambiguous symbol if those internal-linkage symbols are in fact equivalent. For now, we're resolving the ambiguity by picking one of the equivalent definitions as an extension. llvm-svn: 252063
* [Concepts] Add diagnostics which fall under [dcl.spec.concept]p1Nathan Wilson2015-11-041-0/+2
| | | | | | | | | | | | Summary: Diagnose when the 'concept' specifier is used on a typedef or function parameter. Reviewers: rsmith, hubert.reinterpretcast, aaron.ballman, faisalv Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14316 llvm-svn: 252061
* clang-cl: Parse the /guard:cf[-] flag (PR25400)Hans Wennborg2015-11-041-0/+2
| | | | llvm-svn: 252056
* Improving the diagnostic for cases where the attribute only appertains to a ↵Aaron Ballman2015-11-042-4/+5
| | | | | | function with a prototype. llvm-svn: 252055
* [Sema] Implement __make_integer_seqDavid Majnemer2015-11-042-0/+61
| | | | | | | | | | | | | | | | | | This new builtin template allows for incredibly fast instantiations of templates like std::integer_sequence. Performance numbers follow: My work station has 64 GB of ram + 20 Xeon Cores at 2.8 GHz. __make_integer_seq<std::integer_sequence, int, 90000> takes 0.25 seconds. std::make_integer_sequence<int, 90000> takes unbound time, it is still running. Clang is consuming gigabytes of memory. Differential Revision: http://reviews.llvm.org/D13786 llvm-svn: 252036
* [analyzer] Move the ObjCGenericsChecker out of the alpha package.Devin Coughlin2015-11-032-3/+3
| | | | | | | It is now in the osx.cocoa package and so will be on by default for Apple toolchains. llvm-svn: 251966
* Introduce module file extensions to piggy-back data onto module files.Douglas Gregor2015-11-033-0/+49
| | | | | | | | | | | | | | | | | | | | | Introduce the notion of a module file extension, which introduces additional information into a module file at the time it is built that can then be queried when the module file is read. Module file extensions are identified by a block name (which must be unique to the extension) and can write any bitstream records into their own extension block within the module file. When a module file is loaded, any extension blocks are matched up with module file extension readers, that are per-module-file and are given access to the input bitstream. Note that module file extensions can only be introduced by programmatic clients that have access to the CompilerInvocation. There is only one such extension at the moment, which is used for testing the module file extension harness. As a future direction, one could imagine allowing the plugin mechanism to introduce new module file extensions. llvm-svn: 251955
* [modules] Rationalize the behavior of Decl::declarationReplaces, and inRichard Smith2015-11-038-6/+36
| | | | | | | | | particular don't assume that two declarations of the same kind in the same context are declaring the same entity. That's not true when the same name is declared multiple times as internal-linkage symbols within a module. (getCanonicalDecl is cheap now, so we can just use it here.) llvm-svn: 251898
* Switch to using an explicit scope object to ensure we don't forget to pop ObjCRichard Smith2015-11-031-0/+2
| | | | | | type parameters off the scope, and fix the cases where we failed to do so. llvm-svn: 251875
* Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones.Douglas Gregor2015-11-038-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A 'readonly' Objective-C property declared in the primary class can effectively be shadowed by a 'readwrite' property declared within an extension of that class, so long as the types and attributes of the two property declarations are compatible. Previously, this functionality was implemented by back-patching the original 'readonly' property to make it 'readwrite', destroying source information and causing some hideously redundant, incorrect code. Simplify the implementation to express how this should actually be modeled: as a separate property declaration in the extension that shadows (via the name lookup rules) the declaration in the primary class. While here, correct some broken Fix-Its, eliminate a pile of redundant code, clean up the ARC migrator's handling of properties declared in extensions, and fix debug info's naming of methods that come from categories. A wonderous side effect of doing this write is that it eliminates the "AddedObjCPropertyInClassExtension" method from the AST mutation listener, which in turn eliminates the last place where we rewrite entire declarations in a chained PCH file or a module file. This change (which fixes rdar://problem/18475765) will allow us to eliminate the rewritten-decls logic from the serialization library, and fixes a crash (rdar://problem/23247794) illustrated by the test/PCH/chain-categories.m example. llvm-svn: 251874
* watchOS & tvOS: add a few more tests.Tim Northover2015-11-025-15/+99
| | | | llvm-svn: 251832
* Fix va_arg on watchOS.Tim Northover2015-11-021-6/+11
| | | | | | As in other contexts, alignments can go up to 16 bytes in a va_list. llvm-svn: 251821
* [x86] Front-end part of MCU psABI supportAndrey Bokhanko2015-11-022-0/+9
| | | | | | | | | | | This patch implements two things in front-end for MCU psABI support: 1) "long double type is the same as double." 2) "New predefined C/C++ pre-processor symbols: iamcu and iamcu__. Differential Revision: http://reviews.llvm.org/D14205 llvm-svn: 251786
* [MS ABI] Don't zero-initialize vbptrs in basesDavid Majnemer2015-11-021-0/+26
| | | | | | | | | | | | Certain CXXConstructExpr nodes require zero-initialization before a constructor is called. We had a bug in the case where the constructor is called on a virtual base: we zero-initialized the base's vbptr field. A complementary bug is present in MSVC where no zero-initialization occurs for the subobject at all. This fixes PR25370. llvm-svn: 251783
* [MSVC Compat] Permit conversions from pointer-to-function to ↵David Majnemer2015-10-312-10/+9
| | | | | | | | | | | pointer-to-object iff -fms-compatibility We permit implicit conversion from pointer-to-function to pointer-to-object when -fms-extensions is specified. This is rather unfortunate, move this into -fms-compatibility and only permit it within system headers unless -Wno-error=microsoft-cast is specified. llvm-svn: 251738
* [CodeGen] Call SetInternalFunctionAttributes to attach functionAkira Hatanaka2015-10-311-0/+12
| | | | | | | | | | | | | | | | | attributes to internal functions. This patch fixes CodeGenModule::CreateGlobalInitOrDestructFunction to use SetInternalFunctionAttributes instead of SetLLVMFunctionAttributes to attach function attributes to internal functions. Also, make sure the correct CGFunctionInfo is passed instead of always passing what arrangeNullaryFunction returns. rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13610 llvm-svn: 251734
* Sema: correct typo recovery with blocksSaleem Abdulrasool2015-10-311-0/+12
| | | | | | | | | | Handle blocks in the tree transform for the typo correction as otherwise, the capture may miss. This would trigger an assertion. Thanks to Doug Gregor for the help with this! Fixes PR25001. llvm-svn: 251729
* Support tvOS and watchOS availability attributesTim Northover2015-10-302-0/+42
| | | | llvm-svn: 251711
* ARMv7k: implement ABI changes for watchOS from standard iOS.Tim Northover2015-10-307-0/+370
| | | | llvm-svn: 251710
* Disable SjLj exceptions for watchOSTim Northover2015-10-301-0/+1
| | | | llvm-svn: 251709
* Watch and TV OS: wire up basic ABI choicesTim Northover2015-10-301-0/+8
| | | | | | | This sets the mostly expected Darwin default ABI options for these two platforms. Active changes from these defaults for watchOS are in a later patch. llvm-svn: 251708
* Preprocessor: define correct tvOS and watchOS version macrosTim Northover2015-10-301-0/+22
| | | | llvm-svn: 251707
* Support watchOS and tvOS driver optionsTim Northover2015-10-308-5/+130
| | | | | | | | This patch should add support for almost all command-line options and driver tinkering necessary to produce a correct "clang -cc1" invocation for watchOS and tvOS. llvm-svn: 251706
* Reapply r251621 "[Analyzer] Widening loops which do not exit"Sean Eveson2015-10-303-2/+194
| | | | | | It was not the cause of the build bot failure. llvm-svn: 251702
* Revert "[mips] Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-3011-45/+0
| | | | | | | This reverts commits r251633. I'll investigate the test failure off trunk in order to keep the buildbots clean. llvm-svn: 251698
* Revert r251621 "[Analyzer] Widening loops which do not exit" (bot failure)Sean Eveson2015-10-303-194/+2
| | | | | | | | Seems to be causing clang-cmake-mips build bot to fail (timeout) http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/10299 llvm-svn: 251697
* Revert "Try to run and investigate the mips-mti-linux.c test failure on ARM ↵Renato Golin2015-10-301-7/+6
| | | | | | | | | buildbots." This reverts commit r251695. Debug is meant to be done off tree, not use the buildbots experiments. I'll help investigate this problem off trunk. llvm-svn: 251696
* Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots.Vasileios Kalintiris2015-10-301-6/+7
| | | | | | | | This should be a NFC for every toolchain other than mips-mti-linux (where we print the list of directories searched for crt files). It will soon be reverted once we hit the clang-cmake-armv7-a15-selfhost-neon buildbot. llvm-svn: 251695
* Update debug-info-scope test to remove "FIXME", which is fixed in r251689Dehao Chen2015-10-301-4/+0
| | | | llvm-svn: 251691
* Initialize @catch variables correctly in fragile-runtime ARC.John McCall2015-10-301-2/+39
| | | | llvm-svn: 251677
* Fix the emission of ARC ivar layouts in the non-fragile Mac runtime.John McCall2015-10-291-11/+25
| | | | | | | My previous change in this area accidentally broke the rule when InstanceBegin was not a multiple of the word size. llvm-svn: 251666
* Add support for __builtin_{add,sub,mul}_overflow.John McCall2015-10-292-0/+187
| | | | | | Patch by David Grayson! llvm-svn: 251651
* Suppress uninteresting output from crash-recovery-modules.mNico Weber2015-10-291-4/+4
| | | | | | No behavior change, but it makes this test a bit easier to debug when it fails. llvm-svn: 251650
* [mips] Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-10-2911-0/+45
| | | | | | | | | | The original commit in r249137 added the mips-mti-linux toolchain. However, the newly added tests of that commit failed in few buildbots. This commit re-applies the original changes but XFAILs the test file which caused the buildbot failures. This will allow us to examine what's going wrong without having to commit/revert large changes. llvm-svn: 251633
* [Analyzer] Widening loops which do not exitSean Eveson2015-10-293-2/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Dear All, We have been looking at the following problem, where any code after the constant bound loop is not analyzed because of the limit on how many times the same block is visited, as described in bugzillas #7638 and #23438. This problem is of interest to us because we have identified significant bugs that the checkers are not locating. We have been discussing a solution involving ranges as a longer term project, but I would like to propose a patch to improve the current implementation. Example issue: ``` for (int i = 0; i < 1000; ++i) {...something...} int *p = 0; *p = 0xDEADBEEF; ``` The proposal is to go through the first and last iterations of the loop. The patch creates an exploded node for the approximate last iteration of constant bound loops, before the max loop limit / block visit limit is reached. It does this by identifying the variable in the loop condition and finding the value which is “one away” from the loop being false. For example, if the condition is (x < 10), then an exploded node is created where the value of x is 9. Evaluating the loop body with x = 9 will then result in the analysis continuing after the loop, providing x is incremented. The patch passes all the tests, with some modifications to coverage.c, in order to make the ‘function_which_gives_up’ continue to give up, since the changes allowed the analysis to progress past the loop. This patch does introduce possible false positives, as a result of not knowing the state of variables which might be modified in the loop. I believe that, as a user, I would rather have false positives after loops than do no analysis at all. I understand this may not be the common opinion and am interested in hearing your views. There are also issues regarding break statements, which are not considered. A more advanced implementation of this approach might be able to consider other conditions in the loop, which would allow paths leading to breaks to be analyzed. Lastly, I have performed a study on large code bases and I think there is little benefit in having “max-loop” default to 4 with the patch. For variable bound loops this tends to result in duplicated analysis after the loop, and it makes little difference to any constant bound loop which will do more than a few iterations. It might be beneficial to lower the default to 2, especially for the shallow analysis setting. Please let me know your opinions on this approach to processing constant bound loops and the patch itself. Regards, Sean Eveson SN Systems - Sony Computer Entertainment Group Reviewers: jordan_rose, krememek, xazax.hun, zaks.anna, dcoughlin Subscribers: krememek, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D12358 llvm-svn: 251621
* Fix a soon to be invalid testXinliang David Li2015-10-291-1/+0
| | | | | | | Remove a check that won't be valid when LLVM stops emitting runtime hook user function. llvm-svn: 251611
* test: fix overzealous matchSaleem Abdulrasool2015-10-291-1/+1
| | | | | | Accidentally made the test too strict. llvm-svn: 251603
* Driver: CrossWindows sanitizers link supportSaleem Abdulrasool2015-10-291-0/+13
| | | | | | | Add the required libraries to the linker invocation when building with sanitizers. llvm-svn: 251600
* Driver: tweak CrossWindows sanitizer supportSaleem Abdulrasool2015-10-291-0/+12
| | | | | | | Indicate support for ASAN on the CrossWindows toolchain. Although this is insufficient, this at least permits the handling of the driver flag. llvm-svn: 251598
OpenPOWER on IntegriCloud