summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Reapply r251621 "[Analyzer] Widening loops which do not exit"Sean Eveson2015-10-309-3/+332
| | | | | | It was not the cause of the build bot failure. llvm-svn: 251702
* clang/module.modulemap: Exclude Frontend/PCHContainerOperations.h in ↵NAKAMURA Takumi2015-10-301-0/+3
| | | | | | | Clang_Frontend. FIXME: It should be dissolved to interface and impl. llvm-svn: 251701
* Revert "[mips] Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-3017-298/+27
| | | | | | | 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-309-332/+3
| | | | | | | | 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-302-20/+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-302-6/+20
| | | | | | | | 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
* Add "equalsNode" for types and "isCopyAssignmentOperator" matchers.Angel Garcia Gomez2015-10-302-1/+52
| | | | | | | | | | | | Summary: This matchers are going to be used in modernize-use-default, but are generic enough to be placed in ASTMatchers.h. Reviewers: klimek Subscribers: alexfh, cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D14152 llvm-svn: 251693
* Update debug-info-scope test to remove "FIXME", which is fixed in r251689Dehao Chen2015-10-301-4/+0
| | | | llvm-svn: 251691
* Format: support inline namespacesSaleem Abdulrasool2015-10-302-1/+8
| | | | | | | | Correct handling for C++17 inline namespaces. We would previously fail to identify the inline namespaces as a namespace name since multiple ones may be concatenated now with C++17. llvm-svn: 251690
* Initialize @catch variables correctly in fragile-runtime ARC.John McCall2015-10-304-22/+70
| | | | llvm-svn: 251677
* Fix the emission of ARC ivar layouts in the non-fragile Mac runtime.John McCall2015-10-292-17/+36
| | | | | | | My previous change in this area accidentally broke the rule when InstanceBegin was not a multiple of the word size. llvm-svn: 251666
* Mark InternalDebugOpt driver options as CoreOptions.Nico Weber2015-10-291-1/+1
| | | | | | Mostly has the effect of making -ccc-print-phases usable from clang-cl. llvm-svn: 251653
* Add support for __builtin_{add,sub,mul}_overflow.John McCall2015-10-297-3/+382
| | | | | | 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
* clang-format: [JS] Add goog.setTestOnly to the list of stuff thatDaniel Jasper2015-10-292-3/+6
| | | | | | is import-statement-like and shouldn't be wrapped. llvm-svn: 251643
* add support of the latest Ubuntu (Xenial Xerus)Sylvestre Ledru2015-10-291-1/+3
| | | | llvm-svn: 251639
* Add a link to the DXR projectEhsan Akhgari2015-10-291-0/+11
| | | | | | | | DXR is a project developed at Mozilla that implements a code indexing and browsing utility on top of libclang that has features such as call graph querying. llvm-svn: 251638
* [mips] Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-10-2917-27/+298
| | | | | | | | | | 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-299-3/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-292-0/+29
| | | | | | | Add the required libraries to the linker invocation when building with sanitizers. llvm-svn: 251600
* Driver: inline some small arraysSaleem Abdulrasool2015-10-291-10/+4
| | | | | | Use an initializer list to remove a couple of small static arrays. NFC. llvm-svn: 251599
* Driver: tweak CrossWindows sanitizer supportSaleem Abdulrasool2015-10-293-0/+20
| | | | | | | 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
* [analyzer] Update analyzer website for release of checker-277.Devin Coughlin2015-10-294-3/+33
| | | | llvm-svn: 251591
* [Sema] Implement -Wdouble-promotion for clang.George Burgess IV2015-10-294-0/+46
| | | | | | | | | | | | | | | GCC has a warning called -Wdouble-promotion, which warns you when an implicit conversion increases the width of a floating point type. This is useful when writing code for architectures that can perform hardware FP ops on floats, but must fall back to software emulation for larger types (i.e. double, long double). This fixes PR15109 <https://llvm.org/bugs/show_bug.cgi?id=15109>. Thanks to Carl Norum for the patch! llvm-svn: 251588
* [WinEH] Mark calls inside cleanups as noinlineReid Kleckner2015-10-284-21/+41
| | | | | | | | | | | | | | | This works around PR25162. The MSVC tables make it very difficult to correctly inline a C++ destructor that contains try / catch. We've attempted to address PR25162 in LLVM's backend, but it feels pretty infeasible. MSVC and ICC both appear to avoid inlining such complex destructors. Long term, we want to fix this by making the inliner smart enough to know when it is inlining into a cleanup, so it can inline simple destructors (~unique_ptr and ~vector) while avoiding destructors containing try / catch. llvm-svn: 251576
* Fix the calling convention of Mingw64 long double valuesReid Kleckner2015-10-283-21/+67
| | | | | | | | | | GCC uses the x87DoubleExtended model for long doubles, and passes them indirectly by address through function calls. Also replace the existing mingw-long-double assembly emitting test with an IR-level test. llvm-svn: 251567
* Fix missing builtin identifier infos with PCH+modulesBen Langmuir2015-10-284-2/+15
| | | | | | | | | | | | | | Use the *current* state of "is-moduleness" rather than the state at serialization time so that if we read a builtin identifier from a module that wasn't "interesting" to that module, we will still write it out to a PCH that imports that module. Otherwise, we would get mysterious "unknown builtin" errors when using PCH+modules. rdar://problem/23287656 llvm-svn: 251565
* [analyzer] Preserve the order checkers were enabled/disabled.Anton Yartsev2015-10-281-4/+19
| | | | | | | In addition to r251524: preserve the order the checkers were enabled/disabled to be deterministic. Additionally return the number of arguments read by 'ProcessArgs' - for debug purpose. llvm-svn: 251552
* Move global classes into anonymous namespaces. NFC.Benjamin Kramer2015-10-282-2/+4
| | | | llvm-svn: 251528
* [analyzer] Make inclusion/exclusion of checkers less ambiguous.Anton Yartsev2015-10-281-6/+10
| | | | | | | | A checker may be enabled/disabled multiple times via -enable-checker and -disable-checker scan-build arguments. Currently the conflicting and repetitive arguments are passed to the analyzer as is. With this patch only the last enable/disable of a particular checker is accepted and passed to the analyzer. This change is mostly done for the upcoming 'config for scan-build' patch when multiple inclusions/exclusions of a checker are expected to be more common. llvm-svn: 251524
* Put global classes into the appropriate namespace.Benjamin Kramer2015-10-288-2/+20
| | | | | | | Most of the cases belong into an anonymous namespace. No functionality change intended. llvm-svn: 251514
* When running clang with an arm triple such as '--target=thumbv7m-none-eabi'Alexandros Lamprineas2015-10-282-6/+25
| | | | | | | | | | | | that has a thumb only CPU by default (cortex-m3), and when using the assembler, the default thumb state of the CPU does not get passed via the triple to LLVM: $ clang -target thumbv7m-none-eabi -c -v test.s clang -cc1as ... -triple armv7m-none--eabi ... test.s Differential Revision: http://reviews.llvm.org/D14121 llvm-svn: 251507
* Reflow comment.Eric Christopher2015-10-281-6/+4
| | | | llvm-svn: 251501
* Refine r251469 to give better (and more localizable) diagnosticsJohn McCall2015-10-2812-70/+121
| | | | | | for all the reasons that ARC makes things implicitly unavailable. llvm-svn: 251496
* Driver: support -fuse-ld= on cross windowsSaleem Abdulrasool2015-10-283-2/+5
| | | | | | | Update the linker selection to support the `-fuse-ld=` option for selecting a linker. llvm-svn: 251493
* Add a test case for r251476.Akira Hatanaka2015-10-281-0/+54
| | | | llvm-svn: 251477
* [CodeGen] Attach function attributes to Objective-C and OpenMPAkira Hatanaka2015-10-283-9/+14
| | | | | | | | | | | | | | functions. This commit fixes a bug in CGOpenMPRuntime.cpp and CGObjC.cpp where some of the function attributes are not attached to newly created functions. rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13928 llvm-svn: 251476
* clang-format: When a line is formatted, also format subsequence lines if ↵Daniel Jasper2015-10-285-19/+42
| | | | | | | | | | | | | | their indent is off. Summary: This is especially important so that if a change is solely inserting a block around a few statements, clang-format-diff.py will still clean up and add indentation to the inner parts. Reviewers: klimek Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D14105 llvm-svn: 251474
* Add the ability to define "fake" arguments on attributes.John McCall2015-10-285-76/+113
| | | | | | | | | | | | | | Fake arguments are automatically handled for serialization, cloning, and other representational tasks, but aren't included in pretty-printing or parsing (should we eventually ever automate that). This is chiefly useful for attributes that can be written by the user, but which are also frequently synthesized by the compiler, and which we'd like to remember details of the synthesis for. As a simple example, use this to narrow the cases in which we were generating a specialized note for implicitly unavailable declarations. llvm-svn: 251469
* clang-format: Increase cut-off limit for number of analyzed states.Daniel Jasper2015-10-271-1/+1
| | | | | | | | | | | With more complex structures in C++ Lambdas and JavaScript function literals, the old value was simply to small. However, this is a temporary solution, I need to look at this more closely a) to find a fundamentally better approach and b) to look at whether the more recent usage of NoLineBreak makes us visit stuff in an unfortunate order where clang-format waste many states in dead ends. llvm-svn: 251463
* Minor fix in ToolChainTest.cpp to allow user defined GCC toolchain.Samuel Antao2015-10-271-4/+4
| | | | | | | If the user configured clang with a custom GCC toolchain that will take precedence on what the ToolChainTest.cpp expects to evaluate. This is fixed here by passing --gcc-toolchain= to the driver, in order to override any user defined GCC toolchain. llvm-svn: 251459
* [analyzer] Assume escape is possible through system functions taking void*Anna Zaks2015-10-275-13/+60
| | | | | | | | | | | | | | | | | | The analyzer assumes that system functions will not free memory or modify the arguments in other ways, so we assume that arguments do not escape when those are called. However, this may lead to false positive leak errors. For example, in code like this where the pointers added to the rb_tree are freed later on: struct alarm_event *e = calloc(1, sizeof(*e)); <snip> rb_tree_insert_node(&alarm_tree, e); Add a heuristic to assume that calls to system functions taking void* arguments allow for pointer escape. llvm-svn: 251449
* [analyzer] Enhance FAQ with instructions on handing unused variables.Anna Zaks2015-10-271-0/+14
| | | | llvm-svn: 251448
* Tweak how -Wunused-value interacts with macrosNico Weber2015-10-272-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Make the warning more strict in C mode. r172696 added code to suppress warnings from macro expansions in system headers, which checks `SourceMgr.isMacroBodyExpansion(E->IgnoreParens()->getExprLoc())`. Consider this snippet: #define FOO(x) (x) void f(int a) { FOO(a); } In C, the line `FOO(a)` is an `ImplicitCastExpr(ParenExpr(DeclRefExpr))`, while it's just a `ParenExpr(DeclRefExpr)` in C++. So in C++, `E->IgnoreParens()` returns the `DeclRefExpr` and the check tests the SourceLoc of `a`. In C, the `ImplicitCastExpr` has the effect of checking the SourceLoc of `FOO`, which is a macro body expansion, which causes the diagnostic to be skipped. It looks unintentional that clang does different things for C and C++ here, so use `IgnoreParenImpCasts` instead of `IgnoreParens` here. This has the effect of the warning firing more often than previously in C code – it now fires as often as it fires in C++ code. 2. Suppress the warning if it would warn on `UNREFERENCED_PARAMETER`. `UNREFERENCED_PARAMETER` is a commonly used macro on Windows and it happens to uselessly trigger -Wunused-value. As discussed in the thread "rfc: winnt.h's UNREFERENCED_PARAMETER() vs clang's -Wunused-value" on cfe-dev, fix this by special-casing this specific macro. (This costs a string comparison and some fast-path lexing per warning, but the warning is emitted rarely. It fires once in Windows.h itself, so this code runs at least once per TU including Windows.h, but it doesn't run hundreds of times.) http://reviews.llvm.org/D13969 llvm-svn: 251441
* Remove unused diagnostic. NFC.Benjamin Kramer2015-10-271-3/+0
| | | | llvm-svn: 251432
* [mips] Separated mips specific -Wa options, so that they are not checked on ↵Daniel Sanders2015-10-271-12/+30
| | | | | | | | | | | | | | | | other platforms. Summary: This is a follow on to post review comments on revision r248276. Patch by Scott Egerton. Reviewers: vkalintiris, dsanders Subscribers: joerg, rengolin, cfe-commits Differential Revision: http://reviews.llvm.org/D13100 llvm-svn: 251430
* Allow linking multiple bitcode files.Artem Belevich2015-10-279-67/+124
| | | | | | | | | | | | | | | | | | Linking options for particular file depend on the option that specifies the file. Currently there are two: * -mlink-bitcode-file links in complete content of the specified file. * -mlink-cuda-bitcode links in only the symbols needed by current TU. Linked symbols are internalized. This bitcode linking mode is used to link device-specific bitcode provided by CUDA. Files are linked in order they are specified on command line. -mlink-cuda-bitcode replaces -fcuda-uses-libdevice flag. Differential Revision: http://reviews.llvm.org/D13913 llvm-svn: 251427
* [ms-inline-asm] Test case for alignment directive change in LLVM r251418Reid Kleckner2015-10-271-0/+30
| | | | llvm-svn: 251419
OpenPOWER on IntegriCloud