summaryrefslogtreecommitdiffstats
path: root/clang/test/ASTMerge/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* Fixed layout of test/ASTMerge.Sean Callanan2016-11-1638-990/+0
| | | | | | | | | | | | | | | | | | | | | | | | | As outlined in a previous RFC, the test/ASTMerge/Inputs folder is getting full and the tests are starting to become interdependent. This is undesirable because - it makes it harder to write new tests - it makes it harder to figure out at a glance what old tests are doing, and - it adds the risk of breaking one test while changing a different one, because of the interdependencies. To fix this, according to the conversation in the RFC, I have changed the layout from a.c Inputs/a1.c Inputs/a2.c to a/test.c a/Inputs/a1.c a/Inputs/a2.c for all existing tests. I have also eliminated interdependencies by replicating the input files for each test that uses them. https://reviews.llvm.org/D26571 llvm-svn: 287129
* Updated ASTMerge/macro.m to use _Nullable.Sean Callanan2016-11-071-1/+1
| | | | llvm-svn: 286151
* When the ASTImporter imports a source location, it avoids importing macroSean Callanan2016-11-074-0/+19
| | | | | | | | | | | | | | | | | expansions by calling getSpellingLoc(). That's great in most cases, but for macros defined in the '<built-in>' source file, the source file is invalid and does not import correctly, causing an assertion failure (the assertion is Invalid SLocOffset or bad function choice). A more reliable way to avoid this is to use getFileLoc(), which does not return built-in locations. This avoids the crash but still preserves valid source locations. I've added a testcase that covers the previously crashing scenario. https://reviews.llvm.org/D26054 llvm-svn: 286144
* ASTMerge: explicitly specify arch for GCCAsmStmt test to calm non-x86 buildbotsAleksei Sidorin2016-09-281-0/+11
| | | | | | This should fix r282572. llvm-svn: 282578
* ASTMerge: specify arch for GCCAsmStmt test explicitly to calm non-x86 buildbotsAleksei Sidorin2016-09-281-11/+0
| | | | llvm-svn: 282576
* [ASTImporter] Implement some expression-related AST node import (part 2)Aleksei Sidorin2016-09-282-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Some code cleanup * Add tests not present in http://reviews.llvm.org/D14286 * Integrate a test suite from Serge Pavlov (http://reviews.llvm.org/D14224) * ArrayTypeTraitExpr: serialize sub-expression to avoid keeping it undefined * Implement import of some nodes: - ArrayTypeTraitExpr - ExpressionTraitExpr - OpaqueValueExpr - ArraySubscriptExpr - ExplicitCastExpr - ImplicitValueInitExpr - OffsetOfExpr - CXXThisExpr - CXXThrowExpr - CXXNoexceptExpr - CXXDefaultArgExpr - CXXScalarValueInitExpr - CXXBindTemporaryExpr - CXXTemporaryObjectExpr - MaterializeTemporaryExpr - ExprWithCleanups - StaticAssertDecl - FriendDecl - DecayedType Differential Revision: https://reviews.llvm.org/D14326 llvm-svn: 282572
* When importing classes and structs with anonymous structs, it is critical thatSean Callanan2016-07-142-0/+14
| | | | | | | | | | | | | | | | | | | | | | | distinct anonymous structs remain distinct despite having similar layout. This is already ensured by distinguishing based on their placement in the parent struct, using the function `findAnonymousStructOrUnionIndex`. The problem is that this function only handles anonymous structs, like ``` class Foo { struct { int a; } } ``` and not untagged structs like ``` class Foo { struct { int a; } var; } ``` Both need to be handled, and this patch fixes that. The test case ensures that this functionality doesn't regress. Thanks to Manman Ren for review. https://reviews.llvm.org/D22270 llvm-svn: 275460
* Added support to the ASTImporter for C++ constructor initializers.Sean Callanan2016-05-161-0/+19
| | | | | | | | | Also added named casts and propagation of "implicit" to fix the LLDB testsuite. This is a fixed commit of r269546, which was reverted by r269575. Thanks to Aleksei Sidorin for review and advice. llvm-svn: 269693
* Revert r269546 "Added support to the ASTImporter for C++ constructor ↵Oleksiy Vyalov2016-05-141-17/+0
| | | | | | initializers." as it breaks TestDataFormatterSynthVal.DataFormatterSynthValueTestCase.test_with_run_command_dwarf test - http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/14699 llvm-svn: 269575
* Handle injected class names in the ASTImporter.Sean Callanan2016-05-141-0/+7
| | | | | | | | | | | | | | | | | | Every class as parsed by Clang has a forward declaration of itself as a member: class A { class A; ... } but when the parser generates this it ensures that the RecordTypes for the two are the same. This makes (among other things) inheritance work. This patch fixes a bug where the ASTImporter generated two separate RecordTypes when importing the class and the contained forward declaration, and adds a test case. Thanks to Doug Gregor for advice on this. llvm-svn: 269551
* Added support to the ASTImporter for C++ constructor initializers.Sean Callanan2016-05-141-0/+17
| | | | | | Thanks to Aleksei Sidorin for review and advice. llvm-svn: 269546
* [ASTImporter] Implement missing VisitAccessSpecDecl function in ASTImporter ↵Argyrios Kyrtzidis2016-02-182-2/+4
| | | | | | | | class. Patch by Elisavet Sakellari! llvm-svn: 261274
* Implemented ASTImporter support for Stmts and fixedSean Callanan2015-04-282-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Ignore test Inputs globally and remove redundant lit.local.cfg filesAlp Toker2013-11-151-1/+0
| | | | | | | | | | 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
* Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith2012-12-202-0/+8
| | | | | | | | 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
* Fix crash at @implementation with a forward reference as base class.Argyrios Kyrtzidis2012-03-131-1/+1
| | | | | | rdar://11020003 llvm-svn: 152596
* Fix two thinkos and add a test for importing the AST of a categoryDouglas Gregor2010-12-082-0/+28
| | | | | | implementation. llvm-svn: 121263
* Implement AST import for Objective-C property implementationsDouglas Gregor2010-12-072-0/+39
| | | | | | (@synthesize and @dynamic). llvm-svn: 121159
* Implement ASTImporter support for Objective-C category implementations.Douglas Gregor2010-12-072-0/+17
| | | | llvm-svn: 121139
* Extern the ASTImporter to import @implementation declarations.Douglas Gregor2010-12-072-0/+42
| | | | llvm-svn: 121097
* Implement AST import support for class template specializations.Douglas Gregor2010-12-012-0/+28
| | | | llvm-svn: 120523
* Implement basic AST importing and merging support for class templateDouglas Gregor2010-11-302-0/+41
| | | | | | declarations. llvm-svn: 120448
* Don't add an imported function into its lexical context until *after*Douglas Gregor2010-10-012-0/+8
| | | | | | | we've set all of its parameters. Fixes <rdar://problem/8499598>; thanks to Sean for the diagnosis. llvm-svn: 115387
* Hack in some really terrible C++ record PCH support that I need right now.John McCall2010-06-032-0/+16
| | | | | | | | This is required in order to test: The ASTImporter should set base classes after formally entering the definition. llvm-svn: 105401
* Add test for AST importing of C++ namespaces, missing from a prior commitDouglas Gregor2010-02-242-0/+34
| | | | llvm-svn: 97062
* AST import for CStyleCastExpr. With this, we can import Cocoa.h into an ↵Douglas Gregor2010-02-192-2/+4
| | | | | | empty context llvm-svn: 96648
* AST import for sizeof and alignof expressionsDouglas Gregor2010-02-192-2/+4
| | | | llvm-svn: 96647
* AST import for DeclRefExprsDouglas Gregor2010-02-192-2/+4
| | | | llvm-svn: 96646
* AST import of parenthesized expressions, unary operators, binaryDouglas Gregor2010-02-192-2/+6
| | | | | | operators, and compound assignment operators. llvm-svn: 96643
* AST import for character literalsDouglas Gregor2010-02-182-0/+10
| | | | llvm-svn: 96557
* AST import for forward declarations of Objective-C protocolsDouglas Gregor2010-02-182-0/+12
| | | | llvm-svn: 96555
* Implement import of forward declarations of Objective-C classesDouglas Gregor2010-02-182-0/+10
| | | | llvm-svn: 96554
* AST import of Objective-C categories.Douglas Gregor2010-02-182-0/+52
| | | | llvm-svn: 96551
* Implement AST merging for Objective-C properties.Douglas Gregor2010-02-172-0/+25
| | | | llvm-svn: 96483
* AST import for Objective-C protocolsDouglas Gregor2010-02-172-0/+46
| | | | llvm-svn: 96478
* Implement AST importing and checking for Objective-C method declarations.Douglas Gregor2010-02-172-0/+47
| | | | llvm-svn: 96442
* Implement AST importing of Objective-C instance variables. Douglas Gregor2010-02-172-4/+36
| | | | | | Check superclasses when merging two Objective-C @interfaces. llvm-svn: 96420
* Skeleton for importing Objective-C classesDouglas Gregor2010-02-162-0/+14
| | | | llvm-svn: 96306
* Cope with anonymous tags defined within declarators by structurallyDouglas Gregor2010-02-156-1/+29
| | | | | | | | | | | | | | | | | | | | 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
* Reimplement the structural-equality checks used to determine whetherDouglas Gregor2010-02-152-3/+13
| | | | | | | | | | | | | | 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
* Funnel changes to the ImportedDecls list in the ASTImporter through aDouglas Gregor2010-02-122-0/+13
| | | | | | | single Imported function, in preparation for fixing a serious design flaw. llvm-svn: 96044
* Implement AST importing and merging for enumeration types andDouglas Gregor2010-02-122-0/+69
| | | | | | enumerators, along with ImplicitCastExprs to make it work. llvm-svn: 96024
* Handle AST merges of incomplete class types. Douglas Gregor2010-02-122-0/+19
| | | | llvm-svn: 95941
* When AST merging for record declarations fails, warn about theDouglas Gregor2010-02-112-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing test cases for AST merging of structures.Douglas Gregor2010-02-112-0/+29
| | | | llvm-svn: 95886
* Implement basic support for merging function declarations acrossDouglas Gregor2010-02-102-0/+12
| | | | | | translation units. llvm-svn: 95794
* Implement AST importing and merging for typedefs. As part of this, provide a ↵Douglas Gregor2010-02-102-0/+8
| | | | | | lame implementation for importing TypeSourceInfos. llvm-svn: 95783
* Teach AST merging that variables with incomplete array types can beDouglas Gregor2010-02-102-0/+8
| | | | | | | | 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
* Add missing header fileDouglas Gregor2010-02-101-0/+1
| | | | llvm-svn: 95751
* Implement basic support for importing source locations from one ASTDouglas Gregor2010-02-102-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud