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

42 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth 34b8e6889a Flip the default for showing include stacks on notes to false. This
required modifying a few tests that specifically use note include stacks
to check the source manager's view of include stacks. I've simply added
the flag to these tests for now, they may have to be more substantially
changed if we decide to remove support for note include stacks
altogether.

Also, add a test for include stacks on notes that was supposed to go in
with the previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128390 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-27 20:00:08 +00:00
Douglas Gregor cad2c59b0c Fix two thinkos and add a test for importing the AST of a category
implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121263 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 16:41:55 +00:00
Douglas Gregor 954e0c75c4 Implement AST import for Objective-C property implementations
(@synthesize and @dynamic).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121159 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 18:32:03 +00:00
Douglas Gregor 3daef29bf3 Implement ASTImporter support for Objective-C category implementations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121139 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 15:32:12 +00:00
Douglas Gregor dd182ff10b Extern the ASTImporter to import @implementation declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:26:03 +00:00
Douglas Gregor d5dc83a85c Implement AST import support for class template specializations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120523 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 01:36:18 +00:00
Douglas Gregor 040afaeea2 Implement basic AST importing and merging support for class template
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120448 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 19:14:50 +00:00
Argyrios Kyrtzidis 4045107b73 Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15 18:21:24 +00:00
Eric Christopher db45871a17 Try to disable this again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116094 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 19:36:36 +00:00
Eric Christopher ceb406d9f9 Disable this test temporarily in an attempt to green the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 19:18:57 +00:00
Douglas Gregor 81134ad7a0 Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 23:55:07 +00:00
John McCall 5250f27420 Hack in some really terrible C++ record PCH support that I need right now.
This is required in order to test:

The ASTImporter should set base classes after formally entering the definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-03 19:28:45 +00:00
Chris Lattner 53eee7ba97 Instead of counting totally diagnostics, split the count into a count
of errors and warnings.  This allows us to emit something like this:

2 warnings and 1 error generated.

instead of:

3 diagnostics generated.

This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:47:42 +00:00
Douglas Gregor 5821249f8f Add test for AST importing of C++ namespaces, missing from a prior commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 21:53:36 +00:00
Douglas Gregor 008847a70a AST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96648 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 01:32:14 +00:00
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
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
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
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 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
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
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
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
Douglas Gregor b203c9ee39 Add missing test cases for AST merging of structures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95886 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-11 18:18:11 +00:00
Douglas Gregor a404ea673c Implement basic support for merging function declarations across
translation units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 19:54:31 +00:00
Douglas Gregor 82fc4bfa6f Implement AST importing and merging for typedefs. As part of this, provide a lame implementation for importing TypeSourceInfos.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 17:47:19 +00:00
Douglas Gregor 0f962a8e61 Teach AST merging that variables with incomplete array types can be
merged with variables of constant array types. Also, make sure that we
call DiagnosticClient's BeginSourceFile/EndSourceFile, so that it has
a LangOptions to work with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 17:16:49 +00:00
Douglas Gregor ed6ae499e2 Add missing header file
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 01:35:04 +00:00
Douglas Gregor 885237354f Implement basic support for importing source locations from one AST
into another AST, including their include history. Here's an example
error that involves a conflict merging a variable with different types
in two translation units (diagnosed in the third AST context into
which everything is merged).

/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var2.c:3:5:
error: external variable 'x2' declared with incompatible types in
different translation units ('int' vs. 'double')
int x2;
    ^
In file included from
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.c:3:
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.h:1:8:
note: declared here with type 'double'
double x2;
       ^

Although we maintain include history, we do not maintain macro
instantiation history across a merge. Instead, we map down to the
spelling location (for now!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 00:15:17 +00:00
Douglas Gregor e07c5b06c4 Add in the LIT magic to avoid running AST merge test inputs as
separate tests. Thanks, Daniel!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 22:40:03 +00:00
Douglas Gregor d343ff623e Hook up the diagnostics-argument printer when merging AST files, so
that we get readable diagnostics such as:

error: external variable 'x1' declared with incompatible types in
different translation units ('double *' vs. 'float **')

However, there is no translation of source locations, yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 22:37:58 +00:00
Douglas Gregor 9bed879896 Introduce a testbed for merging multiple ASTs into a single AST
context with the AST importer. WIP, still useless but at least it has
a test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 19:21:46 +00:00