summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* RunClang: Pass full Options struct to our ASTConsumerBrad King2014-04-091-5/+5
| | | | | Pass the full structure instead of just the StartNames field. We may need information about other options later.
* Port to LLVM/Clang SVN r205446Brad King2014-04-081-3/+2
| | | | | | | Build with compiler flag '-std=c++11' since the Clang API now uses C++11. Update our implementation to account for Clang API changes. Update our search for the Clang resource directory to include the LLVM/Clang version patch level.
* RunClang: Add missing include for OwningPtrBrad King2014-04-031-0/+1
| | | | Include the LLVM header for OwningPtr before using it.
* Output: Skip empty declarations in class or namespace membersBrad King2014-04-011-0/+3
| | | | Clang creates an "EmptyDecl" for a stray semicolon. Ignore it.
* castxml: Report help with '-help' and '--help'Brad King2014-04-011-0/+15
| | | | Also pass the flag through so Clang reports its help too.
* castxml: Use parentheses for '--castxml-cc-<id>' commandsBrad King2014-03-311-4/+48
| | | | | | | | Avoid requiring the option to be last by using the form --castxml-cc-<id> "(" <cc> <cc-opt>... ")" to specify compiler commands with arguments.
* castxml: Rewrite usage output to include more detailBrad King2014-03-311-3/+24
|
* Output: Skip through extern "C" contexts to enclosing namespaceBrad King2014-03-311-0/+5
| | | | | 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/+5
| | | | | The gccxml output format does not support uninstantiated templates so we need to skip friend declarations referencing them.
* Output: Report template declarations as UnimplementedBrad King2014-03-271-0/+36
| | | | | | In case our traversal accidentally reaches a class or function template due to a bug, generate an Unimplemented element instead of trying to generate a Class-like or Function-like element for a template.
* Output: Desugar non-dependent typedef members of class templatesBrad King2014-03-271-3/+19
| | | | | | 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-241-0/+5
| | | | | | 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-242-3/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+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-1/+7
| | | | | Report the actual function argument type even if it decayed from the type originally specified.
* Output: Use typedef name for anonymous enumBrad King2014-03-241-1/+7
| | | | When an enum has no name but does have a typedef, use the typedef name.
* Output: Add default="" to Function Argument elementsBrad King2014-03-241-6/+24
|
* Output: Add pure_virtual="" to Function-like elementsBrad King2014-03-241-0/+13
|
* Output: Desugar Class base class referencesBrad King2014-03-241-2/+2
| | | | | Report the canonical base type instead of a typedef type in order to match gccxml behavior.
* Output: Add bases="" attribute to Class elementsBrad King2014-03-241-0/+27
| | | | | | | The gccxml output format originally reported bases as an attribute of <Class> elements and later added the <Base> nested elements to produce valid XML IDREFs and indicate virtual inheritance. We need to include the old bases="" attribute to match the gccxml format.
* Output: Fix output of forward-declared classesBrad King2014-03-241-2/+9
| | | | | | | 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.
* castxml: Report version number with '--version'Brad King2014-03-245-0/+40
| | | | Also pass the flag through so Clang reports its version too.
* Introduce CastXML version numberBrad King2014-03-242-0/+49
| | | | Start with "0.1". Compute the version number from Git if possible.
* castxml: Expand response file references on command lineBrad King2014-03-241-0/+14
| | | | | | 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.
* castxml: Use LLVM API to load command-line argumentsBrad King2014-03-241-7/+21
| | | | | | Use llvm::sys::Process::GetArgumentVector instead of KWSys Encoding to load process command-line arguments. This reduces dependency on KWSys and stores the arguments in LLVM-provided data structures.
* Output: Make FundamentalType names match gccxmlBrad King2014-03-241-1/+14
| | | | | | 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.
* Output: Report class friendsBrad King2014-03-241-0/+33
| | | | | | 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-1/+16
| | | | | Inside Class elements generate Base elements reporting the type="", access="", and virtual="" information about base classes, if any.
* Output: Refactor access specifier attribute printingBrad King2014-03-211-7/+16
| | | | Factor out a PrintAccessAttribute method from PrintContextAttribute.
* Output: Add abstract="" attribute to Class elementsBrad King2014-03-211-0/+4
|
* Output: Generate Enumeration elementsBrad King2014-03-211-0/+30
| | | | | | | | | 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/+8
|
* Output: Handle using declarations and directivesBrad King2014-03-211-0/+28
| | | | | | | | 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-211-4/+75
| | | | | | | | | | 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: Extend type nodes and queue to pair with containing classBrad King2014-03-211-27/+44
| | | | | | | | | Clang represents pointer-to-member-function as a pointer-to-member type whose pointee is a normal function-type. The gccxml output format represents them as a normal pointer whose pointee is a "method-type". Since clang::QualType cannot represent a "method-type", introduce our own DumpType struct to contain a clang::QualType and a clang::Type* where the latter can be used to point to the containing class.
* Output: Generate Ellipsis element inside variadic functions and typesBrad King2014-03-211-0/+6
|
* Output: Generate FunctionType elementsBrad King2014-03-211-0/+36
| | | | | | | | | | | | 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/+3
|
* Output: Generate Field elementsBrad King2014-03-211-0/+21
| | | | | | 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/+32
| | | | | | | 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.
* RunClang: Parse function bodies so we can instantiate themBrad King2014-03-211-3/+0
| | | | | Without function bodies Clang generates an error when code attempts an explicit function template instantiation.
* Output: Follow qualified type namesBrad King2014-03-211-0/+3
|
* Output: Desugar template specialization typesBrad King2014-03-211-0/+7
| | | | Replace them with the underlying type.
* Output: Generate class template instantiations and specializationsBrad King2014-03-211-2/+54
| | | | | | | | | | | | | 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.
* Output: Factor out start decl additionBrad King2014-03-211-2/+11
|
* Restrict --castxml-gccxml to C++98 and C89 modesBrad King2014-03-211-0/+25
| | | | | | | 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: Add implicit members to Class, Struct, and UnionBrad King2014-03-211-0/+3
| | | | | Tell Clang to add the implicit method declarations before we traverse a CXXRecordDecl.
* Output: Generate Function and related elementsBrad King2014-03-211-0/+227
| | | | | | | | | | | | | | 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/+20
| | | | | | | 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.
* Output: Generate ArrayType elementsBrad King2014-03-211-0/+26
| | | | | | Implement the OutputConstantArrayType and OutputIncompleteArrayType methods to generate the ArrayType element. Report the min="", max="", and type="" of the array elements and queue the type.