Commit Graph

14794 Commits

Author SHA1 Message Date
Ted Kremenek c5b4c0ec64 Add initial implementation of checking for uses of floating point as a loop counter.
llvm-svn: 76833
2009-07-23 01:07:19 +00:00
Ted Kremenek 4cd5577cdf Add instance predicate method to match static method.
llvm-svn: 76832
2009-07-23 01:06:10 +00:00
Ted Kremenek 5939402e2c Add 'previsit' Checker pass for ObjCMessageExprs.
llvm-svn: 76831
2009-07-23 01:05:31 +00:00
Steve Naroff 8e6aee5821 Remove a bunch of FIXME's related to ObjC type checking.
- Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext.
- Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible(). 
- Tweak several test cases to accommodate the new/improved type checking.

llvm-svn: 76830
2009-07-23 01:01:38 +00:00
Fariborz Jahanian 0228bc1a41 Add constructor used to initialize base/member in
CXXBaseOrMemberInitializer AST node. Needed by
its clients to do the initialization.

llvm-svn: 76826
2009-07-23 00:42:24 +00:00
Mike Stump 671cc00ce1 Fix case, apparently some people still build on case sensitive
filesystems.

llvm-svn: 76824
2009-07-23 00:20:25 +00:00
Mike Stump 33979f75a0 Add warning for falling off the end of a function that should return a
value.  This is on by default, and controlled by -Wreturn-type (-Wmost
-Wall).  I believe there should be very few false positives, though
the most interesting case would be:

  int() { bar(); }

when bar does:

  bar() { while (1) ; }

Here, we assume functions return, unless they are marked with the
noreturn attribute.  I can envision a fixit note for functions that
never return normally that don't have a noreturn attribute to add a
noreturn attribute.

If anyone spots other false positives, let me know!

llvm-svn: 76821
2009-07-22 23:56:57 +00:00
Douglas Gregor e93e46c690 Implement support for out-of-line definitions of the class members of class
templates, e.g.,

  template<typename T>
  struct Outer {
    struct Inner;
  };

  template<typename T>
  struct Outer<T>::Inner {
    // ...
  };

Implementing this feature required some extensions to ActOnTag, which
now takes a set of template parameter lists, and is the precursor to
removing the ActOnClassTemplate function from the parser Action
interface. The reason for this approach is simple: the parser cannot
tell the difference between a class template definition and the
definition of a member of a class template; both have template
parameter lists, and semantic analysis determines what that template
parameter list means.

There is still some cleanup to do with ActOnTag and
ActOnClassTemplate. This commit provides the basic functionality we
need, however.

llvm-svn: 76820
2009-07-22 23:48:44 +00:00
Eli Friedman f32f0a7146 Fix test breakage.
llvm-svn: 76816
2009-07-22 23:24:42 +00:00
Argyrios Kyrtzidis 3a24c4aa00 Change Preprocessor to keep a copy of LangOptions instead of reference, like ASTContext.
Now when creating a Preprocessor we can pass it a temporary LangOptions object instead of having to remember to keep it around.

llvm-svn: 76815
2009-07-22 23:13:42 +00:00
Mike Stump 8dd1b6bd10 Improve CFG support for C++ throw expressions.
llvm-svn: 76814
2009-07-22 22:56:04 +00:00
Mike Stump 24cbfc370b Prep for new warning.
llvm-svn: 76813
2009-07-22 22:55:09 +00:00
Ted Kremenek bfd28fd596 Refactor 'PostStmt' and 'PreStmt' to subclass a common parent 'StmtPoint'.
Educate GRExprEngine::VisitGraph() about 'PreStmt'.

Mark the constructor of 'PostStmt' to be explicit, preventing implicit
conversions and the selection of the wrong 'generateNode' method in
GRStmtNodeBuilder.

Constify a bunch of arguments, which falls out of the changes to ProgramPoint.

llvm-svn: 76809
2009-07-22 22:35:28 +00:00
Eli Friedman 6aea57560f Slight code reorganization to allow instantiating post-inc/dec.
llvm-svn: 76807
2009-07-22 22:25:00 +00:00
Douglas Gregor 1a7ba62e3a Calls to Sema::MatchTemplateParametersToScopeSpecifier should not depend on the order of evaluation of their arguments to be correct.
llvm-svn: 76804
2009-07-22 22:05:02 +00:00
Ted Kremenek b8725e2099 Use SaveAndRestore in 'clang/Analysis/Support/SaveAndRestore.h'
llvm-svn: 76800
2009-07-22 21:52:10 +00:00
Ted Kremenek 5b9b066aeb Add AssumeDual method.
llvm-svn: 76798
2009-07-22 21:51:00 +00:00
Ted Kremenek 915c351496 Migrate the path-sensitive checking of 'nonnull' arguments over to the new
'Checker' interface. An updated test case illustrates that after calling a
function with the 'nonnull' attribute we now register the fact that the passed
pointer must be non-null. This retention of information was not possible with
the previously used GRSimpleAPICheck interface.

llvm-svn: 76797
2009-07-22 21:46:56 +00:00
Eli Friedman 3af2a77717 Fix the parsing of default arguments for inline member function
definitions.

I'm not very familiar with this code, so please review.

llvm-svn: 76796
2009-07-22 21:45:50 +00:00
Ted Kremenek b1c170e64b Make 'SaveAndRestore' and friends reusable classes in libAnalysis.
llvm-svn: 76795
2009-07-22 21:45:16 +00:00
Ted Kremenek 49513ccaec Add support for registering 'Checker' objects with GRExprEngine.
Add a 'previsit' stage (that dispatches to registered Checkers) when evaluating the effects of CallExprs.

llvm-svn: 76794
2009-07-22 21:43:51 +00:00
Ted Kremenek 63fc4352b6 Add new 'Checker' and 'CheckerVisitor' classes, which represent a more powerful
interface to plug in domain-specific checker logic than the current
GRSimpleAPICheck interface. The new 'Checker' interface can actually generate
new nodes, allowing it to modify the state and refine the analysis (which
GRSimpleAPIChecks could not).

llvm-svn: 76793
2009-07-22 21:42:34 +00:00
Ted Kremenek 2776079844 Add support for 'PreStmt' program points to GRCoreEngine and GRStmtNodeBuilder.
llvm-svn: 76792
2009-07-22 21:40:46 +00:00
Ted Kremenek 8a2cb9cede Add 'PreStmt' program point. This will be used to represent checking for
preconditions (in GRExprEngine) before the statement itself is evaluated.

llvm-svn: 76791
2009-07-22 21:39:25 +00:00
Ted Kremenek 0af7e85bf7 Implement operator= for ExplodedNodeSet.
llvm-svn: 76790
2009-07-22 21:38:15 +00:00
Douglas Gregor d6605dbbc0 Fix the problems with template argument deduction and array types for
real. It turns out that we need to actually move all of the qualifiers
up to the array type itself, then recanonicalize the deduced template
argument type.

llvm-svn: 76788
2009-07-22 21:30:48 +00:00
Mike Stump aa19375206 Make -Wreturn-type be part of -Wmost and therefore -Wall.
llvm-svn: 76784
2009-07-22 21:00:27 +00:00
Douglas Gregor b77af8f4aa Fix some memory allocation/deallocation issues
llvm-svn: 76783
2009-07-22 20:55:49 +00:00
Eli Friedman 2729132ec3 Fix a nasty little use-after-free bug.
llvm-svn: 76779
2009-07-22 20:29:16 +00:00
Douglas Gregor 7ac44f4cfb Canonicalize the types produced by template argument deduction.
llvm-svn: 76777
2009-07-22 20:25:36 +00:00
Fariborz Jahanian f87fbc058d Improved on performance of the algorithm for proper ordering of
ctor's initialization of bases and fields.

llvm-svn: 76776
2009-07-22 20:25:00 +00:00
Douglas Gregor b3a1fdc363 Slighty more testing for template argument deduction with array arguments
llvm-svn: 76774
2009-07-22 20:07:21 +00:00
Douglas Gregor 6045482792 Improve template argument deduction for array types, so that a parameter
const T

can be matched with, e.g.,

  volatile int [5]

llvm-svn: 76773
2009-07-22 20:02:25 +00:00
Mike Stump af6ab88979 Prep for new warning.
llvm-svn: 76772
2009-07-22 20:02:03 +00:00
Mike Stump 212005c1b4 Use isa instead of dyn_cast for conditionals.
llvm-svn: 76771
2009-07-22 18:58:19 +00:00
Devang Patel 06cceef545 Use DICompositeType->replaceAllUsesWith().
This requires llvm rev. 76769 or higher.

llvm-svn: 76770
2009-07-22 18:57:00 +00:00
Douglas Gregor 8a27391190 "This patch implements the restrictions on union members detailed in
[class.union]p1", from John McCall!

llvm-svn: 76766
2009-07-22 18:25:24 +00:00
Ted Kremenek f1282074c3 Move bug reporter "visitors" to their own file and make them part of the public
BugReporter API.  No real functionality change.

llvm-svn: 76760
2009-07-22 17:55:28 +00:00
Fariborz Jahanian 5c14ec30cd Allocate BaseOrMemberInitializers and CXXBaseSpecifier nodes
via ASTContext.

llvm-svn: 76758
2009-07-22 17:41:53 +00:00
Douglas Gregor b09f3d82cc Implement parsing and semantic analysis for out-of-line definitions of static
data members of class templates. We don't instantiate the definitions yet,
however.

llvm-svn: 76756
2009-07-22 17:18:37 +00:00
Steve Naroff 3de6b70730 Fix a couple recent ABI regressions noticed during code review (fallout from the ObjC type system rewrite).
It's unfortunate that the mangling includes the low-level structs. Nevertheless, we need this for binary compatibility with GCC.

llvm-svn: 76755
2009-07-22 17:14:51 +00:00
Eli Friedman 5173349565 Switch some functions from using x86 builtins to using vector
operations.

llvm-svn: 76753
2009-07-22 17:08:01 +00:00
Mike Stump 7a5eaf6dd4 Add some documentation, to make it so the next person doens't select
the wrong function.  :-)

llvm-svn: 76752
2009-07-22 16:55:20 +00:00
Steve Naroff 51d4f79ffa Fix <rdar://problem/6770276> Support Class<Proto> syntax.
llvm-svn: 76741
2009-07-22 16:07:01 +00:00
Douglas Gregor a3a4dd5d03 Test template instantiation for member functions of class templates defined
out of line.

llvm-svn: 76740
2009-07-22 15:45:39 +00:00
Eli Friedman 5ac69057c0 Make vectorized floating-point comparisons work without crashing.
llvm-svn: 76726
2009-07-22 06:07:16 +00:00
Ted Kremenek 952a004298 Restructure ProgramPoint to have the 'Kind' value be its own instance
variable.  This gives us much more flexibility with defining more
ProgramPoints, which is the direction we are heading.  The removal of
various bit-mangling of pointers also cleans up the logic.

llvm-svn: 76721
2009-07-22 04:38:22 +00:00
Ted Kremenek 920ad71dab Temporarily disable most use of region casts in RegionStoreManager,
instead preferring to use the a region's actual type when creating
symbols and using the QualType passed to Retrieve for implicit
casting.  This preprocessor logic is temporary; eventually we will
either remove region casts or keep them.

Temporarily toggle (via preprocessor directives) that SymbolicRegions
with heap storage are not undefined, but instead should be
symbolicated.  If we want to model that a SymbolicRegion is
uninitialized, we can explicitly model that by binding UndefinedVal to
that region.  It turns out that we want to treat most heap objects as
being defined, not the other way around.

llvm-svn: 76720
2009-07-22 04:35:42 +00:00
Ted Kremenek b2d0409d50 Fix a crasher in StoreManager::InvalidateRegion() caused by using the
'cast type' of a region to invalidate its binding.  This only occurs
when using RegionStoreManager, as it records the cast type.  I'm
currently considering removing the notion of a cast type (see
comments in code).

llvm-svn: 76719
2009-07-22 04:23:20 +00:00
Mon P Wang acedf7768f Preserve address space information through member accesses, e.g.,
__attribute__((address_space(1))) struct {int arr[ 3 ]; }  *p1;
   ... = p1->arr[2];  // load from address space 1

llvm-svn: 76717
2009-07-22 03:08:17 +00:00
Mike Stump 18366cbe97 Remove an unneeded header.
llvm-svn: 76716
2009-07-22 01:39:14 +00:00
Mike Stump 753d120975 Prep for new warning.
llvm-svn: 76709
2009-07-22 00:43:08 +00:00
Fariborz Jahanian 891436d54c Minor mod. per Doug's comment.
llvm-svn: 76708
2009-07-22 00:42:46 +00:00
Douglas Gregor 168190d822 Complain if we're entering the context of a dependent nested-name-specifier but
cannot match that nested-name-specifier to a class template or class template
partial specialization.

llvm-svn: 76704
2009-07-22 00:28:09 +00:00
Douglas Gregor d8d297c0ac Basic parsing and semantic analysis for out-of-line definitions of the
member functions of class templates, e.g.,

  template<typename T> 
  struct X {
    void f(T);
  };

  template<typename T> X<T>::f(T) { /* ... */ }

llvm-svn: 76692
2009-07-21 23:53:31 +00:00
Mike Stump 93a7ed1fc7 Revert this, we can now avoid error cascades better.
llvm-svn: 76691
2009-07-21 23:52:50 +00:00
Mike Stump 5c1acd1f33 Revert this, was a bug in my new warning code, not the test case.
llvm-svn: 76690
2009-07-21 23:50:15 +00:00
Mike Stump 0ab3c3deac Revert this, we have a better way to do this.
llvm-svn: 76687
2009-07-21 23:47:12 +00:00
Mike Stump d8679446a3 Revert this, we have a better way to handle this.
llvm-svn: 76685
2009-07-21 23:45:39 +00:00
Mike Stump d7b9282e48 Revert recent change, I now have a better way to solve this (thanks Chris).
llvm-svn: 76681
2009-07-21 23:41:23 +00:00
Ted Kremenek 8be513822c Fix long-lurking bug in ObjCSummaryCache revealed by Torok's recent memory
poisoning changes to DenseMap. We were using an iterator after it had been
invalidated by an insertion into the DenseMap.

llvm-svn: 76677
2009-07-21 23:27:57 +00:00
Mike Stump bdbe099dd2 Prep for new warning.
llvm-svn: 76670
2009-07-21 22:54:02 +00:00
Fariborz Jahanian aee31ac316 Patch to accomodate Doug's comment on default
destruction of base/members for each destructor AST.

llvm-svn: 76663
2009-07-21 22:36:06 +00:00
Ted Kremenek c1986570ed Remove stale comment and fix RUN line.
llvm-svn: 76656
2009-07-21 21:48:25 +00:00
Ted Kremenek f0951f6d41 Add test case for PR 4596, which is already fixed due to Steve Naroff's overhaul of the Objective-C type system, but isn't in a checker build yet.
llvm-svn: 76648
2009-07-21 21:21:04 +00:00
Ted Kremenek 6dec002981 Patch by Stefan Bühler: Escape text in macro expansion when emitting HTML in the HTMLRewriter.
This fixes PR 4602.

llvm-svn: 76647
2009-07-21 21:16:46 +00:00
Ted Kremenek 4fd8f73c93 Update stale comment.
llvm-svn: 76644
2009-07-21 21:09:31 +00:00
Mike Stump e303c9e468 Prep for new warning.
llvm-svn: 76643
2009-07-21 21:06:08 +00:00
Ted Kremenek 1e35dfac17 Reorder files.
llvm-svn: 76642
2009-07-21 21:03:50 +00:00
Ted Kremenek ac7c7240f0 Fix PR 4594 by refactoring almost all casting logic from GRExprEngine::VisitCast
to SValuator::EvalCast. In the process, the StoreManagers now use this new cast
machinery, and the hack in GRExprEngine::EvalBind to handle implicit casts
involving OSAtomicCompareAndSwap and friends has been removed (and replaced with
logic closer to the logic specific to those functions).

llvm-svn: 76641
2009-07-21 21:03:30 +00:00
Mike Stump df3f1447e4 Prep for new warning.
llvm-svn: 76640
2009-07-21 21:03:09 +00:00
Mike Stump 5e7869f63e Prep for new warning.
llvm-svn: 76638
2009-07-21 20:52:43 +00:00
Mike Stump 087a3f7e0d Prep for new warning.
llvm-svn: 76637
2009-07-21 20:50:41 +00:00
Daniel Dunbar 08e41d65a2 driver: Print --version on stdout, to match gcc.
- Patch by Jean-Daniel Dupas

llvm-svn: 76632
2009-07-21 20:06:58 +00:00
Eli Friedman 952c15dd52 Misc fixes for -Wreorder:
1. Make it work correctly with anonymous unions.
2. Don't compute it if the warning isn't enabled.
3. Optimize the algorithm slightly to make it linear time in the 
case where we don't produce any warnings.

llvm-svn: 76630
2009-07-21 19:28:10 +00:00
Mike Stump f4464156cf Prep for new warning.
llvm-svn: 76628
2009-07-21 19:03:43 +00:00
Mike Stump 447351f1ff Prep for new warning.
llvm-svn: 76627
2009-07-21 19:02:55 +00:00
Mike Stump c4e34f2d8b Prep for new warning.
llvm-svn: 76626
2009-07-21 19:01:48 +00:00
Mike Stump d6fce57ba7 Prep for new warning.
llvm-svn: 76625
2009-07-21 19:01:31 +00:00
Mike Stump 414c3b435a Prep for new warning.
llvm-svn: 76624
2009-07-21 19:01:01 +00:00
Mike Stump a319fe36c3 Prep for new warning.
llvm-svn: 76623
2009-07-21 19:00:12 +00:00
Douglas Gregor ddbf4e0c2c Make Sema::ActOnCXXEnterDeclaratorScope robust against failures to compute
the declaration context, as occurs with out-of-line class template member
definitions.

llvm-svn: 76622
2009-07-21 18:59:28 +00:00
Mike Stump 3fe60b2118 Prep for new warning.
llvm-svn: 76621
2009-07-21 18:59:16 +00:00
Mike Stump d74687fac6 Prep for new warning.
llvm-svn: 76620
2009-07-21 18:58:50 +00:00
Mike Stump 13876e914b Prep for new warning.
llvm-svn: 76619
2009-07-21 18:58:15 +00:00
Mike Stump 4cac3e34e5 Prep for new warning.
llvm-svn: 76617
2009-07-21 18:57:14 +00:00
Mike Stump 5fbc72bfd5 Prep for new warning.
llvm-svn: 76616
2009-07-21 18:56:34 +00:00
Mike Stump 6a2bf11c55 Prep for new warning.
llvm-svn: 76614
2009-07-21 18:56:04 +00:00
Mike Stump 0aaf1308fc Prep for new warning.
llvm-svn: 76613
2009-07-21 18:54:29 +00:00
Mike Stump 6a18fb2dad Prep for new warning.
llvm-svn: 76611
2009-07-21 18:52:41 +00:00
Mike Stump 9832fcb598 Prep for new warning.
llvm-svn: 76610
2009-07-21 18:51:31 +00:00
Mike Stump c2ec778641 Prep for new warning.
llvm-svn: 76609
2009-07-21 18:48:43 +00:00
Mike Stump 79a9f20c4d Prep for new warning.
llvm-svn: 76608
2009-07-21 18:46:15 +00:00
Mike Stump 41ecf6cc3d Prep for new warning.
llvm-svn: 76607
2009-07-21 18:45:53 +00:00
Mike Stump d1ee66e412 Prep for new warning.
llvm-svn: 76606
2009-07-21 18:45:22 +00:00
Mike Stump 77cfd7a9ca Prep for new warnings about control flow falling off the ends of
functions that return a value.  I was going to buffer the whole lot
up, but it should be easier to review if I check them in
incrementally.  Most of the forth coming changes either add a return
value, or make it impossible to return, or alter the return type.

llvm-svn: 76605
2009-07-21 18:44:24 +00:00
Owen Anderson a265a3876c Update for LLVM API change.
llvm-svn: 76599
2009-07-21 18:06:41 +00:00
Argyrios Kyrtzidis 33c70c9388 Consider nested-names as part of the declarator when resolving an ambiguous statement.
llvm-svn: 76583
2009-07-21 17:05:03 +00:00
Fariborz Jahanian b154ecafa6 Diagnose when a destructor uses a unrelated class type as its name.
llvm-svn: 76577
2009-07-21 15:28:50 +00:00
Douglas Gregor 82fe3e3398 Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.

llvm-svn: 76576
2009-07-21 14:46:17 +00:00
Duncan Sands 49c29ee43f Disambiguate an if statement.
llvm-svn: 76547
2009-07-21 07:56:29 +00:00
Argyrios Kyrtzidis 8274ad5281 Remove the ASTContext parameter from Entity::getPrintableName().
llvm-svn: 76546
2009-07-21 07:52:21 +00:00
Argyrios Kyrtzidis 11982922be Add an assert for safety check.
llvm-svn: 76539
2009-07-21 06:48:06 +00:00
Argyrios Kyrtzidis 1a176f0b96 Fix a crash that occurs in this C++ case:
struct foo {
  static bool value;
};
bool (foo::value); // crash because of parens

llvm-svn: 76538
2009-07-21 06:43:26 +00:00
Owen Anderson f319a7d6e7 Update for LLVM API change.
llvm-svn: 76534
2009-07-21 02:57:15 +00:00
Argyrios Kyrtzidis 3b4e2a7621 Keep only canonical Decls in Entities.
llvm-svn: 76532
2009-07-21 02:10:32 +00:00
Mike Stump 3557ea840b Wire up CFG improvements for __builtin_choose_expr.
llvm-svn: 76531
2009-07-21 01:46:17 +00:00
Mike Stump 8d50b6aeff Wire up CFG improvements for do { } while () when the condition is known.
llvm-svn: 76530
2009-07-21 01:27:50 +00:00
Mike Stump 014b3eabd1 Wire up for statement CFG improvements for conditionals that are known.
llvm-svn: 76529
2009-07-21 01:12:51 +00:00
Mike Stump 23a443bea7 Wire up CFG improvements for while when the condition is known.
llvm-svn: 76522
2009-07-21 00:38:52 +00:00
Argyrios Kyrtzidis d0a31d2c5a Remove a file from the test directory that was added by mistake.
llvm-svn: 76518
2009-07-21 00:17:57 +00:00
Ted Kremenek fe12f88924 RegionStore:
-refactor logic for retrieving bindings from VarDecls into
 RegionStoreManager::RetrieveVar()
- improve RegionStoreManager::CastRetrievedVal() and SimpleSValuate::EvalCastNL
  to better handle casts of values of the same canonical type as well as
  casts of LocAsInteger values.

llvm-svn: 76516
2009-07-21 00:12:07 +00:00
Argyrios Kyrtzidis 05ac8276cf Change the semantics for Entity.
Entity can now refer to declarations that are not visible outside the translation unit.
It is a wrapper of a pointer union, it's either a Decl* for declarations that don't
"cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl.

Included is a test case for handling fields across translation units.

llvm-svn: 76515
2009-07-21 00:07:06 +00:00
Ryan Flynn ed73cac647 define __STDC_VERSION__ processor token for c94
llvm-svn: 76514
2009-07-21 00:07:02 +00:00
Argyrios Kyrtzidis 851b208a20 Use temporary output to avoid running index-test with the same commands multiple times.
llvm-svn: 76513
2009-07-21 00:06:46 +00:00
Argyrios Kyrtzidis a8cf0beeef Implement the virtual getNextRedeclaration() for ObjCMethodDecl.
If it's in an ObjCContainerDecl, its "redeclaration" is the method definition in the corresponding ObjCImplDecl.
If it's in an ObjCImplDecl, its "redeclaration" is the method in the interface.

llvm-svn: 76512
2009-07-21 00:06:36 +00:00
Argyrios Kyrtzidis 60e9b7cf58 Add an assertion for the return value of Decl::getNextRedeclaration().
llvm-svn: 76511
2009-07-21 00:06:27 +00:00
Argyrios Kyrtzidis 1559d67b7a Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

llvm-svn: 76510
2009-07-21 00:06:20 +00:00
Argyrios Kyrtzidis 43cee935ae Remove Sema::LookupObjCImplementation and replace it with just calling ObjCInterfaceDecl::getImplementation().
llvm-svn: 76509
2009-07-21 00:06:04 +00:00
Argyrios Kyrtzidis 6d9fab7619 - Introduce ASTContext::getObjCImplementation() and ASTContext::setObjCImplementation() which use a DenseMap to associate
an interface/category with its implementation (if one exists).

- Introduce ObjCInterfaceDecl::get/setImplementation() and ObjCCategoryDecl::get/setImplementation() that use the above methods.

- Add a compiler error for when a category is reimplemented.

llvm-svn: 76508
2009-07-21 00:05:53 +00:00
Argyrios Kyrtzidis b78139f74d Handle references from ObjCIvarRefExprs.
llvm-svn: 76507
2009-07-21 00:05:38 +00:00
Argyrios Kyrtzidis 153d418def Add '\n' to the end of error message.
llvm-svn: 76506
2009-07-21 00:05:10 +00:00
Mike Stump 0d76d075e4 Add yet more analysis for CFGs involving conditionals that are actually constant.
llvm-svn: 76500
2009-07-20 23:24:15 +00:00
Fariborz Jahanian 83381cc9a6 Move EmitCtorPrologue to CGCXX. Add an assert and FIXMEs.
llvm-svn: 76498
2009-07-20 23:18:55 +00:00
Ted Kremenek 834e2f69da Enhanced IsReinterpreted() (RegionStore.cpp) to reason about higher-order
pointers.

Enhanced RegionStoreManager::Retrieve() to handle automatic casts when the
loaded value is different from the requested value. This should be refined over
time, but essentially we should always symbolicate locations as locations, and
convert them to non-locations on demand.

These changes now cause 'misc-ps.m' to pass again.

llvm-svn: 76497
2009-07-20 22:58:02 +00:00
Fariborz Jahanian c0656de03d Improve message for bad destructor decl. Per Doug's comment.
llvm-svn: 76494
2009-07-20 22:41:12 +00:00
Fariborz Jahanian 127059c7ec Early ir-gen for constructor prologue. This is on going.
llvm-svn: 76493
2009-07-20 22:35:22 +00:00
Douglas Gregor d12df6b160 Reuse VarDecl::Init to store the default argument of a ParmVarDecl,
reducing the size of ParmVarDecl by one pointer. Also means that we'll 
properly (de-)serialize default arguments in C++ PCH files.

llvm-svn: 76487
2009-07-20 22:03:28 +00:00
Ted Kremenek 2f730c8aed This test now passes with RegionStore.
llvm-svn: 76484
2009-07-20 21:44:10 +00:00
Ted Kremenek 77f7fc5e85 Enhance GRExprEngine::EvalBind to handle some implicit casts from nonlocs to
locs and vis versa.

llvm-svn: 76483
2009-07-20 21:43:20 +00:00
Ted Kremenek aadd463e0e Enhance SimpleSValuator to handle nonloc::LocAsInteger -> location casts.
llvm-svn: 76481
2009-07-20 21:39:27 +00:00
Mike Stump 17051250ad Remove an apparently unused forward class decl.
llvm-svn: 76476
2009-07-20 21:23:55 +00:00
Mike Stump 94e12450aa Remove an apparently unused header.
llvm-svn: 76473
2009-07-20 21:17:53 +00:00
Ted Kremenek bf04f98c1f Add XFAILED test.
llvm-svn: 76469
2009-07-20 21:00:55 +00:00
Ted Kremenek a1f9c7fb3b Add FIXME.
llvm-svn: 76466
2009-07-20 20:38:59 +00:00
Douglas Gregor 959cc7aaaa When a field is variable-sized or is an array with a negative size,
don't replace the type of the field with 'int', from Enea Zaffanella!

llvm-svn: 76454
2009-07-20 18:55:14 +00:00
Ted Kremenek 619eece347 Update DataflowSolver to handle the case where a successor/predecessor block
could be NULL. This allows the solver to handle optimized CFGs where branches
can be determined during CFG-construction to be infeasible.

llvm-svn: 76452
2009-07-20 18:52:34 +00:00
Douglas Gregor 47d2859b3e Improve GCC compatibility by allowing static tentative definitions of
incomplete type (with a warning), from Enea Zaffanella!

llvm-svn: 76451
2009-07-20 18:46:59 +00:00
Ted Kremenek af9f362840 Enhance GRBranchNodeBuilderImpl (part of GRCoreEngine) to understand the case
where the true or false CFGBlock* for a branch could be NULL. This will handle
the case where we can determine during CFG construction that a branch is
infeasible.

llvm-svn: 76450
2009-07-20 18:44:36 +00:00
Steve Naroff accc488785 5 cleanups to ObjCObjectPointerType work:
- Remove Sema::CheckPointeeTypesForAssignment(), a temporary API I added to ease migration to ObjCObjectPointerType. Convert Sema::CheckAssignmentConstraints() to no longer depend on the temporary API.
- Sema::ConvertDeclSpecToType(): Replace a couple FIXME's with an important comment/example.
- Sema::GetTypeForDeclarator(): Get the protocol's from the interface, NOT the declspec (to support the following C typedef idiom: "typedef C<P> T; T *obj").
- Sema::ObjCQualifiedIdTypesAreCompatible(): Removed some dead code.
- ASTContext::getObjCEncodingForTypeImpl(): Some minor cleanups.

llvm-svn: 76443
2009-07-20 17:56:53 +00:00
Fariborz Jahanian 4041dfc360 Issue a more descriptive diagnostics when mis-declaring
a destructor.

llvm-svn: 76436
2009-07-20 17:43:15 +00:00
Zhongxing Xu 34e0370502 The children statements might be NULL. Check for this case in
isContainedInStatement().

llvm-svn: 76408
2009-07-20 08:28:49 +00:00
Ted Kremenek 7d3a334298 Implement FIXME in pretty-printing for StringRegions.
llvm-svn: 76381
2009-07-19 20:38:24 +00:00
Ted Kremenek 291e8f770e Improve debug pretty-printing for ObjCIVarRegions.
llvm-svn: 76380
2009-07-19 20:36:24 +00:00
Chris Lattner 9662cd3227 enhance the goto checker to reject jumps across __block variable definitions.
llvm-svn: 76376
2009-07-19 20:17:11 +00:00
Daniel Dunbar ea3060a9e5 Catch another trivial case where we can avoid emitting a separate return blcok.
llvm-svn: 76365
2009-07-19 08:24:34 +00:00
Daniel Dunbar c3ab4c6c98 Detect when the current generation point is unreachable after emitting
expressions.
 - This generally catches the important case of noreturn functions.

 - With the last two changes, we are down to 152 unreachable blocks emitted on
   403.gcc, vs the 1805 we started with.

llvm-svn: 76364
2009-07-19 08:23:12 +00:00
Daniel Dunbar 669521c97c Fix thinko.
llvm-svn: 76362
2009-07-19 07:03:11 +00:00
Daniel Dunbar b6adc43f6e Avoid generation of dead code in a few more situations.
- Emit variable declarations as "simple", we want to avoid forcing the creation
   of a dummy basic block, but still need to make the variable available for
   later use.

 - With that, we can now skip IRgen for other unreachable statements (which
   don't define a label).

 - Anders, I added two fixmes on calls to EmitVLASize, can you check them?

llvm-svn: 76361
2009-07-19 06:58:07 +00:00
Daniel Dunbar 461ea7f005 Add include needed for MSVC.
llvm-svn: 76359
2009-07-19 02:17:34 +00:00
Daniel Dunbar 09fd05082d Update CMake
llvm-svn: 76351
2009-07-19 00:40:45 +00:00
Anders Carlsson 6d9f6f326d Handle layout of non-virtual base classes.
llvm-svn: 76348
2009-07-19 00:18:47 +00:00
Anders Carlsson 118ce16bf5 Refactor field layout into a separate function.
llvm-svn: 76343
2009-07-18 21:48:39 +00:00
Anders Carlsson 27b50135ee Rename NextOffset to DataSize, which better matches the Itanium C++ ABI
llvm-svn: 76339
2009-07-18 21:26:44 +00:00
Anders Carlsson a4267a654b Migrate over to the record layout builder.
llvm-svn: 76338
2009-07-18 21:19:52 +00:00
Argyrios Kyrtzidis c7082933e6 Re-enable 'test/SemaTemplate/temp_class_spec_neg.cpp', after commenting out the cause of the crash.
llvm-svn: 76337
2009-07-18 21:18:10 +00:00
Argyrios Kyrtzidis d6bf03c272 Introduce ASTLocation::getReferencedDecl(), for getting the declaration that the ASTLocation references.
llvm-svn: 76336
2009-07-18 21:17:58 +00:00
Argyrios Kyrtzidis fb63b0a317 Handle invalid ASTLocations instead of asserting.
llvm-svn: 76335
2009-07-18 21:17:43 +00:00
Anders Carlsson 4f51628b02 More layout builder work.
llvm-svn: 76333
2009-07-18 20:50:59 +00:00
Anders Carlsson 7947433411 Add a new ASTRecordLayoutBuilder class. Not used yet.
llvm-svn: 76330
2009-07-18 20:20:21 +00:00
Daniel Dunbar f1dc291655 Disable this test for now, it has been crashing on linux for weeks.
llvm-svn: 76328
2009-07-18 19:55:20 +00:00
Anders Carlsson 15b73deeea Revert r75641.
llvm-svn: 76327
2009-07-18 19:43:29 +00:00
Steve Naroff 4105f3eaf9 Fix typo from r76321.
llvm-svn: 76322
2009-07-18 15:38:31 +00:00
Steve Naroff c277ad10f0 Remove ObjCQualifiedInterfaceType:-)
llvm-svn: 76321
2009-07-18 15:33:26 +00:00
Sebastian Redl c88ab62c87 Fix RUN line to not litter the test directory.
llvm-svn: 76320
2009-07-18 15:13:36 +00:00
Sebastian Redl 3a0ae12162 Rename file in preparation of properly implementing C-style casts in C++.
llvm-svn: 76318
2009-07-18 15:08:18 +00:00
Sebastian Redl e644e19671 Enhance testing of overriding exception specs for inaccessible base exceptions.
llvm-svn: 76317
2009-07-18 14:32:15 +00:00
Zhongxing Xu 3f51f41779 Fix a comment.
llvm-svn: 76303
2009-07-18 09:26:51 +00:00
Argyrios Kyrtzidis fd16798b1f Fix a comment.
llvm-svn: 76299
2009-07-18 08:50:48 +00:00
Argyrios Kyrtzidis 05898da9cb Introduce a redecl_iterator in Decl class, so that we can do a "iterate over all declarations of the same decl" without knowing the exact type.
llvm-svn: 76298
2009-07-18 08:50:35 +00:00
Argyrios Kyrtzidis fad334ce5b Introduce the Redeclarable template class, which serves as a base type defining the common interface for Decls that can be redeclared.
Make FunctionDecl and VarDecl use it.

llvm-svn: 76297
2009-07-18 08:50:13 +00:00
Argyrios Kyrtzidis 194a9d8e73 Remove StmtLocResolver::VisitObjCIvarRefExpr, it was only there to avoid returning an implicit 'self' instead of the ivar.
Since implicit 'self' no longer has a source location, it's not needed. (plus we also want to check for a 'self' that is visible in source code)

llvm-svn: 76296
2009-07-18 08:49:56 +00:00
Argyrios Kyrtzidis e1a8c62ce7 Don't add a SourceLocation for 'self' if it does not actually appears in the source code.
llvm-svn: 76295
2009-07-18 08:49:37 +00:00
Zhongxing Xu 4b9f2d082a Replace stmt visitors with the fall back method.
llvm-svn: 76294
2009-07-18 08:49:07 +00:00
Ted Kremenek e9812bdac5 Fix crash in StoreManager::NewCastRegion() when handling casts from 'id' (or whatever) to a BlockPointerType.
llvm-svn: 76288
2009-07-18 06:27:51 +00:00
Ted Kremenek 2c8a159b7d Return CodeTextRegions for BlockPointerTypes in addition to FunctionPointerTypes.
llvm-svn: 76287
2009-07-18 06:27:01 +00:00
Ted Kremenek 6ab0a74a25 Add test case for bug fix in r76262.
llvm-svn: 76283
2009-07-18 05:02:33 +00:00
Ted Kremenek 0747de6aaa Fix some fallout from CFGBuilder restructuring: all expressions that we explicitly handle have the possibility to be block-level expressions.
llvm-svn: 76277
2009-07-18 00:47:21 +00:00
Argyrios Kyrtzidis 91ff94d6d9 Remove getFirstDeclaration/getLatestDeclaration from FunctionDecl and VarDecl.
Their usefulness is questionable since redecl_iterator was introduced.

llvm-svn: 76275
2009-07-18 00:34:35 +00:00
Argyrios Kyrtzidis 6b7e376160 Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its place.
llvm-svn: 76274
2009-07-18 00:34:25 +00:00
Argyrios Kyrtzidis 5614aef776 Move the functionality of ASTContext::getCanonicalDecl(), into a virtual method Decl::getCanonicalDecl().
llvm-svn: 76273
2009-07-18 00:34:07 +00:00
Argyrios Kyrtzidis e842bd16ce Resolve a location that is inside an ObjCMethodDecl.
llvm-svn: 76272
2009-07-18 00:33:52 +00:00
Argyrios Kyrtzidis 38d83defbe Make ASTLocation accept a Stmt that is inside an ObjCMethodDecl.
llvm-svn: 76271
2009-07-18 00:33:46 +00:00
Argyrios Kyrtzidis 340f8af489 Search through all Decls that are DeclContexts.
llvm-svn: 76270
2009-07-18 00:33:40 +00:00
Argyrios Kyrtzidis 02675dc49d Set ObjCMethodDecl's EndLoc to the '}' when it's a definition.
llvm-svn: 76269
2009-07-18 00:33:33 +00:00
Argyrios Kyrtzidis ea72f422ef Location should be passed to setLocEnd() not to setAtEndLoc() which belongs to ObjCContainerDecl.
llvm-svn: 76268
2009-07-18 00:33:23 +00:00
Argyrios Kyrtzidis ce55b2e543 Add getSourceRange() methods for ObjC Decls.
llvm-svn: 76267
2009-07-18 00:33:08 +00:00
Chris Lattner f56501ce48 fix objc codegen to not have its own list of things that eventually get into llvm.used, just
populate CGM's list directly.

llvm-svn: 76266
2009-07-17 23:57:13 +00:00
Chris Lattner be35620902 This takes a long time to crash, just disable it for now.
llvm-svn: 76263
2009-07-17 23:48:38 +00:00
Ted Kremenek fc311292da Fix caching bug revealed by analyzing ClamAV using RegionStore.
llvm-svn: 76262
2009-07-17 23:48:26 +00:00
Ted Kremenek fe9b768aaa Fix possible null dereference in CFG construction.
llvm-svn: 76261
2009-07-17 22:57:50 +00:00
Ted Kremenek c3fd33014c Remove bogus check.
llvm-svn: 76259
2009-07-17 22:45:54 +00:00
Ted Kremenek 1d67c22949 Add error message when clang-cc cannot be found.
llvm-svn: 76256
2009-07-17 22:38:26 +00:00
Ted Kremenek 93668002c4 Restructure CFG builder to have just one visitor path instead of two. The result
is an algorithm that is much easier to understand and slightly more efficient.
Thanks to Mike Stump for our discussions on the CFGBuilder and his comments that
helped prompt this long needed cleanup.

llvm-svn: 76250
2009-07-17 22:18:43 +00:00
Ted Kremenek 2182259f36 Move WalkAST logic for 'ChooseExpr' to 'VisitChooseExpr'.
llvm-svn: 76205
2009-07-17 18:20:32 +00:00
Ted Kremenek 51d40b07a0 Move WalkAST logic for 'ConditionalOperator' into 'VisitConditionalOperator'.
llvm-svn: 76202
2009-07-17 18:15:54 +00:00
Daniel Dunbar c3ccd180e7 Fix indentation / trailing white space.
llvm-svn: 76200
2009-07-17 18:10:27 +00:00
Ted Kremenek 0bcdc981ef Remove stale comments.
llvm-svn: 76196
2009-07-17 18:04:55 +00:00
Ted Kremenek 8a286fbdb9 Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.

llvm-svn: 76193
2009-07-17 17:50:17 +00:00
Chris Lattner c960b3e80c clean up this code, add the fixme back.
llvm-svn: 76180
2009-07-17 15:50:19 +00:00
Chris Lattner 5230191e37 objc methods can't be an operand to callexpr.
llvm-svn: 76179
2009-07-17 15:46:27 +00:00
Zhongxing Xu 9d05213899 Rename Entity::getName() to Entity::getPrintableName() to make its purpose
more obvious.

llvm-svn: 76167
2009-07-17 07:49:44 +00:00
Zhongxing Xu 3436f58e40 As suggested by Argyrios, revert r76159 and make "FindImmediateParent"
a public static method of ASTLocation.

llvm-svn: 76166
2009-07-17 07:36:20 +00:00
Zhongxing Xu 3c8fa978ad Refactor code into a new CallExpr::getDirectCallee() method. Simplify some
code with the new method.

llvm-svn: 76164
2009-07-17 07:29:51 +00:00
Zhongxing Xu 2391d265ed CallGraph: add a bunch of stmt visitors.
llvm-svn: 76161
2009-07-17 07:05:19 +00:00
Zhongxing Xu d25ea831b2 Relax the assertion in ASTLocation's ctor: if the decl is not the immediate
parent of the stmt, find the immediate parent for the stmt.

This is because sometimes we cannot get the immediate decl of the stmt when
creating the ASTLocation. We can only get a parent of the stmt.

llvm-svn: 76159
2009-07-17 06:58:08 +00:00
Zhongxing Xu 6c1b35a0ef CallGraph:
- add IfStmt visitor.
 - print information only when a function has callee. Otherwise its ASTContext
   map is NULL.

llvm-svn: 76156
2009-07-17 05:49:16 +00:00
Mike Stump 31feda5585 Fixup indentation of rest of switch statement to match llvm coding
conventions.  Also reflowed comments and removed spaces at end of
lines and fixed up 80 col violations.

llvm-svn: 76140
2009-07-17 01:31:16 +00:00
Ted Kremenek b825c0ddc5 Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.
llvm-svn: 76139
2009-07-17 01:20:38 +00:00
Argyrios Kyrtzidis 95d401de9d If we are not doing a Debug build, no need for the debugging print methods.
llvm-svn: 76138
2009-07-17 01:20:03 +00:00
Argyrios Kyrtzidis c6756ab0ae ObjCCategoryImplDecl and ObjCImplementation do not derive directly from DeclContext but from a new abstract ObjCImplDecl.
Reflect this change on the "DeclContext hierarchy".

llvm-svn: 76137
2009-07-17 01:19:49 +00:00
Argyrios Kyrtzidis bffa89f42c Check whether the IdentifierInfo is null, before using it.
llvm-svn: 76136
2009-07-17 01:19:03 +00:00
Mike Stump 48871a2880 Make noreturn functions alter the CFG.
llvm-svn: 76133
2009-07-17 01:04:31 +00:00
Ted Kremenek 3d486f08cb Replace Type::getAsReferenceType() with Type::getAs<ReferenceType>().
llvm-svn: 76132
2009-07-17 01:01:15 +00:00
Ted Kremenek 7c701e7d86 Update cf_returns_retained/ns_returns_retained examples to use __has_feature.
llvm-svn: 76130
2009-07-17 00:25:49 +00:00
Ted Kremenek e5a068fcb3 Update test case to use '__has_feature' macro.
llvm-svn: 76129
2009-07-17 00:19:33 +00:00
Daniel Dunbar a3f41f4bba Some more ?: for Obj-C tests.
llvm-svn: 76125
2009-07-16 23:34:22 +00:00
Daniel Dunbar 54c596465d Fix unused variable warnings (with -Asserts)
llvm-svn: 76112
2009-07-16 22:10:11 +00:00
Fariborz Jahanian c3443a3bf3 ir-gen for --/++ operators of objc object pointers
in 32bit abi.

llvm-svn: 76109
2009-07-16 22:04:59 +00:00
Daniel Dunbar 0418a5f11e Add more testing of ?: for Obj-C object types.
llvm-svn: 76108
2009-07-16 21:55:48 +00:00
Daniel Dunbar 54091b82b5 [llvm up] Add support for '#' component of QA_OVERRIDE_GCC3_OPTIONS.
- This silences the output about how command line arguments are being changed.

llvm-svn: 76107
2009-07-16 21:32:51 +00:00
Daniel Dunbar dde5c8d522 Add extra print for --time-tests output.
llvm-svn: 76104
2009-07-16 21:18:21 +00:00
Anton Korobeynikov b5b703b2f7 Hook in s390x stuff into clang
llvm-svn: 76099
2009-07-16 20:09:57 +00:00
Ted Kremenek e3fb4b6524 Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.

llvm-svn: 76098
2009-07-16 19:58:26 +00:00
Ted Kremenek 6796fbd2e8 Move the source-level CFG from libAST to libAnalysis.
llvm-svn: 76092
2009-07-16 18:13:04 +00:00
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