Commit Graph

53 Commits

Author SHA1 Message Date
Rick Foos 2688a49981 XFAIL Hexagon until more codegen in place.
Summary:
Hexagon is being updated, but there is not enough to pass these tests.
These sections are now on top of Colin's list.

Test Plan: Ran changes on hexagon-build-03.

Reviewers: colinl, rfoos

Reviewed By: rfoos

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D9356

llvm-svn: 236173
2015-04-29 22:54:40 +00:00
Sean Callanan 59721b3d3f Implemented ASTImporter support for Stmts and fixed
some bugs in the ASTImporter that this exposed:

- When importing functions, the body (if any) was
  previously ignored.  This patch ensures that the
  body is imported also.

- When a function-local Decl is imported, the first
  thing the ASTImporter does is import its context
  (via ImportDeclParts()).  This can trigger 
  importing the Decl again as part of the body of
  the function (but only once, since the function's
  Decl has been added to ImportedDecls).  This patch
  fixes that problem by extending ImportDeclParts()
  to return the imported Decl if it was imported as
  part of importing its context, and the patch adds
  ASTImporter::GetAlreadyImportedOrNull() to support
  this query.  All callers of ImportDeclParts return
  the imported version of the Decl if ImportDeclParts()
  returns it.

- When creating functions, InnerLocStart of the source
  function was re-used without importing.  This is a
  straight up bug, and this patch makes ASTImporter
  import the InnerLocStart and use the imported version.

- When importing FileIDs, the ASTImporter previously
  always tried to re-load the file for the corresponding
  CacheEntry from disk.  This doesn't work if the 
  CacheEntry corresponds to a named memory buffer.  This
  patch changes the code so that if the UniqueID for the
  cache entry is invalid (i.e., it is not a disk file)
  the whole entry is treated as if it were invalid, which
  forces an in-memory copy of the buffer.

Also added test cases, using the new support committed in
236011.

llvm-svn: 236012
2015-04-28 18:41:46 +00:00
Alp Toker 9c5ae47c94 Ignore test Inputs globally and remove redundant lit.local.cfg files
By adding a default config.excludes pattern we can avoid individual
suppressions in subdirectories.

This matches LLVM's lit.cfg which also excludes a few other common non-test
filenames for consistency.

llvm-svn: 194814
2013-11-15 13:37:49 +00:00
Argyrios Kyrtzidis 8ade08edba Changes so that a few tests do not fail when running under guarded malloc.
Guarded malloc emits some messages at the beginning in stderr when enabled.
These messages caused a few tests to fail.

llvm-svn: 186219
2013-07-12 22:30:03 +00:00
Rafael Espindola 925213b0fa Add 'not' to commands that are expected to fail.
This is at least good documentation, but also opens the possibility of
using pipefail.

llvm-svn: 185652
2013-07-04 16:16:58 +00:00
Andy Gibbs fcc699aee8 Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.
VerifyDiagnosticConsumer previously would not check that the diagnostic and
its matching directive referenced the same source file.  Common practice was
to create directives that referenced other files but only by line number,
and this led to problems such as when the file containing the directive
didn't have enough lines to match the location of the diagnostic in the
other file, leading to bizarre file formatting and other oddities.

This patch causes VerifyDiagnosticConsumer to match source files as well as
line numbers.  Therefore, a new syntax is made available for directives, for
example:

// expected-error@file:line {{diagnostic message}}

This extends the @line feature where "file" is the file where the diagnostic
is generated.  The @line syntax is still available and uses the current file
for the diagnostic.  "file" can be specified either as a relative or absolute
path - although the latter has less usefulness, I think!  The #include search
paths will be used to locate the file and if it is not found an error will be
generated.

The new check is not optional: if the directive is in a different file to the
diagnostic, the file must be specified.  Therefore, a number of test-cases
have been updated with regard to this.

This closes out PR15613.

llvm-svn: 179677
2013-04-17 08:06:46 +00:00
Richard Smith 5bb4cdfaa9 Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then
produce a note for that diagnostic either with a different DiagnosticEngine or
after calling DiagnosticEngine::Reset(). That didn't make any sense, and did the
wrong thing if the original diagnostic was suppressed.

llvm-svn: 170636
2012-12-20 02:22:15 +00:00
Andy Gibbs c6e68daac0 Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.
llvm-svn: 166280
2012-10-19 12:44:48 +00:00
Jordan Rose b00073db80 Update VerifyDiagnosticConsumer to only get directives during parsing.
The old behavior was to re-scan any files (like modules) where we may have
directives but won't actually be parsing during the -verify invocation.
Now, we keep the old behavior in Debug builds as a sanity check (though
modules are a known entity), and expect all legitimate directives to come
from comments seen by the preprocessor.

This also affects the ARC migration tool, which captures diagnostics in
order to filter some out. This change adds an explicit cleanup to
CaptureDiagnosticsConsumer in order to let its sub-consumer handle the
real end of diagnostics.

This was originally split into four patches, but the tests do not run
cleanly without all four, so I've combined them into one commit.

Patches by Andy Gibbs, with slight modifications from me.

llvm-svn: 161650
2012-08-10 01:06:16 +00:00
Argyrios Kyrtzidis 3b60cffa22 Fix crash at @implementation with a forward reference as base class.
rdar://11020003

llvm-svn: 152596
2012-03-13 01:09:36 +00:00
Argyrios Kyrtzidis 52f53fb303 Improve location fidelity of objc decls.
-Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl.
-Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the
 class name, not the location of '@'.

llvm-svn: 141061
2011-10-04 04:48:02 +00:00
Chandler Carruth 24284afa2d 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.

llvm-svn: 128390
2011-03-27 20:00:08 +00:00
Douglas Gregor 35fd7bc7e0 Fix two thinkos and add a test for importing the AST of a category
implementation.

llvm-svn: 121263
2010-12-08 16:41:55 +00:00
Douglas Gregor 14a49e2fbe Implement AST import for Objective-C property implementations
(@synthesize and @dynamic).

llvm-svn: 121159
2010-12-07 18:32:03 +00:00
Douglas Gregor 4da9d68da0 Implement ASTImporter support for Objective-C category implementations.
llvm-svn: 121139
2010-12-07 15:32:12 +00:00
Douglas Gregor da8025c09e Extern the ASTImporter to import @implementation declarations.
llvm-svn: 121097
2010-12-07 01:26:03 +00:00
Douglas Gregor e2e50d331c Implement AST import support for class template specializations.
llvm-svn: 120523
2010-12-01 01:36:18 +00:00
Douglas Gregor a082a49d9e Implement basic AST importing and merging support for class template
declarations.

llvm-svn: 120448
2010-11-30 19:14:50 +00:00
Argyrios Kyrtzidis 434383d703 Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).
llvm-svn: 116598
2010-10-15 18:21:24 +00:00
Eric Christopher 366c146e79 Try to disable this again.
llvm-svn: 116094
2010-10-08 19:36:36 +00:00
Eric Christopher 2f38b940e3 Disable this test temporarily in an attempt to green the buildbots.
llvm-svn: 116082
2010-10-08 19:18:57 +00:00
Douglas Gregor 0eaa2bfe79 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.

llvm-svn: 115387
2010-10-01 23:55:07 +00:00
John McCall 1c70e99a2c 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.

llvm-svn: 105401
2010-06-03 19:28:45 +00:00
Chris Lattner 198cb4df6e 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.

llvm-svn: 100675
2010-04-07 18:47:42 +00:00
Douglas Gregor f06027db65 Add test for AST importing of C++ namespaces, missing from a prior commit
llvm-svn: 97062
2010-02-24 21:53:36 +00:00
Douglas Gregor 5481d329a3 AST import for CStyleCastExpr. With this, we can import Cocoa.h into an empty context
llvm-svn: 96648
2010-02-19 01:32:14 +00:00
Douglas Gregor d8552cdc96 AST import for sizeof and alignof expressions
llvm-svn: 96647
2010-02-19 01:24:23 +00:00
Douglas Gregor 52f820ead4 AST import for DeclRefExprs
llvm-svn: 96646
2010-02-19 01:17:02 +00:00
Douglas Gregor c74247eddd AST import of parenthesized expressions, unary operators, binary
operators, and compound assignment operators.

llvm-svn: 96643
2010-02-19 01:07:06 +00:00
Douglas Gregor 623421d385 AST import for character literals
llvm-svn: 96557
2010-02-18 02:21:22 +00:00
Douglas Gregor 8661a72b48 AST import for forward declarations of Objective-C protocols
llvm-svn: 96555
2010-02-18 02:12:22 +00:00
Douglas Gregor 06537af873 Implement import of forward declarations of Objective-C classes
llvm-svn: 96554
2010-02-18 02:04:09 +00:00
Douglas Gregor 84c51c3581 AST import of Objective-C categories.
llvm-svn: 96551
2010-02-18 01:47:50 +00:00
Douglas Gregor a11c45866e Implement AST merging for Objective-C properties.
llvm-svn: 96483
2010-02-17 18:02:10 +00:00
Douglas Gregor 98d156a87e AST import for Objective-C protocols
llvm-svn: 96478
2010-02-17 16:12:00 +00:00
Douglas Gregor 43f54796ab Implement AST importing and checking for Objective-C method declarations.
llvm-svn: 96442
2010-02-17 02:12:47 +00:00
Douglas Gregor 7244b0bb86 Implement AST importing of Objective-C instance variables.
Check superclasses when merging two Objective-C @interfaces.

llvm-svn: 96420
2010-02-17 00:34:30 +00:00
Douglas Gregor 4563532043 Skeleton for importing Objective-C classes
llvm-svn: 96306
2010-02-16 01:20:57 +00:00
Douglas Gregor b4964f7705 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.

llvm-svn: 96298
2010-02-15 23:54:17 +00:00
Douglas Gregor 3996e249ed 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;

llvm-svn: 96278
2010-02-15 22:01:00 +00:00
Douglas Gregor 8cdbe64de4 Funnel changes to the ImportedDecls list in the ASTImporter through a
single Imported function, in preparation for fixing a serious design
flaw.

llvm-svn: 96044
2010-02-12 23:44:20 +00:00
Douglas Gregor 98c1018337 Implement AST importing and merging for enumeration types and
enumerators, along with ImplicitCastExprs to make it work.

llvm-svn: 96024
2010-02-12 22:17:39 +00:00
Douglas Gregor 2579105c4e Handle AST merges of incomplete class types.
llvm-svn: 95941
2010-02-12 00:09:27 +00:00
Douglas Gregor 7eeb59752a 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)

llvm-svn: 95900
2010-02-11 19:21:55 +00:00
Douglas Gregor 69837bed2f Add missing test cases for AST merging of structures.
llvm-svn: 95886
2010-02-11 18:18:11 +00:00
Douglas Gregor bb7930c17e Implement basic support for merging function declarations across
translation units.

llvm-svn: 95794
2010-02-10 19:54:31 +00:00
Douglas Gregor fa7a0e5198 Implement AST importing and merging for typedefs. As part of this, provide a lame implementation for importing TypeSourceInfos.
llvm-svn: 95783
2010-02-10 17:47:19 +00:00
Douglas Gregor 2fbe558cfe 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.

llvm-svn: 95782
2010-02-10 17:16:49 +00:00
Douglas Gregor 0f058c83a7 Add missing header file
llvm-svn: 95751
2010-02-10 01:35:04 +00:00
Douglas Gregor 811663eb11 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!).

llvm-svn: 95732
2010-02-10 00:15:17 +00:00