summaryrefslogtreecommitdiff
path: root/test/Import
Commit message (Collapse)AuthorAgeFilesLines
* [ASTImporter] Fix importing OperatorDelete from CXXConstructorDeclRaphael Isemann2019-01-222-0/+13
| | | | | | | | | | | | | | | | | Summary: Shafik found out that importing a CXXConstructorDecl will create a translation unit that causes Clang's CodeGen to crash. The reason for that is that we don't copy the OperatorDelete from the CXXConstructorDecl when importing. This patch fixes it and adds a test case for that. Reviewers: shafik, martong, a_sidorin, a.sidorin Reviewed By: martong, a_sidorin Subscribers: rnkovacs, cfe-commits Differential Revision: https://reviews.llvm.org/D56651 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351849 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for importing anonymous namespaces.Raphael Isemann2019-01-212-0/+70
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51178 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351739 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Store "UsesADL" information in CallExpr.Eric Fiselier2018-12-122-0/+18
| | | | | | | | | | | | | | | | | | | | | Summary: Currently the Clang AST doesn't store information about how the callee of a CallExpr was found. Specifically if it was found using ADL. However, this information is invaluable to tooling. Consider a tool which renames usages of a function. If the originally CallExpr was formed using ADL, then the tooling may need to additionally qualify the replacement. Without information about how the callee was found, the tooling is left scratching it's head. Additionally, we want to be able to match ADL calls as quickly as possible, which means avoiding computing the answer on the fly. This patch changes `CallExpr` to store whether it's callee was found using ADL. It does not change the size of any AST nodes. Reviewers: fowles, rsmith, klimek, shafik Reviewed By: rsmith Subscribers: aaron.ballman, riccibruno, calabrese, titus, cfe-commits Differential Revision: https://reviews.llvm.org/D55534 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348977 91177308-0d34-0410-b5e6-96231b3b80d8
* Compound literals, enums, et al require const exprBill Wendling2018-11-091-0/+10
| | | | | | | | | | | | | | | | | | Summary: Compound literals, enums, file-scoped arrays, etc. require their initializers and size specifiers to be constant. Wrap the initializer expressions in a ConstantExpr so that we can easily check for this later on. Reviewers: rsmith, shafik Reviewed By: rsmith Subscribers: cfe-commits, jyknight, nickdesaulniers Differential Revision: https://reviews.llvm.org/D53921 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346455 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Only store the needed data in WhileStmtBruno Ricci2018-10-301-2/+0
| | | | | | | | | | | | | | Don't store the data for the condition variable if not needed. This cuts the size of WhileStmt by up to a pointer. The order of the children is kept the same. Differential Revision: https://reviews.llvm.org/D53715 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345597 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Only store the needed data in SwitchStmtBruno Ricci2018-10-291-7/+0
| | | | | | | | | | | | | | | | | | Don't store the data for the init statement and condition variable if not needed. This cuts the size of SwitchStmt by up to 2 pointers. The order of the children is intentionally kept the same. Also use the newly available space in the bit-fields of Stmt to store the bit representing whether all enums have been covered instead of using a PointerIntPair. Differential Revision: https://reviews.llvm.org/D53714 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345510 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Check that GNU range case statements are correctly imported.Bruno Ricci2018-10-292-0/+16
| | | | | | | | | | | | The test for case statements did not cover GNU range case statements. Differential Revision: https://reviews.llvm.org/D53610 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345506 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Don't store data for GNU range case statement if not neededBruno Ricci2018-10-281-4/+0
| | | | | | | | | | | | | | | | | | Don't store the data for case statements of the form LHS ... RHS if not needed. This cuts the size of CaseStmt by 1 pointer + 1 SourceLocation in the common case. Also use the newly available space in the bit-fields of Stmt to store the keyword location of SwitchCase and move the small accessor SwitchCase::getSubStmt to the header. Differential Revision: https://reviews.llvm.org/D53609 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345472 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Only store the needed data in IfStmtBruno Ricci2018-10-271-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Only store the needed data in IfStmt. This cuts the size of IfStmt by up to 3 pointers + 1 SourceLocation. The order of the children is intentionally kept the same even though it would be more convenient to put the optional trailing objects last. Additionally use the newly available space in the bit-fields of Stmt to store the location of the "if". The result of this is that for the common case of an if statement of the form: if (some_cond) some_statement the size of IfStmt is brought down to 8 bytes + 2 pointers, instead of 8 bytes + 5 pointers + 2 SourceLocation. Differential Revision: https://reviews.llvm.org/D53607 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345464 91177308-0d34-0410-b5e6-96231b3b80d8
* [cxx2a] P0614R1: Support init-statements in range-based for loops.Richard Smith2018-09-282-2/+6
| | | | | | | We don't yet support this for the case where a range-based for loop is implicitly rewritten to an ObjC for..in statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343350 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for PackExpansionExprRaphael Isemann2018-08-242-0/+23
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51142 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340627 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-land [ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmtRaphael Isemann2018-08-232-0/+71
| | | | | | | Lands r340468 again, but this time we mark the test as unsupported on Windows because it seems that try/catch crashes CodeGen at the moment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340541 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[ASTImporter] Add test for ↵Raphael Isemann2018-08-222-68/+0
| | | | | | | | ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt" This test breaks llvm-clang-x86_64-expensive-checks-win. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340483 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmtRaphael Isemann2018-08-222-0/+68
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51121 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340468 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.Raphael Isemann2018-08-222-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The `array-init-loop-expr` test is currently not testing the importing of ArrayInitLoopExprs. This is because we import the `S` struct into the `test.cpp` context and only do a copy-assignment in `test.cpp`, so the actual ArrayInitLoopExpr we wanted to import is generated by clang directly in the target context. This means we actually never test the importing of ArrayInitLoopExpr with this test, which becomes obvious when looking at the missing test coverage for the respective VisitArrayInitLoopExpr method. This patch moves the copy-assignment of our struct to the `S.cpp` context, which means that `test.cpp` now actually has to import the ArrayInitLoopExpr. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51115 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340467 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for ObjCTypeParamDeclRaphael Isemann2018-08-222-0/+16
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51059 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340465 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for SwitchStmtRaphael Isemann2018-08-222-0/+65
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51056 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340464 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for ObjCAutoreleasePoolStmtRaphael Isemann2018-08-222-0/+14
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340463 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for CXXNoexceptExprRaphael Isemann2018-08-212-0/+9
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, hiraditya, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50737 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340304 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for CXXForRangeStmtRaphael Isemann2018-08-212-0/+64
| | | | | | | | | | | | Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51001 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340297 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for C++'s try/catch statements.Raphael Isemann2018-08-202-0/+57
| | | | | | | | | | | | | | Summary: Also enable exceptions in clang-import-test so that we can parse the test files. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340220 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for C++ casts and fix broken const_cast importing.Raphael Isemann2018-08-202-0/+33
| | | | | | | | | | | | | | | | Summary: The ASTImporter does currently not handle const_casts. This patch adds the missing const_cast importer code and the test case that discovered this. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50932 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340182 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Test for importing condition variable from a ForStmtRaphael Isemann2018-08-202-0/+14
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: cfe-commits, martong Differential Revision: https://reviews.llvm.org/D50928 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340180 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for member pointer types.Raphael Isemann2018-08-162-0/+23
| | | | | | | | | | | | Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50792 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339919 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for importing CompoundAssignOperatorsRaphael Isemann2018-08-162-0/+63
| | | | | | | | | | | | Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, cfe-commits, martong Differential Revision: https://reviews.llvm.org/D50793 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339918 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for DoStmtRaphael Isemann2018-08-162-0/+22
| | | | | | | | | | | | Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50810 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339917 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for WhileStmtRaphael Isemann2018-08-162-0/+31
| | | | | | | | | | | | Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50811 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339916 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for IndirectGotoStmtRaphael Isemann2018-08-162-0/+16
| | | | | | | | | | | | Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50813 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339915 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for CXXDefaultInitExprRaphael Isemann2018-08-162-0/+31
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50732 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339839 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for CXXScalarValueInitRaphael Isemann2018-08-162-0/+13
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50735 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339838 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for ForStmt and ContinueStmtRaphael Isemann2018-08-162-0/+47
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50812 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339837 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for ArrayInitLoopExprRaphael Isemann2018-08-152-0/+14
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50733 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339831 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for ExprWithCleanupsRaphael Isemann2018-08-152-0/+16
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50731 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339830 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add test for IfStmtRaphael Isemann2018-08-152-0/+68
| | | | | | | | | | | | Reviewers: a.sidorin, hiraditya Reviewed By: hiraditya Subscribers: hiraditya, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50796 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339827 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Added test case for opaque enumsRaphael Isemann2018-08-112-1/+7
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50550 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339506 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Added test case for CXXConversionDecl importingRaphael Isemann2018-08-112-0/+15
| | | | | | | | | | | | Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D50552 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339505 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Add support for import of CXXInheritedCtorInitExpr.Balazs Keri2018-07-252-0/+17
| | | | | | | | | | | | Reviewers: a.sidorin, martong Reviewed By: martong Subscribers: rnkovacs, a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D49293 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337898 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] fix test failure corrected by fixed func end locsRafael Stahl2018-07-091-1/+1
| | | | | | | | fix to rC336523 / D48941 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336527 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Properly import SourceLocations of AttrsAleksei Sidorin2018-05-082-0/+39
| | | | | | | | | | Patch by Rafael Stahl! Differential Revision: https://reviews.llvm.org/D46115 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331762 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Support LambdaExprs and improve template supportAleksei Sidorin2018-01-262-1/+8
| | | | | | | | | | | | | | | | Also, a number of style and bug fixes was done: * ASTImporterTest: added sanity check for source node * ExternalASTMerger: better lookup for template specializations * ASTImporter: don't add templated declarations into DeclContext * ASTImporter: introduce a helper, ImportTemplateArgumentListInfo getting SourceLocations * ASTImporter: proper set ParmVarDecls for imported FunctionProtoTypeLoc Differential Revision: https://reviews.llvm.org/D42301 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323519 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for remembering origins to ExternalASTMergerSean Callanan2017-09-2718-3/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ExternalASTMerger has hitherto relied on being able to look up any Decl through its named DeclContext chain. This works for many cases, but causes problems for function-local structs, which cannot be looked up in their containing FunctionDecl. An example case is void f() { { struct S { int a; }; } { struct S { bool b; }; } } It is not possible to lookup either of the two Ses individually (or even to provide enough information to disambiguate) after parsing is over; and there is typically no need to, since they are invisible to the outside world. However, ExternalASTMerger needs to be able to complete either S on demand. This led to an XFAIL on test/Import/local-struct, which this patch removes. The way the patch works is: It defines a new data structure, ExternalASTMerger::OriginMap, which clients are expected to maintain (default-constructing if the origin does not have an ExternalASTMerger servicing it) As DeclContexts are imported, if they cannot be looked up by name they are placed in the OriginMap. This allows ExternalASTMerger to complete them later if necessary. As DeclContexts are imported from an origin that already has its own OriginMap, the origins are forwarded – but only for those DeclContexts that are actually used. This keeps the amount of stored data minimal. The patch also applies several improvements from review: - Thoroughly documents the interface to ExternalASTMerger; - Adds optional logging to help track what's going on; and - Cleans up a bunch of braces and dangling elses. Differential Revision: https://reviews.llvm.org/D38208 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314336 91177308-0d34-0410-b5e6-96231b3b80d8
* This adds the argument --dump-ir to clang-import-test, which allows Sean Callanan2017-08-074-0/+35
| | | | | | | | | | | | | | | | | | | | | | viewing of the final IR. This is useful for confirming that structure layout was correct. I've added two tests: - A test that checks that structs in top-level code are completed correctly during struct layout (they are) - A test that checks that structs defined in function bodies are cpmpleted correctly during struct layout (currently they are not, so this is XFAIL). The second test fails because LookupSameContext() (ExternalASTMerger.cpp) can't find the struct. This is an issue I intend to resolve separately. Differential Revision: https://reviews.llvm.org/D36429 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310318 91177308-0d34-0410-b5e6-96231b3b80d8
* [ExternalASTMerger] Import Objective-C classesSean Callanan2017-07-252-0/+9
| | | | | | | | | | | | | | This patch adds functionality and a test for importing Objective-C classes and their methods. It also adds a flag to clang-import-test to set the language used for parsing. This takes the same argument format as the -x option to the driver. Differential Revision: https://reviews.llvm.org/D35274 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309014 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-import-test] Test that enumerators and their values are found.Sean Callanan2017-07-112-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307603 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-import-test had some dead code. I did the following to eliminate it:Sean Callanan2017-07-102-0/+8
| | | | | | | | | | | | | | | - eliminated error handling for the indirect CompilerInstance, which should never generate an error as it is created; - added a new test for direct importation; and - removed an unused implementation of the CompleteType() API. This brings clang-import-test.cpp and ExternalASTMerge.cpp back to 100% coverage on all metrics measured by DLLVM_BUILD_INSTRUMENTED_COVERAGE. Differential Revision: https://reviews.llvm.org/D35220 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307600 91177308-0d34-0410-b5e6-96231b3b80d8
* Add testcase for r305850.Lang Hames2017-07-072-0/+16
| | | | | | | Accidentally left this out of the original commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307444 91177308-0d34-0410-b5e6-96231b3b80d8
* Call setMustBuildLookupTable on TagDecls in ExternalASTMergerLang Hames2017-06-172-0/+7
| | | | | | | | | | | | | | | | | | | | Summary: setMustBuildLookupTable should be called on imported TagDecls otherwise we may fail to import their member decls (if they have any). Not calling the setMustBuildLookupTable method results in a failure in the attached test case when lookup for the 'x' member fails on struct S, which hasn't had its decls imported elsewhere. (By contrast the member-in-struct testcase hasn't run into this issue because the import of its decls is triggered when the struct instance is defined, and the member access follows this). Reviewers: spyffe, rsmith Reviewed By: spyffe, rsmith Differential Revision: https://reviews.llvm.org/D34253 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305619 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Improve handling of incomplete typesSean Callanan2017-05-133-0/+20
| | | | | | | | | | | | | | | | | | | | | | ASTImporter has some bugs when it's importing types that themselves come from an ExternalASTSource. This is exposed particularly in the behavior when comparing complete TagDecls with forward declarations. This patch does several things: - Adds a test case making sure that conflicting forward-declarations are resolved correctly; - Extends the clang-import-test harness to test two-level importing, so that we make sure we complete types when necessary; and - Fixes a few bugs I found this way. Failure to complete types was one; however, I also discovered that complete RecordDecls aren't properly added to the redecls chain for existing forward declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302975 91177308-0d34-0410-b5e6-96231b3b80d8
* Added an Importer test for in-class member initializers.Sean Callanan2017-04-272-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301573 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-import-test] Lookup inside contextsSean Callanan2017-04-1117-0/+84
| | | | | | | | | | | | | | | | | | | | clang-import-test has until now been only able to report top-level Decls. This is clearly insufficient; we should be able to look inside structs and namespaces also. This patch adds new test cases for a variety of lookups inside existing ASTContexts, and adds the functionality necessar to make most of these testcases work. (One testcase is known to fail because of ASTImporter limitations when importing templates; I'll look into that separately.) This patch also separates the core functionality out into ExternalASTMerger, an interface that allows clients like LLDB to make use of it. clang-import-test now only has the machinery necessary to set up the tests. Differential revision: https://reviews.llvm.org/D30435 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299976 91177308-0d34-0410-b5e6-96231b3b80d8