Jordy Rose
908426aae4
[analyzer] Make CFRefBug and CFRefReportVisitor not dependent on CFRefCount. Unfortunately, CFRefReport still is. No functionality change.
...
llvm-svn: 138388
2011-08-23 21:47:17 +00:00
Jordy Rose
fd13f6f56a
[analyzer] Cleanup: Move temporary declarations of CFRefCount variables closer to their uses. No functionality change.
...
llvm-svn: 138382
2011-08-23 21:06:32 +00:00
Argyrios Kyrtzidis
18c88a96eb
Remove one SourceManager::isInFileID overload and use isOffsetInFileID for the other.
...
llvm-svn: 138381
2011-08-23 21:02:45 +00:00
Argyrios Kyrtzidis
2797df6a24
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".
llvm-svn: 138380
2011-08-23 21:02:41 +00:00
Argyrios Kyrtzidis
e7f7516148
Introduce SourceManager::isInSLocAddrSpace and use it in TokenLexer instead of isInFileID
...
since it is a bit more efficient.
llvm-svn: 138379
2011-08-23 21:02:38 +00:00
Argyrios Kyrtzidis
5451a3973b
Rename SourceManager::isBeforeInSourceLocationOffset -> isBeforeInSLocAddrSpace.
...
llvm-svn: 138378
2011-08-23 21:02:35 +00:00
Argyrios Kyrtzidis
7a7ff681ee
TokenLexer::getExpansionLocForMacroDefLoc doesn't need to return an invalid SourceLocation.
...
llvm-svn: 138377
2011-08-23 21:02:32 +00:00
Argyrios Kyrtzidis
f6a3b0ca4b
In Lexer::isAtEndOfMacroExpansion use SourceManager::isInFileID and avoid
...
the extra SourceManager::getFileID call.
llvm-svn: 138376
2011-08-23 21:02:30 +00:00
Argyrios Kyrtzidis
296374b501
Move a couple of SourceManager functions out-of-line; no functionality change.
...
llvm-svn: 138375
2011-08-23 21:02:28 +00:00
Jordy Rose
20d4e68195
[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.
...
llvm-svn: 138374
2011-08-23 20:55:48 +00:00
Ted Kremenek
ee9848e20d
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>.
llvm-svn: 138372
2011-08-23 20:30:50 +00:00
Jordy Rose
bf77e51fa1
[analyzer] Move helper method Update from CFRefCount to RetainReleaseChecker. No functionality change.
...
llvm-svn: 138370
2011-08-23 20:27:16 +00:00
Eli Friedman
750a5916af
Cleanup to use helper.
...
llvm-svn: 138369
2011-08-23 20:22:34 +00:00
Eli Friedman
c616c5ff1a
Remove function parameter which always used the default value.
...
llvm-svn: 138368
2011-08-23 20:17:13 +00:00
Jordy Rose
6763e38736
[analyzer] Move helper method handleAutoreleaseCounts from CFRefCount to RetainReleaseChecker. No functionality change.
...
llvm-svn: 138365
2011-08-23 20:07:14 +00:00
Jordy Rose
298cc4d907
[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.
...
llvm-svn: 138358
2011-08-23 19:43:16 +00:00
Jordy Rose
7861276f47
[analyzer] Move symbol death leak analysis from CFRefCount to RetainReleaseChecker.
...
llvm-svn: 138353
2011-08-23 19:01:07 +00:00
Caitlin Sadowski
afbbd8e5ad
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.
llvm-svn: 138350
2011-08-23 18:46:34 +00:00
Eric Christopher
551ef45e85
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.
llvm-svn: 138343
2011-08-23 17:56:55 +00:00
Fariborz Jahanian
797f1e23f6
checking for __block variable captured by given
...
stmt expression, recursively walk down all substatements
of the stmt expression. // rdar://10001085
llvm-svn: 138334
2011-08-23 16:47:15 +00:00
Nico Weber
dd47363b3a
enable -fstack-protector on 10.5 for usermode binaries by default.
...
This matches gcc's behavior.
llvm-svn: 138324
2011-08-23 07:38:27 +00:00
Jordy Rose
212e459164
[analyzer] Only allocate retain summaries for interesting functions/messages. This is a minor saving of memory but doesn't seem to cost any performance.
...
llvm-svn: 138320
2011-08-23 04:27:15 +00:00
Matt Beaumont-Gay
56381b8502
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.
llvm-svn: 138318
2011-08-23 01:35:51 +00:00
Fariborz Jahanian
b50801f049
block IRgen - Fixes a crash when determining if given block variable
...
is captured by a given statement expression. // rdar://10001085
llvm-svn: 138314
2011-08-23 00:27:49 +00:00
Jordy Rose
f5b0234992
[analyzer] Rename CFRefCount's evalSummary method to evalCallOrMessage, since it no longer, uh, evaluates call summaries.
...
llvm-svn: 138313
2011-08-23 00:03:01 +00:00
Eli Friedman
c55efe4fb2
Make sure we don't inline functions marked with __attribute__((naked)). <rdar://problem/9973228>
...
llvm-svn: 138310
2011-08-22 23:55:33 +00:00
Jordy Rose
5b31d7acf7
[analyzer] Migrate the handling of retain-count-related RetEffects and ArgEffects from CFRefCount to RetainReleaseChecker. No intended functionality change.
...
llvm-svn: 138309
2011-08-22 23:48:23 +00:00
Anna Zaks
bd7972b49e
[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.
...
llvm-svn: 138296
2011-08-22 23:18:12 +00:00
Fariborz Jahanian
b66de9f37b
objc refactoring - minor clean up.
...
llvm-svn: 138276
2011-08-22 21:44:58 +00:00
Anna Zaks
76c3fb6a51
Static Analyzer Diagnostics: Allow checkers to add ExtraDescriptiveText, now renamed into ExtraText, to the diagnostic without subclassing BugReport.
...
llvm-svn: 138272
2011-08-22 20:31:28 +00:00
Fariborz Jahanian
a646084550
objc - use existing API for temporary switch of
...
objc's decl context.
llvm-svn: 138267
2011-08-22 20:15:24 +00:00
Ted Kremenek
618e574253
Do not perform check for missing '[super dealloc]' under ARC as calling -dealloc is illegal in that mode.
...
llvm-svn: 138261
2011-08-22 19:07:43 +00:00
Anna Zaks
752de1443f
Clean up the CFRefBugReport - remove the members, which got moved to the CFRefReportVisitors.
...
llvm-svn: 138259
2011-08-22 18:54:07 +00:00
Eli Friedman
4acfbcd918
Don't warn on varaidic macros in C++0x mode.
...
llvm-svn: 138257
2011-08-22 18:48:28 +00:00
Fariborz Jahanian
f36734dd2a
objc - minor comment fix up and cleanup.
...
llvm-svn: 138253
2011-08-22 18:34:22 +00:00
Fariborz Jahanian
4bf8262a43
objc - Simplify switing objc decl context by using
...
a context switching object.
llvm-svn: 138248
2011-08-22 17:59:19 +00:00
Nico Weber
715abaf213
Warn on missing [super dealloc] calls.
...
This matches gcc's logic. Half of PR10661.
llvm-svn: 138240
2011-08-22 17:25:57 +00:00
Chandler Carruth
41c6dcc734
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.
llvm-svn: 138239
2011-08-22 17:24:56 +00:00
Fariborz Jahanian
899c365257
objc- checking for objc decl context range is unreliable and
...
subject to change. Check for equality instead.
llvm-svn: 138238
2011-08-22 17:13:51 +00:00
Argyrios Kyrtzidis
c7e50c5cbd
Fix a bug in objc @encoding of C++ classes.
...
llvm-svn: 138235
2011-08-22 16:03:14 +00:00
Fariborz Jahanian
8d382dc781
Restore patch I reversed in r138040. Known buildbot
...
failures are resolved.
llvm-svn: 138234
2011-08-22 15:54:49 +00:00
Zhongxing Xu
aec683afec
Fix typo.
...
llvm-svn: 138227
2011-08-22 02:05:13 +00:00
Argyrios Kyrtzidis
8d32f754b8
Fix gcc build.
...
llvm-svn: 138226
2011-08-21 23:49:52 +00:00
Argyrios Kyrtzidis
61ef3db222
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.
llvm-svn: 138225
2011-08-21 23:33:04 +00:00
Jordy Rose
898a148d28
[analyzer] Migrate the aliasing effects of CFRetain and CFMakeCollectable from CFRefCount to RetainReleaseChecker. No intended functionality change.
...
llvm-svn: 138223
2011-08-21 21:58:18 +00:00
Jordy Rose
6582dde545
[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.)
...
llvm-svn: 138221
2011-08-21 21:04:38 +00:00
Jordy Rose
3f7f7568f2
[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.
...
llvm-svn: 138220
2011-08-21 19:41:36 +00:00
Jordy Rose
82c673de33
[analyzer] Replace calls to getNameAsString() with StringRef equivalents.
...
llvm-svn: 138215
2011-08-21 05:25:15 +00:00
Benjamin Kramer
3cca223a2a
Fix compile on platforms that don't implicitly include stdarg.h here.
...
llvm-svn: 138214
2011-08-20 21:50:41 +00:00
Jordy Rose
a8f99ba749
[analyzer] RetainReleaseChecker always wants region change updates. There's no need for a flag, at least not right now.
...
llvm-svn: 138212
2011-08-20 21:17:59 +00:00
Jordy Rose
5c252ef7b1
Fix indentation.
...
llvm-svn: 138211
2011-08-20 21:16:58 +00:00
Jordy Rose
5a3c9ff3a3
[analyzer] Move handling of hardcoded noreturn ("panic") methods from CFRefCount to NoReturnFunctionChecker. No functionality change intended.
...
llvm-svn: 138210
2011-08-20 20:55:40 +00:00
NAKAMURA Takumi
fbd46b0736
test/lit.cfg: Enable "crash-recovery" tests on Win32 hosts. CrashRecoveryContext supports Win32 since r138199.
...
FIXME: Shall we eliminate the feature "crash-recovery"?
llvm-svn: 138201
2011-08-20 07:09:20 +00:00
Chad Rosier
aa9e24133f
Typo spotted by Ivan Krasin.
...
llvm-svn: 138200
2011-08-20 06:56:17 +00:00
Chandler Carruth
4e6bd3955f
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.
llvm-svn: 138197
2011-08-20 06:30:57 +00:00
Ted Kremenek
60d2ec5765
[analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. No need to bind an explicit value and create a new node.
...
llvm-svn: 138196
2011-08-20 06:23:25 +00:00
Ted Kremenek
876e34b7b5
[analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive visit to subexpressions (which is no longer needed).
...
llvm-svn: 138195
2011-08-20 06:16:31 +00:00
Ted Kremenek
a9ce612fa2
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).
llvm-svn: 138194
2011-08-20 06:00:03 +00:00
Ted Kremenek
10e2503177
Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.
...
llvm-svn: 138193
2011-08-20 05:59:58 +00:00
NAKAMURA Takumi
d0dc49e640
test/CodeGenCXX/2003-11-25-ReturningOpaqueByValue.cpp: Mark XFAIL: win32.
...
FIXME: Avoid using system headers. clang cannot handle MS <vector> yet.
llvm-svn: 138190
2011-08-20 05:38:29 +00:00
Douglas Gregor
b36fc536d2
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.
llvm-svn: 138189
2011-08-20 05:09:43 +00:00
Douglas Gregor
18221d8eae
Clean out some minor cruft in the AST reader; no functionality change.
...
llvm-svn: 138188
2011-08-20 04:58:43 +00:00
Douglas Gregor
ab443b9da5
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.
llvm-svn: 138187
2011-08-20 04:39:52 +00:00
Anna Zaks
88255cc533
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.
...
llvm-svn: 138184
2011-08-20 01:27:22 +00:00
Ted Kremenek
417d566775
Remove dead code.
...
llvm-svn: 138183
2011-08-20 01:15:28 +00:00
Eric Christopher
e480b1ef3d
Remove XFAIL/XTARGET since this is passing on the other bots.
...
llvm-svn: 138182
2011-08-20 01:08:46 +00:00
Eric Christopher
b4da65e631
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.
llvm-svn: 138180
2011-08-20 01:04:49 +00:00
Eric Christopher
19de6c75fd
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.
llvm-svn: 138175
2011-08-20 00:49:25 +00:00
Eric Christopher
fde9786b44
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.
llvm-svn: 138172
2011-08-20 00:37:56 +00:00
Eric Christopher
2be76cd1b3
Migrate and update:
...
2007-10-03-MetadataPointers.mm
2010-08-04-Template.mm
2010-08-06-X.Y-syntax.mm
from llvm/test/FrontendObjC++.
llvm-svn: 138167
2011-08-20 00:25:36 +00:00
Eric Christopher
50507663a6
Remove this file, it's not much of a test and string headers cause
...
problems on windows.
llvm-svn: 138166
2011-08-20 00:22:40 +00:00
Eric Christopher
aab7dffa12
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++.
llvm-svn: 138162
2011-08-20 00:17:18 +00:00
Eric Christopher
6672b33511
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++.
llvm-svn: 138157
2011-08-20 00:09:39 +00:00
Eric Christopher
19eb735e27
Modify the check line to be happier on windows.
...
llvm-svn: 138152
2011-08-19 23:46:18 +00:00
Eric Christopher
862f8ecf55
Remove dead file.
...
llvm-svn: 138150
2011-08-19 23:45:03 +00:00
Eric Christopher
3bf8310d42
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++.
llvm-svn: 138148
2011-08-19 23:41:35 +00:00
Devang Patel
2de80d601a
Add new test.
...
Remove one outdated test.
llvm-svn: 138144
2011-08-19 23:26:54 +00:00
Anna Zaks
071a89c39f
Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. BugReport no longer needs to inherit from BugReporterVisitor.
...
llvm-svn: 138142
2011-08-19 23:21:56 +00:00
Eric Christopher
925d593b60
Try removing xfail and xtarget to see if this brings back a couple of bots.
...
llvm-svn: 138139
2011-08-19 23:17:46 +00:00
Eric Christopher
a8cd70e21a
Migrate 2007-01-02-UnboundedArray.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138138
2011-08-19 23:15:04 +00:00
Eric Christopher
17db038966
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.
llvm-svn: 138134
2011-08-19 23:08:33 +00:00
Argyrios Kyrtzidis
eeca36fe9a
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%.
llvm-svn: 138129
2011-08-19 22:34:17 +00:00
Argyrios Kyrtzidis
60617128e6
Rename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMacroDefLoc, no functionality change.
...
llvm-svn: 138128
2011-08-19 22:34:14 +00:00
Argyrios Kyrtzidis
34d729d46d
Refactor common functionality into SourceManager::getFileIDSize, no functionality change.
...
llvm-svn: 138127
2011-08-19 22:34:01 +00:00
Anna Zaks
f86615ca5c
Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) 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
2011-08-19 22:33:38 +00:00
Eric Christopher
7e88fdfecc
Remove 2008-10-29-WrongOffset.cpp since it requires a header file on all
...
platforms.
llvm-svn: 138118
2011-08-19 22:25:04 +00:00
Eric Christopher
5478583ac1
Migrate 2007-10-01-StructResize.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138117
2011-08-19 22:25:02 +00:00
Eric Christopher
cae25b58fc
Migrate 2008-01-12-VecInit.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138114
2011-08-19 22:16:30 +00:00
Eric Christopher
88279b7eb6
Migrate 2008-05-07-CrazyOffsetOf.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138113
2011-08-19 22:16:28 +00:00
Eric Christopher
fd4d7156ea
Migrate 2008-10-29-WrongOffset.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138112
2011-08-19 22:16:25 +00:00
Eric Christopher
a82c55ecf0
Migrate 2009-03-17-dbg.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138111
2011-08-19 22:16:23 +00:00
Eric Christopher
20429e90d7
Migrate 2009-04-23-bool2.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138110
2011-08-19 22:16:21 +00:00
Eric Christopher
b991a6ae87
Remove this test. It's failing and it's not that good of a test.
...
llvm-svn: 138106
2011-08-19 22:00:44 +00:00
Eric Christopher
b52ebc3e29
Migrate 2009-06-16-DebugInfoCrash.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138099
2011-08-19 21:51:07 +00:00
Eric Christopher
0c5f2a3bf1
Migrate 2009-07-16-PrivateCopyConstructor.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138098
2011-08-19 21:51:05 +00:00
Eric Christopher
69d6c3d31a
Migrate 2009-08-05-ZeroInitWidth.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138097
2011-08-19 21:51:03 +00:00
Eric Christopher
336a2bf4dd
Migrate 2009-07-16-Using.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138096
2011-08-19 21:51:01 +00:00
Eric Christopher
824e2e702f
Migrate 2009-08-11-VectorRetTy.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138095
2011-08-19 21:50:59 +00:00
Eric Christopher
1c241f741e
Migrate 2009-09-09-packed-layout.cpp test from llvm/test/FrontendC++.
...
llvm-svn: 138090
2011-08-19 21:24:41 +00:00
Eric Christopher
65534ba4a4
Migrate 2009-10-27-crash.cpp from llvm/test/FrontendC++.
...
llvm-svn: 138089
2011-08-19 21:24:39 +00:00
Eric Christopher
16bfebc42c
Migrate 2009-12-23-MissingSext.cpp from test/FrontendC++ and modify
...
for sext -> and difference.
llvm-svn: 138088
2011-08-19 21:24:37 +00:00
Douglas Gregor
8c5af41b76
Remove another unused function from ModuleManager. We have no notion of a 'last' module any more
...
llvm-svn: 138081
2011-08-19 21:20:08 +00:00
Douglas Gregor
4ad83e69a0
Remove unused function ModuleManager::exportLookup()
...
llvm-svn: 138079
2011-08-19 21:12:29 +00:00
Nick Lewycky
d78cfd57eb
Do not depend on the standard library on the system. Replace the #include with
...
the relevant section of libcxx.
As an aside, I am not at all confident that this test is still testing that it's
supposed to.
llvm-svn: 138075
2011-08-19 20:43:24 +00:00
Matt Beaumont-Gay
335e653fe6
Improve the correctness and accuracy of the message for -Wdynamic-class-memaccess
...
llvm-svn: 138074
2011-08-19 20:40:18 +00:00
Fariborz Jahanian
7e47de3156
objc-arc: @property definitions should default to (strong) when not
...
specified. // rdar://9971982
llvm-svn: 138062
2011-08-19 19:28:44 +00:00
Fariborz Jahanian
9a3b269ea1
Revers r138040. Need to look at a few buildbot failures.
...
llvm-svn: 138049
2011-08-19 18:02:47 +00:00
Fariborz Jahanian
d6d866d6fa
objective-c: Bring objective-c handling of decl context
...
to modernity. Instead of passing down individual
context objects from parser to sema, establish decl
context in parser and have sema access current context
as needed. I still need to take of Doug's comment for
minor cleanups.
llvm-svn: 138040
2011-08-19 16:06:57 +00:00
Ted Kremenek
369b3fa752
Rename -Wstrl-incorrect-size to -Wstrlcpy-strlcat-size. This warning really is just specific to strlcpy and strlcat.
...
llvm-svn: 138038
2011-08-19 14:35:32 +00:00
Benjamin Kramer
56b675f8a1
Reflow code. No functionality change.
...
llvm-svn: 138032
2011-08-19 04:18:11 +00:00
Craig Topper
6eb2058a6a
Warn about and truncate UCNs that are too big for their character literal type.
...
llvm-svn: 138031
2011-08-19 03:20:12 +00:00
Douglas Gregor
4dd3e948ef
Teach ModuleManager::addModule() to check whether a particular module
...
has already been loaded before allocating a new Module structure. If
the module has already been loaded (uniquing based on file name), then
just return the existing module rather than trying to load it again.
This allows us to load a DAG of modules. Introduce a simple test case
that forms a diamond-shaped module graph, and illustrates that a
source file importing the bottom of the diamond can see declarations
in all four of the modules that make up the diamond.
Note that this version moves the file-opening logic into the module
manager, rather than splitting it between the module manager and the
AST reader. More importantly, it properly handles the
weird-but-possibly-useful case of loading an AST file from "-".
llvm-svn: 138030
2011-08-19 02:29:29 +00:00
Anna Zaks
be28d6c66d
Fix a memory leak in the analyzer - BugReports didn't get freed. Plus, remove invalid assert from the destructor which wasn't called previously due to the leak.
...
llvm-svn: 138027
2011-08-19 01:57:09 +00:00
Chandler Carruth
e92e42f3fd
Fix the rest of the indent goofiness here.
...
llvm-svn: 138024
2011-08-19 01:40:11 +00:00
Chandler Carruth
f8b554f0f2
Fix an egregious formatting goof.
...
llvm-svn: 138023
2011-08-19 01:38:33 +00:00
Eric Christopher
84fbdb4a8f
Add a completely hacky workaround for pch kext files with different extensions
...
when falling back to cc1plus for our compile.
rdar://9963920
llvm-svn: 138017
2011-08-19 00:30:14 +00:00
Ted Kremenek
18db5d4e9d
Enhance -Wstrl-incorrect-size to not report a FIXIT for destinations that are flexible arrays or have size 1.
...
llvm-svn: 138004
2011-08-18 22:48:41 +00:00
Anna Zaks
f4dd4ae7cc
Static Analyzer Diagnostics: Move custom diagnostic visitors from BugReporterContext to BugReport.
...
One API change: I added BugReporter as an additional parameter to the BugReporterVisitor::VisitNode() method to allow visitors register other visitors with the report on the fly (while processing a node). This functionality is used by NilReceiverVisitor, which registers TrackNullOrUndefValue when the receiver is null.
llvm-svn: 138001
2011-08-18 22:37:56 +00:00
Ted Kremenek
288d31d62a
[libclang] Remove NestedNameSpecifierVisit, as Clang says that this code is dead.
...
llvm-svn: 137999
2011-08-18 22:25:21 +00:00
Kaelyn Uhrain
40aa7c91b6
Don't accept a typo correction if the corrected identifier is the same as the
...
uncorrected identifier. Fixes a problem pointed out by Eli.
llvm-svn: 137987
2011-08-18 21:57:36 +00:00
Ted Kremenek
0a57df1981
Remove main() *errors* from warning group.
...
llvm-svn: 137983
2011-08-18 21:20:46 +00:00
Ted Kremenek
6865f77fdd
Reapply r137903, but fix the definition of size_t in the test case to use __SIZE_TYPE__ (and hence be portable).
...
Also, change the warning to -Wstrl-incorrect-size.
llvm-svn: 137980
2011-08-18 20:55:45 +00:00
Argyrios Kyrtzidis
75f6cd2b79
[libclang] Support code-completion inside macro arguments.
...
llvm-svn: 137973
2011-08-18 19:41:28 +00:00
Chad Rosier
222e187e33
Temporarily revert r137925 to appease buildbots. Original commit message:
...
Teach ModuleManager::addModule() to check whether a particular module
has already been loaded before allocating a new Module structure. If
the module has already been loaded (uniquing based on file name), then
just return the existing module rather than trying to load it again.
This allows us to load a DAG of modules. Introduce a simple test case
that forms a diamond-shaped module graph, and illustrates that a
source file importing the bottom of the diamond can see declarations
in all four of the modules that make up the diamond.
llvm-svn: 137971
2011-08-18 19:06:24 +00:00
Anna Zaks
3c06d7f442
Add a test for checking that custom diagnostic visitors are working.
...
llvm-svn: 137970
2011-08-18 19:02:46 +00:00
Kaelyn Uhrain
fd81a350e2
Rework DiagnoseInvalidRedeclaration to add the ability to correct typos when
...
diagnosing invalid function redeclarations.
llvm-svn: 137966
2011-08-18 18:19:12 +00:00
Argyrios Kyrtzidis
035674d33c
[libclang] Annotate correctly macro argument tokens.
...
llvm-svn: 137961
2011-08-18 18:03:34 +00:00
Chad Rosier
2f8187933f
Use StringRef, rather than C string APIs.
...
llvm-svn: 137958
2011-08-18 17:56:32 +00:00
Manuel Klimek
d9d2138561
Fixes traversal of class template nodes on template instantiations.
...
Also fixes a spelling error.
llvm-svn: 137945
2011-08-18 16:50:43 +00:00
Francois Pichet
17ed020569
Add support for MSVC __unaligned attribute. Necessary to parse MSVC headers in 64-bit mode (ie: when _M_IA64 or _M_AMD64 is defined)
...
more info: http://msdn.microsoft.com/en-us/library/ms177389.aspx
llvm-svn: 137935
2011-08-18 09:59:55 +00:00
Chandler Carruth
48b2831d8a
Always mark friend function declarations in class templates as
...
implicitly instantiable, even if we don't see a body on the friend
function declaration. The body may simply have not yet been attached.
This fixes PR10666.
There may be an alternate, preferred implementation strategy, see my
FIXME. Review would definitely be appreciated Doug. =D
llvm-svn: 137934
2011-08-18 09:09:59 +00:00
Douglas Gregor
914eb7c18a
Teach ModuleManager::addModule() to check whether a particular module
...
has already been loaded before allocating a new Module structure. If
the module has already been loaded (uniquing based on file name), then
just return the existing module rather than trying to load it again.
This allows us to load a DAG of modules. Introduce a simple test case
that forms a diamond-shaped module graph, and illustrates that a
source file importing the bottom of the diamond can see declarations
in all four of the modules that make up the diamond.
llvm-svn: 137925
2011-08-18 04:41:58 +00:00
Douglas Gregor
df0c151ba6
Keep track of which modules have been loaded directly (e.g., via
...
-import-module) vs. loaded because some other module depends on
them. As part of doing this, pass down the module that caused a module
to be loaded directly, rather than assuming that we're loading a
chain. Finally, write out all of the directly-loaded modules when
serializing an AST file (using the new IMPORTS record), so that an AST
file can depend on more than one other AST file, all of which will be
loaded when that AST file is loaded. This allows us to form and load a
tree of modules, but we can't yet load a DAG of modules.
llvm-svn: 137923
2011-08-18 04:12:04 +00:00
Ted Kremenek
13fd55d85f
Revert r137903, "Add experimental -Wstrlcpy-size warning that looks to see if the size argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now)."
...
This currently doesn't work on Windows.
llvm-svn: 137920
2011-08-18 02:18:02 +00:00
Chad Rosier
f44aa3fe82
No seriously, remove the unsupported warning options.
...
llvm-svn: 137918
2011-08-18 02:08:52 +00:00
Anna Zaks
ab935f26e6
Fix a regression form r137894. Make sure the custom BugReporterVisitors get registred as they were in EnhancedBugReport. Would be good to add a test for this.
...
llvm-svn: 137917
2011-08-18 02:05:18 +00:00
Chandler Carruth
2b949c2b4b
Remove the last FIXMEs on -Wunused-comparison since it got moved to
...
entirely use the existing -Wunused-value infrastructure. This also fixes
a few missed cases for -Wunused in general.
llvm-svn: 137916
2011-08-18 02:04:29 +00:00
Chad Rosier
ee403fa613
Fix off by one.
...
llvm-svn: 137915
2011-08-18 01:23:31 +00:00
Chad Rosier
3045386527
[driver] Implement in a more table-like manner and add many more warning options
...
that aren't handled by llvm-gcc on fallback.
Enhancement to rdar://9964354
llvm-svn: 137912
2011-08-18 01:18:28 +00:00
Ted Kremenek
66bfc1db14
Add documentation on -Weverything.
...
llvm-svn: 137911
2011-08-18 01:17:05 +00:00
Ted Kremenek
fbbdcedc2e
Implement '-Weverything', which enables all warnings except those explicitly mapped to be ignored.
...
Currently this includes -pedantic warnings as well; we'll need to consider whether these should
be included.
This works as expected with -Werror.
Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into
their own test file.
llvm-svn: 137910
2011-08-18 01:12:56 +00:00
Argyrios Kyrtzidis
85a14bbd31
For the MacroExpands preprocessor callback, also pass the SourceRange
...
of expansion (for function macros it includes the right paren).
llvm-svn: 137909
2011-08-18 01:05:45 +00:00
Eric Christopher
cf41632cb1
Add some more options that aren't handled by llvm-gcc on fallback.
...
This is going to be made a table.
llvm-svn: 137907
2011-08-18 00:26:15 +00:00
Chad Rosier
d57133dcca
[driver] Don't generate diagnostics (i.e., preprocessed source) if reading
...
from stdin. This allows Eli and the like to continue with their debugging
trickery without loss of limb (or car) on my part. :)
llvm-svn: 137906
2011-08-18 00:22:25 +00:00
Bruno Cardoso Lopes
bf9246d1f0
"-mavx" should also enable all other SSE levels.
...
llvm-svn: 137905
2011-08-18 00:07:03 +00:00
Francois Pichet
4c7269474e
Downgrade "err_init_list_variable_narrowing" into a warning in Microsoft mode even if c++0x is enabled. This necessary to parse MSVC code in C++0x mode.
...
llvm-svn: 137904
2011-08-18 00:04:08 +00:00
Ted Kremenek
d5fe9e4d97
Add experimental -Wstrlcpy-size warning that looks to see if the size argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now).
...
Warning logic provided by Geoff Keating.
llvm-svn: 137903
2011-08-17 23:40:36 +00:00
Anna Zaks
db2acbc5dd
Add more comments for BugReport.
...
llvm-svn: 137901
2011-08-17 23:36:16 +00:00
Anna Zaks
525cfe7d28
Remove DiagBugReport by pulling it into its parent BugReport.
...
llvm-svn: 137899
2011-08-17 23:21:23 +00:00
Chad Rosier
6fdf38bfbd
Fix else style. No functionality change intended.
...
llvm-svn: 137896
2011-08-17 23:08:45 +00:00
Anna Zaks
3a6bdf8f82
Remove EnhancedBugReport and RangedBugReport - pull all the extra functionality they provided into their parent BugReport. The only functional changes are: made getRanges() non const - it adds default range to Ranges if none are supplied, made getStmt() private, which was another FIXME.
...
llvm-svn: 137894
2011-08-17 23:00:25 +00:00
Eric Christopher
f901e85533
Fix typo.
...
llvm-svn: 137893
2011-08-17 22:59:59 +00:00
Ted Kremenek
5b8ad40664
[libclang] Workaround potential race condition with code completion AllocatedResults being freed after a CXTranslationUnit.
...
The Container USR's CXString had its underlying data owned by the CXTranslationUnit's string pool. This
would result in trying to access freed memory.
llvm-svn: 137887
2011-08-17 22:19:53 +00:00
John McCall
5500ef27be
Reorganize the return-type vs. expression checking code in
...
block returns; no functionality change.
llvm-svn: 137884
2011-08-17 22:09:46 +00:00
John McCall
7d92c70e6f
Somehow I fouled up this test.
...
llvm-svn: 137882
2011-08-17 22:04:02 +00:00
Argyrios Kyrtzidis
d5553f1c34
Remove an unnecessary assignment (to InstFromD).
...
Caught by the static analyzer!
llvm-svn: 137878
2011-08-17 21:35:28 +00:00
John McCall
75f92b519c
Gather cleanups correctly in block return statements.
...
Thanks to Ted for finding this with magic tools.
llvm-svn: 137877
2011-08-17 21:34:14 +00:00
Jordy Rose
217eb9043f
[analyzer] Migrate assumption and binding handling from CFRefCount to RetainReleaseChecker. This is mostly a textual move and required no supporting changes. No functionality change intended.
...
llvm-svn: 137874
2011-08-17 21:27:39 +00:00
Ted Kremenek
897af91e1a
Fix incorrect code indentation and silence dead store warning due to idiomatic code.
...
llvm-svn: 137870
2011-08-17 21:09:35 +00:00
Douglas Gregor
29cc642f68
In the AST file format, eliminate the CHAINED_METADATA record. Instead,
...
all AST files have a normal METADATA record that has the same form
regardless of whether we refer to a chained PCH or any other kind of
AST file.
Introduce the IMPORTS record, which describes all of the AST files
that are imported by this AST file, and how (as a module, a PCH file,
etc.). Currently, we emit at most one entry to this record, to support
chained PCH.
llvm-svn: 137869
2011-08-17 21:07:30 +00:00
Ted Kremenek
c14efa7122
Fix a handful of dead stores found by Clang's static analyzer. There's a bunch of others I haven't touched.
...
llvm-svn: 137867
2011-08-17 21:04:19 +00:00
Anna Zaks
8af4bbc60a
Add a bit more comments to the BugReporter and friends.
...
llvm-svn: 137859
2011-08-17 20:25:08 +00:00
Argyrios Kyrtzidis
d8b87a8b2e
[libclang] Implicit objc methods are skipped, no need to check isSynthesized.
...
Plus, isSynthesized returning true does not mean that there is not a user-declared method declaration.
llvm-svn: 137858
2011-08-17 20:15:55 +00:00
Argyrios Kyrtzidis
004df6e053
Mark objc methods that are implicitly declared for properties (not user-declared) as implicit.
...
This results in libclang ignoring such methods.
llvm-svn: 137852
2011-08-17 19:25:08 +00:00
Douglas Gregor
14208800fa
Fix -ferror-limit= to properly emit notes following the last error
...
messages. Fi from David Blaikie, tests from Nikola Smiljanic!
llvm-svn: 137851
2011-08-17 19:13:00 +00:00
Chad Rosier
23594f6b44
Fix iterator end for r137842.
...
llvm-svn: 137849
2011-08-17 18:51:56 +00:00
Chad Rosier
bc5ea3d4b9
[driver] Clang doesn't support -mkernel/-fapple-kext for i386, so it's
...
automatically invoking llvm-gcc's cc1plus, which doesn't support all options
supported by Clang. Therefore, filter out unsupported options.
rdar://9964354
llvm-svn: 137842
2011-08-17 18:24:55 +00:00
Eli Friedman
872900987d
Add additional path to Linux toolchain. Patch by Will Dietz. PR10690.
...
llvm-svn: 137839
2011-08-17 18:17:26 +00:00
Nico Weber
80806a7b91
Add Gentoo gcc 4.3.4 include paths
...
llvm-svn: 137834
2011-08-17 17:55:30 +00:00
Argyrios Kyrtzidis
3fce368d87
[python] Fix bug of the SourceLocation binding.
...
Patch by Anders Waldenborg!
llvm-svn: 137829
2011-08-17 17:20:24 +00:00
Argyrios Kyrtzidis
8f6bd2d653
[python] Add test_type.py by Anders Waldenborg, which I forgot to commit in r137797.
...
llvm-svn: 137828
2011-08-17 17:01:10 +00:00
Chandler Carruth
463394752b
Whitelist operator== and operator!= as valid for unused value warnings,
...
even when overloaded and user-defined. These operators are both more
valuable to warn on (due to likely typos) and extremely unlikely to be
reasonable for use to trigger side-effects.
llvm-svn: 137823
2011-08-17 09:49:44 +00:00
Chandler Carruth
e2669397f1
Treating the unused equality comparisons as something other than part of
...
-Wunused was a mistake. It resulted in duplicate warnings and lots of
other hacks. Instead, this should be a special sub-category to
-Wunused-value, much like -Wunused-result is.
Moved to -Wunused-comparison, moved the implementation to piggy back on
the -Wunused-value implementation instead of rolling its own, different
mechanism for catching all of the "interesting" statements.
I like the unused-value mechanism for this better, but its currently
missing several top-level statements. For now, I've FIXME-ed out those
test cases. I'll enhance the generic infrastructure to catch these
statements in a subsequent patch.
This patch also removes the cast-to-void fixit hint. This hint isn't
available on any of the other -Wunused-value diagnostics, and if we want
it to be, we should add it generically rather than in one specific case.
llvm-svn: 137822
2011-08-17 09:34:37 +00:00
Chandler Carruth
29027b9352
Fix this test which had encoded the typo fixed in r137814.
...
llvm-svn: 137821
2011-08-17 08:56:14 +00:00
Chandler Carruth
e89ca5f7d2
Don't suggest assignment in implausible situation. We still warn, as the
...
code is very likely to be buggy, but its going to require more
significant changes on the part of the user to correct it in this case.
llvm-svn: 137820
2011-08-17 08:38:11 +00:00
Chandler Carruth
ae51ecc57b
Introduce a new warning, -Wtop-level-comparison. This warning is
...
a complement to the warnings we provide in condition expressions. Much
like we warn on conditions such as:
int x, y;
...
if (x = y) ... // Almost always a typo of '=='
This warning applies the complementary logic to "top-level" statements,
or statements whose value is not consumed or used in some way:
int x, y;
...
x == y; // Almost always a type for '='
We also mirror the '!=' vs. '|=' logic.
The warning is designed to fire even for overloaded operators for two reasons:
1) Especially in the presence of widespread templates that assume
operator== and operator!= perform the expected comparison operations,
it seems unreasonable to suppress warnings on the offchance that
a user has written a class that abuses these operators, embedding
side-effects or other magic within them.
2) There is a trivial source modification to silence the warning for
truly exceptional cases:
(void)(x == y); // No warning
A (greatly reduced) form of this warning has already caught a number of
bugs in our codebase, so there is precedent for it actually firing. That
said, its currently off by default, but enabled under -Wall.
There are several fixmes left here that I'm working on in follow-up
patches, including de-duplicating warnings from -Wunused, sharing code
with -Wunused's implementation (and creating a nice place to hook
diagnostics on "top-level" statements), and handling cases where a proxy
object with a bool conversion is returned, hiding the operation in the
cleanup AST nodes.
Suggestions for any of this code more than welcome. Also, I'd really
love suggestions for better naming than "top-level".
llvm-svn: 137819
2011-08-17 08:38:04 +00:00
Jordy Rose
c1470290c3
Hook up -W[no-]analyzer-incompatible-plugin to new warning, and unbreak buildbot.
...
llvm-svn: 137816
2011-08-17 06:25:12 +00:00
Jordy Rose
9c09ce48b4
Fix typo.
...
llvm-svn: 137814
2011-08-17 05:00:56 +00:00
Jordy Rose
075d73bcce
[analyzer] Add a warning for an incompatible plugin version.
...
llvm-svn: 137813
2011-08-17 04:56:03 +00:00
Benjamin Kramer
8b3929d956
Silence compiler warnings by casting object pointers to function pointers via intptr_t.
...
This is ugly but ISO C++ doesn't allow direct casts.
llvm-svn: 137812
2011-08-17 04:22:25 +00:00
Jordy Rose
ae55cf2f90
Don't use BuiltinBug in analyzer plugin example.
...
llvm-svn: 137811
2011-08-17 03:23:51 +00:00
Jordy Rose
9db0719242
[analyzer] Add some documentation for the new analyzer plugin infrastructure.
...
llvm-svn: 137805
2011-08-17 02:15:41 +00:00
NAKAMURA Takumi
203f87ccb1
[MSVC] Fix a warning C4334 "'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)".
...
llvm-svn: 137803
2011-08-17 01:46:16 +00:00
Jordy Rose
93b86e494d
[analyzer] Add basic support for pluggable checkers.
...
llvm-svn: 137802
2011-08-17 01:30:59 +00:00
Francois Pichet
09af8c36d1
Add serialization support for ClassScopeFunctionSpecializationDecl.
...
llvm-svn: 137799
2011-08-17 01:06:54 +00:00
Argyrios Kyrtzidis
f872dc4c3b
[python] Add support for CXType to python bindings.
...
Patch by Anders Waldenborg!
llvm-svn: 137797
2011-08-17 00:43:03 +00:00
Argyrios Kyrtzidis
6f5bd2f630
[libclang] Make clang_getCursor able to handle locations that point inside macro arguments.
...
e.g. for:
\define INVOKE(METHOD, CLASS) [CLASS METHOD]
void test2() {
INVOKE(meth, MyClass);
}
Pointing at 'meth' will give a CXCursor_ObjCMessageExpr and pointing at 'MyClass'
will give a CXCursor_ObjCClassRef.
llvm-svn: 137796
2011-08-17 00:31:25 +00:00
Argyrios Kyrtzidis
161868db4c
Make Lexer::GetBeginningOfToken able to handle macro arg expansion locations.
...
llvm-svn: 137795
2011-08-17 00:31:23 +00:00
Argyrios Kyrtzidis
92a47bd997
Introduce SourceManager::getMacroArgExpandedLocation function.
...
If we pass it a source location that points inside a function macro argument,
the returned location will be the macro location in which the argument was expanded.
If a macro argument is used multiple times, the expanded location will
be at the first expansion of the argument.
e.g.
MY_MACRO(foo);
^
Passing a file location pointing at 'foo', will yield a macro location
where 'foo' was expanded into.
Make SourceManager::getLocation call getMacroArgExpandedLocation as well.
llvm-svn: 137794
2011-08-17 00:31:20 +00:00
Argyrios Kyrtzidis
ac199bffab
Make SourceManager::isBeforeInTranslationUnit handle macro locations correctly.
...
llvm-svn: 137793
2011-08-17 00:31:18 +00:00
Argyrios Kyrtzidis
a1d943a121
[PCH] When writing out ExpansionInfo, make sure we don't lose track if it's a macro arg expansion or not.
...
llvm-svn: 137792
2011-08-17 00:31:14 +00:00
Chandler Carruth
f87d6c00e7
Switch this code to use the more idiomatic 'dyn_cast' pattern.
...
llvm-svn: 137780
2011-08-16 22:30:10 +00:00
Eric Christopher
43b1188a71
Migrate test from llvm/test/FrontendC++.
...
llvm-svn: 137773
2011-08-16 21:41:54 +00:00
Eric Christopher
ed78181605
Migrate from llvm/test/FrontendC++ and FileCheckize.
...
llvm-svn: 137772
2011-08-16 21:41:52 +00:00
Eric Christopher
77214ad172
Migrate from llvm/test/FrontendC++.
...
llvm-svn: 137771
2011-08-16 21:41:50 +00:00
Eric Christopher
38a7c55cae
Migrate test from llvm/test/FrontendC++ and FileCheckize.
...
llvm-svn: 137770
2011-08-16 21:41:48 +00:00
Eric Christopher
88fa0f0eb7
Migrate test from llvm/test/FrontendC++.
...
llvm-svn: 137769
2011-08-16 21:41:46 +00:00
Eric Christopher
3f98c99b07
Migrate from llvm/test/FrontendC++.
...
llvm-svn: 137768
2011-08-16 21:41:44 +00:00
Eric Christopher
82da54d872
Migrate from llvm/test/FrontendC++.
...
llvm-svn: 137767
2011-08-16 21:41:41 +00:00
Eric Christopher
2e4877fcb2
Migrate test from llvm/test/FrontendC++.
...
llvm-svn: 137766
2011-08-16 21:41:40 +00:00
Eric Christopher
f1b912b88e
Migrate from llvm/test/FrontendC++.
...
llvm-svn: 137765
2011-08-16 21:41:38 +00:00
Eric Christopher
74733d2e12
Migrate varargs.cpp from llvm/test/FrontendC++.
...
llvm-svn: 137764
2011-08-16 21:41:35 +00:00
Eric Christopher
9eeae42a6e
Migrate weak-external.cpp from llvm/test/FrontendC++.
...
llvm-svn: 137763
2011-08-16 21:41:33 +00:00
Eric Christopher
148bdfa58a
Migrate x86-64-abi-sret-vs-2word-struct-param.cpp from
...
llvm/test/FrontendC++ and FileCheckize.
llvm-svn: 137762
2011-08-16 21:41:31 +00:00
Eric Christopher
8a24ed567c
Migrate thunk-linkonce-odr.cpp from llvm/test/FrontendC++.
...
llvm-svn: 137761
2011-08-16 21:41:26 +00:00
Ted Kremenek
e1962328f5
[analyzer] teach ExprEngine about loads from static C++ class fields. Fixes <rdar://problem/9948787>.
...
llvm-svn: 137760
2011-08-16 21:37:52 +00:00
Jordy Rose
59cce71af6
[analyzer] Overhaul of checker registration in preparation for basic plugin support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages).
...
llvm-svn: 137758
2011-08-16 21:24:21 +00:00
Devang Patel
0e3a9f645b
Robustify test, there is no need to check metadata number which can change.
...
llvm-svn: 137752
2011-08-16 21:01:06 +00:00
Devang Patel
ffa30ab216
Finalize debug info after all deferred globals are emitted.
...
llvm-svn: 137750
2011-08-16 20:58:22 +00:00
Anna Zaks
a06421a02c
MacOSKeychainAPIChecker: Turn it on by default.
...
llvm-svn: 137740
2011-08-16 20:02:05 +00:00
Jim Grosbach
acb07b599c
Update createMCAsmParser() to match r137735.
...
llvm-svn: 137736
2011-08-16 18:33:55 +00:00
Anna Zaks
01ae1e1197
MacOSKeychainAPIChecker: Do not report double allocation if first allocation returned an error.
...
llvm-svn: 137720
2011-08-16 16:30:24 +00:00
Ted Kremenek
31fdb61618
[analyzer] Enhance ConditionVisitor to handle arbitrary ValueDecls in binary expressions, and also handle inverting the order of comparison when the named decl appears on the RHS.
...
llvm-svn: 137714
2011-08-16 10:57:37 +00:00
NAKAMURA Takumi
f665ce60c2
CMake: "clang-test" may not depend on check.deps.
...
...I believe it would not break anything...
FIXME: "check-all" may not be generated w/o LLVM_INCLUDE_TESTS.
llvm-svn: 137709
2011-08-16 03:45:31 +00:00
Ted Kremenek
01401a54f8
[analyzer] fix operation inversion calculation in ConditionVisitor.
...
llvm-svn: 137708
2011-08-16 03:44:38 +00:00
Ted Kremenek
667417ef9c
[analyzer] Enhance ConditionVisitor to understand eagerly evaluated (simple) binary conditions, and teach it to only focus on constraint changes.
...
llvm-svn: 137705
2011-08-16 01:53:41 +00:00
Ted Kremenek
b1bf2680f5
[analyzer] add ExprEngine::getEagerlyAssumedTags() to allow externally querying of "eagerly assumed" expressions.
...
llvm-svn: 137704
2011-08-16 01:53:39 +00:00
Ted Kremenek
9815709cd2
[analyzer] Remove PostStmtCustom ProgramPoint. It can be represented using tagged PostStmts.
...
llvm-svn: 137697
2011-08-16 00:49:19 +00:00
Argyrios Kyrtzidis
e593e7fe6f
Fix tests for non-darwin hosts.
...
llvm-svn: 137688
2011-08-15 23:43:33 +00:00
Eric Christopher
d4737be322
Move test from llvm/test/FrontendCXX and update.
...
llvm-svn: 137682
2011-08-15 23:24:31 +00:00
Anna Zaks
5443a6497b
MacOSKeychainAPIChecker: The security API/memory leak checker should always generate regular nodes instead of sink nodes.
...
llvm-svn: 137681
2011-08-15 23:23:15 +00:00
Ted Kremenek
32b9e234fe
Add ProgramState.cpp.
...
llvm-svn: 137677
2011-08-15 23:05:22 +00:00
Ted Kremenek
cb8473643b
Add missing header files.
...
llvm-svn: 137676
2011-08-15 23:03:51 +00:00
Devang Patel
e24d324762
Use new DIBuilder::finalize() at the end to wrap up debug info encoding for a translation unit.
...
llvm-svn: 137674
2011-08-15 23:01:55 +00:00
Eric Christopher
d9afc5c749
FileCheckize this test.
...
llvm-svn: 137671
2011-08-15 22:48:14 +00:00
Argyrios Kyrtzidis
2c7f4f133f
[libclang] Require explicit cursor visitation for all TypeLocs (compilation will
...
fail if a TypeLoc kind is not handled) and handle DecltypeTypeLoc and InjectedClassNameTypeLoc.
llvm-svn: 137670
2011-08-15 22:40:24 +00:00
Eric Christopher
bf005ecd9c
'pure' and 'const' functions should also be marked nounwind. Migrate
...
test over from llvm/test/FrontendC++ and update others to account for
the change.
llvm-svn: 137669
2011-08-15 22:38:22 +00:00
Ted Kremenek
faaef9e334
Take 2 (take 3?) at removing derelict clang.xcodeproj. All Xcode users should be using CMake, as the clang.xcodeproj is never up-to-date and cannot actually build Clang.
...
llvm-svn: 137666
2011-08-15 22:10:47 +00:00
Ted Kremenek
001fd5b498
Rename GRState to ProgramState, and cleanup some code formatting along the way.
...
llvm-svn: 137665
2011-08-15 22:09:50 +00:00
Argyrios Kyrtzidis
5ef35b7ce2
Fix the buildbot test.
...
llvm-svn: 137660
2011-08-15 21:45:01 +00:00
Richard Smith
a77a0a6bf2
Track in the AST whether a function is constexpr.
...
llvm-svn: 137653
2011-08-15 21:04:07 +00:00
Bob Wilson
11403367c0
Make -findirect-virtual-calls and -fterminated-vtables aliases of -fapple-kext.
...
Outside the driver, they were already treated that way, but the driver was not
giving them the same special treatment as -fapple-kext, e.g., falling back to
llvm-gcc for i386/Darwin kexts. Radar 9868422.
llvm-svn: 137639
2011-08-15 19:13:06 +00:00
Bob Wilson
08b3756633
Remove duplicate option.
...
llvm-svn: 137638
2011-08-15 19:13:02 +00:00
Argyrios Kyrtzidis
48ff9a0bd5
[libclang] Handle AttributedTypeLoc for cursor visitation. Fixes rdar://9535717.
...
llvm-svn: 137634
2011-08-15 18:44:43 +00:00
Anna Zaks
29f9b7adc3
MacOSKeychainAPIChecker: Use llvm::SmallString instead of std::string (as per code review for r137523).
...
llvm-svn: 137633
2011-08-15 18:42:00 +00:00
Matt Beaumont-Gay
0a0ba9d883
Add fixit notes for -Wconstant-logical-operand.
...
llvm-svn: 137620
2011-08-15 17:50:06 +00:00
Douglas Gregor
3ec7910e10
Teach reference initialization from the result of a user-defined
...
conversion to initialize the standard conversion *after* the
user-defined conversion properly. Fixes PR10644.
llvm-svn: 137608
2011-08-15 13:59:46 +00:00
Francois Pichet
127bea8f48
fix typo in test.
...
llvm-svn: 137592
2011-08-14 22:30:29 +00:00
Francois Pichet
daa7f2d613
Another typo found by Nico; Doug also warned me about it, but I didn't listen to him.
...
llvm-svn: 137591
2011-08-14 21:38:35 +00:00
Francois Pichet
5792825fb2
Fix typo.
...
llvm-svn: 137585
2011-08-14 14:28:49 +00:00
Eli Friedman
0be3970804
Fix r137086 to actually work properly in general. PR10650.
...
llvm-svn: 137574
2011-08-14 04:50:34 +00:00
Francois Pichet
00c7e6ceb1
Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.
...
Example:
template <class T>
class A {
public:
template <class U> void f(U p) { }
template <> void f(int p) { } // <== class scope specialization
};
This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.
llvm-svn: 137573
2011-08-14 03:52:19 +00:00
NAKAMURA Takumi
c77574a2e3
Fix "Uninitialized" warnings on g++-4.4.
...
In fact, they are false warnings but it seems g++-4.4 might be unable to know they must be false.
llvm-svn: 137568
2011-08-14 00:37:22 +00:00
Bob Wilson
0d45f58cbb
Reject -mkernel for i386/Darwin C++ code; fall back to llvm-gcc instead.
...
Since -mkernel implies -fapple-kext, this just extends the current behavior
for -fapple-kext to apply for -mkernel as well. Radar 9933387.
llvm-svn: 137566
2011-08-13 23:48:55 +00:00
Nico Weber
ed8080cb9f
Add support of -x objc-cpp-output, -x objc++-cpp-output to the Driver.
...
Matches gcc, and is also required for using ccache with clang.
llvm-svn: 137563
2011-08-13 23:13:37 +00:00
Nico Weber
c687cae11d
Accept -x objc++-cpp-output as an alias for -x objective-c++-cpp-output
...
This is the ObjC++ version of r129201. It's for example needed to use
ccache with clang.
llvm-svn: 137560
2011-08-13 19:03:50 +00:00
Jeffrey Yasskin
9a56e37927
Fix C++0x narrowing conversion errors in Clang.
...
llvm-svn: 137552
2011-08-13 05:47:04 +00:00
Bob Wilson
445c24f8f0
Move handling of vget_lane/vset_lane before the code that checks the type.
...
Unlike most of the other Neon intrinsics, these are not overloaded and do not
have the extra argument that specifies the vector type. This has not been
fatal because the lane number operand is supposed to be an ICE and so that
value has harmlessly been used as the type identifier. Radar 9901281.
llvm-svn: 137550
2011-08-13 05:03:46 +00:00
Anna Zaks
80319c1702
MacOSKeychainAPIChecker: Test all APIs.
...
llvm-svn: 137549
2011-08-13 02:10:15 +00:00
Chad Rosier
58b662c3e3
[driver] Make sure to update the iterator end when erasing for Args.
...
llvm-svn: 137539
2011-08-12 23:38:19 +00:00
Ted Kremenek
5ef32dbf2a
Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at.
...
llvm-svn: 137537
2011-08-12 23:37:29 +00:00
Eli Friedman
729ed799c7
Update clang tests for r137527.
...
llvm-svn: 137535
2011-08-12 23:33:52 +00:00
Chad Rosier
4f81fc21a0
[driver] When generating clang failure diagnostics, don't try to preprocess
...
inputs that aren't preprocessable.
llvm-svn: 137532
2011-08-12 23:30:05 +00:00
Chad Rosier
4bc3de4070
Return the proper type for objects when given a .o extension.
...
llvm-svn: 137531
2011-08-12 23:16:53 +00:00
Ted Kremenek
75fd43c61d
Document purpose of ProgramPointTag::getTagKind().
...
llvm-svn: 137530
2011-08-12 23:06:47 +00:00
Ted Kremenek
e8f7316fee
[analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*.
...
Having a notion of an actual ProgramPointTag will aid in introspection of the analyzer's behavior.
For example, the GraphViz output of the analyzer will pretty-print the tags in a useful manner.
llvm-svn: 137529
2011-08-12 23:04:46 +00:00
Anna Zaks
59d741fec6
MacOSKeychainAPIChecker: If the allocated data address entered as an enclosing function parameter, skip it to avoid false positives.
...
llvm-svn: 137526
2011-08-12 22:47:22 +00:00
Chad Rosier
ecdede8f5f
[driver] Refactor a bit to enable a few fixes when generating diagnostics. No functional change intended.
...
llvm-svn: 137524
2011-08-12 22:08:57 +00:00
Anna Zaks
fdd0aca0a5
MacOSKeychainAPIChecker:
...
Report errors earlier: on checkDeadSymbols() and clear the state after the symbol we are tracking goes out of scope.
Also, perform lazy error checking. Instead of forcing the paths to be split depending one the return value of the allocator, make the return symbol depend on the allocated data symbol, which prolongs its life span to the time when the allocated data symbol becomes dead.
llvm-svn: 137523
2011-08-12 21:56:43 +00:00
Jordy Rose
add45b78dd
[analyzer] Nitpicks on Olaf's patch, which I meant to e-mail but then didn't in
...
time. One is cleanup, the other is me being OCD about enum group nesting.
llvm-svn: 137517
2011-08-12 21:41:07 +00:00
Anna Zaks
c94894fbc2
MacOSKeychainAPIChecker: There is no need to use SymbolMetadata to represent the allocated data symbol, we can just use the symbol corresponding to the SymbolicRegion. This simplifies tracking of the symbol, for example, SymbolMetadata needs to go through extra hoops to stay alive.
...
Make AllocationState internal to the MacOSKeychainAPIChecker class.
llvm-svn: 137514
2011-08-12 21:14:26 +00:00
Jeffrey Yasskin
94f8c77931
Conversions to bool count as integer conversions for the purposes of
...
the C++0x narrowing error.
llvm-svn: 137512
2011-08-12 20:56:43 +00:00
Fariborz Jahanian
70a315c363
metadata generated by the compiler does not include the weak
...
attribute of a property. patch by Remy Demarest fixes it.
llvm-svn: 137509
2011-08-12 20:47:08 +00:00
Ted Kremenek
26794fe096
Place err_cfstring_literal_not_string_constant and warn_cfstring_truncated under "-WCFString" flag.
...
llvm-svn: 137508
2011-08-12 20:46:54 +00:00
Ted Kremenek
95c3b73f3a
Place diagnostic warn_stringcompare under the "-Wstring-compare" flag.
...
llvm-svn: 137507
2011-08-12 20:46:52 +00:00
Ted Kremenek
d713fec9cc
Place warnings related to incorrect "main()" declaration under "-Wmain".
...
llvm-svn: 137506
2011-08-12 20:46:49 +00:00
Ted Kremenek
8facefab10
Add -Wtypename-missing flag for diagnostic warn_typename_missing.
...
llvm-svn: 137505
2011-08-12 20:46:45 +00:00
Ted Kremenek
8df44b2632
[analyzer] Introduce new MemRegion, "TypedValueRegion", so that we can separate TypedRegions that implement getValueType() from those that don't.
...
Patch by Olaf Krzikalla!
llvm-svn: 137498
2011-08-12 20:02:48 +00:00
Richard Smith
def8bdbfac
Fix some comments.
...
llvm-svn: 137491
2011-08-12 18:44:32 +00:00
Chris Lattner
5ec04a51fa
switch clang to use the new-new way of creating llvm::StructType's.
...
llvm-svn: 137472
2011-08-12 17:43:31 +00:00
Douglas Gregor
c45c287ab6
Overriding the predefined Protocol isn't something that's actually
...
done and is likely to not work well anyway; take away this unnecessary
complexity.
llvm-svn: 137465
2011-08-12 17:09:30 +00:00
Ted Kremenek
50aa2d480c
Revert "Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping after an object was declared. Fixes PR 10620."
...
llvm-svn: 137459
2011-08-12 14:41:23 +00:00
Douglas Gregor
801c99d22d
Switch the __int128_t and __uint128_t types over to predefined types
...
in the AST format, which are built lazily by the ASTContext when
requested.
llvm-svn: 137437
2011-08-12 06:49:56 +00:00
NAKAMURA Takumi
5ae5353894
docs/doxygen.css: Import .memitem, .memproto and .memdoc from llvm/doxygen.
...
llvm-svn: 137435
2011-08-12 06:24:04 +00:00
Douglas Gregor
52e02808c5
Switch the Objective-C 'SEL' type over to a predefined type in the
...
AST file format, lazily generating the actual declaration in
ASTContext as needed.
llvm-svn: 137434
2011-08-12 06:17:30 +00:00
Douglas Gregor
0a58618a09
Switch the Objective-C 'Class' type over to a predefined type in the
...
AST file format, lazily generating the actual declaration in
ASTContext as needed.
llvm-svn: 137431
2011-08-12 05:59:41 +00:00
NAKAMURA Takumi
9f8a02d34e
De-Unicode-ify.
...
llvm-svn: 137430
2011-08-12 05:49:51 +00:00
Douglas Gregor
3ea7269b54
Move the creation of the predefined typedef for Objective-C's 'id'
...
type over into the AST context, then make that declaration a
predefined declaration in the AST format. This ensures that different
AST files will at least agree on the (global) declaration ID for 'id',
and eliminates one of the "special" types in the AST file format.
llvm-svn: 137429
2011-08-12 05:46:01 +00:00
Craig Topper
a2dee81dec
Fix a raw string literal test case to actually use a raw string literal.
...
llvm-svn: 137427
2011-08-12 04:09:37 +00:00
Ted Kremenek
06b8cd7324
Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping after an object was declared. Fixes PR 10620.
...
llvm-svn: 137426
2011-08-12 04:09:00 +00:00
Craig Topper
c0a06c5cfd
Fix a couple raw string literal tests
...
llvm-svn: 137422
2011-08-12 03:20:18 +00:00
Akira Hatanaka
ae31c7af1c
Alignment of a va_arg must be at least as large as the ABI's minimum alignment.
...
llvm-svn: 137420
2011-08-12 02:30:14 +00:00
NAKAMURA Takumi
e45db981e4
include/clang/Config/config.h.cmake: Reorder and reword to follow (generated) llvm/Config/config.h.in.
...
llvm-svn: 137415
2011-08-12 01:56:14 +00:00
Akira Hatanaka
dabfc21fbf
Add definition of a static member of a class.
...
llvm-svn: 137411
2011-08-12 01:43:14 +00:00
Douglas Gregor
851443c5b9
Collapse ASTWriter::WriteASTChain into ASTWriter::WriteASTCore,
...
eliminating a pile of redundant code (and probably some bugs in the
process). The variation between chained and non-chained PCH is fairly
small now anyway.
llvm-svn: 137410
2011-08-12 01:39:19 +00:00
Bill Wendling
023e761555
Remove extra semicolons.
...
llvm-svn: 137409
2011-08-12 01:29:32 +00:00
Nick Lewycky
1c5f3fa197
The diagtool registration system tries to use a global variable from a method
...
called on another global variable. Use ManagedStatic to ensure that the global
we register with actually exists when we need it.
llvm-svn: 137406
2011-08-12 01:14:22 +00:00
Anna Zaks
9b25cee36f
Optimizations for Dependent Symbol tracking (as per Ted's code review for r137309):
...
1) Change SymbolDependTy map to keep pointers as data. And other small tweaks like making the DenseMap smaller 64->16 elements; remove removeSymbolDependencies() as it will probably not be used.
2) Do not mark dependents live more then once.
llvm-svn: 137401
2011-08-12 00:34:56 +00:00
Douglas Gregor
dab42432d7
In the serialized AST format, make the translation unit a "predefined"
...
declaration that never actually gets serialized. Instead, serialize
the various kinds of update records (lexical decls, visible decls, the
addition of an anonymous namespace) for the translation unit, even if
we're not chaining. This way, we won't have to deal with multiple
loaded translation unit declarations.
llvm-svn: 137395
2011-08-12 00:15:20 +00:00
Argyrios Kyrtzidis
1d233f9a5e
Fix a PCH crash bug where we kept a reference inside a DenseMap while the map was getting modified.
...
No test case, sorry. It's one of those bugs where it's really really hard to make one. rdar://9910862.
llvm-svn: 137383
2011-08-11 23:26:42 +00:00
Ted Kremenek
d33c4d39a0
scan-build: enable C++ support by default.
...
llvm-svn: 137382
2011-08-11 22:47:20 +00:00
Richard Trieu
aee9e76722
The current warning in -Wnull-arithmetic for comparisons between NULL and non-pointers is not very helpful. This patch will update the wording to be more helpful to users.
...
Old warning:
warning: use of NULL in arithmetic operation [-Wnull-arithmetic]
return 10 <= NULL;
^ ~~~~
New warning:
warning: comparison between NULL and non-pointer ('int' and NULL) [-Wnull-arithmetic]
return 10 <= NULL;
~~ ^ ~~~~
llvm-svn: 137377
2011-08-11 22:38:21 +00:00
Douglas Gregor
aa8a827f08
When initializing a context from a particular AST file, check whether
...
either "special" type has already been initialized. Previously, we did
this check based on just the first special type (__builtin_va_list),
but now we have some NULL special type entries to content with.
llvm-svn: 137373
2011-08-11 22:18:49 +00:00
Ted Kremenek
228b5fefbb
Add diagtool-based test where we enforce that no additional warnings can be added to Clang without a -W flag.
...
llvm-svn: 137369
2011-08-11 22:06:55 +00:00
Douglas Gregor
09c4aa8177
The AST reader and writer don't need accessors for poking at the predefined Objective-C types
...
llvm-svn: 137366
2011-08-11 22:04:35 +00:00
Douglas Gregor
9767347b11
Encapsulate the Objective-C id/Class/SEL "redefinition" types in
...
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.
llvm-svn: 137349
2011-08-11 20:58:55 +00:00
Sean Callanan
da6df8a186
Extended the AST importer to support ParenTypes.
...
This is necessary to support importing certain
function pointer types.
llvm-svn: 137311
2011-08-11 16:56:07 +00:00
Anna Zaks
22a9d0f316
Analyzer Core: Adding support for user-defined symbol dependencies. (For example, the allocated resource symbol only needs to be freed if no error has been returned by the allocator, so a checker might want to make the lifespan of the error code symbol depend on the allocated resource symbol.) Note, by default, the map that holds the dependencies will get destroyed along with the SymbolManager at the end of function exploration.
...
llvm-svn: 137309
2011-08-11 16:43:28 +00:00
Craig Topper
6d64a738fa
Add tests for string literal concatenation.
...
llvm-svn: 137302
2011-08-11 05:57:09 +00:00
Craig Topper
5265bb211d
Raw string followup. Pass a couple StringRefs by value.
...
llvm-svn: 137301
2011-08-11 05:10:55 +00:00