Commit Graph

59364 Commits

Author SHA1 Message Date
Ted Kremenek 238d0b6ecd Rename no-outofbounds.c to xfail-no-outofbounds.c and split off that
test into a separate file to monitor the fact that BasicStoreManager
passes the test.

llvm-svn: 70859
2009-05-04 14:31:19 +00:00
Ted Kremenek 66f8fe18ef Update checker build.
llvm-svn: 70858
2009-05-04 14:24:29 +00:00
Duncan Sands d84881ec53 Testcase for PR3967.
llvm-svn: 70856
2009-05-04 12:54:02 +00:00
Anton Korobeynikov 0a0cc2d7b7 Workaround libstdc++ bug when crosscompiling to mingw.
Patch by Jay Foad!

llvm-svn: 70849
2009-05-04 10:25:30 +00:00
Anton Korobeynikov dad5871f84 It turns out that this version of gcc is broken (cygwin is well-known in shipping
of broken/buggy/snapshot-based compilers)

llvm-svn: 70848
2009-05-04 10:24:46 +00:00
Zhongxing Xu 6ebde279ae array indexes are unsigned integers of the same width as pointer.
no-outofbounds.c still fails. Previously it passed because the array index
is mistakenly a loc::ConcreteInt.

llvm-svn: 70844
2009-05-04 08:52:47 +00:00
Ted Kremenek 2d9fa1b4b7 Test now passes. I'll hold off merging it with the BasicStore test until we know this is a stable change.
llvm-svn: 70837
2009-05-04 07:11:21 +00:00
Ted Kremenek 758fda4274 BasicStore: 'ElementRegion' is the new 'TypedViewRegion'.
StoreManager: Handle casts from one element region to another.
Update test cases.

llvm-svn: 70836
2009-05-04 07:04:36 +00:00
Daniel Dunbar d53e07b396 Remove unnecessary copy of constraint info.
llvm-svn: 70835
2009-05-04 06:56:16 +00:00
Ted Kremenek 95162024e2 This test no longer fails.
llvm-svn: 70834
2009-05-04 06:45:58 +00:00
Douglas Gregor 006fd38dc1 Simplify the interesting-region code by assimmilating blocks of non-whitespace text with each expansion step. It's easier and seems to have better results.
llvm-svn: 70833
2009-05-04 06:45:38 +00:00
Ted Kremenek 35cf12ab2d Handle 'long x = 0; char *y = (char *) x;' by layering an
'ElementRegion' on top of the VarRegion for 'x'.  This causes the test
case xfail_wine_crash.c to now pass for BasicStoreManager.  It doesn't
crash for RegionStoreManager either, but reports a bogus unintialized
value warning.

llvm-svn: 70832
2009-05-04 06:35:49 +00:00
Douglas Gregor 2d69cd247e Tweak the extraction of the "interesting" part of a source range in two ways:
1) First of all, we treat _ as part of an identifier and not as
  punctuation (oops).
  2) Second of all, always make sure that the token that the ^ is
  pointing at is fully within the "interesting" part of the range.

llvm-svn: 70831
2009-05-04 06:27:32 +00:00
Ted Kremenek 02e508960c Per conversations with Zhongxing, add an 'element type' to
ElementRegion.  I also removed 'ElementRegion::getArrayRegion',
although we may need to add this back.

This breaks a few test cases with RegionStore:
- 'array-struct.c' triggers an infinite recursion in RegionStoreManager.  Need to investigate.
- misc-ps.m triggers a failure with RegionStoreManager as we now get the diagnostic:
  'Line 159: Uninitialized or undefined return value returned to caller.'
  
There were a bunch of places that needed to be edit
RegionStoreManager, and we may not be passing all the correct 'element
types' down from GRExprEngine.

Zhongxing: When you get a chance, could you review this?  I could have
easily screwed up something basic in RegionStoreManager.

llvm-svn: 70830
2009-05-04 06:18:28 +00:00
Douglas Gregor 5b07c7ec05 Implement support for comparing pointers with <, >, <=, >=, ==, and !=
in C++, taking into account conversions to the "composite pointer
type" so that we can compare, e.g., a pointer to a derived class to a
pointer to a base class. 

Also, upgrade the "comparing distinct pointer types" from a warning to
an error for C++, since this is clearly an error. Turns out that we
hadn't gone through and audited this code for C++, ever. 

Fixes <rdar://problem/6816420>.

llvm-svn: 70829
2009-05-04 06:07:12 +00:00
Ted Kremenek 1d9a267b2e retain checker:
- Fix retain checker test failures.
- Update retain checker to have annotations override default summary effects, not completely redefine them.

llvm-svn: 70828
2009-05-04 05:31:22 +00:00
Daniel Dunbar e993ba6fca Add -fobjc-tight-layout.
- This implements gcc style Objective-C interface layout (I
   think). Currently it is always off, there is no functionality
   change unless this is passed.
   
   For the curious, the deal is that gcc lays out the fields of a
   subclass as if they were part of the superclass. That is, the
   subclass fields immediately follow the super class fields instead
   of being padded to the alignment of the superclass structure.

 - Currently gcc uses the tight layout in 32-bit and 64-bit modes, and
   llvm-gcc uses it in 32-bit only, for reasons which aren't clear
   yet. We probably want to switch to matching gcc, once this makes it
   through testing... my hope is that we can also fix llvm-gcc in
   order to maintain compatibility between the compilers.

llvm-svn: 70827
2009-05-04 05:16:21 +00:00
Ted Kremenek ff606a1259 retain checker: RetainSummaryManager now has a 'DefaultSummary' object
which is returned instead of a null pointer.  This helps centralize
the logic concerning "default effects".

llvm-svn: 70826
2009-05-04 04:57:00 +00:00
Eli Friedman 2ad7e17096 PR4143: don't crash generating debug info for incomplete enum types.
llvm-svn: 70825
2009-05-04 04:39:55 +00:00
Ted Kremenek 1bff64e309 retain checker: Don't bother using a FoldingSet to unique summaries.
We never compare summaries by their pointers, and we create only a
handful of them when analyzing a given function.

llvm-svn: 70824
2009-05-04 04:30:18 +00:00
Eli Friedman 33955dd28f Remove unnecessary push_back (at least, I think it's unnecessary);
hopefully, this fixes PR4144 without any regressions.

llvm-svn: 70823
2009-05-04 04:12:48 +00:00
Daniel Dunbar 98ba964e5c Don't allow clients to traverse into superclass synthesized properties
via CollectObjCIvars.
 - In places where we need them, we should have the implementation and
   access the properties through it.

This is a fairly substantial functionality change: 
 1. @encode no longer encodes synthesized ivars, ever.

 2. The ivar layout bitmap no longer encodes information for
    synthesized ivars in superclasses. Well, actually I had already
    broken that, but it is intentional now.

We are now differing substantially from llvm-gcc and gcc
here. However, in my opinion this fundamentally *must* work if
non-fragile classes are to work. Without this change, the result of
@encode and the ivar layout depend on the order that the
implementation is seen in a file (if it is in the same file with its
superclass). Since both scenarios should work the same, our behavior
is now consistent with gcc behavior as if an implementation is never
seen following an implementation of its superclass.

Note that #2 is only a functionality change when (A) an
implementation appears in the same translation unit with the
implementation of its superclass, and (B) the superclass has
synthesized ivars. My belief is that this situation does not occur in
practice.

I am not yet sure of the role/semantics of @encode when synthesized
ivars are present... it's use is fairly unsound in a non-fragile world.

llvm-svn: 70822
2009-05-04 04:10:48 +00:00
Evan Cheng 3f77805642 Make sure to color with only allocatable registers for the specific register class.
llvm-svn: 70821
2009-05-04 03:30:11 +00:00
Chris Lattner d579cb1167 * Sink 4 duplicates of edge threading validity checks and DOUT prints into
ThreadEdge directly.  This shares the code, but is just a refactoring.
* Make JumpThreading compute the set of loop headers and avoid threading
  across them.  This prevents jump threading from forming irreducible 
  loops (goodness) but also prevents it from threading in other cases that
  are beneficial (see the comment above FindFunctionBackedges).

llvm-svn: 70820
2009-05-04 02:28:08 +00:00
Chris Lattner 351134ba93 Factor loop backedge finding out of CodeGenPrepare into a new
FindFunctionBackedges function.

llvm-svn: 70819
2009-05-04 02:25:58 +00:00
Daniel Dunbar d8b7f8e7cf Set COLUMNS=0 to disable wrapping instead of a random large number.
llvm-svn: 70818
2009-05-04 02:20:01 +00:00
Chris Lattner 0fc8a35fb8 add a range insertion method to SmallSet.
llvm-svn: 70817
2009-05-04 02:19:15 +00:00
Daniel Dunbar 4ddeb20743 Test a few more bits of the driver.
llvm-svn: 70816
2009-05-04 00:31:11 +00:00
Evan Cheng 4b6072bcb8 The stack slots which share the same stack slot after coloring can, but do not have to, use the same register. In fact, they each may have different register class requirements.
llvm-svn: 70815
2009-05-04 00:24:50 +00:00
Daniel Dunbar 032dc63cd4 Nightly test coverage reporting is back online.
llvm-svn: 70814
2009-05-03 23:46:18 +00:00
Daniel Dunbar 62b1070fa2 Inline GetFieldBaseOffset into sole callsite.
llvm-svn: 70813
2009-05-03 23:35:23 +00:00
Daniel Dunbar 5b743915c3 Avoid recomputing field offsets.
llvm-svn: 70812
2009-05-03 23:31:46 +00:00
Argyrios Kyrtzidis 79be34012f Revert r70803 for now, it causes a regression.
llvm-svn: 70811
2009-05-03 23:27:19 +00:00
Daniel Dunbar d22aa4a5e5 Normalize formatting
llvm-svn: 70810
2009-05-03 23:21:22 +00:00
Daniel Dunbar ea6dff3744 Make diagnostic printing more deterministic when running tests.
llvm-svn: 70809
2009-05-03 23:14:36 +00:00
Daniel Dunbar b5bd4eaa10 svn:ignore Debug+Coverage dirs
llvm-svn: 70808
2009-05-03 23:11:22 +00:00
Daniel Dunbar 6f9499188c Fix an infinite loop in diagnostic printing.
- The diagnostic is still poor, however. Doug, can you investigate?

 - Improved the test case to not depend on the file name, now it can
   be extended to actually check the formatting of the diagnostics
   (I'm hoping grep -A is portable here).

llvm-svn: 70807
2009-05-03 23:04:40 +00:00
Eli Friedman 7df3447c10 Fix for PR3841: follow gcc's example and fall back to the system
stdint.h unless we are freestanding.

Any suggestions here are welcome.

llvm-svn: 70806
2009-05-03 23:00:48 +00:00
Eli Friedman b8c4fd8cfd PR2524: downgrade taking address of expression of type 'void' to an
extension warning.

llvm-svn: 70805
2009-05-03 22:36:05 +00:00
Argyrios Kyrtzidis ba49fef34a Remove an, apparently, leftover MachineModuleInfo::RecordSourceLine declaration.
llvm-svn: 70804
2009-05-03 22:11:08 +00:00
Argyrios Kyrtzidis ce7196b903 -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
-Depend on DebugLocs for source line info.

llvm-svn: 70803
2009-05-03 22:03:35 +00:00
Eli Friedman 8469bc7c73 Fix/re-enable test.
llvm-svn: 70800
2009-05-03 21:22:18 +00:00
Daniel Dunbar 110c800cee Disable this test case, I'm tired of seeing red. :)
llvm-svn: 70799
2009-05-03 21:10:32 +00:00
Daniel Dunbar 36e2a1eea3 Use the implementation decl for looking up offset while building the
ivar layout.
 - The layout needs access to synthesized ivars.

llvm-svn: 70798
2009-05-03 21:05:10 +00:00
Daniel Dunbar e4eeb07acd Rename test case
llvm-svn: 70797
2009-05-03 20:37:42 +00:00
Eli Friedman 426056acf2 Fix the testcase for PR4132.
llvm-svn: 70796
2009-05-03 19:54:21 +00:00
Ted Kremenek 055797b789 Add RegionStore test that illustrates a bogus array-out-of-bounds error.
llvm-svn: 70795
2009-05-03 19:24:34 +00:00
Eli Friedman 5b73b5e197 PR4134: Implement __builtin_extract_return_addr.
llvm-svn: 70794
2009-05-03 19:23:23 +00:00
Eli Friedman 2f621b72f4 Fix for PR4132: make sure to insert whitespace consistently before a
pasted token.

llvm-svn: 70793
2009-05-03 19:16:00 +00:00
Evan Cheng 1de5cf548e Typo.
llvm-svn: 70792
2009-05-03 19:10:11 +00:00