summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [analyzer] Move ReturnStmt retain-count analysis from CFRefCount to ↵Jordy Rose2011-08-231-186/+182
| | | | | | RetainReleaseChecker. Tweak CFRefReport to reflect that fact that ReturnStmt checks are pre-statement, not post-statement. No intended functionality change. llvm-svn: 138358
* [analyzer] Move symbol death leak analysis from CFRefCount to ↵Jordy Rose2011-08-232-167/+179
| | | | | | RetainReleaseChecker. llvm-svn: 138353
* Thread-safety analysis: adding in a basic lockset tracking system. ThisCaitlin Sadowski2011-08-232-50/+676
| | | | | | | | | | | | | | | | system flags an error when unlocking a lock which was not held, locking the same lock twice, having a different lockset on each iteration of a loop, or going out of scope while still holding a lock. In order to successfully use the lockset, this patch also makes sure that attribute arguments are attached correctly for later parsing. This patch was also worked on by DeLesley Hutchins. Note: This patch has been reviewed by Chandler Carruth and Jeffrey Yasskin. Feel free to provide post-commit review comments for a subsequent patch. llvm-svn: 138350
* Add support for a verifier to the driver. Currently only verifies debugEric Christopher2011-08-235-9/+73
| | | | | | | | | | | output on darwin so is hard coded there. As a note this will need a little bit of refactoring in the class hierarchy to separate it out for different verifiers based on input type. Fixes rdar://8256258. llvm-svn: 138343
* checking for __block variable captured by givenFariborz Jahanian2011-08-231-2/+9
| | | | | | | stmt expression, recursively walk down all substatements of the stmt expression. // rdar://10001085 llvm-svn: 138334
* enable -fstack-protector on 10.5 for usermode binaries by default.Nico Weber2011-08-232-5/+10
| | | | | | This matches gcc's behavior. llvm-svn: 138324
* [analyzer] Only allocate retain summaries for interesting ↵Jordy Rose2011-08-231-43/+71
| | | | | | functions/messages. This is a minor saving of memory but doesn't seem to cost any performance. llvm-svn: 138320
* Fix an incorrect note.Matt Beaumont-Gay2011-08-231-1/+1
| | | | | | | | For the test case added to function-redecl.cpp, we were previously complaining about a mismatch in the parameter types, since the definition used the typedef'd type. llvm-svn: 138318
* block IRgen - Fixes a crash when determining if given block variableFariborz Jahanian2011-08-231-0/+3
| | | | | | is captured by a given statement expression. // rdar://10001085 llvm-svn: 138314
* [analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessage, ↵Jordy Rose2011-08-231-54/+21
| | | | | | since it no longer, uh, evaluates call summaries. llvm-svn: 138313
* Make sure we don't inline functions marked with __attribute__((naked)). ↵Eli Friedman2011-08-221-4/+9
| | | | | | <rdar://problem/9973228> llvm-svn: 138310
* [analyzer] Migrate the handling of retain-count-related RetEffects and ↵Jordy Rose2011-08-221-211/+292
| | | | | | ArgEffects from CFRefCount to RetainReleaseChecker. No intended functionality change. llvm-svn: 138309
* [analyzer] MacOSKeychainAPIChecker: Users of KeyChain API often use free() ↵Anna Zaks2011-08-221-10/+18
| | | | | | to deallocate the password. Catch this error explicitly and generate the error message at the place where free() is called. llvm-svn: 138296
* objc refactoring - minor clean up.Fariborz Jahanian2011-08-221-12/+8
| | | | llvm-svn: 138276
* Static Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveText, now ↵Anna Zaks2011-08-222-24/+31
| | | | | | renamed into ExtraText, to the diagnostic without subclassing BugReport. llvm-svn: 138272
* objc - use existing API for temporary switch ofFariborz Jahanian2011-08-221-5/+2
| | | | | | objc's decl context. llvm-svn: 138267
* Do not perform check for missing '[super dealloc]' under ARC as calling ↵Ted Kremenek2011-08-221-1/+3
| | | | | | -dealloc is illegal in that mode. llvm-svn: 138261
* Clean up the CFRefBugReport - remove the members, which got moved to the ↵Anna Zaks2011-08-221-13/+5
| | | | | | CFRefReportVisitors. llvm-svn: 138259
* Don't warn on varaidic macros in C++0x mode.Eli Friedman2011-08-221-2/+2
| | | | llvm-svn: 138257
* objc - minor comment fix up and cleanup.Fariborz Jahanian2011-08-222-3/+3
| | | | llvm-svn: 138253
* objc - Simplify switing objc decl context by usingFariborz Jahanian2011-08-224-50/+18
| | | | | | a context switching object. llvm-svn: 138248
* Warn on missing [super dealloc] calls.Nico Weber2011-08-224-3/+22
| | | | | | This matches gcc's logic. Half of PR10661. llvm-svn: 138240
* Fix a crash-on-valid that has been here for a very long time:Chandler Carruth2011-08-221-2/+9
| | | | | | | | | | | | | | | const int &x = x; This crashed by inifinetly recursing within the lvalue evaluation routine. I've added a (somewhat) braindead way of preventing this recursion. If folks have better suggestions for how to avoid it I'm all ears. That said, we have some work to do. This doesn't trigger a single warning for uninitialized, self-initialized or otherwise completely wrong code. In some senses, the crash was almost better. llvm-svn: 138239
* Fix a bug in objc @encoding of C++ classes.Argyrios Kyrtzidis2011-08-221-1/+3
| | | | llvm-svn: 138235
* Restore patch I reversed in r138040. Known buildbotFariborz Jahanian2011-08-229-119/+185
| | | | | | failures are resolved. llvm-svn: 138234
* Boost the efficiency of SourceManager::getMacroArgExpandedLocation.Argyrios Kyrtzidis2011-08-215-41/+126
| | | | | | | | | | | | | | | | | | Currently getMacroArgExpandedLocation is very inefficient and for the case of a location pointing at the main file it will end up checking almost all of the SLocEntries. Make it faster: -Use a map of macro argument chunks to their expanded source location. The map is for a single source file, it's stored in the file's ContentCache and lazily computed, like the source lines cache. -In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track of the number of FileIDs (files and macros) that were created during preprocessing of that particular file SLocEntry. This is useful when computing the macro argument map in skipping included files while scanning for macro arg FileIDs that lexed from a specific source file. Due to padding, the new field does not increase the size of SLocEntry. llvm-svn: 138225
* [analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable ↵Jordy Rose2011-08-211-46/+94
| | | | | | from CFRefCount to RetainReleaseChecker. No intended functionality change. llvm-svn: 138223
* [analyzer] Remove FIXME; Ted reminded me that -init is not guaranteed to ↵Jordy Rose2011-08-211-1/+0
| | | | | | return its receiver and pretending that it does won't actually buy us anything. (Comment change only.) llvm-svn: 138221
* [analyzer] Migrate return value handling from CFRefCount to ExprEngine. This ↵Jordy Rose2011-08-213-67/+98
| | | | | | seems to result in a minor performance hit, but I think that will go away again once we eliminate TransferFuncs from function calls entirely. llvm-svn: 138220
* [analyzer] Replace calls to getNameAsString() with StringRef equivalents.Jordy Rose2011-08-214-16/+15
| | | | llvm-svn: 138215
* Fix compile on platforms that don't implicitly include stdarg.h here.Benjamin Kramer2011-08-201-1/+1
| | | | llvm-svn: 138214
* [analyzer] RetainReleaseChecker always wants region change updates. There's ↵Jordy Rose2011-08-201-6/+2
| | | | | | no need for a flag, at least not right now. llvm-svn: 138212
* Fix indentation.Jordy Rose2011-08-201-17/+17
| | | | llvm-svn: 138211
* [analyzer] Move handling of hardcoded noreturn ("panic") methods from ↵Jordy Rose2011-08-202-38/+71
| | | | | | CFRefCount to NoReturnFunctionChecker. No functionality change intended. llvm-svn: 138210
* Typo spotted by Ivan Krasin.Chad Rosier2011-08-201-1/+1
| | | | llvm-svn: 138200
* [analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. ↵Ted Kremenek2011-08-203-7/+6
| | | | | | No need to bind an explicit value and create a new node. llvm-svn: 138196
* [analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive ↵Ted Kremenek2011-08-201-121/+113
| | | | | | visit to subexpressions (which is no longer needed). llvm-svn: 138195
* Start partitioning ExprEngine.cpp into separate .cpp files that handle ↵Ted Kremenek2011-08-205-1187/+1202
| | | | | | | | different parts of the analysis (e.g., analysis of C expressions, analysis of Objective-C expressions, and so on). llvm-svn: 138194
* Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.Ted Kremenek2011-08-202-2/+2
| | | | llvm-svn: 138193
* Make the loading of multiple records for the same identifier (fromDouglas Gregor2011-08-201-1/+3
| | | | | | | | | | different modules) more robust. It already handled (simple) merges of the set of declarations attached to that identifier, so add a test case that shows us getting two different declarations for the same identifier (one struct, one function) from different modules, and are able to use both of them. llvm-svn: 138189
* Clean out some minor cruft in the AST reader; no functionality change.Douglas Gregor2011-08-201-2/+0
| | | | llvm-svn: 138188
* Introduce a module visitation function that starts at the top-levelDouglas Gregor2011-08-201-19/+116
| | | | | | | | | | | | | | | | | modules (those that no other module depends on) and performs a search over all of the modules, visiting a new module only when all of the modules that depend on it have already been visited. The visitor can abort the search for all modules that a module depends on, which allows us to minimize the number of lookups necessary when performing a search. Switch identifier lookup from a linear walk over the set of modules to this module visitation operation. The behavior is the same for simple PCH and chained PCH, but provides the proper search order for modules. Verified with printf debugging, since we don't have enough in place to actually test this. llvm-svn: 138187
* Static Analyzer Diagnostics: Move the responsibility for generating the ↵Anna Zaks2011-08-203-65/+100
| | | | | | endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece. llvm-svn: 138184
* Remove dead code.Ted Kremenek2011-08-202-25/+1
| | | | llvm-svn: 138183
* Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. ↵Anna Zaks2011-08-192-22/+34
| | | | | | BugReport no longer needs to inherit from BugReporterVisitor. llvm-svn: 138142
* For assigning SourceLocations to macro arg tokens, reserve a single SLocEntryArgyrios Kyrtzidis2011-08-191-22/+69
| | | | | | | | | | | | | | for tokens that are lexed consecutively from the same FileID, instead of creating a SLocEntry for each token. e.g for assert(foo == bar); there will be a single SLocEntry for the "foo == bar" chunk and locations for the 'foo', '==', 'bar' tokens will point inside that chunk. For parsing SemaExpr.cpp, this reduced the number of SLocEntries by 25%. llvm-svn: 138129
* Rename TokenLexer::getMacroExpansionLocation -> ↵Argyrios Kyrtzidis2011-08-191-8/+10
| | | | | | getExpansionLocForMacroDefLoc, no functionality change. llvm-svn: 138128
* Refactor common functionality into SourceManager::getFileIDSize, no ↵Argyrios Kyrtzidis2011-08-191-14/+1
| | | | | | functionality change. llvm-svn: 138127
* Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) ↵Anna Zaks2011-08-1918-360/+255
| | | | | | | | | | | | API in favor of addVisitor(BugReporterVisitor*). 1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well. 2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor. 3) Modify all the checkers to use the new API. llvm-svn: 138126
* Remove unused function ModuleManager::exportLookup()Douglas Gregor2011-08-191-10/+0
| | | | llvm-svn: 138079
OpenPOWER on IntegriCloud