]> granicus.if.org Git - clang/log
clang
15 years agoCleanup a couple loops and improve a comment (based on feedback from Fariborz).
Steve Naroff [Thu, 16 Jul 2009 16:21:02 +0000 (16:21 +0000)]
Cleanup a couple loops and improve a comment (based on feedback from Fariborz).

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

15 years agoRemove ASTContext::isObjCObjectPointerType().
Steve Naroff [Thu, 16 Jul 2009 15:41:00 +0000 (15:41 +0000)]
Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.

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

15 years agocodegen string literals using private linkage now like llvm-gcc, eliminating
Chris Lattner [Thu, 16 Jul 2009 05:03:48 +0000 (05:03 +0000)]
codegen string literals using private linkage now like llvm-gcc, eliminating
some target hooks.

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

15 years agoUnbreak build?
Daniel Dunbar [Thu, 16 Jul 2009 02:02:48 +0000 (02:02 +0000)]
Unbreak build?

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

15 years agoUpdate CMake file.
Ted Kremenek [Thu, 16 Jul 2009 01:43:33 +0000 (01:43 +0000)]
Update CMake file.

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

15 years agoMove RegionStoreManager over to using new
Ted Kremenek [Thu, 16 Jul 2009 01:33:37 +0000 (01:33 +0000)]
Move RegionStoreManager over to using new
ValueManager::makeArrayIndex()/convertArrayIndex() methods.  This
handles yet another crash case when reasoning about array indices of
different bitwidth and signedness.

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

15 years agoTwo changes:
Ted Kremenek [Thu, 16 Jul 2009 01:32:00 +0000 (01:32 +0000)]
Two changes:

(1) Moved the SValuator object from GRExprEngine to ValueManager.  This
   allows ValueManager to use the SValuator when creating SVals.

(2) Added ValueManager::makeArrayIndex() and
    ValueManager::convertToArrayIndex(), two SVal creation methods
    that will help RegionStoreManager always have a consistent set of
    SVals with the same integer size and type when reasoning about
    array indices.

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

15 years agoGenerate error on declaration containing 'static' and '__attribute__((weak))'
Fariborz Jahanian [Thu, 16 Jul 2009 01:12:24 +0000 (01:12 +0000)]
Generate error on declaration containing 'static' and '__attribute__((weak))'
Patch by Ryan Flynn

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

15 years agoupdate makefile.
Zhongxing Xu [Thu, 16 Jul 2009 01:05:34 +0000 (01:05 +0000)]
update makefile.

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

15 years agoadd copyright comments.
Zhongxing Xu [Thu, 16 Jul 2009 01:03:49 +0000 (01:03 +0000)]
add copyright comments.

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

15 years agoEnable. Now the LLVM dwarfwriter does not print extra '1' prefix in symbol names...
Devang Patel [Thu, 16 Jul 2009 01:02:47 +0000 (01:02 +0000)]
Enable. Now the LLVM dwarfwriter does not print extra '1' prefix in symbol names (rev. 75875)

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

15 years agoAdd a primitive clang whole primitive analyzer tool.
Zhongxing Xu [Thu, 16 Jul 2009 01:00:25 +0000 (01:00 +0000)]
Add a primitive clang whole primitive analyzer tool.

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

15 years agoCommit the initial implementation of call graph building.
Zhongxing Xu [Thu, 16 Jul 2009 00:54:12 +0000 (00:54 +0000)]
Commit the initial implementation of call graph building.

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

15 years agoAvoid crashing for the enclosed test case.
Steve Naroff [Thu, 16 Jul 2009 00:25:06 +0000 (00:25 +0000)]
Avoid crashing for the enclosed test case.

This is fallout from the recent ObjCObjectPointerType rework. I'll work on fixing this tomorrow.

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

15 years agoUpdate for LLVM API change.
Owen Anderson [Thu, 16 Jul 2009 00:14:12 +0000 (00:14 +0000)]
Update for LLVM API change.

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

15 years agoUse utility method to create 0-index into ElementRegion.
Ted Kremenek [Thu, 16 Jul 2009 00:00:11 +0000 (00:00 +0000)]
Use utility method to create 0-index into ElementRegion.

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

15 years agoFixed a stinko which caused an ast-print test failure.
Fariborz Jahanian [Wed, 15 Jul 2009 23:39:31 +0000 (23:39 +0000)]
Fixed a stinko which caused an ast-print test failure.

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

15 years agoHandle some more fallout with the conversion of using PointerType for
Ted Kremenek [Wed, 15 Jul 2009 23:23:54 +0000 (23:23 +0000)]
Handle some more fallout with the conversion of using PointerType for
Objective-C pointers to using ObjCObjectPointerType.

Now the checking for 'attribute ((nonnull))' in Sema doesn't emit an error when
trying to apply that attribute to a parameter that is an Objective-C pointer
(this is a regression).

To prevent this regression from occuring in the future, the 'nonnull.c' test was
moved to test/SemaObjC and renamed 'nonnull.m'. I also enhanced the tests to
show that function calls involved a NULL Objective-C pointer constant does not
trigger a warning. This is consistent with GCC, but should likely be fixed.

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

15 years ago#ifdef'ed out -ast-print of destructors which caused
Fariborz Jahanian [Wed, 15 Jul 2009 23:22:45 +0000 (23:22 +0000)]
#ifdef'ed out -ast-print of destructors which caused
a test failure, until figuring out what caused the failure.

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

15 years agoAdded ASTs to destructor decl AST for default destruction of object's
Fariborz Jahanian [Wed, 15 Jul 2009 22:34:08 +0000 (22:34 +0000)]
Added ASTs to destructor decl AST for default destruction of object's
base/members.

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

15 years agoFix <rdar://problem/7062158> by having BasicStoreManager model values for 'static...
Ted Kremenek [Wed, 15 Jul 2009 22:09:25 +0000 (22:09 +0000)]
Fix <rdar://problem/7062158> by having BasicStoreManager model values for 'static' global variables.

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

15 years agoLexically order files in CMakeLists.txt files.
Ted Kremenek [Wed, 15 Jul 2009 21:08:41 +0000 (21:08 +0000)]
Lexically order files in CMakeLists.txt files.

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

15 years agoReapply r75764: [llvm up] Switch to using the new TargetRegistry
Daniel Dunbar [Wed, 15 Jul 2009 20:25:38 +0000 (20:25 +0000)]
Reapply r75764: [llvm up] Switch to using the new TargetRegistry

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

15 years agoRemove cast from test case (cast was incorrectly added as part of http://llvm.org...
Steve Naroff [Wed, 15 Jul 2009 19:44:23 +0000 (19:44 +0000)]
Remove cast from test case (cast was incorrectly added as part of http://llvm.org/viewvc/llvm-project?view=rev&revision=75314).

Add new warnings that are being produced.

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

15 years agoRemove default argument, since it isn't being used (suggested by Fariborz).
Steve Naroff [Wed, 15 Jul 2009 19:34:04 +0000 (19:34 +0000)]
Remove default argument, since it isn't being used (suggested by Fariborz).

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

15 years agoRevert r75764 "[llvm up] Switch to using the new TargetRegistry" to fix build.
Argyrios Kyrtzidis [Wed, 15 Jul 2009 18:59:48 +0000 (18:59 +0000)]
Revert r75764 "[llvm up] Switch to using the new TargetRegistry" to fix build.

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

15 years agoAdd comments to indicate why RUN lines are below the source code.
Argyrios Kyrtzidis [Wed, 15 Jul 2009 18:59:40 +0000 (18:59 +0000)]
Add comments to indicate why RUN lines are below the source code.

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

15 years agoAdd a "t".
Steve Naroff [Wed, 15 Jul 2009 18:50:21 +0000 (18:50 +0000)]
Add a "t".

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

15 years agoImplement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built...
Steve Naroff [Wed, 15 Jul 2009 18:40:39 +0000 (18:40 +0000)]
Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).

This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.

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

15 years agoUpdate for raw_fd_ostream API changes. raw_fd_ostream now has a
Dan Gohman [Wed, 15 Jul 2009 17:32:18 +0000 (17:32 +0000)]
Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.

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

15 years agoTweak svn:ignore
Daniel Dunbar [Wed, 15 Jul 2009 09:45:29 +0000 (09:45 +0000)]
Tweak svn:ignore

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

15 years ago[llvm up] Switch to using the new TargetRegistry.
Daniel Dunbar [Wed, 15 Jul 2009 09:43:46 +0000 (09:43 +0000)]
[llvm up] Switch to using the new TargetRegistry.

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

15 years agoDelete extra whitespaces.
Zhongxing Xu [Wed, 15 Jul 2009 09:04:01 +0000 (09:04 +0000)]
Delete extra whitespaces.

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

15 years agorewrite the logic to make it follow the comments more closely.
Zhongxing Xu [Wed, 15 Jul 2009 06:21:18 +0000 (06:21 +0000)]
rewrite the logic to make it follow the comments more closely.

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

15 years agoEnhance RegionStore's reasoning about Objective-C ivars. More testing to follow.
Ted Kremenek [Wed, 15 Jul 2009 06:09:28 +0000 (06:09 +0000)]
Enhance RegionStore's reasoning about Objective-C ivars.  More testing to follow.

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

15 years agoUse utility method.
Zhongxing Xu [Wed, 15 Jul 2009 05:09:24 +0000 (05:09 +0000)]
Use utility method.

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

15 years agoAdd getName() method to Entity.
Zhongxing Xu [Wed, 15 Jul 2009 04:39:21 +0000 (04:39 +0000)]
Add getName() method to Entity.

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

15 years agoRelax assertion.
Ted Kremenek [Wed, 15 Jul 2009 04:23:32 +0000 (04:23 +0000)]
Relax assertion.

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

15 years agoMore test cases revealed that the logic in StoreManager::InvalidateRegion() needs...
Ted Kremenek [Wed, 15 Jul 2009 02:31:43 +0000 (02:31 +0000)]
More test cases revealed that the logic in StoreManager::InvalidateRegion() needs more finesse when handling the invalidation of pointers.  Pointers that were invalidated as integers could later cause problems for clients using them as pointers.  It is easier for us to model a symbolic value as a pointer rather than modeling a non-symbolic value as a pointer.

This patch causes:
- StoreManager::InvalidateRegion() to not used the casted type of a region if
  it would cause a pointer type to be invalidated as a non-pointer type.
- Pushes RegionStore::RetrieveElement() further by handling retrievals from
  symbolic arrays that have been invalidated.  This uses the new SymbolDerived
  construct that was recently introduced.

The result is that the failing test in misc-ps-region-store-x86_64.m now passes.
Both misc-ps-region-store-x86_64.m and misc-ps-region-store-i386.m contain a
test case that motivated this change.

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

15 years agoIntroduced the notion of a "derived symbol" using the class SymbolDerived.
Ted Kremenek [Wed, 15 Jul 2009 02:27:32 +0000 (02:27 +0000)]
Introduced the notion of a "derived symbol" using the class SymbolDerived.
SymbolDerived allows us to model symbolic values that are related to other
symbols via a region hierarchy. For example, SymbolDerived can be used to model
individual values of a symbolic array.

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

15 years agoHandle cast of 'ObjCObjectRegion' in StoreManager::InvalidateRegion.
Ted Kremenek [Tue, 14 Jul 2009 23:52:07 +0000 (23:52 +0000)]
Handle cast of 'ObjCObjectRegion' in StoreManager::InvalidateRegion.

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

15 years agoAdded a FIXME and prevent crash when listing
Fariborz Jahanian [Tue, 14 Jul 2009 23:41:35 +0000 (23:41 +0000)]
Added a FIXME and prevent crash when listing
a dependent type in the ctor initializer-list.

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

15 years agoSplit out 'test2' into an i386 and x86_64 file, illustrating how the
Ted Kremenek [Tue, 14 Jul 2009 23:17:22 +0000 (23:17 +0000)]
Split out 'test2' into an i386 and x86_64 file, illustrating how the
test behavior differs between architectures.  When this is no longer
the case, these tests will be merged.

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

15 years agoUpdate for LLVM API change, and contextify a bunch of related stuff.
Owen Anderson [Tue, 14 Jul 2009 23:10:40 +0000 (23:10 +0000)]
Update for LLVM API change, and contextify a bunch of related stuff.

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

15 years agoThis test currently only passes for 32-bit archs.
Ted Kremenek [Tue, 14 Jul 2009 22:58:18 +0000 (22:58 +0000)]
This test currently only passes for 32-bit archs.

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

15 years agoFixed a bug in building ctor-initializer AST.
Fariborz Jahanian [Tue, 14 Jul 2009 22:40:50 +0000 (22:40 +0000)]
Fixed a bug in building ctor-initializer AST.

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

15 years agoRemove -ftraditional option, which gcc doesn't actually support. Make
Eli Friedman [Tue, 14 Jul 2009 21:58:17 +0000 (21:58 +0000)]
Remove -ftraditional option, which gcc doesn't actually support.  Make
using -traditional and -traditional-cpp with clang an error because
it's unsupported in clang and causes a significant change in the
semantics of the language.

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

15 years agoRevert 75648 for now. It is causing test failures.
Devang Patel [Tue, 14 Jul 2009 21:31:22 +0000 (21:31 +0000)]
Revert 75648 for now. It is causing test failures.

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

15 years agoEnhance RegionStoreManager to handle 'Retrieve's from SymbolicRegions. We do this...
Ted Kremenek [Tue, 14 Jul 2009 20:48:22 +0000 (20:48 +0000)]
Enhance RegionStoreManager to handle 'Retrieve's from SymbolicRegions.  We do this by silently wrapping the region with an ElementRegion.  This fixes the failures in misc-ps-region-store.m.

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

15 years agofix fallout of the LLVM codegen switching to formatted_raw_ostream.
Chris Lattner [Tue, 14 Jul 2009 20:39:15 +0000 (20:39 +0000)]
fix fallout of the LLVM codegen switching to formatted_raw_ostream.

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

15 years agoTweak pretty-printing of CompoundVal to make it more useful for debugging.
Ted Kremenek [Tue, 14 Jul 2009 20:21:36 +0000 (20:21 +0000)]
Tweak pretty-printing of CompoundVal to make it more useful for debugging.

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

15 years agoBuild AST for default ctor-initializer when constructor has
Fariborz Jahanian [Tue, 14 Jul 2009 20:06:22 +0000 (20:06 +0000)]
Build AST for default ctor-initializer when constructor has
out of line definition.

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

15 years agoSupport data members of array type in default
Fariborz Jahanian [Tue, 14 Jul 2009 18:56:31 +0000 (18:56 +0000)]
Support data members of array type in default
ctor-initializer AST build.

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

15 years agoMoved a FIXME to where it was meant to be.
Fariborz Jahanian [Tue, 14 Jul 2009 18:29:14 +0000 (18:29 +0000)]
Moved a FIXME to where it was meant to be.

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

15 years agoIntroduce Type::isAnyPointerType() and convert all clients (suggested by Chris).
Steve Naroff [Tue, 14 Jul 2009 18:25:06 +0000 (18:25 +0000)]
Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).

I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace.

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

15 years agoPatch to build AST for ctor's initializer list according to
Fariborz Jahanian [Tue, 14 Jul 2009 18:24:21 +0000 (18:24 +0000)]
Patch to build AST for ctor's initializer list according to
semantics of order of construction [class.init].

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

15 years ago[llvm up] adjust to match mainline.
Chris Lattner [Tue, 14 Jul 2009 18:18:16 +0000 (18:18 +0000)]
[llvm up] adjust to match mainline.

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

15 years agoRename RecordLayout.h to ASTRecordLayout.h
Anders Carlsson [Tue, 14 Jul 2009 17:29:11 +0000 (17:29 +0000)]
Rename RecordLayout.h to ASTRecordLayout.h

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

15 years agoRevert r75614 which depend on r75610 (for LLVM), which was reverted.
Daniel Dunbar [Tue, 14 Jul 2009 16:40:28 +0000 (16:40 +0000)]
Revert r75614 which depend on r75610 (for LLVM), which was reverted.

--- Reverse-merging r75614 into '.':
U    lib/CodeGen/CGDebugInfo.cpp

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

15 years agoAdd a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.
Steve Naroff [Tue, 14 Jul 2009 14:58:18 +0000 (14:58 +0000)]
Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.

Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).

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

15 years agoFix the build
Alisdair Meredith [Tue, 14 Jul 2009 08:10:06 +0000 (08:10 +0000)]
Fix the build

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

15 years agoBasic support for C++0x unicode types. Support for literals will follow in an increm...
Alisdair Meredith [Tue, 14 Jul 2009 06:30:34 +0000 (06:30 +0000)]
Basic support for C++0x unicode types.  Support for literals will follow in an incremental patch

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

15 years agouse new name for method.
Chris Lattner [Tue, 14 Jul 2009 06:16:43 +0000 (06:16 +0000)]
use new name for method.

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

15 years agoMove the RUN lines on the same file but below the code, as suggested by Sebastian.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 05:34:59 +0000 (05:34 +0000)]
Move the RUN lines on the same file but below the code, as suggested by Sebastian.

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

15 years agoIn Stmt::printPretty(), pass the SourceManager to dump().
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:20:38 +0000 (03:20 +0000)]
In Stmt::printPretty(), pass the SourceManager to dump().

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

15 years agoHandle redeclarations properly at the index-test tool.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:20:31 +0000 (03:20 +0000)]
Handle redeclarations properly at the index-test tool.

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

15 years agoIntroduce redecl_iterator, used for iterating over the redeclarations of a FunctionDe...
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:20:21 +0000 (03:20 +0000)]
Introduce redecl_iterator, used for iterating over the redeclarations of a FunctionDecl or VarDecl.

It iterates over all the redeclarations, regardless of the starting point. For example:

1) int f();
2) int f();
3) int f();

if you have the (2) FunctionDecl and call redecls_begin/redecls_end to iterate, you'll get this sequence:
(2)
(1)
(3)

The motivation to introduce this was that, previously, if (3) was a function definition,
and you called getBody() at (2), it would not return it, since getBody() iterated over the previous declarations only,
so it would only check (2) and (1).

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

15 years agoIntroduce FunctionDecl::getLatestDeclaration() and VarDecl::getLatestDeclaration().
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:20:08 +0000 (03:20 +0000)]
Introduce FunctionDecl::getLatestDeclaration() and VarDecl::getLatestDeclaration().

For multiple redeclarations they return the last one.

Also, add some non const versions of methods.

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

15 years agoIntroduce FunctionDecl::getFirstDeclaration() and VarDecl::getFirstDeclaration().
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:19:57 +0000 (03:19 +0000)]
Introduce FunctionDecl::getFirstDeclaration() and VarDecl::getFirstDeclaration().

For multiple redeclarations they return the first one.

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

15 years agoAdd a C++ indexing test case, where we show the references of overloaded '+' plus...
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:19:46 +0000 (03:19 +0000)]
Add a C++ indexing test case, where we show the references of overloaded '+' plus signs.

Ok, this is a bit out of place since C++ support is way way off, but it was just too cool to not show it off :-)

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

15 years agoFor C++ overloaded operator calls, set the source location of the DeclRefExpr to...
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:19:38 +0000 (03:19 +0000)]
For C++ overloaded operator calls, set the source location of the DeclRefExpr to the location of the operator.

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

15 years agoFor index-test, if the ASTLocation points at a CallExpr, get a Decl out of it.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:19:30 +0000 (03:19 +0000)]
For index-test, if the ASTLocation points at a CallExpr, get a Decl out of it.

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

15 years agoRead/write a CXXOperatorCallExpr from/to PCH files.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:19:21 +0000 (03:19 +0000)]
Read/write a CXXOperatorCallExpr from/to PCH files.

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

15 years agoFixes for a couple of things:
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:18:53 +0000 (03:18 +0000)]
Fixes for a couple of things:

- Declaration context of ParmVarDecls (that we got from the Declarator) was not their containing function.
- C++ out-of-line method definitions didn't get an access specifier.

Both were exposed by a crash when emitting a C++ method to a PCH file (assert at Decl::CheckAccessDeclContext()).

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

15 years agoHandle struct fields through the index-test tool.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:18:40 +0000 (03:18 +0000)]
Handle struct fields through the index-test tool.

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

15 years agoMove the test input source code to a separate file.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:18:25 +0000 (03:18 +0000)]
Move the test input source code to a separate file.

That way we can freely add new RUN lines without having to correct the line part in all the -point-at options.

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

15 years agoIn ResolveLocationInAST, handle locations that are inside TagDecl definitions.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:18:17 +0000 (03:18 +0000)]
In ResolveLocationInAST, handle locations that are inside TagDecl definitions.

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

15 years agoIn DeclReferenceMap, map FieldDecls to the MemberExprs that reference them.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:18:09 +0000 (03:18 +0000)]
In DeclReferenceMap, map FieldDecls to the MemberExprs that reference them.

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

15 years agoRead/write TagDecl's RBraceLoc from/to PCH files.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:18:02 +0000 (03:18 +0000)]
Read/write TagDecl's RBraceLoc from/to PCH files.

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

15 years agoPass the right brace SourceLocation from the Parser to the TagDecls.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:17:52 +0000 (03:17 +0000)]
Pass the right brace SourceLocation from the Parser to the TagDecls.

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

15 years agoAdd the SourceLocation for the right brace in TagDecl.
Argyrios Kyrtzidis [Tue, 14 Jul 2009 03:17:17 +0000 (03:17 +0000)]
Add the SourceLocation for the right brace in TagDecl.

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

15 years agoUse LLVM mangler to get mangled name for debug info entry.
Devang Patel [Tue, 14 Jul 2009 02:47:58 +0000 (02:47 +0000)]
Use LLVM mangler to get mangled name for debug info entry.

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

15 years agoUpdate debug info generation for ObjCObjectPointer changes.
Daniel Dunbar [Tue, 14 Jul 2009 01:20:56 +0000 (01:20 +0000)]
Update debug info generation for ObjCObjectPointer changes.
 - Previously this would crash on recursive types, and it was also incorrectly
   stripping off a level of indirection.
 - I'm not 100% convinced this is all correct, but it should be a monotonic
   improvment.

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

15 years agoInstead of recovering from a wrong invalidation, this patch aims to
Zhongxing Xu [Tue, 14 Jul 2009 01:12:46 +0000 (01:12 +0000)]
Instead of recovering from a wrong invalidation, this patch aims to
invalidate the region correctly. It uses the cast-to type to invalidate
the region when available. To avoid invalid cast-to type like 'void*' or 'id',
region store now only records non-generic casts of regions.

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

15 years agoI just revertd llvm patch.
Devang Patel [Tue, 14 Jul 2009 00:56:16 +0000 (00:56 +0000)]
I just revertd llvm patch.
XFAIL this for now until I prepare clang specific patch.

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

15 years agoAdd basic checking for passing NULL to CFRetain/CFRelease, since those functions
Ted Kremenek [Tue, 14 Jul 2009 00:43:42 +0000 (00:43 +0000)]
Add basic checking for passing NULL to CFRetain/CFRelease, since those functions
are not explicitly marked as not accepting NULL pointers. This check illustrates
how we need more refactoring in the custom-check logic.

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

15 years agoUpdate for API change.
Owen Anderson [Tue, 14 Jul 2009 00:38:16 +0000 (00:38 +0000)]
Update for API change.

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

15 years agoTidy pretty-printing for SVals, using 'dump()' instead of 'printStdErr()', and implem...
Ted Kremenek [Mon, 13 Jul 2009 23:53:06 +0000 (23:53 +0000)]
Tidy pretty-printing for SVals, using 'dump()' instead of 'printStdErr()', and implementing operator<< support for llvm::raw_ostream.

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

15 years agoWhen pretty-printing symbolic regions, use '{' ... '}' to indicate the symbol used...
Ted Kremenek [Mon, 13 Jul 2009 23:38:57 +0000 (23:38 +0000)]
When pretty-printing symbolic regions, use '{' ... '}' to indicate the symbol used for the region (makes it easier to read for nested regions).

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

15 years agoFixes a minor bug in pretty printing of ctor defs.
Fariborz Jahanian [Mon, 13 Jul 2009 23:31:10 +0000 (23:31 +0000)]
Fixes a minor bug in pretty printing of ctor defs.

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

15 years agoChange pretty-printing API for SymExprs and MemRegions to use a naming convention...
Ted Kremenek [Mon, 13 Jul 2009 23:31:04 +0000 (23:31 +0000)]
Change pretty-printing API for SymExprs and MemRegions to use a naming convention and style similar to other elements in Clang.

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

15 years agoEnhance SimpleSValuator::EvalBinOpNN to recognize the trivial case
Ted Kremenek [Mon, 13 Jul 2009 21:55:12 +0000 (21:55 +0000)]
Enhance SimpleSValuator::EvalBinOpNN to recognize the trivial case
where we are comparing a symbolic value against itself, regardless of
the nature of that symbolic value.

This enhancement identified a case where RegionStoreManager is not
correctly symbolicating the values of the pointees of parameters.  The
failing test is now in 'test/Analysis/misc-ps-region-store.m', with
that test file now (temporarily) marked XFAIL.

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

15 years agoExplicitly initialize the options array, MinGW's gcc 4.3.5 appears to have a bug
Daniel Dunbar [Mon, 13 Jul 2009 21:50:47 +0000 (21:50 +0000)]
Explicitly initialize the options array, MinGW's gcc 4.3.5 appears to have a bug
in array value-initialization.

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

15 years agoThere is no need to value initialize this array.
Daniel Dunbar [Mon, 13 Jul 2009 21:48:50 +0000 (21:48 +0000)]
There is no need to value initialize this array.

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

15 years agoRemove superfluous call to getAsPointerType()...
Steve Naroff [Mon, 13 Jul 2009 21:32:29 +0000 (21:32 +0000)]
Remove superfluous call to getAsPointerType()...

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

15 years agoMake stdin for test scripts empty, so that tests don't accidentally hang waiting
Daniel Dunbar [Mon, 13 Jul 2009 21:24:28 +0000 (21:24 +0000)]
Make stdin for test scripts empty, so that tests don't accidentally hang waiting
for stdin.

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

15 years agoSema::CheckAdditionOperands(): Use Type::getPointeeType() and remove PTy and OPT...
Steve Naroff [Mon, 13 Jul 2009 21:20:41 +0000 (21:20 +0000)]
Sema::CheckAdditionOperands(): Use Type::getPointeeType() and remove PTy and OPT variables.

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

15 years agoNew testcase for rev 75503.
Devang Patel [Mon, 13 Jul 2009 21:20:20 +0000 (21:20 +0000)]
New testcase for rev 75503.

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

15 years agoadd netbsd support, patch by Krister Kalfridsson!
Chris Lattner [Mon, 13 Jul 2009 20:29:08 +0000 (20:29 +0000)]
add netbsd support, patch by Krister Kalfridsson!

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

15 years agoAdded pretty-printing support for constructor definition.
Fariborz Jahanian [Mon, 13 Jul 2009 20:18:13 +0000 (20:18 +0000)]
Added pretty-printing support for constructor definition.

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