Commit Graph

7664 Commits

Author SHA1 Message Date
Zhongxing Xu bcbe44fa90 Create only one AnalysisManager for each translation unit. In HandleCode(),
reset the current analysis context of the AnalysisManager.

llvm-svn: 77943
2009-08-03 03:13:46 +00:00
Daniel Dunbar a8888ac1cb Driver/OpenBSD: Improve ld options.
- Patch by Jonathan Gray!

llvm-svn: 77935
2009-08-03 01:28:59 +00:00
Douglas Gregor 55137cbc85 Produce a warning that partial ordering of function templates is not yet supported
llvm-svn: 77928
2009-08-02 23:46:29 +00:00
Douglas Gregor 9dc8bd327f Keep track of the template arguments deduced when matching a class
template partial specialization. Then, use those template arguments
when instantiating members of that class template partial
specialization. Fixes PR4607.

llvm-svn: 77925
2009-08-02 23:24:31 +00:00
Anders Carlsson 59a9468b22 Whoops, meant to delete this.
llvm-svn: 77916
2009-08-02 21:34:52 +00:00
Anders Carlsson f18318cf4e use CodeGenModule::EmitNullConstant in a couple of places.
llvm-svn: 77915
2009-08-02 21:18:22 +00:00
Anders Carlsson 4ab4f7f416 Use the correct cast kind for dynamic_cast.
llvm-svn: 77905
2009-08-02 19:07:59 +00:00
Ted Kremenek 6ddbb4c963 Fix regression caused by recent refactoring where HTML and plist files would not get flushed out when using '-disable-free'.
llvm-svn: 77882
2009-08-02 05:43:14 +00:00
Ted Kremenek ca7935d347 Remove RegionViews and RegionCasts. These are no longer used.
llvm-svn: 77876
2009-08-02 05:15:23 +00:00
Ted Kremenek f106ab91ff RegionStoreManager::RemoveDeadBindings() now removes dead 'default' bindings as well.
llvm-svn: 77875
2009-08-02 05:00:15 +00:00
Ted Kremenek cee28a4c4d Generalize the interface of 'StoreManager::RemoveDeadBindings()' to manipulate the entire GRState, not just the Store.
llvm-svn: 77870
2009-08-02 04:45:08 +00:00
Anders Carlsson 44616ce317 Remove old code that was causing the new test to fail.
llvm-svn: 77862
2009-08-02 04:17:43 +00:00
Ted Kremenek 9419876e59 Fix regression in StoreManager::CastRegion() to always treat casts to
'void*' (or 'const void*') as an identity transformation.

llvm-svn: 77860
2009-08-02 04:12:53 +00:00
Anders Carlsson 7df966e040 Don't evaluate inout constraints twice. Fixes PR3800.
llvm-svn: 77854
2009-08-02 03:40:19 +00:00
Daniel Dunbar a4a341b9b0 Compute end_overridden_methods in a way that keeps ENABLE_EXPENSIVE_CHECKS
happy.

llvm-svn: 77850
2009-08-02 01:48:29 +00:00
Daniel Dunbar 4074b93184 Use Twine instead of utostr
llvm-svn: 77848
2009-08-02 01:43:57 +00:00
Daniel Dunbar 36741c8a29 Avoid accessing invalid std::vector element; this makes clang
ENABLE_EXPENSIVE_CHECKS clean on x86_64-.*-darwin10.

llvm-svn: 77831
2009-08-01 23:40:20 +00:00
Eli Friedman 62561fe9b0 Fix a minor issue with unions in the new struct building code.
llvm-svn: 77829
2009-08-01 23:11:24 +00:00
Eli Friedman 881f9a89d1 Additional AuroraUX header path.
llvm-svn: 77811
2009-08-01 21:46:03 +00:00
Eli Friedman e480ce3d29 Don't error on C++ linkage; if we don't support that, there are
serious issues :)

llvm-svn: 77800
2009-08-01 20:48:04 +00:00
Eli Friedman 2e6da95a60 Add temp C++ include path for AuroraUX; patch by Edward O'Callaghan.
llvm-svn: 77786
2009-08-01 17:10:21 +00:00
Ted Kremenek 1f22aa7433 This is a fairly large patch, which resulted from a cascade of changes
made to RegionStore (and related classes) in order to handle some
analyzer failures involving casts and manipulation of symbolic memory.

The root of the change is in StoreManager::CastRegion().  Instead of
using ad hoc heuristics to decide when to layer an ElementRegion on a
casted MemRegion, we now always layer an ElementRegion when the cast
type is different than the original type of the region.  This carries
the current cast information associated with a region around without
resorting to the error prone recording of "casted types" in GRState.

Along with this new policy of layering ElementRegions, I added a new
algorithm to strip away existing ElementRegions when they simply
represented casts of a base memory object.  This algorithm computes
the raw "byte offset" that an ElementRegion represents from the base
region, and allows the new ElementRegion to be based off that offset.
The added benefit is that this naturally handles a series of casts of
a MemRegion without building up a set of redundant ElementRegions
(thus canonicalizing the region view).

Other related changes that cascaded from this one (as tests were
failing in RegionStore):

- Revamped RegionStoreManager::InvalidateRegion() to completely remove
  all bindings and default values from a region and all subregions.
  Now invalidated fields are not bound directly to new symbolic
  values; instead the base region has a "default" symbol value from
  which "derived symbols" can be created.  The main advantage of this
  approach is that it allows us to invalidate a region hierarchy and
  then lazily instantiate new values no matter how deep the hierarchy
  went (i.e., regardless of the number of field accesses,
  e.g. x->f->y->z->...).  The previous approach did not do this.

- Slightly reworked RegionStoreManager::RemoveDeadBindings() to also
  incorporate live symbols and live regions that do not have direct
  bindings but also have "default values" used for lazy instantiation.
  The changes to 'InvalidateRegion' revealed that these were necessary
  in order to achieve lazy instantiation of values in the region store
  with those bindings being removed too early.

- The changes to InvalidateRegion() and RemoveDeadBindings() revealed
  a serious bug in 'getSubRegionMap()' where not all region -> subregion
  relationships involved in actually bindings (explicit and implicit)
  were being recorded.  This has been fixed by using a worklist algorithm
  to iteratively fill in the region map.

- Added special support to RegionStoreManager::Bind()/Retrieve() to handle
  OSAtomicCompareAndSwap in light of the new 'CastRegion' changes and the
  layering of ElementRegions.

- Fixed a bug in SymbolReaper::isLive() where derived symbols were not
  being marked live if the symbol they were derived from was also live.
  This fix was critical for getting lazy instantiation in RegionStore
  to work.

- Tidied up the implementation of ValueManager::getXXXSymbolVal() methods
  to use SymbolManager::canSymbolicate() to decide whether or not a
  symbol should be symbolicated.

- 'test/Analysis/misc-ps-xfail.m' now passes; that test case has been
  moved to 'test/Analysis/misc-ps.m'.

- Tweaked some pretty-printing of MemRegions, and implemented
  'ElementRegion::getRawOffset()' for use with the CastRegion changes.

llvm-svn: 77782
2009-08-01 06:17:29 +00:00
Ted Kremenek eb01ba670e Temporarily disable out-of-bounds checking. The current checking logic will not work quite right with the changes I'm about to commit.
llvm-svn: 77779
2009-08-01 05:59:39 +00:00
Anders Carlsson 1682af5bac More warnings for unused expressions.
llvm-svn: 77763
2009-08-01 01:39:59 +00:00
Mike Stump 183c3d2f59 Add beginnigs of rtti generation, wire up more of -fno-exceptions.
llvm-svn: 77751
2009-07-31 23:15:31 +00:00
Anders Carlsson 1726aaa4fc Remove the old struct builder code.
llvm-svn: 77738
2009-07-31 21:48:56 +00:00
Mike Stump 67829f6493 And now we can generate a simple vtable. Still a work in progress...
llvm-svn: 77737
2009-07-31 21:43:43 +00:00
Anders Carlsson d65ab045e8 Move code from EmitUnion directly into the function that handles cast-to-union.
llvm-svn: 77735
2009-07-31 21:38:39 +00:00
Anders Carlsson 0d5f37b81a Use the struct builder for unions.
llvm-svn: 77732
2009-07-31 21:34:04 +00:00
Mike Stump dd93a19ac6 Fixup spacing and 80-col violations.
llvm-svn: 77731
2009-07-31 21:31:32 +00:00
Owen Anderson 0b75f23b94 Update for LLVM API change.
llvm-svn: 77722
2009-07-31 20:28:54 +00:00
Argyrios Kyrtzidis 260a4703a9 For a CXXOperatorCallExpr, fix the order that StmtLocResolver uses to check subexpressions.
llvm-svn: 77713
2009-07-31 19:02:11 +00:00
Douglas Gregor b9a955dc1d Remove a redundant getCanonicalType call
llvm-svn: 77702
2009-07-31 18:32:42 +00:00
Mike Stump bc78a728ee Add code to setup the vtable pointer in the constructor. Work in progress.
llvm-svn: 77699
2009-07-31 18:25:34 +00:00
Mike Stump f332516136 Fix spacing.
llvm-svn: 77688
2009-07-31 17:46:44 +00:00
Owen Anderson fe4e34707c Update for LLVM API change.
llvm-svn: 77686
2009-07-31 17:39:36 +00:00
Douglas Gregor 1d1d16c43e Make canonicalization of overloaded function declarations match the
Itanium C++ ABI's name mangling, since both are related to the notion
of "equivalent" function templates.

llvm-svn: 77678
2009-07-31 16:07:31 +00:00
Douglas Gregor c97f09f565 Canonicalize template template parameters. We can't test this yet, but
it's "obviously correct" :) 

llvm-svn: 77677
2009-07-31 15:46:56 +00:00
Douglas Gregor 70317123c9 Canonicalize function parameters
llvm-svn: 77676
2009-07-31 15:45:02 +00:00
Douglas Gregor 802a030d6e Canonicalization and profiling for overloaded function declarations,
for those extra-esoteric cases. Not that any two given C++ compilers
agree on this test case, but this change gives us a strong definition
of equivalent types.

llvm-svn: 77664
2009-07-31 05:24:01 +00:00
Douglas Gregor 352169aed4 Canonicalize dependent extended vector types.
llvm-svn: 77663
2009-07-31 03:54:25 +00:00
Ryan Flynn d963a49756 PR3679 - enable #pragma weak aliasing.
llvm-svn: 77660
2009-07-31 02:52:19 +00:00
John McCall 9bb74a5ef5 Rename Action::TagKind to Action::TagUseKind, which removes both a misnomer
and a name collision.

llvm-svn: 77658
2009-07-31 02:45:11 +00:00
John McCall ef50e99783 sp.
llvm-svn: 77656
2009-07-31 02:20:35 +00:00
Mike Stump e9c6ffc7d1 Whitespace around else canonicalization and fix 80-col violations.
llvm-svn: 77655
2009-07-31 02:02:20 +00:00
Eli Friedman dfbd0c4b0d Make the check for the linkage of a template handle the case of nested
linkage specifications correctly.

llvm-svn: 77653
2009-07-31 01:43:05 +00:00
Anders Carlsson a076d14514 Add CK_DerivedToBase and use it PerformObjectMemberConversion.
llvm-svn: 77652
2009-07-31 01:23:52 +00:00
Mike Stump 5b78af9ed7 Fix build warnings.
llvm-svn: 77651
2009-07-31 01:10:29 +00:00
Anders Carlsson a26159261c Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)
llvm-svn: 77650
2009-07-31 00:48:10 +00:00
Ted Kremenek df4b3dc3a4 Fix use-after-release bug introduced in r77585 where the PathDiagnosticClient
created by AnalysisConsumer would be released by an instance of AnalysisManager
and then reused by later instances of AnalysisManager. Ownership of the
PathDiagnosticClient now belongs (for now) in AnalysisConsumer.

We also need this layering (for now) because the HTMLDiagnostiClient requires
that the entire translation unit be processed before emitting diagnostics. This
is done in its destructor (which should also be fixed, but that is another
issue).

This fixes PR 4653.

llvm-svn: 77648
2009-07-31 00:34:52 +00:00