summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused argument.Rafael Espindola2013-03-184-17/+15
| | | | llvm-svn: 177287
* Fix clang-format segfault.Daniel Jasper2013-03-182-0/+4
| | | | | | | | When annotating "lines" starting with ":", clang-format would segfault. This could actually happen in valid code, e.g. #define A : llvm-svn: 177283
* ObjCDictionaryElements are pod-like.Benjamin Kramer2013-03-181-0/+6
| | | | llvm-svn: 177282
* Make sure to use same EABI version for external assembler as for integrated as.Anton Korobeynikov2013-03-182-1/+2
| | | | | | Patch by Andrew Turner! llvm-svn: 177252
* Generalize a few debug info test casesDavid Blaikie2013-03-173-3/+3
| | | | | | | | Checking for the annotation comment rather than the metadata values makes these tests resilient to a coming refactor that will pull these fields out into a separate metadata node. llvm-svn: 177237
* revert r177211 due to its potential issuesManman Ren2013-03-168-53/+16
| | | | llvm-svn: 177222
* [analyzer] Model trivial copy/move assignment operators with a bind as well.Jordan Rose2013-03-164-11/+141
| | | | | | | | | | | | r175234 allowed the analyzer to model trivial copy/move constructors as an aggregate bind. This commit extends that to trivial assignment operators as well. Like the last commit, one of the motivating factors here is not warning when the right-hand object is partially-initialized, which can have legitimate uses. <rdar://problem/13405162> llvm-svn: 177220
* Remove -Wspellcheck and replace it with a diagnostic option.Argyrios Kyrtzidis2013-03-168-8/+18
| | | | | | | Thanks to Richard S. for pointing out that the warning would show up with -Weverything. llvm-svn: 177218
* [analyzer] Separate graph trimming from creating the single-path graph.Jordan Rose2013-03-161-58/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we generate a path diagnostic for a bug report, we have to take the full ExplodedGraph and limit it down to a single path. We do this in two steps: "trimming", which limits the graph to all the paths that lead to this particular bug, and "creating the report graph", which finds the shortest path in the trimmed path to any error node. With BugReporterVisitor false positive suppression, this becomes more expensive: it's possible for some paths through the trimmed graph to be invalid (i.e. likely false positives) but others to be valid. Therefore we have to run the visitors over each path in the graph until we find one that is valid, or until we've ruled them all out. This can become quite expensive. This commit separates out graph trimming from creating the report graph, performing the first only once per bug equivalence class and the second once per bug report. It also cleans up that portion of the code by introducing some wrapper classes. This seems to recover most of the performance regression described in my last commit. <rdar://problem/13433687> llvm-svn: 177216
* [analyzer] Eliminate InterExplodedGraphMap class and NodeBackMap typedef.Jordan Rose2013-03-165-92/+50
| | | | | | | | | | | | | | | ...in favor of this typedef: typedef llvm::DenseMap<const ExplodedNode *, const ExplodedNode *> InterExplodedGraphMap; Use this everywhere the previous class and typedef were used. Took the opportunity to ArrayRef-ize ExplodedGraph::trim while I'm at it. No functionality change. llvm-svn: 177215
* [analyzer] Don't repeat a bug equivalence class if every report is invalid.Jordan Rose2013-03-161-3/+13
| | | | | | | | I removed this check in the recursion->iteration commit, but forgot that generatePathDiagnostic may be called multiple times if there are multiple PathDiagnosticConsumers. llvm-svn: 177214
* Exploit this-return of a callsite in a this-return function.Manman Ren2013-03-168-16/+53
| | | | | | | | | | | | | For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. rdar://12818789 llvm-svn: 177211
* Improve template diffing handling of default integer values.Richard Trieu2013-03-154-24/+145
| | | | | | | | | | When the template argument is both default and value dependent, the expression retrieved for the default argument cannot be evaluated, thus never matching any argument value. To get the proper value, get the template argument from the desugared template specialization. Also, output the original expression to provide more information about the argument mismatch. llvm-svn: 177209
* [analyzer] Address a TODO in the StreamChecker; otherwise the output is ↵Anna Zaks2013-03-151-2/+1
| | | | | | non-deterministic. llvm-svn: 177207
* [analyzer] Use isLiveRegion to determine when SymbolRegionValue is dead.Anna Zaks2013-03-153-20/+39
| | | | | | | | | | Fixes a FIXME, improves dead symbol collection, suppresses a false positive, which resulted from reusing the same symbol twice for simulation of 2 calls to the same function. Fixing this lead to 2 possible false negatives in CString checker. Since the checker is still alpha and the solution will not require revert of this commit, move the tests to a FIXME section. llvm-svn: 177206
* [analyzer] BugReporterVisitors: handle the case where a ternary operator is ↵Anna Zaks2013-03-152-8/+22
| | | | | | wrapped in a cast. llvm-svn: 177205
* [analyzer] Address Jordan’s review of r177138 (a micro optimization)Anna Zaks2013-03-151-5/+8
| | | | llvm-svn: 177204
* Fix buffer underrun (invalid read) triggered during diagnostic rendering. ↵Ted Kremenek2013-03-151-1/+1
| | | | | | | | | | | | | The test would overflow when computing '0 - 1'. I don't have a good testcase for this that does not depend on system headers. It did not trigger with preprocessed output, and I had trouble reducing the example. Fixes <rdar://problem/13324594>. Thanks to Michael Greiner for reporting this issue. llvm-svn: 177201
* [modules] Don't record the macros from the predefines buffer.Argyrios Kyrtzidis2013-03-151-1/+24
| | | | | | | These will be available in the current translation unit anyway, for modules they only waste space and deserialization time. llvm-svn: 177197
* <rdar://problem/13426257> Introduce SDKSettings.plist as an input file ↵Douglas Gregor2013-03-152-16/+50
| | | | | | | | | | | | | | | dependency for PCH/modules. When we're building a precompiled header or module against an SDK on Darwin, there will be a file SDKSettings.plist in the sysroot. Since stat()'ing every system header on which a module or PCH file depends is performance suicide, we instead stat() just SDKSettings.plist. This hack works well on Darwin; it's unclear how we want to handle this on other platforms. If there is a canonical file, we should use it; if not, we either have to take the performance hit of stat()'ing system headers repeatedly or roll the dice by not checking anything. llvm-svn: 177194
* Simplify print logic, per feedback from Jordan Rose.Ted Kremenek2013-03-151-1/+1
| | | | llvm-svn: 177193
* Enhance -Wtautological-constant-out-of-range-compare to include the name of ↵Ted Kremenek2013-03-154-20/+33
| | | | | | | | the enum constant. This is QoI. Fixes <rdar://problem/13076064>. llvm-svn: 177190
* [analyzer] Make GRBugReporter::generatePathDiagnostic iterative, not recursive.Jordan Rose2013-03-151-112/+103
| | | | | | | | | | | | | | | | | | The previous generatePathDiagnostic() was intended to be tail-recursive, restarting and trying again if a report was marked invalid. However: (1) this leaked all the cloned visitors, which weren't being deleted, and (2) this wasn't actually tail-recursive because some local variables had non-trivial destructors. This was causing us to overflow the stack on inputs with large numbers of reports in the same equivalence class, such as sqlite3.c. Being iterative at least prevents us from blowing out the stack, but doesn't solve the performance issue: suppressing thousands (yes, thousands) of paths in the same equivalence class is expensive. I'm looking into that now. <rdar://problem/13423498> llvm-svn: 177189
* [analyzer] Collect stats on the max # of bug reports in an equivalence class.Jordan Rose2013-03-151-0/+15
| | | | | | | | | | | | | | We discovered that sqlite3.c currently has 2600 reports in a single equivalence class; it would be good to know if this is a recent development or what. (For the curious, the different reports in an equivalence class represent the same bug found along different paths. When we're suppressing false positives, we need to go through /every/ path to make sure there isn't a valid path to a bug. This is a flaw in our after-the-fact suppression, made worse by the fact that that function isn't particularly optimized.) llvm-svn: 177188
* [analyzer] Include opcode in dumping a SymSymExpr.Jordan Rose2013-03-151-34/+15
| | | | | | For debugging use only; no functionality change. llvm-svn: 177187
* [analyzer] Look through ExprWhenCleanups when trying to track a NULL.Jordan Rose2013-03-152-6/+43
| | | | | | Silences a few false positives in LLVM. llvm-svn: 177186
* Add some assertions to appease the static analyzer.Jordan Rose2013-03-152-2/+2
| | | | | | No functionality change. llvm-svn: 177185
* Remove unnecessary default in covered switch over enumDavid Blaikie2013-03-151-1/+0
| | | | | | This cleans up the Clang -Werror build that was broken by r177180. llvm-svn: 177184
* [AST] Add a fast path to ConstantArrayType::getNumAddressingBits().Daniel Dunbar2013-03-151-3/+22
| | | | | | | | | | - This fast path is almost 100% effective on real code, and lets us avoid multiple allocations of 128-bit APSInt objects in the common case. - As with any overflow-check-skipping-code, I'd appreciate someone double checking my logic. llvm-svn: 177183
* c: perform integer overflow check on all binaryFariborz Jahanian2013-03-151-12/+1
| | | | | | operations. // rdar://13423975 llvm-svn: 177181
* Refactor template diffing to store an enum that records which type ofRichard Trieu2013-03-151-89/+88
| | | | | | | difference is stored inside a DiffNode. This should not change any diagnostic messages. llvm-svn: 177180
* ClangTool output cleanupEdwin Vane2013-03-152-9/+13
| | | | | | | | | | Information messages sent to stdout by ClangTool now only happen when the -debug flag is set. Error messages that used to go to stdout now go to stderr. Author: Ariel J Bernal <ariel.j.bernal@intel.com> llvm-svn: 177177
* Revert "Remove a pointless assertion."Bob Wilson2013-03-151-1/+5
| | | | | | | | | This reverts commit r177158. I'm blindly reverting this because it appears to be breaking numerous buildbots. I'll reapply if it doesn't turn out to be the culprit. llvm-svn: 177165
* Force column info only for direct inlined functions. This should strikeAdrian Prantl2013-03-152-4/+23
| | | | | | | | | | the balance between expected behavior and compatibility with the gdb testsuite. (GDB gets confused if we break an expression into multiple debug stmts so we enable this behavior only for inlined functions. For the full experience people can still use -gcolumn-info.) llvm-svn: 177164
* c: Also chek for integer overflow for '%' operator.Fariborz Jahanian2013-03-152-2/+11
| | | | llvm-svn: 177163
* c: add the missing binary operatory when checkingFariborz Jahanian2013-03-152-1/+4
| | | | | | for integer overflow. // rdar://13423975 llvm-svn: 177162
* Take in account the triplet 'powerpc-linux-gnuspe' for PowerPC SPE. Done for ↵Sylvestre Ledru2013-03-151-0/+3
| | | | | | the port of Debian on this arch. More information on: http://wiki.debian.org/PowerPCSPEPort Patch by Roland Stigge llvm-svn: 177161
* Remove a pointless assertion.Nico Weber2013-03-151-5/+1
| | | | | | | | | FindNodeOrInsertPos() is called 10 lines earlier already, and the function early-returns there if the result is != 0. InsertPos isn't recomputed after that check, so this assert is always trivially true. (And it has nothing to do with if T is canonical or not.) llvm-svn: 177158
* Improve formatting of chained calls.Daniel Jasper2013-03-152-8/+26
| | | | | | | | | | | | | | | | clang-format already prevented sequences like: ... SomeParameter).someFunction( ... as those are quite confusing. This failed on: ... SomeParameter).someFunction(otherFunction( ... Fixed in this patch. llvm-svn: 177157
* Indent all lines in a multi-line comment by the same amount.Alexander Kornienko2013-03-152-27/+33
| | | | | | | | | | | | | | | | Summary: Do this to avoid spoling nicely formatted multi-line comments (e.g. with code examples or similar stuff). Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D544 llvm-svn: 177153
* Fixup for r176934. More careful setup of path to llvm-symbolizerAlexey Samsonov2013-03-152-7/+8
| | | | llvm-svn: 177145
* [analyzer] Refactor checks in IDC visitor for consistency and speedAnna Zaks2013-03-151-6/+6
| | | | llvm-svn: 177138
* [analyzer] Teach trackNullOrUndef to look through ternary operatorsAnna Zaks2013-03-152-3/+50
| | | | | | Allows the suppression visitors trigger more often. llvm-svn: 177137
* PR15290: 'this' is not permitted in the declaration of a friend function,Richard Smith2013-03-152-4/+23
| | | | | | | therefore references to members should not be transformed into implicit uses of 'this'. Patch by Ismail Pazarbasi! llvm-svn: 177134
* Silence anonymous type in anonymous union warnings.Eric Christopher2013-03-159-148/+173
| | | | llvm-svn: 177133
* Diagnose about extern "C" functions returning c++ objectsFariborz Jahanian2013-03-142-2/+38
| | | | | | on first declaration only. // rdar://13364028 llvm-svn: 177127
* Don't try to typo-correct 'super' in an objc method.Argyrios Kyrtzidis2013-03-146-2/+45
| | | | | | | | | | | | | | | | | | | | | This created 2 issues: 1) Performance issue, since typo-correction with PCH/modules is rather expensive. 2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would be emitted, like this: 3.m:8:3: error: unknown type name 'super'; did you mean 'super1'? super.x = 0; ^~~~~ super1 t3.m:5:13: note: 'super1' declared here typedef int super1; ^ t3.m:8:8: error: expected identifier or '(' super.x = 0; ^ llvm-svn: 177126
* Add a testcase for r177118.Adrian Prantl2013-03-141-1/+2
| | | | llvm-svn: 177124
* [analyzer] Change the way in which IDC Visitor decides to kick in and make ↵Anna Zaks2013-03-143-33/+42
| | | | | | | | | | | | | sure it attaches in the given edge case In the test case below, the value V is not constrained to 0 in ErrorNode but it is in node N. So we used to fail to register the Suppression visitor. We also need to change the way we determine that the Visitor should kick in because the node N belongs to the ExplodedGraph and might not be on the BugReporter path that the visitor sees. Instead of trying to match the node, turn on the visitor when we see the last node in which the symbol is ‘0’. llvm-svn: 177121
* Always declare the .block_descriptor parameter, not just the local copy.Adrian Prantl2013-03-141-9/+10
| | | | | | Un-breaks gdb's invoke-block behavior. llvm-svn: 177118
OpenPOWER on IntegriCloud