summaryrefslogtreecommitdiffstats
path: root/test/input
Commit message (Collapse)AuthorAgeFilesLines
...
* test: Improve class template member typedef test casesBrad King2014-12-112-4/+4
| | | | Reference the template parameter type as the typedef'd type.
* Output: Add function calling convention attributesBrad King2014-04-141-0/+4
| | | | | Add to Function-like and FunctionType elements an attributes="" attribute for the calling convention as gccxml does.
* Output: Generate location attributes for builtin declarationsBrad King2014-04-111-0/+1
| | | | | | Report a file id "f0" named "<builtin>" for declarations that are generated by the compiler and have no reference location in the source. Add a test case covering the MSVC builtin "size_t" typedef.
* Output: Traverse extern "C" namespace membersBrad King2014-04-111-0/+6
| | | | Teach AddDeclContextMembers to recurse on LinkageSpecDecl members.
* Output: Drop class template partial specializations from outputBrad King2014-04-112-0/+14
| | | | | | | Since gccxml format does not support uninstantiated templates we must not output any partial specializations either. Skip class template partial specializations when traversing context members. Desugar non-dependent typedef members of class template partial specializations.
* Output: Drop functions with rvalue reference types from gccxml outputBrad King2014-04-112-0/+12
| | | | | | | | | | | Improve support for -std=c++11 with --castxml-gccxml by dropping all functions and class methods whose signature contains a rvalue reference. This subsumes the previous check for implicit move constructors and implicit move assignment operators and extends it to explicitly written declarations too. Add test cases to verify that such declarations are excluded from the output.
* castxml: Register all LLVM target architectures and asm parsersBrad King2014-04-101-0/+1
| | | | | We need as parsers to support Visual Studio system header files that contain inline assembly.
* castxml: Support -std=c++11 with --castxml-gccxmlBrad King2014-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | Parsing standard library headers in Visual Studio 11 and above requires Clang to use -std=c++11 because the headers use C++11 constructs. While gccxml output format does not support these constructs, it is still useful to be able to output interfaces from C++98 project code while tolerating C++11 constructs in system headers. Drop the rejection of -std=c++11 and --castxml-gccxml together. Teach our ASTVisitor::AddDumpNode method to skip deleted member functions, implicit move constructors, and implicit move assignment operators. This should avoid encountering any C++11 constructs that are not written explicitly in the translation unit. Extend the test suite to run all gccxml output format tests in both -std=c++98 and -std=c++11 mode to verify the behavior of the two modes is as close as possible. Tweak the Class-implicit-members expected output to tolerate the empty throw specification missing in C++11 mode. Add a RValueReferenceType test to verify that the gccxml-format output contains an Unimplemented element for the rvalue-reference type.
* test: Show failure when implicit member needs bad template instantiationBrad King2014-04-091-0/+9
| | | | | | | | | | | | | | | | | | | When a function template (or member of a class template) is instantiated by an implicit class member definition, Clang delays the instantiation for later handling by clang::Sema::PerformPendingInstantiations during clang::Sema::ActOnEndOfTranslationUnit. If the instantiation causes errors they are not suppressed because our clang::Sema::SFINAETrap has gone out of scope. Even if we could keep a clang::Sema::SFINAETrap in scope, the clang::Sema::InstantiatingTemplate::Initialize method sets sema.InNonInstantiationSFINAEContext to false and adds an entry to sema.ActiveTemplateInstantiations. This prevents the clang::Sema::EmitCurrentDiagnostic call to isSFINAEContext from returning a valid SFINAE context, so errors are still not suppressed. Add a test case demonstrating this known failure, and mark it as "broken". This will require changes to Clang to fix.
* Output: Skip empty declarations in class or namespace membersBrad King2014-04-011-0/+3
| | | | Clang creates an "EmptyDecl" for a stray semicolon. Ignore it.
* Output: Skip through extern "C" contexts to enclosing namespaceBrad King2014-03-311-0/+3
| | | | | The gccxml output format has no representation for extern "C" declaration contexts, so simply report the enclosing namespace.
* Output: Skip friend function templatesBrad King2014-03-311-0/+8
| | | | | The gccxml output format does not support uninstantiated templates so we need to skip friend declarations referencing them.
* test: Show duplication of reference-to-class-template-specialization typesBrad King2014-03-272-0/+10
| | | | | | | | | | | | | Clang generates a distinct TemplateSpecializationType for each appearance of A<T> for some template A<>. They are all sugar for an underlying RecordType. While they all share the same canonical type, LValueReferenceType instances that refer to them are also distinct and do not share the same canonical type because each has a different pointee type. Add tests demonstrating cases where this causes duplicate ReferenceType elements to be generated. Mark them as "broken" and add a note in the expected output that matches nothing but documents the problem.
* Output: Desugar non-dependent typedef members of class templatesBrad King2014-03-271-0/+6
| | | | | | Since gccxml does not output uninstantiated templates we must desugar typedef types that would refer to declarations whose context is a template. This is consistent with gccxml behavior.
* Output: Drop from Namespace members="" non-inline class membersBrad King2014-03-243-0/+15
| | | | | | Clang presents non-inline class members in the list of declarations in a namespace. Teach PrintMembersAttribute to skip declarations whose actual context is not the context that listed them.
* Output: Skip implicit members that cannot be compiledBrad King2014-03-246-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement the HandleTagDeclDefinition method in our ASTConsumer. Clang calls this method during parsing on completion of each class definition. This gives us a chance to modify class definitions. Teach HandleTagDeclDefinition to add the implicit member declarations. For each implicit member, ask Clang to try instantiating its definition to see if a call to the member will actually work. Suppress errors during this check using a clang::Sema::SFINAETrap and simply mark the declaration as invalid if there were errors. Add test cases for: * implicit members that cannot be used due to access, const data members, or reference data members. * a POD array data member since Clang uses special logic when creating implicit members that copy the data. * a mutable data member since Clang adds implicit member declarations itself (via clang::Sema::AddImplicitlyDeclaredMembersToClass), but we still need to try defining them. * a class that uses its implicit members so they are already defined.
* Output: Report Typedef underlying typeBrad King2014-03-241-0/+1
| | | | | When a typedef is "moded" the underlying type may be different from the named type. Report the real type.
* Output: Decay Function Argument typesBrad King2014-03-241-0/+1
| | | | | Report the actual function argument type even if it decayed from the type originally specified.
* Output: Use typedef name for anonymous enumBrad King2014-03-242-0/+8
| | | | When an enum has no name but does have a typedef, use the typedef name.
* Output: Add default="" to Function Argument elementsBrad King2014-03-242-0/+8
|
* Output: Add pure_virtual="" to Function-like elementsBrad King2014-03-241-0/+2
|
* Output: Desugar Class base class referencesBrad King2014-03-241-0/+3
| | | | | Report the canonical base type instead of a typedef type in order to match gccxml behavior.
* test: Add case for multiple class forward declarationsBrad King2014-03-241-0/+4
|
* Output: Fix output of forward-declared classesBrad King2014-03-241-0/+8
| | | | | | | When adding a dump node for a class, use the class definition, if available, instead of the canonical declaration. They may not be the same when a class is forward-declared before it is defined. We need to use the definition to get all members.
* test: Add case for class template basesBrad King2014-03-241-0/+4
|
* castxml: Expand response file references on command lineBrad King2014-03-242-0/+1
| | | | | | Add support for @args.rsp file references on the command line. Add test cases covering missing response files, empty response files, and response files that actually provide arguments.
* Output: Make FundamentalType names match gccxmlBrad King2014-03-241-0/+15
| | | | | | The gccxml FundamentalType names used different variants for integer type names than Clang uses. Hard-code the names for these types. Add a test case to cover these names.
* test: Add cases for C-mode gccxml-like outputBrad King2014-03-243-0/+4
| | | | | | | Although gccxml did not support C, it was occasionally requested. The gccxml output format supports C and Clang can easily handle parsing it. Add test cases that verify Clang can parse sources as C code and not C++.
* test: Add case for using declaration in derived classBrad King2014-03-241-0/+8
| | | | | Cover a class that brings overloads from a base through a using declaration.
* test: Add cases for class member template instantiationBrad King2014-03-242-0/+8
| | | | Cover member templates of both classes and class templates.
* Output: Report class friendsBrad King2014-03-241-0/+6
| | | | | | Report in Class elements a befriending="" attribute listing the class friends. Queue the friends for output, but not necessarily as complete types.
* Output: Report class basesBrad King2014-03-211-0/+9
| | | | | Inside Class elements generate Base elements reporting the type="", access="", and virtual="" information about base classes, if any.
* Output: Add abstract="" attribute to Class elementsBrad King2014-03-211-0/+3
|
* Output: Generate Enumeration elementsBrad King2014-03-212-0/+6
| | | | | | | | | Implement the OutputEnumDecl method to generate the Enumeration element. Report the name="", context="", and location="" of the declaration. Inside the Enumeration element generate EnumValue elements describing the enumeration names and initializers. Also map enum types to the corresponding declarations.
* Output: Add init="" attribute to Variable elementsBrad King2014-03-211-0/+4
|
* Output: Handle using declarations and directivesBrad King2014-03-214-0/+18
| | | | | | | | Honor both for purposes of the start node lookup. Walk through using declarations (Clang UsingShadowDecl) to output the referenced declarations in their original context. Do not include names brought into a context by a using declaration or directive in the members of that context.
* Output: Generate MethodType and OffsetType elementsBrad King2014-03-214-0/+8
| | | | | | | | | | Implement the OutputMemberPointerType method. If a type is a pointer to a data member, call a new OutputOffsetType method to generate an OffsetType element representing it directly. If a type is a pointer to a function member, queue a DumpType node that holds the pointee function type and the containing class. Teach the main OutputType method to recognize this case and dispatch to a new OutputMethodType method to generate a MethodType element.
* Output: Generate Ellipsis element inside variadic functions and typesBrad King2014-03-212-0/+2
|
* Output: Generate FunctionType elementsBrad King2014-03-211-0/+1
| | | | | | | | | | | | Implement the OutputFunctionProtoType method to generate the FunctionType element. Report the return type. Inside the FunctionType element generate Argument elements describing the function type parameter types. For each argument report the type and queue it. Create a OutputFunctionTypeHelper method to hold the main implementation and call it from OutputFunctionProtoType with the "FunctionType" name as an argument. This will allow it to be re-used for other function types later.
* Output: Map Paren type to the inner typeBrad King2014-03-211-0/+1
|
* test: Add case for a Variable as Class memberBrad King2014-03-211-0/+3
|
* Output: Generate Field elementsBrad King2014-03-211-0/+5
| | | | | | Implement the OutputFieldDecl method to generate the Field element. Report the name="", type="", bits="", mutable="", context="", and location="" of the declaration. Queue the type.
* Output: Generate function template instantiations and specializationsBrad King2014-03-211-0/+3
| | | | | | | Teach the AddStartDecl and PrintMembersAttribute methods to queue function template instantiations and specializations for output using an AddFunctionTemplateDecl helper to share common implementation. Map the Clang SubstTemplateTypeParm type to its replacement type.
* test: Add cases for Method, OperatorMethod, and OperatorFunctionBrad King2014-03-213-0/+10
| | | | | Use operator name "<<" and verify that the word "operator" does not appear in the name as is the case in original gccxml.
* Output: Follow qualified type namesBrad King2014-03-211-0/+2
|
* Output: Desugar template specialization typesBrad King2014-03-211-0/+2
| | | | Replace them with the underlying type.
* Output: Generate class template instantiations and specializationsBrad King2014-03-211-0/+5
| | | | | | | | | | | | | Teach the AddStartDecl and PrintMembersAttribute methods to queue class template instantiations and specializations for output using an AddClassTemplateDecl helper to share common implementation. Implement the OutputClassTemplateSpecializationDecl method to forward to the OutputCXXRecordDecl method. Teach the underlying OutputRecordDecl implementation to use a new PrintNameAttribute overload that extracts the full name from a NamedDecl so that template arguments are included in the class template specialization name.
* Restrict --castxml-gccxml to C++98 and C89 modesBrad King2014-03-214-0/+0
| | | | | | | The gccxml output format was designed for C++98 and does not support constructs in C++11 or other newer language standards. Reject such combinations up front. An alternative output format will be needed for such interfaces.
* Output: Generate Function and related elementsBrad King2014-03-212-0/+2
| | | | | | | | | | | | | | Implement the OutputFunctionDecl, OutputCXXMethodDecl, OutputCXXConversionDecl, OutputCXXConstructorDecl, and OutputCXXDestructorDecl methods to generate these elements. Report the name="", returns="", context="", and location="" of the function declaration. Also add static="1", explicit="1", const="1", virtual="1", inline="1", extern="1", and artificial="1" (compiler generated), and throws="..." as appropriate. Inside the function element generate Argument elements describing the function parameters. For each argument report the name="", type="", and location="". Queue the argument types.
* Output: Generate Variable elementsBrad King2014-03-211-0/+1
| | | | | | | Implement the OutputVarDecl method to generate the Variable element. Report the name="", type="", context="", location="", and storage class (static="1" or extern="1") of the declaration. Queue the type.