aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2013-04-30Objective-C (mostly arc): Under ARC, we often have unneeded qualifiers Fariborz Jahanian
in the diagnostics. Remove them when reporting incompatible Objective-C pointer types. // rdar://13752880. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180765 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Revert "[analyzer] Change PathPieces to be a wrapper around an ilist of ↵Ted Kremenek
(through indirection) PathDiagnosticPieces." Jordan rightly pointed out that we can do the same with std::list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180746 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29[analyzer] Change PathPieces to be a wrapper around an ilist of (through ↵Ted Kremenek
indirection) PathDiagnosticPieces. Much of this patch outside of PathDiagnostics.h are just minor syntactic changes due to the return type for operator* and the like changing for the iterator, so the real focus should be on PathPieces itself. This change is motivated so that we can do efficient insertion and removal of individual pieces from within a PathPiece, just like this was a kind of "IR" for static analyzer diagnostics. We currently implement path transformations by iterating over an entire PathPiece and making a copy. This isn't very natural for some algorithms. We use an ilist here instead of std::list because we want operations to rip out/insert nodes in place, just like IR manipulation. This isn't being used yet, but opens the door for more powerful transformation algorithms on diagnostic paths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180741 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29[analyzer] Remove comparePath's dependency on subscript operator.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Emit the TLS intialization functions into a list.Bill Wendling
Add the TLS initialization functions to a list of initialization functions. The back-end takes this list and places the function pointers into the correct section. This way they're called before `main().' <rdar://problem/13733006> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29c language: diagnose use of "[*]" on any array dimensionFariborz Jahanian
in the parameter of a function definition. Currently, it crashes in irgen if it is on other than the 1st dimension. // rdar://13705391 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180732 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Use ArrayRef in AddMethodCandidate.Rafael Espindola
Patch by Robert Wilhelm! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180724 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29When emitting a preprocessed file with implicit module imports, make sure ↵Argyrios Kyrtzidis
line directives are emitted in the next line. rdar://13722737 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180718 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Revert "[analyzer] Model casts to bool differently from other numbers."Jordan Rose
This seems to be causing quite a slowdown on our internal analyzer bot, and I'm not sure why. Needs further investigation. This reverts r180638 / 9e161ea981f22ae017b6af09d660bfc3ddf16a09. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180714 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Fix a typo in a parse assert.Fariborz Jahanian
Patch by Alex Denisov. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180712 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Small CapturedStmt improvementsBen Langmuir
Add a CapturedStmt.h similar to Lambda.h to reduce the typing required to get to the CapturedRegionKind enum. This also allows codegen to access this enum without including Sema/ScopeInfo.h. Also removes some duplicated code for capturing 'this' between CapturedStmt and Lambda. Differential Revision: http://llvm-reviews.chandlerc.com/D712 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180710 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Test commitBen Langmuir
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180709 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Keep the parser's template depth up to date when parsing local templates andRichard Smith
late-parsed templates. Patch by Faisal Vali! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180708 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Implement DR580: access checks for template parameters of a class template areRichard Smith
performed within the context of that class template. Patch by Ismail Pazarbasi! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180707 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Properly reenter multiple contexts when parsing a late-parsed function templateRichard Smith
within a dependent context. Patch by Will Wilson (+clang-format)! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180702 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29Fix an assertion failure / accepts-invalid in -fms-extensions mode. Don't buildRichard Smith
a dependent-scope id expression when a templated member function of a non-templated class references an unknown identifier, since instantiation won't rebuild it (and we can tell at parse time that it'll never work). Based on a patch by Faisal Vali! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180701 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27ArrayRef'ize Sema::ActOnEnumBody. No functionality change.Dmitri Gribenko
Patch by Robert Wilhelm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180682 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Silence a silly sign compare warning from GCC.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180673 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Exit early when $PWD isn't set. Remove unused unistd.h include.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Use LLVM's preferred current_path API instead of calling getcwd(3) directly.Benjamin Kramer
The existing code also failed to allocate a buffer for it so getcwd corrupted the stack. sys::fs::current_path takes care of the memory management. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180669 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27[driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN toChad Rosier
make the gdb tests and the Windows bots happy. The Path::GetCurrentDirectory API is not equivalent to ::getcwd(), so r180652 causes a gdb tests to fail. On the other hand, <sys/param.h> isn't defined on Windows systems, so that causes Windows builds to fail. rdar://12237559 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180661 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Fix the dangling pointer.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180658 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Struct-path aware TBAA: fix handling of may_alias attribute.Manman Ren
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180656 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Struct-path aware TBAA: change the format of TBAAStructType node.Manman Ren
We switch the order of offset and field type to make TBAAStructType node (name, parent node, offset) similar to scalar TBAA node (name, parent node). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180653 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27[driver] Use the llvm equivalent of getcwd(). Hopefully, this makes the WindowsChad Rosier
bots recover. rdar://12237559 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180652 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27Fix an assertion hit in Sema::CheckObjCMethodOverrides.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180651 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26documenttion parsing. Provide a c-index testFariborz Jahanian
and limit comment extraction to public c++ bases. // rdar://13647476 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180646 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26In the ASTImporter, when checking whether twoSean Callanan
structs are compatible, check whether the fields of the structs have the same name. This prevents erroneous coalescing of (in particular) anonymous structs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180644 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Move helper classes into anonymous namespaces.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180642 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[analyzer] An ObjC for-in loop runs 0 times if the collection is nil.Jordan Rose
In an Objective-C for-in loop "for (id element in collection) {}", the loop will run 0 times if the collection is nil. This is because the for-in loop is implemented using a protocol method that returns 0 when there are no elements to iterate, and messages to nil will result in a 0 return value. At some point we may want to actually model this message send, but for now we may as well get the nil case correct, and avoid the false positives that would come with this case. <rdar://problem/13744632> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180639 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[analyzer] Model casts to bool differently from other numbers.Jordan Rose
Casts to bool (and _Bool) are equivalent to checks against zero, not truncations to 1 bit or 8 bits. This improved reasoning does cause a change in the behavior of the alpha BoolAssignment checker. Previously, this checker complained about statements like "bool x = y" if 'y' was known not to be 0 or 1. Now it does not, since that conversion is well-defined. It's hard to say what the "best" behavior here is: this conversion is safe, but might be better written as an explicit comparison against zero. More usefully, besides improving our model of booleans, this fixes spurious warnings when returning the address of a local variable cast to bool. <rdar://problem/13296133> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180638 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[PCH/modules] Require the preprocessing record option to match the used PCH, ↵Argyrios Kyrtzidis
if modules are enabled. The preprocessing record becomes important when modules are enabled, since it is used to calculate the module cache hash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180635 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[Modules] Fix an issue where the reconstructed redeclaration chain was ↵Argyrios Kyrtzidis
incomplete, missing the definition from a module. -Make sure that a deserialized external decl gets added to the TU scope. -When associating an identifier with a set of decls, use the most recent local ones, if they exist, otherwise associating decls from modules (that came after a local one) will lead to an incomplete reconstructed re-declaration chain. rdar://13712705 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180634 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[frontend] Make -chain-include work when used with modules.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180633 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26ArrayRefize code. No functionality change.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180632 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26document parsing. When a sub-class (c++ Objective-C) missing Fariborz Jahanian
a comment, grab the first comment found in its class heirarchy. Also, when a category is mossing a comment, grab comment of its primary class. // rdar://13647476 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180629 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26[driver] Implement the -fdebug-compilation-dir in a way that is compatible withChad Rosier
gcc. No test case included as I'm having problems finding a test case where the inode/dev don't match. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180628 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Comment parsing: -fparse-all-comments: recognize empty line commentsDmitri Gribenko
In -fparse-all-comments mode empty '//' comments were recognized as RCK_Invalid, and were not merged with next and previous lines. Patch by Amin Shali. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Implement C++1y decltype(auto).Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26C++1y: support simple variable assignments in constexpr functions.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180603 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Support debug info for using directives at global/namespace scope.David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180594 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-26Add r180263 back, but fix hasBraces() to be correct during parsing.Rafael Espindola
Original commit message: Fix a case in linkage computation that should check for single line extern "C". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180591 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25Revert r180263. It's causing failures.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180583 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25Objective-C: This is a small modification to myFariborz Jahanian
patch -n r180198. When reporting on missing property accessor implementation in categories, do not report when they are declared in primary class, class's protocol, or one of it super classes or in of the other categories. // rdar://13713098 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180580 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25[analyzer] Teach DeadStoreChecker to look though BO_Comma and disregard the LHS.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180579 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25Put friend decls in the correct context.Rafael Espindola
When we find a friend declaration we have to skip transparent contexts for doing lookups, but we should not skip them when inserting the new decl if the lookup found nothing. Fixes PR15841. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180571 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25Fix header comment.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180268 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25Improve clang-format's memoization behavior.Daniel Jasper
Deeply nested expressions basically break clang-format's memoization. This patch slightly improves the situations and makes expressions like aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa( aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa( aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa( aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa(aaaaa( aaaaa(aaaaa()))))))))))))))))))))))))))))))))))))))); work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180264 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25Fix a case in linkage computation that should check for single line extern "C".Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180263 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25Don't mark 'extern "C" void f(void)' as having extern storage class.Rafael Espindola
Instead, we check for one line extern "C" context in linkage computation and when deciding if a variable is a definition. This hopefully completes the transition to having "as written" semantics for hasExternalStorage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180258 91177308-0d34-0410-b5e6-96231b3b80d8