summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Skip transparent contexts when looking for using directives in name lookup.Douglas Gregor2013-04-091-1/+5
| | | | | | Fixes the bootstrap regression I introduced in r179067. llvm-svn: 179079
* Mark as referenced the functions from instantiated UserDefinedLiterals.Argyrios Kyrtzidis2013-04-091-0/+2
| | | | | | Fixes rdar://13589856 llvm-svn: 179078
* [analyzer] Keep tracking the pointer after the escape to more aggressively ↵Anna Zaks2013-04-091-30/+43
| | | | | | | | | | | report mismatched deallocator Test that the path notes do not change. I don’t think we should print a note on escape. Also, I’ve removed a check that assumed that the family stored in the RefStete could be AF_None and added an assert in the constructor. llvm-svn: 179075
* Don't copy just to capture a strong block pointer under ARC.John McCall2013-04-081-7/+27
| | | | | | | | | It turns out that the optimizer can't eliminate this without extra information, for which there's a separate bug. rdar://13588325 llvm-svn: 179069
* <rdar://problem/13584715> Converted constant expressions are expected to ↵Douglas Gregor2013-04-081-1/+1
| | | | | | | | | | | | | | have integral values. We were assuming that any expression used as a converted constant expression would either not have a folded constant value or would be an integer, which is not the case for some ill-formed constant expressions. Because converted constant expressions are only used where integral values are expected, we can simply treat this as an error path. If that ever changes, we'll need to widen the interface of Sema::CheckConvertedConstantExpression() anyway. llvm-svn: 179068
* <rdar://problem/13540899> Collect using directives from all of the semantic ↵Douglas Gregor2013-04-081-8/+25
| | | | | | | | | | | | contexts not represented by scopes. This fixes a regression I introduced in r178136, where we would not consider the using directives from the semantic declaration contexts that aren't represented by the lexical scopes (Scope) when performing unqualified name lookup. This lead to horribly funny diagnostics like "no identifier named 'foo'; did you mean 'foo'?". llvm-svn: 179067
* Recognize function-like macro usages without semicolon in declaration context.Alexander Kornienko2013-04-081-9/+16
| | | | | | | | | | | | | | | | | | | | Summary: Preserve line breaks after function-like macro usages without semicolon, e.g.: QQQ(xxx) class X { }; Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D638 llvm-svn: 179064
* Fix typo in assertion.Nick Lewycky2013-04-081-1/+1
| | | | llvm-svn: 179061
* The PNaCl target no longer permits __attribute__((regparm)).Eli Bendersky2013-04-082-34/+16
| | | | | | | Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo and adjust tests accordingly. llvm-svn: 179059
* <rdar://problem/13559825> Further reduce template instantiation depth down ↵Douglas Gregor2013-04-081-1/+1
| | | | | | to 256, since we're blowing the stack for a trivial "factorial" class template. llvm-svn: 179057
* Fix PR15634, better error message for template deduction failure.Richard Trieu2013-04-081-4/+26
| | | | | | | | | | | | | When two template decls with the same name are used in this diagnostic, force them to print their qualified names. This changes the bad message of: candidate template ignored: could not match 'array' against 'array' to the better message of: candidate template ignored: could not match 'NS2::array' against 'NS1::array' llvm-svn: 179056
* <rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets ↵Douglas Gregor2013-04-082-15/+41
| | | | | | a non-variable iteration declaration. llvm-svn: 179053
* fix indentationAdrian Prantl2013-04-081-1/+1
| | | | llvm-svn: 179052
* Revamp indentation behavior for complex binary expressions.Daniel Jasper2013-04-083-43/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to indent according to operator precedence and pretty much identical to how stuff would be indented with parenthesis. Before: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; After: bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa == aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > ccccccccccccccccccccccccccccccccccccccccc; llvm-svn: 179049
* Thread safety analysis: turn on checking within lock and unlock functions.DeLesley Hutchins2013-04-082-12/+54
| | | | | | These checks are enabled with the -Wthread-safety-beta flag. llvm-svn: 179046
* <rdar://problem/13540921> Cope with instantiations of the C++11 range-based ↵Douglas Gregor2013-04-081-0/+14
| | | | | | for loop that end up being Objective-C fast enumeration loops. llvm-svn: 179037
* <rdar://problem/13540921> Cope with deduced 'auto' in a C++11 for-range loop ↵Douglas Gregor2013-04-081-0/+27
| | | | | | that is actually an Objective-C fast enumeration loop. llvm-svn: 179035
* Tweak warning text for nil value in ObjC container warning.Ted Kremenek2013-04-081-1/+1
| | | | llvm-svn: 179034
* <rdar://problem/12806802> Propagate access specifiers for conversion ↵Douglas Gregor2013-04-081-6/+12
| | | | | | | | | | | | | functions to the conversion function set eagerly. This slightly propagates an existing hack that delays when we provide access specifiers for the visible conversion functions of a class by copying the available access specifier early. The only client this affects is LLDB, which tends to discover and add conversion functions after the class is technically "complete". As such, the only observable difference is in LLDB, so the testing will go there. llvm-svn: 179029
* Revert accidental commit r179015.Daniel Jasper2013-04-083-43/+27
| | | | llvm-svn: 179016
* xDaniel Jasper2013-04-083-27/+43
| | | | llvm-svn: 179015
* Sema: Don't crash when trying to emit a warning for a duplicate value in an ↵Benjamin Kramer2013-04-071-1/+1
| | | | | | | | | invalid enum. Fixes PR15693. A null check on a pointer returned from cast<> is a very dubious construct, do we have a checker for this somewhere? llvm-svn: 178975
* Remove nondeterminism introduced in r178950.Richard Smith2013-04-062-11/+14
| | | | llvm-svn: 178952
* When an internal-linkage function or variable is declared within an extern "C"Richard Smith2013-04-062-0/+69
| | | | | | | | | | linkage specification, and is marked as __attribute__((used)), try to also give it the unmangled name (by emitting an internal linkage alias) if nothing else within the translation unit would use that name. This allows inline asm in that translation unit to use the entity via its unmangled name, which people apparently rely on. llvm-svn: 178950
* [analyzer] When creating a trimmed graph, preserve whether a node is a sink.Jordan Rose2013-04-061-1/+2
| | | | | | | | | | | | | | This is important because sometimes two nodes are identical, except the second one is a sink. This bug has probably been around for a while, but it wouldn't have been an issue in the old report graph algorithm. I'm ashamed to say I actually looked at this the first time around and thought it would never be a problem...and then didn't include an assertion to back that up. PR15684 llvm-svn: 178944
* [objcmt] Fix a mishandled conversion to objc directory literal.Argyrios Kyrtzidis2013-04-061-0/+2
| | | | | | rdar://13181413 llvm-svn: 178942
* <rdar://problem/13325066> Destroy std::initializer_list temporaries whose ↵Douglas Gregor2013-04-061-4/+20
| | | | | | lifetime has been extended by reference binding. llvm-svn: 178939
* [analyzer] Shorten the malloc checker’s leak messageAnna Zaks2013-04-061-2/+3
| | | | | | As per Ted’s suggestion! llvm-svn: 178938
* Rework how ObjC method inherit deprecated/availability.Ted Kremenek2013-04-062-2/+8
| | | | | | | | | | | | | | | | | | | | | New rule: - Method decls in @implementation are considered "redeclarations" and inherit deprecated/availability from the @interface. - All other cases are consider overrides, which do not inherit deprecated/availability. For example: (a) @interface redeclares a method in an adopted protocol. (b) A subclass redeclares a method in a superclass. (c) A protocol redeclares a method from another protocol it adopts. The idea is that API authors should have the ability to easily move availability/deprecated up and down a class/protocol hierarchy. A redeclaration means that the availability/deprecation is a blank slate. Fixes <rdar://problem/13574571> llvm-svn: 178937
* [analyzer] Reword error messages for nil keys and values of NSMutableDictionary.Anna Zaks2013-04-051-6/+17
| | | | llvm-svn: 178935
* [analyzer] Remove another redundancy from trackNullOrUndefAnna Zaks2013-04-051-6/+0
| | | | llvm-svn: 178934
* [analyzer] Fix null tracking for the given test case, by using the proper ↵Anna Zaks2013-04-051-18/+3
| | | | | | state and removing redundant code. llvm-svn: 178933
* When -Woverloaded-virtual is triggered, call HandleFunctionTypeMismatch to addRichard Trieu2013-04-051-1/+3
| | | | | | | more information to the notes. This information is already present on other diagnostic messages that involves overloads. llvm-svn: 178923
* Add an error to check that all program scope variables are in the constant ↵Tanya Lattner2013-04-051-0/+10
| | | | | | address space in OpenCL. llvm-svn: 178906
* [analyzer] Eliminates all the cases with unknown family.Anton Yartsev2013-04-051-6/+7
| | | | | | Now treat AF_None family as impossible in isTrackedFamily() llvm-svn: 178899
* [analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks).Jordan Rose2013-04-052-4/+8
| | | | | | | | As mentioned in the previous commit message, the use-after-free and double-free warnings for 'delete' are worth enabling even while the leak warnings still have false positives. llvm-svn: 178891
* [analyzer] Split new/delete checker into use-after-free and leaks parts.Jordan Rose2013-04-052-3/+18
| | | | | | | | | | | | This splits the leak-checking part of alpha.cplusplus.NewDelete into a separate user-level checker, alpha.cplusplus.NewDeleteLeaks. All the difficult false positives we've seen with the new/delete checker have been spurious leak warnings; the use-after-free warnings and mismatched deallocator warnings, while rare, have always been valid. <rdar://problem/6194569> llvm-svn: 178890
* Allow breaking after 'class' for classes with looong names.Daniel Jasper2013-04-051-1/+4
| | | | | | (Don't ask, this was a user request). llvm-svn: 178888
* Fix bad formatting of overloaded operator definitions.Daniel Jasper2013-04-051-1/+2
| | | | | | | | | | | | | | | | Before: bool operator< (const aaaaaaaaaaaaaaaaaaaaa &left, const aaaaaaaaaaaaaaaaaaaaa &right) { return left.group < right.group; } After: bool operator<(const aaaaaaaaaaaaaaaaaaaaa &left, const aaaaaaaaaaaaaaaaaaaaa &right) { return left.group < right.group; } llvm-svn: 178887
* Proper prefix for doxygen commentsEli Bendersky2013-04-051-3/+3
| | | | llvm-svn: 178878
* AArch64: bring predefines in line with most recent ACLE documentTim Northover2013-04-051-16/+16
| | | | | | | | | | | The prefixes and names used are now identical to 32-bit ARM, which is also expected to remain unchanged. If we made this change after a release, we'd probably have to support both variants for a while, but I think since AArch64 exists only on trunk now, it's acceptable to simply swap them now. llvm-svn: 178870
* [analyzer] Path notes for the MismatchedDeallocator checker.Anton Yartsev2013-04-051-4/+8
| | | | llvm-svn: 178862
* Improve formatting of multi-variable DeclStmts.Daniel Jasper2013-04-051-3/+12
| | | | | | | | | | | | | | | | | | | | This fixed llvm.org/PR15670 Before: aaaaaaaaa a = aaaaaaaaaaaaaaaaaaaa, b = bbbbbbbbbbbbbbbbbbbb, c = cccccccccccccccccccc, d = dddddddddddddddddddd; aaaaaaaaa *a = aaaaaaaaaaaaaaaaaaa, *b = bbbbbbbbbbbbbbbbbbb, *c = ccccccccccccccccccc, *d = ddddddddddddddddddd; After: aaaaaaaaa a = aaaaaaaaaaaaaaaaaaaa, b = bbbbbbbbbbbbbbbbbbbb, c = cccccccccccccccccccc, d = dddddddddddddddddddd; aaaaaaaaa *a = aaaaaaaaaaaaaaaaaaa, *b = bbbbbbbbbbbbbbbbbbb, *c = ccccccccccccccccccc, *d = ddddddddddddddddddd; llvm-svn: 178860
* Allow EmitConstantInit() to emit constant initializers for objects with ↵Alexey Samsonov2013-04-051-2/+1
| | | | | | trivial constructors and non-trivial destructors. Test that such objects are ignored by init-order checker. llvm-svn: 178856
* [analyzer] Check allocation family more precise.Anton Yartsev2013-04-051-4/+4
| | | | | | | | | The statement passed to isTrackedFamily() might be a user defined function calling malloc; in this case we got AF_NONE family for this function. Now the allocation family is derived from Sym, that holds a family of a real allocator. This commit is also a movement towards getting rid of tracking memory allocating by unknown means. llvm-svn: 178834
* [analyzer] Corrected the switch statement.Anton Yartsev2013-04-051-6/+3
| | | | llvm-svn: 178831
* [analyzer] Show path diagnostic for C++ initializersAnna Zaks2013-04-053-2/+17
| | | | | | Also had to modify the PostInitializer ProgramLocation to contain the field region. llvm-svn: 178826
* [analyzer] Fully-covered switch for families in isTrackedFamily()Anton Yartsev2013-04-051-7/+18
| | | | llvm-svn: 178820
* Add support for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{1,2,4,8} on x86.Michael J. Spencer2013-04-041-0/+8
| | | | | | This fixes std::thread with libstdc++. llvm-svn: 178816
* [analyzer] Reduced the unwanted correlations between checkers living inside ↵Anton Yartsev2013-04-041-89/+137
| | | | | | | | | | | | | MallocChecker.cpp This fixes an issue pointed to by Jordan: if unix.Malloc and unix.MismatchedDeallocator are both on, then we end up still tracking leaks of memory allocated by new. Moved the guards right before emitting the bug reports to unify and simplify the logic of handling of multiple checkers. Now all the checkers perform their checks regardless of if they were enabled, or not, and it is decided just before the emitting of the report, if it should be emitted. (idea from Anna). Additional changes: improved test coverage for checker correlations; refactoring: BadDealloc -> MismatchedDealloc llvm-svn: 178814
OpenPOWER on IntegriCloud