summaryrefslogtreecommitdiffstats
path: root/clang/test/ASTMerge
Commit message (Collapse)AuthorAgeFilesLines
* [ASTImporter] Added import of CXXStdInitializerListExprGabor Marton2018-06-292-0/+12
| | | | | | | | | | | | | | Reviewers: a.sidorin Reviewed By: a.sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D48631 Patch by Balazs Keri! llvm-svn: 335968
* Re-apply: [ASTImporter] Import the whole redecl chain of functionsGabor Marton2018-06-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch when any `FunctionDecl` of a redeclaration chain is imported then we bring in the whole declaration chain. This involves functions and function template specializations. Also friend functions are affected. The chain is imported as it is in the "from" tu, the order of the redeclarations are kept. I also changed the lookup logic in order to find friends, but first making them visible in their declaration context. We may have long redeclaration chains if all TU contains the same prototype, but our measurements shows no degradation in time of CTU analysis (Tmux, Xerces, Bitcoin, Protobuf). Also, as further work we could squash redundant prototypes, but first ensure that functionality is working properly; then should we optimize. This may seem like a huge patch, sorry about that. But, most of the changes are new tests, changes in the production code is not that much. I also tried to create a smaller patch which does not affect specializations, but that patch failed to pass some of the `clang-import-test`s because there we import function specializations. Also very importantly, we can't just change the import of `FunctionDecl`s without changing the import of function template specializations because they are handled as `FunctionDecl`s. Reviewers: a.sidorin, r.stahl, xazax.hun, balazske, a_sidorin Reviewed By: a_sidorin Subscribers: labath, aprantl, a_sidorin, rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47532 Re-apply commit rC335480 llvm-svn: 335731
* [ASTImporter] Use InjectedClassNameType at import of templated record.Gabor Marton2018-06-263-0/+7
| | | | | | | | | | | | | | | | | | Summary: At import of a record describing a template set its type to InjectedClassNameType (instead of RecordType). Reviewers: a.sidorin, martong, r.stahl Reviewed By: a.sidorin, martong, r.stahl Subscribers: a_sidorin, rnkovacs, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D47450 Patch by Balazs Keri! llvm-svn: 335600
* Revert "[ASTImporter] Import the whole redecl chain of functions"Gabor Marton2018-06-251-4/+4
| | | | | | This reverts commit r335480. llvm-svn: 335491
* [ASTImporter] Import the whole redecl chain of functionsGabor Marton2018-06-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With this patch when any `FunctionDecl` of a redeclaration chain is imported then we bring in the whole declaration chain. This involves functions and function template specializations. Also friend functions are affected. The chain is imported as it is in the "from" tu, the order of the redeclarations are kept. I also changed the lookup logic in order to find friends, but first making them visible in their declaration context. We may have long redeclaration chains if all TU contains the same prototype, but our measurements shows no degradation in time of CTU analysis (Tmux, Xerces, Bitcoin, Protobuf). Also, as further work we could squash redundant prototypes, but first ensure that functionality is working properly; then should we optimize. This may seem like a huge patch, sorry about that. But, most of the changes are new tests, changes in the production code is not that much. I also tried to create a smaller patch which does not affect specializations, but that patch failed to pass some of the `clang-import-test`s because there we import function specializations. Also very importantly, we can't just change the import of `FunctionDecl`s without changing the import of function template specializations because they are handled as `FunctionDecl`s. Reviewers: a.sidorin, r.stahl, xazax.hun, balazske Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47532 llvm-svn: 335480
* [ASTImporter] FriendDecl importing improvementsPeter Szecsi2018-04-253-0/+64
| | | | | | | | | | There are only a few cases of importing a frienddecl which is currently supported. This patch aims to improve the friend import process. Set FriendObjectKind in case of decls, insert friend into the friend chain correctly, checks structurally equivalent in a more advanced manner. Test cases added as well. llvm-svn: 330847
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* Fix test added in r329301 to work properly with Windows paths.Douglas Yung2018-04-051-4/+4
| | | | llvm-svn: 329361
* [ASTImporter] Fix for importing unnamed structsAleksei Sidorin2018-04-053-1/+133
| | | | | | | | Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D30876 llvm-svn: 329301
* [ASTImporter] Fix lexical DC for templated decls; support ↵Aleksei Sidorin2018-02-142-0/+26
| | | | | | | | | | VarTemplatePartialSpecDecl Also minor refactoring in related functions was done. Differential Revision: https://reviews.llvm.org/D43012 llvm-svn: 325116
* [ASTImporter] Support LambdaExprs and improve template supportAleksei Sidorin2018-01-267-18/+65
| | | | | | | | | | | | | | 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
* [ASTImporter] Fix missing SourceLoc import for ObjCMethodDecl selectorsAleksei Sidorin2018-01-091-1/+3
| | | | | | | | Patch by Nico Rieck, test case by Sean Callanan! Differential Revision: https://reviews.llvm.org/D6550 llvm-svn: 322079
* [ASTImporter] Support new AST nodes:Aleksei Sidorin2017-11-213-3/+67
| | | | | | | | | | | | | | | | * UnresolvedUsingType * EmptyDecl * NamespaceAliasDecl * UsingDecl * UsingShadowDecl * UsingDirectiveDecl * UnresolvedUsingValueDecl * UnresolvedUsingTypenameDecl Refactor error handling in ImportTemplateArgumentLoc() method. Add a test for inline namespaces. llvm-svn: 318776
* Revert r299355 "[ASTImporter] Fix for importing unnamed structs"Gabor Horvath2017-04-033-133/+1
| | | | | | It breaks windows bots. llvm-svn: 299386
* [ASTImporter] Fix for importing unnamed structsGabor Horvath2017-04-033-1/+133
| | | | | | | | Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D30876 llvm-svn: 299355
* [ASTImporter] Lookup SearchName instead of NameGabor Horvath2017-04-033-1/+38
| | | | | | | | | | When the SearchName is already calculated we should use that for the lookup. Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D30877 llvm-svn: 299354
* [ASTImporter] Import fix of GCCAsmStmts w/ missing symbolic operandsGabor Horvath2017-03-132-0/+11
| | | | | | | | Patch by Zoltan Gera! Differential Revision: https://reviews.llvm.org/D30831 llvm-svn: 297627
* [ASTImporter] Support default argument initialization of ParmVarDeclsAleksei Sidorin2017-02-202-0/+6
| | | | | | | | Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D29612 llvm-svn: 295654
* ASTImporter: fix tests on Windows with removing slashed parts of pathsAleksei Sidorin2017-01-231-9/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D26753 llvm-svn: 292781
* ASTImporter: quick test fixAleksei Sidorin2017-01-231-9/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D26753 llvm-svn: 292779
* ASTImporter: add forgotten tests for rL292776Aleksei Sidorin2017-01-233-0/+222
| | | | llvm-svn: 292778
* Fixed layout of test/ASTMerge.Sean Callanan2016-11-1661-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | 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-075-0/+25
| | | | | | | | | | | | | | | | | 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-282-0/+18
| | | | | | 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-284-0/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-143-0/+18
| | | | | | | | | | | | | | | | | | | | | | | 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-162-0/+29
| | | | | | | | | 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-142-27/+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-142-0/+15
| | | | | | | | | | | | | | | | | | 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-142-0/+27
| | | | | | Thanks to Aleksei Sidorin for review and advice. llvm-svn: 269546
* [ASTImporter] Implement missing VisitAccessSpecDecl function in ASTImporter ↵Argyrios Kyrtzidis2016-02-183-8/+10
| | | | | | | | class. Patch by Elisavet Sakellari! llvm-svn: 261274
* Update tests touched by r249656David Majnemer2015-10-082-6/+6
| | | | | | | | | These test updates almost exclusively around the change in behavior around enum: enums without a definition are considered incomplete except when targeting MSVC ABIs. Since these tests are interested in the 'incomplete-enum' behavior, restrict them to %itanium_abi_triple. llvm-svn: 249660
* PR10405 - Desugar FunctionType and TemplateSpecializationType if any type ↵Nikola Smiljanic2015-07-161-1/+1
| | | | | | that appears inside needs to be desugared. llvm-svn: 242371
* [Hexagon] Reapply 238773 after fix to LLVM.Colin LeMahieu2015-06-031-1/+0
| | | | llvm-svn: 238948
* Revert "[Hexagon] Test passes for hexagon target now that the backend ↵Rafael Espindola2015-06-011-0/+1
| | | | | | | | | | correctly generates relocations." This reverts commit r238754. It depends on r238748, which was reverted. llvm-svn: 238773
* [Hexagon] Test passes for hexagon target now that the backend correctly ↵Colin LeMahieu2015-06-011-1/+0
| | | | | | generates relocations. llvm-svn: 238754
* XFAIL Hexagon until more codegen in place.Rick Foos2015-04-291-0/+1
| | | | | | | | | | | | | | | | | | 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
* Implemented ASTImporter support for Stmts and fixedSean Callanan2015-04-284-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Changes so that a few tests do not fail when running under guarded malloc.Argyrios Kyrtzidis2013-07-121-1/+1
| | | | | | | Guarded malloc emits some messages at the beginning in stderr when enabled. These messages caused a few tests to fail. llvm-svn: 186219
* Add 'not' to commands that are expected to fail.Rafael Espindola2013-07-0410-10/+10
| | | | | | | This is at least good documentation, but also opens the possibility of using pipefail. llvm-svn: 185652
* Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.Andy Gibbs2013-04-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix code that attempted to produce a diagnostic with one DiagnosticEngine, thenRichard Smith2012-12-203-0/+13
| | | | | | | | 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
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-191-0/+1
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* Update VerifyDiagnosticConsumer to only get directives during parsing.Jordan Rose2012-08-101-0/+6
| | | | | | | | | | | | | | | | | | | | 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
* Fix crash at @implementation with a forward reference as base class.Argyrios Kyrtzidis2012-03-131-1/+1
| | | | | | rdar://11020003 llvm-svn: 152596
* Improve location fidelity of objc decls.Argyrios Kyrtzidis2011-10-041-4/+4
| | | | | | | | -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
* Flip the default for showing include stacks on notes to false. ThisChandler Carruth2011-03-271-1/+1
| | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud