Commit Graph

14369 Commits

Author SHA1 Message Date
Ted Kremenek afe797d7b3 Add 'clang-wpa' to the CMake-based build.
llvm-svn: 76091
2009-07-16 18:10:20 +00:00
Owen Anderson a296c03430 Update for LLVM API change.
llvm-svn: 76090
2009-07-16 18:09:38 +00:00
Fariborz Jahanian ca75db7c02 Diagnose ++/-- op on objc pointers in
nonfragile abi, instead of crashing.

llvm-svn: 76088
2009-07-16 17:59:14 +00:00
Chris Lattner aa64ca28cb use CreateRuntimeVariable to get __CFConstantStringClassReference
instead of doing it manually (which might end up getting auto-renamed),
fixing a FIXME. rdar://7065446

llvm-svn: 76079
2009-07-16 16:48:25 +00:00
Steve Naroff fac5bc9264 Cleanup a couple loops and improve a comment (based on feedback from Fariborz).
llvm-svn: 76078
2009-07-16 16:21:02 +00:00
Steve Naroff 79d1215d83 Remove ASTContext::isObjCObjectPointerType().
Convert all clients to use the new predicate on Type.

llvm-svn: 76076
2009-07-16 15:41:00 +00:00
Chris Lattner 3afa3e1d91 codegen string literals using private linkage now like llvm-gcc, eliminating
some target hooks.

llvm-svn: 75895
2009-07-16 05:03:48 +00:00
Daniel Dunbar 84a56054cd Unbreak build?
llvm-svn: 75887
2009-07-16 02:02:48 +00:00
Ted Kremenek 942c0e5243 Update CMake file.
llvm-svn: 75885
2009-07-16 01:43:33 +00:00
Ted Kremenek c7b1dade86 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.

llvm-svn: 75884
2009-07-16 01:33:37 +00:00
Ted Kremenek f267a15c8d 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.

llvm-svn: 75882
2009-07-16 01:32:00 +00:00
Fariborz Jahanian 41136eec6b Generate error on declaration containing 'static' and '__attribute__((weak))'
Patch by Ryan Flynn

llvm-svn: 75879
2009-07-16 01:12:24 +00:00
Zhongxing Xu cd64aaa4a9 update makefile.
llvm-svn: 75878
2009-07-16 01:05:34 +00:00
Zhongxing Xu bd8549169a add copyright comments.
llvm-svn: 75877
2009-07-16 01:03:49 +00:00
Devang Patel 894caff444 Enable. Now the LLVM dwarfwriter does not print extra '1' prefix in symbol names (rev. 75875)
llvm-svn: 75876
2009-07-16 01:02:47 +00:00
Zhongxing Xu 17c9e7cb5c Add a primitive clang whole primitive analyzer tool.
llvm-svn: 75874
2009-07-16 01:00:25 +00:00
Zhongxing Xu bc6eb71f31 Commit the initial implementation of call graph building.
llvm-svn: 75873
2009-07-16 00:54:12 +00:00
Steve Naroff a057ba905b Avoid crashing for the enclosed test case.
This is fallout from the recent ObjCObjectPointerType rework. I'll work on fixing this tomorrow.

llvm-svn: 75870
2009-07-16 00:25:06 +00:00
Owen Anderson 9f98d37612 Update for LLVM API change.
llvm-svn: 75869
2009-07-16 00:14:12 +00:00
Ted Kremenek ccc22924b0 Use utility method to create 0-index into ElementRegion.
llvm-svn: 75865
2009-07-16 00:00:11 +00:00
Fariborz Jahanian 30324d68b1 Fixed a stinko which caused an ast-print test failure.
llvm-svn: 75861
2009-07-15 23:39:31 +00:00
Ted Kremenek d4adebbbd6 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.

llvm-svn: 75856
2009-07-15 23:23:54 +00:00
Fariborz Jahanian 24d2383a19 #ifdef'ed out -ast-print of destructors which caused
a test failure, until figuring out what caused the failure.

llvm-svn: 75855
2009-07-15 23:22:45 +00:00
Fariborz Jahanian 16094c2467 Added ASTs to destructor decl AST for default destruction of object's
base/members.

llvm-svn: 75849
2009-07-15 22:34:08 +00:00
Ted Kremenek f3e1e4d9a1 Fix <rdar://problem/7062158> by having BasicStoreManager model values for 'static' global variables.
llvm-svn: 75844
2009-07-15 22:09:25 +00:00
Ted Kremenek 3e808edac9 Lexically order files in CMakeLists.txt files.
llvm-svn: 75832
2009-07-15 21:08:41 +00:00
Daniel Dunbar ee71c25eee Reapply r75764: [llvm up] Switch to using the new TargetRegistry
llvm-svn: 75821
2009-07-15 20:25:38 +00:00
Steve Naroff 7183eefdfa 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.

llvm-svn: 75816
2009-07-15 19:44:23 +00:00
Steve Naroff da44a40b64 Remove default argument, since it isn't being used (suggested by Fariborz).
llvm-svn: 75815
2009-07-15 19:34:04 +00:00
Argyrios Kyrtzidis 4b415acff6 Revert r75764 "[llvm up] Switch to using the new TargetRegistry" to fix build.
llvm-svn: 75814
2009-07-15 18:59:48 +00:00
Argyrios Kyrtzidis ed53caebda Add comments to indicate why RUN lines are below the source code.
llvm-svn: 75813
2009-07-15 18:59:40 +00:00
Steve Naroff 8206de760b Add a "t".
llvm-svn: 75810
2009-07-15 18:50:21 +00:00
Steve Naroff 1329fa0ed9 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.

llvm-svn: 75808
2009-07-15 18:40:39 +00:00
Dan Gohman 74e3eb49ea 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.

llvm-svn: 75802
2009-07-15 17:32:18 +00:00
Daniel Dunbar 3d038dd33d [llvm up] Switch to using the new TargetRegistry.
llvm-svn: 75764
2009-07-15 09:43:46 +00:00
Zhongxing Xu 69cc15e97f Delete extra whitespaces.
llvm-svn: 75761
2009-07-15 09:04:01 +00:00
Zhongxing Xu a5da8d25b7 rewrite the logic to make it follow the comments more closely.
llvm-svn: 75750
2009-07-15 06:21:18 +00:00
Ted Kremenek 4802955b84 Enhance RegionStore's reasoning about Objective-C ivars. More testing to follow.
llvm-svn: 75748
2009-07-15 06:09:28 +00:00
Zhongxing Xu b5bf7ee393 Use utility method.
llvm-svn: 75745
2009-07-15 05:09:24 +00:00
Zhongxing Xu 12b1d137c2 Add getName() method to Entity.
llvm-svn: 75740
2009-07-15 04:39:21 +00:00
Ted Kremenek 57fa7e3cc8 Relax assertion.
llvm-svn: 75738
2009-07-15 04:23:32 +00:00
Ted Kremenek e6fea68c46 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.

llvm-svn: 75730
2009-07-15 02:31:43 +00:00
Ted Kremenek c6c2157836 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.

llvm-svn: 75728
2009-07-15 02:27:32 +00:00
Ted Kremenek e5d2f79876 Handle cast of 'ObjCObjectRegion' in StoreManager::InvalidateRegion.
llvm-svn: 75713
2009-07-14 23:52:07 +00:00
Fariborz Jahanian dfbd05d8aa Added a FIXME and prevent crash when listing
a dependent type in the ctor initializer-list.

llvm-svn: 75712
2009-07-14 23:41:35 +00:00
Ted Kremenek 9a797db199 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.

llvm-svn: 75708
2009-07-14 23:17:22 +00:00
Owen Anderson 170229f68d Update for LLVM API change, and contextify a bunch of related stuff.
llvm-svn: 75705
2009-07-14 23:10:40 +00:00
Ted Kremenek eea582f04f This test currently only passes for 32-bit archs.
llvm-svn: 75698
2009-07-14 22:58:18 +00:00
Fariborz Jahanian 5da7ecb245 Fixed a bug in building ctor-initializer AST.
llvm-svn: 75692
2009-07-14 22:40:50 +00:00
Eli Friedman bb0d9a5129 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.

llvm-svn: 75690
2009-07-14 21:58:17 +00:00