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

2027 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor bd249a5428 AST import for sizeof and alignof expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:24:23 +00:00
Douglas Gregor 4408063066 AST import for DeclRefExprs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:17:02 +00:00
Douglas Gregor f638f9580b AST import of parenthesized expressions, unary operators, binary
operators, and compound assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:07:06 +00:00
Ted Kremenek 9f9269e810 Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself.  I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 00:42:33 +00:00
Fariborz Jahanian 11062e1123 Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 00:31:17 +00:00
Benjamin Kramer bb2d176c4f Try to fix the auroraux buildbot. I suspect it has a "#define SEC" somewhere.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 13:02:13 +00:00
Douglas Gregor b2e400aae8 AST import for character literals
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:21:22 +00:00
Douglas Gregor 2b78502297 AST import for forward declarations of Objective-C protocols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:12:22 +00:00
Douglas Gregor a2bc15b746 Implement import of forward declarations of Objective-C classes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 02:04:09 +00:00
Douglas Gregor b4677b62a8 AST import of Objective-C categories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 01:47:50 +00:00
Ted Kremenek 31c780d95a Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
match 'ns_returns_retained' and 'cf_returns_retained' respectively.  These
are not yet hooked up to the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 00:05:45 +00:00
Douglas Gregor 2cd00932b9 Implement AST importing of ImplicitParamDecls, despite the sad fact
that we can't test it yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96516 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 21:22:52 +00:00
Douglas Gregor e3261624c1 Implement AST merging for Objective-C properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 18:02:10 +00:00
Douglas Gregor 2e2a400383 AST import for Objective-C protocols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 16:12:00 +00:00
Ted Kremenek efbddd2317 Add IBAction attribute to keep the IBOutlet attribute company.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 02:37:45 +00:00
Tanya Lattner 12ead498c4 Fix unused function warning to handle used attributes and redeclarations. Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 02:17:21 +00:00
Douglas Gregor c3f2d2bb83 Implement AST importing and checking for Objective-C method declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96442 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 02:12:47 +00:00
Douglas Gregor 2e55e3af2f Implement AST importing of Objective-C instance variables.
Check superclasses when merging two Objective-C @interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96420 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-17 00:34:30 +00:00
Douglas Gregor e873fb7421 Introduce a new kind of failed result for isLvalue/isModifiableLvalue
which describes temporary objects of class type in C++. Use this to
provide a more-specific, remappable diagnostic when takin the address
of such a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 21:39:57 +00:00
John McCall bf0ee35416 White-list comma expressions with the literal 0 as their RHS against
unused-value warnings.  This is a common macro idiom.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96326 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 04:10:53 +00:00
John McCall 19c8576b73 Make the various type-decl Types (and their associated ASTContext routines)
accept const decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96325 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 03:57:14 +00:00
Douglas Gregor a12d294db5 Skeleton for importing Objective-C classes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 01:20:57 +00:00
Douglas Gregor ea35d11905 Cope with anonymous tags defined within declarators by structurally
comparing their types under the assumption that they are equivalent,
rather than importing the types and then checking for compatibility. A
few minor tweaks here:
  - Teach structural matching to handle compatibility between
  function types with prototypes and those without prototypes.
  - Teach structural matching that an incomplete record decl is the
  same as any other record decl with the same name.
  - Keep track of pairs of declarations that we have already checked
  (but failed to find as structurally matching), so we don't emit
  diagnostics repeatedly.
  - When importing a typedef of an anonymous tag, be sure to link the
  imported tag type to its typedef.

With these changes, we survive a repeated import of <stdlib.h> and
<stdio.h>. Alas, the ASTNodeImporter is getting a little grotty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 23:54:17 +00:00
Douglas Gregor 73dc30b71e Reimplement the structural-equality checks used to determine whether
two types in different AST contexts are equivalent. Rather than
transforming the type from one context into the other context, we
perform a deep structural comparison of the types. This change
addresses a serious problem with recursive data types like

  struct ListNode {
    int value;
    struct ListNode *Next;
  } xList;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 22:01:00 +00:00
Fariborz Jahanian 2576061136 Class continuation now has its own property ast for
those declared in it. This is to allow duplicate
property diagnostics for properties declared in class extensions
multiple times (radar 7629420) and for future use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96276 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 21:55:26 +00:00
Zhongxing Xu 94ba380b82 Simplify code. If we can reach here, the base must be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96211 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 04:28:35 +00:00
Daniel Dunbar af667588d5 Add newline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 20:24:39 +00:00
John McCall 7fe0b9ea2c Switch the standard DeclarationName comparator to be a tri-valued comparator.
Use that while fixing a nasty misuse of qsort in vtable codegen which, somehow,
has not actually caused a crash.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 01:04:05 +00:00
Eli Friedman c4a2638b5e Fix for PR6274: teach constant folding to evaluate __builtin_expect.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96054 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-13 00:10:10 +00:00
Douglas Gregor 5ce5dab3c3 Funnel changes to the ImportedDecls list in the ASTImporter through a
single Imported function, in preparation for fixing a serious design
flaw.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 23:44:20 +00:00
Douglas Gregor 36ead2e992 Implement AST importing and merging for enumeration types and
enumerators, along with ImplicitCastExprs to make it work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 22:17:39 +00:00
Fariborz Jahanian 2d901df394 Don't error when setting a sub-structure variable via objc properties
in objective-c++ mode (do it for objective-c only).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 21:02:28 +00:00
Fariborz Jahanian 432a8893f7 Patch to fix a warning which exposed a bug in building
a qualified objective-c pointer type. Fixes radar 7638810.
(Also removes a FIXME).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 19:27:33 +00:00
Douglas Gregor d014542e1c Simplify incomplete-array merging code in the AST importer, thanks to
Daniel's suggestion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 17:23:39 +00:00
Douglas Gregor 1bf40248e3 Fix a latent bug found by Ahmed Charles, where we were calling
ASTContext::getFunctionType with the wrong set of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 17:17:28 +00:00
Douglas Gregor e72b5dc556 Handle AST merges of incomplete class types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 00:09:27 +00:00
Ted Kremenek ad7fe86486 Fix leak in CXXNewExpr where the SubExprs array would get allocated directly using 'new[]' instead of the allocator associated with ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95933 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 22:51:03 +00:00
Ted Kremenek e2f769b5c2 Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95931 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 22:44:22 +00:00
Ted Kremenek eb3b324800 Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 22:41:21 +00:00
Douglas Gregor 4800d95d28 When AST merging for record declarations fails, warn about the
incompatibility and show where the structural differences are. For
example:

struct1.c:36:8: warning: type 'struct S7' has incompatible definitions
in different translation units
struct S7 { int i : 8; unsigned j : 8; } x7;
       ^
struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here
struct S7 { int i : 8; unsigned j : 8; } x7;
                                ^
struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here
struct S7 { int i : 8; unsigned j : 16; } x7;
                                ^

There are a few changes to make this work:
  - ASTImporter now has only a single Diagnostic object, not multiple
  diagnostic objects. Otherwise, having a warning/error printed via
  one Diagnostic and its note printed on the other Diagnostic could
  cause the note to be suppressed.
  - Implemented import functionality for IntegerLiteral (along with
  general support for statements and expressions)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95900 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 19:21:55 +00:00
Anders Carlsson 848fa64143 More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 18:20:28 +00:00
Ted Kremenek 5961611172 Use the allocator associated with ASTContext to allocate the args
array associated with NonNullAttr.  This fixes yet another leak when
ASTContext uses a BumpPtrAllocator.

Fixes: <rdar://problem/7637150>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95863 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 07:31:47 +00:00
Ted Kremenek 3478eb6872 Have ~ASTContext() delete StoredDeclsMap (internal to DeclContext) by
storing the set of StoredDeclsMaps in an internal vector of void*.
This isn't an ideal solution, but for the time being this fixes a
major memory leak with these DenseMaps not being freed.

Fixes: <rdar://problem/7634755>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 07:12:28 +00:00
Ted Kremenek 3d2c43e9a7 Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext.  This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 05:28:37 +00:00
Douglas Gregor 2d5b70386d Remove another redundant ASTContext parameter
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 01:30:34 +00:00
Douglas Gregor 838db383b6 Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 01:19:42 +00:00
Fariborz Jahanian e9ff443040 Diagnose when user provided getter is being used as lvalue
using property dot-syntax. Fixes radar 7628953.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 01:11:34 +00:00
Douglas Gregor 952b017601 Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95836 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 01:04:33 +00:00
Douglas Gregor 96a01b4acf Implement basic AST merging for classes, structs, and unions in C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 00:48:18 +00:00
Charles Davis 5a0164d6ab Add support for the force_align_arg_pointer attribute. This is an x86-specific
attribute, so it uses Anton's new target-specific attribute support. It's
supposed to ensure that the stack is 16-byte aligned, but since necessary
support is lacking from LLVM, this is a no-op for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 23:06:52 +00:00