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

11661 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar a3c078ee57 Override some pod2man defaults.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 00:10:37 +00:00
Fariborz Jahanian 06b89124a9 Fixes a bug for objc2's gc in the presense of type-casts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 23:28:21 +00:00
Ted Kremenek e1baed3843 BugReporter (extensive diagnostics): improve location context generation for the
start of 'do' and '@synchronized' statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 23:13:38 +00:00
Ted Kremenek da5348eda7 source-level CFG: have the body for the @synchronized start with its own basic
block. This makes it a little easier for diagnostics generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71037 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 23:11:51 +00:00
Ted Kremenek c42e07ef9a BugReporter (extensive diagnostics): Fix getEnclosingStmtLocation to reason
about Exprs that are not consumed and fix where the loop iteration diagnostic
goes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 22:19:17 +00:00
Ted Kremenek ade9ecaba9 Fix subtle bug in ParentMap::isConsumedExpr(): correctly ignore *parents* that
are ParenExpr or CastExprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 22:16:12 +00:00
Chris Lattner 037fb7f369 Fix rdar://6849429 - -Wunused-value with deeply nested macro expansion generates untraceable warnings
The "instantiated from" messages coming from the caret diagnostics system are 
basically walking the macro expansion tree, emitting each level as it goes.  However, it was
skipping certain leaves in the tree by skipping up the entire instantiation arm every time
it went up one spelling arm.  This caused it to miss some things.  For example, in this
testcase:

#define M1(x) x
#define M2 1;

void foo() {
 M1(M2)
}

we now print:

/Users/sabre/Desktop/clang-unused-value-macro.c:6:2: warning: expression result unused

 M1(M2)
 ^~~~~~
/Users/sabre/Desktop/clang-unused-value-macro.c:6:5: note: instantiated from:

 M1(M2)
    ^~
/Users/sabre/Desktop/clang-unused-value-macro.c:3:12: note: instantiated from:

#define M2 1;
           ^

Previously we didn't print the last line, so we never emitted the caret pointing to the 1!

Incidentally, the spaces between the lines is really noisy, I think we should reconsider
this heuristic (which adds them when the printed code starts too close to the start of the
line).

The regression test can't use -verify, because -verify doesn't catch notes for macro
instantiation history.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 22:03:18 +00:00
Chris Lattner 67a16fe5d6 rename test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71024 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 21:52:01 +00:00
Fariborz Jahanian df9ccc6381 Patch to support Gnu runtime's typed selectors.
Patch by David Chisnall.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 21:36:57 +00:00
Chris Lattner a021e7c4ce 257 -> FS
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 18:54:47 +00:00
Daniel Dunbar d25f00c21b Enable tight Objective-C interface layout unconditionally.
- I will remove the flag when I'm comfortable there is no fallout
   from this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 18:52:50 +00:00
Ted Kremenek 69aa08072d Implement attribute 'ns_autorelease'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 18:44:20 +00:00
Fariborz Jahanian 041f2fd623 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
2009-05-05 18:34:37 +00:00
Chris Lattner b0ed3029d9 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
2009-05-05 17:48:42 +00:00
Ted Kremenek 4222f21c98 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
2009-05-05 17:46:22 +00:00
Chris Lattner bdb0132722 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
2009-05-05 06:16:31 +00:00
Chris Lattner d37d9b5bf9 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
2009-05-05 05:16:17 +00:00
Chris Lattner 9e55b8a8b3 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
2009-05-05 05:05:36 +00:00
Chris Lattner 650cea9cc5 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
2009-05-05 04:57:08 +00:00
Douglas Gregor de866f3d4d 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
2009-05-05 04:50:50 +00:00
Anders Carlsson 2a131fbca2 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
2009-05-05 04:44:02 +00:00
Ted Kremenek b9c7cbb2cc Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 03:56:29 +00:00
Ted Kremenek e351aa10da 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
2009-05-05 00:46:09 +00:00
Daniel Dunbar a81419d0b5 Remove an unneeded lookup routine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70951 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 00:36:57 +00:00
Ted Kremenek d331dd7fa4 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
2009-05-05 00:21:59 +00:00
Ted Kremenek 921b0b5ef3 Fix unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 00:06:16 +00:00
Ted Kremenek 0ac5618eab 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
2009-05-05 00:02:18 +00:00
Ted Kremenek 6a08469ebe 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
2009-05-04 23:52:59 +00:00
Ted Kremenek d99b345a1a Remove experimental attribute 'ns_ownership_make_collectable.'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 23:46:06 +00:00
Fariborz Jahanian bf63b87ecf 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
2009-05-04 23:27:20 +00:00
Daniel Dunbar 6e8575b88b 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
2009-05-04 23:23:09 +00:00
Fariborz Jahanian 31fa7d7022 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
2009-05-04 21:46:27 +00:00
Daniel Dunbar b4c79e027f 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
2009-05-04 21:26:30 +00:00
Daniel Dunbar c2e57bfc7f 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
2009-05-04 21:10:32 +00:00
Daniel Dunbar f773737e35 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
2009-05-04 21:00:40 +00:00
Daniel Dunbar bc6ea8125a 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
2009-05-04 20:52:37 +00:00
Fariborz Jahanian d4edddde6d 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
2009-05-04 19:35:12 +00:00
Ted Kremenek 75494ffb4e Rename attributes 'objc_ownership...' to 'ns_ownership...'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 19:10:19 +00:00
Ted Kremenek 305d2d2b61 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
2009-05-04 19:02:41 +00:00
Chris Lattner dcd808c1f9 "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
2009-05-04 18:27:04 +00:00
Ted Kremenek 4c6f8d38e2 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
2009-05-04 18:15:17 +00:00
Ted Kremenek 65d80fd4ac 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
2009-05-04 17:53:11 +00:00
Ted Kremenek 31c215e620 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
2009-05-04 17:29:57 +00:00
Ted Kremenek 1308f573d7 Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70883 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 17:27:32 +00:00
Ted Kremenek 1c6a3cc881 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
2009-05-04 17:04:30 +00:00
Chris Lattner c6e2ab0dd6 "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
2009-05-04 16:56:33 +00:00
Ted Kremenek ea4b4aaa64 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
2009-05-04 16:43:50 +00:00
Ted Kremenek 05673d61fe 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
2009-05-04 15:40:58 +00:00
Ted Kremenek e401a0ce4a 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
2009-05-04 15:34:07 +00:00
Daniel Dunbar 5efccb1ab8 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
2009-05-04 15:31:17 +00:00