summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] Teach ConstraintManager to ignore NonLoc <> NonLoc comparisons.Jordan Rose2013-03-242-2/+18
| | | | | | | | | These aren't generated by default, but they are needed when either side of the comparison is tainted. Should fix our internal buildbot. llvm-svn: 177846
* Simplify code. No functionality change.Benjamin Kramer2013-03-241-20/+7
| | | | llvm-svn: 177842
* Reject -no-integrated-as on windows.Rafael Espindola2013-03-247-21/+27
| | | | llvm-svn: 177840
* Generate metadata to implement the -cl-kernel-arg-info option.Guy Benyei2013-03-244-12/+134
| | | | | | OpenCL 1.2 spec. 5.7.3. llvm-svn: 177839
* Don't actually invoke codegen in driver test.Benjamin Kramer2013-03-241-2/+2
| | | | llvm-svn: 177838
* Make clang to mark static stack allocations with lifetime markers to enable ↵Nadav Rotem2013-03-239-21/+180
| | | | | | | | | a more aggressive stack coloring. Patch by John McCall with help by Shuxin Yang. rdar://13115369 llvm-svn: 177819
* Revert svn r176894 and r177658.Bob Wilson2013-03-232-21/+10
| | | | | | | | | | | Changing -ccc-install-dir to affect cc1's resource-dir setting broke our internal LNT tests. After discussing the situation with Jim, we've decided to pursue an alternate approach. We really want the resource-dir to be located relative to clang, even when using -ccc-install-dir, but we're going to add a fallback setting for the libc++ headers if they don't exist alongside the compiler. llvm-svn: 177815
* Under ARC, when we're passing the address of a strong variableJohn McCall2013-03-239-29/+129
| | | | | | | | | | | | to an out-parameter using the indirect-writeback conversion, and we copied the current value of the variable to the temporary, make sure that we register an intrinsic use of that value with the optimizer so that the value won't get released until we have a chance to retain it. rdar://13195034 llvm-svn: 177813
* Strip off local qualifiers when converting from RecordType toRichard Trieu2013-03-233-25/+41
| | | | | | | TemplateSpecializationType during template type diffing. This allows the correct printing of diffing qualifiers on templates. llvm-svn: 177809
* [analyzer] Teach constraint managers about unsigned comparisons.Jordan Rose2013-03-236-23/+185
| | | | | | | | | | | In C, comparisons between signed and unsigned numbers are always done in unsigned-space. Thus, we should know that "i >= 0U" is always true, even if 'i' is signed. Similarly, "u >= 0" is also always true, even though '0' is signed. Part of <rdar://problem/13239003> (false positives related to std::vector) llvm-svn: 177806
* [analyzer] Loc-Loc operations (subtraction or comparison) produce a NonLoc.Jordan Rose2013-03-232-8/+8
| | | | | | | | | | For two concrete locations, we were producing another concrete location and then casting it to an integer. We should just create a nonloc::ConcreteInt to begin with. No functionality change. llvm-svn: 177805
* [analyzer] CmpRuns.py: Accept single files as input.Jordan Rose2013-03-231-46/+51
| | | | | | | | This allows us to compare two direct invocations of the analyzer on a single source file without having to wrap the output plists in their own directories. llvm-svn: 177804
* [analyzer] Also transform "a < b" to "(b - a) > 0" in the constraint manager.Jordan Rose2013-03-232-15/+61
| | | | | | | | | | | | We can support the full range of comparison operations between two locations by canonicalizing them as subtraction, as in the previous commit. This won't work (well) if either location includes an offset, or (again) if the comparisons are not consistent about which region comes first. <rdar://problem/13239003> llvm-svn: 177803
* Add reverseComparisonOp and negateComparisonOp to BinaryOperator.Jordan Rose2013-03-233-46/+32
| | | | | | ...and adopt them in the analyzer. llvm-svn: 177802
* [analyzer] Translate "a != b" to "(b - a) != 0" in the constraint manager.Jordan Rose2013-03-234-23/+101
| | | | | | | | | | | | | | | | | | | | | | | Canonicalizing these two forms allows us to better model containers like std::vector, which use "m_start != m_finish" to implement empty() but "m_finish - m_start" to implement size(). The analyzer should have a consistent interpretation of these two symbolic expressions, even though it's not properly reasoning about either one yet. The other unfortunate thing is that while the size() expression will only ever be written "m_finish - m_start", the comparison may be written "m_finish == m_start" or "m_start == m_finish". Right now the analyzer does not attempt to canonicalize those two expressions, since it doesn't know which length expression to pick. Doing this correctly will probably require implementing unary minus as a new SymExpr kind (<rdar://problem/12351075>). For now, the analyzer inverts the order of arguments in the comparison to build the subtraction, on the assumption that "begin() != end()" is written more often than "end() != begin()". This is purely speculation. <rdar://problem/13239003> llvm-svn: 177801
* [analyzer] Use SymExprs to represent '<loc> - <loc>' and '<loc> == <loc>'.Jordan Rose2013-03-232-17/+34
| | | | | | | | | | We just treat this as opaque symbols, but even that allows us to handle simple cases where the same condition is tested twice. This is very common in the STL, which means that any project using the STL gets spurious errors. Part of <rdar://problem/13239003>. llvm-svn: 177800
* documentation parsing: when providing code completion commentFariborz Jahanian2013-03-232-2/+29
| | | | | | | for a getter used in property-dot syntax, if geter has its own comment use it. // rdar://12791315 llvm-svn: 177797
* [analyzer] Warn when a nil key or value are passed to NSMutableDictionary ↵Anna Zaks2013-03-232-22/+136
| | | | | | and ensure it works with subscripting. llvm-svn: 177789
* [analyzer] Correct the stale comment.Anna Zaks2013-03-231-3/+3
| | | | llvm-svn: 177788
* If a .syms file is available alongside a sanitizer runtime, pass it to theRichard Smith2013-03-2313-9/+33
| | | | | | | | linker via --dynamic-list instead of using --export-dynamic. This reduces the size of the dynamic symbol table, and thus of the binary (in some cases by up to ~30%). llvm-svn: 177783
* Use RequireCompleteType() instead of isIncompleteType().Bill Wendling2013-03-222-2/+11
| | | | | | | | | | | | isIncompleteType() returns true or false for template types depending on whether the type is instantiated yet. In this context, that's arbitrary. The better way to check for a complete type is RequireCompleteType(). Thanks to Eli Friedman for noticing this! <rdar://problem/12700799> llvm-svn: 177768
* Add test case for PR 12921.Ted Kremenek2013-03-221-0/+19
| | | | llvm-svn: 177767
* <rdar://problem/13479539> Only rebuild the global module cache when we're ↵Douglas Gregor2013-03-221-1/+2
| | | | | | | | allowed to. This eliminates excessive rebuilds of the global module cache. llvm-svn: 177766
* Revert "[analyzer] Break cycles (optionally) when trimming an ExplodedGraph."Jordan Rose2013-03-223-24/+4
| | | | | | | | | | | | | | The algorithm used here was ridiculously slow when a potential back-edge pointed to a node that already had a lot of successors. The previous commit makes this feature unnecessary anyway. This reverts r177468 / f4cf6b10f863b9bc716a09b2b2a8c497dcc6aa9b. Conflicts: lib/StaticAnalyzer/Core/BugReporter.cpp llvm-svn: 177765
* [analyzer] Use a forward BFS instead of a reverse BFS to find shortest paths.Jordan Rose2013-03-221-150/+93
| | | | | | | | | | | | | | | | | | | | | | | | | For a given bug equivalence class, we'd like to emit the report with the shortest path. So far to do this we've been trimming the ExplodedGraph to only contain relevant nodes, then doing a reverse BFS (starting at all the error nodes) to find the shortest paths from the root. However, this is fairly expensive when we are suppressing many bug reports in the same equivalence class. r177468-9 tried to solve this problem by breaking cycles during graph trimming, then updating the BFS priorities after each suppressed report instead of recomputing the whole thing. However, breaking cycles is not a cheap operation because an analysis graph minus cycles is still a DAG, not a tree. This fix changes the algorithm to do a single forward BFS (starting from the root) and to use that to choose the report with the shortest path by looking at the error nodes with the lowest BFS priorities. This was Anna's idea, and has the added advantage of requiring no update step: we can just pick the error node with the next lowest priority to produce the next bug report. <rdar://problem/13474689> llvm-svn: 177764
* [analyzer] Fix test to actually test what was intended.Jordan Rose2013-03-221-2/+2
| | | | llvm-svn: 177763
* [analyzer] Fix ExprEngine::ViewGraph to handle C++ initializers.Jordan Rose2013-03-222-40/+59
| | | | | | Debugging aid only, no functionality change. llvm-svn: 177762
* [PCH/Modules] De/Serialize MacroInfos separately than MacroDirectives.Argyrios Kyrtzidis2013-03-2210-336/+600
| | | | | | | | | -Serialize the macro directives history into its own section -Get rid of the macro updates section -When de/serializing an identifier from a module, associate only one macro per submodule that defined+exported it. llvm-svn: 177761
* [modules] When a MacroInfo object is deserialized, allocate and store its ↵Argyrios Kyrtzidis2013-03-225-2/+43
| | | | | | submodule ID. llvm-svn: 177760
* [ms-cxxabi] Implement member data pointers for non-dynamic classesReid Kleckner2013-03-224-10/+181
| | | | | | | | | | | | | | | | | | | | Summary: For non-dynamic classes (no virtual bases), member data pointers are simple offsets from the base of the record. Dynamic classes use an aggregate for member data pointers and are therefore currently unsupported. Unlike Itanium, the ms ABI uses 0 to represent null for polymorphic classes. Non-polymorphic classes use -1 like Itanium, since 0 is a valid field offset. Reviewers: rjmccall CC: timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D558 llvm-svn: 177753
* <rdar://problem/13479539> Simplify ModuleManager/GlobalModuleIndex ↵Douglas Gregor2013-03-225-175/+76
| | | | | | | | | | | | | | interaction to eliminate a pile of extraneous stats(). The refactoring in r177367 introduced a serious performance bug where the "lazy" resolution of module file names in the global module index to actual module file entries in the module manager would perform repeated negative stats(). The new interaction requires the module manager to inform the global module index when a module file has been loaded, eliminating the extraneous stat()s and a bunch of bookkeeping on both sides. llvm-svn: 177750
* documentation parsing. Provide code completion comment Fariborz Jahanian2013-03-223-0/+19
| | | | | | | | for self.GetterName where GetterName is the getter method for a property with name different from the property name (declared via a property getter attribute) // rdar://12791315 llvm-svn: 177744
* These tests fail on our Window64 machine.Fariborz Jahanian2013-03-225-0/+5
| | | | | | | Feel free to revert them (or let me know and I will revert) if they shouldn't be. llvm-svn: 177743
* Better fix for r177725.Daniel Jasper2013-03-223-7/+5
| | | | | | | | | | | | It turns out that -foo; can be an objective C method declaration. So instead of the previous solution, recognize objective C methods only if we are in a declaration scope. llvm-svn: 177740
* Align comments to surrounding unformatted comments.Daniel Jasper2013-03-222-3/+33
| | | | | | | | | | | | | | | Before: int a; // not formatted // formatting this line only After: int a; // not formatted // formatting this line only This makes clang-format stable independent of whether the whole file or single lines are formatted in most cases. llvm-svn: 177739
* [cxxabi] Get ptrdiff_t from the CodeGenModule instead of caching itReid Kleckner2013-03-221-32/+16
| | | | | | As the comment says, it's a little silly to cache it in the ABI code. llvm-svn: 177738
* Update docs after moving clang-format from clang-tools-extra to cfe.Daniel Jasper2013-03-221-10/+9
| | | | llvm-svn: 177729
* Add clang-format to the corresponding Makefile.Daniel Jasper2013-03-221-1/+1
| | | | llvm-svn: 177727
* More precisely recognize ObjC method declarations.Daniel Jasper2013-03-222-3/+7
| | | | | | | | | Otherwise, +/- and the beginning of constants can be recognized incorrectly. Before: #define A - 1 After: #define A -1 llvm-svn: 177725
* Documentation: fix a typo and formattingDmitri Gribenko2013-03-221-2/+2
| | | | llvm-svn: 177722
* Fix DeclRefExpr::getFoundDecl() for usages by reference.Daniel Jasper2013-03-223-8/+23
| | | | llvm-svn: 177721
* Make clang-format understand more line comments.Daniel Jasper2013-03-222-0/+2
| | | | | | | | | | | Apparently one needs to set LangOptions.LineComment. Before "//* */" got reformatted to "/ /* */" as the lexer was returning the token sequence (slash, comment). This could also lead to weird other stuff, e.g. for people that like to using comments like: //**************** llvm-svn: 177720
* Add future directions for modulesDouglas Gregor2013-03-221-0/+16
| | | | llvm-svn: 177707
* More modules documentation, including the straw-man import declaration ↵Douglas Gregor2013-03-221-28/+90
| | | | | | syntax and "how to modularize a platform". llvm-svn: 177706
* OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev2013-03-2244-4/+983
| | | | llvm-svn: 177705
* More documentation on the module map language.Douglas Gregor2013-03-222-5/+465
| | | | llvm-svn: 177704
* test commitAlexey Bataev2013-03-221-1/+1
| | | | llvm-svn: 177701
* Warn about attempts to reinterpret_cast between two types that areJohn McCall2013-03-224-2/+330
| | | | | | | | hierarchy-related at a possibly nonzero offset. Patch by Alexander Zinenko! llvm-svn: 177698
* Fix a crash-on-valid where a block capture copy expression wasJohn McCall2013-03-228-5/+60
| | | | | | | | | | | | picking up cleanups from earlier in the statement. Also fix a crash-on-invalid where a reference to an invalid decl from an enclosing scope was causing an expression to fail to build, but only *after* a cleanup was registered from that statement, causing an assertion downstream. The crash-on-valid is rdar://13459289. llvm-svn: 177692
* ubsan: Pass floating-point arguments to the runtime by value if they fit theRichard Smith2013-03-222-2/+36
| | | | | | value argument. If not, be sure we don't accidentally use a dynamic alloca. llvm-svn: 177690
OpenPOWER on IntegriCloud