summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in test's XFAIL line. Patch by Dimitry Andric!Nick Lewycky2013-10-211-1/+1
| | | | llvm-svn: 193063
* Sema: Explain our deviation from the standard by referencing the, now open, ↵David Majnemer2013-10-211-0/+2
| | | | | | LWG issue. llvm-svn: 193062
* Be more precise when diagnosing 'inline' on global replacement functionsDavid Majnemer2013-10-212-2/+2
| | | | llvm-svn: 193061
* Runtime support for the indirect function call checker.Peter Collingbourne2013-10-209-0/+70
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1339 llvm-svn: 193060
* [ubsan] Introduce %clangxx substitution for all C++ tests.Peter Collingbourne2013-10-2024-55/+57
| | | | llvm-svn: 193059
* Implement function type checker for the undefined behavior sanitizer.Peter Collingbourne2013-10-2012-12/+122
| | | | | | | | | This uses function prefix data to store function type information at the function pointer. Differential Revision: http://llvm-reviews.chandlerc.com/D1338 llvm-svn: 193058
* Revert r193022 and r193048. They broke the ubsan test suite.Peter Collingbourne2013-10-202-27/+23
| | | | llvm-svn: 193057
* Switch attribute test line endings from CRLFAlp Toker2013-10-204-75/+75
| | | | | | The convention is LF unless specifically testing line endings. llvm-svn: 193056
* Fix crash in cleanup attr handlingAlp Toker2013-10-204-3/+19
| | | | | | | | | | | ResolveSingleFunctionTemplateSpecialization() returns 0 and doesn't emit diags unless the expression has template-ids, so we must null check the result. Also add a better diag noting which overloads are causing the problem. Reviewed by Aaron Ballman. llvm-svn: 193055
* clang-format: Better understand Lambda poarameters.Daniel Jasper2013-10-202-1/+9
| | | | | | | | | | | | Before: auto PointerBinding = [](const char * S) {}; After: auto PointerBinding = [](const char *S) {}; This fixes llvm.org/PR17618. llvm-svn: 193054
* Fix python-free build.Joerg Sonnenberger2013-10-203-0/+8
| | | | llvm-svn: 193053
* Make sure switch covers all values.Joerg Sonnenberger2013-10-201-0/+3
| | | | llvm-svn: 193052
* clang-format: Fix formatting of nested blocks after comment.Daniel Jasper2013-10-202-10/+17
| | | | | | | | | | | | | | | Before: DEBUG({ // Comment that used to confuse clang-format. fdafas(); }); Before: DEBUG({ // Comments are now fine. fdafas(); }); This fixed llvm.org/PR17619. llvm-svn: 193051
* clang-format: Support case ranges.Daniel Jasper2013-10-202-1/+9
| | | | | | | | | | | | | | | | | | | Before (note the missing space before "..." which can lead to compile errors): switch (x) { case 'A'... 'Z': case 1... 5: break; } After: switch (x) { case 'A' ... 'Z': case 1 ... 5: break; } llvm-svn: 193050
* clang-format: Improve formatting of ObjC dict literals.Daniel Jasper2013-10-202-8/+18
| | | | | | | | | | | | | | | | Before: NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; After: NSDictionary *d = @{ @"nam" : NSUserNam(), @"dte" : [NSDate date], @"processInfo" : [NSProcessInfo processInfo] }; llvm-svn: 193049
* Driver: libubsan_cxx depends on libubsan. Preserve the topological ordering, ↵Benjamin Kramer2013-10-202-4/+5
| | | | | | some linkers depend on it. llvm-svn: 193048
* Forgot some references to misspelled enums.Benjamin Kramer2013-10-201-4/+4
| | | | llvm-svn: 193047
* Miscellaneous speling fixes.Benjamin Kramer2013-10-2013-18/+18
| | | | llvm-svn: 193046
* Teach simplify-cfg how to correctly create covered lookup tables for ↵Michael Gottesman2013-10-202-6/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | switches on iN with N >= 3. One optimization simplify-cfg performs is the converting of switches to lookup tables if the switch has > 4 cases. This is done by: 1. Finding the max/min case value and calculating the switch case range. 2. Create a lookup table basic block. 3. Perform a check in the switch's BB to see if the input value is in the switch's case range. If the input value satisfies said predicate branch to the lookup table BB, otherwise branch to the switch's default destination BB using the default value as the result. The conditional check consists of subtracting the min case value of the table from any input iN value and then ensuring that said value is unsigned less than the size of the lookup table represented as an iN value. If the lookup table is a covered lookup table, the size of the table will be N which is 0 as an iN value. Thus the comparison will be an `icmp ult` of an iN value against 0 which is always false yielding the incorrect result. This patch fixes this problem by recognizing if we have a covered lookup table and if we do, unconditionally jumps to the lookup table BB since the covering property of the lookup table implies no input values could not be handled by said BB. rdar://15268442 llvm-svn: 193045
* Sema: Diagnose global replacement functions declared as inlineDavid Majnemer2013-10-203-0/+11
| | | | | | | | | | | This fixes PR17591. N.B. This actually goes beyond what the standard mandates by requiring the restriction to hold for declarations instead of definitions. This is believed to be a defect in the standard and an LWG issue has been submitted. llvm-svn: 193044
* Typo.Peter Collingbourne2013-10-201-1/+1
| | | | llvm-svn: 193043
* Emit prefix data after debug and EH directives.Peter Collingbourne2013-10-202-4/+6
| | | | | | | | | This ensures that the prefix data is treated as part of the function for the purpose of debug info. This provides a better debugging experience, among other things by allowing a debug info client to correctly look up a function in debug info given a function pointer. llvm-svn: 193042
* Emit DWARF line entries for all data in the instruction stream.Peter Collingbourne2013-10-202-6/+20
| | | | | | | r182712 attempted to do this, but it failed to handle data emitted via EmitBytes. llvm-svn: 193041
* Add a missing getMostRecentDecl to ClassTemplateDecl.Rafael Espindola2013-10-191-0/+8
| | | | llvm-svn: 193040
* Simplify some implementations of get*Decl.Rafael Espindola2013-10-197-33/+45
| | | | | | | | | | * NamedDecl and CXXMethodDecl were missing getMostRecentDecl. * The const version can just forward to the non const. * getMostRecentDecl can use cast instead of cast_or_null. This then removes some casts from the callers. llvm-svn: 193039
* Remove unused variable.Benjamin Kramer2013-10-191-2/+1
| | | | llvm-svn: 193038
* This should use the possessive adjective.Rafael Espindola2013-10-192-2/+2
| | | | | | Thanks to David Blaikie for noticing it. llvm-svn: 193037
* Comment improvement.Rafael Espindola2013-10-192-2/+2
| | | | | | Thanks to Sean Silva for the suggestion. llvm-svn: 193036
* Perform an intelligent splice of the predecessor with the single successor.Bill Wendling2013-10-192-1/+57
| | | | | | | | If the predecessor's being spliced into a landing pad, then we need the PHIs to come first and the rest of the predecessor's code to come *after* the landing pad instruction. llvm-svn: 193035
* Avoid duplicate search by reusing the iterator.Yaron Keren2013-10-192-5/+7
| | | | llvm-svn: 193034
* Added comments from Andrew Kaylor.Yaron Keren2013-10-191-0/+21
| | | | llvm-svn: 193033
* Add irreader to the component list, because ParseIR is called.Bill Wendling2013-10-191-2/+2
| | | | llvm-svn: 193032
* Remove NDBEUG from all release types compile flags.Yaron Keren2013-10-191-2/+7
| | | | llvm-svn: 193031
* Simplify WinLinkDriver. No functionality change.Rui Ueyama2013-10-191-10/+5
| | | | llvm-svn: 193030
* Fix bug that CompareAtoms::compare is not transitive.Rui Ueyama2013-10-193-28/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a bug in r190608. The results of a comparison function passed to std::sort must be transitive, which is, if a < b and b < c, and if a != b, a < c must be also true. CompareAtoms::compare did not actually guarantee the transitivity. As a result the sort results were sometimes just wrong. Consider there are three atoms, X, Y, and Z, whose file ordinals are 1, 2, 3, respectively. Z has a property "layout-after X". In this case, all the following conditionals become true: X < Y because X's ordinal is less than Y's Y < Z because Y's ordinal is less than Z's Z < X because of the layout-after relationship This is not of course transitive. The reason why this happened is because we used follow-on relationships for comparison if two atoms falls in the same follow-on chain, but we used each atom's properties if they did not. This patch fixes the issue by using follow-on root atoms for comparison to get consistent results. Differential Revision: http://llvm-reviews.chandlerc.com/D1980 llvm-svn: 193029
* Reduce indentation with an early exit.Rafael Espindola2013-10-191-23/+24
| | | | llvm-svn: 193028
* Add isFirstDecl to DecBase too and use it instead of getPreviousDecl() == 0.Rafael Espindola2013-10-197-10/+21
| | | | | | Redeclarable already had a isFirstDecl, but it was missing from DeclBase. llvm-svn: 193027
* Fix typo.Rafael Espindola2013-10-191-1/+1
| | | | llvm-svn: 193026
* Simplify FunctionDecl::getBody.Rafael Espindola2013-10-191-9/+5
| | | | llvm-svn: 193025
* Reformat.Eric Christopher2013-10-191-80/+73
| | | | llvm-svn: 193024
* Fix up a few minor performance problems spotted in code review.Eric Christopher2013-10-191-7/+6
| | | | llvm-svn: 193023
* When building ubsan, link in ubsan parts first and sanitizer-common second, toNick Lewycky2013-10-192-22/+25
| | | | | | | pick up the common bits ubsan actually needs. Also remove whole-archive when we aren't trying to re-export the symbols. llvm-svn: 193022
* Update PPC loop tests after SCEV non-unit-stride checkin r193015.Andrew Trick2013-10-192-24/+12
| | | | llvm-svn: 193021
* Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.Kaelyn Uhrain2013-10-1912-44/+113
| | | | | | | | | | | Now that CorrectTypo knows how to correctly search classes for typo correction candidates, there is no good reason to only replace an existing CXXScopeSpecifier if it refers to a namespace. While the actual enablement was a matter of changing a single comparison, the fallout from enabling the functionality required a lot more code changes (including my two previous commits). llvm-svn: 193020
* Be smarter about deciding to add a leading '::' to aKaelyn Uhrain2013-10-193-30/+57
| | | | | | NestedNameSpecifier that replaces an existing specifier. llvm-svn: 193019
* Merge NamespaceSpecifierSet's AddNamespace and AddRecord as they areKaelyn Uhrain2013-10-191-75/+9
| | | | | | essentially the same. llvm-svn: 193018
* [PECOFF] Only COMDAT symbols are allowed to be dead-stripped.Rui Ueyama2013-10-183-11/+24
| | | | | | | | | | | | | | | | | | We should dead-strip atoms only if they are created for COMDAT symbols. If we remove non-COMDAT atoms from a binary, it will no longer be guaranteed that the binary will work correctly. In COFF, you can manipulate the order of section contents in the resulting binary by section name. For example, if you have four sections .data$unique_prefix_{a,b,c,d}, it's guaranteed that the contents of A, B, C, and D will be consecutive in the resulting .data section in that order. Thus, you can access B's and C's contents by incrementing a pointer pointing to A until it reached to D. That's why we cannot dead-strip B or C even if no one is directly referencing to them. Some object files in the standard library actually use that technique. llvm-svn: 193017
* ValueObject and SBValue's GetChildMemberWithName should look through ↵Jim Ingham2013-10-182-1/+54
| | | | | | | | | | anonymous structs and unions the same way that C would. <rdar://problem/11987906> llvm-svn: 193016
* SCEV should use NSW to get trip count for positive nonunit stride loops.Andrew Trick2013-10-182-36/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SCEV currently fails to compute loop counts for nonunit stride loops. This comes up frequently. It prevents loop optimization and forces vectorization to insert extra loop checks. For example: void foo(int n, int *x) { for (int i = 0; i < n; i += 3) { x[i] = i; x[i+1] = i+1; x[i+2] = i+2; } } We need to properly handle the case in which limit > INT_MAX-stride. In the above case: n > INT_MAX-3. In this case the loop counter will step beyond the limit and overflow at the same time. However, knowing that signed integer overlow in undefined, we can assume the loop test behavior is arbitrary after overflow. This obeys both C undefined behavior rules, and the more strict LLVM poison value rules. I'm finally fixing this in response to Hal Finkel's persistence. The most probable reason that we never optimized this before is that we were being careful to handle case where the developer expected a side-effect free infinite loop relying on overflow: for (int i = 0; i < n; i += s) { ++j; } return j; If INT_MAX+1 is a multiple of s and n > INT_MAX-s, then we might expect an infinite loop. However there are plenty of ways to achieve this effect without relying on undefined behavior of signed overflow. llvm-svn: 193015
* Write a simple description of the 'target triple' directive. This should be ↵Bill Wendling2013-10-181-0/+24
| | | | | | expanded. PR8976. llvm-svn: 193014
OpenPOWER on IntegriCloud