Граф коммитов

11594 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar d6884a0b90 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 05:16:21 +00:00
Ted Kremenek 7faca82163 retain checker: RetainSummaryManager now has a 'DefaultSummary' object
which is returned instead of a null pointer.  This helps centralize
the logic concerning "default effects".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70826 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 04:57:00 +00:00
Eli Friedman 3189e4be4f PR4143: don't crash generating debug info for incomplete enum types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 04:39:55 +00:00
Ted Kremenek 22fe248abd 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 04:30:18 +00:00
Eli Friedman 5c667608ef Remove unnecessary push_back (at least, I think it's unnecessary);
hopefully, this fixes PR4144 without any regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70823 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 04:12:48 +00:00
Daniel Dunbar 3715328021 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 04:10:48 +00:00
Daniel Dunbar 609e5c36af Set COLUMNS=0 to disable wrapping instead of a random large number.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70818 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 02:20:01 +00:00
Daniel Dunbar 5f865672c0 Test a few more bits of the driver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70816 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 00:31:11 +00:00
Daniel Dunbar b9876318cb Nightly test coverage reporting is back online.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:46:18 +00:00
Daniel Dunbar e05cc98e97 Inline GetFieldBaseOffset into sole callsite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:35:23 +00:00
Daniel Dunbar 900c1980de Avoid recomputing field offsets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:31:46 +00:00
Daniel Dunbar 31682fd385 Normalize formatting
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:21:22 +00:00
Daniel Dunbar f4287fd570 Make diagnostic printing more deterministic when running tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:14:36 +00:00
Daniel Dunbar 613e12a482 svn:ignore Debug+Coverage dirs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70808 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:11:22 +00:00
Daniel Dunbar 1ef29d217e 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70807 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:04:40 +00:00
Eli Friedman 6fdca0e1f8 Fix for PR3841: follow gcc's example and fall back to the system
stdint.h unless we are freestanding.

Any suggestions here are welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 23:00:48 +00:00
Eli Friedman 53202857c6 PR2524: downgrade taking address of expression of type 'void' to an
extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70805 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 22:36:05 +00:00
Eli Friedman c0d600c83a Fix/re-enable test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 21:22:18 +00:00
Daniel Dunbar 9c2b34728b Disable this test case, I'm tired of seeing red. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 21:10:32 +00:00
Daniel Dunbar 5a5a803df8 Use the implementation decl for looking up offset while building the
ivar layout.
 - The layout needs access to synthesized ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 21:05:10 +00:00
Daniel Dunbar a74869c46a Rename test case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70797 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 20:37:42 +00:00
Eli Friedman 686a21bf85 Fix the testcase for PR4132.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 19:54:21 +00:00
Ted Kremenek 9668255419 Add RegionStore test that illustrates a bogus array-out-of-bounds error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 19:24:34 +00:00
Eli Friedman 3b660efb9f PR4134: Implement __builtin_extract_return_addr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 19:23:23 +00:00
Eli Friedman d9b856fddd Fix for PR4132: make sure to insert whitespace consistently before a
pasted token.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70793 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 19:16:00 +00:00
Ted Kremenek 953e8abf9b Add failing test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70791 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 19:09:37 +00:00
Eli Friedman 43907e87c7 Fix comment to account for r70786.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 19:01:39 +00:00
Eli Friedman 5e22213961 PR4133: fix always_inline implementation to be consistent with gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70786 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 18:13:43 +00:00
Anders Carlsson 31ccf377f4 Make codegen for constructors work again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 17:47:16 +00:00
Douglas Gregor ed4ec8f6d1 One can use "class" and "struct" interchangeably to refer to a class
in C++. Fixes <rdar://problem/6815995>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 17:18:57 +00:00
Anders Carlsson 578aa64fd1 assert that mangleName is not called for C++ ctors/dtors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70783 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 16:51:04 +00:00
Douglas Gregor 2167de4c49 Fix crash in source-line truncation code for diagnostic
printing. Also, when we only need to truncate the line at the end,
make sure there is room for the ellipsis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 15:24:25 +00:00
Daniel Dunbar ee1ec39f54 Remove ASTContext::addRecordToClass.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 14:27:48 +00:00
Daniel Dunbar 7c9f6c51be It turns out BuildAggrIvarLayout wasn't even using the shadow struct,
just computing it!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 14:22:14 +00:00
Daniel Dunbar 25d583ec27 Lift common subexpression, remove dead "base" variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 14:17:18 +00:00
Daniel Dunbar d58edcb491 Factor out BuildAggrIvarRecordLayout routine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70777 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 14:10:34 +00:00
Daniel Dunbar 5e563dd38d Lift out GetGCAttrTypeForType routine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70776 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:55:09 +00:00
Daniel Dunbar 8b2926c236 Add constructors for GC_IVAR and SKIP_SCAN, tighten up uses.
Lift up a size calculation and note some asymmetries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:44:42 +00:00
Anton Korobeynikov 73c64e5fb9 Hook msp430 in
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70774 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:43:08 +00:00
Anton Korobeynikov a7c4717f5f Whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:42:53 +00:00
Daniel Dunbar 487993b90d Normalize style, remove a dead assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:32:01 +00:00
Daniel Dunbar 532d4daa03 Use ASTRecordLayout for computing ivar offsets instead of shadow
struct.
 - We still need to do more lookup than necessary because ivars don't
   live in a reasonable DeclContext.

 - The only remaining client of the interface shadow struct is the
   ivar layout bitmap.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 13:15:50 +00:00
Daniel Dunbar 9f89f2bc11 Add a ComputeIvarBaseOffset overload taking an implementation
decl. Only this routine will be suitable for computing the offset of a
synthesized ivar.
 - No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 12:57:56 +00:00
Daniel Dunbar d8fd6ff0ea Fix a possible memory error, the record layout entry could be
invalidated by layout out the super class, we cannot cache the map
entry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 11:41:43 +00:00
Daniel Dunbar 453addbaea Implement the interface/implementation layout distinction.
- These routines should now be independent of the Sema state.

 - This is nearly zero functionality change, the distinction only
   matters in the non-fragile ABI, and the consumers that care about
   this distinction should be using getASTObjCImplementationLayout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 11:16:44 +00:00
Daniel Dunbar 2bebbf0ace Compute Objective-C metadata size information from the record layout,
not the shadow structure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 10:46:44 +00:00
Daniel Dunbar b2dbbb99e1 Split out getASTObjCImplementationLayout
- The difference from getASTObjCInterfaceLayout is that the computes
   the layout including synthesized ivars.

 - No functionality change, they currently both compute the same thing
   -- whether that includes synthesized ivars or not depends on when
   they get called!!!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 10:38:35 +00:00
Daniel Dunbar 24cbfb96f0 Remove an unneeded special case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 10:35:52 +00:00
Daniel Dunbar e5393fb93e PR4063, with feeling: Chain PP callbacks by default.
- This is somewhat cleaner and also fixes PR4063 for real, I had the
   order wrong so we were just creating an empty dependency file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 10:04:17 +00:00
Daniel Dunbar 0a70c64b09 PR4063: Fix dependency generation with -E.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 09:35:25 +00:00