summaryrefslogtreecommitdiffstats
path: root/clang/test/Import
Commit message (Collapse)AuthorAgeFilesLines
* Tighten up CHECK lines added in a9f10ebffa to work on ARM.Douglas Yung2019-12-051-1/+1
| | | | On ARM platforms, the compiler generates an additional line containing `-CXXRecordDecl which is not the intended line, but preceeds the intended match causing the test to fail.
* [ASTImporter] Various source location and range import fixes.Balázs Kéri2019-12-056-3/+25
| | | | | | | | | | | | | | | | | | | | Summary: ASTImporter contained wrong or missing imports of SourceLocation and SourceRange for some objects. At least a part of such errors is fixed now. Source location import fixes in namespace, enum, record, class template specialization declarations and DeclRefExpr, UnresolvedLookupExpr, UnresolvedMemberExpr, NestedNameSpecifierLoc. Reviewers: martong, a.sidorin, shafik Reviewed By: shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60499
* [ASTImporter] Add support for BuiltinTemplateDeclRaphael Isemann2019-10-302-0/+46
| | | | | | | | | | | | | | | | | Summary: That decl kind is currently not implemented. BuiltinTemplateDecl is for decls that are hardcoded in the ASTContext, so we can import them like we do other builtin decls by just taking the equivalent decl from the target ASTContext. Reviewers: martong, a.sidorin, shafik Reviewed By: martong, shafik Subscribers: rnkovacs, kristina, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69566
* [clang] Ignore builtin namespaces in test/Import/cxx-anon-namespaceRaphael Isemann2019-10-011-1/+5
| | | | | | | | | Some platforms (e.g. AArch64) put __va_list in the 'std' namespace which might end up being the first namespace we match in this test. Instead let the first namespace match via file name/line so that we skip the builtin namespaces. llvm-svn: 373327
* [ASTImporter] Copy Argument Passing Restrictions setting when importing a ↵Shafik Yaghmour2019-04-262-0/+23
| | | | | | | | | | | | | | | CXXRecordDecl definition Summary: For a CXXRecordDecl the RecordDeclBits are stored in the DeclContext. Currently when we import the definition of a CXXRecordDecl via the ASTImporter we do not copy over this data. This change will add support for copying the ArgPassingRestrictions from RecordDeclBits to fix an LLDB expression parsing bug where we would set it to not pass in registers. Note, we did not copy over any other of the RecordDeclBits since we don't have tests for those. We know that copying over LoadedFieldsFromExternalStorage would be a error and that may be the case for others as well. The companion LLDB review: https://reviews.llvm.org/D61146 Differential Review: https://reviews.llvm.org/D61140 llvm-svn: 359338
* [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 llvm-svn: 351849
* [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 llvm-svn: 351739
* [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 llvm-svn: 348977
* 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 llvm-svn: 346455
* [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 llvm-svn: 345597
* [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 llvm-svn: 345510
* [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 llvm-svn: 345506
* [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 llvm-svn: 345472
* [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 llvm-svn: 345464
* [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. llvm-svn: 343350
* [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 llvm-svn: 340627
* 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. llvm-svn: 340541
* Revert "[ASTImporter] Add test for ↵Raphael Isemann2018-08-222-68/+0
| | | | | | | | ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt" This test breaks llvm-clang-x86_64-expensive-checks-win. llvm-svn: 340483
* [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 llvm-svn: 340468
* [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 llvm-svn: 340467
* [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 llvm-svn: 340465
* [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 llvm-svn: 340464
* [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 llvm-svn: 340463
* [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 llvm-svn: 340304
* [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 llvm-svn: 340297
* [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 llvm-svn: 340220
* [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 llvm-svn: 340182
* [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 llvm-svn: 340180
* [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 llvm-svn: 339919
* [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 llvm-svn: 339918
* [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 llvm-svn: 339917
* [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 llvm-svn: 339916
* [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 llvm-svn: 339915
* [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 llvm-svn: 339839
* [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 llvm-svn: 339838
* [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 llvm-svn: 339837
* [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 llvm-svn: 339831
* [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 llvm-svn: 339830
* [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 llvm-svn: 339827
* [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 llvm-svn: 339506
* [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 llvm-svn: 339505
* [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 llvm-svn: 337898
* [ASTImporter] fix test failure corrected by fixed func end locsRafael Stahl2018-07-091-1/+1
| | | | | | fix to rC336523 / D48941 llvm-svn: 336527
* [ASTImporter] Properly import SourceLocations of AttrsAleksei Sidorin2018-05-082-0/+39
| | | | | | | | Patch by Rafael Stahl! Differential Revision: https://reviews.llvm.org/D46115 llvm-svn: 331762
* [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 llvm-svn: 323519
* 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 llvm-svn: 314336
* 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 llvm-svn: 310318
* [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 llvm-svn: 309014
* [clang-import-test] Test that enumerators and their values are found.Sean Callanan2017-07-112-0/+8
| | | | llvm-svn: 307603
* 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 llvm-svn: 307600
OpenPOWER on IntegriCloud