summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add test for DR692.Richard Smith2016-12-201-0/+63
| | | | llvm-svn: 290166
* Remove extraneous space.Rui Ueyama2016-12-201-1/+1
| | | | llvm-svn: 290165
* Remove `Compressed` member from InputSectionData.Rui Ueyama2016-12-203-15/+13
| | | | | | | This value is used only once, and we can compute a value. So we don't need to save it. llvm-svn: 290164
* Change the timeout in CallBoardSystemServiceOpenApplication to Jason Molenda2016-12-201-1/+1
| | | | | | | | 30 seconds to match the old springboard timeout; the launcher should time out before that and we will hopefully get back an informative error message instead of timing out ourselves. llvm-svn: 290163
* [PM] Rework a loop in the CGSCC update logic to be more conservative andChandler Carruth2016-12-201-7/+11
| | | | | | | | | | clear. The current RefSCC can occur in exactly one position so we should just enforce that and leverage the property rather than checking for it anywhere. This addresses review comments made on another patch. llvm-svn: 290162
* [PM] Provide an initial, minimal port of the inliner to the new pass manager.Chandler Carruth2016-12-2014-40/+682
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't implement *every* feature of the existing inliner, but tries to implement the most important ones for building a functional optimization pipeline and beginning to sort out bugs, regressions, and other problems. Notable, but intentional omissions: - No alloca merging support. Why? Because it isn't clear we want to do this at all. Active discussion and investigation is going on to remove it, so for simplicity I omitted it. - No support for trying to iterate on "internally" devirtualized calls. Why? Because it adds what I suspect is inappropriate coupling for little or no benefit. We will have an outer iteration system that tracks devirtualization including that from function passes and iterates already. We should improve that rather than approximate it here. - Optimization remarks. Why? Purely to make the patch smaller, no other reason at all. The last one I'll probably work on almost immediately. But I wanted to skip it in the initial patch to try to focus the change as much as possible as there is already a lot of code moving around and both of these *could* be skipped without really disrupting the core logic. A summary of the different things happening here: 1) Adding the usual new PM class and rigging. 2) Fixing minor underlying assumptions in the inline cost analysis or inline logic that don't generally hold in the new PM world. 3) Adding the core pass logic which is in essence a loop over the calls in the nodes in the call graph. This is a bit duplicated from the old inliner, but only a handful of lines could realistically be shared. (I tried at first, and it really didn't help anything.) All told, this is only about 100 lines of code, and most of that is the mechanics of wiring up analyses from the new PM world. 4) Updating the LazyCallGraph (in the new PM) based on the *newly inlined* calls and references. This is very minimal because we cannot form cycles. 5) When inlining removes the last use of a function, eagerly nuking the body of the function so that any "one use remaining" inline cost heuristics are immediately refined, and queuing these functions to be completely deleted once inlining is complete and the call graph updated to reflect that they have become dead. 6) After all the inlining for a particular function, updating the LazyCallGraph and the CGSCC pass manager to reflect the function-local simplifications that are done immediately and internally by the inline utilties. These are the exact same fundamental set of CG updates done by arbitrary function passes. 7) Adding a bunch of test cases to specifically target CGSCC and other subtle aspects in the new PM world. Many thanks to the careful review from Easwaran and Sanjoy and others! Differential Revision: https://reviews.llvm.org/D24226 llvm-svn: 290161
* Fix a bug that the glob pattern parser falls in an infinite loop for invalid ↵Rui Ueyama2016-12-202-0/+6
| | | | | | patterns. llvm-svn: 290160
* Fix the spelling of 'bitfield' in diagnostics to be consistently 'bit-field'.Chandler Carruth2016-12-207-20/+20
| | | | | | | | The latter agrees with most existing diagnostics and the C and C++ standards. Differential Revision: https://reviews.llvm.org/D26530 llvm-svn: 290159
* Reapply r289926: attempt to fix windows buildAdrian Prantl2016-12-201-1/+2
| | | | llvm-svn: 290158
* Set Config->ColorDiagnostics early so that all error messages are colored.Rui Ueyama2016-12-203-27/+30
| | | | | | | | | Previously, some errors that were checked before we set to Config->ColorDiagnostics weren't colored. This patch moves the code to set the variable so that such error messages are colored just like other error messages. llvm-svn: 290157
* [Parser] Correct typo after lambda capture initializer is parsed.Akira Hatanaka2016-12-202-0/+17
| | | | | | | | | | | | | | | | This patch fixes an assertion that is triggered when RecordLayoutBuilder tries to compute the size of a field (for capture "name" in the test case) whose type hasn't been deduced. The patch fixes the bug by correcting the typo of the capture initializer after the initializer is parsed and before setting the expression for the annotation token. Fixes PR30566. rdar://problem/23380132 Differential Revision: https://reviews.llvm.org/D25206 llvm-svn: 290156
* Update for LLVM global variable debug info API change.Adrian Prantl2016-12-2014-61/+93
| | | | | | This reapplies r289921. llvm-svn: 290155
* Fix debug info metadata for upstream change in LLVM.Adrian Prantl2016-12-201-1/+1
| | | | llvm-svn: 290154
* [IR] Remove the DIExpression field from DIGlobalVariable.Adrian Prantl2016-12-20191-681/+1060
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements PR31013 by introducing a DIGlobalVariableExpression that holds a pair of DIGlobalVariable and DIExpression. Currently, DIGlobalVariables holds a DIExpression. This is not the best way to model this: (1) The DIGlobalVariable should describe the source level variable, not how to get to its location. (2) It makes it unsafe/hard to update the expressions when we call replaceExpression on the DIGLobalVariable. (3) It makes it impossible to represent a global variable that is in more than one location (e.g., a variable with multiple DW_OP_LLVM_fragment-s). We also moved away from attaching the DIExpression to DILocalVariable for the same reasons. This reapplies r289902 with additional testcase upgrades and a change to the Bitcode record for DIGlobalVariable, that makes upgrading the old format unambiguous also for variables without DIExpressions. <rdar://problem/29250149> https://llvm.org/bugs/show_bug.cgi?id=31013 Differential Revision: https://reviews.llvm.org/D26769 llvm-svn: 290153
* Make this REQUIRES match the other REQUIRES lines that mention requiringChandler Carruth2016-12-201-1/+1
| | | | | | a darwin system. llvm-svn: 290152
* Simplify type of Config->SymbolOrderingFile.Rui Ueyama2016-12-205-29/+20
| | | | | | | | | | | That variable was of type DenseMap<StringRef, unsigned>, but the unsigned numbers needed to be monotonicly increasing numbers because the implementation that used the variable depended on that fact. That was an implementation detail and shouldn't have leaked into Config. This patch simplifies its type to std::vector<StringRef>. llvm-svn: 290151
* Inline a small function.Rui Ueyama2016-12-201-11/+4
| | | | llvm-svn: 290150
* Add the alloc_size attribute to clang.George Burgess IV2016-12-2016-205/+1079
| | | | | | | | | | | | | | | | | | | | This patch does three things: - Gives us the alloc_size attribute in clang, which lets us infer the number of bytes handed back to us by malloc/realloc/calloc/any user functions that act in a similar manner. - Teaches our constexpr evaluator that evaluating some `const` variables is OK sometimes. This is why we have a change in test/SemaCXX/constant-expression-cxx11.cpp and other seemingly unrelated tests. Richard Smith okay'ed this idea some time ago in person. - Uniques some Blocks in CodeGen, which was reviewed separately at D26410. Lack of uniquing only really shows up as a problem when combined with our new eagerness in the face of const. Differential Revision: https://reviews.llvm.org/D14274 llvm-svn: 290149
* Revert "[ObjectYAML] Support for DWARF debug_info section"Chris Bieneman2016-12-2011-851/+8
| | | | | | | | This reverts commit r290147. This commit is breaking a bot (http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/621). I don't have time to investigate at the moment, so I'll revert for now. llvm-svn: 290148
* [ObjectYAML] Support for DWARF debug_info sectionChris Bieneman2016-12-2011-8/+851
| | | | | | This patch adds support for YAML<->DWARF for debug_info sections. llvm-svn: 290147
* Fix completely bogus types for some builtins:Richard Smith2016-12-197-16/+30
| | | | | | | | | | | | | | | | | | | | | * In C++, never create a FunctionNoProtoType for a builtin (fixes C++1z crasher from r289754). * Fix type of __sync_synchronize to be a no-parameter function rather than a varargs function. This matches GCC. * Fix type of vfprintf to match its actual type. We gave it a wrong type due to PR4290 (apparently autoconf generates invalid code and expects compilers to choke it down or it miscompiles the program; the relevant error in clang was downgraded to a warning in r122744 to fix other occurrences of this autoconf brokenness, so we don't need this workaround any more). * Turn off vararg argument checking for __noop, since it's not *really* a varargs function. Alternatively we could add custom type checking for it and synthesize parameter types matching the actual arguments in each call, but that seemed like overkill. llvm-svn: 290146
* Make another test insensitive to the default C++ dialect.Paul Robinson2016-12-191-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D27955 llvm-svn: 290145
* Add ARM support to update_llc_test_checks.pyEli Friedman2016-12-192-43/+98
| | | | | | | | | | Just the minimal support to get it working at the moment. Includes checks for test/CodeGen/ARM/vzip.ll as an example. Differential Revision: https://reviews.llvm.org/D27829 llvm-svn: 290144
* [analyzer] Add checker modeling gtest APIs.Devin Coughlin2016-12-196-0/+452
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gtest is a widely-used unit-testing API. It provides macros for unit test assertions: ASSERT_TRUE(p != nullptr); that expand into an if statement that constructs an object representing the result of the assertion and returns when the assertion is false: if (AssertionResult gtest_ar_ = AssertionResult(p == nullptr)) ; else return ...; Unfortunately, the analyzer does not model the effect of the constructor precisely because (1) the copy constructor implementation is missing from the the header (so it can't be inlined) and (2) the boolean-argument constructor is constructed into a temporary (so the analyzer decides not to inline it since it doesn't reliably call temporary destructors right now). This results in false positives because the analyzer does not realize that the the assertion must hold along the non-return path. This commit addresses the false positives by explicitly modeling the effects of the two un-inlined constructors on the AssertionResult state. I've added a new package, "apiModeling", for these kinds of checkers that model APIs but don't emit any diagnostics. I envision all the checkers in this package always being on by default. This addresses the false positives reported in PR30936. Differential Revision: https://reviews.llvm.org/D27773 rdar://problem/22705813 llvm-svn: 290143
* [LV] Sink tripcount query to where it's actually used. NFC.Michael Kuperstein2016-12-191-5/+4
| | | | llvm-svn: 290142
* Don't try to emit nullability fix-its within/around macros.Jordan Rose2016-12-193-22/+48
| | | | | | | | | | | | | | The newly-added notes from r290132 are too noisy even when the fix-it is valid. For the existing warning from r286521, it's probably the right decision 95% of the time to put the change outside the macro if the array is outside the macro and inside otherwise, but I don't want to overthink it right now. Caught by the ASan bot! More rdar://problem/29524992 llvm-svn: 290141
* [analyzer] Add sink after construction of temporary with no-return destructor.Devin Coughlin2016-12-192-0/+50
| | | | | | | | | | | | | | | | | | | The analyzer's CFG currently doesn't have nodes for calls to temporary destructors. This causes the analyzer to explore infeasible paths in which a no-return destructor would have stopped exploration and so results in false positives when no-return destructors are used to implement assertions. To mitigate these false positives, this patch stops generates a sink after evaluating a constructor on a temporary object that has a no-return destructor. This results in a loss of coverage because the time at which the destructor is called may be after the time of construction (especially for lifetime-extended temporaries). This addresses PR15599. rdar://problem/29131566 llvm-svn: 290140
* [ObjectYAML] Support for DWARF Pub SectionsChris Bieneman2016-12-197-0/+470
| | | | | | This patch adds support for YAML<->DWARF round tripping for pub* section data. The patch supports both GNU and non-GNU style entries. llvm-svn: 290139
* [libfuzzer] dump_coverage command line flagMike Aizatsky2016-12-197-0/+28
| | | | | | | | Reviewers: kcc, vitalybuka Differential Revision: https://reviews.llvm.org/D27942 llvm-svn: 290138
* [Axccel] Remove -Wno-missing-braces in buildJason Henline2016-12-193-6/+6
| | | | | | | | | | | | | | | | Summary: I originally added the -Wno-missing-braces flag because I thought it was erroneously flagging std::array initializations. Now I realize the extra braces really are desired for these initializations, so I'm turning the warning flag back on. Reviewers: jlebar Subscribers: mgorny, parallel_libs-commits Differential Revision: https://reviews.llvm.org/D27941 llvm-svn: 290137
* Fix corner cases of setting the section address.Rafael Espindola2016-12-194-26/+140
| | | | | | | | | | | | | | | | This handles all the corner cases if setting a section address: - If the address is too low, we cannot allocate the program headers. - If the load address is lowered, we have to do that before finalize This also shares some code with the linker script since it was already hitting similar cases. This is used by the freebsd boot loader. It is not clear if we need to support this with a non binary output, but it is not as bad as I was expecting. llvm-svn: 290136
* [Format] Remove dead code.Benjamin Kramer2016-12-194-31/+0
| | | | | | No functionality change. llvm-svn: 290135
* [ASTReader] Sort RawComments before mergingBruno Cardoso Lopes2016-12-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | `RawComments` are sorted by comparing underlying `SourceLocation`'s. This is done by comparing `FileID` and `Offset`; when the `FileID` is the same it means the locations are within the same TU and the `Offset` is used. FileID, from the source code: "A mostly-opaque identifier, where 0 is "invalid", >0 is this module, and <-1 is something loaded from another module.". That said, when de-serializing SourceLocations, FileID's from RawComments loaded from other modules get negative IDs where previously they were positive. This makes imported RawComments unsorted, leading to a wrong merge with other comments from the current TU. Fix that by sorting RawComments properly after de-serialization and before merge. This fixes an assertion in `ASTContext::getRawCommentForDeclNoCache`, which fires only in a debug build of clang. Differential Revision: https://reviews.llvm.org/D27546 rdar://problem/29287314 llvm-svn: 290134
* [TargetInstrInfo] replace redundant expression in getMemOpBaseRegImmOfsMichael LeMay2016-12-191-2/+1
| | | | | | | | | | | | | | | Summary: The expression for computing the return value of getMemOpBaseRegImmOfs has only one possible value. The other value would result in a return earlier in the function. This patch replaces the expression with its only possible value. Reviewers: sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27437 llvm-svn: 290133
* Add fix-it notes to the nullability consistency warning.Jordan Rose2016-12-1915-58/+220
| | | | | | | | | | | | | | | | | | | | | This is especially important for arrays, since no one knows the proper syntax for putting qualifiers in arrays. nullability.h:3:26: warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) void arrayParameter(int x[]); ^ nullability.h:3:26: note: insert '_Nullable' if the array parameter may be null void arrayParameter(int x[]); ^ _Nullable nullability.h:3:26: note: insert '_Nonnull' if the array parameter should never be null void arrayParameter(int x[]); ^ _Nonnull rdar://problem/29524992 llvm-svn: 290132
* Make a function to correctly extract the DW_AT_high_pc given the low pc value.Greg Clayton2016-12-194-25/+214
| | | | | | | | DWARF 4 and later supports encoding the PC as an address or as as offset from the low PC. Clients using DWARFDie should be insulated from how to extract the high PC value. This function takes care of extracting the form value and looking for the correct form. Differential Revision: https://reviews.llvm.org/D27885 llvm-svn: 290131
* Reverting r290004, r290006, r290010 pending review.Sean Callanan2016-12-1913-384/+0
| | | | llvm-svn: 290130
* Fixup for r290119: Only run debug_alloc_stack.cc on Darwin until I figure ↵Kuba Mracek2016-12-191-0/+3
| | | | | | out how to make it work on Linux. llvm-svn: 290129
* Make a few OpenMP tests "C++11 clean."Paul Robinson2016-12-193-6/+72
| | | | | | | This time trying to commit just the relevant 3 tests! Reviewed by abataev (in D27794) llvm-svn: 290128
* [InstCombine] use commutative matcher for pattern with commutative operatorsSanjay Patel2016-12-192-4/+21
| | | | | | | | This is a case that was missed in: https://reviews.llvm.org/rL290067 ...and it would regress if we fix operand complexity (PR28296). llvm-svn: 290127
* More fixup for r290119: Make the ifdef work.Kuba Mracek2016-12-191-2/+2
| | | | llvm-svn: 290126
* Revert another accidental bitPaul Robinson2016-12-191-2/+0
| | | | llvm-svn: 290125
* Another fix-up for r290119: Include stdint.h so we have uint64_t on Linux.Kuba Mracek2016-12-191-0/+1
| | | | llvm-svn: 290124
* Fix-up for r290119 - don't check global size, it might not be available when ↵Kuba Mracek2016-12-191-1/+1
| | | | | | using atos llvm-svn: 290123
* [ELF] - Implemented --retain-symbols-file optionGeorge Rimar2016-12-195-6/+89
| | | | | | | | | | | | | | | | --retain-symbols-file=filename Retain only the symbols listed in the file filename, discarding all others. filename is simply a flat file, with one symbol name per line. This option is especially useful in environments (such as VxWorks) where a large global symbol table is accumulated gradually, to conserve run-time memory. Note: though documentation says "--retain-symbols-file does not discard undefined symbols, or symbols needed for relocations.", both bfd and gold do that, and this patch too, like testcase show. Differential revision: https://reviews.llvm.org/D27716 llvm-svn: 290122
* Undo accidental comitPaul Robinson2016-12-1913-244/+93
| | | | llvm-svn: 290121
* Make a few OpenMP tests "C++11 clean."Paul Robinson2016-12-1912-91/+244
| | | | | | Reviewed by abataev (in D27794) llvm-svn: 290120
* [tsan] Implement __tsan_get_alloc_stack and __tsan_locate_address to query ↵Kuba Mracek2016-12-195-0/+212
| | | | | | | | | | pointer types and allocation stacks of heap pointers In ASan, we have __asan_locate_address and __asan_get_alloc_stack, which is used in LLDB/Xcode to show the allocation backtrace for a heap memory object. This patch implements the same for TSan. Differential Revision: https://reviews.llvm.org/D27656 llvm-svn: 290119
* [InstCombine] add folds for icmp (umin|umax X, Y), XSanjay Patel2016-12-194-94/+93
| | | | | | | | This is a follow-up to: https://reviews.llvm.org/rL289855 (https://reviews.llvm.org/D27531) https://reviews.llvm.org/rL290111 llvm-svn: 290118
* Expression evaluation for overloaded C functions (redux)Luke Drummond2016-12-196-29/+159
| | | | | | | | | | | | | | | | | | | This is a redux of [Ewan's patch](https://reviews.llvm.org/D17957) , refactored to properly substitute primitive types using a hook in the itanium demangler, and updated after the previous patch went stale The new `SubsPrimitiveParmItanium` function takes a symbol name and replacement primitive type parameter as before but parses it using the FastDemangler, which has been modified to be able to notify clients of parse events (primitive types at this point). Additionally, we now use a `set` of `ConstStrings` instead of a `vector` so that we don't try and resolve the same invalid candidate multiple times. Differential Revision: https://reviews.llvm.org/D27223 Subscribers: lldb-commits llvm-svn: 290117
OpenPOWER on IntegriCloud