]> granicus.if.org Git - clang/log
clang
13 years ago3000 Sema diagnostics should be enough for anyone.
Chandler Carruth [Wed, 16 Feb 2011 19:41:58 +0000 (19:41 +0000)]
3000 Sema diagnostics should be enough for anyone.

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

13 years agoFix a thinko with llvm::Optional, which is clearly the most dangerous class template...
Douglas Gregor [Wed, 16 Feb 2011 19:09:24 +0000 (19:09 +0000)]
Fix a thinko with llvm::Optional, which is clearly the most dangerous class template in the universe

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

13 years agoTeach the CXCodeCompleteResults results structure, which stores
Douglas Gregor [Wed, 16 Feb 2011 19:08:06 +0000 (19:08 +0000)]
Teach the CXCodeCompleteResults results structure, which stores
code-completion results accessed via libclang, to extend the lifetime
of the allocator used for cached global code-completion results at
least until these completion results are destroyed. Fixes
<rdar://problem/8997369>.

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

13 years agoIf preprocessed token introduced empty filename then use main translation unit's...
Devang Patel [Wed, 16 Feb 2011 18:40:36 +0000 (18:40 +0000)]
If preprocessed token introduced empty filename then use main translation unit's filename for debug info entries.

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

13 years agoImprove the invalidation logic for the cache of global code
Douglas Gregor [Wed, 16 Feb 2011 18:16:54 +0000 (18:16 +0000)]
Improve the invalidation logic for the cache of global code
completions. We now compute a hash of the names of all top-level
declarations and macro definitions, and invalidate the cache when the
hash value changes.

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

13 years agoTeach PPChainedCallbacks to forward the InclusionDirective() callback.
Douglas Gregor [Wed, 16 Feb 2011 18:15:35 +0000 (18:15 +0000)]
Teach PPChainedCallbacks to forward the InclusionDirective() callback.

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

13 years agoWarning -> ExtWarn
Argyrios Kyrtzidis [Wed, 16 Feb 2011 16:23:31 +0000 (16:23 +0000)]
Warning -> ExtWarn

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

13 years agoRemove this FIXME; clear up an unused variable; style.
John McCall [Wed, 16 Feb 2011 08:39:19 +0000 (08:39 +0000)]
Remove this FIXME;  clear up an unused variable;  style.

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

13 years agoSave a copy expression for non-trivial copy constructions of catch variables.
John McCall [Wed, 16 Feb 2011 08:02:54 +0000 (08:02 +0000)]
Save a copy expression for non-trivial copy constructions of catch variables.

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

13 years agoAdds a CMake target for the Basic lib's unit tests. Reviewed by
Zhanyong Wan [Wed, 16 Feb 2011 05:45:20 +0000 (05:45 +0000)]
Adds a CMake target for the Basic lib's unit tests.  Reviewed by
jyasskin and chapuni.

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

13 years agoImproves CMakeLists.txt for Clang's unit tests: make "linked
Zhanyong Wan [Wed, 16 Feb 2011 05:19:17 +0000 (05:19 +0000)]
Improves CMakeLists.txt for Clang's unit tests: make "linked
components" and "used libs" arguments of add_clang_unittest().
Reviewed by jyasskin and chapuni.

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

13 years agoTweak -Warray-bounds diagnostics based on feedback from Chandler.
Ted Kremenek [Wed, 16 Feb 2011 04:01:44 +0000 (04:01 +0000)]
Tweak -Warray-bounds diagnostics based on feedback from Chandler.

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

13 years agoCMake: Tweak for Visual Studio 10 quirk at clang-standalone build.
NAKAMURA Takumi [Wed, 16 Feb 2011 03:07:15 +0000 (03:07 +0000)]
CMake: Tweak for Visual Studio 10 quirk at clang-standalone build.

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

13 years agotest/CMakeLists.txt: Don't depend on llvm toolchain at clang-standalone build.
NAKAMURA Takumi [Wed, 16 Feb 2011 03:07:10 +0000 (03:07 +0000)]
test/CMakeLists.txt: Don't depend on llvm toolchain at clang-standalone build.

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

13 years agoRevert r125642. This broke the build? It should be a no-op.
Nick Lewycky [Wed, 16 Feb 2011 02:34:28 +0000 (02:34 +0000)]
Revert r125642. This broke the build? It should be a no-op.

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

13 years agotest/PCH/headersearch.cpp fails on Win32. Not trivial to fix.
Francois Pichet [Wed, 16 Feb 2011 02:29:43 +0000 (02:29 +0000)]
test/PCH/headersearch.cpp fails on Win32. Not trivial to fix.

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

13 years agoConvert the UnpackedAlignment field to CharUnits from bits. No change in
Ken Dyck [Wed, 16 Feb 2011 02:11:31 +0000 (02:11 +0000)]
Convert the UnpackedAlignment field to CharUnits from bits. No change in
functionality intended.

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

13 years agoDon't use "../foo" to return to the current directory.
Nick Lewycky [Wed, 16 Feb 2011 02:10:49 +0000 (02:10 +0000)]
Don't use "../foo" to return to the current directory.

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

13 years agoConvert Alignment member to CharUnits from bits. No change in functionality
Ken Dyck [Wed, 16 Feb 2011 02:05:21 +0000 (02:05 +0000)]
Convert Alignment member to CharUnits from bits. No change in functionality
intended.

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

13 years agoAdd trivial buffer overflow checking in Sema.
Ted Kremenek [Wed, 16 Feb 2011 01:57:07 +0000 (01:57 +0000)]
Add trivial buffer overflow checking in Sema.

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

13 years agoConvert NonVirtualSize to CharUnits from bits. No change in functionality
Ken Dyck [Wed, 16 Feb 2011 01:52:01 +0000 (01:52 +0000)]
Convert NonVirtualSize to CharUnits from bits. No change in functionality
intended.

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

13 years agoConvert NonVirtualAlignment to CharUnits. No change in functionality
Ken Dyck [Wed, 16 Feb 2011 01:43:15 +0000 (01:43 +0000)]
Convert NonVirtualAlignment to CharUnits. No change in functionality
intended.

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

13 years ago[analyzer] AnalyzerFrontend is dependent on AnalyzerCheckers.
Argyrios Kyrtzidis [Wed, 16 Feb 2011 01:40:55 +0000 (01:40 +0000)]
[analyzer] AnalyzerFrontend is dependent on AnalyzerCheckers.

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

13 years ago[analyzer] Use the new registration mechanism on the apple checkers:
Argyrios Kyrtzidis [Wed, 16 Feb 2011 01:40:52 +0000 (01:40 +0000)]
[analyzer] Use the new registration mechanism on the apple checkers:

  NilArgChecker
  CFNumberCreateChecker
  NSAutoreleasePoolChecker
  CFRetainReleaseChecker
  ClassReleaseChecker

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

13 years agoWhen searching for visible declarations (e.g., for code completion),
Douglas Gregor [Wed, 16 Feb 2011 01:39:26 +0000 (01:39 +0000)]
When searching for visible declarations (e.g., for code completion),
be sure to look at all of the Objective-C class declarations within a
@class. Fixes <rdar://problem/8876207>.

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

13 years agoSimplify test to check an aggregate argument that has non trivial constructor or...
Devang Patel [Wed, 16 Feb 2011 01:11:51 +0000 (01:11 +0000)]
Simplify test to check an aggregate argument that has non trivial constructor or destructor.
This patch rewrites r125142.

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

13 years agoWhen trying to provide a code completion item for a call to "super" in
Douglas Gregor [Wed, 16 Feb 2011 00:51:18 +0000 (00:51 +0000)]
When trying to provide a code completion item for a call to "super" in
Objective-C, also look in the categories and class extensions of our
superclasses. Fixes <rdar://problem/8853540>.

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

13 years agoDon't call objc_read_weak as part of emitting a block literal.
John McCall [Wed, 16 Feb 2011 00:49:34 +0000 (00:49 +0000)]
Don't call objc_read_weak as part of emitting a block literal.
Nobody ever gave me a clear reason for why we were doing this, and
now it's apparently causing serious problems, so if *not* having this
causes problems, we get to solve them the right way this time.

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

13 years agoCheck for deprecated implementation unconditionally.
Fariborz Jahanian [Wed, 16 Feb 2011 00:30:31 +0000 (00:30 +0000)]
Check for deprecated implementation unconditionally.
Warning and its note will be ignored in default case.

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

13 years agoFix typo (per Chris's comment).
Fariborz Jahanian [Wed, 16 Feb 2011 00:14:11 +0000 (00:14 +0000)]
Fix typo (per Chris's comment).

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

13 years agoWarn for missing terminating " or ' instead of error for gcc compatibility. Fixed...
Argyrios Kyrtzidis [Tue, 15 Feb 2011 23:45:31 +0000 (23:45 +0000)]
Warn for missing terminating " or ' instead of error for gcc compatibility. Fixed rdar://8914293.

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

13 years agoOnly c++ class arguments with non trivial constructor or destructor needs a reference.
Devang Patel [Tue, 15 Feb 2011 23:36:28 +0000 (23:36 +0000)]
Only c++ class arguments with non trivial constructor or destructor needs a reference.
C struct arguments do not need this adjustment.
This fixes 7 failures in callfuncs.exp from gdb testsuite.

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

13 years ago[analyzer] Use the new registration mechanism on some of the experimental internal...
Argyrios Kyrtzidis [Tue, 15 Feb 2011 22:55:20 +0000 (22:55 +0000)]
[analyzer] Use the new registration mechanism on some of the experimental internal checkers:

  CastToStructChecker
  FixedAddressChecker
  PointerArithChecker
  PointerSubChecker

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

13 years ago[analyzer] Use the new registration mechanism on the IdempotentOperationChecker.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 22:55:14 +0000 (22:55 +0000)]
[analyzer] Use the new registration mechanism on the IdempotentOperationChecker.

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

13 years agoHandle delayed access in local declarations. PR9229.
John McCall [Tue, 15 Feb 2011 22:51:53 +0000 (22:51 +0000)]
Handle delayed access in local declarations.  PR9229.

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

13 years agoTeach code completion to cope with block types written without a
Douglas Gregor [Tue, 15 Feb 2011 22:37:09 +0000 (22:37 +0000)]
Teach code completion to cope with block types written without a
prototype, e.g., ^() rather than ^(void). Fixes
<rdar://problem/8875712>.

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

13 years agoAdd a hack to avoid adding '\01' to asm names when possible. It would be
Rafael Espindola [Tue, 15 Feb 2011 22:23:51 +0000 (22:23 +0000)]
Add a hack to avoid adding '\01' to asm names when possible. It would be
better for clang to always compute the right name, but for now this hack
fixes PR9177 and lets us build firefox with LTO :-)

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

13 years agoRefactor CGRecordLayoutBuilder to use CharUnits more consistently.
John McCall [Tue, 15 Feb 2011 22:21:29 +0000 (22:21 +0000)]
Refactor CGRecordLayoutBuilder to use CharUnits more consistently.

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

13 years agoImplement a special code-completion pattern for "IBAction". Fixes
Douglas Gregor [Tue, 15 Feb 2011 22:19:42 +0000 (22:19 +0000)]
Implement a special code-completion pattern for "IBAction". Fixes
<rdar://problem/8767704>.

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

13 years agoFix the distro name.
Rafael Espindola [Tue, 15 Feb 2011 21:44:06 +0000 (21:44 +0000)]
Fix the distro name.

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

13 years agoMoves FileManagerTest.cpp to unittests/Basic such that the unit test
Zhanyong Wan [Tue, 15 Feb 2011 21:30:27 +0000 (21:30 +0000)]
Moves FileManagerTest.cpp to unittests/Basic such that the unit test
directory structure matches the library structure.  Reviewed by jyasskin.

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

13 years ago[analyzer] Remove ObjCSelfInitCheck from AnalyzerOptions.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 21:25:07 +0000 (21:25 +0000)]
[analyzer] Remove ObjCSelfInitCheck from AnalyzerOptions.

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

13 years ago[analyzer] Use the new registration mechanism on some of the experimental checks...
Argyrios Kyrtzidis [Tue, 15 Feb 2011 21:25:03 +0000 (21:25 +0000)]
[analyzer] Use the new registration mechanism on some of the experimental checks. These are:

   CStringChecker
   ChrootChecker
   MallocChecker
   PthreadLockChecker
   StreamChecker
   UnreachableCodeChecker

MallocChecker creates implicit dependencies between checkers and needs to be handled differently.

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

13 years agoFix include paths on 32 bit ubuntu 10.10.
Rafael Espindola [Tue, 15 Feb 2011 21:16:43 +0000 (21:16 +0000)]
Fix include paths on 32 bit ubuntu 10.10.
Original patch by Jonas Bülow.

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

13 years agoWhen code-completing within a list of declaration specifiers,
Douglas Gregor [Tue, 15 Feb 2011 20:33:25 +0000 (20:33 +0000)]
When code-completing within a list of declaration specifiers,
separately handle the case of a local declaration-specifier list,
including all types in the set of options. Fixes
<rdar://problem/8790735> and <rdar://problem/8662831>.

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

13 years agoOpenCL: standardise naming of test cases
Peter Collingbourne [Tue, 15 Feb 2011 19:46:41 +0000 (19:46 +0000)]
OpenCL: standardise naming of test cases

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

13 years agoSerialization/deserialization support for floating point #pragma
Peter Collingbourne [Tue, 15 Feb 2011 19:46:30 +0000 (19:46 +0000)]
Serialization/deserialization support for floating point #pragma
options, enabled OpenCL extensions and default FP_CONTRACT setting.

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

13 years agoOpenCL: semantic analysis support for cl_khr_fp64 extension
Peter Collingbourne [Tue, 15 Feb 2011 19:46:23 +0000 (19:46 +0000)]
OpenCL: semantic analysis support for cl_khr_fp64 extension

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

13 years agoWhen we encounter an Objective-C class name in an expression, followed
Douglas Gregor [Tue, 15 Feb 2011 19:17:31 +0000 (19:17 +0000)]
When we encounter an Objective-C class name in an expression, followed
by the code completion token, treat this as a class message send where
the opening square bracket is missing. Fixes <rdar://problem/6970911>.

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

13 years agoIn -fapple-kext mode, global object construction code
Fariborz Jahanian [Tue, 15 Feb 2011 18:54:46 +0000 (18:54 +0000)]
In -fapple-kext mode, global object construction code
ends up in the text segment. // rdar://8825235.

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

13 years agoEmit in-class member function definitions that are marked
Douglas Gregor [Tue, 15 Feb 2011 18:11:42 +0000 (18:11 +0000)]
Emit in-class member function definitions that are marked
"used". Fixes <rdar://problem/8684363>.

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

13 years agoAllow resolving headers from a PCH even after headers+PCH were moved to another path.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 17:54:22 +0000 (17:54 +0000)]
Allow resolving headers from a PCH even after headers+PCH were moved to another path.

Store in PCH the directory that the PCH was originally created in.
If a header file is not found at the path that we expect it to be and the PCH file
was moved from its original location, try to resolve the file by assuming that
header+PCH were moved together and the header is in the same place relative to the PCH.

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

13 years agoRefactoring of code to issue warning on implemented
Fariborz Jahanian [Tue, 15 Feb 2011 17:49:58 +0000 (17:49 +0000)]
Refactoring of code to issue warning on implemented
deprecated class and methods in objective-c.

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

13 years agoAdd missing CMake dependency
Douglas Gregor [Tue, 15 Feb 2011 17:09:56 +0000 (17:09 +0000)]
Add missing CMake dependency

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

13 years agoFix the clang-wpa example.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 16:54:12 +0000 (16:54 +0000)]
Fix the clang-wpa example.

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

13 years agoInitialize InlineCall in AnalyzerOptions.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 16:54:07 +0000 (16:54 +0000)]
Initialize InlineCall in AnalyzerOptions.

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

13 years agoAssorted cleanup:
John McCall [Tue, 15 Feb 2011 09:22:45 +0000 (09:22 +0000)]
Assorted cleanup:
  - Have CGM precompute a number of commonly-used types
  - Have CGF copy that during initialization instead of recomputing them
  - Use TBAA info when initializing a parameter variable
  - Refactor the scalar ++/-- code

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

13 years agoAdd CMake support to the clang unittests.
Jeffrey Yasskin [Tue, 15 Feb 2011 07:54:28 +0000 (07:54 +0000)]
Add CMake support to the clang unittests.

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

13 years ago[analyzer] Reflect changes for tablegen'ing the checkers.
Argyrios Kyrtzidis [Tue, 15 Feb 2011 07:42:38 +0000 (07:42 +0000)]
[analyzer] Reflect changes for tablegen'ing the checkers.

-Update tablegen files for checkers, use the tablegen class name for the checker class name.
-Update ClangSACheckersProvider to not look into hidden checker packages.

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

13 years ago[analyzer] Use the new registration mechanism on some of the internal checks. These...
Argyrios Kyrtzidis [Tue, 15 Feb 2011 07:42:33 +0000 (07:42 +0000)]
[analyzer] Use the new registration mechanism on some of the internal checks. These are:

StackAddrLeakChecker
ObjCAtSyncChecker
UnixAPIChecker
MacOSXAPIChecker

The rest have/create implicit dependencies between checkers and need to be handled differently.

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

13 years agoReturn a declaration to the parser when creating a field in C++ so that
John McCall [Tue, 15 Feb 2011 07:12:36 +0000 (07:12 +0000)]
Return a declaration to the parser when creating a field in C++ so that
the parser will complete the declarator with a valid decl and thus trigger
delayed diagnostics for it.  It certainly looks like we were intentionally
returning null here, but I couldn't find any good reason for it, and there
wasn't a comment, so farewell to all that.

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

13 years agoPerform zero-initialization of virtual base classes when emitting
John McCall [Tue, 15 Feb 2011 06:40:56 +0000 (06:40 +0000)]
Perform zero-initialization of virtual base classes when emitting
a zero constant for a complete class.  rdar://problem/8424975

To make this happen, track the field indexes for virtual bases
in the complete object.  I'm curious whether we might be better
off making CGRecordLayoutBuilder *much* more reliant on
ASTRecordLayout;  we're currently duplicating an awful lot of the ABI
layout logic.

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

13 years agoFix memory leak in CFGBuilder resulting from tracking scope information using SmallVe...
Ted Kremenek [Tue, 15 Feb 2011 02:47:45 +0000 (02:47 +0000)]
Fix memory leak in CFGBuilder resulting from tracking scope information using SmallVectors.

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

13 years agoConvert RecordLayout::Alignment to CharUnits from bit units. No change in
Ken Dyck [Tue, 15 Feb 2011 02:32:40 +0000 (02:32 +0000)]
Convert RecordLayout::Alignment to CharUnits from bit units. No change in
functionality intended.

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

13 years agoIdempotentOperationChecker: don't repeatedly recompute block reachability.
Ted Kremenek [Tue, 15 Feb 2011 02:20:03 +0000 (02:20 +0000)]
IdempotentOperationChecker: don't repeatedly recompute block reachability.

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

13 years agoWarn if method for a deprecated method is implemented.
Fariborz Jahanian [Tue, 15 Feb 2011 00:59:30 +0000 (00:59 +0000)]
Warn if method for a deprecated method is implemented.
Warn if class for a deprecated class is implemented.
Warn if category for a deprecated class is implemented.
All under control of -Wdeprecated-implementations.
// rdar://8973810.

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

13 years agoupdate for ConstantVector API change.
Chris Lattner [Tue, 15 Feb 2011 00:14:06 +0000 (00:14 +0000)]
update for ConstantVector API change.

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

13 years agoPut "incomplete implementation" warning under a flag.
Ted Kremenek [Mon, 14 Feb 2011 23:59:16 +0000 (23:59 +0000)]
Put "incomplete implementation" warning under a flag.

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

13 years agoDon't crash on hierarchy static_casts which appear in variable initializers.
John McCall [Mon, 14 Feb 2011 23:21:33 +0000 (23:21 +0000)]
Don't crash on hierarchy static_casts which appear in variable initializers.
PR9221.

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

13 years agoChange the context correctly when instantiating a static data member definition.
John McCall [Mon, 14 Feb 2011 20:37:25 +0000 (20:37 +0000)]
Change the context correctly when instantiating a static data member definition.

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

13 years agoAdd current binary and source directories to the header search list
Oscar Fuentes [Mon, 14 Feb 2011 20:14:11 +0000 (20:14 +0000)]
Add current binary and source directories to the header search list
for all compiler invocations.

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

13 years agoAnger the CMake gods by updating 'clang.xcodeproj'.
Argyrios Kyrtzidis [Mon, 14 Feb 2011 20:09:57 +0000 (20:09 +0000)]
Anger the CMake gods by updating 'clang.xcodeproj'.

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

13 years agoRemove left-over #include.
Argyrios Kyrtzidis [Mon, 14 Feb 2011 19:02:35 +0000 (19:02 +0000)]
Remove left-over #include.

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

13 years agoProvide overload diagnostics when explicit casts involving class types fail.
John McCall [Mon, 14 Feb 2011 18:34:10 +0000 (18:34 +0000)]
Provide overload diagnostics when explicit casts involving class types fail.
PR8626.

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

13 years agorevert my ConstantVector patch, it seems to have made the llvm-gcc
Chris Lattner [Mon, 14 Feb 2011 18:16:09 +0000 (18:16 +0000)]
revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.

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

13 years ago[analyzer] Overhauling of the checker registration mechanism.
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:31 +0000 (18:13 +0000)]
[analyzer] Overhauling of the checker registration mechanism.

-Checkers will be defined in the tablegen file 'Checkers.td'.
-Apart from checkers, we can define checker "packages" that will contain a collection of checkers.
-Checkers can be enabled with -analyzer-checker=<name> and disabled with -analyzer-disable-checker=<name> e.g:
Enable checkers from 'cocoa' and 'corefoundation' packages except the self-initialization checker:
-analyzer-checker=cocoa -analyzer-checker=corefoundation -analyzer-disable-checker=cocoa.SelfInit
-Introduces CheckerManager and CheckerProvider. CheckerProviders get the set of checker names to enable/disable and
 register them with the CheckerManager which will be the entry point for all checker-related functionality.

Currently only the self-initialization checker takes advantage of the new mechanism.

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

13 years ago[analyzer] Remove ManagerRegistry which is not used. In the future we may load analyz...
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:17 +0000 (18:13 +0000)]
[analyzer] Remove ManagerRegistry which is not used. In the future we may load analyzer plugins dynamically but
registration through static constructors should be avoided.

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

13 years ago[analyzer] Move include/clang/StaticAnalyzer/AnalysisConsumer.h -> lib/StaticAnalyzer...
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:11 +0000 (18:13 +0000)]
[analyzer] Move include/clang/StaticAnalyzer/AnalysisConsumer.h -> lib/StaticAnalyzer/Frontend/AnalysisConsumer.h since
FrontendActions.cpp is the only user.

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

13 years ago[analyzer] Move Checkers/FrontendActions.cpp -> Frontend/FrontendActions.cpp
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:06 +0000 (18:13 +0000)]
[analyzer] Move Checkers/FrontendActions.cpp -> Frontend/FrontendActions.cpp

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

13 years ago[analyzer] Introduce libclangStaticAnalyzerFrontend and move Checkers/AnalysisConsume...
Argyrios Kyrtzidis [Mon, 14 Feb 2011 18:13:01 +0000 (18:13 +0000)]
[analyzer] Introduce libclangStaticAnalyzerFrontend and move Checkers/AnalysisConsumer.cpp into Frontend lib.

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

13 years agoRemove dead code in IdempotentOperationChecker.
Ted Kremenek [Mon, 14 Feb 2011 18:05:07 +0000 (18:05 +0000)]
Remove dead code in IdempotentOperationChecker.

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

13 years agoFix edge case where we don't cull warnings in IdempotentOperationsChecker due to...
Ted Kremenek [Mon, 14 Feb 2011 17:59:23 +0000 (17:59 +0000)]
Fix edge case where we don't cull warnings in IdempotentOperationsChecker due to incomplete analysis of loops.

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

13 years agoUse 'BitVector' instead of SmallPtrSet<CFGBlock*> in IdempotentOperationsChecker...
Ted Kremenek [Mon, 14 Feb 2011 17:59:20 +0000 (17:59 +0000)]
Use 'BitVector' instead of SmallPtrSet<CFGBlock*> in IdempotentOperationsChecker.  No real functionality change.

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

13 years agoAdd support for the builtins used in gcc 4.4's <cmath> and <complex>
Jeffrey Yasskin [Mon, 14 Feb 2011 17:02:48 +0000 (17:02 +0000)]
Add support for the builtins used in gcc 4.4's <cmath> and <complex>
headers in C++0x mode.  Fixes PR9138.

Patch by John Bytheway!

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

13 years agoHandle 'UsingDirective' in CFGRecStmtDeclVisitor.
Ted Kremenek [Mon, 14 Feb 2011 17:00:16 +0000 (17:00 +0000)]
Handle 'UsingDirective' in CFGRecStmtDeclVisitor.

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

13 years agoupdate for ConstantVector::get API change.
Chris Lattner [Mon, 14 Feb 2011 07:55:40 +0000 (07:55 +0000)]
update for ConstantVector::get API change.

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

13 years agoWhen parsing an out-of-line member function declaration, we must delay
John McCall [Mon, 14 Feb 2011 07:13:47 +0000 (07:13 +0000)]
When parsing an out-of-line member function declaration, we must delay
access-control diagnostics which arise from the portion of the declarator
following the scope specifier, just in case access is granted by
friending the individual method.  This can also happen with in-line
member function declarations of class templates due to templated-scope
friend declarations.

We were really playing fast-and-loose before with this sort of thing,
and it turned out to work because *most* friend functions are in file
scope.  Making us delay regardless of context exposed several bugs with
how we were manipulating delay.  I ended up needing a concept of a
context that's independent of the declarations in which it appears,
and then I actually had to make some things save contexts correctly,
but delay should be much cleaner now.

I also encapsulated all the delayed-diagnostics machinery in a single
subobject of Sema;  this is a pattern we might want to consider rolling
out to other components of Sema.

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

13 years agofix two broken links and some out of date writing, PR9174
Chris Lattner [Mon, 14 Feb 2011 06:42:50 +0000 (06:42 +0000)]
fix two broken links and some out of date writing, PR9174

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

13 years agoAdd missing file
Peter Collingbourne [Mon, 14 Feb 2011 02:14:26 +0000 (02:14 +0000)]
Add missing file

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

13 years agoOpenCL: add support for __kernel, kernel keywords and EXTENSION,
Peter Collingbourne [Mon, 14 Feb 2011 01:42:53 +0000 (01:42 +0000)]
OpenCL: add support for __kernel, kernel keywords and EXTENSION,
FP_CONTRACT pragmas.  Patch originally by ARM.

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

13 years agoMove support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actions
Peter Collingbourne [Mon, 14 Feb 2011 01:42:35 +0000 (01:42 +0000)]
Move support for "#pragma STDC FP_CONTRACT" to Parser; add Sema actions

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

13 years agoMake LexOnOffSwitch a Preprocessor member function
Peter Collingbourne [Mon, 14 Feb 2011 01:42:24 +0000 (01:42 +0000)]
Make LexOnOffSwitch a Preprocessor member function

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

13 years agoUse hasSameType in one more, hopefully, last place.
Fariborz Jahanian [Sun, 13 Feb 2011 20:11:42 +0000 (20:11 +0000)]
Use hasSameType in one more, hopefully, last place.

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

13 years agoSome refactoring and using more modern APIs for
Fariborz Jahanian [Sun, 13 Feb 2011 20:01:48 +0000 (20:01 +0000)]
Some refactoring and using more modern APIs for
implementation of co/contra-variance objc++
block pointers. // rdar://8979379.

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

13 years agoGive some convenient idiomatic accessors to Stmt::child_range and
John McCall [Sun, 13 Feb 2011 04:07:26 +0000 (04:07 +0000)]
Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.

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

13 years agoLook through array types when deciding whether a field requires non-trivial
John McCall [Sun, 13 Feb 2011 00:46:43 +0000 (00:46 +0000)]
Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic.  Fixes PR 9197.

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

13 years agoImplement objective-c++'s block pointer type matching involving
Fariborz Jahanian [Sat, 12 Feb 2011 19:07:46 +0000 (19:07 +0000)]
Implement objective-c++'s block pointer type matching involving
types which are contravariance in argument types and covariance
in return types. // rdar://8979379.

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

13 years agoTeach the IdempotentOperations checker to ignore property setters.
Ted Kremenek [Sat, 12 Feb 2011 18:50:03 +0000 (18:50 +0000)]
Teach the IdempotentOperations checker to ignore property setters.

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

13 years agoWhen reading the AST, delay loading of the redeclaration chain to avoid deeply nested...
Argyrios Kyrtzidis [Sat, 12 Feb 2011 07:50:47 +0000 (07:50 +0000)]
When reading the AST, delay loading of the redeclaration chain to avoid deeply nested calls.
Temporarily set the first (canonical) declaration as the previous one, which is the one that
matters, and mark the real previous DeclID to be loaded & attached later on.

Fixes rdar://8956193.

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

13 years agoUpdate static analyzer build to checker-255.
Ted Kremenek [Sat, 12 Feb 2011 03:20:34 +0000 (03:20 +0000)]
Update static analyzer build to checker-255.

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