summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Rename CanFitInto64Bits to alwaysFitsInto64Bits per discussion on IRC.Jordan Rose2012-09-251-2/+2
| | | | | | | | | | | | | This makes the behavior clearer concerning literals with the maximum number of digits. For a 32-bit example, 4,000,000,000 is a valid uint32_t, but 5,000,000,000 is not, so we'd have to count 10-digit decimal numbers as "unsafe" (meaning we have to check for overflow when parsing them, just as we would for numbers with 11 digits or higher). This is the same, only with 64 bits to play with. No functionality change. llvm-svn: 164639
* [driver] Add support for the -fno-fast-math option.Chad Rosier2012-09-251-11/+27
| | | | | | rdar://12299433 llvm-svn: 164638
* Improve upon r164450 and localize the logic of updating the type ofArgyrios Kyrtzidis2012-09-251-28/+34
| | | | | | a function decl inside the ASTNodeImporter::VisitFunctionDecl function. llvm-svn: 164625
* Optimize NumericLiteralParser::GetIntegerValue().Dmitri Gribenko2012-09-251-9/+21
| | | | | | | It does a conservative estimate on the size of numbers that can fit into uint64_t. This bound is improved. llvm-svn: 164624
* Reapply "[analyzer] Remove constraints on dead symbols as part of ↵Jordan Rose2012-09-252-9/+8
| | | | | | | | | | | | | | | | | | removeDeadBindings." Previously, we'd just keep constraints around forever, which means we'd never be able to merge paths that differed only in constraints on dead symbols. Because we now allow constraints on symbolic expressions, not just single symbols, this requires changing SymExpr::symbol_iterator to include intermediate symbol nodes in its traversal, not just the SymbolData leaf nodes. This depends on the previous commit to be correct. Originally applied in r163444, reverted in r164275, now being re-applied. llvm-svn: 164622
* [analyzer] Calculate liveness for symbolic exprs as well as atomic symbols.Jordan Rose2012-09-251-28/+40
| | | | | | | | | | | | | No tests, but this allows the optimization of removing dead constraints. We can then add tests that we don't do this prematurely. <rdar://problem/12333297> Note: the added FIXME to investigate SymbolRegionValue liveness is tracked by <rdar://problem/12368183>. This patch does not change the existing behavior. llvm-svn: 164621
* Under certain terrible circumstances (<rdar://problem/10805775>),Douglas Gregor2012-09-251-0/+13
| | | | | | | | | top-level frameworks can actually be symlinked over to embedded frameworks, and accessed via the top-level framework's headers. In this case, we need to determine that the framework was *actually* an embedded framework, so we can load the appropriate top-level module. llvm-svn: 164620
* Macro history (de-)serialization. Deserialization currently reads only the ↵Alexander Kornienko2012-09-254-107/+128
| | | | | | | | | | | | | | | | latest macro definition. Needs more work. Summary: Passes all tests (+ the new one with code completion), but needs a thorough review in part related to modules. Reviewers: doug.gregor Reviewed By: alexfh CC: cfe-commits, rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D41 llvm-svn: 164610
* Examine the last, not the first, instruction from the MC matcher.Bob Wilson2012-09-251-1/+1
| | | | | | | | If an MS-style inline asm is matched to multiple instructions, e.g., with a a WAIT-prefix, then we need to examine the operands of the last instruction instruction, not the prefix instruction. llvm-svn: 164608
* Introduce builtin macros to determine whether we're building aDouglas Gregor2012-09-251-0/+67
| | | | | | | | | | specific module (__building_module(modulename)) and to get the name of the current module as an identifier (__MODULE__). Used to help headers behave differently when they're being included as part of building a module. Oh, the irony. llvm-svn: 164605
* When performing a ::delete of an object with a virtual destructor,John McCall2012-09-254-1/+50
| | | | | | | | | | | | | | be sure to delete the complete object pointer, not the original pointer. This is necessary if the base being deleted is at a non-zero offset in the complete object. This is only required for objects with virtual destructors because deleting an object via a base-class subobject when the base does not have a virtual destructor is undefined behavior. Noticed while reviewing the last four years of cxx-abi-dev activity. llvm-svn: 164597
* Implement Mike Herrick's proposed noexcept mangling.John McCall2012-09-251-1/+5
| | | | llvm-svn: 164593
* In the MS ABI, ctors return 'this'. Patch by Dmitry Sokolov.John McCall2012-09-251-12/+35
| | | | llvm-svn: 164592
* Add the Microsoft __is_interface_class type trait.John McCall2012-09-255-0/+9
| | | | | | Patch by Andy Gibbs! llvm-svn: 164591
* Fix for r163013 regression and further __interface enhancement.John McCall2012-09-253-22/+108
| | | | | | Patch by Andy Gibbs! llvm-svn: 164590
* During jump-scope checking, build an ExprWithCleanups immediatelyJohn McCall2012-09-252-3/+20
| | | | | | | | | | | | into the enclosing scope; this is a more accurate model but is (I believe) unnecessary in my test case due to other flaws. However, one of those flaws is now intentional: blocks which appear in return statements can be trivially observed to not extend in lifetime past the return, and so we can allow a jump past them. Do the necessary magic in IR-generation to make this work. llvm-svn: 164589
* Fix crash when a decltype expression in a trailing return type refers to theRichard Smith2012-09-252-0/+24
| | | | | | | | | | function being instantiated. An error recovery codepath was recursively performing name lookup (and triggering an unbounded stack of template instantiations which blew out the stack before hitting the depth limit). Patch by Wei Pan! llvm-svn: 164586
* Delete some code which is, as far as I can tell, dead.Eli Friedman2012-09-251-53/+3
| | | | llvm-svn: 164580
* [analyzer] Fix a buildbot crash triggered by turning on dynamicAnna Zaks2012-09-251-1/+1
| | | | | | dispatch. llvm-svn: 164579
* Don't produce diagnostics for missing ctor-initializers during templateRichard Smith2012-09-252-2/+6
| | | | | | instantiations if we encountered errors parsing some of the initializers. llvm-svn: 164578
* Handle C++ functional casts in a similar way to C-style casts inEli Friedman2012-09-241-0/+1
| | | | | | unused expression warnings. <rdar://problem/12359208>. llvm-svn: 164569
* Update for r164567.Chad Rosier2012-09-241-2/+2
| | | | llvm-svn: 164568
* Add clarifying comment.Ted Kremenek2012-09-241-0/+2
| | | | llvm-svn: 164557
* StringRef'ize Preprocessor::CreateString().Dmitri Gribenko2012-09-246-15/+12
| | | | llvm-svn: 164555
* Replace raw call to snprintf() by llvm streams.Dmitri Gribenko2012-09-241-21/+24
| | | | llvm-svn: 164554
* Replace an assertion with an error for empty __asm statements.Bob Wilson2012-09-241-4/+12
| | | | llvm-svn: 164551
* Fix a comment typo and clean up formatting.Bob Wilson2012-09-241-4/+5
| | | | llvm-svn: 164550
* Make sure that we don't end up making an #undef'd macro visible afterDouglas Gregor2012-09-241-3/+9
| | | | | | | the fact. Test cases will come when we're actually (de-)serializing macro history. llvm-svn: 164549
* Change the wording of the extension warning fromDmitri Gribenko2012-09-243-19/+36
| | | | | | | | | > 'long long' is an extension when C99 mode is not enabled to > 'long long' is a C++11 extension while compiling in C++98 mode. llvm-svn: 164545
* [analyzer] Really turn on dynamic-bifurcation on by default.Anna Zaks2012-09-241-2/+0
| | | | | | | Thanks to Byoungyoung for realizing taht we are not passing the default option correctly. llvm-svn: 164543
* [analyzer]Prevent infinite recursion(assume->checker:evalAssume->assume)Anna Zaks2012-09-241-1/+3
| | | | | | (Unfortunately, I do not have a good reduced test case for this.) llvm-svn: 164541
* Small cleanup of literal semantic analysis: hiding 'char *' pointers behindDmitri Gribenko2012-09-243-22/+22
| | | | | | | StringRef makes code cleaner. Also, make the temporary buffer smaller: 512 characters is unreasonably large for integer literals. llvm-svn: 164484
* Implement ToolChain::IsUnwindTablesDefault to reduce code duplication a bit.Rafael Espindola2012-09-233-10/+4
| | | | llvm-svn: 164473
* On Hexagon getArchName() never returns x86_64, simplify the function.Rafael Espindola2012-09-221-3/+1
| | | | llvm-svn: 164470
* Comment sema: warn when comment has \deprecated but declaration does not have aDmitri Gribenko2012-09-221-0/+34
| | | | | | | | | deprecation attribute ('deprecated', 'availability' or 'unavailable'). This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it can be turned off easily while leaving other -Wdocumentation warnings on. llvm-svn: 164467
* Fix pr13749. There is still a lot of code using getArchName that should beRafael Espindola2012-09-221-1/+1
| | | | | | using getArch, but I will try to fix them one at time to add tests. llvm-svn: 164460
* Avoid multiple atomic builtin declaration.Abramo Bagnara2012-09-221-4/+13
| | | | llvm-svn: 164454
* When importing a FunctionProtoType::ExtProtoInfo, its ExceptionSpecDecl can ↵Argyrios Kyrtzidis2012-09-221-10/+44
| | | | | | | | | | | | point to the FunctionDecl that we are importing the FunctionProtoType for, in which case we'll have infinite recursion when importing. Initially create a FunctionProtoType with null ExceptionSpecDecl/ExceptionSpecTemplate and update the type in ASTNodeImporter::VisitFunctionDecl after the FunctionDecl has been created. llvm-svn: 164450
* [analyzer] Suppress bugs whose paths go through the return of a null pointer.Jordan Rose2012-09-222-6/+25
| | | | | | | | | | | | | | | | | | | | This is a heuristic intended to greatly reduce the number of false positives resulting from inlining, particularly inlining of generic, defensive C++ methods that live in header files. The suppression is triggered in the cases where we ask to track where a null pointer came from, and it turns out that the source of the null pointer was an inlined function call. This change brings the number of bug reports in LLVM from ~1500 down to around ~300, a much more manageable number. Yes, some true positives may be hidden as well, but from what I looked at the vast majority of silenced reports are false positives, and many of the true issues found by the analyzer are still reported. I'm hoping to improve this heuristic further by adding some exceptions next week (cases in which a bug should still be reported). llvm-svn: 164449
* [analyzer] Track a null value back through FindLastStoreBRVisitor.Jordan Rose2012-09-221-27/+36
| | | | | | | Also, tidy up the other tracking visitors so that they mark the right things as interesting and don't do extra work. llvm-svn: 164448
* [analyzer] Always allow BugReporterVisitors to see the bug path.Jordan Rose2012-09-221-21/+57
| | | | | | | | | | | | | | | | | | Before, PathDiagnosticConsumers that did not support actual path output would (sensibly) cause the generation of the full path to be skipped. However, BugReporterVisitors may want to see the path in order to mark a BugReport as invalid. Now, even for a path generation scheme of 'None' we will still create a trimmed graph and walk backwards through the bug path, doing no work other than passing the nodes to the BugReporterVisitors. This isn't cheap, but it's necessary to properly do suppression when the first path consumer does not support path notes. In the future, we should try only generating the path and visitor-provided path notes once, or at least only creating the trimmed graph once. llvm-svn: 164447
* [analyzer] Allow a BugReport to be marked "invalid" during path generation.Jordan Rose2012-09-222-10/+40
| | | | | | | | | | | | | | | | This is intended to allow visitors to make decisions about whether a BugReport is likely a false positive. Currently there are no visitors making use of this feature, so there are no tests. When a BugReport is marked invalid, the invalidator must provide a key that identifies the invaliation (intended to be the visitor type and a context pointer of some kind). This allows us to reverse the decision later on. Being able to reverse a decision about invalidation gives us more flexibility, and allows us to formulate conditions like "this report is invalid UNLESS the original argument is 'foo'". We can use this to fine-tune our false-positive suppression (coming soon). llvm-svn: 164446
* [analyzer] Look through OpaqueValueExprs when tracking a nil value.Jordan Rose2012-09-221-0/+3
| | | | | | | This allows us to show /why/ a particular object is nil, even when it is wrapped in an OpaqueValueExpr. llvm-svn: 164445
* [analyzer] Better path notes for null pointers passed as arguments.Jordan Rose2012-09-221-7/+53
| | | | | | | | | | | | | Rather than saying "Null pointer value stored to 'foo'", we now say "Passing null pointer value via Nth parameter 'foo'", which is much better. The note is also now on the argument expression as well, rather than the entire call. This paves the way for continuing to track arguments back to their sources. <rdar://problem/12211490> llvm-svn: 164444
* Use llvm::getOrdinalSuffix to print ordinal numbers in diagnostics.Jordan Rose2012-09-223-53/+15
| | | | | | Just a refactoring of common infrastructure. No intended functionality change. llvm-svn: 164443
* [analyzer] Check that an ObjCIvarRefExpr's base is non-null even as an lvalue.Jordan Rose2012-09-223-14/+22
| | | | | | | | | | | Like with struct fields, we want to catch cases like this early, so that we can produce better diagnostics and path notes: PointObj *p = nil; int *px = &p->_x; // should warn here *px = 1; llvm-svn: 164442
* [analyzer] Check that a member expr is valid even when the result is an lvalue.Jordan Rose2012-09-221-9/+17
| | | | | | | | | | | We want to catch cases like this early, so that we can produce better diagnostics and path notes: Point *p = 0; int *px = &p->x; // should warn here *px = 1; llvm-svn: 164441
* [ms-inline asm] Use mnemonicIsValid() in a helpful assert.Chad Rosier2012-09-211-0/+2
| | | | llvm-svn: 164421
* Mark the passed in "self" for a block as an object pointer soEric Christopher2012-09-211-3/+9
| | | | | | | | | that the backend can mark it as the representative pointer for the block. rdar://12001329 llvm-svn: 164418
* Fix build errors.Argyrios Kyrtzidis2012-09-211-2/+4
| | | | llvm-svn: 164417
OpenPOWER on IntegriCloud