summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Don't try to set attributes in alias, they have none.Rafael Espindola2013-03-191-1/+3
| | | | llvm-svn: 177402
* Revert r177329.Rafael Espindola2013-03-191-2/+1
| | | | | | | | | If this should not happen, we should have an assert. If it should happen, we should have a test and remove the comment. In no case should we have this self inconsistent code. llvm-svn: 177399
* Go back to using the integrated assembler on windows ever when passedRafael Espindola2013-03-191-2/+3
| | | | | | -no-integrated-as. It is the only assembler we have there. llvm-svn: 177398
* [ASan] Make -fsanitize=address always imply -fsanitize=init-orderAlexey Samsonov2013-03-192-11/+9
| | | | llvm-svn: 177391
* Add a clarifying note when a return statement is rejected becauseJohn McCall2013-03-195-27/+116
| | | | | | | | we expect a related result type. rdar://12493140 llvm-svn: 177378
* Minor optimization to r177367 to treat a module with missing dependencies as ↵Douglas Gregor2013-03-191-1/+1
| | | | | | out-of-date rather than missing. llvm-svn: 177369
* Finish refactoring the tool selection logic.Rafael Espindola2013-03-194-48/+26
| | | | | | | | | The general pattern now is that Foobar::constructTool only creates tools defined in the tools::foobar namespace and then delegates to the parent. The remaining duplicated code is now in the tools themselves. llvm-svn: 177368
* <rdar://problem/13363214> Eliminate race condition between module rebuild ↵Douglas Gregor2013-03-197-286/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | and the global module index. The global module index was querying the file manager for each of the module files it knows about at load time, to prune out any out-of-date information. The file manager would then cache the results of the stat() falls used to find that module file. Later, the same translation unit could end up trying to import one of the module files that had previously been ignored by the module cache, but after some other Clang instance rebuilt the module file to bring it up-to-date. The stale stat() results in the file manager would trigger a second rebuild of the already-up-to-date module, causing failures down the line. The global module index now lazily resolves its module file references to actual AST reader module files only after the module file has been loaded, eliminating the stat-caching race. Moreover, the AST reader can communicate to its caller that a module file is missing (rather than simply being out-of-date), allowing us to simplify the module-loading logic and allowing the compiler to recover if a dependent module file ends up getting deleted. llvm-svn: 177367
* PR15383: When -fsanitize=float-cast-overflow checks a float-to-int conversion,Richard Smith2013-03-191-8/+24
| | | | | | | | it wasn't taking into account that the float should be truncated *before* the range check happens. Thus (unsigned)-0.99 and (unsigned char)255.9 have defined behavior and should not be trapped. llvm-svn: 177362
* Centralize the logic for using the integrated assembler.Rafael Espindola2013-03-183-41/+13
| | | | llvm-svn: 177360
* documentation comment parsing. Added couple of Fariborz Jahanian2013-03-181-2/+8
| | | | | | | | top-level HeaderDoc tags @functiongroup and @methodgroup to doc. tags recognized. // rdar://12379114 llvm-svn: 177358
* Diagnose uses of 'alignof' on functions in -pedantic mode.Richard Smith2013-03-181-5/+6
| | | | llvm-svn: 177354
* [analyzer] Do part of the work to find shortest bug paths up front.Jordan Rose2013-03-181-42/+115
| | | | | | | | | | | | | | Splitting the graph trimming and the path-finding (r177216) already recovered quite a bit of performance lost to increased suppression. We can still do better by also performing the reverse BFS up front (needed for shortest-path-finding) and only walking the shortest path for each report. This does mean we have to walk back up the path and invalidate all the BFS numbers if the report turns out to be invalid, but it's probably still faster than redoing the full BFS every time. More performance work for <rdar://problem/13433687> llvm-svn: 177353
* [analyzer] Replace uses of assume() with isNull() in BR visitors.Jordan Rose2013-03-181-15/+18
| | | | | | | | Also, replace a std::string with a SmallString. No functionality change. llvm-svn: 177352
* PR15539: Record "evaluating if/elif condition" flag in the right placeDavid Blaikie2013-03-182-2/+2
| | | | | | | The previous implementation missed the case where the elif condition was evaluated from the context of an #ifdef that was false causing PR15539. llvm-svn: 177345
* [frontend] Initialize the diagnostic client before loading an ast file.Argyrios Kyrtzidis2013-03-181-0/+4
| | | | | | | Issue reported by Tom Honermann! http://llvm.org/bugs/show_bug.cgi?id=15377 llvm-svn: 177336
* Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith2013-03-183-71/+102
| | | | | | definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. llvm-svn: 177335
* [PCH] Fix assertion hit related to enum decls inside templated funtions.Argyrios Kyrtzidis2013-03-181-0/+1
| | | | | | | Report and suggested fix by Tom Honermann! http://llvm.org/bugs/show_bug.cgi?id=13020 llvm-svn: 177330
* This code works around what appears to be a bug in another part of clang.Reed Kotler2013-03-181-1/+2
| | | | | | | | | | | | I have filed http://llvm.org/bugs/show_bug.cgi?id=15538 against clang. This code is safer anyway because "cast" assumes you really know that it's okay to make the cast. In this case isa should not be false and dyn_cast should not return null as far as I understand. But everything else is valid so I did not want to revert my previous patch for attributes mips16/nomips16 or use an llvm_unreachable here which would make a number of our tests fail for mips. llvm-svn: 177329
* Bring inheriting constructor implementation up-to-date with current defectRichard Smith2013-03-183-82/+177
| | | | | | | | | reports, and implement implicit definition of inheriting constructors. Remaining missing features: inheriting constructor templates, implicit exception specifications for inheriting constructors, inheriting constructors from dependent bases. llvm-svn: 177320
* Centralize the recording of which tools have been constructed.Rafael Espindola2013-03-184-293/+123
| | | | llvm-svn: 177319
* [analyzer] Warn when a ‘nil’ object is added to NSArray or NSMutableArray.Anna Zaks2013-03-181-4/+33
| | | | llvm-svn: 177318
* Objective-C modern translator. Don't put line infoFariborz Jahanian2013-03-181-1/+5
| | | | | | | | into the pre-preprocessed file to be passed to modern translator when compiling in no debug mode. // rdar://13138170 llvm-svn: 177311
* Use early returns when checking if we already constructed a tool and whenRafael Espindola2013-03-183-207/+219
| | | | | | delegating to Generic_GCC::SelectTool (it already updates the tool map). llvm-svn: 177305
* Remove unused argument.Rafael Espindola2013-03-184-42/+39
| | | | llvm-svn: 177303
* Pass an ArgList to every toolchain constructor. Remove the useIntegratedAsRafael Espindola2013-03-186-30/+35
| | | | | | argument. llvm-svn: 177301
* Inline ShouldUseIntegratedAssembler and move the documentation toRafael Espindola2013-03-181-10/+3
| | | | | | useIntegratedAs. llvm-svn: 177300
* Refactor a bit of duplicated code to useIntegratedAs.Rafael Espindola2013-03-185-41/+17
| | | | llvm-svn: 177299
* Remove unused argument.Rafael Espindola2013-03-184-76/+40
| | | | llvm-svn: 177293
* Remove unused argument.Rafael Espindola2013-03-183-15/+14
| | | | llvm-svn: 177287
* Fix clang-format segfault.Daniel Jasper2013-03-181-0/+2
| | | | | | | | When annotating "lines" starting with ":", clang-format would segfault. This could actually happen in valid code, e.g. #define A : llvm-svn: 177283
* Make sure to use same EABI version for external assembler as for integrated as.Anton Korobeynikov2013-03-181-0/+1
| | | | | | Patch by Andrew Turner! llvm-svn: 177252
* revert r177211 due to its potential issuesManman Ren2013-03-167-49/+12
| | | | llvm-svn: 177222
* [analyzer] Model trivial copy/move assignment operators with a bind as well.Jordan Rose2013-03-162-9/+48
| | | | | | | | | | | | 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-163-5/+8
| | | | | | | 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-163-69/+31
| | | | | | | | | | | | | | | ...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-167-12/+49
| | | | | | | | | | | | | 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-151-22/+113
| | | | | | | | | | 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-151-3/+1
| | | | | | | | | | 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-151-8/+11
| | | | | | 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-151-15/+46
| | | | | | | | | | | | | | | 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-151-2/+15
| | | | | | | | 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
OpenPOWER on IntegriCloud