]> granicus.if.org Git - clang/log
clang
15 years agoIssue a warning in odd case of instance method used
Fariborz Jahanian [Tue, 5 May 2009 18:34:37 +0000 (18:34 +0000)]
Issue a warning in odd case of instance method used
in a 'Class' receiver which is not a root instance
method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70987 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove some incorrect and unimplemented atomic builtins (e.g.
Chris Lattner [Tue, 5 May 2009 17:48:42 +0000 (17:48 +0000)]
remove some incorrect and unimplemented atomic builtins (e.g.
__sync_umin_and_fetch), add some missing atomic builtins (e.g.
__sync_fetch_and_nand) and reorder the list to match the GCC
documentation.  The builtins still need work and codegen
implementation, more patches coming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70985 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhance ownership attribute tests with functions that use the attributes!
Ted Kremenek [Tue, 5 May 2009 17:46:22 +0000 (17:46 +0000)]
Enhance ownership attribute tests with functions that use the attributes!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70984 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen defining a function whose type has no prototype, make an effort
Chris Lattner [Tue, 5 May 2009 06:16:31 +0000 (06:16 +0000)]
When defining a function whose type has no prototype, make an effort
to go back and clean up existing uses of the bitcasted function.  This
is not just an optimization: it is required for correctness to get
always inline functions to work, see testcases in function-attributes.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70971 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix some more cases where we'd emit a file with a line of 0 for implicit
Chris Lattner [Tue, 5 May 2009 05:16:17 +0000 (05:16 +0000)]
fix some more cases where we'd emit a file with a line of 0 for implicit
types.  In this case, it was objc_selector and objc_class.  This fixes
rdar://6852754 - clang sometimes generates incorrect/unknown file/line info for DW_TAG__structure_type dies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70969 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo not generate bogus location info for DW_TAG_inheritance
Chris Lattner [Tue, 5 May 2009 05:05:36 +0000 (05:05 +0000)]
Do not generate bogus location info for DW_TAG_inheritance
DIEs.  We were generating a loc with line of 0 and a file.
These tags do not need locations at all, just remove it.
this fixes rdar://6852792 - Clang generates incorrect (and unnecessary) file and line info for DW_TAG_inheritance dies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70966 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix generated debug info for decls with no location (which include self/_cmd
Chris Lattner [Tue, 5 May 2009 04:57:08 +0000 (04:57 +0000)]
Fix generated debug info for decls with no location (which include self/_cmd
in ObjC) to not emit file/line location information.  Previously
we would output a file with bogus line information.  This fixes:
rdar://6852814 - Clang generates incorrect file & line info for automatic/understood formal parameters for objc-programs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70965 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTurns out that Sebastian already implemented the logic to compute the
Douglas Gregor [Tue, 5 May 2009 04:50:50 +0000 (04:50 +0000)]
Turns out that Sebastian already implemented the logic to compute the
composite pointer type, and his is better! Updated relational- and
equality-operator checking accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70963 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefactor global decls to hold either a regular Decl or a CXXConstructorDecl + ctor...
Anders Carlsson [Tue, 5 May 2009 04:44:02 +0000 (04:44 +0000)]
Refactor global decls to hold either a regular Decl or a CXXConstructorDecl + ctor type or a CXXDestructorDecl + dtor type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70962 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate checker build.
Ted Kremenek [Tue, 5 May 2009 03:56:29 +0000 (03:56 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70961 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').
Ted Kremenek [Tue, 5 May 2009 00:46:09 +0000 (00:46 +0000)]
Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70952 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove an unneeded lookup routine.
Daniel Dunbar [Tue, 5 May 2009 00:36:57 +0000 (00:36 +0000)]
Remove an unneeded lookup routine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70951 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename ownership attributes:
Ted Kremenek [Tue, 5 May 2009 00:21:59 +0000 (00:21 +0000)]
Rename ownership attributes:
 ns_ownership_returns -> ns_returns_owned
 ns_ownership_retain -> ns_retains
 ns_ownership_release -> ns_releases
 cf_ownership_retain ->  cf_retains
 cf_ownership_release -> cf_releases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70949 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix unused variable warning
Ted Kremenek [Tue, 5 May 2009 00:06:16 +0000 (00:06 +0000)]
Fix unused variable warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70946 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove possibly incorrect assertion that doesn't matter.
Ted Kremenek [Tue, 5 May 2009 00:02:18 +0000 (00:02 +0000)]
Remove possibly incorrect assertion that doesn't matter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70943 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.
Ted Kremenek [Mon, 4 May 2009 23:52:59 +0000 (23:52 +0000)]
Rename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70941 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove experimental attribute 'ns_ownership_make_collectable.'
Ted Kremenek [Mon, 4 May 2009 23:46:06 +0000 (23:46 +0000)]
Remove experimental attribute 'ns_ownership_make_collectable.'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoProvide basic support for generation of objc2's
Fariborz Jahanian [Mon, 4 May 2009 23:27:20 +0000 (23:27 +0000)]
Provide basic support for generation of objc2's
objc_assign_global API when assigning to global
objective-c object pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70939 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the field count in interface record layout (it was incorrectly
Daniel Dunbar [Mon, 4 May 2009 23:23:09 +0000 (23:23 +0000)]
Fix the field count in interface record layout (it was incorrectly
compensating for super classes). This was making the reported class
sizes for empty classes very, very wrong.
 - Also, we now report the size info for an empty class like gcc (as
   the offset of the start, not as 0, 0).

 - Add a few more test cases we were mishandling before (padding bit
   field at end of struct, for example).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70938 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdding more test to ivar-layout-64.m.
Fariborz Jahanian [Mon, 4 May 2009 21:46:27 +0000 (21:46 +0000)]
Adding more test to ivar-layout-64.m.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70918 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCompute interface instanceStart and instanceSize using the record
Daniel Dunbar [Mon, 4 May 2009 21:26:30 +0000 (21:26 +0000)]
Compute interface instanceStart and instanceSize using the record
layout.
 - This is much simpler / more efficient.

 - This also properly computes the size in the presence of bit-fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70916 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits.
Daniel Dunbar [Mon, 4 May 2009 21:10:32 +0000 (21:10 +0000)]
Add ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70914 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd ASTRecordLayout::getNextOffset accessor, and some doxygen comments.
Daniel Dunbar [Mon, 4 May 2009 21:00:40 +0000 (21:00 +0000)]
Add ASTRecordLayout::getNextOffset accessor, and some doxygen comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70909 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInitialize NextOffset correctly, otherwise tight layout fails for
Daniel Dunbar [Mon, 4 May 2009 20:52:37 +0000 (20:52 +0000)]
Initialize NextOffset correctly, otherwise tight layout fails for
empty classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70905 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoignore weak_import attribute on objc method decls.
Fariborz Jahanian [Mon, 4 May 2009 19:35:12 +0000 (19:35 +0000)]
ignore weak_import attribute on objc method decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70901 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename attributes 'objc_ownership...' to 'ns_ownership...'.
Ted Kremenek [Mon, 4 May 2009 19:10:19 +0000 (19:10 +0000)]
Rename attributes 'objc_ownership...' to 'ns_ownership...'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70897 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIncrease scan-view max timeout to 1 minute.
Ted Kremenek [Mon, 4 May 2009 19:02:41 +0000 (19:02 +0000)]
Increase scan-view max timeout to 1 minute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70896 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago"Fix" a problem with debug info in the presence of always_inline
Chris Lattner [Mon, 4 May 2009 18:27:04 +0000 (18:27 +0000)]
"Fix" a problem with debug info in the presence of always_inline
function calls.  For a program like this:

#include <stdio.h>
static __inline__ __attribute__((always_inline))
int bar(int x) { return 4; }
int main() {
  int X = bar(4);
  printf("%d\n", X);
}

clang was not outputing any debug info for the body of main().  This is
because the backend is getting confused by the region_start/end that clang
is emitting for block scopes.  For now, just disable these (matching llvm-gcc),
this stuff is in progress of rework anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70889 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBugReporter (extensive diagnostics): don't mark location contexts that are
Ted Kremenek [Mon, 4 May 2009 18:15:17 +0000 (18:15 +0000)]
BugReporter (extensive diagnostics): don't mark location contexts that are
control-flow expressions as dead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70887 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix false positive null dereference by unifying code paths in GRSimpleVals for
Ted Kremenek [Mon, 4 May 2009 17:53:11 +0000 (17:53 +0000)]
Fix false positive null dereference by unifying code paths in GRSimpleVals for
'==' and '!=' (some code in the '!=' was not replicated in the '==' code,
causing some constraints to get lost).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70885 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename attributes:
Ted Kremenek [Mon, 4 May 2009 17:29:57 +0000 (17:29 +0000)]
Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'

Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70884 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate test case.
Ted Kremenek [Mon, 4 May 2009 17:27:32 +0000 (17:27 +0000)]
Update test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70883 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove support for ObjCMethodDecl attributes that appear between the
Ted Kremenek [Mon, 4 May 2009 17:04:30 +0000 (17:04 +0000)]
Remove support for ObjCMethodDecl attributes that appear between the
return type and the selector.  This is inconsistent with C functions
(where such attributes would be placed on the return type, not the the
FunctionDecl), and is inconsistent with what people are use to seeing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70878 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago"The attached diff fixes the //FIXME in message send to super. This should now be...
Chris Lattner [Mon, 4 May 2009 16:56:33 +0000 (16:56 +0000)]
"The attached diff fixes the //FIXME in message send to super.  This should now be faster, and works in the presence of class posing.  This is now the same approach as used in GCC (the earlier code was a quick hack to get something working)."

Patch by David Chisnall!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70877 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoretain checker: Add checker support for FunctionDecl ownership annotations. Need...
Ted Kremenek [Mon, 4 May 2009 16:43:50 +0000 (16:43 +0000)]
retain checker: Add checker support for FunctionDecl ownership annotations.  Need to add Sema support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70873 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoretain checker: Pull out logic for parameter annotations into a
Ted Kremenek [Mon, 4 May 2009 15:40:58 +0000 (15:40 +0000)]
retain checker: Pull out logic for parameter annotations into a
separate method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70870 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoretain checker: Don't treat function's declared in macros differently.
Ted Kremenek [Mon, 4 May 2009 15:34:07 +0000 (15:34 +0000)]
retain checker: Don't treat function's declared in macros differently.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70869 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPatch from David Chisnall:
Daniel Dunbar [Mon, 4 May 2009 15:31:17 +0000 (15:31 +0000)]
Patch from David Chisnall:

The attached diff fixes the //FIXME in message send to super.  This
should now be faster, and works in the presence of class posing.  This
is now the same approach as used in GCC (the earlier code was a quick
hack to get something working).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70868 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd array index assertion: BasicStore should not expect any fancy
Ted Kremenek [Mon, 4 May 2009 15:25:46 +0000 (15:25 +0000)]
Add array index assertion: BasicStore should not expect any fancy
ElementRegions that have non-zero array indices.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70867 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate test case... the location given for this error makes it look
Daniel Dunbar [Mon, 4 May 2009 15:18:44 +0000 (15:18 +0000)]
Update test case... the location given for this error makes it look
rather odd when truncated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70866 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename 'makeZeroIndex' to 'makeZeroArrayIndex'.
Ted Kremenek [Mon, 4 May 2009 15:17:38 +0000 (15:17 +0000)]
Rename 'makeZeroIndex' to 'makeZeroArrayIndex'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70865 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoZhongxing already implemented this FIXME.
Ted Kremenek [Mon, 4 May 2009 15:14:27 +0000 (15:14 +0000)]
Zhongxing already implemented this FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70864 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRename no-outofbounds.c to xfail-no-outofbounds.c and split off that
Ted Kremenek [Mon, 4 May 2009 14:31:19 +0000 (14:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70859 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate checker build.
Ted Kremenek [Mon, 4 May 2009 14:24:29 +0000 (14:24 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70858 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoarray indexes are unsigned integers of the same width as pointer.
Zhongxing Xu [Mon, 4 May 2009 08:52:47 +0000 (08:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70844 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTest now passes. I'll hold off merging it with the BasicStore test until we know...
Ted Kremenek [Mon, 4 May 2009 07:11:21 +0000 (07:11 +0000)]
Test now passes.  I'll hold off merging it with the BasicStore test until we know this is a stable change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70837 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBasicStore: 'ElementRegion' is the new 'TypedViewRegion'.
Ted Kremenek [Mon, 4 May 2009 07:04:36 +0000 (07:04 +0000)]
BasicStore: 'ElementRegion' is the new 'TypedViewRegion'.
StoreManager: Handle casts from one element region to another.
Update test cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70836 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove unnecessary copy of constraint info.
Daniel Dunbar [Mon, 4 May 2009 06:56:16 +0000 (06:56 +0000)]
Remove unnecessary copy of constraint info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70835 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis test no longer fails.
Ted Kremenek [Mon, 4 May 2009 06:45:58 +0000 (06:45 +0000)]
This test no longer fails.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70834 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify the interesting-region code by assimmilating blocks of non-whitespace text...
Douglas Gregor [Mon, 4 May 2009 06:45:38 +0000 (06:45 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70833 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle 'long x = 0; char *y = (char *) x;' by layering an
Ted Kremenek [Mon, 4 May 2009 06:35:49 +0000 (06:35 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70832 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTweak the extraction of the "interesting" part of a source range in two ways:
Douglas Gregor [Mon, 4 May 2009 06:27:32 +0000 (06:27 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70831 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPer conversations with Zhongxing, add an 'element type' to
Ted Kremenek [Mon, 4 May 2009 06:18:28 +0000 (06:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70830 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement support for comparing pointers with <, >, <=, >=, ==, and !=
Douglas Gregor [Mon, 4 May 2009 06:07:12 +0000 (06:07 +0000)]
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>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70829 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoretain checker:
Ted Kremenek [Mon, 4 May 2009 05:31:22 +0000 (05:31 +0000)]
retain checker:
- Fix retain checker test failures.
- Update retain checker to have annotations override default summary effects, not completely redefine them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70828 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd -fobjc-tight-layout.
Daniel Dunbar [Mon, 4 May 2009 05:16:21 +0000 (05:16 +0000)]
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

15 years agoretain checker: RetainSummaryManager now has a 'DefaultSummary' object
Ted Kremenek [Mon, 4 May 2009 04:57:00 +0000 (04:57 +0000)]
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

15 years agoPR4143: don't crash generating debug info for incomplete enum types.
Eli Friedman [Mon, 4 May 2009 04:39:55 +0000 (04:39 +0000)]
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

15 years agoretain checker: Don't bother using a FoldingSet to unique summaries.
Ted Kremenek [Mon, 4 May 2009 04:30:18 +0000 (04:30 +0000)]
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

15 years agoRemove unnecessary push_back (at least, I think it's unnecessary);
Eli Friedman [Mon, 4 May 2009 04:12:48 +0000 (04:12 +0000)]
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

15 years agoDon't allow clients to traverse into superclass synthesized properties
Daniel Dunbar [Mon, 4 May 2009 04:10:48 +0000 (04:10 +0000)]
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

15 years agoSet COLUMNS=0 to disable wrapping instead of a random large number.
Daniel Dunbar [Mon, 4 May 2009 02:20:01 +0000 (02:20 +0000)]
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

15 years agoTest a few more bits of the driver.
Daniel Dunbar [Mon, 4 May 2009 00:31:11 +0000 (00:31 +0000)]
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

15 years agoNightly test coverage reporting is back online.
Daniel Dunbar [Sun, 3 May 2009 23:46:18 +0000 (23:46 +0000)]
Nightly test coverage reporting is back online.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70814 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInline GetFieldBaseOffset into sole callsite.
Daniel Dunbar [Sun, 3 May 2009 23:35:23 +0000 (23:35 +0000)]
Inline GetFieldBaseOffset into sole callsite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70813 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAvoid recomputing field offsets.
Daniel Dunbar [Sun, 3 May 2009 23:31:46 +0000 (23:31 +0000)]
Avoid recomputing field offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70812 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNormalize formatting
Daniel Dunbar [Sun, 3 May 2009 23:21:22 +0000 (23:21 +0000)]
Normalize formatting

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70810 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMake diagnostic printing more deterministic when running tests.
Daniel Dunbar [Sun, 3 May 2009 23:14:36 +0000 (23:14 +0000)]
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

15 years agosvn:ignore Debug+Coverage dirs
Daniel Dunbar [Sun, 3 May 2009 23:11:22 +0000 (23:11 +0000)]
svn:ignore Debug+Coverage dirs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70808 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix an infinite loop in diagnostic printing.
Daniel Dunbar [Sun, 3 May 2009 23:04:40 +0000 (23:04 +0000)]
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

15 years agoFix for PR3841: follow gcc's example and fall back to the system
Eli Friedman [Sun, 3 May 2009 23:00:48 +0000 (23:00 +0000)]
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

15 years agoPR2524: downgrade taking address of expression of type 'void' to an
Eli Friedman [Sun, 3 May 2009 22:36:05 +0000 (22:36 +0000)]
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

15 years agoFix/re-enable test.
Eli Friedman [Sun, 3 May 2009 21:22:18 +0000 (21:22 +0000)]
Fix/re-enable test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70800 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDisable this test case, I'm tired of seeing red. :)
Daniel Dunbar [Sun, 3 May 2009 21:10:32 +0000 (21:10 +0000)]
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

15 years agoUse the implementation decl for looking up offset while building the
Daniel Dunbar [Sun, 3 May 2009 21:05:10 +0000 (21:05 +0000)]
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

15 years agoRename test case
Daniel Dunbar [Sun, 3 May 2009 20:37:42 +0000 (20:37 +0000)]
Rename test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70797 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix the testcase for PR4132.
Eli Friedman [Sun, 3 May 2009 19:54:21 +0000 (19:54 +0000)]
Fix the testcase for PR4132.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70796 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd RegionStore test that illustrates a bogus array-out-of-bounds error.
Ted Kremenek [Sun, 3 May 2009 19:24:34 +0000 (19:24 +0000)]
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

15 years agoPR4134: Implement __builtin_extract_return_addr.
Eli Friedman [Sun, 3 May 2009 19:23:23 +0000 (19:23 +0000)]
PR4134: Implement __builtin_extract_return_addr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70794 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix for PR4132: make sure to insert whitespace consistently before a
Eli Friedman [Sun, 3 May 2009 19:16:00 +0000 (19:16 +0000)]
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

15 years agoAdd failing test case.
Ted Kremenek [Sun, 3 May 2009 19:09:37 +0000 (19:09 +0000)]
Add failing test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70791 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix comment to account for r70786.
Eli Friedman [Sun, 3 May 2009 19:01:39 +0000 (19:01 +0000)]
Fix comment to account for r70786.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70789 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPR4133: fix always_inline implementation to be consistent with gcc.
Eli Friedman [Sun, 3 May 2009 18:13:43 +0000 (18:13 +0000)]
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

15 years agoMake codegen for constructors work again.
Anders Carlsson [Sun, 3 May 2009 17:47:16 +0000 (17:47 +0000)]
Make codegen for constructors work again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70785 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOne can use "class" and "struct" interchangeably to refer to a class
Douglas Gregor [Sun, 3 May 2009 17:18:57 +0000 (17:18 +0000)]
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

15 years agoassert that mangleName is not called for C++ ctors/dtors.
Anders Carlsson [Sun, 3 May 2009 16:51:04 +0000 (16:51 +0000)]
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

15 years agoFix crash in source-line truncation code for diagnostic
Douglas Gregor [Sun, 3 May 2009 15:24:25 +0000 (15:24 +0000)]
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

15 years agoRemove ASTContext::addRecordToClass.
Daniel Dunbar [Sun, 3 May 2009 14:27:48 +0000 (14:27 +0000)]
Remove ASTContext::addRecordToClass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70780 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIt turns out BuildAggrIvarLayout wasn't even using the shadow struct,
Daniel Dunbar [Sun, 3 May 2009 14:22:14 +0000 (14:22 +0000)]
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

15 years agoLift common subexpression, remove dead "base" variable.
Daniel Dunbar [Sun, 3 May 2009 14:17:18 +0000 (14:17 +0000)]
Lift common subexpression, remove dead "base" variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70778 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFactor out BuildAggrIvarRecordLayout routine.
Daniel Dunbar [Sun, 3 May 2009 14:10:34 +0000 (14:10 +0000)]
Factor out BuildAggrIvarRecordLayout routine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70777 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoLift out GetGCAttrTypeForType routine.
Daniel Dunbar [Sun, 3 May 2009 13:55:09 +0000 (13:55 +0000)]
Lift out GetGCAttrTypeForType routine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70776 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd constructors for GC_IVAR and SKIP_SCAN, tighten up uses.
Daniel Dunbar [Sun, 3 May 2009 13:44:42 +0000 (13:44 +0000)]
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

15 years agoHook msp430 in
Anton Korobeynikov [Sun, 3 May 2009 13:43:08 +0000 (13:43 +0000)]
Hook msp430 in

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70774 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhitespace cleanup
Anton Korobeynikov [Sun, 3 May 2009 13:42:53 +0000 (13:42 +0000)]
Whitespace cleanup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70773 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoNormalize style, remove a dead assert.
Daniel Dunbar [Sun, 3 May 2009 13:32:01 +0000 (13:32 +0000)]
Normalize style, remove a dead assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70771 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse ASTRecordLayout for computing ivar offsets instead of shadow
Daniel Dunbar [Sun, 3 May 2009 13:15:50 +0000 (13:15 +0000)]
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

15 years agoAdd a ComputeIvarBaseOffset overload taking an implementation
Daniel Dunbar [Sun, 3 May 2009 12:57:56 +0000 (12:57 +0000)]
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

15 years agoFix a possible memory error, the record layout entry could be
Daniel Dunbar [Sun, 3 May 2009 11:41:43 +0000 (11:41 +0000)]
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

15 years agoImplement the interface/implementation layout distinction.
Daniel Dunbar [Sun, 3 May 2009 11:16:44 +0000 (11:16 +0000)]
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