]> granicus.if.org Git - clang/log
clang
13 years agoDon't warn on varaidic macros in C++0x mode.
Eli Friedman [Mon, 22 Aug 2011 18:48:28 +0000 (18:48 +0000)]
Don't warn on varaidic macros in C++0x mode.

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

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

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

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

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

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

This matches gcc's logic. Half of PR10661.

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

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

  const int &x = x;

This crashed by inifinetly recursing within the lvalue evaluation
routine. I've added a (somewhat) braindead way of preventing this
recursion. If folks have better suggestions for how to avoid it I'm all
ears.

That said, we have some work to do. This doesn't trigger a single
warning for uninitialized, self-initialized or otherwise completely
wrong code. In some senses, the crash was almost better.

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

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

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

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

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

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

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

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

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

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

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

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

Currently getMacroArgExpandedLocation is very inefficient and for the case
of a location pointing at the main file it will end up checking almost all of
the SLocEntries. Make it faster:

-Use a map of macro argument chunks to their expanded source location. The map
 is for a single source file, it's stored in the file's ContentCache and lazily
 computed, like the source lines cache.
-In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track
 of the number of FileIDs (files and macros) that were created during preprocessing
 of that particular file SLocEntry. This is useful when computing the macro argument
 map in skipping included files while scanning for macro arg FileIDs that lexed from
 a specific source file. Due to padding, the new field does not increase the size
 of SLocEntry.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

13 years agoMake the loading of multiple records for the same identifier (from
Douglas Gregor [Sat, 20 Aug 2011 05:09:43 +0000 (05:09 +0000)]
Make the loading of multiple records for the same identifier (from
different modules) more robust. It already handled (simple) merges of
the set of declarations attached to that identifier, so add a test
case that shows us getting two different declarations for the same
identifier (one struct, one function) from different modules, and are
able to use both of them.

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

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

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

13 years agoIntroduce a module visitation function that starts at the top-level
Douglas Gregor [Sat, 20 Aug 2011 04:39:52 +0000 (04:39 +0000)]
Introduce a module visitation function that starts at the top-level
modules (those that no other module depends on) and performs a search
over all of the modules, visiting a new module only when all of the
modules that depend on it have already been visited. The visitor can
abort the search for all modules that a module depends on, which
allows us to minimize the number of lookups necessary when performing
a search.

Switch identifier lookup from a linear walk over the set of modules to
this module visitation operation. The behavior is the same for simple
PCH and chained PCH, but provides the proper search order for
modules. Verified with printf debugging, since we don't have enough in
place to actually test this.

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

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

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

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

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

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

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

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

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

from llvm/test/FrontendObjC.

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

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

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

from llvm/test/FrontendObjC.

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

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

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

from llvm/test/FrontendObjC.

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

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

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

from llvm/test/FrontendObjC++.

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

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

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

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

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

from llvm/test/FrontendC++.

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

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

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

from llvm/test/FrontendC++.

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

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

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

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

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

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

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

from llvm/test/FrontendC++.

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

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

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

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

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

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

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

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

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

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

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

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

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

13 years agoFor assigning SourceLocations to macro arg tokens, reserve a single SLocEntry
Argyrios Kyrtzidis [Fri, 19 Aug 2011 22:34:17 +0000 (22:34 +0000)]
For assigning SourceLocations to macro arg tokens, reserve a single SLocEntry
for tokens that are lexed consecutively from the same FileID, instead of creating
a SLocEntry for each token. e.g for

   assert(foo == bar);

there will be a single SLocEntry for the "foo == bar" chunk and locations
for the 'foo', '==', 'bar' tokens will point inside that chunk.

For parsing SemaExpr.cpp, this reduced the number of SLocEntries by 25%.

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

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