]> granicus.if.org Git - clang/log
clang
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

13 years agoRename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMacroDefLoc, no...
Argyrios Kyrtzidis [Fri, 19 Aug 2011 22:34:14 +0000 (22:34 +0000)]
Rename TokenLexer::getMacroExpansionLocation -> getExpansionLocForMacroDefLoc, no functionality change.

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

13 years agoRefactor common functionality into SourceManager::getFileIDSize, no functionality...
Argyrios Kyrtzidis [Fri, 19 Aug 2011 22:34:01 +0000 (22:34 +0000)]
Refactor common functionality into SourceManager::getFileIDSize, no functionality change.

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

13 years agoStatic Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) API in...
Anna Zaks [Fri, 19 Aug 2011 22:33:38 +0000 (22:33 +0000)]
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.

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

13 years agoRemove 2008-10-29-WrongOffset.cpp since it requires a header file on all
Eric Christopher [Fri, 19 Aug 2011 22:25:04 +0000 (22:25 +0000)]
Remove 2008-10-29-WrongOffset.cpp since it requires a header file on all
platforms.

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

13 years agoMigrate 2007-10-01-StructResize.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 22:25:02 +0000 (22:25 +0000)]
Migrate 2007-10-01-StructResize.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2008-01-12-VecInit.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 22:16:30 +0000 (22:16 +0000)]
Migrate 2008-01-12-VecInit.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2008-05-07-CrazyOffsetOf.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 22:16:28 +0000 (22:16 +0000)]
Migrate 2008-05-07-CrazyOffsetOf.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2008-10-29-WrongOffset.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 22:16:25 +0000 (22:16 +0000)]
Migrate 2008-10-29-WrongOffset.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-03-17-dbg.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 22:16:23 +0000 (22:16 +0000)]
Migrate 2009-03-17-dbg.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-04-23-bool2.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 22:16:21 +0000 (22:16 +0000)]
Migrate 2009-04-23-bool2.cpp from llvm/test/FrontendC++.

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

13 years agoRemove this test. It's failing and it's not that good of a test.
Eric Christopher [Fri, 19 Aug 2011 22:00:44 +0000 (22:00 +0000)]
Remove this test. It's failing and it's not that good of a test.

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

13 years agoMigrate 2009-06-16-DebugInfoCrash.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 21:51:07 +0000 (21:51 +0000)]
Migrate 2009-06-16-DebugInfoCrash.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-07-16-PrivateCopyConstructor.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 21:51:05 +0000 (21:51 +0000)]
Migrate 2009-07-16-PrivateCopyConstructor.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-08-05-ZeroInitWidth.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 21:51:03 +0000 (21:51 +0000)]
Migrate 2009-08-05-ZeroInitWidth.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-07-16-Using.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 21:51:01 +0000 (21:51 +0000)]
Migrate 2009-07-16-Using.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-08-11-VectorRetTy.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 21:50:59 +0000 (21:50 +0000)]
Migrate 2009-08-11-VectorRetTy.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-09-09-packed-layout.cpp test from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 21:24:41 +0000 (21:24 +0000)]
Migrate 2009-09-09-packed-layout.cpp test from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-10-27-crash.cpp from llvm/test/FrontendC++.
Eric Christopher [Fri, 19 Aug 2011 21:24:39 +0000 (21:24 +0000)]
Migrate 2009-10-27-crash.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate 2009-12-23-MissingSext.cpp from test/FrontendC++ and modify
Eric Christopher [Fri, 19 Aug 2011 21:24:37 +0000 (21:24 +0000)]
Migrate 2009-12-23-MissingSext.cpp from test/FrontendC++ and modify
for sext -> and difference.

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

13 years agoRemove another unused function from ModuleManager. We have no notion of a 'last'...
Douglas Gregor [Fri, 19 Aug 2011 21:20:08 +0000 (21:20 +0000)]
Remove another unused function from ModuleManager. We have no notion of a 'last' module any more

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

13 years agoRemove unused function ModuleManager::exportLookup()
Douglas Gregor [Fri, 19 Aug 2011 21:12:29 +0000 (21:12 +0000)]
Remove unused function ModuleManager::exportLookup()

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

13 years agoDo not depend on the standard library on the system. Replace the #include with
Nick Lewycky [Fri, 19 Aug 2011 20:43:24 +0000 (20:43 +0000)]
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.

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

13 years agoImprove the correctness and accuracy of the message for -Wdynamic-class-memaccess
Matt Beaumont-Gay [Fri, 19 Aug 2011 20:40:18 +0000 (20:40 +0000)]
Improve the correctness and accuracy of the message for -Wdynamic-class-memaccess

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

13 years agoobjc-arc: @property definitions should default to (strong) when not
Fariborz Jahanian [Fri, 19 Aug 2011 19:28:44 +0000 (19:28 +0000)]
objc-arc: @property definitions should default to (strong) when not
specified. // rdar://9971982

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

13 years agoRevers r138040. Need to look at a few buildbot failures.
Fariborz Jahanian [Fri, 19 Aug 2011 18:02:47 +0000 (18:02 +0000)]
Revers r138040. Need to look at a few buildbot failures.

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

13 years agoobjective-c: Bring objective-c handling of decl context
Fariborz Jahanian [Fri, 19 Aug 2011 16:06:57 +0000 (16:06 +0000)]
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.

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

13 years agoRename -Wstrl-incorrect-size to -Wstrlcpy-strlcat-size. This warning really is just...
Ted Kremenek [Fri, 19 Aug 2011 14:35:32 +0000 (14:35 +0000)]
Rename -Wstrl-incorrect-size to -Wstrlcpy-strlcat-size.  This warning really is just specific to strlcpy and strlcat.

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

13 years agoReflow code. No functionality change.
Benjamin Kramer [Fri, 19 Aug 2011 04:18:11 +0000 (04:18 +0000)]
Reflow code. No functionality change.

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

13 years agoWarn about and truncate UCNs that are too big for their character literal type.
Craig Topper [Fri, 19 Aug 2011 03:20:12 +0000 (03:20 +0000)]
Warn about and truncate UCNs that are too big for their character literal type.

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

13 years agoTeach ModuleManager::addModule() to check whether a particular module
Douglas Gregor [Fri, 19 Aug 2011 02:29:29 +0000 (02:29 +0000)]
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 "-".

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

13 years agoFix a memory leak in the analyzer - BugReports didn't get freed. Plus, remove invalid...
Anna Zaks [Fri, 19 Aug 2011 01:57:09 +0000 (01:57 +0000)]
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.

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

13 years agoFix the rest of the indent goofiness here.
Chandler Carruth [Fri, 19 Aug 2011 01:40:11 +0000 (01:40 +0000)]
Fix the rest of the indent goofiness here.

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

13 years agoFix an egregious formatting goof.
Chandler Carruth [Fri, 19 Aug 2011 01:38:33 +0000 (01:38 +0000)]
Fix an egregious formatting goof.

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

13 years agoAdd a completely hacky workaround for pch kext files with different extensions
Eric Christopher [Fri, 19 Aug 2011 00:30:14 +0000 (00:30 +0000)]
Add a completely hacky workaround for pch kext files with different extensions
when falling back to cc1plus for our compile.

rdar://9963920

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

13 years agoEnhance -Wstrl-incorrect-size to not report a FIXIT for destinations that are flexibl...
Ted Kremenek [Thu, 18 Aug 2011 22:48:41 +0000 (22:48 +0000)]
Enhance -Wstrl-incorrect-size to not report a FIXIT for destinations that are flexible arrays or have size 1.

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

13 years agoStatic Analyzer Diagnostics: Move custom diagnostic visitors from BugReporterContext...
Anna Zaks [Thu, 18 Aug 2011 22:37:56 +0000 (22:37 +0000)]
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.

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

13 years ago[libclang] Remove NestedNameSpecifierVisit, as Clang says that this code is dead.
Ted Kremenek [Thu, 18 Aug 2011 22:25:21 +0000 (22:25 +0000)]
[libclang] Remove NestedNameSpecifierVisit, as Clang says that this code is dead.

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

13 years agoDon't accept a typo correction if the corrected identifier is the same as the
Kaelyn Uhrain [Thu, 18 Aug 2011 21:57:36 +0000 (21:57 +0000)]
Don't accept a typo correction if the corrected identifier is the same as the
uncorrected identifier. Fixes a problem pointed out by Eli.

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

13 years agoRemove main() *errors* from warning group.
Ted Kremenek [Thu, 18 Aug 2011 21:20:46 +0000 (21:20 +0000)]
Remove main() *errors* from warning group.

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

13 years agoReapply r137903, but fix the definition of size_t in the test case to use __SIZE_TYPE...
Ted Kremenek [Thu, 18 Aug 2011 20:55:45 +0000 (20:55 +0000)]
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.

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

13 years ago[libclang] Support code-completion inside macro arguments.
Argyrios Kyrtzidis [Thu, 18 Aug 2011 19:41:28 +0000 (19:41 +0000)]
[libclang] Support code-completion inside macro arguments.

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

13 years agoTemporarily revert r137925 to appease buildbots. Original commit message:
Chad Rosier [Thu, 18 Aug 2011 19:06:24 +0000 (19:06 +0000)]
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.

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

13 years agoAdd a test for checking that custom diagnostic visitors are working.
Anna Zaks [Thu, 18 Aug 2011 19:02:46 +0000 (19:02 +0000)]
Add a test for checking that custom diagnostic visitors are working.

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

13 years agoRework DiagnoseInvalidRedeclaration to add the ability to correct typos when
Kaelyn Uhrain [Thu, 18 Aug 2011 18:19:12 +0000 (18:19 +0000)]
Rework DiagnoseInvalidRedeclaration to add the ability to correct typos when
diagnosing invalid function redeclarations.

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

13 years ago[libclang] Annotate correctly macro argument tokens.
Argyrios Kyrtzidis [Thu, 18 Aug 2011 18:03:34 +0000 (18:03 +0000)]
[libclang] Annotate correctly macro argument tokens.

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

13 years agoUse StringRef, rather than C string APIs.
Chad Rosier [Thu, 18 Aug 2011 17:56:32 +0000 (17:56 +0000)]
Use StringRef, rather than C string APIs.

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

13 years agoFixes traversal of class template nodes on template instantiations.
Manuel Klimek [Thu, 18 Aug 2011 16:50:43 +0000 (16:50 +0000)]
Fixes traversal of class template nodes on template instantiations.
Also fixes a spelling error.

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

13 years agoAdd support for MSVC __unaligned attribute. Necessary to parse MSVC headers in 64...
Francois Pichet [Thu, 18 Aug 2011 09:59:55 +0000 (09:59 +0000)]
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

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

13 years agoAlways mark friend function declarations in class templates as
Chandler Carruth [Thu, 18 Aug 2011 09:09:59 +0000 (09:09 +0000)]
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

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

13 years agoTeach ModuleManager::addModule() to check whether a particular module
Douglas Gregor [Thu, 18 Aug 2011 04:41:58 +0000 (04:41 +0000)]
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.

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

13 years agoKeep track of which modules have been loaded directly (e.g., via
Douglas Gregor [Thu, 18 Aug 2011 04:12:04 +0000 (04:12 +0000)]
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.

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

13 years agoRevert r137903, "Add experimental -Wstrlcpy-size warning that looks to see if the...
Ted Kremenek [Thu, 18 Aug 2011 02:18:02 +0000 (02:18 +0000)]
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.

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

13 years agoNo seriously, remove the unsupported warning options.
Chad Rosier [Thu, 18 Aug 2011 02:08:52 +0000 (02:08 +0000)]
No seriously, remove the unsupported warning options.

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

13 years agoFix a regression form r137894. Make sure the custom BugReporterVisitors get registred...
Anna Zaks [Thu, 18 Aug 2011 02:05:18 +0000 (02:05 +0000)]
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.

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

13 years agoRemove the last FIXMEs on -Wunused-comparison since it got moved to
Chandler Carruth [Thu, 18 Aug 2011 02:04:29 +0000 (02:04 +0000)]
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.

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

13 years agoFix off by one.
Chad Rosier [Thu, 18 Aug 2011 01:23:31 +0000 (01:23 +0000)]
Fix off by one.

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

13 years ago[driver] Implement in a more table-like manner and add many more warning options
Chad Rosier [Thu, 18 Aug 2011 01:18:28 +0000 (01:18 +0000)]
[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

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

13 years agoAdd documentation on -Weverything.
Ted Kremenek [Thu, 18 Aug 2011 01:17:05 +0000 (01:17 +0000)]
Add documentation on -Weverything.

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

13 years agoImplement '-Weverything', which enables all warnings except those explicitly mapped...
Ted Kremenek [Thu, 18 Aug 2011 01:12:56 +0000 (01:12 +0000)]
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.

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

13 years agoFor the MacroExpands preprocessor callback, also pass the SourceRange
Argyrios Kyrtzidis [Thu, 18 Aug 2011 01:05:45 +0000 (01:05 +0000)]
For the MacroExpands preprocessor callback, also pass the SourceRange
of expansion (for function macros it includes the right paren).

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

13 years agoAdd some more options that aren't handled by llvm-gcc on fallback.
Eric Christopher [Thu, 18 Aug 2011 00:26:15 +0000 (00:26 +0000)]
Add some more options that aren't handled by llvm-gcc on fallback.

This is going to be made a table.

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

13 years ago[driver] Don't generate diagnostics (i.e., preprocessed source) if reading
Chad Rosier [Thu, 18 Aug 2011 00:22:25 +0000 (00:22 +0000)]
[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. :)

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

13 years ago"-mavx" should also enable all other SSE levels.
Bruno Cardoso Lopes [Thu, 18 Aug 2011 00:07:03 +0000 (00:07 +0000)]
"-mavx" should also enable all other SSE levels.

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

13 years agoDowngrade "err_init_list_variable_narrowing" into a warning in Microsoft mode even...
Francois Pichet [Thu, 18 Aug 2011 00:04:08 +0000 (00:04 +0000)]
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.

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

13 years agoAdd experimental -Wstrlcpy-size warning that looks to see if the size argument for...
Ted Kremenek [Wed, 17 Aug 2011 23:40:36 +0000 (23:40 +0000)]
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.

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

13 years agoAdd more comments for BugReport.
Anna Zaks [Wed, 17 Aug 2011 23:36:16 +0000 (23:36 +0000)]
Add more comments for BugReport.

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

13 years agoRemove DiagBugReport by pulling it into its parent BugReport.
Anna Zaks [Wed, 17 Aug 2011 23:21:23 +0000 (23:21 +0000)]
Remove DiagBugReport by pulling it into its parent BugReport.

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

13 years agoFix else style. No functionality change intended.
Chad Rosier [Wed, 17 Aug 2011 23:08:45 +0000 (23:08 +0000)]
Fix else style.  No functionality change intended.

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

13 years agoRemove EnhancedBugReport and RangedBugReport - pull all the extra functionality they...
Anna Zaks [Wed, 17 Aug 2011 23:00:25 +0000 (23:00 +0000)]
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.

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

13 years agoFix typo.
Eric Christopher [Wed, 17 Aug 2011 22:59:59 +0000 (22:59 +0000)]
Fix typo.

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

13 years ago[libclang] Workaround potential race condition with code completion AllocatedResults...
Ted Kremenek [Wed, 17 Aug 2011 22:19:53 +0000 (22:19 +0000)]
[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.

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

13 years agoReorganize the return-type vs. expression checking code in
John McCall [Wed, 17 Aug 2011 22:09:46 +0000 (22:09 +0000)]
Reorganize the return-type vs. expression checking code in
block returns; no functionality change.

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

13 years agoSomehow I fouled up this test.
John McCall [Wed, 17 Aug 2011 22:04:02 +0000 (22:04 +0000)]
Somehow I fouled up this test.

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

13 years agoRemove an unnecessary assignment (to InstFromD).
Argyrios Kyrtzidis [Wed, 17 Aug 2011 21:35:28 +0000 (21:35 +0000)]
Remove an unnecessary assignment (to InstFromD).
Caught by the static analyzer!

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

13 years agoGather cleanups correctly in block return statements.
John McCall [Wed, 17 Aug 2011 21:34:14 +0000 (21:34 +0000)]
Gather cleanups correctly in block return statements.
Thanks to Ted for finding this with magic tools.

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

13 years ago[analyzer] Migrate assumption and binding handling from CFRefCount to RetainReleaseCh...
Jordy Rose [Wed, 17 Aug 2011 21:27:39 +0000 (21:27 +0000)]
[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.

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

13 years agoFix incorrect code indentation and silence dead store warning due to idiomatic code.
Ted Kremenek [Wed, 17 Aug 2011 21:09:35 +0000 (21:09 +0000)]
Fix incorrect code indentation and silence dead store warning due to idiomatic code.

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

13 years agoIn the AST file format, eliminate the CHAINED_METADATA record. Instead,
Douglas Gregor [Wed, 17 Aug 2011 21:07:30 +0000 (21:07 +0000)]
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.

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

13 years agoFix a handful of dead stores found by Clang's static analyzer. There's a bunch of...
Ted Kremenek [Wed, 17 Aug 2011 21:04:19 +0000 (21:04 +0000)]
Fix a handful of dead stores found by Clang's static analyzer.  There's a bunch of others I haven't touched.

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

13 years agoAdd a bit more comments to the BugReporter and friends.
Anna Zaks [Wed, 17 Aug 2011 20:25:08 +0000 (20:25 +0000)]
Add a bit more comments to the BugReporter and friends.

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