]> granicus.if.org Git - clang/log
clang
13 years agoRevert "[analyzer] Cleanup: Move temporary declarations of CFRefCount variables close...
Eric Christopher [Wed, 24 Aug 2011 00:39:51 +0000 (00:39 +0000)]
Revert "[analyzer] Cleanup: Move temporary declarations of CFRefCount variables closer to their uses. No functionality change."

This reverts commit d02b4af7bd6ca4a743c7074d64e205d718aa221d.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138420 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert "[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount...
Eric Christopher [Wed, 24 Aug 2011 00:39:48 +0000 (00:39 +0000)]
Revert "[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. Unfortunately, CFRefReport still is. No functionality change."

This reverts commit e3fb7e428b7ba0d5d902dfe3f165d70e09b03a15.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138419 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake constant aggregate constant initializers private linkage.
Eric Christopher [Wed, 24 Aug 2011 00:33:55 +0000 (00:33 +0000)]
Make constant aggregate constant initializers private linkage.
After talking with John making this the case for all of these is
the right way to go.

Fixes rdar://9804564 and PR10414

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138418 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] MacOSKeychainAPIChecker: Add reasoning about functions which MIGHT dealloc...
Anna Zaks [Wed, 24 Aug 2011 00:06:27 +0000 (00:06 +0000)]
[analyzer] MacOSKeychainAPIChecker: Add reasoning about functions which MIGHT deallocate the memory region allocated with SecKeychain APIs. Specifically, when the buffer is passed to CFStringCreateWithBytesNoCopy along with a custom deallocator, which might potentially correctly release the memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138417 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] MacOSKeychainAPIChecker: Retrieve the memory region which we are tracking...
Anna Zaks [Tue, 23 Aug 2011 23:56:12 +0000 (23:56 +0000)]
[analyzer] MacOSKeychainAPIChecker: Retrieve the memory region which we are tracking even when it's no longer a SymbolicRegion, for example, when it is cast to char*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138415 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove creation of the deallocation mismatch report into a separate function for future...
Anna Zaks [Tue, 23 Aug 2011 23:47:36 +0000 (23:47 +0000)]
Move creation of the deallocation mismatch report into a separate function for future reuse.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138414 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhitespace and 80-col cleanup.
Eric Christopher [Tue, 23 Aug 2011 23:44:09 +0000 (23:44 +0000)]
Whitespace and 80-col cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138413 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc - fix up the builtin type for objc_assign_ivar.
Fariborz Jahanian [Tue, 23 Aug 2011 23:33:09 +0000 (23:33 +0000)]
objc - fix up the builtin type for objc_assign_ivar.
// rdar://9362887.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138412 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix _mm256_shuffle_ps mask! Example, for mask=203, Instead of:
Bruno Cardoso Lopes [Tue, 23 Aug 2011 23:29:45 +0000 (23:29 +0000)]
Fix _mm256_shuffle_ps mask! Example, for mask=203, Instead of:
  <i32 3, i32 2, i32 8, i32 11, i32 3, i32 6, i32 12, i32 15>
generate:
  <i32 3, i32 2, i32 8, i32 11, i32 7, i32 6, i32 12, i32 15>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138411 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStart reworking -Wunreachable-code. The original analysis had serious flaws with...
Ted Kremenek [Tue, 23 Aug 2011 23:05:11 +0000 (23:05 +0000)]
Start reworking -Wunreachable-code.  The original analysis had serious flaws with how it
handled SCC's of dead code, or simply having false negatives by overly suppressing warnings.

WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138410 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCFG: record set of C++ 'try' dispatch blocks, which could be of interest to various...
Ted Kremenek [Tue, 23 Aug 2011 23:05:07 +0000 (23:05 +0000)]
CFG: record set of C++ 'try' dispatch blocks, which could be of interest to various analyses (e.g., reachability).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138409 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoConstify the result of CFGStmt::getStmt().
Ted Kremenek [Tue, 23 Aug 2011 23:05:04 +0000 (23:05 +0000)]
Constify the result of CFGStmt::getStmt().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138408 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd 'const' version of CompoundStmt::children().
Ted Kremenek [Tue, 23 Aug 2011 23:05:01 +0000 (23:05 +0000)]
Add 'const' version of CompoundStmt::children().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138407 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert "[analyzer] Clean up unused bits of CFRefCount."
Eric Christopher [Tue, 23 Aug 2011 22:38:04 +0000 (22:38 +0000)]
Revert "[analyzer] Clean up unused bits of CFRefCount."

This reverts commit 6886a92640f5bffc972f67c0a1f302d6c6e7c322.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138405 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhitespace.
Eric Christopher [Tue, 23 Aug 2011 22:38:00 +0000 (22:38 +0000)]
Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138404 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactor and fix checking for initialization of flexible array members. The old...
Eli Friedman [Tue, 23 Aug 2011 22:24:57 +0000 (22:24 +0000)]
Refactor and fix checking for initialization of flexible array members.  The old version had the checks scattered across the code, missed some checks, and had a couple nasty bugs in existing checks.

Fixes PR10648 and another similar accepts-invalid bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138398 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Clean up unused bits of CFRefCount.
Jordy Rose [Tue, 23 Aug 2011 21:51:36 +0000 (21:51 +0000)]
[analyzer] Clean up unused bits of CFRefCount.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138390 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRight now this requires asserts.
Eric Christopher [Tue, 23 Aug 2011 21:47:58 +0000 (21:47 +0000)]
Right now this requires asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138389 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. Unfortun...
Jordy Rose [Tue, 23 Aug 2011 21:47:17 +0000 (21:47 +0000)]
[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. Unfortunately, CFRefReport still is. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138388 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Cleanup: Move temporary declarations of CFRefCount variables closer to...
Jordy Rose [Tue, 23 Aug 2011 21:06:32 +0000 (21:06 +0000)]
[analyzer] Cleanup: Move temporary declarations of CFRefCount variables closer to their uses. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138382 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove one SourceManager::isInFileID overload and use isOffsetInFileID for the other.
Argyrios Kyrtzidis [Tue, 23 Aug 2011 21:02:45 +0000 (21:02 +0000)]
Remove one SourceManager::isInFileID overload and use isOffsetInFileID for the other.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138381 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAmend r138129 (reduction of SLocEntries) which introduced performance regression due
Argyrios Kyrtzidis [Tue, 23 Aug 2011 21:02:41 +0000 (21:02 +0000)]
Amend r138129 (reduction of SLocEntries) which introduced performance regression due
to increased calls to SourceManager::getFileID. (rdar://9992664)

Use a slightly different approach that is more efficient both in terms of speed
(no extra getFileID calls) and in SLocEntries reduction.

Comparing pre-r138129 and this patch we get:

For compiling SemaExpr.cpp reduction of SLocEntries by 26%.
For the boost enum library:
  -SLocEntries -34% (note that this was -5% for r138129)
  -Memory consumption -50%
  -PCH size -31%

Reduced SLocEntries also benefit the hot function SourceManager::getFileID,
evident by the reduced "FileID scans".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138380 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce SourceManager::isInSLocAddrSpace and use it in TokenLexer instead of isInFileID
Argyrios Kyrtzidis [Tue, 23 Aug 2011 21:02:38 +0000 (21:02 +0000)]
Introduce SourceManager::isInSLocAddrSpace and use it in TokenLexer instead of isInFileID
since it is a bit more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138379 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename SourceManager::isBeforeInSourceLocationOffset -> isBeforeInSLocAddrSpace.
Argyrios Kyrtzidis [Tue, 23 Aug 2011 21:02:35 +0000 (21:02 +0000)]
Rename SourceManager::isBeforeInSourceLocationOffset -> isBeforeInSLocAddrSpace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138378 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTokenLexer::getExpansionLocForMacroDefLoc doesn't need to return an invalid SourceLoc...
Argyrios Kyrtzidis [Tue, 23 Aug 2011 21:02:32 +0000 (21:02 +0000)]
TokenLexer::getExpansionLocForMacroDefLoc doesn't need to return an invalid SourceLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138377 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn Lexer::isAtEndOfMacroExpansion use SourceManager::isInFileID and avoid
Argyrios Kyrtzidis [Tue, 23 Aug 2011 21:02:30 +0000 (21:02 +0000)]
In Lexer::isAtEndOfMacroExpansion use SourceManager::isInFileID and avoid
the extra SourceManager::getFileID call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138376 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove a couple of SourceManager functions out-of-line; no functionality change.
Argyrios Kyrtzidis [Tue, 23 Aug 2011 21:02:28 +0000 (21:02 +0000)]
Move a couple of SourceManager functions out-of-line; no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138375 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move function retain-count effect summary log from CFRefCount to RetainRel...
Jordy Rose [Tue, 23 Aug 2011 20:55:48 +0000 (20:55 +0000)]
[analyzer] Move function retain-count effect summary log from CFRefCount to RetainReleaseChecker, and then explicitly provide the summary log when creating CFRefReports. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138374 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix regression in -Wuninitialized involving VLAs. It turns out that we were modeling...
Ted Kremenek [Tue, 23 Aug 2011 20:30:50 +0000 (20:30 +0000)]
Fix regression in -Wuninitialized involving VLAs.  It turns out that we were modeling sizeof(VLAs)
incorrectly in the CFG, and also the static analyzer.  This patch regresses the analyzer a bit, but
that needs to be followed up with a better solution.

Fixes <rdar://problem/10008112>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138372 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move helper method Update from CFRefCount to RetainReleaseChecker. No...
Jordy Rose [Tue, 23 Aug 2011 20:27:16 +0000 (20:27 +0000)]
[analyzer] Move helper method Update from CFRefCount to RetainReleaseChecker. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138370 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCleanup to use helper.
Eli Friedman [Tue, 23 Aug 2011 20:22:34 +0000 (20:22 +0000)]
Cleanup to use helper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138369 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove function parameter which always used the default value.
Eli Friedman [Tue, 23 Aug 2011 20:17:13 +0000 (20:17 +0000)]
Remove function parameter which always used the default value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138368 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move helper method handleAutoreleaseCounts from CFRefCount to RetainReleas...
Jordy Rose [Tue, 23 Aug 2011 20:07:14 +0000 (20:07 +0000)]
[analyzer] Move helper method handleAutoreleaseCounts from CFRefCount to RetainReleaseChecker. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138365 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move ReturnStmt retain-count analysis from CFRefCount to RetainReleaseChec...
Jordy Rose [Tue, 23 Aug 2011 19:43:16 +0000 (19:43 +0000)]
[analyzer] Move ReturnStmt retain-count analysis from CFRefCount to RetainReleaseChecker. Tweak CFRefReport to reflect that fact that ReturnStmt checks are pre-statement, not post-statement.  No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138358 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move symbol death leak analysis from CFRefCount to RetainReleaseChecker.
Jordy Rose [Tue, 23 Aug 2011 19:01:07 +0000 (19:01 +0000)]
[analyzer] Move symbol death leak analysis from CFRefCount to RetainReleaseChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138353 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread-safety analysis: adding in a basic lockset tracking system. This
Caitlin Sadowski [Tue, 23 Aug 2011 18:46:34 +0000 (18:46 +0000)]
Thread-safety analysis: adding in a basic lockset tracking system. This
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138350 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for a verifier to the driver. Currently only verifies debug
Eric Christopher [Tue, 23 Aug 2011 17:56:55 +0000 (17:56 +0000)]
Add support for a verifier to the driver. Currently only verifies debug
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138343 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agochecking for __block variable captured by given
Fariborz Jahanian [Tue, 23 Aug 2011 16:47:15 +0000 (16:47 +0000)]
checking for __block variable captured by given
stmt expression, recursively walk down all substatements
of the stmt expression. // rdar://10001085

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138334 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoenable -fstack-protector on 10.5 for usermode binaries by default.
Nico Weber [Tue, 23 Aug 2011 07:38:27 +0000 (07:38 +0000)]
enable -fstack-protector on 10.5 for usermode binaries by default.

This matches gcc's behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138324 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Only allocate retain summaries for interesting functions/messages. This...
Jordy Rose [Tue, 23 Aug 2011 04:27:15 +0000 (04:27 +0000)]
[analyzer] Only allocate retain summaries for interesting functions/messages. This is a minor saving of memory but doesn't seem to cost any performance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138320 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix an incorrect note.
Matt Beaumont-Gay [Tue, 23 Aug 2011 01:35:51 +0000 (01:35 +0000)]
Fix an incorrect note.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138318 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoblock IRgen - Fixes a crash when determining if given block variable
Fariborz Jahanian [Tue, 23 Aug 2011 00:27:49 +0000 (00:27 +0000)]
block IRgen - Fixes a crash when determining if given block variable
is captured by a given statement expression. // rdar://10001085

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138314 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessage, since it...
Jordy Rose [Tue, 23 Aug 2011 00:03:01 +0000 (00:03 +0000)]
[analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessage, since it no longer, uh, evaluates call summaries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138313 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure we don't inline functions marked with __attribute__((naked)). <rdar:/...
Eli Friedman [Mon, 22 Aug 2011 23:55:33 +0000 (23:55 +0000)]
Make sure we don't inline functions marked with __attribute__((naked)).  <rdar://problem/9973228>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138310 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Migrate the handling of retain-count-related RetEffects and ArgEffects...
Jordy Rose [Mon, 22 Aug 2011 23:48:23 +0000 (23:48 +0000)]
[analyzer] Migrate the handling of retain-count-related RetEffects and ArgEffects from CFRefCount to RetainReleaseChecker. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138309 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] MacOSKeychainAPIChecker: Users of KeyChain API often use free() to dealloc...
Anna Zaks [Mon, 22 Aug 2011 23:18:12 +0000 (23:18 +0000)]
[analyzer] MacOSKeychainAPIChecker: Users of KeyChain API often use free() to deallocate the password. Catch this error explicitly and generate the error message at the place where free() is called.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138296 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc refactoring - minor clean up.
Fariborz Jahanian [Mon, 22 Aug 2011 21:44:58 +0000 (21:44 +0000)]
objc refactoring - minor clean up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138276 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStatic Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveText, now renamed...
Anna Zaks [Mon, 22 Aug 2011 20:31:28 +0000 (20:31 +0000)]
Static Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveText, now renamed into ExtraText, to the diagnostic without subclassing BugReport.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138272 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc - use existing API for temporary switch of
Fariborz Jahanian [Mon, 22 Aug 2011 20:15:24 +0000 (20:15 +0000)]
objc - use existing API for temporary switch of
objc's decl context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138267 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDo not perform check for missing '[super dealloc]' under ARC as calling -dealloc...
Ted Kremenek [Mon, 22 Aug 2011 19:07:43 +0000 (19:07 +0000)]
Do not perform check for missing '[super dealloc]' under ARC as calling -dealloc is illegal in that mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138261 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up the CFRefBugReport - remove the members, which got moved to the CFRefReportV...
Anna Zaks [Mon, 22 Aug 2011 18:54:07 +0000 (18:54 +0000)]
Clean up the CFRefBugReport - remove the members, which got moved to the CFRefReportVisitors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138259 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't warn on varaidic macros in C++0x mode.
Eli Friedman [Mon, 22 Aug 2011 18:48:28 +0000 (18:48 +0000)]
Don't warn on varaidic macros in C++0x mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138257 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc - minor comment fix up and cleanup.
Fariborz Jahanian [Mon, 22 Aug 2011 18:34:22 +0000 (18:34 +0000)]
objc - minor comment fix up and cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138253 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc - Simplify switing objc decl context by using
Fariborz Jahanian [Mon, 22 Aug 2011 17:59:19 +0000 (17:59 +0000)]
objc - Simplify switing objc decl context by using
a context switching object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138248 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWarn on missing [super dealloc] calls.
Nico Weber [Mon, 22 Aug 2011 17:25:57 +0000 (17:25 +0000)]
Warn on missing [super dealloc] calls.

This matches gcc's logic. Half of PR10661.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138240 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a crash-on-valid that has been here for a very long time:
Chandler Carruth [Mon, 22 Aug 2011 17:24:56 +0000 (17:24 +0000)]
Fix a crash-on-valid that has been here for a very long time:

  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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138239 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc- checking for objc decl context range is unreliable and
Fariborz Jahanian [Mon, 22 Aug 2011 17:13:51 +0000 (17:13 +0000)]
objc- checking for objc decl context range is unreliable and
subject to change. Check for equality instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138238 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a bug in objc @encoding of C++ classes.
Argyrios Kyrtzidis [Mon, 22 Aug 2011 16:03:14 +0000 (16:03 +0000)]
Fix a bug in objc @encoding of C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138235 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRestore patch I reversed in r138040. Known buildbot
Fariborz Jahanian [Mon, 22 Aug 2011 15:54:49 +0000 (15:54 +0000)]
Restore patch I reversed in r138040. Known buildbot
failures are resolved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138234 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix typo.
Zhongxing Xu [Mon, 22 Aug 2011 02:05:13 +0000 (02:05 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138227 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix gcc build.
Argyrios Kyrtzidis [Sun, 21 Aug 2011 23:49:52 +0000 (23:49 +0000)]
Fix gcc build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138226 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBoost the efficiency of SourceManager::getMacroArgExpandedLocation.
Argyrios Kyrtzidis [Sun, 21 Aug 2011 23:33:04 +0000 (23:33 +0000)]
Boost the efficiency of SourceManager::getMacroArgExpandedLocation.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138225 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable from CFRefC...
Jordy Rose [Sun, 21 Aug 2011 21:58:18 +0000 (21:58 +0000)]
[analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable from CFRefCount to RetainReleaseChecker. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138223 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Remove FIXME; Ted reminded me that -init is not guaranteed to return its...
Jordy Rose [Sun, 21 Aug 2011 21:04:38 +0000 (21:04 +0000)]
[analyzer] Remove FIXME; Ted reminded me that -init is not guaranteed to return its receiver and pretending that it does won't actually buy us anything. (Comment change only.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138221 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Migrate return value handling from CFRefCount to ExprEngine. This seems...
Jordy Rose [Sun, 21 Aug 2011 19:41:36 +0000 (19:41 +0000)]
[analyzer] Migrate return value handling from CFRefCount to ExprEngine. This seems to result in a minor performance hit, but I think that will go away again once we eliminate TransferFuncs from function calls entirely.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138220 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Replace calls to getNameAsString() with StringRef equivalents.
Jordy Rose [Sun, 21 Aug 2011 05:25:15 +0000 (05:25 +0000)]
[analyzer] Replace calls to getNameAsString() with StringRef equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138215 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix compile on platforms that don't implicitly include stdarg.h here.
Benjamin Kramer [Sat, 20 Aug 2011 21:50:41 +0000 (21:50 +0000)]
Fix compile on platforms that don't implicitly include stdarg.h here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138214 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] RetainReleaseChecker always wants region change updates. There's no need...
Jordy Rose [Sat, 20 Aug 2011 21:17:59 +0000 (21:17 +0000)]
[analyzer] RetainReleaseChecker always wants region change updates. There's no need for a flag, at least not right now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138212 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix indentation.
Jordy Rose [Sat, 20 Aug 2011 21:16:58 +0000 (21:16 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138211 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Move handling of hardcoded noreturn ("panic") methods from CFRefCount...
Jordy Rose [Sat, 20 Aug 2011 20:55:40 +0000 (20:55 +0000)]
[analyzer] Move handling of hardcoded noreturn ("panic") methods from CFRefCount to NoReturnFunctionChecker. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138210 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/lit.cfg: Enable "crash-recovery" tests on Win32 hosts. CrashRecoveryContext...
NAKAMURA Takumi [Sat, 20 Aug 2011 07:09:20 +0000 (07:09 +0000)]
test/lit.cfg: Enable "crash-recovery" tests on Win32 hosts. CrashRecoveryContext supports Win32 since r138199.

FIXME: Shall we eliminate the feature "crash-recovery"?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138201 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTypo spotted by Ivan Krasin.
Chad Rosier [Sat, 20 Aug 2011 06:56:17 +0000 (06:56 +0000)]
Typo spotted by Ivan Krasin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138200 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove this test. It requires C++ standard library headers, which we'd
Chandler Carruth [Sat, 20 Aug 2011 06:30:57 +0000 (06:30 +0000)]
Remove this test. It requires C++ standard library headers, which we'd
like to avoid within the Clang test suite, it doesn't verify the output
at all so it only servers as a test that Clang doesn't crash, and
finally all it does is declare a function that returns a vector and call
it. Probably the biggest thing being tested here is Clang's parsing of
the vector template, and we have lots of good template parsing tests. We
don't need another in codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138197 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. No need...
Ted Kremenek [Sat, 20 Aug 2011 06:23:25 +0000 (06:23 +0000)]
[analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment.  No need to bind an explicit value and create a new node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138196 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive visit...
Ted Kremenek [Sat, 20 Aug 2011 06:16:31 +0000 (06:16 +0000)]
[analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive visit to subexpressions (which is no longer needed).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138195 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStart partitioning ExprEngine.cpp into separate .cpp files that handle different...
Ted Kremenek [Sat, 20 Aug 2011 06:00:03 +0000 (06:00 +0000)]
Start partitioning ExprEngine.cpp into separate .cpp files that handle different parts
of the analysis (e.g., analysis of C expressions, analysis of Objective-C expressions, and so on).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138194 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename CXXExprEngine.cpp to ExprEngineCXX.cpp.
Ted Kremenek [Sat, 20 Aug 2011 05:59:58 +0000 (05:59 +0000)]
Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138193 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CodeGenCXX/2003-11-25-ReturningOpaqueByValue.cpp: Mark XFAIL: win32.
NAKAMURA Takumi [Sat, 20 Aug 2011 05:38:29 +0000 (05:38 +0000)]
test/CodeGenCXX/2003-11-25-ReturningOpaqueByValue.cpp: Mark XFAIL: win32.

FIXME: Avoid using system headers. clang cannot handle MS <vector> yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138190 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake the loading of multiple records for the same identifier (from
Douglas Gregor [Sat, 20 Aug 2011 05:09:43 +0000 (05:09 +0000)]
Make the loading of multiple records for the same identifier (from
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138189 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean out some minor cruft in the AST reader; no functionality change.
Douglas Gregor [Sat, 20 Aug 2011 04:58:43 +0000 (04:58 +0000)]
Clean out some minor cruft in the AST reader; no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138188 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a module visitation function that starts at the top-level
Douglas Gregor [Sat, 20 Aug 2011 04:39:52 +0000 (04:39 +0000)]
Introduce a module visitation function that starts at the top-level
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138187 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStatic Analyzer Diagnostics: Move the responsibility for generating the endOfPath...
Anna Zaks [Sat, 20 Aug 2011 01:27:22 +0000 (01:27 +0000)]
Static Analyzer Diagnostics: Move the responsibility for generating the endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138184 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove dead code.
Ted Kremenek [Sat, 20 Aug 2011 01:15:28 +0000 (01:15 +0000)]
Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138183 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove XFAIL/XTARGET since this is passing on the other bots.
Eric Christopher [Sat, 20 Aug 2011 01:08:46 +0000 (01:08 +0000)]
Remove XFAIL/XTARGET since this is passing on the other bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138182 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate, update and FileCheckize:
Eric Christopher [Sat, 20 Aug 2011 01:04:49 +0000 (01:04 +0000)]
Migrate, update and FileCheckize:

 2010-02-01-utf16-with-null.m
 2010-02-23-DbgInheritance.m
 2010-03-17-StructRef.m
 2011-03-08-IVarLookup.m

from llvm/test/FrontendObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138180 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate, update and FileCheckize:
Eric Christopher [Sat, 20 Aug 2011 00:49:25 +0000 (00:49 +0000)]
Migrate, update and FileCheckize:

2008-11-25-Blocks.m
2009-01-26-WriteBarrier-2.m
2009-02-05-VolatileProp.m
2009-08-05-utf16.m

from llvm/test/FrontendObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138175 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate, FileCheckize and update:
Eric Christopher [Sat, 20 Aug 2011 00:37:56 +0000 (00:37 +0000)]
Migrate, FileCheckize and update:

2007-04-03-ObjcEH.m
2007-05-02-Strong.m
2007-10-18-ProDescriptor.m
2007-10-23-GC-WriteBarrier.m
2008-10-3-EhValue.m
2008-11-12-Metadata.m
2008-11-24-ConstCFStrings.m

from llvm/test/FrontendObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138172 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate and update:
Eric Christopher [Sat, 20 Aug 2011 00:25:36 +0000 (00:25 +0000)]
Migrate and update:

2007-10-03-MetadataPointers.mm
2010-08-04-Template.mm
2010-08-06-X.Y-syntax.mm

from llvm/test/FrontendObjC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138167 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove this file, it's not much of a test and string headers cause
Eric Christopher [Sat, 20 Aug 2011 00:22:40 +0000 (00:22 +0000)]
Remove this file, it's not much of a test and string headers cause
problems on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138166 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate, FileCheckize and update:
Eric Christopher [Sat, 20 Aug 2011 00:17:18 +0000 (00:17 +0000)]
Migrate, FileCheckize and update:

2003-11-02-WeakLinkage.cpp
2003-11-18-PtrMemConstantInitializer.cpp
2003-11-25-ReturningOpaqueByValue.cpp
2003-11-27-MultipleInheritanceThunk.cpp
2003-11-29-DuplicatedCleanupTest.cpp
2003-12-08-ArrayOfPtrToMemberFunc.cpp
2004-01-11-DynamicInitializedConstant.cpp

from llvm/test/FrontendC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138162 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate, FileCheckize and update:
Eric Christopher [Sat, 20 Aug 2011 00:09:39 +0000 (00:09 +0000)]
Migrate, FileCheckize and update:

2004-03-08-ReinterpretCastCopy.cpp
2004-03-09-UnmangledBuiltinMethods.cpp
2004-03-15-CleanupsAndGotos.cpp
2004-06-08-LateTemplateInstantiation.cpp
2004-09-27-CompilerCrash.cpp
2004-09-27-DidntEmitTemplate.cpp
2004-11-27-ExceptionCleanupAssertion.cpp
2004-11-27-FriendDefaultArgCrash.cpp
2005-01-03-StaticInitializers.cpp

from llvm/test/FrontendC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138157 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoModify the check line to be happier on windows.
Eric Christopher [Fri, 19 Aug 2011 23:46:18 +0000 (23:46 +0000)]
Modify the check line to be happier on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138152 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove dead file.
Eric Christopher [Fri, 19 Aug 2011 23:45:03 +0000 (23:45 +0000)]
Remove dead file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138150 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate, FileCheckize and update:
Eric Christopher [Fri, 19 Aug 2011 23:41:35 +0000 (23:41 +0000)]
Migrate, FileCheckize and update:

2005-02-11-AnonymousUnion.cpp
2005-02-13-BadDynamicInit.cpp
2005-02-14-BitFieldOffset.cpp
2005-02-19-BitfieldStructCrash.cpp
2005-02-19-UnnamedVirtualThunkArgument.cpp
2005-02-20-BrokenReferenceTest.cpp
2006-03-01-GimplifyCrash.cpp
2006-03-06-C++RecurseCrash.cpp
2006-09-12-OpaqueStructCrash.cpp
2006-10-30-ClassBitfield.cpp
2006-11-20-GlobalSymbols.cpp
2006-11-20-GlobalSymbols.ll
2006-11-30-ConstantExprCrash.cpp

from llvm/test/FrontendC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138148 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd new test.
Devang Patel [Fri, 19 Aug 2011 23:26:54 +0000 (23:26 +0000)]
Add new test.
Remove one outdated test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138144 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStatic Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. BugRepor...
Anna Zaks [Fri, 19 Aug 2011 23:21:56 +0000 (23:21 +0000)]
Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. BugReport no longer needs to inherit from BugReporterVisitor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138142 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTry removing xfail and xtarget to see if this brings back a couple of bots.
Eric Christopher [Fri, 19 Aug 2011 23:17:46 +0000 (23:17 +0000)]
Try removing xfail and xtarget to see if this brings back a couple of bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138139 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate 2007-01-02-UnboundedArray.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 23:15:04 +0000 (23:15 +0000)]
Migrate 2007-01-02-UnboundedArray.cpp from llvm/test/FrontendC++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138138 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMigrate:
Eric Christopher [Fri, 19 Aug 2011 23:08:33 +0000 (23:08 +0000)]
Migrate:

2007-01-06-PtrMethodInit.cpp
2007-04-05-PackedBitFields-1.cpp
2007-04-05-PackedBitFieldsOverlap-2.cpp
2007-04-05-PackedBitFieldsOverlap.cpp
2007-04-05-PackedBitFieldsSmall.cpp
2007-04-05-StructPackedFieldUnpacked.cpp
2007-04-10-PackedUnion.cpp
2007-04-14-FNoBuiltin.cpp
2007-05-03-VectorInit.cpp
2007-07-29-RestrictPtrArg.cpp
2007-07-29-RestrictRefArg.cpp
2007-09-10-RecursiveTypeResolution.cpp

from llvm/test/FrontendC++ and FileCheckize where appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138134 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFor assigning SourceLocations to macro arg tokens, reserve a single SLocEntry
Argyrios Kyrtzidis [Fri, 19 Aug 2011 22:34:17 +0000 (22:34 +0000)]
For assigning SourceLocations to macro arg tokens, reserve a single SLocEntry
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%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138129 91177308-0d34-0410-b5e6-96231b3b80d8