pax_global_header00006660000000000000000000000064134560764600014525gustar00rootroot0000000000000052 comment=5ba47e3b67c4a9070e8404ed2db4d16c52e4267b CastXML-0.2.0/000077500000000000000000000000001345607646000127775ustar00rootroot00000000000000CastXML-0.2.0/.clang-format000066400000000000000000000010471345607646000153540ustar00rootroot00000000000000--- # This configuration requires clang-format version 6.0 exactly. BasedOnStyle: Mozilla AlignOperands: false AllowShortFunctionsOnASingleLine: InlineOnly AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None BinPackArguments: true BinPackParameters: true BraceWrapping: AfterClass: true AfterEnum: true AfterFunction: true AfterStruct: true AfterUnion: true BreakBeforeBraces: Custom ColumnLimit: 79 IndentPPDirectives: AfterHash SortUsingDeclarations: false SpaceAfterTemplateKeyword: true ... CastXML-0.2.0/CMakeLists.txt000066400000000000000000000133751345607646000155500ustar00rootroot00000000000000#============================================================================= # Copyright Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= cmake_minimum_required(VERSION 2.8.5) project(CastXML) include(src/Version.cmake) include(CTest) # Build tree locations. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CastXML_BINARY_DIR}/bin") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CastXML_BINARY_DIR}/lib") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CastXML_BINARY_DIR}/lib") # Install tree locations. if(NOT CastXML_INSTALL_RUNTIME_DIR) set(CastXML_INSTALL_RUNTIME_DIR bin) endif() if(NOT CastXML_INSTALL_DATA_DIR) set(CastXML_INSTALL_DATA_DIR share/castxml) endif() if(NOT CastXML_INSTALL_DOC_DIR) set(CastXML_INSTALL_DOC_DIR share/doc/castxml) endif() if(NOT CastXML_INSTALL_MAN_DIR) set(CastXML_INSTALL_MAN_DIR man) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") if(NOT LLVM_ENABLE_EH) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") endif() if(NOT LLVM_ENABLE_RTTI) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") endif() if(CYGWIN OR MINGW) # Use GNU extensions on Windows as LLVM upstream does. set(std_cxx11 "-std=gnu++11") else() set(std_cxx11 "-std=c++11") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${std_cxx11}") endif() macro(hint_clang_from_llvm) if(LLVM_DIR AND NOT Clang_DIR) if(LLVM_DIR MATCHES "share/llvm/cmake$") # LLVM/Clang 3.8 installs in /share/{llvm,clang}/cmake get_filename_component(Clang_DIR "${LLVM_DIR}/../../clang/cmake" ABSOLUTE) else() # LLVM/Clang 3.9+ installs in /lib/cmake/{llvm,clang} get_filename_component(Clang_DIR "${LLVM_DIR}/../clang" ABSOLUTE) endif() endif() endmacro() macro(hint_llvm_from_clang) if(Clang_DIR AND NOT LLVM_DIR) if(Clang_DIR MATCHES "share/clang/cmake$") # LLVM/Clang 3.8 installs in /share/{llvm,clang}/cmake get_filename_component(LLVM_DIR "${Clang_DIR}/../../llvm/cmake" ABSOLUTE) else() # LLVM/Clang 3.9+ installs in /lib/cmake/{llvm,clang} get_filename_component(LLVM_DIR "${Clang_DIR}/../llvm" ABSOLUTE) endif() endif() endmacro() # Build scripts may set either LLVM_DIR or Clang_DIR. hint_llvm_from_clang() hint_clang_from_llvm() # Clang 3.8+ installs its own CMake package. Try it first. find_package(Clang QUIET) # If Clang did not find LLVM for us, give our search below a hint. hint_llvm_from_clang() # Clang 3.9+ automatically searches for LLVM. For older versions we # may need to search for LLVM directly. Either way we require LLVM. if(NOT LLVM_FOUND) find_package(LLVM REQUIRED) endif() if(DEFINED LLVM_BUILD_BINARY_DIR) message(FATAL_ERROR "Clang_DIR or LLVM_DIR refers to a LLVM/Clang build directory:\n" " Clang_DIR=${Clang_DIR}\n" " LLVM_DIR=${LLVM_DIR}\n" "CastXML must be built against a LLVM/Clang install tree as " "specified in\n" " ${CastXML_SOURCE_DIR}/README.rst") endif() set(found_clang 0) set(tried_clang) foreach(inc ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS}) if(EXISTS "${inc}/clang/AST/ASTConsumer.h") set(found_clang 1) break() else() set(tried_clang " ${inc}\n") endif() endforeach() if(NOT found_clang) message(FATAL_ERROR "Clang_DIR or LLVM_DIR refers to a LLVM/Clang installation:\n" " Clang_DIR=${Clang_DIR}\n" " LLVM_DIR=${LLVM_DIR}\n" "that does not have `clang/` headers in any include directory:\n" "${tried_clang}" ) endif() add_definitions(${LLVM_DEFINITIONS}) include_directories(${CLANG_INCLUDE_DIRS}) include_directories(${LLVM_INCLUDE_DIRS}) link_directories(${LLVM_LIBRARY_DIRS}) if(NOT DEFINED LLVM_VERSION_PATCH) set(LLVM_VERSION_PATCH 0) endif() set(CLANG_RESOURCE_DIR "" CACHE PATH "Clang resource directory") if(NOT CLANG_RESOURCE_DIR) set(v ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}) set(tried "") set(dirs "") foreach(d ${LLVM_LIBRARY_DIRS}) # Clang resources are typically inside LLVM's library directory. list(APPEND dirs ${d}) # Some distros use a layout of the form # /lib/llvm//lib # /lib/clang//include if("${d}" MATCHES "^(.*)/llvm/.*$") list(APPEND dirs "${CMAKE_MATCH_1}") endif() endforeach() # Look in each candidate directory for Clang resources. foreach(d ${dirs}) if(IS_DIRECTORY "${d}/clang/${v}/include") set(CLANG_RESOURCE_DIR ${d}/clang/${v}) break() endif() set(tried "${tried}\n ${d}/clang/${v}") endforeach() if(NOT CLANG_RESOURCE_DIR) if(tried) set(tried " Tried:${tried}") endif() message(FATAL_ERROR "Could not find CLANG_RESOURCE_DIR.${tried}" "\n" "Please set CLANG_RESOURCE_DIR to the Clang SDK directory containing " "\"include/stddef.h\", typically of the form \"/lib/clang/${v}\"." ) endif() unset(tried) endif() install(DIRECTORY ${CLANG_RESOURCE_DIR}/include DESTINATION "${CastXML_INSTALL_DATA_DIR}/clang" ) add_subdirectory(src) if(BUILD_TESTING) add_subdirectory(test) endif() add_subdirectory(doc) install(DIRECTORY share/castxml/ DESTINATION "${CastXML_INSTALL_DATA_DIR}") install(FILES "LICENSE" "NOTICE" DESTINATION "${CastXML_INSTALL_DOC_DIR}" ) CastXML-0.2.0/LICENSE000066400000000000000000000261361345607646000140140ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. CastXML-0.2.0/NOTICE000066400000000000000000000002001345607646000136730ustar00rootroot00000000000000CastXML Copyright 2013-2015 Kitware, Inc. This product includes software developed at Kitware, Inc. (http://www.kitware.com/). CastXML-0.2.0/README.rst000066400000000000000000000045661345607646000145010ustar00rootroot00000000000000CastXML ******* Introduction ============ CastXML is a C-family abstract syntax tree XML output tool. This project is maintained by `Kitware`_ in support of `ITK`_, the Insight Segmentation and Registration Toolkit. .. _`Kitware`: http://www.kitware.com .. _`ITK`: http://www.itk.org Manual ====== See the `castxml(1)`_ manual page for instructions to run the tool. .. _`castxml(1)`: doc/manual/castxml.1.rst License ======= CastXML is licensed under the `Apache License, Version 2.0`_. See the ``__ and ``__ files for details. .. _`Apache License, Version 2.0`: http://www.apache.org/licenses/LICENSE-2.0 Community ========= Subscribe and post to the `CastXML Mailing List`_ for discussion of CastXML. .. _`CastXML Mailing List`: http://public.kitware.com/mailman/listinfo/castxml Build ===== To build CastXML from source, first obtain the prerequisites: * A C++ compiler supporting the ``c++11`` standard language level. * `CMake`_ cross-platform build system generator. * `LLVM/Clang`_ compiler SDK install tree built using the C++ compiler. This version of CastXML has been tested with LLVM/Clang - SVN revision ``356914`` (trunk) - Release ``8.0`` - Release ``7.0`` - Release ``6.0`` - Release ``5.0`` - Release ``4.0`` - Release ``3.9`` - Release ``3.8`` - Release ``3.7`` - Release ``3.6`` * Optionally, the `Sphinx`_ documentation generator to build documentation. Run CMake on the CastXML source tree to generate a build tree using a C++ compiler compatible with that used to build the LLVM/Clang SDK. CMake options include: ``Clang_DIR`` Location of the LLVM/Clang SDK. Set to ``/lib/cmake/clang``, where ```` is the top of the LLVM/Clang SDK install tree. Alternatively, ``LLVM_DIR`` may be set to ``/lib/cmake/llvm``. ``SPHINX_EXECUTABLE`` Location of the ``sphinx-build`` executable. Required only if building documentation. ``SPHINX_HTML`` Build documentation in ``html`` format. ``SPHINX_MAN`` Build documentation in ``man`` format. Run the corresponding native build tool (e.g. ``make``) in the CastXML build tree, and optionally build the ``install`` target. The ``castxml`` command-line tool may be used either from the build tree or the install tree. The install tree is relocatable. .. _`CMake`: http://www.cmake.org/ .. _`LLVM/Clang`: http://clang.llvm.org/ .. _`Sphinx`: http://sphinx-doc.org/ CastXML-0.2.0/doc/000077500000000000000000000000001345607646000135445ustar00rootroot00000000000000CastXML-0.2.0/doc/CMakeLists.txt000066400000000000000000000064101345607646000163050ustar00rootroot00000000000000#============================================================================= # Copyright Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= project(CastXMLDoc NONE) option(SPHINX_MAN "Build man pages with Sphinx" OFF) option(SPHINX_HTML "Build html pages with Sphinx" OFF) find_program(SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx Documentation Builder (sphinx-doc.org)" ) if(NOT SPHINX_MAN AND NOT SPHINX_HTML) return() elseif(NOT SPHINX_EXECUTABLE) message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") endif() set(copyright_line_regex "^Copyright (2013-20[0-9][0-9] Kitware.*)") file(STRINGS "${CastXML_SOURCE_DIR}/NOTICE" copyright_line LIMIT_COUNT 1 REGEX "${copyright_line_regex}") if(copyright_line MATCHES "${copyright_line_regex}") set(conf_copyright "${CMAKE_MATCH_1}") else() set(conf_copyright "Kitware, Inc.") endif() set(conf_docs "${CastXML_SOURCE_DIR}/doc") set(conf_path "${CMAKE_CURRENT_SOURCE_DIR}") set(conf_version "${CastXML_VERSION}") set(conf_release "${CastXML_VERSION}") configure_file(conf.py.in conf.py @ONLY) set(doc_formats "") if(SPHINX_HTML) list(APPEND doc_formats html) endif() if(SPHINX_MAN) list(APPEND doc_formats man) endif() set(doc_format_outputs "") set(doc_format_last "") foreach(format ${doc_formats}) set(doc_format_output "doc_format_${format}") set(doc_format_log "build-${format}.log") add_custom_command( OUTPUT ${doc_format_output} COMMAND ${SPHINX_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} -d ${CMAKE_CURRENT_BINARY_DIR}/doctrees -b ${format} ${CastXML_SOURCE_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/${format} > ${doc_format_log} # log stdout, pass stderr DEPENDS ${doc_format_last} COMMENT "sphinx-build ${format}: see doc/${doc_format_log}" VERBATIM ) set_property(SOURCE ${doc_format_output} PROPERTY SYMBOLIC 1) list(APPEND doc_format_outputs ${doc_format_output}) set(doc_format_last ${doc_format_output}) endforeach() add_custom_target(documentation ALL DEPENDS ${doc_format_outputs}) if(SPHINX_MAN) file(GLOB man_rst RELATIVE ${CastXML_SOURCE_DIR}/doc/manual ${CastXML_SOURCE_DIR}/doc/manual/*.[1-9].rst) foreach(m ${man_rst}) if("x${m}" MATCHES "^x(.+)\\.([1-9])\\.rst$") set(name "${CMAKE_MATCH_1}") set(sec "${CMAKE_MATCH_2}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/${name}.${sec} DESTINATION ${CastXML_INSTALL_MAN_DIR}/man${sec}) endif() endforeach() endif() if(SPHINX_HTML) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${CastXML_INSTALL_DOC_DIR} PATTERN .buildinfo EXCLUDE PATTERN objects.inv EXCLUDE ) endif() CastXML-0.2.0/doc/conf.py.in000066400000000000000000000052201345607646000154470ustar00rootroot00000000000000#============================================================================= # Copyright Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= import sys import os import re import glob sys.path.insert(0, r'@conf_path@') source_suffix = '.rst' master_doc = 'index' project = 'CastXML' copyright = '@conf_copyright@' version = '@conf_version@' # feature version release = '@conf_release@' # full version string exclude_patterns = [] extensions = [] templates_path = ['@conf_path@/templates'] castxml_manuals = sorted(glob.glob(r'@conf_docs@/manual/*.rst')) castxml_manual_description = re.compile('^\.\. castxml-manual-description:(.*)$') man_pages = [] for fpath in castxml_manuals: try: name, sec, rst = os.path.basename(fpath).split('.') desc = None f = open(fpath, 'r') for l in f: m = castxml_manual_description.match(l) if m: desc = m.group(1).strip() break f.close() if desc: man_pages.append(('manual/%s.%s' % (name, sec), name, desc, [], int(sec))) else: sys.stderr.write("ERROR: No castxml-manual-description in '%s'\n" % fpath) except Exception as e: sys.stderr.write("ERROR: %s\n" % str(e)) man_show_urls = False html_show_sourcelink = True html_theme = 'default' html_theme_options = { 'footerbgcolor': '#00182d', 'footertextcolor': '#ffffff', 'sidebarbgcolor': '#e4ece8', 'sidebarbtncolor': '#00a94f', 'sidebartextcolor': '#333333', 'sidebarlinkcolor': '#00a94f', 'relbarbgcolor': '#00529b', 'relbartextcolor': '#ffffff', 'relbarlinkcolor': '#ffffff', 'bgcolor': '#ffffff', 'textcolor': '#444444', 'headbgcolor': '#f2f2f2', 'headtextcolor': '#003564', 'headlinkcolor': '#3d8ff2', 'linkcolor': '#2b63a8', 'visitedlinkcolor': '#2b63a8', 'codebgcolor': '#eeeeee', 'codetextcolor': '#333333', } html_title = 'CastXML %s Documentation' % release html_short_title = '%s Documentation' % release CastXML-0.2.0/doc/index.rst000066400000000000000000000003261345607646000154060ustar00rootroot00000000000000.. title:: CastXML Documentation Command-Line Tools ################## .. toctree:: :maxdepth: 1 /manual/castxml.1 .. only:: html Index and Search ################ * :ref:`genindex` * :ref:`search` CastXML-0.2.0/doc/manual/000077500000000000000000000000001345607646000150215ustar00rootroot00000000000000CastXML-0.2.0/doc/manual/castxml.1.rst000066400000000000000000000157761345607646000174050ustar00rootroot00000000000000.. castxml-manual-description: C-family Abstract Syntax Tree XML Output castxml(1) ********** Synopsis ======== :: castxml ( | | )... Description =========== Parse C-family source files and optionally write a subset of the Abstract Syntax Tree (AST) to a representation in XML. Source files are parsed as complete translation units using an internal `Clang`_ compiler. XML output is enabled by the ``--castxml-output=`` or ``--castxml-gccxml`` option. .. _`Clang`: http://clang.llvm.org/ .. _`gccxml`: http://gccxml.org Options ======= The following command-line options are interpreted by ``castxml``. Remaining options are given to the internal Clang compiler. ``--castxml-cc- ``, ``--castxml-cc- "(" ... ")"`` Configure the internal Clang preprocessor and target platform to match that of the given compiler command. The ```` names a reference compiler with which the given command is compatible. It must be one of: * ``gnu``: GNU Compiler Collection C++ (g++) * ``gnu-c``: GNU Compiler Collection C (gcc) * ``msvc``: Microsoft Visual C++ (cl) * ``msvc-c``: Microsoft Visual C (cl) ```` names a compiler (e.g. ``/usr/bin/gcc`` or ``cl``) and ``...`` specifies options that may affect its target (e.g. ``-m32``). The target platform detected from the given compiler may be overridden by a separate Clang ``-target`` option. The language standard level detected from the given compiler may be overridden by a separate Clang ``-std=`` option. ``--castxml-output=`` Write XML output to to ``.xml`` or file named by ``-o``. The ```` specifies the "epic" format version number to generate, and must be ``1``. ``--castxml-gccxml`` Generate XML output in a format close to that of `gccxml`_. Write output to ``.xml`` or file named by ``-o``. The gccxml format does not support Clang language modes other than ``-std=c++98`` or ``-std=c89``. This output format may be used with language modes ``-std=c++11``, ``-std=c++14``, ``-std=c99``, and ``-std=c11`` but the output will not contain implicit move constructors or move assignment operators, and may contain ```` elements on non-c++98 constructs. ``--castxml-start [,]...`` Start AST traversal at declaration(s) with the given qualified name(s). Multiple names may be specified as a comma-separated list or by repeating the option. ``-help``, ``--help`` Print ``castxml`` and internal Clang compiler usage information. ``-o `` If output is generated (e.g. via ``--castxml-output=``), write the output to ````. At most one ```` file may be specified as input. ``--version`` Print ``castxml`` and internal Clang compiler version information. Release versions of CastXML use the format:: ..[-rc][-] where the ```` component is less than ``20000000``, ```` is an optional release candidate number, and ```` may contain arbitrary text (in case of development between patch versions). Development versions of CastXML use the format:: ..[-] where the ```` component is of format ``CCYYMMDD`` and ```` may contain arbitrary text. This represents development as of a particular date following the ``.`` feature release. Output Format Versions ====================== With ``--castxml-output=`` ----------------------------- The XML root element tag will be of the form: .. code-block:: xml * The first component is the ``epic`` format version number given to the ``--castxml-output=`` flag, and currently must always be ``1``. * The second component is the ``major`` format version number and increments when a new XML element is added or for other major changes. Clients will need updating. * The third component is the ``minor`` format version number and increments whenever a new XML attribute is added to an existing element or a minor bug is fixed in the XML output of an existing element or attribute (clients should work unchanged unless they want the new info). With ``--castxml-gccxml`` ------------------------- The XML root element tag will be of the form: .. code-block:: xml The ``version`` number corresponds to the last `gccxml`_ version that was ever released (for backward compatibility). The ``cvs_revision`` number is a running number that is incremented for each minor change in the xml format. Preprocessing ============= CastXML preprocesses source files using an internal Clang compiler using its own predefined macros for the target platform by default. The ``--castxml-cc-`` option switches the predefined macros to match those detected from the given compiler command. In either case, CastXML always adds the following predefined macros: ``__castxml_major__`` Defined to the CastXML major version number in decimal. ``__castxml_minor__`` Defined to the CastXML minor version number in decimal. ``__castxml_patch__`` Defined to the CastXML patch version number in decimal. ``__castxml_check(major,minor,patch)`` Defined to a constant expression encoding the three version components for comparison with ``__castxml__``. The actual encoding is unspecified. ``__castxml__`` Defined to a constant expression encoding the CastXML version components:: __castxml_check(__castxml_major__,__castxml_minor__,__castxml_patch__) ``__castxml_clang_major__`` Defined to the value of ``__clang_major__`` from the internal Clang. ``__castxml_clang_minor__`` Defined to the value of ``__clang_minor__`` from the internal Clang. ``__castxml_clang_patchlevel__`` Defined to the value of ``__clang_patchlevel__`` from the internal Clang. Source files may use these to identify the tool that is actually doing the preprocessing even when ``--castxml-cc-`` changes the predefined macros. FAQ === Why are C++ function bodies not dumped in XML? ---------------------------------------------- This feature has not been implemented because the driving project for which CastXML was written had no need for function bodies. Is there a DTD specifying the XML format dumped? ------------------------------------------------ No. Why don't I see templates in the output? ---------------------------------------- This feature has not been implemented because the driving project for which CastXML was written had no need for uninstantiated templates. Template instantiations will still be dumped, though. For example: .. code-block:: c++ template struct foo {}; typedef foo::foo foo_int; will instantiate ``foo``, which will be included in the output. However, there will be no place that explicitly lists the set of types used for the instantiation other than in the name. This is because the proper way to do it is to dump the templates too and reference them from the instantiations with the template arguments listed. Since the features will be linked they should be implemented together. CastXML-0.2.0/doc/templates/000077500000000000000000000000001345607646000155425ustar00rootroot00000000000000CastXML-0.2.0/doc/templates/layout.html000066400000000000000000000004021345607646000177410ustar00rootroot00000000000000{% extends "!layout.html" %} {% block rootrellink %}
  • CastXML{{ reldelim1 }}
  • {{ shorttitle|e }}{{ reldelim1 }}
  • {% endblock %} CastXML-0.2.0/share/000077500000000000000000000000001345607646000141015ustar00rootroot00000000000000CastXML-0.2.0/share/castxml/000077500000000000000000000000001345607646000155545ustar00rootroot00000000000000CastXML-0.2.0/share/castxml/detect_vs.c000066400000000000000000000101331345607646000176760ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* cl -c -FoNUL detect_vs.c */ #define TO_STRING0(x) #x #define TO_STRING(x) TO_STRING0(x) #define TO_DEFINE(x) "#define " #x " " TO_STRING(x) #pragma message("") #ifdef __ATOM__ # pragma message(TO_DEFINE(__ATOM__)) #endif #ifdef __AVX__ # pragma message(TO_DEFINE(__AVX__)) #endif #ifdef __AVX2__ # pragma message(TO_DEFINE(__AVX2__)) #endif #ifdef _ATL_VER # pragma message(TO_DEFINE(_ATL_VER)) #endif #ifdef _CHAR_UNSIGNED # pragma message(TO_DEFINE(_CHAR_UNSIGNED)) #endif #ifdef _CONTROL_FLOW_GUARD # pragma message(TO_DEFINE(_CONTROL_FLOW_GUARD)) #endif #ifdef _CPPRTTI # pragma message(TO_DEFINE(_CPPRTTI)) #endif #ifdef _CPPUNWIND # pragma message(TO_DEFINE(_CPPUNWIND)) #endif #ifdef _DEBUG # pragma message(TO_DEFINE(_DEBUG)) #endif #ifdef _DLL # pragma message(TO_DEFINE(_DLL)) #endif #ifdef _INTEGRAL_MAX_BITS # pragma message(TO_DEFINE(_INTEGRAL_MAX_BITS)) #endif #ifdef _ISO_VOLATILE # pragma message(TO_DEFINE(_ISO_VOLATILE)) #endif #ifdef _KERNEL_MODE # pragma message(TO_DEFINE(_KERNEL_MODE)) #endif #ifdef _MANAGED # pragma message(TO_DEFINE(_MANAGED)) #endif #ifdef _MFC_VER # pragma message(TO_DEFINE(_MFC_VER)) #endif #ifdef _MSC_BUILD # pragma message(TO_DEFINE(_MSC_BUILD)) #endif #ifdef _MSC_EXTENSIONS # pragma message(TO_DEFINE(_MSC_EXTENSIONS)) #endif #ifdef _MSC_FULL_VER # pragma message(TO_DEFINE(_MSC_FULL_VER)) #endif #ifdef _MSC_VER # pragma message(TO_DEFINE(_MSC_VER)) #endif #ifdef _MT # pragma message(TO_DEFINE(_MT)) #endif #ifdef _M_ALPHA # pragma message(TO_DEFINE(_M_ALPHA)) #endif #ifdef _M_AMD64 # pragma message(TO_DEFINE(_M_AMD64)) #endif #ifdef _M_ARM # pragma message(TO_DEFINE(_M_ARM)) #endif #ifdef _M_ARM64 # pragma message(TO_DEFINE(_M_ARM64)) #endif #ifdef _M_ARM_ARMV7VE # pragma message(TO_DEFINE(_M_ARM_ARMV7VE)) #endif #ifdef _M_ARM_FP # pragma message(TO_DEFINE(_M_ARM_FP)) #endif #ifdef _M_CEE # pragma message(TO_DEFINE(_M_CEE)) #endif #ifdef _M_CEE_PURE # pragma message(TO_DEFINE(_M_CEE_PURE)) #endif #ifdef _M_CEE_SAFE # pragma message(TO_DEFINE(_M_CEE_SAFE)) #endif #ifdef _M_FP_EXCEPT # pragma message(TO_DEFINE(_M_FP_EXCEPT)) #endif #ifdef _M_FP_FAST # pragma message(TO_DEFINE(_M_FP_FAST)) #endif #ifdef _M_FP_PRECISE # pragma message(TO_DEFINE(_M_FP_PRECISE)) #endif #ifdef _M_FP_STRICT # pragma message(TO_DEFINE(_M_FP_STRICT)) #endif #ifdef _M_IA64 # pragma message(TO_DEFINE(_M_IA64)) #endif #ifdef _M_IX86 # pragma message(TO_DEFINE(_M_IX86)) #endif #ifdef _M_IX86_FP # pragma message(TO_DEFINE(_M_IX86_FP)) #endif #ifdef _M_MPPC # pragma message(TO_DEFINE(_M_MPPC)) #endif #ifdef _M_MRX000 # pragma message(TO_DEFINE(_M_MRX000)) #endif #ifdef _M_PPC # pragma message(TO_DEFINE(_M_PPC)) #endif #ifdef _M_X64 # pragma message(TO_DEFINE(_M_X64)) #endif #ifdef _NATIVE_WCHAR_T_DEFINED # pragma message(TO_DEFINE(_NATIVE_WCHAR_T_DEFINED)) #endif #ifdef _OPENMP # pragma message(TO_DEFINE(_OPENMP)) #endif #ifdef _PREFAST_ # pragma message(TO_DEFINE(_PREFAST_)) #endif #ifdef _VC_NODEFAULTLIB # pragma message(TO_DEFINE(_VC_NODEFAULTLIB)) #endif #ifdef _WCHAR_T_DEFINED # pragma message(TO_DEFINE(_WCHAR_T_DEFINED)) #endif #ifdef _WIN32 # pragma message(TO_DEFINE(_WIN32)) #endif #ifdef _WIN64 # pragma message(TO_DEFINE(_WIN64)) #endif #ifdef _WINRT_DLL # pragma message(TO_DEFINE(_WINRT_DLL)) #endif #ifdef _Wp64 # pragma message(TO_DEFINE(_Wp64)) #endif #ifdef __CLR_VER # pragma message(TO_DEFINE(__CLR_VER)) #endif #ifdef __MSVC_RUNTIME_CHECKS # pragma message(TO_DEFINE(__MSVC_RUNTIME_CHECKS)) #endif #ifdef __STDC__ # pragma message(TO_DEFINE(__STDC__)) #endif #ifdef __STDC_HOSTED__ # pragma message(TO_DEFINE(__STDC_HOSTED__)) #endif CastXML-0.2.0/share/castxml/detect_vs.cpp000066400000000000000000000111021345607646000202330ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* cl -c -FoNUL detect_vs.cpp */ #define TO_STRING0(x) #x #define TO_STRING(x) TO_STRING0(x) #define TO_DEFINE(x) "#define " #x " " TO_STRING(x) #pragma message("") #ifdef __ATOM__ # pragma message(TO_DEFINE(__ATOM__)) #endif #ifdef __AVX__ # pragma message(TO_DEFINE(__AVX__)) #endif #ifdef __AVX2__ # pragma message(TO_DEFINE(__AVX2__)) #endif #ifdef _ATL_VER # pragma message(TO_DEFINE(_ATL_VER)) #endif #ifdef _CHAR_UNSIGNED # pragma message(TO_DEFINE(_CHAR_UNSIGNED)) #endif #ifdef _CONTROL_FLOW_GUARD # pragma message(TO_DEFINE(_CONTROL_FLOW_GUARD)) #endif #ifdef _CPPRTTI # pragma message(TO_DEFINE(_CPPRTTI)) #endif #ifdef _CPPUNWIND # pragma message(TO_DEFINE(_CPPUNWIND)) #endif #ifdef _DEBUG # pragma message(TO_DEFINE(_DEBUG)) #endif #ifdef _DLL # pragma message(TO_DEFINE(_DLL)) #endif #ifdef _INTEGRAL_MAX_BITS # pragma message(TO_DEFINE(_INTEGRAL_MAX_BITS)) #endif #ifdef _ISO_VOLATILE # pragma message(TO_DEFINE(_ISO_VOLATILE)) #endif #ifdef _KERNEL_MODE # pragma message(TO_DEFINE(_KERNEL_MODE)) #endif #ifdef _MANAGED # pragma message(TO_DEFINE(_MANAGED)) #endif #ifdef _MFC_VER # pragma message(TO_DEFINE(_MFC_VER)) #endif #ifdef _MSC_BUILD # pragma message(TO_DEFINE(_MSC_BUILD)) #endif #ifdef _MSC_EXTENSIONS # pragma message(TO_DEFINE(_MSC_EXTENSIONS)) #endif #ifdef _MSC_FULL_VER # pragma message(TO_DEFINE(_MSC_FULL_VER)) #endif #ifdef _MSC_VER # pragma message(TO_DEFINE(_MSC_VER)) #endif #ifdef _MSVC_LANG # pragma message(TO_DEFINE(_MSVC_LANG)) #endif #ifdef _MT # pragma message(TO_DEFINE(_MT)) #endif #ifdef _M_ALPHA # pragma message(TO_DEFINE(_M_ALPHA)) #endif #ifdef _M_AMD64 # pragma message(TO_DEFINE(_M_AMD64)) #endif #ifdef _M_ARM # pragma message(TO_DEFINE(_M_ARM)) #endif #ifdef _M_ARM64 # pragma message(TO_DEFINE(_M_ARM64)) #endif #ifdef _M_ARM_ARMV7VE # pragma message(TO_DEFINE(_M_ARM_ARMV7VE)) #endif #ifdef _M_ARM_FP # pragma message(TO_DEFINE(_M_ARM_FP)) #endif #ifdef _M_CEE # pragma message(TO_DEFINE(_M_CEE)) #endif #ifdef _M_CEE_PURE # pragma message(TO_DEFINE(_M_CEE_PURE)) #endif #ifdef _M_CEE_SAFE # pragma message(TO_DEFINE(_M_CEE_SAFE)) #endif #ifdef _M_FP_EXCEPT # pragma message(TO_DEFINE(_M_FP_EXCEPT)) #endif #ifdef _M_FP_FAST # pragma message(TO_DEFINE(_M_FP_FAST)) #endif #ifdef _M_FP_PRECISE # pragma message(TO_DEFINE(_M_FP_PRECISE)) #endif #ifdef _M_FP_STRICT # pragma message(TO_DEFINE(_M_FP_STRICT)) #endif #ifdef _M_IA64 # pragma message(TO_DEFINE(_M_IA64)) #endif #ifdef _M_IX86 # pragma message(TO_DEFINE(_M_IX86)) #endif #ifdef _M_IX86_FP # pragma message(TO_DEFINE(_M_IX86_FP)) #endif #ifdef _M_MPPC # pragma message(TO_DEFINE(_M_MPPC)) #endif #ifdef _M_MRX000 # pragma message(TO_DEFINE(_M_MRX000)) #endif #ifdef _M_PPC # pragma message(TO_DEFINE(_M_PPC)) #endif #ifdef _M_X64 # pragma message(TO_DEFINE(_M_X64)) #endif #ifdef _NATIVE_WCHAR_T_DEFINED # pragma message(TO_DEFINE(_NATIVE_WCHAR_T_DEFINED)) #endif #ifdef _OPENMP # pragma message(TO_DEFINE(_OPENMP)) #endif #ifdef _PREFAST_ # pragma message(TO_DEFINE(_PREFAST_)) #endif #ifdef _VC_NODEFAULTLIB # pragma message(TO_DEFINE(_VC_NODEFAULTLIB)) #endif #ifdef _WCHAR_T_DEFINED # pragma message(TO_DEFINE(_WCHAR_T_DEFINED)) #endif #ifdef _WIN32 # pragma message(TO_DEFINE(_WIN32)) #endif #ifdef _WIN64 # pragma message(TO_DEFINE(_WIN64)) #endif #ifdef _WINRT_DLL # pragma message(TO_DEFINE(_WINRT_DLL)) #endif #ifdef _Wp64 # pragma message(TO_DEFINE(_Wp64)) #endif #ifdef __CLR_VER # pragma message(TO_DEFINE(__CLR_VER)) #endif #ifdef __MSVC_RUNTIME_CHECKS # pragma message(TO_DEFINE(__MSVC_RUNTIME_CHECKS)) #endif #ifdef __STDCPP_DEFAULT_NEW_ALIGNMENT__ # pragma message(TO_DEFINE(__STDCPP_DEFAULT_NEW_ALIGNMENT__)) #endif #ifdef __STDCPP_STRICT_POINTER_SAFETY__ # pragma message(TO_DEFINE(__STDCPP_STRICT_POINTER_SAFETY__)) #endif #ifdef __STDCPP_THREADS__ # pragma message(TO_DEFINE(__STDCPP_THREADS__)) #endif #ifdef __cplusplus # pragma message(TO_DEFINE(__cplusplus)) #endif #ifdef __cplusplus_cli # pragma message(TO_DEFINE(__cplusplus_cli)) #endif #ifdef __cplusplus_winrt # pragma message(TO_DEFINE(__cplusplus_winrt)) #endif #pragma message("class type_info;") CastXML-0.2.0/share/castxml/empty.c000066400000000000000000000000001345607646000170440ustar00rootroot00000000000000CastXML-0.2.0/share/castxml/empty.cpp000066400000000000000000000000001345607646000174040ustar00rootroot00000000000000CastXML-0.2.0/src/000077500000000000000000000000001345607646000135665ustar00rootroot00000000000000CastXML-0.2.0/src/CMakeLists.txt000066400000000000000000000037371345607646000163400ustar00rootroot00000000000000#============================================================================= # Copyright Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= # Tell executables in the build tree where to find the source tree. configure_file( "SourceDir.txt.in" "${CastXML_BINARY_DIR}/CMakeFiles/castxmlSourceDir.txt" @ONLY ) # Tell executables in the build tree where to find Clang resources. configure_file( "ClangResourceDir.txt.in" "${CastXML_BINARY_DIR}/CMakeFiles/castxmlClangResourceDir.txt" @ONLY ) # Configure version number for C++ code. configure_file( "Version.h.in" "${CastXML_BINARY_DIR}/src/Version.h" @ONLY ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(clang_libs clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangEdit clangAST clangLex clangBasic ) set(llvm_libs native option bitreader support ${LLVM_TARGETS_TO_BUILD} ) add_executable(castxml castxml.cxx Detect.cxx Detect.h Options.h Output.cxx Output.h RunClang.cxx RunClang.h Utils.cxx Utils.h ) if(LLVM_LINK_LLVM_DYLIB) set(USE_SHARED USE_SHARED) endif() llvm_config(castxml ${USE_SHARED} ${llvm_libs}) target_link_libraries(castxml PRIVATE ${clang_libs}) set_property(SOURCE Utils.cxx APPEND PROPERTY COMPILE_DEFINITIONS "CASTXML_INSTALL_DATA_DIR=\"${CastXML_INSTALL_DATA_DIR}\"") install(TARGETS castxml DESTINATION ${CastXML_INSTALL_RUNTIME_DIR}) CastXML-0.2.0/src/ClangResourceDir.txt.in000066400000000000000000000000251345607646000201240ustar00rootroot00000000000000@CLANG_RESOURCE_DIR@ CastXML-0.2.0/src/Detect.cxx000066400000000000000000000152111345607646000155220ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "Detect.h" #include "Options.h" #include "Utils.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Host.h" #include #include #include #include static std::string getClangBuiltinIncludeDir() { return getClangResourceDir() + "/include"; } static bool failedCC(const char* id, std::vector const& args, std::string const& out, std::string const& err, std::string const& msg) { std::cerr << "error: '--castxml-cc-" << id << "' compiler command failed:\n\n"; for (std::vector::const_iterator i = args.begin(), e = args.end(); i != e; ++i) { std::cerr << " '" << *i << "'"; } std::cerr << "\n"; if (!msg.empty()) { std::cerr << msg << "\n"; } else { std::cerr << out << "\n"; std::cerr << err << "\n"; } return false; } static void fixPredefines(Options& opts) { // Remove any detected conflicting definition of a Clang builtin macro. std::string& pd = opts.Predefines; std::string::size_type beg = 0; while ((beg = pd.find("#define __has", beg), beg != std::string::npos)) { std::string::size_type end = pd.find('\n', beg); if (end != std::string::npos) { pd.erase(beg, end + 1 - beg); } else { pd.erase(beg); } } } static void setTriple(Options& opts) { std::string const& pd = opts.Predefines; llvm::Triple triple(llvm::sys::getDefaultTargetTriple()); if (pd.find("#define __x86_64__ 1") != pd.npos || pd.find("#define _M_X64 ") != pd.npos) { triple.setArchName("x86_64"); } else if (pd.find("#define __amd64__ 1") != pd.npos || pd.find("#define _M_AMD64 ") != pd.npos) { triple.setArchName("amd64"); } else if (pd.find("#define __i386__ 1") != pd.npos || pd.find("#define _M_IX86 ") != pd.npos) { triple.setArchName("i386"); } if (pd.find("#define _WIN32 1") != pd.npos) { triple.setVendorName("pc"); triple.setOSName("windows"); } if (pd.find("#define __MINGW32__ 1") != pd.npos) { triple.setEnvironmentName("gnu"); } opts.Triple = triple.getTriple(); } static bool detectCC_GNU(const char* const* argBeg, const char* const* argEnd, Options& opts, const char* id, const char* ext) { std::string const fwExplicitSuffix = " (framework directory)"; std::string const fwImplicitSuffix = "/Frameworks"; std::vector cc_args(argBeg, argEnd); std::string empty_cpp = getResourceDir() + "/empty." + ext; int ret; std::string out; std::string err; std::string msg; cc_args.push_back("-E"); cc_args.push_back("-dM"); cc_args.push_back("-v"); cc_args.push_back(empty_cpp.c_str()); if (runCommand(int(cc_args.size()), &cc_args[0], ret, out, err, msg) && ret == 0) { opts.Predefines = out; const char* start_line = "#include <...> search starts here:"; if (const char* c = strstr(err.c_str(), start_line)) { if ((c = strchr(c, '\n'), c++)) { while (*c++ == ' ') { if (const char* e = strchr(c, '\n')) { const char* s = c; c = e + 1; if (*(e - 1) == '\r') { --e; } std::string inc(s, e - s); std::replace(inc.begin(), inc.end(), '\\', '/'); bool fw = ((inc.size() > fwExplicitSuffix.size()) && (inc.substr(inc.size() - fwExplicitSuffix.size()) == fwExplicitSuffix)); if (fw) { inc = inc.substr(0, inc.size() - fwExplicitSuffix.size()); } else { fw = ((inc.size() > fwImplicitSuffix.size()) && (inc.substr(inc.size() - fwImplicitSuffix.size()) == fwImplicitSuffix)); } // Replace the compiler builtin include directory with ours. if (!fw && llvm::sys::fs::exists(inc + "/emmintrin.h")) { inc = getClangBuiltinIncludeDir(); } opts.Includes.push_back(Options::Include(inc, fw)); } } } } fixPredefines(opts); setTriple(opts); return true; } else { return failedCC(id, cc_args, out, err, msg); } } static bool detectCC_MSVC(const char* const* argBeg, const char* const* argEnd, Options& opts, const char* id, const char* ext) { std::vector cc_args(argBeg, argEnd); std::string detect_vs_cpp = getResourceDir() + "/detect_vs." + ext; int ret; std::string out; std::string err; std::string msg; cc_args.push_back("-c"); cc_args.push_back("-FoNUL"); cc_args.push_back(detect_vs_cpp.c_str()); if (runCommand(int(cc_args.size()), &cc_args[0], ret, out, err, msg) && ret == 0) { if (const char* predefs = strstr(out.c_str(), "\n#define")) { opts.Predefines = predefs + 1; } if (const char* includes_str = std::getenv("INCLUDE")) { llvm::SmallVector includes; llvm::StringRef includes_ref(includes_str); includes_ref.split(includes, ";", -1, false); for (llvm::StringRef i : includes) { if (!i.empty()) { std::string inc = i; std::replace(inc.begin(), inc.end(), '\\', '/'); opts.Includes.push_back(inc); } } } fixPredefines(opts); setTriple(opts); return true; } else { return failedCC(id, cc_args, out, err, msg); } } bool detectCC(const char* id, const char* const* argBeg, const char* const* argEnd, Options& opts) { if (strcmp(id, "gnu") == 0) { return detectCC_GNU(argBeg, argEnd, opts, id, "cpp"); } else if (strcmp(id, "gnu-c") == 0) { return detectCC_GNU(argBeg, argEnd, opts, id, "c"); } else if (strcmp(id, "msvc") == 0) { return detectCC_MSVC(argBeg, argEnd, opts, id, "cpp"); } else if (strcmp(id, "msvc-c") == 0) { return detectCC_MSVC(argBeg, argEnd, opts, id, "c"); } else { std::cerr << "error: '--castxml-cc-" << id << "' not known!\n"; return false; } } CastXML-0.2.0/src/Detect.h000066400000000000000000000015161345607646000151520ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef CASTXML_DETECT_H #define CASTXML_DETECT_H struct Options; /// detectCC - Detect settings from given compiler command. bool detectCC(const char* id, const char* const* argBeg, const char* const* argEnd, Options& opts); #endif // CASTXML_DETECT_H CastXML-0.2.0/src/Options.h000066400000000000000000000025121345607646000153720ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef CASTXML_OPTIONS_H #define CASTXML_OPTIONS_H #include #include struct Options { Options() : PPOnly(false) , GccXml(false) , CastXml(false) , HaveCC(false) , HaveStd(false) , HaveTarget(false) , CastXmlEpicFormatVersion(1) { } bool PPOnly; bool GccXml; bool CastXml; bool HaveCC; bool HaveStd; bool HaveTarget; unsigned int CastXmlEpicFormatVersion; struct Include { Include(std::string const& d, bool f = false) : Directory(d) , Framework(f) { } std::string Directory; bool Framework; }; std::string OutputFile; std::vector Includes; std::string Predefines; std::string Triple; std::vector StartNames; }; #endif // CASTXML_OPTIONS_H CastXML-0.2.0/src/Output.cxx000066400000000000000000002142421345607646000156170ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "Output.h" #include "Options.h" #include "Utils.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclFriend.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclOpenMP.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/Mangle.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/RecordLayout.h" #include "clang/Basic/Specifiers.h" #include "clang/Basic/TargetInfo.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Lex/Preprocessor.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/raw_ostream.h" #include #include #include #include #include #include class ASTVisitorBase { protected: clang::CompilerInstance& CI; clang::ASTContext const& CTX; llvm::raw_ostream& OS; ASTVisitorBase(clang::CompilerInstance& ci, clang::ASTContext const& ctx, llvm::raw_ostream& os) : CI(ci) , CTX(ctx) , OS(os) { } // Represent cv qualifier state of one dump node. struct DumpQual { private: typedef void (DumpQual::*bool_type)() const; void bool_true() const {} public: bool IsConst; bool IsVolatile; bool IsRestrict; DumpQual() : IsConst(false) , IsVolatile(false) , IsRestrict(false) { } operator bool_type() const { return (this->IsConst || this->IsVolatile || this->IsRestrict) ? &DumpQual::bool_true : nullptr; } friend bool operator<(DumpQual const& l, DumpQual const& r) { if (!l.IsConst && r.IsConst) { return true; } else if (l.IsConst && !r.IsConst) { return false; } else if (!l.IsVolatile && r.IsVolatile) { return true; } else if (l.IsVolatile && !r.IsVolatile) { return false; } else if (!l.IsRestrict && r.IsRestrict) { return true; } else if (l.IsRestrict && !r.IsRestrict) { return false; } else { return false; } } friend llvm::raw_ostream& operator<<(llvm::raw_ostream& os, DumpQual const& dq) { return os << (dq.IsConst ? "c" : "") << (dq.IsVolatile ? "v" : "") << (dq.IsRestrict ? "r" : ""); } }; // Represent id of one dump node. struct DumpId { private: typedef void (DumpId::*bool_type)() const; void bool_true() const {} public: unsigned int Id; DumpQual Qual; DumpId() : Id(0) , Qual() { } DumpId(unsigned int id, DumpQual dq) : Id(id) , Qual(dq) { } operator bool_type() const { return this->Id != 0 ? &DumpId::bool_true : nullptr; } friend bool operator<(DumpId const& l, DumpId const& r) { if (l.Id < r.Id) { return true; } else if (l.Id > r.Id) { return false; } else { return l.Qual < r.Qual; } } friend llvm::raw_ostream& operator<<(llvm::raw_ostream& os, DumpId const& id) { return os << id.Id << id.Qual; } }; // Record status of one AST node to be dumped. struct DumpNode { DumpNode() : Index() , Complete(false) { } // Index in nodes ordered by first encounter. DumpId Index; // Whether the node is to be traversed completely. bool Complete; }; // Report all decl nodes as unimplemented until overridden. #define ABSTRACT_DECL(DECL) #define DECL(CLASS, BASE) \ void Output##CLASS##Decl(clang::CLASS##Decl const* d, DumpNode const* dn) \ { \ this->OutputUnimplementedDecl(d, dn); \ } #include "clang/AST/DeclNodes.inc" void OutputUnimplementedDecl(clang::Decl const* d, DumpNode const* dn) { /* clang-format off */ this->OS << " Index << "\" kind=\"" << encodeXML(d->getDeclKindName()) << "\"/>\n"; /* clang-format on */ } // Report all type nodes as unimplemented until overridden. #define ABSTRACT_TYPE(CLASS, BASE) #define TYPE(CLASS, BASE) \ void Output##CLASS##Type(clang::CLASS##Type const* t, DumpNode const* dn) \ { \ this->OutputUnimplementedType(t, dn); \ } #include "clang/AST/TypeNodes.def" void OutputUnimplementedType(clang::Type const* t, DumpNode const* dn) { /* clang-format off */ this->OS << " Index << "\" type_class=\"" << encodeXML(t->getTypeClassName()) << "\"/>\n"; /* clang-format on */ } }; class ASTVisitor : public ASTVisitorBase { // Store a type to be visited, possibly as a record member. struct DumpType { DumpType() : Type() , Class(0) { } DumpType(clang::QualType t, clang::Type const* c = 0) : Type(t) , Class(c) { } friend bool operator<(DumpType const& l, DumpType const& r) { // Order by pointer value without discarding low-order // bits used to encode qualifiers. void const* lpp = &l.Type; void const* rpp = &r.Type; void const* lpv = *static_cast(lpp); void const* rpv = *static_cast(rpp); if (lpv < rpv) { return true; } else if (lpv > rpv) { return false; } else { return l.Class < r.Class; } } clang::QualType Type; clang::Type const* Class; }; // Store an entry in the node traversal queue. struct QueueEntry { // Available node kinds. enum Kinds { KindQual, KindDecl, KindType }; QueueEntry(DumpNode const* dn) : Kind(KindQual) , Decl(nullptr) , Type() , DN(dn) { } QueueEntry(clang::Decl const* d, DumpNode const* dn) : Kind(KindDecl) , Decl(d) , Type() , DN(dn) { } QueueEntry(DumpType t, DumpNode const* dn) : Kind(KindType) , Decl(nullptr) , Type(t) , DN(dn) { } // Kind of node at this entry. Kinds Kind; // The declaration when Kind == KindDecl. clang::Decl const* Decl; // The type when Kind == KindType. DumpType Type; // The dump status for this node. DumpNode const* DN; friend bool operator<(QueueEntry const& l, QueueEntry const& r) { return l.DN->Index < r.DN->Index; } }; class PrinterHelper : public clang::PrinterHelper { ASTVisitor& Visitor; public: PrinterHelper(ASTVisitor& v) : Visitor(v) { } bool handledStmt(clang::Stmt* s, llvm::raw_ostream& os) override { return this->Visitor.PrintHelpStmt(s, os); } }; /** Get the dump status node for a Clang declaration. */ DumpNode* GetDumpNode(clang::Decl const* d) { return &this->DeclNodes[d]; } /** Get the dump status node for a Clang type. */ DumpNode* GetDumpNode(DumpType t) { return &this->TypeNodes[t]; } /** Get the dump status node for a qualified DumpId. */ DumpNode* GetDumpNode(DumpId id) { assert(id.Qual); return &this->QualNodes[id]; } /** Allocate a dump node for a Clang declaration. */ DumpId AddDeclDumpNode(clang::Decl const* d, bool complete, bool forType = false); DumpId AddDeclDumpNodeForType(clang::Decl const* d, bool complete, DumpQual dq); /** Allocate a dump node for a Clang type. */ DumpId AddTypeDumpNode(DumpType dt, bool complete, DumpQual dq = DumpQual()); /** Allocate a dump node for a qualified DumpId. */ DumpId AddQualDumpNode(DumpId id); /** Helper common to AddDeclDumpNode and AddTypeDumpNode. */ template DumpId AddDumpNodeImpl(K k, bool complete); /** Allocate a dump node for a source file entry. */ unsigned int AddDumpFile(clang::FileEntry const* f); /** Add class template specializations and instantiations for output. */ void AddClassTemplateDecl(clang::ClassTemplateDecl const* d, std::set* emitted = 0); /** Add function template specializations and instantiations for output. */ void AddFunctionTemplateDecl(clang::FunctionTemplateDecl const* d, std::set* emitted = 0); /** Add declaration context members for output. */ void AddDeclContextMembers(clang::DeclContext const* dc, std::set& emitted); /** Add a starting declaration for output. */ void AddStartDecl(clang::Decl const* d); /** Queue leftover nodes that do not need complete output. */ void QueueIncompleteDumpNodes(); /** Traverse AST nodes until the queue is empty. */ void ProcessQueue(); void ProcessFileQueue(); /** Output start tags on top of xml file. */ void OutputStartXMLTags(); /** Output end tags. */ void OutputEndXMLTags(); /** Dispatch output of a declaration. */ void OutputDecl(clang::Decl const* d, DumpNode const* dn); /** Dispatch output of a qualified or unqualified type. */ void OutputType(DumpType dt, DumpNode const* dn); /** Output a qualified type. */ void OutputCvQualifiedType(DumpNode const* dn); /** Get the XML IDREF for the element defining the given declaration context (namespace, class, etc.). */ DumpId GetContextIdRef(clang::DeclContext const* dc); /** Return the unqualified name of the declaration context (class, struct, union) of the given method. */ std::string GetContextName(clang::CXXMethodDecl const* d); /** Print the XML IDREF value referencing the given type. If the type has top-level cv-qualifiers, they are appended to the numeric id as single characters (c=const, v=volatile, r=restrict) to reference the XML ID of a CvQualifiedType element describing the qualifiers and referencing the unqualified type. */ void PrintTypeIdRef(clang::QualType t, bool complete); /** Print an id="_" XML unique ID attribute. */ void PrintIdAttribute(DumpNode const* dn); /** Print a name="..." attribute. */ void PrintNameAttribute(std::string const& name); /** Print a mangled="..." attribute. */ void PrintMangledAttribute(clang::NamedDecl const* d); /** Print an offset="..." attribute. */ void PrintOffsetAttribute(unsigned int const& offset); /** Print size="..." and align="..." attributes. */ void PrintABIAttributes(clang::TypeInfo const& t); void PrintABIAttributes(clang::TypeDecl const* d); /** Print a basetype="..." attribute with the XML IDREF for the given type. Also queues the given type for later output. */ void PrintBaseTypeAttribute(clang::Type const* c, bool complete); /** Print a type="..." attribute with the XML IDREF for the given (possibly cv-qualified) type. Also queues the given type for later output. */ void PrintTypeAttribute(clang::QualType t, bool complete); /** Print a returns="..." attribute with the XML IDREF for the given (possibly cv-qualified) type. Also queue the given type for later output. */ void PrintReturnsAttribute(clang::QualType t, bool complete); /** Print the XML attributes location="fid:line" file="fid" line="line" for the given decl. */ void PrintLocationAttribute(clang::Decl const* d); /** Print a members="..." attribute listing the XML IDREFs for members of the given declaration context. Also queues the context members for later output. */ void PrintMembersAttribute(clang::DeclContext const* dc); void PrintMembersAttribute(std::set const& emitted); /** Print a bases="..." attribute listing the XML IDREFs for bases of the given class type. Also queues the base classes for later output. */ void PrintBasesAttribute(clang::CXXRecordDecl const* dx); /** Print an attributes="..." attribute listing the given attributes. */ void PrintAttributesAttribute(std::vector const& attrs); /** Print an attributes="..." attribute listing the given declaration's attributes. */ void PrintAttributesAttribute(clang::Decl const* d); /** Get the attributes of the given function type. */ void GetFunctionTypeAttributes(clang::FunctionProtoType const* t, std::vector& attrs); /** Get the attributes of the given declaration. */ void GetDeclAttributes(clang::Decl const* d, std::vector& attrs); /** Print a throw="..." attribute listing the XML IDREFs for the types that the given function prototype declares in the throw() specification. */ void PrintThrowsAttribute(clang::FunctionProtoType const* fpt, bool complete); /** Print a befriending="..." attribute listing the XML IDREFs for friends of the given class. Also queues the friends for later output. */ void PrintBefriendingAttribute(clang::CXXRecordDecl const* dx); /** Flags used by function output methods to pass information to the OutputFunctionHelper method. */ enum FunctionHelperFlags { FH_Returns = (1 << 0), FH_Static = (1 << 1), FH_Explicit = (1 << 2), FH_Const = (1 << 3), FH_Virtual = (1 << 4), FH_Pure = (1 << 5), FH__Last }; /** Output a function element using the name and flags given by the caller. This encompasses functionality common to all the function declaration output methods. */ void OutputFunctionHelper( clang::FunctionDecl const* d, DumpNode const* dn, const char* tag, unsigned int flags, llvm::Optional const& name = llvm::Optional()); /** Output a function type element using the tag given by the caller. This encompasses functionality common to all the function type output methods. */ void OutputFunctionTypeHelper(clang::FunctionProtoType const* t, DumpNode const* dn, const char* tag, clang::Type const* c); /** Output an element inside a function element. */ void OutputFunctionArgument(clang::ParmVarDecl const* a, bool complete, clang::Expr const* def); /** Print some statements (expressions) in a custom form. */ bool PrintHelpStmt(clang::Stmt const* s, llvm::raw_ostream& os); /** Print an access="..." attribute. */ void PrintAccessAttribute(clang::AccessSpecifier as); /** Print a context="..." attribute with the XML IDREF for the containing declaration context (namespace, class, etc.). Also prints access="..." attribute for class members to indicate public, protected, or private membership. */ void PrintContextAttribute(clang::Decl const* d, clang::AccessSpecifier alt = clang::AS_none); bool HaveFloat128Type() const; void PrintFloat128Type(DumpNode const* dn); // Decl node output methods. void OutputTranslationUnitDecl(clang::TranslationUnitDecl const* d, DumpNode const* dn); void OutputNamespaceDecl(clang::NamespaceDecl const* d, DumpNode const* dn); void OutputRecordDecl(clang::RecordDecl const* d, DumpNode const* dn); void OutputCXXRecordDecl(clang::CXXRecordDecl const* d, DumpNode const* dn); void OutputClassTemplateSpecializationDecl( clang::ClassTemplateSpecializationDecl const* d, DumpNode const* dn); void OutputTypedefDecl(clang::TypedefDecl const* d, DumpNode const* dn); void OutputTypeAliasDecl(clang::TypeAliasDecl const* d, DumpNode const* dn); void OutputEnumDecl(clang::EnumDecl const* d, DumpNode const* dn); void OutputFieldDecl(clang::FieldDecl const* d, DumpNode const* dn); void OutputVarDecl(clang::VarDecl const* d, DumpNode const* dn); void OutputFunctionDecl(clang::FunctionDecl const* d, DumpNode const* dn); void OutputCXXMethodDecl(clang::CXXMethodDecl const* d, DumpNode const* dn); void OutputCXXConversionDecl(clang::CXXConversionDecl const* d, DumpNode const* dn); void OutputCXXConstructorDecl(clang::CXXConstructorDecl const* d, DumpNode const* dn); void OutputCXXDestructorDecl(clang::CXXDestructorDecl const* d, DumpNode const* dn); // Type node output methods. void OutputBuiltinType(clang::BuiltinType const* t, DumpNode const* dn); void OutputConstantArrayType(clang::ConstantArrayType const* t, DumpNode const* dn); void OutputIncompleteArrayType(clang::IncompleteArrayType const* t, DumpNode const* dn); void OutputFunctionProtoType(clang::FunctionProtoType const* t, DumpNode const* dn); void OutputLValueReferenceType(clang::LValueReferenceType const* t, DumpNode const* dn); void OutputMemberPointerType(clang::MemberPointerType const* t, DumpNode const* dn); void OutputMethodType(clang::FunctionProtoType const* t, clang::Type const* c, DumpNode const* dn); void OutputOffsetType(clang::QualType t, clang::Type const* c, DumpNode const* dn); void OutputPointerType(clang::PointerType const* t, DumpNode const* dn); void OutputElaboratedType(clang::ElaboratedType const* t, DumpNode const* dn); /** Queue declarations matching given qualified name in given context. */ void LookupStart(clang::DeclContext const* dc, std::string const& name); private: // List of starting declaration names. Options const& Opts; // Total number of nodes to be dumped. unsigned int NodeCount; // Total number of source files to be referenced. unsigned int FileCount; // Whether we need a File element for compiler builtins. bool FileBuiltin; // Whether we are in the complete or incomplete output step. bool RequireComplete; // Mangling context for target ABI. std::unique_ptr MangleContext; // Control declaration and type printing. clang::PrintingPolicy PrintingPolicy; // Map from clang AST declaration node to our dump status node. typedef std::map DeclNodesMap; DeclNodesMap DeclNodes; // Map from clang AST type node to our dump status node. typedef std::map TypeNodesMap; TypeNodesMap TypeNodes; // Map from qualified DumpId to our dump status node. typedef std::map QualNodesMap; QualNodesMap QualNodes; // Map from clang file entry to our source file index. typedef std::map FileNodesMap; FileNodesMap FileNodes; // Node traversal queue. std::set Queue; // File traversal queue. std::queue FileQueue; public: ASTVisitor(clang::CompilerInstance& ci, clang::ASTContext& ctx, llvm::raw_ostream& os, Options const& opts) : ASTVisitorBase(ci, ctx, os) , Opts(opts) , NodeCount(0) , FileCount(0) , FileBuiltin(false) , RequireComplete(true) , MangleContext(ctx.createMangleContext()) , PrintingPolicy(ctx.getPrintingPolicy()) { this->PrintingPolicy.SuppressUnwrittenScope = true; } /** Visit declarations in the given translation unit. This is the main entry point. */ void HandleTranslationUnit(clang::TranslationUnitDecl const* tu); }; ASTVisitor::DumpId ASTVisitor::AddDeclDumpNode(clang::Decl const* d, bool complete, bool forType) { // Select the definition or canonical declaration. d = d->getCanonicalDecl(); if (clang::RecordDecl const* rd = clang::dyn_cast(d)) { if (clang::RecordDecl const* rdd = rd->getDefinition()) { d = rdd; } } // Replace some decls with those they reference. switch (d->getKind()) { case clang::Decl::UsingShadow: return this->AddDeclDumpNode( static_cast(d)->getTargetDecl(), complete, forType); case clang::Decl::LinkageSpec: { clang::DeclContext const* dc = static_cast(d)->getDeclContext(); return this->AddDeclDumpNode(clang::Decl::castFromDeclContext(dc), complete, forType); } break; default: break; } // Skip invalid declarations that are not needed for a type element. if (d->isInvalidDecl() && !forType) { return DumpId(); } // Skip C++11 declarations gccxml does not support. if (this->Opts.GccXml || this->Opts.CastXml) { if (clang::FunctionDecl const* fd = clang::dyn_cast(d)) { if (fd->isDeleted()) { return DumpId(); } if (fd->getLiteralIdentifier()) { return DumpId(); } if (clang::FunctionProtoType const* fpt = fd->getType()->getAs()) { if (fpt->getReturnType()->isRValueReferenceType()) { return DumpId(); } for (clang::FunctionProtoType::param_type_iterator i = fpt->param_type_begin(), e = fpt->param_type_end(); i != e; ++i) { if ((*i)->isRValueReferenceType()) { return DumpId(); } } } } if (clang::dyn_cast(d)) { return DumpId(); } if (clang::TypedefDecl const* td = clang::dyn_cast(d)) { if (td->getUnderlyingType()->isRValueReferenceType()) { return DumpId(); } } } return this->AddDumpNodeImpl(d, complete); } ASTVisitor::DumpId ASTVisitor::AddDeclDumpNodeForType(clang::Decl const* d, bool complete, DumpQual dq) { // Get the id for the canonical decl. DumpId id = this->AddDeclDumpNode(d, complete, true); // If any qualifiers were collected through layers of desugaring // then get the id of the qualified type referencing this decl. if (id && dq) { id = this->AddQualDumpNode(DumpId(id.Id, dq)); } return id; } ASTVisitor::DumpId ASTVisitor::AddTypeDumpNode(DumpType dt, bool complete, DumpQual dq) { clang::QualType t = dt.Type; clang::Type const* c = dt.Class; // Extract local qualifiers and recurse with locally unqualified type. if (t.hasLocalQualifiers()) { dq.IsConst = dq.IsConst || t.isLocalConstQualified(); dq.IsVolatile = dq.IsVolatile || t.isLocalVolatileQualified(); dq.IsRestrict = dq.IsRestrict || t.isLocalRestrictQualified(); return this->AddTypeDumpNode(DumpType(t.getLocalUnqualifiedType(), c), complete, dq); } // Replace some types with their decls. switch (t->getTypeClass()) { case clang::Type::Adjusted: return this->AddTypeDumpNode( DumpType(t->getAs()->getAdjustedType(), c), complete, dq); case clang::Type::Attributed: return this->AddTypeDumpNode( DumpType(t->getAs()->getEquivalentType(), c), complete, dq); case clang::Type::Auto: { clang::AutoType const* at = t->getAs(); if (at->isSugared()) { return this->AddTypeDumpNode(DumpType(at->desugar(), c), complete, dq); } } break; case clang::Type::Decayed: return this->AddTypeDumpNode( DumpType(t->getAs()->getDecayedType(), c), complete, dq); case clang::Type::Decltype: if (this->Opts.CastXml && t->isNullPtrType()) { clang::DecltypeType const* dtt = t->getAs(); if (dtt->getUnderlyingExpr()->getStmtClass() == clang::Stmt::CXXNullPtrLiteralExprClass) { // Treat literal 'decltype(nullptr)' as a FundamentalType. return this->AddTypeDumpNode(DumpType(dtt->getUnderlyingType(), c), complete, dq); } } break; case clang::Type::Elaborated: if (this->Opts.GccXml || !t->isElaboratedTypeSpecifier()) { return this->AddTypeDumpNode( DumpType(t->getAs()->getNamedType(), c), complete, dq); } break; case clang::Type::Enum: return this->AddDeclDumpNodeForType( t->getAs()->getDecl(), complete, dq); case clang::Type::Paren: return this->AddTypeDumpNode( DumpType(t->getAs()->getInnerType(), c), complete, dq); case clang::Type::Record: return this->AddDeclDumpNodeForType( t->getAs()->getDecl(), complete, dq); case clang::Type::SubstTemplateTypeParm: return this->AddTypeDumpNode( DumpType( t->getAs()->getReplacementType(), c), complete, dq); case clang::Type::TemplateSpecialization: { clang::TemplateSpecializationType const* tst = t->getAs(); if (tst->isSugared()) { return this->AddTypeDumpNode(DumpType(tst->desugar(), c), complete, dq); } } break; case clang::Type::Typedef: { clang::TypedefType const* tdt = t->getAs(); if (!tdt->isInstantiationDependentType() && tdt->isSugared()) { // Make sure all containing contexts are not templates. clang::Decl const* d = tdt->getDecl(); while (clang::DeclContext const* tdc = d->getDeclContext()) { if (clang::CXXRecordDecl const* tdx = clang::dyn_cast(tdc)) { d = tdx; if (tdx->getDescribedClassTemplate() || clang::isa( tdx)) { // This TypedefType refers to a non-dependent // TypedefDecl member of a class template. Since gccxml // format does not include uninstantiated templates we // must use the desugared type so that we do not end up // referencing a class template as context. return this->AddTypeDumpNode(tdt->desugar(), complete, dq); } } else { break; } } } return this->AddDeclDumpNodeForType(tdt->getDecl(), complete, dq); } break; default: break; } // Get the id for the fully desugared, unqualified type. DumpId id = this->AddDumpNodeImpl(dt, complete); // If any qualifiers were collected through layers of desugaring // then get the id of the qualified type. if (id && dq) { id = this->AddQualDumpNode(DumpId(id.Id, dq)); } return id; } ASTVisitor::DumpId ASTVisitor::AddQualDumpNode(DumpId id) { DumpNode* dn = this->GetDumpNode(id); if (!dn->Index) { dn->Index = id; // Always treat CvQualifiedType nodes as complete. dn->Complete = true; this->Queue.insert(QueueEntry(dn)); } return dn->Index; } template ASTVisitor::DumpId ASTVisitor::AddDumpNodeImpl(K k, bool complete) { // Update an existing node or add one. DumpNode* dn = this->GetDumpNode(k); if (dn->Index) { // Node was already encountered. See if it is now complete. if (complete && !dn->Complete) { // Node is now complete, but wasn't before. Queue it. dn->Complete = true; this->Queue.insert(QueueEntry(k, dn)); } } else { // This is a new node. Assign it an index. dn->Index.Id = ++this->NodeCount; dn->Complete = complete; if (complete || !this->RequireComplete) { // Node is complete. Queue it. this->Queue.insert(QueueEntry(k, dn)); } } // Return node's index. return dn->Index; } unsigned int ASTVisitor::AddDumpFile(clang::FileEntry const* f) { unsigned int& index = this->FileNodes[f]; if (index == 0) { index = ++this->FileCount; this->FileQueue.push(f); } return index; } void ASTVisitor::AddClassTemplateDecl(clang::ClassTemplateDecl const* d, std::set* emitted) { // Queue all the instantiations of this class template. for (clang::ClassTemplateDecl::spec_iterator i = d->spec_begin(), e = d->spec_end(); i != e; ++i) { clang::CXXRecordDecl const* rd = *i; DumpId id = this->AddDeclDumpNode(rd, true); if (id && emitted) { emitted->insert(id); } } } void ASTVisitor::AddFunctionTemplateDecl(clang::FunctionTemplateDecl const* d, std::set* emitted) { // Queue all the instantiations of this function template. for (clang::FunctionTemplateDecl::spec_iterator i = d->spec_begin(), e = d->spec_end(); i != e; ++i) { clang::FunctionDecl const* fd = *i; DumpId id = this->AddDeclDumpNode(fd, true); if (id && emitted) { emitted->insert(id); } } } void ASTVisitor::AddDeclContextMembers(clang::DeclContext const* dc, std::set& emitted) { bool const isTranslationUnit = clang::isa(dc); for (clang::DeclContext::decl_iterator i = dc->decls_begin(), e = dc->decls_end(); i != e; ++i) { clang::Decl const* d = *i; // Skip declarations that are not really members of this context. if (d->getDeclContext() != dc) { continue; } // Skip declarations that we use internally as builtins. if (isTranslationUnit) { if (clang::NamedDecl const* nd = clang::dyn_cast(d)) { if (clang::IdentifierInfo const* ii = nd->getIdentifier()) { if (ii->getName().find("__castxml") != std::string::npos) { continue; } } } } // Ignore certain members. switch (d->getKind()) { case clang::Decl::CXXRecord: { clang::CXXRecordDecl const* rd = static_cast(d); if (rd->isInjectedClassName()) { continue; } } break; case clang::Decl::AccessSpec: { continue; } break; case clang::Decl::ClassTemplate: { this->AddClassTemplateDecl( static_cast(d), &emitted); continue; } break; case clang::Decl::ClassTemplatePartialSpecialization: { continue; } break; case clang::Decl::Empty: { continue; } break; case clang::Decl::Friend: { continue; } break; case clang::Decl::FunctionTemplate: { this->AddFunctionTemplateDecl( static_cast(d), &emitted); continue; } break; case clang::Decl::LinkageSpec: { this->AddDeclContextMembers( static_cast(d), emitted); continue; } break; case clang::Decl::Namespace: { clang::NamespaceDecl const* nd = static_cast(d); if (nd->isInline()) { this->AddDeclContextMembers(nd, emitted); continue; } } break; case clang::Decl::Using: { continue; } break; case clang::Decl::UsingDirective: { continue; } break; default: break; } // Queue this decl and print its id. if (DumpId id = this->AddDeclDumpNode(d, true)) { emitted.insert(id); } } } void ASTVisitor::AddStartDecl(clang::Decl const* d) { switch (d->getKind()) { case clang::Decl::ClassTemplate: this->AddClassTemplateDecl( static_cast(d)); break; case clang::Decl::FunctionTemplate: this->AddFunctionTemplateDecl( static_cast(d)); break; case clang::Decl::Namespace: { if (!static_cast(d)->isInline()) { this->AddDeclDumpNode(d, true); } } break; case clang::Decl::Using: { clang::UsingDecl const* ud = static_cast(d); for (clang::UsingDecl::shadow_iterator i = ud->shadow_begin(), e = ud->shadow_end(); i != e; ++i) { this->AddDeclDumpNode(*i, true); } } break; default: this->AddDeclDumpNode(d, true); break; } } void ASTVisitor::QueueIncompleteDumpNodes() { // Queue declaration nodes that do not need complete output. for (DeclNodesMap::const_iterator i = this->DeclNodes.begin(), e = this->DeclNodes.end(); i != e; ++i) { if (!i->second.Complete) { this->Queue.insert(QueueEntry(i->first, &i->second)); } } // Queue type nodes that do not need complete output. for (TypeNodesMap::const_iterator i = this->TypeNodes.begin(), e = this->TypeNodes.end(); i != e; ++i) { if (!i->second.Complete) { this->Queue.insert(QueueEntry(i->first, &i->second)); } } } void ASTVisitor::ProcessQueue() { // Dispatch each entry in the queue based on its node kind. while (!this->Queue.empty()) { QueueEntry qe = *this->Queue.begin(); this->Queue.erase(this->Queue.begin()); switch (qe.Kind) { case QueueEntry::KindQual: this->OutputCvQualifiedType(qe.DN); break; case QueueEntry::KindDecl: this->OutputDecl(qe.Decl, qe.DN); break; case QueueEntry::KindType: this->OutputType(qe.Type, qe.DN); break; } } } void ASTVisitor::ProcessFileQueue() { if (this->FileBuiltin) { /* clang-format off */ this->OS << " ") << "\"/>\n" ; /* clang-format on */ } while (!this->FileQueue.empty()) { clang::FileEntry const* f = this->FileQueue.front(); this->FileQueue.pop(); /* clang-format off */ this->OS << " FileNodes[f] << "\"" " name=\"" << encodeXML(f->getName()) << "\"" "/>\n" ; /* clang-format on */ } } void ASTVisitor::OutputDecl(clang::Decl const* d, DumpNode const* dn) { // Dispatch output of the declaration. switch (d->getKind()) { #define ABSTRACT_DECL(DECL) #define DECL(CLASS, BASE) \ case clang::Decl::CLASS: \ this->Output##CLASS##Decl(static_cast(d), dn); \ break; #include "clang/AST/DeclNodes.inc" } } void ASTVisitor::OutputType(DumpType dt, DumpNode const* dn) { clang::QualType t = dt.Type; clang::Type const* c = dt.Class; if (c) { // Output the method type. this->OutputMethodType(t->getAs(), c, dn); } else { // Dispatch output of the unqualified type. switch (t->getTypeClass()) { #define ABSTRACT_TYPE(CLASS, BASE) #define TYPE(CLASS, BASE) \ case clang::Type::CLASS: \ this->Output##CLASS##Type( \ static_cast(t.getTypePtr()), dn); \ break; #include "clang/AST/TypeNodes.def" } } } void ASTVisitor::OutputCvQualifiedType(DumpNode const* dn) { DumpId id = dn->Index; // Create a special CvQualifiedType element to hold top-level // cv-qualifiers for a real type node. this->OS << " OS << " type=\"_" << id.Id << "\""; // Add the cv-qualification attributes. if (id.Qual.IsConst) { this->OS << " const=\"1\""; } if (id.Qual.IsVolatile) { this->OS << " volatile=\"1\""; } if (id.Qual.IsRestrict) { this->OS << " restrict=\"1\""; } this->OS << "/>\n"; } ASTVisitor::DumpId ASTVisitor::GetContextIdRef(clang::DeclContext const* dc) { while (dc->isInlineNamespace()) { dc = dc->getParent(); } if (clang::Decl const* d = clang::dyn_cast(dc)) { return this->AddDeclDumpNode(d, false); } else { return DumpId(); } } std::string ASTVisitor::GetContextName(clang::CXXMethodDecl const* d) { clang::DeclContext const* dc = d->getDeclContext(); if (clang::RecordDecl const* rd = clang::dyn_cast(dc)) { return rd->getName().str(); } return ""; } void ASTVisitor::PrintTypeIdRef(clang::QualType t, bool complete) { // Add the type node. DumpId id = this->AddTypeDumpNode(t, complete); // Print the reference. this->OS << "_" << id; } void ASTVisitor::PrintIdAttribute(DumpNode const* dn) { this->OS << " id=\"_" << dn->Index << "\""; } void ASTVisitor::PrintNameAttribute(std::string const& name) { std::string n = stringReplace(name, "__castxml__float128_s", "__float128"); this->OS << " name=\"" << encodeXML(n) << "\""; } void ASTVisitor::PrintMangledAttribute(clang::NamedDecl const* d) { // Compute the mangled name. std::string s; { llvm::raw_string_ostream rso(s); this->MangleContext->mangleName(d, rso); } if (!this->HaveFloat128Type()) { // We cannot mangle __float128 correctly because Clang does not have // it as an internal type, so skip mangled attributes involving it. if (s.find("__float128") != s.npos) { s = ""; } } // Strip a leading 1 byte in MS mangling. if (!s.empty() && s[0] == '\1') { s = s.substr(1); } this->OS << " mangled=\"" << encodeXML(s) << "\""; } void ASTVisitor::PrintOffsetAttribute(unsigned int const& offset) { this->OS << " offset=\"" << offset << "\""; } void ASTVisitor::PrintABIAttributes(clang::TypeDecl const* d) { if (clang::TypeDecl const* td = clang::dyn_cast(d)) { clang::Type const* ty = td->getTypeForDecl(); if (!ty->isIncompleteType()) { this->PrintABIAttributes(this->CTX.getTypeInfo(ty)); } } } void ASTVisitor::PrintABIAttributes(clang::TypeInfo const& t) { this->OS << " size=\"" << t.Width << "\""; this->OS << " align=\"" << t.Align << "\""; } void ASTVisitor::PrintBaseTypeAttribute(clang::Type const* c, bool complete) { this->OS << " basetype=\""; this->PrintTypeIdRef(clang::QualType(c, 0), complete); this->OS << "\""; } void ASTVisitor::PrintTypeAttribute(clang::QualType t, bool complete) { this->OS << " type=\""; this->PrintTypeIdRef(t, complete); this->OS << "\""; } void ASTVisitor::PrintReturnsAttribute(clang::QualType t, bool complete) { this->OS << " returns=\""; this->PrintTypeIdRef(t, complete); this->OS << "\""; } void ASTVisitor::PrintLocationAttribute(clang::Decl const* d) { clang::SourceLocation sl = d->getLocation(); if (sl.isValid()) { clang::FullSourceLoc fsl = this->CTX.getFullLoc(sl).getExpansionLoc(); if (clang::FileEntry const* f = this->CI.getSourceManager().getFileEntryForID(fsl.getFileID())) { unsigned int id = this->AddDumpFile(f); unsigned int line = fsl.getExpansionLineNumber(); /* clang-format off */ this->OS << " location=\"f" << id << ":" << line << "\"" " file=\"f" << id << "\"" " line=\"" << line << "\""; /* clang-format on */ return; } } if (d->isImplicit()) { this->FileBuiltin = true; this->OS << " location=\"f0:0\" file=\"f0\" line=\"0\""; } } bool ASTVisitor::PrintHelpStmt(clang::Stmt const* s, llvm::raw_ostream& os) { switch (s->getStmtClass()) { case clang::Stmt::CStyleCastExprClass: { // Duplicate clang::StmtPrinter::VisitCStyleCastExpr // but with canonical type so we do not print an unqualified name. clang::CStyleCastExpr const* e = static_cast(s); os << "("; e->getTypeAsWritten().getCanonicalType().print(os, this->PrintingPolicy); os << ")"; PrinterHelper ph(*this); e->getSubExpr()->printPretty(os, &ph, this->PrintingPolicy); return true; } break; case clang::Stmt::CXXConstCastExprClass: // fallthrough case clang::Stmt::CXXDynamicCastExprClass: // fallthrough case clang::Stmt::CXXReinterpretCastExprClass: // fallthrough case clang::Stmt::CXXStaticCastExprClass: { // Duplicate clang::StmtPrinter::VisitCXXNamedCastExpr // but with canonical type so we do not print an unqualified name. clang::CXXNamedCastExpr const* e = static_cast(s); os << e->getCastName() << '<'; e->getTypeAsWritten().getCanonicalType().print(os, this->PrintingPolicy); os << ">("; PrinterHelper ph(*this); e->getSubExpr()->printPretty(os, &ph, this->PrintingPolicy); os << ")"; return true; } break; case clang::Stmt::DeclRefExprClass: { // Print the fully qualified name of the referenced declaration. clang::DeclRefExpr const* e = static_cast(s); if (clang::NamedDecl const* d = clang::dyn_cast(e->getDecl())) { std::string s; { llvm::raw_string_ostream rso(s); d->printQualifiedName(rso, this->PrintingPolicy); rso.str(); } if (clang::isa(d)) { // Clang does not exclude the "::" after an unnamed enum type. std::string::size_type pos = s.find("::::"); if (pos != s.npos) { s.erase(pos, 2); } } os << s; return true; } } break; default: break; } return false; } void ASTVisitor::PrintAccessAttribute(clang::AccessSpecifier as) { switch (as) { case clang::AS_private: this->OS << " access=\"private\""; break; case clang::AS_protected: this->OS << " access=\"protected\""; break; case clang::AS_public: this->OS << " access=\"public\""; break; case clang::AS_none: break; } } void ASTVisitor::PrintContextAttribute(clang::Decl const* d, clang::AccessSpecifier alt) { clang::DeclContext const* dc = d->getDeclContext(); if (DumpId id = this->GetContextIdRef(dc)) { this->OS << " context=\"_" << id << "\""; if (dc->isRecord()) { clang::AccessSpecifier as = d->getAccess(); this->PrintAccessAttribute(as != clang::AS_none ? as : alt); } } } void ASTVisitor::PrintMembersAttribute(clang::DeclContext const* dc) { std::set emitted; this->AddDeclContextMembers(dc, emitted); this->PrintMembersAttribute(emitted); } void ASTVisitor::PrintMembersAttribute(std::set const& emitted) { if (!emitted.empty()) { this->OS << " members=\""; const char* sep = ""; for (std::set::const_iterator i = emitted.begin(), e = emitted.end(); i != e; ++i) { this->OS << sep << "_" << *i; sep = " "; } this->OS << "\""; } } void ASTVisitor::PrintBasesAttribute(clang::CXXRecordDecl const* dx) { this->OS << " bases=\""; const char* sep = ""; for (clang::CXXRecordDecl::base_class_const_iterator i = dx->bases_begin(), e = dx->bases_end(); i != e; ++i) { this->OS << sep; sep = " "; switch (i->getAccessSpecifier()) { case clang::AS_private: this->OS << "private:"; break; case clang::AS_protected: this->OS << "protected:"; break; default: break; } this->PrintTypeIdRef(i->getType().getCanonicalType(), true); } this->OS << "\""; } void ASTVisitor::PrintAttributesAttribute( std::vector const& attrs) { if (attrs.empty()) { return; } this->OS << " attributes=\""; const char* sep = ""; for (std::string const& a : attrs) { this->OS << sep << encodeXML(a); sep = " "; } this->OS << "\""; } void ASTVisitor::PrintAttributesAttribute(clang::Decl const* d) { std::vector attributes; this->GetDeclAttributes(d, attributes); this->PrintAttributesAttribute(attributes); } void ASTVisitor::GetFunctionTypeAttributes(clang::FunctionProtoType const* t, std::vector& attrs) { switch (t->getExtInfo().getCC()) { case clang::CallingConv::CC_C: break; case clang::CallingConv::CC_X86StdCall: attrs.push_back("__stdcall__"); break; case clang::CallingConv::CC_X86FastCall: attrs.push_back("__fastcall__"); break; case clang::CallingConv::CC_X86ThisCall: attrs.push_back("__thiscall__"); break; default: break; } } void ASTVisitor::GetDeclAttributes(clang::Decl const* d, std::vector& attrs) { for (auto const* a : d->specific_attrs()) { attrs.push_back("annotate(" + a->getAnnotation().str() + ")"); } if (d->hasAttr()) { attrs.push_back("deprecated"); } if (d->hasAttr()) { attrs.push_back("dllexport"); } if (d->hasAttr()) { attrs.push_back("dllimport"); } } void ASTVisitor::PrintThrowsAttribute(clang::FunctionProtoType const* fpt, bool complete) { if (fpt && fpt->hasDynamicExceptionSpec()) { clang::FunctionProtoType::exception_iterator i = fpt->exception_begin(); clang::FunctionProtoType::exception_iterator e = fpt->exception_end(); this->OS << " throw=\""; const char* sep = ""; for (; i != e; ++i) { this->OS << sep; this->PrintTypeIdRef(*i, complete); sep = " "; } this->OS << "\""; } } void ASTVisitor::PrintBefriendingAttribute(clang::CXXRecordDecl const* dx) { if (dx && dx->hasFriends()) { this->OS << " befriending=\""; const char* sep = ""; for (clang::CXXRecordDecl::friend_iterator i = dx->friend_begin(), e = dx->friend_end(); i != e; ++i) { clang::FriendDecl const* fd = *i; if (clang::NamedDecl const* nd = fd->getFriendDecl()) { if (nd->isTemplateDecl()) { // gccxml output format does not have uninstantiated templates continue; } if (DumpId id = this->AddDeclDumpNode(nd, false)) { this->OS << sep << "_" << id; sep = " "; } } else if (clang::TypeSourceInfo const* tsi = fd->getFriendType()) { this->OS << sep; this->PrintTypeIdRef(tsi->getType(), false); sep = " "; } } this->OS << "\""; } } bool ASTVisitor::HaveFloat128Type() const { #if LLVM_VERSION_MAJOR > 3 || LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 8 return this->CI.getTarget().hasFloat128Type(); #else return false; #endif } void ASTVisitor::PrintFloat128Type(DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->OS << " name=\"__float128\" size=\"128\" align=\"128\"/>\n"; } void ASTVisitor::OutputFunctionHelper(clang::FunctionDecl const* d, DumpNode const* dn, const char* tag, unsigned int flags, llvm::Optional const& name) { this->OS << " <" << tag; this->PrintIdAttribute(dn); if (name) { this->PrintNameAttribute(name.getValue()); } if (flags & FH_Returns) { this->PrintReturnsAttribute(d->getReturnType(), dn->Complete); } this->PrintContextAttribute(d); this->PrintLocationAttribute(d); if (flags & FH_Static) { this->OS << " static=\"1\""; } if (flags & FH_Explicit) { this->OS << " explicit=\"1\""; } if (flags & FH_Const) { this->OS << " const=\"1\""; } if (flags & FH_Virtual) { this->OS << " virtual=\"1\""; } if (flags & FH_Pure) { this->OS << " pure_virtual=\"1\""; } if (d->isInlined()) { this->OS << " inline=\"1\""; } if (d->getStorageClass() == clang::SC_Extern) { this->OS << " extern=\"1\""; } if (d->isImplicit()) { this->OS << " artificial=\"1\""; } if (clang::CXXMethodDecl const* md = clang::dyn_cast(d)) { if (md->size_overridden_methods() > 0) { this->OS << " overrides=\""; const char* sep = ""; for (clang::CXXMethodDecl::method_iterator i = md->begin_overridden_methods(), e = md->end_overridden_methods(); i != e; ++i) { if (DumpId id = this->AddDeclDumpNode(*i, false)) { this->OS << sep << "_" << id; sep = " "; } } this->OS << "\""; } } std::vector attributes; if (clang::FunctionProtoType const* fpt = d->getType()->getAs()) { this->PrintThrowsAttribute(fpt, dn->Complete); if (!clang::isa(d) && !clang::isa(d)) { this->PrintMangledAttribute(d); } this->GetFunctionTypeAttributes(fpt, attributes); } this->GetDeclAttributes(d, attributes); this->PrintAttributesAttribute(attributes); if (unsigned np = d->getNumParams()) { this->OS << ">\n"; for (unsigned i = 0; i < np; ++i) { // Use the default argument from the most recent declaration. // Clang accumulates the defaults and only the last one has // them all. clang::ParmVarDecl const* pd = d->getMostRecentDecl()->getParamDecl(i); clang::Expr const* def = pd->getInit(); if (!def && pd->hasUninstantiatedDefaultArg()) { def = pd->getUninstantiatedDefaultArg(); } // Use the parameter located in the canonical declaration. this->OutputFunctionArgument(d->getParamDecl(i), dn->Complete, def); } if (d->isVariadic()) { this->OS << " \n"; } this->OS << " \n"; } else { this->OS << "/>\n"; } } void ASTVisitor::OutputFunctionTypeHelper(clang::FunctionProtoType const* t, DumpNode const* dn, const char* tag, clang::Type const* c) { this->OS << " <" << tag; this->PrintIdAttribute(dn); if (c) { this->PrintBaseTypeAttribute(c, dn->Complete); } this->PrintReturnsAttribute(t->getReturnType(), dn->Complete); if (t->isConst()) { this->OS << " const=\"1\""; } if (t->isVolatile()) { this->OS << " volatile=\"1\""; } if (t->isRestrict()) { this->OS << " restrict=\"1\""; } std::vector attributes; this->GetFunctionTypeAttributes(t, attributes); this->PrintAttributesAttribute(attributes); if (t->param_type_begin() != t->param_type_end()) { this->OS << ">\n"; for (clang::FunctionProtoType::param_type_iterator i = t->param_type_begin(), e = t->param_type_end(); i != e; ++i) { this->OS << " PrintTypeAttribute(*i, dn->Complete); this->OS << "/>\n"; } if (t->isVariadic()) { this->OS << " \n"; } this->OS << " \n"; } else { this->OS << "/>\n"; } } void ASTVisitor::OutputFunctionArgument(clang::ParmVarDecl const* a, bool complete, clang::Expr const* def) { this->OS << " getName().str(); if (!name.empty()) { this->PrintNameAttribute(name); } this->PrintTypeAttribute(a->getType(), complete); if (a->getOriginalType() != a->getType()) { this->OS << " original_type=\""; this->PrintTypeIdRef(a->getOriginalType(), complete); this->OS << "\""; } this->PrintLocationAttribute(a); if (def) { this->OS << " default=\""; std::string s; llvm::raw_string_ostream rso(s); PrinterHelper ph(*this); def->printPretty(rso, &ph, this->PrintingPolicy); this->OS << encodeXML(rso.str()); this->OS << "\""; } this->PrintAttributesAttribute(a); this->OS << "/>\n"; } void ASTVisitor::OutputTranslationUnitDecl(clang::TranslationUnitDecl const* d, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintNameAttribute("::"); if (dn->Complete) { this->PrintMembersAttribute(d); } this->OS << "/>\n"; } void ASTVisitor::OutputNamespaceDecl(clang::NamespaceDecl const* d, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); std::string name = d->getName().str(); if (!name.empty()) { this->PrintNameAttribute(name); } this->PrintContextAttribute(d); if (dn->Complete) { std::set emitted; for (clang::NamespaceDecl const* r : d->redecls()) { this->AddDeclContextMembers(r, emitted); } this->PrintMembersAttribute(emitted); } this->OS << "/>\n"; } void ASTVisitor::OutputRecordDecl(clang::RecordDecl const* d, DumpNode const* dn) { const char* tag; switch (d->getTagKind()) { case clang::TTK_Class: tag = "Class"; break; case clang::TTK_Union: tag = "Union"; break; case clang::TTK_Struct: tag = "Struct"; break; case clang::TTK_Interface: return; case clang::TTK_Enum: return; } clang::CXXRecordDecl const* dx = clang::dyn_cast(d); bool doBases = false; this->OS << " <" << tag; this->PrintIdAttribute(dn); if (!d->isAnonymousStructOrUnion() && !d->isLambda()) { std::string s; llvm::raw_string_ostream rso(s); d->getNameForDiagnostic(rso, this->PrintingPolicy, false); this->PrintNameAttribute(rso.str()); } clang::AccessSpecifier access = clang::AS_none; if (clang::ClassTemplateSpecializationDecl const* dxts = clang::dyn_cast(d)) { // This is a template instantiation so get the access of the original // template. Access of the instantiation itself has no meaning. if (clang::ClassTemplateDecl const* dxt = dxts->getSpecializedTemplate()) { access = dxt->getAccess(); } } this->PrintContextAttribute(d, access); this->PrintLocationAttribute(d); if (d->getDefinition()) { if (dx && dx->isAbstract()) { this->OS << " abstract=\"1\""; } if (dn->Complete && !d->isInvalidDecl() && !d->isLambda()) { this->PrintMembersAttribute(d); doBases = dx && dx->getNumBases(); if (doBases) { this->PrintBasesAttribute(dx); } this->PrintBefriendingAttribute(dx); } } else { this->OS << " incomplete=\"1\""; } this->PrintABIAttributes(d); this->PrintAttributesAttribute(d); if (doBases) { this->OS << ">\n"; clang::ASTRecordLayout const& layout = this->CTX.getASTRecordLayout(dx); for (clang::CXXRecordDecl::base_class_const_iterator i = dx->bases_begin(), e = dx->bases_end(); i != e; ++i) { clang::QualType bt = i->getType().getCanonicalType(); clang::CXXRecordDecl const* bd = clang::dyn_cast( bt->getAs()->getDecl()); this->OS << " PrintTypeAttribute(bt, true); this->PrintAccessAttribute(i->getAccessSpecifier()); this->OS << " virtual=\"" << (i->isVirtual() ? 1 : 0) << "\""; if (bd && !i->isVirtual()) { this->OS << " offset=\"" << layout.getBaseClassOffset(bd).getQuantity() << "\""; } this->OS << "/>\n"; } this->OS << " \n"; } else { this->OS << "/>\n"; } } void ASTVisitor::OutputCXXRecordDecl(clang::CXXRecordDecl const* d, DumpNode const* dn) { if (d->getDescribedClassTemplate()) { // We do not implement class template output yet. this->ASTVisitorBase::OutputCXXRecordDecl(d, dn); return; } this->OutputRecordDecl(d, dn); } void ASTVisitor::OutputClassTemplateSpecializationDecl( clang::ClassTemplateSpecializationDecl const* d, DumpNode const* dn) { this->OutputCXXRecordDecl(d, dn); } void ASTVisitor::OutputTypedefDecl(clang::TypedefDecl const* d, DumpNode const* dn) { // As a special case, replace our compatibility Typedef for __float128 // with a FundamentalType so we generate the same thing gccxml did. if (d->getName() == "__castxml__float128" && clang::isa(d->getDeclContext())) { clang::SourceLocation sl = d->getLocation(); if (sl.isValid()) { clang::FullSourceLoc fsl = this->CTX.getFullLoc(sl).getExpansionLoc(); if (!this->CI.getSourceManager().getFileEntryForID(fsl.getFileID())) { this->PrintFloat128Type(dn); return; } } } this->OS << " PrintIdAttribute(dn); this->PrintNameAttribute(d->getName().str()); this->PrintTypeAttribute(d->getUnderlyingType(), dn->Complete); this->PrintContextAttribute(d); this->PrintLocationAttribute(d); this->PrintAttributesAttribute(d); this->OS << "/>\n"; } void ASTVisitor::OutputTypeAliasDecl(clang::TypeAliasDecl const* d, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintNameAttribute(d->getName().str()); this->PrintTypeAttribute(d->getUnderlyingType(), dn->Complete); this->PrintContextAttribute(d); this->PrintLocationAttribute(d); this->PrintAttributesAttribute(d); this->OS << "/>\n"; } void ASTVisitor::OutputEnumDecl(clang::EnumDecl const* d, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); std::string name = d->getName().str(); if (name.empty()) { if (clang::TypedefNameDecl const* td = d->getTypedefNameForAnonDecl()) { name = td->getName().str(); } } this->PrintNameAttribute(name); this->PrintContextAttribute(d); this->PrintLocationAttribute(d); this->PrintABIAttributes(d); this->PrintAttributesAttribute(d); clang::EnumDecl::enumerator_iterator enum_begin = d->enumerator_begin(); clang::EnumDecl::enumerator_iterator enum_end = d->enumerator_end(); if (enum_begin != enum_end) { this->OS << ">\n"; for (clang::EnumDecl::enumerator_iterator i = enum_begin; i != enum_end; ++i) { clang::EnumConstantDecl const* ecd = *i; this->OS << " PrintNameAttribute(ecd->getName()); this->OS << " init=\"" << ecd->getInitVal() << "\""; this->PrintAttributesAttribute(ecd); this->OS << "/>\n"; } this->OS << " \n"; } else { this->OS << "/>\n"; } } void ASTVisitor::OutputFieldDecl(clang::FieldDecl const* d, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintNameAttribute(d->getName().str()); this->PrintTypeAttribute(d->getType(), dn->Complete); if (d->isBitField()) { unsigned bits = d->getBitWidthValue(this->CTX); this->OS << " bits=\"" << bits << "\""; } this->PrintContextAttribute(d); this->PrintLocationAttribute(d); this->PrintOffsetAttribute(this->CTX.getFieldOffset(d)); if (d->isMutable()) { this->OS << " mutable=\"1\""; } this->PrintAttributesAttribute(d); this->OS << "/>\n"; } void ASTVisitor::OutputVarDecl(clang::VarDecl const* d, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintNameAttribute(d->getName().str()); this->PrintTypeAttribute(d->getType(), dn->Complete); if (clang::Expr const* init = d->getInit()) { this->OS << " init=\""; std::string s; llvm::raw_string_ostream rso(s); PrinterHelper ph(*this); init->printPretty(rso, &ph, this->PrintingPolicy); this->OS << encodeXML(rso.str()); this->OS << "\""; } this->PrintContextAttribute(d); this->PrintLocationAttribute(d); if (d->getStorageClass() == clang::SC_Static) { this->OS << " static=\"1\""; } if (d->getStorageClass() == clang::SC_Extern) { this->OS << " extern=\"1\""; } this->PrintMangledAttribute(d); this->PrintAttributesAttribute(d); this->OS << "/>\n"; } void ASTVisitor::OutputFunctionDecl(clang::FunctionDecl const* d, DumpNode const* dn) { if (d->getDescribedFunctionTemplate()) { // We do not implement function template output yet. this->ASTVisitorBase::OutputFunctionDecl(d, dn); return; } unsigned int flags = FH_Returns; if (d->getStorageClass() == clang::SC_Static) { flags |= FH_Static; } if (d->isOverloadedOperator()) { this->OutputFunctionHelper( d, dn, "OperatorFunction", flags, std::string(clang::getOperatorSpelling(d->getOverloadedOperator()))); } else if (clang::IdentifierInfo const* ii = d->getIdentifier()) { this->OutputFunctionHelper(d, dn, "Function", flags, ii->getName().str()); } else { this->OutputUnimplementedDecl(d, dn); } } void ASTVisitor::OutputCXXMethodDecl(clang::CXXMethodDecl const* d, DumpNode const* dn) { if (d->getDescribedFunctionTemplate()) { // We do not implement function template output yet. this->ASTVisitorBase::OutputCXXMethodDecl(d, dn); return; } unsigned int flags = FH_Returns; if (d->isStatic()) { flags |= FH_Static; } if (d->isConst()) { flags |= FH_Const; } if (d->isVirtual()) { flags |= FH_Virtual; } if (d->isPure()) { flags |= FH_Pure; } if (d->isOverloadedOperator()) { this->OutputFunctionHelper( d, dn, "OperatorMethod", flags, std::string(clang::getOperatorSpelling(d->getOverloadedOperator()))); } else if (clang::IdentifierInfo const* ii = d->getIdentifier()) { this->OutputFunctionHelper(d, dn, "Method", flags, ii->getName().str()); } else { this->OutputUnimplementedDecl(d, dn); } } void ASTVisitor::OutputCXXConversionDecl(clang::CXXConversionDecl const* d, DumpNode const* dn) { if (d->getDescribedFunctionTemplate()) { // We do not implement function template output yet. this->ASTVisitorBase::OutputCXXConversionDecl(d, dn); return; } unsigned int flags = FH_Returns; if (d->isConst()) { flags |= FH_Const; } if (d->isVirtual()) { flags |= FH_Virtual; } if (d->isPure()) { flags |= FH_Pure; } this->OutputFunctionHelper(d, dn, "Converter", flags); } void ASTVisitor::OutputCXXConstructorDecl(clang::CXXConstructorDecl const* d, DumpNode const* dn) { if (d->getDescribedFunctionTemplate()) { // We do not implement function template output yet. this->ASTVisitorBase::OutputCXXConstructorDecl(d, dn); return; } unsigned int flags = 0; if (d->isExplicit()) { flags |= FH_Explicit; } this->OutputFunctionHelper(d, dn, "Constructor", flags, this->GetContextName(d)); } void ASTVisitor::OutputCXXDestructorDecl(clang::CXXDestructorDecl const* d, DumpNode const* dn) { if (d->getDescribedFunctionTemplate()) { // We do not implement function template output yet. this->ASTVisitorBase::OutputCXXDestructorDecl(d, dn); return; } unsigned int flags = 0; if (d->isVirtual()) { flags |= FH_Virtual; } if (d->isPure()) { flags |= FH_Pure; } this->OutputFunctionHelper(d, dn, "Destructor", flags, this->GetContextName(d)); } void ASTVisitor::OutputBuiltinType(clang::BuiltinType const* t, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); // gccxml used different name variants than Clang for some types std::string name; switch (t->getKind()) { case clang::BuiltinType::Short: name = "short int"; break; case clang::BuiltinType::UShort: name = "short unsigned int"; break; case clang::BuiltinType::Long: name = "long int"; break; case clang::BuiltinType::ULong: name = "long unsigned int"; break; case clang::BuiltinType::LongLong: name = "long long int"; break; case clang::BuiltinType::ULongLong: name = "long long unsigned int"; break; case clang::BuiltinType::NullPtr: name = "decltype(nullptr)"; break; default: name = t->getName(this->PrintingPolicy).str(); break; }; this->PrintNameAttribute(name); this->PrintABIAttributes(this->CTX.getTypeInfo(t)); this->OS << "/>\n"; } void ASTVisitor::OutputConstantArrayType(clang::ConstantArrayType const* t, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->OS << " min=\"0\" max=\"" << (t->getSize() - 1) << "\""; this->PrintTypeAttribute(t->getElementType(), dn->Complete); this->OS << "/>\n"; } void ASTVisitor::OutputIncompleteArrayType(clang::IncompleteArrayType const* t, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->OS << " min=\"0\" max=\"\""; this->PrintTypeAttribute(t->getElementType(), dn->Complete); this->OS << "/>\n"; } void ASTVisitor::OutputFunctionProtoType(clang::FunctionProtoType const* t, DumpNode const* dn) { this->OutputFunctionTypeHelper(t, dn, "FunctionType", 0); } void ASTVisitor::OutputLValueReferenceType(clang::LValueReferenceType const* t, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintTypeAttribute(t->getPointeeType(), false); this->PrintABIAttributes(this->CTX.getTypeInfo(t)); this->OS << "/>\n"; } void ASTVisitor::OutputMemberPointerType(clang::MemberPointerType const* t, DumpNode const* dn) { if (t->isMemberDataPointerType()) { this->OutputOffsetType(t->getPointeeType(), t->getClass(), dn); } else { this->OS << " PrintIdAttribute(dn); DumpId id = this->AddTypeDumpNode( DumpType(t->getPointeeType(), t->getClass()), false); this->OS << " type=\"_" << id << "\""; this->OS << "/>\n"; } } void ASTVisitor::OutputMethodType(clang::FunctionProtoType const* t, clang::Type const* c, DumpNode const* dn) { this->OutputFunctionTypeHelper(t, dn, "MethodType", c); } void ASTVisitor::OutputOffsetType(clang::QualType t, clang::Type const* c, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintBaseTypeAttribute(c, dn->Complete); this->PrintTypeAttribute(t, dn->Complete); this->OS << "/>\n"; } void ASTVisitor::OutputPointerType(clang::PointerType const* t, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintTypeAttribute(t->getPointeeType(), false); this->PrintABIAttributes(this->CTX.getTypeInfo(t)); this->OS << "/>\n"; } void ASTVisitor::OutputElaboratedType(clang::ElaboratedType const* t, DumpNode const* dn) { this->OS << " PrintIdAttribute(dn); this->PrintTypeAttribute(t->getNamedType(), false); this->OS << "/>\n"; } void ASTVisitor::OutputStartXMLTags() { /* clang-format off */ this->OS << "\n" ; /* clang-format on */ if (this->Opts.CastXml) { // Start dump with castxml-compatible format. /* clang-format off */ this->OS << "\n" ; /* clang-format on */ } else if (this->Opts.GccXml) { // Start dump with gccxml-compatible format (legacy). /* clang-format off */ this->OS << "\n" ; /* clang-format on */ } } void ASTVisitor::OutputEndXMLTags() { // Finish dump. if (this->Opts.CastXml) { /* clang-format off */ this->OS << "\n" ; /* clang-format on */ } else if (this->Opts.GccXml) { /* clang-format off */ this->OS << "
    \n" ; /* clang-format on */ } } void ASTVisitor::LookupStart(clang::DeclContext const* dc, std::string const& name) { std::string::size_type pos = name.find("::"); std::string cur = name.substr(0, pos); clang::IdentifierTable& ids = CI.getPreprocessor().getIdentifierTable(); auto const& result = dc->lookup(clang::DeclarationName(&ids.get(cur))); if (pos == name.npos) { for (clang::NamedDecl const* n : result) { this->AddStartDecl(n); } } else { std::string rest = name.substr(pos + 2); for (clang::NamedDecl const* n : result) { if (clang::DeclContext const* idc = clang::dyn_cast(n)) { this->LookupStart(idc, rest); } } } for (clang::UsingDirectiveDecl const* i : dc->using_directives()) { this->LookupStart(i->getNominatedNamespace(), name); } } void ASTVisitor::HandleTranslationUnit(clang::TranslationUnitDecl const* tu) { // Add the starting nodes for the dump. if (!this->Opts.StartNames.empty()) { // Use the specified starting locations. for (std::vector::const_iterator i = this->Opts.StartNames.begin(), e = this->Opts.StartNames.end(); i != e; ++i) { this->LookupStart(tu, *i); } } else { // No start specified. Use whole translation unit. this->AddStartDecl(tu); } // Dump opening tags. this->OutputStartXMLTags(); // Dump the complete nodes. this->ProcessQueue(); // Queue all the incomplete nodes. this->RequireComplete = false; this->QueueIncompleteDumpNodes(); // Dump the incomplete nodes. this->ProcessQueue(); // Dump the filename queue. this->ProcessFileQueue(); // Dump end tags. this->OutputEndXMLTags(); } void outputXML(clang::CompilerInstance& ci, clang::ASTContext& ctx, llvm::raw_ostream& os, Options const& opts) { ASTVisitor v(ci, ctx, os, opts); v.HandleTranslationUnit(ctx.getTranslationUnitDecl()); } CastXML-0.2.0/src/Output.h000066400000000000000000000016711345607646000152440ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef CASTXML_OUTPUT_H #define CASTXML_OUTPUT_H namespace llvm { class raw_ostream; } namespace clang { class CompilerInstance; class ASTContext; } struct Options; /// outputXML - Print a gccxml-compatible AST dump. void outputXML(clang::CompilerInstance& ci, clang::ASTContext& ctx, llvm::raw_ostream& os, Options const& opts); #endif // CASTXML_OUTPUT_H CastXML-0.2.0/src/RunClang.cxx000066400000000000000000000651431345607646000160340ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "RunClang.h" #include "Options.h" #include "Output.h" #include "Utils.h" #include "llvm/Config/llvm-config.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/Basic/TargetInfo.h" #include "clang/Basic/Version.h" #include "clang/Driver/Compilation.h" #include "clang/Driver/Driver.h" #include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/Options.h" #include "clang/Driver/Tool.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Frontend/FrontendActions.h" #include "clang/Frontend/FrontendDiagnostic.h" #include "clang/Frontend/TextDiagnosticPrinter.h" #include "clang/Frontend/Utils.h" #include "clang/Lex/Preprocessor.h" #include "clang/Sema/Sema.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Option/ArgList.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Host.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" #include #include #include #include #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 9 # define CASTXML_OWNS_OSTREAM #endif class ASTConsumer : public clang::ASTConsumer { clang::CompilerInstance& CI; #ifdef CASTXML_OWNS_OSTREAM std::unique_ptr OwnOS; #endif llvm::raw_ostream& OS; Options const& Opts; struct Class { clang::CXXRecordDecl* RD; int Depth; Class(clang::CXXRecordDecl* rd, int depth) : RD(rd) , Depth(depth) { } }; std::queue Classes; int ClassImplicitMemberDepth = 0; public: #ifdef CASTXML_OWNS_OSTREAM ASTConsumer(clang::CompilerInstance& ci, std::unique_ptr os, Options const& opts) : CI(ci) , OwnOS(std::move(os)) , OS(*OwnOS) , Opts(opts) { } #else ASTConsumer(clang::CompilerInstance& ci, llvm::raw_ostream& os, Options const& opts) : CI(ci) , OS(os) , Opts(opts) { } #endif void AddImplicitMembers(Class const& c) { clang::CXXRecordDecl* rd = c.RD; this->ClassImplicitMemberDepth = c.Depth + 1; clang::Sema& sema = this->CI.getSema(); sema.ForceDeclarationOfImplicitMembers(rd); for (clang::DeclContext::decl_iterator i = rd->decls_begin(), e = rd->decls_end(); i != e; ++i) { clang::CXXMethodDecl* m = clang::dyn_cast(*i); if (m && !m->isDeleted() && !m->isInvalidDecl()) { bool mark = false; clang::CXXConstructorDecl* c = clang::dyn_cast(m); if (c) { mark = (c->isDefaultConstructor() || c->isCopyConstructor() || c->isMoveConstructor()); } else if (clang::dyn_cast(m)) { mark = true; } else { mark = (m->isCopyAssignmentOperator() || m->isMoveAssignmentOperator()); } if (mark) { clang::DiagnosticErrorTrap Trap(sema.getDiagnostics()); /* Ensure the member is defined. */ sema.MarkFunctionReferenced(clang::SourceLocation(), m); if (c && c->isDefaulted() && c->isDefaultConstructor() && c->isTrivial() && !c->isUsed(false) && !c->hasAttr()) { /* Clang does not build the definition of trivial constructors until they are used. Force semantic checking. */ sema.DefineImplicitDefaultConstructor(clang::SourceLocation(), c); } if (Trap.hasErrorOccurred()) { m->setInvalidDecl(); } /* Finish implicitly instantiated member. */ sema.PerformPendingInstantiations(); } } } } void HandleTagDeclDefinition(clang::TagDecl* d) { if (clang::CXXRecordDecl* rd = clang::dyn_cast(d)) { if (!rd->isDependentContext()) { if (this->ClassImplicitMemberDepth < 16) { this->Classes.push(Class(rd, this->ClassImplicitMemberDepth)); } } } } void HandleTranslationUnit(clang::ASTContext& ctx) { clang::Sema& sema = this->CI.getSema(); // Perform instantiations needed by the original translation unit. sema.PerformPendingInstantiations(); if (!sema.getDiagnostics().hasErrorOccurred()) { // Suppress diagnostics from below extensions to the translation unit. sema.getDiagnostics().setSuppressAllDiagnostics(true); // Add implicit members to classes. while (!this->Classes.empty()) { Class c = this->Classes.front(); this->Classes.pop(); this->AddImplicitMembers(c); } } // Tell Clang to finish the translation unit and tear down the parser. sema.ActOnEndOfTranslationUnit(); // Process the AST. outputXML(this->CI, ctx, this->OS, this->Opts); } }; template class CastXMLPredefines : public T { protected: Options const& Opts; CastXMLPredefines(Options const& opts) : Opts(opts) { } std::string UpdatePredefines(clang::CompilerInstance const& CI) { std::string const& predefines = CI.getPreprocessor().getPredefines(); // Identify the portion of the predefines string corresponding to // built-in predefined macros. char const predef_start[] = "# 1 \"\" 3\n"; char const predef_end[] = "# 1 \"\" 1\n"; std::string::size_type start = predefines.find(predef_start); std::string::size_type end = std::string::npos; if (start != std::string::npos) { start += sizeof(predef_start) - 1; end = predefines.find(predef_end, start); if (end == std::string::npos) { end = predefines.size(); } } std::string builtins; // Add builtins to identify CastXML itself. { char castxml_version[64]; sprintf(castxml_version, "#define __castxml_major__ %u\n", getVersionMajor()); builtins += castxml_version; sprintf(castxml_version, "#define __castxml_minor__ %u\n", getVersionMinor()); builtins += castxml_version; sprintf(castxml_version, "#define __castxml_patch__ %u\n", getVersionPatch()); builtins += castxml_version; } // Encode the version number components to allow a date as the patch // level and up to 1000 minor releases for each major release. // These values can exceed a 32-bit unsigned integer, but we know // that they will only be evaluated by our builtin clang. builtins += "#define __castxml_check(major,minor,patch) " "(10000000000*major + 100000000*minor + patch)\n"; builtins += "#define __castxml__ " "__castxml_check(__castxml_major__,__castxml_minor__," "__castxml_patch__)\n"; // Add builtins to identify the internal Clang compiler. builtins += #define STR(x) STR_(x) #define STR_(x) #x "#define __castxml_clang_major__ " STR( CLANG_VERSION_MAJOR) "\n" "#define __castxml_clang_minor__ " STR( CLANG_VERSION_MINOR) "\n" "#define " "__castxml_clang_" "patchlevel__ " #ifdef CLANG_VERSION_PATCHLEVEL STR(CLANG_VERSION_PATCHLEVEL) #else "0" #endif "\n" #undef STR #undef STR_ ; // If we detected predefines from another compiler, substitute them. if (this->Opts.HaveCC) { builtins += this->Opts.Predefines; // Provide __builtin_va_arg_pack if simulating the actual GNU compiler. if (this->NeedBuiltinVarArgPack(this->Opts.Predefines)) { // Clang does not support this builtin, so fake it to tolerate // uses in function bodies while parsing. builtins += "\n" "#define __builtin_va_arg_pack() 0\n" "#define __builtin_va_arg_pack_len() 1\n"; } // Provide __float128 if simulating the actual GNU compiler. if (!this->HaveFloat128(CI) && this->NeedFloat128(this->Opts.Predefines)) { // Clang provides its own (fake) builtin in gnu++11 mode but issues // diagnostics when it is used in some contexts. Provide our own // approximation of the builtin instead. builtins += "\n" "typedef struct __castxml__float128_s { " " char x[16] __attribute__((aligned(16))); " "} __castxml__float128;\n" "#define __float128 __castxml__float128\n"; } // Provide __is_assignable builtin if simulating MSVC. // When a future Clang version supports the builtin then // we can skip this when built against such a Clang. if (CI.getLangOpts().MSCompatibilityVersion >= 190000000 && CI.getLangOpts().CPlusPlus11) { builtins += "\n" "template T&& __castxml__declval() noexcept;\n" "template () = __castxml__declval())>\n" " static char (&__castxml__is_assignable_check(int))[1];\n" "template \n" " static char (&__castxml__is_assignable_check(...))[2];\n" "#define __is_assignable(_To,_Fr) \\\n" " (sizeof(__castxml__is_assignable_check<_To,_Fr>(0)) == \\\n" " sizeof(char(&)[1]))\n"; } #if LLVM_VERSION_MAJOR < 3 || LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 8 // Clang 3.8 and above provide a __make_integer_seq builtin needed // in C++14 mode. Provide it ourselves for older Clang versions. if (CI.getLangOpts().CPlusPlus14) { builtins += "\n" "template struct __castxml__integral_constant;\n" "template class _S,\n" " typename, typename, bool>\n" " struct __castxml__make_integer_seq_impl;\n" "template class _S,\n" " class _T, _T... __v>\n" " struct __castxml__make_integer_seq_impl<_S,\n" " __castxml__integral_constant<_T, 0>,\n" " _S<_T, __v...>, true> {\n" " typedef _S<_T, __v...> type;\n" " };\n" "template class _S,\n" " class _T, _T __i, _T... __v>\n" " struct __castxml__make_integer_seq_impl<_S,\n" " __castxml__integral_constant<_T, __i>,\n" " _S<_T, __v...>, true>\n" " : __castxml__make_integer_seq_impl<_S,\n" " __castxml__integral_constant<_T, __i - 1>,\n" " _S<_T, __i - 1, __v...>, __i >= 1 > {};\n" "template class _S,\n" " typename _T, _T _Sz>\n" "using __castxml__make_integer_seq = typename\n" " __castxml__make_integer_seq_impl<_S,\n" " __castxml__integral_constant<_T, _Sz>,\n" " _S<_T>, (_Sz>=0)>::type;\n" "#define __make_integer_seq __castxml__make_integer_seq\n"; } #endif #if LLVM_VERSION_MAJOR < 6 if (this->NeedHasUniqueObjectRepresentations(this->Opts.Predefines, CI)) { // Clang 6 and above provide a __has_unique_object_representations // builtin needed in C++17 mode. Provide an approximation for older // Clang versions. builtins += "\n" "#define __has_unique_object_representations(x) false\n"; } #endif // Prevent glibc use of a GNU extension not implemented by Clang. if (this->NeedNoMathInlines(this->Opts.Predefines)) { builtins += "\n" "#define __NO_MATH_INLINES 1\n"; } } else { builtins += predefines.substr(start, end - start); } return predefines.substr(0, start) + builtins + predefines.substr(end); } bool IsActualGNU(std::string const& pd) const { return (pd.find("#define __GNUC__ ") != pd.npos && pd.find("#define __clang__ ") == pd.npos && pd.find("#define __INTEL_COMPILER ") == pd.npos && pd.find("#define __CUDACC__ ") == pd.npos && pd.find("#define __PGI ") == pd.npos); } bool NeedBuiltinVarArgPack(std::string const& pd) { return this->IsActualGNU(pd); } bool NeedFloat128(std::string const& pd) const { return (this->IsActualGNU(pd) && (pd.find("#define __i386__ ") != pd.npos || pd.find("#define __x86_64__ ") != pd.npos || pd.find("#define __ia64__ ") != pd.npos)); } bool HaveFloat128(clang::CompilerInstance const& CI) const { #if LLVM_VERSION_MAJOR > 3 || LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 8 return CI.getTarget().hasFloat128Type(); #else static_cast(CI); return false; #endif } #if LLVM_VERSION_MAJOR < 6 bool NeedHasUniqueObjectRepresentations( std::string const& pd, clang::CompilerInstance const& CI) const { return (this->IsActualGNU(pd) && CI.getLangOpts().CPlusPlus1z); } #endif bool NeedNoMathInlines(std::string const& pd) const { return (this->IsActualGNU(pd) && (pd.find("#define __i386__ ") != pd.npos && pd.find("#define __OPTIMIZE__ ") != pd.npos && pd.find("#define __NO_MATH_INLINES ") == pd.npos)); } bool BeginSourceFileAction(clang::CompilerInstance& CI #if LLVM_VERSION_MAJOR < 5 , llvm::StringRef /*Filename*/ #endif ) override { CI.getPreprocessor().setPredefines(this->UpdatePredefines(CI)); // Tell Clang not to tear down the parser at EOF. CI.getPreprocessor().enableIncrementalProcessing(); return true; } }; class CastXMLPrintPreprocessedAction : public CastXMLPredefines { public: CastXMLPrintPreprocessedAction(Options const& opts) : CastXMLPredefines(opts) { } }; class CastXMLSyntaxOnlyAction : public CastXMLPredefines { std::unique_ptr CreateASTConsumer( clang::CompilerInstance& CI, llvm::StringRef InFile) override { using llvm::sys::path::filename; if (!this->Opts.GccXml && !this->Opts.CastXml) { return clang::SyntaxOnlyAction::CreateASTConsumer(CI, InFile); #ifdef CASTXML_OWNS_OSTREAM } else if (std::unique_ptr OS = CI.createDefaultOutputFile(false, filename(InFile), "xml")) { return llvm::make_unique(CI, std::move(OS), this->Opts); #else } else if (llvm::raw_ostream* OS = CI.createDefaultOutputFile(false, filename(InFile), "xml")) { return llvm::make_unique(CI, *OS, this->Opts); #endif } else { return nullptr; } } public: CastXMLSyntaxOnlyAction(Options const& opts) : CastXMLPredefines(opts) { } }; static clang::FrontendAction* CreateFrontendAction(clang::CompilerInstance* CI, Options const& opts) { clang::frontend::ActionKind action = CI->getInvocation().getFrontendOpts().ProgramAction; switch (action) { case clang::frontend::PrintPreprocessedInput: return new CastXMLPrintPreprocessedAction(opts); case clang::frontend::ParseSyntaxOnly: return new CastXMLSyntaxOnlyAction(opts); default: std::cerr << "error: unsupported action: " << int(action) << "\n"; return nullptr; } } static bool isObjC(clang::CompilerInstance* CI) { #if LLVM_VERSION_MAJOR >= 8 return CI->getLangOpts().ObjC; #else return CI->getLangOpts().ObjC1 || CI->getLangOpts().ObjC2; #endif } static bool runClangCI(clang::CompilerInstance* CI, Options const& opts) { // Create a diagnostics engine for this compiler instance. CI->createDiagnostics(); if (!CI->hasDiagnostics()) { return false; } // Set frontend options we captured directly. CI->getFrontendOpts().OutputFile = opts.OutputFile; if (opts.GccXml) { #define MSG(x) "error: '--castxml-gccxml' does not work with " x "\n" if (isObjC(CI)) { std::cerr << MSG("Objective C"); return false; } #undef MSG } if (opts.CastXml) { #define MSG(x) "error: '--castxml-output=' does not work with " x "\n" if (isObjC(CI)) { std::cerr << MSG("Objective C"); return false; } #undef MSG } // Construct our Clang front-end action. This dispatches // handling of each input file with an action based on the // flags provided (e.g. -E to preprocess-only). std::unique_ptr action( CreateFrontendAction(CI, opts)); if (action) { return CI->ExecuteAction(*action); } else { return false; } } static llvm::IntrusiveRefCntPtr runClangCreateDiagnostics(const char* const* argBeg, const char* const* argEnd) { llvm::IntrusiveRefCntPtr diagOpts( new clang::DiagnosticOptions); llvm::IntrusiveRefCntPtr diagID( new clang::DiagnosticIDs()); std::unique_ptr opts( clang::driver::createDriverOptTable()); unsigned missingArgIndex, missingArgCount; #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7 llvm::opt::InputArgList args(opts->ParseArgs( llvm::makeArrayRef(argBeg, argEnd), missingArgIndex, missingArgCount)); clang::ParseDiagnosticArgs(*diagOpts, args); #else std::unique_ptr args( opts->ParseArgs(argBeg, argEnd, missingArgIndex, missingArgCount)); clang::ParseDiagnosticArgs(*diagOpts, *args); #endif clang::TextDiagnosticPrinter* diagClient = new clang::TextDiagnosticPrinter(llvm::errs(), &*diagOpts); llvm::IntrusiveRefCntPtr diags( new clang::DiagnosticsEngine(diagID, &*diagOpts, diagClient)); clang::ProcessWarningOptions(*diags, *diagOpts, /*ReportDiags=*/false); return diags; } static int runClangImpl(const char* const* argBeg, const char* const* argEnd, Options const& opts) { // Construct a diagnostics engine for use while processing driver options. llvm::IntrusiveRefCntPtr diags = runClangCreateDiagnostics(argBeg, argEnd); // Use the approach in clang::createInvocationFromCommandLine to // get system compiler setting arguments from the Driver. clang::driver::Driver d("clang", llvm::sys::getDefaultTargetTriple(), *diags); if (!llvm::sys::path::is_absolute(d.ResourceDir) || !llvm::sys::fs::is_directory(d.ResourceDir)) { d.ResourceDir = getClangResourceDir(); } llvm::SmallVector cArgs; cArgs.push_back(""); cArgs.insert(cArgs.end(), argBeg, argEnd); // Tell the driver not to generate any commands past syntax parsing. if (opts.PPOnly) { cArgs.push_back("-E"); } else { cArgs.push_back("-fsyntax-only"); } // Ask the driver to build the compiler commands for us. std::unique_ptr c(d.BuildCompilation(cArgs)); if (diags->hasErrorOccurred()) { return 1; } // For '-###' just print the jobs and exit early. if (c->getArgs().hasArg(clang::driver::options::OPT__HASH_HASH_HASH)) { c->getJobs().Print(llvm::errs(), "\n", true); return 0; } // Reject '-o' with multiple inputs. if (!opts.OutputFile.empty() && c->getJobs().size() > 1) { diags->Report(clang::diag::err_drv_output_argument_with_multiple_files); return 1; } // Run Clang for each compilation computed by the driver. // This should be once per input source file. bool result = true; for (auto const& job : c->getJobs()) { clang::driver::Command const* cmd = llvm::dyn_cast(&job); if (cmd && strcmp(cmd->getCreator().getName(), "clang") == 0) { // Invoke Clang with this set of arguments. std::unique_ptr CI( new clang::CompilerInstance()); const char* const* cmdArgBeg = cmd->getArguments().data(); const char* const* cmdArgEnd = cmdArgBeg + cmd->getArguments().size(); if (clang::CompilerInvocation::CreateFromArgs( CI->getInvocation(), cmdArgBeg, cmdArgEnd, *diags)) { if (diags->hasErrorOccurred()) { return 1; } result = runClangCI(CI.get(), opts) && result; } else { result = false; } } else { // Skip this unexpected job. llvm::SmallString<128> buf; llvm::raw_svector_ostream msg(buf); job.Print(msg, "\n", true); diags->Report(clang::diag::err_fe_expected_clang_command); diags->Report(clang::diag::err_fe_expected_compiler_job) << msg.str(); result = false; } } return result ? 0 : 1; } int runClang(const char* const* argBeg, const char* const* argEnd, Options const& opts) { llvm::SmallVector args(argBeg, argEnd); std::string fmsc_version = "-fmsc-version="; std::string std_flag = "-std="; if (opts.HaveCC) { // Configure target to match that of given compiler. if (!opts.HaveTarget && !opts.Triple.empty()) { args.push_back("-target"); args.push_back(opts.Triple.c_str()); } // Tell Clang driver not to add its header search paths. args.push_back("-nobuiltininc"); args.push_back("-nostdlibinc"); // Add header search paths detected from given compiler. for (std::vector::const_iterator i = opts.Includes.begin(), e = opts.Includes.end(); i != e; ++i) { if (i->Framework) { args.push_back("-iframework"); } else { args.push_back("-isystem"); } args.push_back(i->Directory.c_str()); } // Tell Clang not to add its predefines. args.push_back("-undef"); // Configure language options to match given compiler. std::string const& pd = opts.Predefines; if (pd.find("#define _MSC_EXTENSIONS ") != pd.npos) { args.push_back("-fms-extensions"); } if (const char* d = strstr(pd.c_str(), "#define _MSC_VER ")) { args.push_back("-fms-compatibility"); // Extract the _MSC_VER value to give to -fmsc-version=. d += 17; if (const char* e = strchr(d, '\n')) { if (*(e - 1) == '\r') { --e; } std::string const msc_ver_str(d, e - d); fmsc_version += msc_ver_str; args.push_back(fmsc_version.c_str()); if (!opts.HaveStd) { if (pd.find("#define __cplusplus ") != pd.npos) { // Extract the C++ level from _MSC_VER to give to -std=. // Note that Clang also does this but old versions of Clang // do not know about new versions of MSVC. errno = 0; long msc_ver = std::strtol(msc_ver_str.c_str(), nullptr, 10); if (errno != 0) { msc_ver = 1600; } if (msc_ver >= 1900) { long msvc_lang = 0; if (const char* l = strstr(pd.c_str(), "#define _MSVC_LANG ")) { l += 19; if (const char* le = strchr(l, '\n')) { if (*(le - 1) == '\r') { --le; } std::string const msvc_lang_str(l, le - l); msvc_lang = std::strtol(msvc_lang_str.c_str(), nullptr, 10); } } if (msvc_lang >= 201703L) { args.push_back("-std=c++17"); } else { args.push_back("-std=c++14"); } } else if (msc_ver >= 1600) { args.push_back("-std=c++11"); } else { args.push_back("-std=c++98"); } } else { args.push_back("-std=c89"); } } } } else if (!opts.HaveStd) { // Check for GNU extensions. if (pd.find("#define __GNUC__ ") != pd.npos && pd.find("#define __STRICT_ANSI__ ") == pd.npos) { std_flag += "gnu"; } else { std_flag += "c"; } if (const char* d = strstr(pd.c_str(), "#define __cplusplus ")) { // Extract the C++ level to give to -std=. We do this above for // MSVC because it does not set __cplusplus to standard values. d += 20; if (const char* e = strchr(d, '\n')) { if (*(e - 1) == '\r') { --e; } // Add the standard year. std::string const std_date_str(d, e - d); errno = 0; long std_date = std::strtol(std_date_str.c_str(), nullptr, 10); if (errno != 0) { std_date = 0; } std_flag += "++"; if (std_date >= 201703L) { #if LLVM_VERSION_MAJOR >= 5 std_flag += "17"; #else std_flag += "1z"; #endif } else if (std_date >= 201406L) { std_flag += "1z"; } else if (std_date >= 201402L) { std_flag += "14"; } else if (std_date >= 201103L) { std_flag += "11"; } else { std_flag += "98"; } args.push_back(std_flag.c_str()); } } else if (const char* d = strstr(pd.c_str(), "#define __STDC_VERSION__ ")) { // Extract the C standard level. d += 25; if (const char* e = strchr(d, '\n')) { if (*(e - 1) == '\r') { --e; } std::string const std_date_str(d, e - d); errno = 0; long std_date = std::strtol(std_date_str.c_str(), nullptr, 10); if (errno != 0) { std_date = 0; } if (std_date >= 201112L) { std_flag += "11"; } else if (std_date >= 199901L) { std_flag += "99"; } else { std_flag += "89"; } args.push_back(std_flag.c_str()); } } else { // Assume C 89. std_flag += "89"; args.push_back(std_flag.c_str()); } } } return runClangImpl(args.data(), args.data() + args.size(), opts); } CastXML-0.2.0/src/RunClang.h000066400000000000000000000015241345607646000154520ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef CASTXML_RUNCLANG_H #define CASTXML_RUNCLANG_H struct Options; /// runClang - Run Clang with given user arguments and detected options. int runClang(const char* const* argBeg, const char* const* argEnd, Options const& opts); #endif // CASTXML_RUNCLANG_H CastXML-0.2.0/src/SourceDir.txt.in000066400000000000000000000000251345607646000166300ustar00rootroot00000000000000@CastXML_SOURCE_DIR@ CastXML-0.2.0/src/Utils.cxx000066400000000000000000000153231345607646000154160ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "Utils.h" #include "Version.h" #include #include #include #include #include #include #include #include static std::string castxmlResourceDir; static std::string castxmlClangResourceDir; static std::string GetMainExecutable(const char* argv0) { return llvm::sys::fs::getMainExecutable(argv0, (void*)(intptr_t)GetMainExecutable); } static bool tryBuildDir(std::string const& dir) { // Build tree has // /CMakeFiles/castxmlSourceDir.txt // /CMakeFiles/castxmlClangResourceDir.txt std::string src_dir_txt = dir + "/CMakeFiles/castxmlSourceDir.txt"; std::string cl_dir_txt = dir + "/CMakeFiles/castxmlClangResourceDir.txt"; std::ifstream src_fin(src_dir_txt.c_str()); std::ifstream cl_fin(cl_dir_txt.c_str()); std::string src_dir; std::string cl_dir; if (std::getline(src_fin, src_dir) && llvm::sys::fs::is_directory(src_dir) && std::getline(cl_fin, cl_dir) && llvm::sys::fs::is_directory(cl_dir)) { castxmlResourceDir = src_dir + "/share/castxml"; castxmlClangResourceDir = cl_dir; return true; } return false; } bool findResourceDir(const char* argv0, std::ostream& error) { std::string exe = GetMainExecutable(argv0); if (!llvm::sys::path::is_absolute(exe)) { error << "error: unable to locate " << argv0 << "\n"; return false; } // Install tree has // /bin/castxml // / // //clang llvm::SmallString<16> dir(exe); llvm::sys::path::remove_filename(dir); llvm::sys::path::remove_filename(dir); castxmlResourceDir = std::string(dir.str()) + "/" + CASTXML_INSTALL_DATA_DIR; castxmlClangResourceDir = castxmlResourceDir + "/clang"; if (!llvm::sys::fs::is_directory(castxmlResourceDir) || !llvm::sys::fs::is_directory(castxmlClangResourceDir)) { llvm::SmallString<16> dir2(dir); llvm::sys::path::remove_filename(dir2); // Build tree has // /bin[/]/castxml if (!tryBuildDir(dir.str()) && !tryBuildDir(dir2.str())) { error << "Unable to locate resources for " << exe << "\n"; return false; } } return true; } std::string getResourceDir() { return castxmlResourceDir; } std::string getClangResourceDir() { return castxmlClangResourceDir; } std::string getVersionString() { return CASTXML_VERSION_STRING; } unsigned int getVersionMajor() { return CASTXML_VERSION_MAJOR; } unsigned int getVersionMinor() { return CASTXML_VERSION_MINOR; } unsigned int getVersionPatch() { return CASTXML_VERSION_PATCH; } bool runCommand(int argc, const char* const* argv, int& ret, std::string& out, std::string& err, std::string& msg) { // Find the program to run. llvm::ErrorOr maybeProg = llvm::sys::findProgramByName(argv[0]); if (std::error_code e = maybeProg.getError()) { msg = e.message(); return false; } std::string const& prog = *maybeProg; // Create a temporary directory to hold output files. llvm::SmallString<128> tmpDir; if (std::error_code e = llvm::sys::fs::createUniqueDirectory("castxml", tmpDir)) { msg = e.message(); return false; } llvm::SmallString<128> tmpOut = tmpDir; tmpOut.append("out"); llvm::SmallString<128> tmpErr = tmpDir; tmpErr.append("err"); // Construct file redirects. llvm::StringRef inFile; // empty means /dev/null llvm::StringRef outFile = tmpOut.str(); llvm::StringRef errFile = tmpErr.str(); #if LLVM_VERSION_MAJOR >= 6 llvm::Optional redirects[3]; redirects[0] = inFile; redirects[1] = outFile; redirects[2] = errFile; #else llvm::StringRef const* redirects[3]; redirects[0] = &inFile; redirects[1] = &outFile; redirects[2] = &errFile; #endif #if LLVM_VERSION_MAJOR >= 7 llvm::SmallVector cmd(argv, argv + argc); llvm::ArrayRef args = cmd; llvm::Optional> env = llvm::None; #else std::vector cmd(argv, argv + argc); cmd.push_back(0); const char** args = &*cmd.begin(); const char** env = nullptr; #endif // Actually run the command. ret = llvm::sys::ExecuteAndWait(prog, args, env, redirects, 0, 0, &msg, nullptr); // Load the output from the temporary files. { std::ifstream fout(outFile.str()); std::ifstream ferr(errFile.str()); out.assign(std::istreambuf_iterator(fout), std::istreambuf_iterator()); err.assign(std::istreambuf_iterator(ferr), std::istreambuf_iterator()); } // Remove temporary files and directory. llvm::sys::fs::remove(llvm::Twine(tmpOut)); llvm::sys::fs::remove(llvm::Twine(tmpErr)); llvm::sys::fs::remove(llvm::Twine(tmpDir)); return ret >= 0; } std::string encodeXML(std::string const& in, bool cdata) { std::string xml; const char* last = in.c_str(); for (const char* c = last; *c; ++c) { switch (*c) { #define XML(OUT) \ xml.append(last, c - last); \ last = c + 1; \ xml.append(OUT) case '&': XML("&"); break; case '<': XML("<"); break; case '>': XML(">"); break; case '\'': if (!cdata) { XML("'"); } break; case '"': if (!cdata) { XML("""); } break; default: break; #undef XML } } xml.append(last); return xml; } std::string stringReplace(std::string str, std::string const& in, std::string const& out) { std::string::size_type p = 0; while ((p = str.find(in, p)) != std::string::npos) { str.replace(p, in.size(), out); p += out.length(); } return str; } #if defined(_WIN32) # include #endif void suppressInteractiveErrors() { #if defined(_WIN32) SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); #endif } CastXML-0.2.0/src/Utils.h000066400000000000000000000040231345607646000150360ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef CASTXML_UTILS_H #define CASTXML_UTILS_H #include /// findResources - Call from main() to find resources /// relative to the executable. On success returns true. /// On failure returns false and stores a message in the stream. bool findResourceDir(const char* argv0, std::ostream& error); /// getResourceDir - Get resource directory found at startup std::string getResourceDir(); /// getClangResourceDir - Get Clang resource directory found at startup std::string getClangResourceDir(); /// getVersionString - Get the CastXML version string std::string getVersionString(); /// getVersionMajor - Get CastXML major version. unsigned int getVersionMajor(); /// getVersionMinor - Get CastXML minor version. unsigned int getVersionMinor(); /// getVersionPatch - Get CastXML patch version. unsigned int getVersionPatch(); /// runCommand - Run a given command line and capture the output. bool runCommand(int argc, const char* const* argv, int& ret, std::string& out, std::string& err, std::string& msg); /// suppressInteractiveErrors - Disable Windows error dialog popups void suppressInteractiveErrors(); /// encodeXML - Convert character string to XML representation std::string encodeXML(std::string const& in, bool cdata = false); /// stringReplace - Replace all occurrences of an 'in' string with 'out'. std::string stringReplace(std::string str, std::string const& in, std::string const& out); #endif // CASTXML_UTILS_H CastXML-0.2.0/src/Version.cmake000066400000000000000000000043621345607646000162220ustar00rootroot00000000000000# CastXML version number components. set(CastXML_VERSION_MAJOR 0) set(CastXML_VERSION_MINOR 2) set(CastXML_VERSION_PATCH 0) set(CastXML_VERSION_RC 0) set(CastXML_VERSION_IS_DIRTY 0) # Start with the full version number used in tags. It has no dev info. set(CastXML_VERSION "${CastXML_VERSION_MAJOR}.${CastXML_VERSION_MINOR}.${CastXML_VERSION_PATCH}") if(CastXML_VERSION_RC) set(CastXML_VERSION "${CastXML_VERSION}-rc${CastXML_VERSION_RC}") endif() if(EXISTS ${CastXML_SOURCE_DIR}/.git) find_package(Git QUIET) if(GIT_FOUND) macro(_git) execute_process( COMMAND ${GIT_EXECUTABLE} ${ARGN} WORKING_DIRECTORY ${CastXML_SOURCE_DIR} RESULT_VARIABLE _git_res OUTPUT_VARIABLE _git_out OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE _git_err ERROR_STRIP_TRAILING_WHITESPACE ) endmacro() endif() endif() # Try to identify the current development source version. if(COMMAND _git) # Get the commit checked out in this work tree. _git(log -n 1 HEAD "--pretty=format:%h %s" --) set(git_info "${_git_out}") else() # Get the commit exported by 'git archive'. set(git_info "5ba47e3 CastXML 0.2.0") endif() # Extract commit information if available. if(git_info MATCHES "^([0-9a-f]+) (.*)$") set(git_hash "${CMAKE_MATCH_1}") set(git_subject "${CMAKE_MATCH_2}") # If this is not the exact commit of a release, add dev info. if(NOT "${git_subject}" MATCHES "^[Cc]ast[Xx][Mm][Ll] ${CastXML_VERSION}$") set(git_suffix "-g${git_hash}") if(COMMAND _git) # Use version suffix computed by 'git describe' if this version has been tagged. _git(describe --tags --match "v${CastXML_VERSION}" HEAD) if(_git_out MATCHES "^v${CastXML_VERSION}(-[0-9]+-g[0-9a-f]+)?$") set(git_suffix "${CMAKE_MATCH_1}") endif() endif() set(CastXML_VERSION "${CastXML_VERSION}${git_suffix}") endif() # If this is a work tree, check whether it is dirty. if(COMMAND _git) _git(update-index -q --refresh) _git(diff-index --name-only HEAD --) if(_git_out) set(CastXML_VERSION "${CastXML_VERSION}-dirty") endif() endif() elseif(NOT "${CastXML_VERSION_PATCH}" VERSION_LESS 20000000) # Generic development version. set(CastXML_VERSION "${CastXML_VERSION}-git") endif() CastXML-0.2.0/src/Version.h.in000066400000000000000000000015461345607646000157770ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifndef CASTXML_VERSION_H #define CASTXML_VERSION_H #define CASTXML_VERSION_STRING "@CastXML_VERSION@" #define CASTXML_VERSION_MAJOR @CastXML_VERSION_MAJOR@ #define CASTXML_VERSION_MINOR @CastXML_VERSION_MINOR@ #define CASTXML_VERSION_PATCH @CastXML_VERSION_PATCH@ #endif // CASTXML_VERSION_H CastXML-0.2.0/src/castxml.cxx000066400000000000000000000251021345607646000157650ustar00rootroot00000000000000/* Copyright Kitware, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "Detect.h" #include "Options.h" #include "RunClang.h" #include "Utils.h" #include "llvm/Config/llvm-config.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Allocator.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Process.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/raw_ostream.h" #if LLVM_VERSION_MAJOR >= 7 # include "llvm/Support/InitLLVM.h" #endif #include #include #include #include #include #include #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 7 # include "llvm/Support/StringSaver.h" #else class StringSaver : public llvm::cl::StringSaver { std::set Strings; public: const char* SaveString(const char* s) { return this->Strings.insert(s).first->c_str(); } }; #endif int main(int argc_in, const char** argv_in) { suppressInteractiveErrors(); #if LLVM_VERSION_MAJOR >= 7 llvm::InitLLVM initLLVM(argc_in, argv_in); llvm::SmallVector argv(argv_in, argv_in + argc_in); #else llvm::SmallVector argv; llvm::SpecificBumpPtrAllocator argAlloc; if (std::error_code e = llvm::sys::Process::GetArgumentVector( argv, llvm::ArrayRef(argv_in, argc_in), argAlloc)) { llvm::errs() << "error: could not get arguments: " << e.message() << "\n"; return 1; } #endif if (argv.empty()) { llvm::errs() << "error: no argv[0]?!\n"; return 1; } llvm::InitializeAllTargets(); llvm::InitializeAllTargetMCs(); llvm::InitializeAllAsmPrinters(); llvm::InitializeAllAsmParsers(); #if LLVM_VERSION_MAJOR > 3 || \ LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR >= 8 llvm::BumpPtrAllocator argSaverAlloc; llvm::StringSaver argSaver(argSaverAlloc); #elif LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR == 7 llvm::BumpPtrAllocator argSaverAlloc; llvm::BumpPtrStringSaver argSaver(argSaverAlloc); #else StringSaver argSaver; #endif llvm::cl::ExpandResponseFiles(argSaver, llvm::cl::TokenizeGNUCommandLine, argv); size_t const argc = argv.size(); if (!findResourceDir(argv[0], std::cerr)) { return 1; } /* clang-format off */ const char* usage = "Usage: castxml ( | | )...\n" "\n" " Options interpreted by castxml are listed below.\n" " Remaining options are given to the internal Clang compiler.\n" "\n" "Options:\n" "\n" " --castxml-cc- \n" " --castxml-cc- \"(\" ... \")\"\n" " Configure the internal Clang preprocessor and target\n" " platform to match that of the given compiler command.\n" " The must be \"gnu\", \"msvc\", \"gnu-c\", or \"msvc-c\".\n" " names a compiler (e.g. \"gcc\") and ... specifies\n" " options that may affect its target (e.g. \"-m32\").\n" "\n" " --castxml-output=\n" " Write castxml-format output to .xml or file named by '-o'\n" " The specifies the \"epic\" format version number to generate,\n" " and must be '1'.\n" "\n" " --castxml-gccxml\n" " Write gccxml-format output to .xml or file named by '-o'\n" " Use this option if you need an output similar to the one generated\n" " by the legacy gccxml tool.\n" "\n" " --castxml-start [,]...\n" " Start AST traversal at declaration(s) with the given (qualified)\n" " name(s). Multiple names may be specified as a comma-separated\n" " list or by repeating the option.\n" "\n" " -help, --help\n" " Print castxml and internal Clang compiler usage information\n" "\n" " -o \n" " Write output to \n" "\n" " --version\n" " Print castxml and internal Clang compiler version information\n" "\n" ; /* clang-format on */ Options opts; llvm::SmallVector clang_args; llvm::SmallVector cc_args; const char* cc_id = 0; for (size_t i = 1; i < argc; ++i) { if (strcmp(argv[i], "--castxml-gccxml") == 0) { if (!opts.GccXml) { opts.GccXml = true; } else { /* clang-format off */ std::cerr << "error: '--castxml-gccxml' may be given at most once!\n" "\n" << usage ; /* clang-format on */ return 1; } } else if (strncmp(argv[i], "--castxml-output=", 17) == 0) { if (!opts.CastXml) { opts.CastXml = true; opts.CastXmlEpicFormatVersion = atoi(argv[i] + 17); if (opts.CastXmlEpicFormatVersion != 1) { /* clang-format off */ std::cerr << "error: '--castxml-output=' accepts only '1' as ''!\n" "\n" << usage ; /* clang-format on */ } } else { /* clang-format off */ std::cerr << "error: '--castxml-output=' may be given at most once!\n" "\n" << usage ; /* clang-format on */ return 1; } } else if (strcmp(argv[i], "--castxml-start") == 0) { if ((i + 1) < argc) { std::string item; std::stringstream stream(argv[++i]); while (std::getline(stream, item, ',')) { opts.StartNames.push_back(item); } } else { /* clang-format off */ std::cerr << "error: argument to '--castxml-start' is missing " "(expected 1 value)\n" "\n" << usage ; /* clang-format on */ return 1; } } else if (strncmp(argv[i], "--castxml-cc-", 13) == 0) { if (!cc_id) { cc_id = argv[i] + 13; if ((i + 1) >= argc) { continue; } ++i; if (strncmp(argv[i], "-", 1) == 0) { /* clang-format off */ std::cerr << "error: argument to '--castxml-cc-" << cc_id << "' may not start with '-'\n" "\n" << usage ; /* clang-format on */ return 1; } if (strcmp(argv[i], "(") == 0) { unsigned int depth = 1; for (++i; i < argc && depth > 0; ++i) { if (strncmp(argv[i], "--castxml-", 10) == 0) { /* clang-format off */ std::cerr << "error: arguments to '--castxml-cc-" << cc_id << "' may not start with '--castxml-'\n" "\n" << usage ; /* clang-format on */ return 1; } else if (strcmp(argv[i], "(") == 0) { ++depth; cc_args.push_back(argv[i]); } else if (strcmp(argv[i], ")") == 0) { if (--depth) { cc_args.push_back(argv[i]); } } else { cc_args.push_back(argv[i]); } } if (depth) { /* clang-format off */ std::cerr << "error: unbalanced parentheses after '--castxml-cc-" << cc_id << "'\n" "\n" << usage ; /* clang-format on */ return 1; } --i; } else { cc_args.push_back(argv[i]); } } else { /* clang-format off */ std::cerr << "error: '--castxml-cc-' may be given at most once!\n" "\n" << usage ; /* clang-format on */ return 1; } } else if (strcmp(argv[i], "-E") == 0) { opts.PPOnly = true; } else if (strcmp(argv[i], "-o") == 0) { if ((i + 1) < argc) { opts.OutputFile = argv[++i]; } else { /* clang-format off */ std::cerr << "error: argument to '-o' is missing (expected 1 value)\n" "\n" << usage ; /* clang-format on */ return 1; } } else if (strcmp(argv[i], "-help") == 0 || strcmp(argv[i], "--help") == 0) { /* clang-format off */ std::cout << usage << "\n" "Help for the internal Clang compiler appears below.\n" "\n" "---------------------------------------------------------------" "\n" << std::endl; /* clang-format on */ // Also print Clang help. clang_args.push_back(argv[i]); } else if (strcmp(argv[i], "--version") == 0) { /* clang-format off */ std::cout << "castxml version " << getVersionString() << "\n" "\n" "CastXML project maintained and supported by Kitware " "(kitware.com).\n" << std::endl; /* clang-format on */ // Also print Clang version. clang_args.push_back(argv[i]); } else { clang_args.push_back(argv[i]); if (strcmp(argv[i], "-target") == 0 || strcmp(argv[i], "--target") == 0 || strncmp(argv[i], "-target=", 8) == 0 || strncmp(argv[i], "--target=", 9) == 0) { opts.HaveTarget = true; } else if (strncmp(argv[i], "-std=", 5) == 0) { opts.HaveStd = true; } } } if (cc_id) { opts.HaveCC = true; if (cc_args.empty()) { /* clang-format off */ std::cerr << "error: '--castxml-cc-" << cc_id << "' must be followed by a compiler command!\n" "\n" << usage ; /* clang-format on */ return 1; } if (!detectCC(cc_id, cc_args.data(), cc_args.data() + cc_args.size(), opts)) { return 1; } } if (opts.GccXml && opts.CastXml) { /* clang-format off */ std::cerr << "error: '--castxml-gccxml' and '--castxml-output='" " may not be not be used together!\n" "\n" << usage ; /* clang-format on */ return 1; } if (clang_args.empty()) { return 0; } return runClang(clang_args.data(), clang_args.data() + clang_args.size(), opts); } CastXML-0.2.0/src/clang-format.bash000077500000000000000000000062611345607646000170070ustar00rootroot00000000000000#!/usr/bin/env bash #============================================================================= # Copyright 2015-2016 Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= usage='usage: clang-format.bash [] [--] --help Print usage plus more detailed help. --clang-format Use given clang-format tool. --amend Filter files changed by HEAD. --cached Filter files locally staged for commit. --modified Filter files locally modified from HEAD. --tracked Filter files tracked by Git. ' help="$usage"' Example to format locally modified files: src/clang-format.bash --modified Example to format locally modified files staged for commit: src/clang-format.bash --cached Example to format files modified by the most recent commit: src/clang-format.bash --amend Example to format all files: src/clang-format.bash --tracked Example to format the current topic: git filter-branch \ --tree-filter "src/clang-format.bash --tracked" \ master.. ' die() { echo "$@" 1>&2; exit 1 } #----------------------------------------------------------------------------- # Parse command-line arguments. clang_format='' mode='' while test "$#" != 0; do case "$1" in --amend) mode="amend" ;; --cached) mode="cached" ;; --clang-format) shift; clang_format="$1" ;; --help) echo "$help"; exit 0 ;; --modified) mode="modified" ;; --tracked) mode="tracked" ;; --) shift ; break ;; -*) die "$usage" ;; *) break ;; esac shift done test "$#" = 0 || die "$usage" # Find a default tool. tools=' clang-format-6.0 clang-format ' if test "x$clang_format" = "x"; then for tool in $tools; do if type -p "$tool" >/dev/null; then clang_format="$tool" break fi done fi # Verify that we have a tool. if ! type -p "$clang_format" >/dev/null; then echo "Unable to locate '$clang_format'" exit 1 fi # Select listing mode. case "$mode" in '') echo "$usage"; exit 0 ;; amend) git_ls='git diff-tree --diff-filter=AM --name-only HEAD -r --no-commit-id' ;; cached) git_ls='git diff-index --diff-filter=AM --name-only HEAD --cached' ;; modified) git_ls='git diff-index --diff-filter=AM --name-only HEAD' ;; tracked) git_ls='git ls-files' ;; *) die "invalid mode: $mode" ;; esac # Filter sources to which our style should apply. $git_ls -z -- '*.h' '*.cxx' | egrep -z -v '^share/castxml/' | egrep -z -v '^src/kwsys/' | # Update sources in-place. xargs -0 "$clang_format" -i CastXML-0.2.0/test/000077500000000000000000000000001345607646000137565ustar00rootroot00000000000000CastXML-0.2.0/test/CMakeLists.txt000066400000000000000000000673471345607646000165370ustar00rootroot00000000000000#============================================================================= # Copyright Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= # Keep test binaries away from main binaries. unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY) unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY) unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) find_package(LibXml2 QUIET) macro(castxml_test_cmd test) set(command $ ${ARGN}) set(_castxml_expect ${castxml_test_cmd_expect} cmd.${test}) add_test( NAME cmd.${test} COMMAND ${CMAKE_COMMAND} "-Dcommand:STRING=${command}" "-Dexpect=${_castxml_expect}" ${castxml_test_cmd_extra_arguments} -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake ) endmacro() macro(castxml_test_output_common prefix ext std test) if(DEFINED castxml_test_output_custom_start) set(_castxml_start ${castxml_test_output_custom_start}) else() set(_castxml_start --castxml-start start) endif() if(castxml_test_output_custom_input) set(_castxml_input ${castxml_test_output_custom_input}) else() set(_castxml_input ${test}) endif() set(_castxml_expect ${prefix}.${std}.${test}) if("${std}" MATCHES "^gnu(.*)$") list(APPEND _castxml_expect ${prefix}.c${CMAKE_MATCH_1}.${test}) endif() if("${std}" MATCHES "^(c|gnu)[^+]") list(APPEND _castxml_expect ${prefix}.c.${test}) endif() list(APPEND _castxml_expect ${prefix}.any.${test}) if ("${prefix}" MATCHES "^gccxml(.*)$") set(flag --castxml-gccxml) elseif ("${prefix}" MATCHES "^castxml1(.*)$") set(flag --castxml-output=1) endif() set(std_flag -std=${std}) if(LLVM_VERSION_MAJOR VERSION_LESS 5) if("${std_flag}" MATCHES "^(.*)17$") set(std_flag "${CMAKE_MATCH_1}1z") endif() endif() set(command $ ${flag} ${_castxml_start} ${std_flag} ${CMAKE_CURRENT_LIST_DIR}/input/${_castxml_input}.${ext} -o ${prefix}.${std}.${test}.xml ${castxml_test_output_extra_arguments} ) add_test( NAME ${prefix}.${std}.${test} COMMAND ${CMAKE_COMMAND} "-Dcommand:STRING=${command}" "-Dexpect=${_castxml_expect}" "-Dxml=${prefix}.${std}.${test}.xml" "-Dxmllint=${LIBXML2_XMLLINT_EXECUTABLE}" -P ${CMAKE_CURRENT_SOURCE_DIR}/run.cmake ) endmacro() macro(castxml_test_output_c89 test) castxml_test_output_common(gccxml c c89 ${test}) castxml_test_output_common(castxml1 c c89 ${test}) endmacro() macro(castxml_test_output_c99 test) castxml_test_output_common(gccxml c c99 ${test}) castxml_test_output_common(castxml1 c c99 ${test}) endmacro() macro(castxml_test_output_c11 test) castxml_test_output_common(gccxml c c11 ${test}) castxml_test_output_common(castxml1 c c11 ${test}) endmacro() macro(castxml_test_output_gnu89 test) castxml_test_output_common(gccxml c gnu89 ${test}) castxml_test_output_common(castxml1 c gnu89 ${test}) endmacro() macro(castxml_test_output_gnu99 test) castxml_test_output_common(gccxml c gnu99 ${test}) castxml_test_output_common(castxml1 c gnu99 ${test}) endmacro() macro(castxml_test_output_gnu11 test) castxml_test_output_common(gccxml c gnu11 ${test}) castxml_test_output_common(castxml1 c gnu11 ${test}) endmacro() macro(castxml_test_output_cxx98 test) castxml_test_output_common(gccxml cxx c++98 ${test}) castxml_test_output_common(castxml1 cxx c++98 ${test}) endmacro() macro(castxml_test_output_gnuxx98 test) castxml_test_output_common(gccxml cxx gnu++98 ${test}) castxml_test_output_common(castxml1 cxx gnu++98 ${test}) endmacro() macro(castxml_test_output_cxx11 test) castxml_test_output_common(gccxml cxx c++11 ${test}) castxml_test_output_common(castxml1 cxx c++11 ${test}) endmacro() macro(castxml_test_output_gnuxx11 test) castxml_test_output_common(gccxml cxx gnu++11 ${test}) castxml_test_output_common(castxml1 cxx gnu++11 ${test}) endmacro() macro(castxml_test_output_cxx14 test) castxml_test_output_common(gccxml cxx c++14 ${test}) castxml_test_output_common(castxml1 cxx c++14 ${test}) endmacro() macro(castxml_test_output_gnuxx14 test) castxml_test_output_common(gccxml cxx gnu++14 ${test}) castxml_test_output_common(castxml1 cxx gnu++14 ${test}) endmacro() macro(castxml_test_output_cxx17 test) castxml_test_output_common(gccxml cxx c++17 ${test}) castxml_test_output_common(castxml1 cxx c++17 ${test}) endmacro() macro(castxml_test_output_gnuxx17 test) castxml_test_output_common(gccxml cxx gnu++17 ${test}) castxml_test_output_common(castxml1 cxx gnu++17 ${test}) endmacro() macro(castxml_test_output_broken_cxx98 test) castxml_test_output_common(gccxml.broken cxx c++98 ${test}) castxml_test_output_common(castxml1.broken cxx c++98 ${test}) endmacro() macro(castxml_test_output_broken_gnuxx98 test) castxml_test_output_common(gccxml.broken cxx gnu++98 ${test}) castxml_test_output_common(castxml1.broken cxx gnu++98 ${test}) endmacro() macro(castxml_test_output_broken_cxx11 test) castxml_test_output_common(gccxml.broken cxx c++11 ${test}) castxml_test_output_common(castxml1.broken cxx c++11 ${test}) endmacro() macro(castxml_test_output_broken_gnuxx11 test) castxml_test_output_common(gccxml.broken cxx gnu++11 ${test}) castxml_test_output_common(castxml1.broken cxx gnu++11 ${test}) endmacro() macro(castxml_test_output_broken_cxx14 test) castxml_test_output_common(gccxml.broken cxx c++14 ${test}) castxml_test_output_common(castxml1.broken cxx c++14 ${test}) endmacro() macro(castxml_test_output_broken_gnuxx14 test) castxml_test_output_common(gccxml.broken cxx gnu++14 ${test}) castxml_test_output_common(castxml1.broken cxx gnu++14 ${test}) endmacro() macro(castxml_test_output_broken_cxx17 test) castxml_test_output_common(gccxml.broken cxx c++17 ${test}) castxml_test_output_common(castxml1.broken cxx c++17 ${test}) endmacro() macro(castxml_test_output_broken_gnuxx17 test) castxml_test_output_common(gccxml.broken cxx gnu++17 ${test}) castxml_test_output_common(castxml1.broken cxx gnu++17 ${test}) endmacro() macro(castxml_test_output_c test) castxml_test_output_c89(${test}) castxml_test_output_gnu89(${test}) castxml_test_output_c99(${test}) castxml_test_output_gnu99(${test}) castxml_test_output_c11(${test}) castxml_test_output_gnu11(${test}) endmacro() macro(castxml_test_output test) castxml_test_output_cxx98(${test}) castxml_test_output_gnuxx98(${test}) castxml_test_output_cxx11(${test}) castxml_test_output_gnuxx11(${test}) castxml_test_output_cxx14(${test}) castxml_test_output_gnuxx14(${test}) castxml_test_output_cxx17(${test}) castxml_test_output_gnuxx17(${test}) endmacro() macro(castxml_test_output_11 test) castxml_test_output_cxx11(${test}) castxml_test_output_gnuxx11(${test}) castxml_test_output_cxx14(${test}) castxml_test_output_gnuxx14(${test}) castxml_test_output_cxx17(${test}) castxml_test_output_gnuxx17(${test}) endmacro() macro(castxml_test_output_14 test) castxml_test_output_cxx14(${test}) castxml_test_output_gnuxx14(${test}) castxml_test_output_cxx17(${test}) castxml_test_output_gnuxx17(${test}) endmacro() macro(castxml_test_output_14below test) castxml_test_output_cxx98(${test}) castxml_test_output_gnuxx98(${test}) castxml_test_output_cxx11(${test}) castxml_test_output_gnuxx11(${test}) castxml_test_output_cxx14(${test}) castxml_test_output_gnuxx14(${test}) endmacro() macro(castxml_test_output_broken test) castxml_test_output_broken_cxx98(${test}) castxml_test_output_broken_gnuxx98(${test}) castxml_test_output_broken_cxx11(${test}) castxml_test_output_broken_gnuxx11(${test}) castxml_test_output_broken_cxx14(${test}) castxml_test_output_broken_gnuxx14(${test}) castxml_test_output_broken_cxx17(${test}) castxml_test_output_broken_gnuxx17(${test}) endmacro() set(input ${CMAKE_CURRENT_LIST_DIR}/input) set(empty_c ${input}/empty.c) set(empty_cxx ${input}/empty.cxx) set(empty_m ${input}/empty.m) set(empty_mm ${input}/empty.mm) castxml_test_cmd(help1 -help) castxml_test_cmd(help2 --help) castxml_test_cmd(no-arguments) castxml_test_cmd(version --version) castxml_test_cmd(cc-missing --castxml-cc-gnu) castxml_test_cmd(cc-option --castxml-cc-gnu -) castxml_test_cmd(cc-paren-castxml --castxml-cc-gnu "(" --castxml-cc-msvc ")") castxml_test_cmd(cc-paren-nested --castxml-cc-gnu "(" "(" ")" ")") castxml_test_cmd(cc-paren-unbalanced --castxml-cc-gnu "(") castxml_test_cmd(cc-twice --castxml-cc-msvc cl --castxml-cc-gnu gcc) castxml_test_cmd(cc-unknown --castxml-cc-unknown cc) castxml_test_cmd(gccxml-and-E --castxml-gccxml -E) castxml_test_cmd(castxml-and-E --castxml-output=1 -E) castxml_test_cmd(gccxml-twice --castxml-gccxml --castxml-gccxml) castxml_test_cmd(castxml-twice --castxml-output=1 --castxml-output=1) castxml_test_cmd(castxml-mix1 --castxml-gccxml --castxml-output=1) castxml_test_cmd(castxml-mix2 --castxml-output=1 --castxml-gccxml) castxml_test_cmd(castxml-wrong-epic-version --castxml-output=0) castxml_test_cmd(gccxml-and-c99 --castxml-gccxml -std=c99 ${empty_c}) castxml_test_cmd(castxml-and-c99 --castxml-output=1 -std=c99 ${empty_c}) castxml_test_cmd(gccxml-and-c11 --castxml-gccxml -std=c11 ${empty_c}) castxml_test_cmd(castxml-and-c11 --castxml-output=1 -std=c11 ${empty_c}) castxml_test_cmd(gccxml-and-c++11 --castxml-gccxml -std=c++11 ${empty_cxx}) castxml_test_cmd(castxml-and-c++11 --castxml-output=1 -std=c++11 ${empty_cxx}) castxml_test_cmd(gccxml-and-c++14 --castxml-gccxml -std=c++14 ${empty_cxx}) castxml_test_cmd(castxml-and-c++14 --castxml-output=1 -std=c++14 ${empty_cxx}) if(LLVM_VERSION_MAJOR VERSION_LESS 5) castxml_test_cmd(gccxml-and-c++17 --castxml-gccxml -std=c++1z ${empty_cxx}) castxml_test_cmd(castxml-and-c++17 --castxml-output=1 -std=c++1z ${empty_cxx}) else() castxml_test_cmd(gccxml-and-c++17 --castxml-gccxml -std=c++17 ${empty_cxx}) castxml_test_cmd(castxml-and-c++17 --castxml-output=1 -std=c++17 ${empty_cxx}) endif() castxml_test_cmd(gccxml-and-objc1 --castxml-gccxml ${empty_m}) castxml_test_cmd(castxml-and-objc1 --castxml-output=1 ${empty_m}) castxml_test_cmd(gccxml-and-objc2 --castxml-gccxml ${empty_mm}) castxml_test_cmd(castxml-and-objc2 --castxml-output=1 ${empty_mm}) castxml_test_cmd(gccxml-empty-c++98 --castxml-gccxml -std=c++98 ${empty_cxx}) castxml_test_cmd(castxml-empty-c++98 --castxml-output=1 -std=c++98 ${empty_cxx}) castxml_test_cmd(gccxml-empty-c++98-E --castxml-gccxml -std=c++98 ${empty_cxx} -E) castxml_test_cmd(castxml-empty-c++98-E --castxml-output=1 -std=c++98 ${empty_cxx} -E) castxml_test_cmd(gccxml-empty-c++98-c --castxml-gccxml -std=c++98 ${empty_cxx} -c) castxml_test_cmd(castxml-empty-c++98-c --castxml-output=1 -std=c++98 ${empty_cxx} -c) castxml_test_cmd(std-c++98-src-c -std=c++98 ${empty_c}) castxml_test_cmd(std-c89-src-cxx -std=c89 ${empty_cxx}) castxml_test_cmd(input-missing ${input}/does-not-exist.c) castxml_test_cmd(o-missing -o) castxml_test_cmd(start-missing --castxml-start) castxml_test_cmd(rsp-empty @${input}/empty.rsp) castxml_test_cmd(rsp-missing @${input}/does-not-exist.rsp) castxml_test_cmd(rsp-o-missing @${input}/o-missing.rsp) # Test predefined macros when not using --castxml-cc-. configure_file(expect/cmd.predefined-macros.stdout.txt.in expect/cmd.predefined-macros.stdout.txt @ONLY) set(castxml_test_cmd_expect ${CMAKE_CURRENT_BINARY_DIR}/expect/cmd.predefined-macros) castxml_test_cmd(gccxml-predefined-macros --castxml-gccxml ${empty_cxx} -E -dM) castxml_test_cmd(castxml-predefined-macros --castxml-output=1 ${empty_cxx} -E -dM) unset(castxml_test_cmd_expect) castxml_test_cmd(castxml-predefined-c ${input}/predefined.c) castxml_test_cmd(castxml-predefined-cxx ${input}/predefined.cxx) # Test --castxml-cc-gnu detection. add_executable(cc-gnu cc-gnu.c) set_property(SOURCE cc-gnu.c APPEND PROPERTY COMPILE_DEFINITIONS "TEST_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"") castxml_test_cmd(cc-gnu-bad-cmd --castxml-cc-gnu cc-gnu-bad-cmd ${empty_cxx}) castxml_test_cmd(cc-gnu-src-c-E --castxml-cc-gnu $ ${empty_c} -E -dM) castxml_test_cmd(cc-gnu-src-cxx-E --castxml-cc-gnu $ ${empty_cxx} -E -dM) castxml_test_cmd(cc-gnu-src-cxx-cmd --castxml-cc-gnu $ ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-amd64 --castxml-cc-gnu "(" $ --cc-define=__amd64__ ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-explicit --castxml-cc-gnu "(" $ ")" -target explicit-target-triple ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-i386 --castxml-cc-gnu "(" $ --cc-define=__i386__ ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-i386-opt-E --castxml-cc-gnu "(" $ --cc-define=__i386__ --cc-define=__OPTIMIZE__ ")" ${empty_cxx} -E -dM) castxml_test_cmd(cc-gnu-tgt-mingw --castxml-cc-gnu "(" $ --cc-define=_WIN32 --cc-define=__MINGW32__ ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-win --castxml-cc-gnu "(" $ --cc-define=_WIN32 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-tgt-x86_64 --castxml-cc-gnu "(" $ --cc-define=__x86_64__ ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-c++98 --castxml-cc-gnu "(" $ -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-c++11 --castxml-cc-gnu "(" $ -std=201103L -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-c++14 --castxml-cc-gnu "(" $ -std=201402L -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++98 --castxml-cc-gnu "(" $ ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++11 --castxml-cc-gnu "(" $ -std=201103L ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++14 --castxml-cc-gnu "(" $ -std=201402L ")" ${empty_cxx} "-###") if(LLVM_VERSION_MAJOR VERSION_LESS 5) castxml_test_cmd(cc-gnu-std-c++1z --castxml-cc-gnu "(" $ -std=201703L -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++1z --castxml-cc-gnu "(" $ -std=201703L ")" ${empty_cxx} "-###") else() castxml_test_cmd(cc-gnu-std-c++1z --castxml-cc-gnu "(" $ -std=201406L -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-c++17 --castxml-cc-gnu "(" $ -std=201703L -ansi ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++1z --castxml-cc-gnu "(" $ -std=201406L ")" ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-std-gnu++17 --castxml-cc-gnu "(" $ -std=201703L ")" ${empty_cxx} "-###") endif() castxml_test_cmd(cc-gnu-std-explicit --castxml-cc-gnu "(" $ -std=199901L ")" -std=c++14 ${empty_cxx} "-###") castxml_test_cmd(cc-gnu-c-bad-cmd --castxml-cc-gnu-c "(" cc-gnu-c-bad-cmd ")" ${empty_c}) castxml_test_cmd(cc-gnu-c-src-c-E --castxml-cc-gnu-c $ ${empty_c} -E -dM) castxml_test_cmd(cc-gnu-c-src-c-cmd --castxml-cc-gnu-c $ ${empty_c} "-###") castxml_test_cmd(cc-gnu-c-std-c89 --castxml-cc-gnu-c "(" $ -ansi ")" ${empty_c} "-###") castxml_test_cmd(cc-gnu-c-std-c99 --castxml-cc-gnu-c "(" $ -std=199901L -ansi ")" ${empty_c} "-###") castxml_test_cmd(cc-gnu-c-std-c11 --castxml-cc-gnu-c "(" $ -std=201112L -ansi ")" ${empty_c} "-###") castxml_test_cmd(cc-gnu-c-std-gnu89 --castxml-cc-gnu-c "(" $ ")" ${empty_c} "-###") castxml_test_cmd(cc-gnu-c-std-gnu99 --castxml-cc-gnu-c "(" $ -std=199901L ")" ${empty_c} "-###") castxml_test_cmd(cc-gnu-c-std-gnu11 --castxml-cc-gnu-c "(" $ -std=201112L ")" ${empty_c} "-###") castxml_test_cmd(cc-gnu-c-tgt-i386-opt-E --castxml-cc-gnu-c "(" $ --cc-define=__i386__ --cc-define=__OPTIMIZE__ ")" ${empty_c} -E -dM) castxml_test_cmd(cc-gnu-builtin-unique-object-representations --castxml-cc-gnu "(" $ -std=201703L ")" ${input}/has_unique_object_representations.cxx) # Test --castxml-cc-msvc detection. add_executable(cc-msvc cc-msvc.c) set(castxml_test_cmd_extra_arguments "-Dprologue=${CMAKE_CURRENT_SOURCE_DIR}/cc-msvc.cmake") castxml_test_cmd(cc-msvc-bad-cmd --castxml-cc-msvc cc-msvc-bad-cmd ${empty_cxx}) castxml_test_cmd(cc-msvc-src-c-E --castxml-cc-msvc $ ${empty_c} -E -dM) castxml_test_cmd(cc-msvc-src-cxx-E --castxml-cc-msvc $ ${empty_cxx} -E -dM) castxml_test_cmd(cc-msvc-src-cxx-cmd --castxml-cc-msvc $ ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-tgt-amd64 --castxml-cc-msvc "(" $ --cc-define=_M_AMD64 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-tgt-explicit --castxml-cc-msvc "(" $ ")" -target explicit-target-triple ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-tgt-i386 --castxml-cc-msvc "(" $ --cc-define=_M_IX86 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-tgt-win --castxml-cc-msvc "(" $ --cc-define=_WIN32 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-tgt-x86_64 --castxml-cc-msvc "(" $ --cc-define=_M_X64 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++98 --castxml-cc-msvc "(" $ -msc=1500 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++11 --castxml-cc-msvc "(" $ -msc=1600 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++14 --castxml-cc-msvc "(" $ -msc=1900 ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++17 --castxml-cc-msvc "(" $ -msc=1900 -msvc_lang=201703L ")" ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-std-c++17-E --castxml-cc-msvc "(" $ -msc=1900 -msvc_lang=201703L -stdcpp_default_new_alignment=16ll ")" ${empty_cxx} -E -dM) castxml_test_cmd(cc-msvc-std-explicit --castxml-cc-msvc "(" $ -msc=1500 ")" -std=gnu++14 ${empty_cxx} "-###") castxml_test_cmd(cc-msvc-builtin-1800-E --castxml-cc-msvc "(" $ -msc=1800 ")" ${empty_cxx} -E -dM) castxml_test_cmd(cc-msvc-builtin-1900-E --castxml-cc-msvc "(" $ -msc=1900 ")" ${empty_cxx} -E -dM) castxml_test_cmd(cc-msvc-builtin-1900 --castxml-cc-msvc "(" $ -msc=1900 ")" ${input}/make_integer_seq.cxx) castxml_test_cmd(cc-msvc-c-bad-cmd --castxml-cc-msvc-c "(" cc-msvc-c-bad-cmd ")" ${empty_c}) castxml_test_cmd(cc-msvc-c-src-c-E --castxml-cc-msvc-c $ ${empty_c} -E -dM) castxml_test_cmd(cc-msvc-c-src-c-cmd --castxml-cc-msvc-c $ ${empty_c} "-###") castxml_test_cmd(cc-msvc-c-std-c89 --castxml-cc-msvc-c "(" $ ")" ${empty_c} "-###") unset(castxml_test_cmd_extra_arguments) castxml_test_output(ArrayType) castxml_test_output(ArrayType-incomplete) castxml_test_output(Class) castxml_test_output(Class-abstract) castxml_test_output(Class-annotate) castxml_test_output(Class-deprecated) castxml_test_output(Class-base-offset) castxml_test_output(Class-base-typedef) castxml_test_output(Class-bases) castxml_test_output(Class-forward) castxml_test_output(Class-friends) castxml_test_output(Class-implicit-member-access) castxml_test_output(Class-implicit-member-access-mutable) castxml_test_output(Class-implicit-member-array) castxml_test_output(Class-implicit-member-bad-base) castxml_test_output(Class-implicit-member-const) castxml_test_output(Class-implicit-member-const-aggregate) castxml_test_output(Class-implicit-member-reference) castxml_test_output(Class-implicit-members) castxml_test_output(Class-incomplete) castxml_test_output(Class-incomplete-twice) castxml_test_output(Class-member-Struct-anonymous) castxml_test_output(Class-member-template) castxml_test_output(Class-member-template-access) castxml_test_output(Class-member-Union-anonymous) castxml_test_output(Class-partial-template-member-Typedef) castxml_test_output(Class-template) castxml_test_output(Class-template-Method-Argument-const) castxml_test_output(Class-template-Method-Argument-default) castxml_test_output(Class-template-Method-return-const) castxml_test_output(Class-template-bases) castxml_test_output(Class-template-constructor-template) castxml_test_output(Class-template-friends) castxml_test_output(Class-template-member-nontemplate-Typedef) castxml_test_output(Class-template-member-Typedef) castxml_test_output(Class-template-member-Typedef-const) castxml_test_output(Class-template-member-template) castxml_test_output(Class-template-recurse) castxml_test_output(Constructor) castxml_test_output(Constructor-annotate) castxml_test_output(Constructor-deprecated) castxml_test_output(Converter) castxml_test_output(Converter-annotate) castxml_test_output(Converter-deprecated) castxml_test_output(CvQualifiedType) castxml_test_output(CXXLiteral) castxml_test_output(Destructor) castxml_test_output(Destructor-annotate) castxml_test_output(Destructor-deprecated) castxml_test_output(Elaborated) castxml_test_output(Enumeration) castxml_test_output(Enumeration-annotate) castxml_test_output(Enumeration-deprecated) castxml_test_output(Enumeration-anonymous) castxml_test_output(Field) castxml_test_output(Field-annotate) castxml_test_output(Field-deprecated) castxml_test_output(Function) castxml_test_output_14(Function-auto) castxml_test_output(Function-annotate) castxml_test_output(Function-deprecated) castxml_test_output(Function-Argument-annotate) castxml_test_output(Function-Argument-deprecated) castxml_test_output(Function-Argument-decay) castxml_test_output(Function-Argument-default) castxml_test_output(Function-Argument-default-cast) castxml_test_output(Function-Argument-default-ns) castxml_test_output_11(Function-lambda) castxml_test_output(Function-rvalue-reference) castxml_test_output(Function-template) castxml_test_output_14below(Function-throw) castxml_test_output(Function-variadic) castxml_test_output(FunctionType) castxml_test_output(FunctionType-variadic) castxml_test_output(FundamentalType) castxml_test_output(FundamentalTypes) castxml_test_output_11(FundamentalType-nullptr) castxml_test_output(Method) castxml_test_output(Method-annotate) castxml_test_output(Method-deprecated) castxml_test_output(Method-Argument-default) castxml_test_output(Method-Argument-default-cast) castxml_test_output(Method-overrides) castxml_test_output(Method-rvalue-reference) castxml_test_output(MethodType) castxml_test_output(MethodType-cv) castxml_test_output(Namespace) castxml_test_output(Namespace-anonymous) castxml_test_output(Namespace-Class-members) castxml_test_output(Namespace-Class-partial-template-members) castxml_test_output(Namespace-Class-template-members) castxml_test_output(Namespace-Function-template-members) castxml_test_output(Namespace-empty) castxml_test_output(Namespace-extern-C-members) castxml_test_output(Namespace-inline) castxml_test_output(Namespace-inline-start) castxml_test_output(Namespace-inline-template) castxml_test_output(Namespace-nested) castxml_test_output(Namespace-repeat) castxml_test_output(Namespace-repeat-start) castxml_test_output(OffsetType) castxml_test_output(OffsetType-cv) castxml_test_output(OperatorFunction) castxml_test_output(OperatorFunction-annotate) castxml_test_output(OperatorFunction-deprecated) castxml_test_output(OperatorMethod) castxml_test_output(OperatorMethod-annotate) castxml_test_output(OperatorMethod-deprecated) castxml_test_output(PointerType) castxml_test_output(ReferenceType) castxml_test_output(RValueReferenceType) castxml_test_output(TypeAlias) castxml_test_output(TypeAliasTemplate) castxml_test_output(Typedef-annotate) castxml_test_output(Typedef-deprecated) castxml_test_output(Typedef-paren) castxml_test_output(Typedef-to-Class-template) castxml_test_output(Typedef-to-Enumeration) castxml_test_output(Typedef-to-Enumeration-anonymous) castxml_test_output(Typedef-to-FundamentalType-mode) castxml_test_output(Typedef-to-extern-C-FundamentalType-mode) castxml_test_output(Typedef-to-Struct-anonymous) castxml_test_output(Typedef-to-Union-anonymous) castxml_test_output(Variable) castxml_test_output(Variable-annotate) castxml_test_output(Variable-deprecated) castxml_test_output(Variable-in-Class) castxml_test_output(Variable-init) castxml_test_output(Variable-init-cast) castxml_test_output(Variable-init-ns) castxml_test_output_11(Variable-lambda) # Test multiple start declarations. set(castxml_test_output_custom_input Namespace-nested) set(castxml_test_output_custom_start --castxml-start start::ns1,start::ns3) castxml_test_output(Namespace-nested-1) set(castxml_test_output_custom_start --castxml-start start::ns1 --castxml-start start::ns3) castxml_test_output(Namespace-nested-2) unset(castxml_test_output_custom_start) unset(castxml_test_output_custom_input) castxml_test_output(invalid-decl-for-type) castxml_test_output(qualified-type-name) castxml_test_output(using-declaration-class) castxml_test_output(using-declaration-ns) castxml_test_output(using-declaration-start) castxml_test_output(using-directive-ns) castxml_test_output(using-directive-start) set(castxml_test_output_custom_start "") castxml_test_output(nostart) unset(castxml_test_output_custom_start) if(";${LLVM_TARGETS_TO_BUILD};" MATCHES ";X86;") set(castxml_test_output_extra_arguments -target i386-pc-windows-msvc) castxml_test_output(Class-ms-dllexport) castxml_test_output(Class-ms-dllimport) castxml_test_output(Constructor-ms-dllexport) castxml_test_output(Constructor-ms-dllimport) castxml_test_output(Converter-ms-dllexport) castxml_test_output(Converter-ms-dllimport) castxml_test_output(Destructor-ms-dllexport) castxml_test_output(Destructor-ms-dllimport) castxml_test_output(Function-ms-dllexport) castxml_test_output(Function-ms-dllimport) castxml_test_output(Method-ms-dllexport) castxml_test_output(Method-ms-dllimport) castxml_test_output(OperatorFunction-ms-dllexport) castxml_test_output(OperatorFunction-ms-dllimport) castxml_test_output(OperatorMethod-ms-dllexport) castxml_test_output(OperatorMethod-ms-dllimport) castxml_test_output(Variable-ms-dllexport) castxml_test_output(Variable-ms-dllimport) castxml_test_output(Function-calling-convention-ms) castxml_test_output(Function-calling-convention-ms-annotate) castxml_test_output(Function-calling-convention-ms-deprecated) castxml_test_output(Function-calling-convention-ms-dllexport) castxml_test_output(Function-calling-convention-ms-dllimport) castxml_test_output(implicit-decl-ms) castxml_test_output(inline-asm-ms) unset(castxml_test_output_extra_arguments) endif() castxml_test_output_c(FunctionNoProto) castxml_test_output_c(FundamentalType) castxml_test_output_c(Typedef-called-class) castxml_test_output_c(invalid) castxml_test_output_broken(ReferenceType-to-Class-template) set(castxml_test_output_extra_arguments --castxml-cc-gnu-c "(" $ --cc-define=__x86_64__ ")") castxml_test_output_c(GNU-float128) set(castxml_test_output_custom_start "") castxml_test_output_c(GNU-float128-nostart) unset(castxml_test_output_custom_start) unset(castxml_test_output_extra_arguments) set(castxml_test_output_extra_arguments --castxml-cc-gnu "(" $ --cc-define=__x86_64__ ")") castxml_test_output(GNU-float128) set(castxml_test_output_custom_start "") castxml_test_output(GNU-float128-nostart) unset(castxml_test_output_custom_start) unset(castxml_test_output_extra_arguments) set(castxml_test_output_extra_arguments --castxml-cc-gnu-c $) castxml_test_output_c(GNU-va_arg_pack) unset(castxml_test_output_extra_arguments) set(castxml_test_output_extra_arguments --castxml-cc-gnu $) castxml_test_output(GNU-va_arg_pack) unset(castxml_test_output_extra_arguments) CastXML-0.2.0/test/cc-gnu-builtin/000077500000000000000000000000001345607646000165765ustar00rootroot00000000000000CastXML-0.2.0/test/cc-gnu-builtin/emmintrin.h000066400000000000000000000000001345607646000207370ustar00rootroot00000000000000CastXML-0.2.0/test/cc-gnu.c000066400000000000000000000021571345607646000153030ustar00rootroot00000000000000#include #include int main(int argc, const char* argv[]) { int cpp = 0; const char* std_date = 0; int i; for (i = 1; i < argc; ++i) { if (strncmp(argv[i], "--cc-define=", 12) == 0) { fprintf(stdout, "#define %s 1\n", argv[i]+12); } else if (strncmp(argv[i], "-std=", 5) == 0) { std_date = argv[i]+5; } else if (strcmp(argv[i], "-ansi") == 0) { fprintf(stdout, "#define __STRICT_ANSI__ 1\n"); } else if (strstr(argv[i], ".cpp")) { cpp = 1; } } if (cpp) { fprintf(stdout, "#define __cplusplus %s\n", std_date? std_date : "199711L" ); } else if(std_date) { fprintf(stdout, "#define __STDC_VERSION__ %s\n", std_date ); } fprintf(stdout, "#define __GNUC__ 1\n" "#define __has_include(x) x\n" "#define __has_include_next(x) x\n" "#define __GNUC_MINOR__ 1\n" "#define __has_last(x) x" ); fprintf(stderr, "#include <...> search starts here:\n" " /some/include\n" " " TEST_DIR "/cc-gnu-builtin\n" " /some/Frameworks\n" " /some/CustomFW (framework directory)\n" ); return 0; } CastXML-0.2.0/test/cc-msvc.c000066400000000000000000000024351345607646000154610ustar00rootroot00000000000000#include #include int main(int argc, const char* argv[]) { int cpp = 0; const char* msc_ver = "1600"; const char* msvc_lang = 0; const char* stdcpp_default_new_alignment = 0; int i; for (i = 1; i < argc; ++i) { if (strncmp(argv[i], "--cc-define=", 12) == 0) { fprintf(stdout, "\n#define %s 1", argv[i]+12); } else if (strncmp(argv[i], "-msc=", 5) == 0) { msc_ver = argv[i]+5; } else if (strncmp(argv[i], "-msvc_lang=", 11) == 0) { msvc_lang = argv[i]+11; } else if (strncmp(argv[i], "-stdcpp_default_new_alignment=", 30) == 0) { stdcpp_default_new_alignment = argv[i]+30; } else if (strstr(argv[i], ".cpp")) { cpp = 1; } } fprintf(stdout, "\n" ); if (cpp) { fprintf(stdout, "#define __cplusplus 199711L\n" ); } fprintf(stdout, "#define _MSC_VER %s\n", msc_ver ); if(msvc_lang) { fprintf(stdout, "#define _MSVC_LANG %s\n", msvc_lang ); } if(stdcpp_default_new_alignment) { fprintf(stdout, "#define __STDCPP_DEFAULT_NEW_ALIGNMENT__ %s\n", stdcpp_default_new_alignment); } fprintf(stdout, "#define __has_include(x) x\n" "#define __has_include_next(x) x\n" "#define _WIN32 1\n" "#define __has_last(x) x" ); return 0; } CastXML-0.2.0/test/cc-msvc.cmake000066400000000000000000000000661345607646000163150ustar00rootroot00000000000000set(ENV{INCLUDE} "/some/include;/some/other/include") CastXML-0.2.0/test/expect/000077500000000000000000000000001345607646000152465ustar00rootroot00000000000000CastXML-0.2.0/test/expect/castxml1.any.ArrayType-incomplete.xml.txt000066400000000000000000000005461345607646000252110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*>
    $ CastXML-0.2.0/test/expect/castxml1.any.ArrayType.xml.txt000066400000000000000000000005341345607646000230510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.CXXLiteral.xml.txt000066400000000000000000000002061345607646000231040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-abstract.xml.txt000066400000000000000000000031751345607646000240030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-annotate.xml.txt000066400000000000000000000023301345607646000240010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-base-offset.xml.txt000066400000000000000000000007541345607646000243760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .* $ CastXML-0.2.0/test/expect/castxml1.any.Class-base-typedef.xml.txt000066400000000000000000000044621345607646000245500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-deprecated.xml.txt000066400000000000000000000023131345607646000242710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-forward.xml.txt000066400000000000000000000020301345607646000236310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-friends.xml.txt000066400000000000000000000030131345607646000236210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-member-access-mutable.xml.txt000066400000000000000000000033631345607646000301440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-member-access.xml.txt000066400000000000000000000030341345607646000265100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-member-array.xml.txt000066400000000000000000000026601345607646000263710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-member-bad-base.xml.txt000066400000000000000000000044111345607646000267050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> ( | ) $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-member-const-aggregate.xml.txt000066400000000000000000000017541345607646000303300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-member-const.xml.txt000066400000000000000000000021131345607646000263720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-member-reference.xml.txt000066400000000000000000000021351345607646000272060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-implicit-members.xml.txt000066400000000000000000000026301345607646000254350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-incomplete-twice.xml.txt000066400000000000000000000004601345607646000254420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-incomplete.xml.txt000066400000000000000000000003601345607646000243300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-member-Struct-anonymous.xml.txt000066400000000000000000000046201345607646000267530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-member-Union-anonymous.xml.txt000066400000000000000000000046161345607646000265640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-member-template-access.xml.txt000066400000000000000000000050311345607646000265100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-member-template.xml.txt000066400000000000000000000027361345607646000252620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-ms-dllexport.xml.txt000066400000000000000000000024611345607646000246270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-ms-dllimport.xml.txt000066400000000000000000000024611345607646000246200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-partial-template-member-Typedef.xml.txt000066400000000000000000000031511345607646000303020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-Method-Argument-const.xml.txt000066400000000000000000000032541345607646000301330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-Method-Argument-default.xml.txt000066400000000000000000000027641345607646000304360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-Method-return-const.xml.txt000066400000000000000000000027231345607646000276700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-constructor-template.xml.txt000066400000000000000000000024251345607646000302040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-friends.xml.txt000066400000000000000000000031641345607646000254410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-member-Typedef-const.xml.txt000066400000000000000000000032221345607646000277730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-member-Typedef.xml.txt000066400000000000000000000031151345607646000266500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-member-nontemplate-Typedef.xml.txt000066400000000000000000000012471345607646000312000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-member-template.xml.txt000066400000000000000000000030621345607646000270640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template-recurse.xml.txt000066400000000000000000000024401345607646000254530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class-template.xml.txt000066400000000000000000000046111345607646000240070ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Class.xml.txt000066400000000000000000000022501345607646000221730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Constructor-annotate.xml.txt000066400000000000000000000022711345607646000252650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Constructor-deprecated.xml.txt000066400000000000000000000022541345607646000255550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Constructor-ms-dllexport.xml.txt000066400000000000000000000022551345607646000261100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Constructor-ms-dllimport.xml.txt000066400000000000000000000022551345607646000261010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Constructor.xml.txt000066400000000000000000000022111345607646000234500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Converter-annotate.xml.txt000066400000000000000000000026331345607646000247110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Converter-deprecated.xml.txt000066400000000000000000000026161345607646000252010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Converter-ms-dllexport.xml.txt000066400000000000000000000026171345607646000255340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Converter-ms-dllimport.xml.txt000066400000000000000000000026171345607646000255250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Converter.xml.txt000066400000000000000000000025531345607646000231030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.CvQualifiedType.xml.txt000066400000000000000000000005441345607646000241700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Destructor-annotate.xml.txt000066400000000000000000000022701345607646000250750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Destructor-deprecated.xml.txt000066400000000000000000000022531345607646000253650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Destructor-ms-dllexport.xml.txt000066400000000000000000000022541345607646000257200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Destructor-ms-dllimport.xml.txt000066400000000000000000000022541345607646000257110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Destructor.xml.txt000066400000000000000000000022101345607646000232600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Elaborated.xml.txt000066400000000000000000000172441345607646000232010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Enumeration-annotate.xml.txt000066400000000000000000000006131345607646000252240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Enumeration-anonymous.xml.txt000066400000000000000000000006341345607646000254460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Enumeration-deprecated.xml.txt000066400000000000000000000005571345607646000255220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Enumeration.xml.txt000066400000000000000000000005311345607646000234140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Field-annotate.xml.txt000066400000000000000000000026301345607646000237620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Field-deprecated.xml.txt000066400000000000000000000026131345607646000242520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Field.xml.txt000066400000000000000000000033231345607646000221530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-Argument-Annotate.xml.txt000066400000000000000000000010071345607646000262410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-Argument-decay.xml.txt000066400000000000000000000023021345607646000255540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-Argument-default-cast.xml.txt000066400000000000000000000072131345607646000270510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-Argument-default-ns.xml.txt000066400000000000000000000017261345607646000265420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-Argument-default.xml.txt000066400000000000000000000013751345607646000261240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-Argument-deprecated.xml.txt000066400000000000000000000007721345607646000266000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-annotate.xml.txt000066400000000000000000000007761345607646000245350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-auto.xml.txt000066400000000000000000000005031345607646000236600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-calling-convention-ms-annotate.xml.txt000066400000000000000000000032131345607646000307260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-calling-convention-ms-deprecated.xml.txt000066400000000000000000000031211345607646000312130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-calling-convention-ms-dllexport.xml.txt000066400000000000000000000031141345607646000311320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-calling-convention-ms-dllimport.xml.txt000066400000000000000000000031141345607646000311230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-calling-convention-ms.xml.txt000066400000000000000000000030151345607646000271170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-deprecated.xml.txt000066400000000000000000000007611345607646000250160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-lambda.xml.txt000066400000000000000000000012011345607646000241240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-ms-dllexport.xml.txt000066400000000000000000000007621345607646000253510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-ms-dllimport.xml.txt000066400000000000000000000007621345607646000253420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-rvalue-reference.xml.txt000066400000000000000000000006311345607646000261440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-template.xml.txt000066400000000000000000000012211345607646000245210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-throw.xml.txt000066400000000000000000000010501345607646000240510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function-variadic.xml.txt000066400000000000000000000007471345607646000245040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Function.xml.txt000066400000000000000000000007161345607646000227200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.FunctionType-variadic.xml.txt000066400000000000000000000007371345607646000253450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.FunctionType.xml.txt000066400000000000000000000007061345607646000235610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.FundamentalType-nullptr.xml.txt000066400000000000000000000010441345607646000257240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.FundamentalType.xml.txt000066400000000000000000000004611345607646000242300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.FundamentalTypes.xml.txt000066400000000000000000000046461345607646000244240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.GNU-float128-nostart.xml.txt000066400000000000000000000003011345607646000246000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-0.2.0/test/expect/castxml1.any.GNU-float128.xml.txt000066400000000000000000000015311345607646000231160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.GNU-va_arg_pack.xml.txt000066400000000000000000000006631345607646000240200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-Argument-default-cast.xml.txt000066400000000000000000000041111345607646000264760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-Argument-default.xml.txt000066400000000000000000000032461345607646000255560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-annotate.xml.txt000066400000000000000000000027531345607646000241650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-deprecated.xml.txt000066400000000000000000000027361345607646000244550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-ms-dllexport.xml.txt000066400000000000000000000027371345607646000250100ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-ms-dllimport.xml.txt000066400000000000000000000027371345607646000250010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-overrides.xml.txt000066400000000000000000000054721345607646000243570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method-rvalue-reference.xml.txt000066400000000000000000000021741345607646000256030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Method.xml.txt000066400000000000000000000026731345607646000223570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.MethodType-cv.xml.txt000066400000000000000000000011421345607646000236150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.MethodType.xml.txt000066400000000000000000000010061345607646000232060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-Class-members.xml.txt000066400000000000000000000026751345607646000255300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-Class-partial-template-members.xml.txt000066400000000000000000000002061345607646000307570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-Class-template-members.xml.txt000066400000000000000000000002061345607646000273250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-Function-template-members.xml.txt000066400000000000000000000002061345607646000300450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-anonymous.xml.txt000066400000000000000000000005371345607646000250560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-empty.xml.txt000066400000000000000000000002061345607646000241550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-extern-C-members.xml.txt000066400000000000000000000010701345607646000261340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-inline-start.xml.txt000066400000000000000000000000641345607646000254320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-inline-template.xml.txt000066400000000000000000000010001345607646000260770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-inline.xml.txt000066400000000000000000000006121345607646000242760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-nested-1.xml.txt000066400000000000000000000011321345607646000244360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-nested-2.xml.txt000066400000000000000000000011321345607646000244370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-nested.xml.txt000066400000000000000000000014261345607646000243060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-repeat-start.xml.txt000066400000000000000000000007701345607646000254400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace-repeat.xml.txt000066400000000000000000000010551345607646000243020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Namespace.xml.txt000066400000000000000000000002061345607646000230210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OffsetType-cv.xml.txt000066400000000000000000000010761345607646000236310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OffsetType.xml.txt000066400000000000000000000006671345607646000232300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorFunction-annotate.xml.txt000066400000000000000000000013531345607646000262410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorFunction-deprecated.xml.txt000066400000000000000000000013361345607646000265310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorFunction-ms-dllexport.xml.txt000066400000000000000000000013371345607646000270640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorFunction-ms-dllimport.xml.txt000066400000000000000000000013371345607646000270550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorFunction.xml.txt000066400000000000000000000012731345607646000244330ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorMethod-annotate.xml.txt000066400000000000000000000030061345607646000256710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorMethod-deprecated.xml.txt000066400000000000000000000027711345607646000261700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorMethod-ms-dllexport.xml.txt000066400000000000000000000027721345607646000265230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorMethod-ms-dllimport.xml.txt000066400000000000000000000027721345607646000265140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.OperatorMethod.xml.txt000066400000000000000000000027261345607646000240720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.PointerType.xml.txt000066400000000000000000000005551345607646000234160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.RValueReferenceType.xml.txt000066400000000000000000000002061345607646000250040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.ReferenceType.xml.txt000066400000000000000000000005611345607646000236710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.TypeAlias.xml.txt000066400000000000000000000005501345607646000230220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.TypeAliasTemplate.xml.txt000066400000000000000000000002061345607646000245140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-annotate.xml.txt000066400000000000000000000005311345607646000243350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-deprecated.xml.txt000066400000000000000000000005141345607646000246250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-paren.xml.txt000066400000000000000000000004571345607646000236400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-to-Class-template.xml.txt000066400000000000000000000005341345607646000260250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-to-Enumeration-anonymous.xml.txt000066400000000000000000000006261345607646000274650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-to-Enumeration.xml.txt000066400000000000000000000005421345607646000254340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-to-FundamentalType-mode.xml.txt000066400000000000000000000005071345607646000271710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-to-Struct-anonymous.xml.txt000066400000000000000000000006071345607646000264620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-to-Union-anonymous.xml.txt000066400000000000000000000006051345607646000262640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Typedef-to-extern-C-FundamentalType-mode.xml.txt000066400000000000000000000005201345607646000306470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-annotate.xml.txt000066400000000000000000000005531345607646000244660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-deprecated.xml.txt000066400000000000000000000005361345607646000247560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-in-Class.xml.txt000066400000000000000000000026161345607646000243300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-init-cast.xml.txt000066400000000000000000000012141345607646000245430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-init-ns.xml.txt000066400000000000000000000011101345607646000242240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-init.xml.txt000066400000000000000000000013151345607646000236150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-lambda.xml.txt000066400000000000000000000005641345607646000240770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-ms-dllexport.xml.txt000066400000000000000000000005371345607646000253110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable-ms-dllimport.xml.txt000066400000000000000000000005521345607646000252770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.Variable.xml.txt000066400000000000000000000004731345607646000226600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.implicit-decl-ms.xml.txt000066400000000000000000000010371345607646000242640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.inline-asm-ms.xml.txt000066400000000000000000000005041345607646000235770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.invalid-decl-for-type.xml.txt000066400000000000000000000051071345607646000252300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.nostart.xml.txt000066400000000000000000000010221345607646000226140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .* .* $ CastXML-0.2.0/test/expect/castxml1.any.qualified-type-name.xml.txt000066400000000000000000000006761345607646000250000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.using-declaration-class.xml.txt000066400000000000000000000055361345607646000256530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.using-declaration-ns.xml.txt000066400000000000000000000004561345607646000251620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.using-declaration-start.xml.txt000066400000000000000000000004441345607646000256740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.using-directive-ns.xml.txt000066400000000000000000000002061345607646000246440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.any.using-directive-start.xml.txt000066400000000000000000000004421345607646000253630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.broken.any.ReferenceType-to-Class-template.xml.txt000066400000000000000000000030351345607646000304430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> (broken: duplicate ReferenceType)? (broken: duplicate ReferenceType)? $ CastXML-0.2.0/test/expect/castxml1.c++11.Class-bases.xml.txt000066400000000000000000000107151345607646000232160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++11.Class-template-bases.xml.txt000066400000000000000000000066371345607646000250370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++14.Class-bases.xml.txt000066400000000000000000000107151345607646000232210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++14.Class-template-bases.xml.txt000066400000000000000000000066371345607646000250420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++17.Class-bases.xml.txt000066400000000000000000000107151345607646000232240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++17.Class-template-bases.xml.txt000066400000000000000000000066371345607646000250450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++98.CXXLiteral.result.txt000066400000000000000000000000021345607646000235560ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/castxml1.c++98.CXXLiteral.stderr.txt000066400000000000000000000000271345607646000235520ustar00rootroot00000000000000error: expected a type CastXML-0.2.0/test/expect/castxml1.c++98.CXXLiteral.xml.txt000066400000000000000000000000141345607646000230430ustar00rootroot00000000000000\(missing\) CastXML-0.2.0/test/expect/castxml1.c++98.Class-bases.xml.txt000066400000000000000000000111511345607646000232300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++98.Class-template-bases.xml.txt000066400000000000000000000070351345607646000250470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c++98.Function-rvalue-reference.stderr.txt000066400000000000000000000000631345607646000266100ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-0.2.0/test/expect/castxml1.c++98.Method-rvalue-reference.stderr.txt000066400000000000000000000000631345607646000262430ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-0.2.0/test/expect/castxml1.c++98.RValueReferenceType.stderr.txt000066400000000000000000000000631345607646000254520ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-0.2.0/test/expect/castxml1.c++98.TypeAlias.stderr.txt000066400000000000000000000000641345607646000234670ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-0.2.0/test/expect/castxml1.c++98.TypeAliasTemplate.stderr.txt000066400000000000000000000000641345607646000251630ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-0.2.0/test/expect/castxml1.c.FunctionNoProto.xml.txt000066400000000000000000000004631345607646000236730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c.FundamentalType.xml.txt000066400000000000000000000004571345607646000236700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c.GNU-float128-nostart.xml.txt000066400000000000000000000002771345607646000242470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-0.2.0/test/expect/castxml1.c.GNU-float128.xml.txt000066400000000000000000000006251345607646000225540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c.GNU-va_arg_pack.xml.txt000066400000000000000000000006611345607646000234510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c.Typedef-called-class.xml.txt000066400000000000000000000006201345607646000245050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/castxml1.c.invalid.result.txt000066400000000000000000000000021345607646000227160ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/castxml1.c.invalid.stderr.txt000066400000000000000000000000411345607646000227060ustar00rootroot00000000000000error: unknown type name 'class' CastXML-0.2.0/test/expect/cmd.castxml-and-objc1.result.txt000066400000000000000000000000021345607646000232650ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.castxml-and-objc1.stderr.txt000066400000000000000000000000771345607646000232660ustar00rootroot00000000000000^error: '--castxml-output=' does not work with Objective C$ CastXML-0.2.0/test/expect/cmd.castxml-and-objc2.result.txt000066400000000000000000000000021345607646000232660ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.castxml-and-objc2.stderr.txt000066400000000000000000000000771345607646000232670ustar00rootroot00000000000000^error: '--castxml-output=' does not work with Objective C$ CastXML-0.2.0/test/expect/cmd.castxml-empty-c++98-E.stdout.txt000066400000000000000000000000361345607646000236110ustar00rootroot00000000000000^#[^ ]*/test/input/empty.cxx" CastXML-0.2.0/test/expect/cmd.castxml-mix1.result.txt000066400000000000000000000000021345607646000224050ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.castxml-mix1.stderr.txt000066400000000000000000000001531345607646000224010ustar00rootroot00000000000000^error: '--castxml-gccxml' and '--castxml-output=' may not be not be used together! Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.castxml-mix2.result.txt000066400000000000000000000000021345607646000224060ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.castxml-mix2.stderr.txt000066400000000000000000000001531345607646000224020ustar00rootroot00000000000000^error: '--castxml-gccxml' and '--castxml-output=' may not be not be used together! Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.castxml-twice.result.txt000066400000000000000000000000021345607646000226420ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.castxml-twice.stderr.txt000066400000000000000000000001161345607646000226350ustar00rootroot00000000000000^error: '--castxml-output=' may be given at most once! Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.castxml-wrong-epic-version.result.txt000066400000000000000000000000021345607646000252640ustar00rootroot000000000000000 CastXML-0.2.0/test/expect/cmd.castxml-wrong-epic-version.stderr.txt000066400000000000000000000001161345607646000252570ustar00rootroot00000000000000^error: '--castxml-output=' accepts only '1' as ''! Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.cc-gnu-bad-cmd.result.txt000066400000000000000000000000021345607646000225170ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-gnu-bad-cmd.stderr.txt000066400000000000000000000001641345607646000225150ustar00rootroot00000000000000^error: '--castxml-cc-gnu' compiler command failed: 'cc-gnu-bad-cmd' '-E' '-dM' '-v' '.*/share/castxml/empty.cpp' CastXML-0.2.0/test/expect/cmd.cc-gnu-c-bad-cmd.result.txt000066400000000000000000000000021345607646000227370ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-gnu-c-bad-cmd.stderr.txt000066400000000000000000000001661345607646000227370ustar00rootroot00000000000000^error: '--castxml-cc-gnu-c' compiler command failed: 'cc-gnu-c-bad-cmd' '-E' '-dM' '-v' '.*/share/castxml/empty.c' CastXML-0.2.0/test/expect/cmd.cc-gnu-c-src-c-E.stdout.txt000066400000000000000000000006161345607646000226600ustar00rootroot00000000000000^#define __GNUC_MINOR__ 1 #define __GNUC__ 1 #define __builtin_va_arg_pack\(\) 0 #define __builtin_va_arg_pack_len\(\) 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+$ CastXML-0.2.0/test/expect/cmd.cc-gnu-c-src-c-cmd.stderr.txt000066400000000000000000000002421345607646000232130ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "[^"]*/include" "-iframework" "/some/Frameworks" "-iframework" "/some/CustomFW" "-[^i] CastXML-0.2.0/test/expect/cmd.cc-gnu-c-std-c11.stderr.txt000066400000000000000000000000261345607646000226170ustar00rootroot00000000000000"clang" .* "-std=c11" CastXML-0.2.0/test/expect/cmd.cc-gnu-c-std-c89.stderr.txt000066400000000000000000000000261345607646000226360ustar00rootroot00000000000000"clang" .* "-std=c89" CastXML-0.2.0/test/expect/cmd.cc-gnu-c-std-c99.stderr.txt000066400000000000000000000000261345607646000226370ustar00rootroot00000000000000"clang" .* "-std=c99" CastXML-0.2.0/test/expect/cmd.cc-gnu-c-std-gnu11.stderr.txt000066400000000000000000000000301345607646000231610ustar00rootroot00000000000000"clang" .* "-std=gnu11" CastXML-0.2.0/test/expect/cmd.cc-gnu-c-std-gnu89.stderr.txt000066400000000000000000000000301345607646000232000ustar00rootroot00000000000000"clang" .* "-std=gnu89" CastXML-0.2.0/test/expect/cmd.cc-gnu-c-std-gnu99.stderr.txt000066400000000000000000000000301345607646000232010ustar00rootroot00000000000000"clang" .* "-std=gnu99" CastXML-0.2.0/test/expect/cmd.cc-gnu-c-tgt-i386-opt-E.stdout.txt000066400000000000000000000007761345607646000237450ustar00rootroot00000000000000^#define __GNUC_MINOR__ 1 #define __GNUC__ 1 #define __NO_MATH_INLINES 1 #define __OPTIMIZE__ 1 #define __builtin_va_arg_pack\(\) 0 #define __builtin_va_arg_pack_len\(\) 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+( #define __float128 __castxml__float128)? #define __i386__ 1$ CastXML-0.2.0/test/expect/cmd.cc-gnu-src-c-E.result.txt000066400000000000000000000000021345607646000224210ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-gnu-src-c-E.stderr.txt000066400000000000000000000001101345607646000224060ustar00rootroot00000000000000^error: invalid argument '-std=gnu\+\+98' not allowed with 'C(/ObjC)?'$ CastXML-0.2.0/test/expect/cmd.cc-gnu-src-cxx-E.stdout.txt000066400000000000000000000006521345607646000230200ustar00rootroot00000000000000^#define __GNUC_MINOR__ 1 #define __GNUC__ 1 #define __builtin_va_arg_pack\(\) 0 #define __builtin_va_arg_pack_len\(\) 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+ #define __cplusplus 199711L$ CastXML-0.2.0/test/expect/cmd.cc-gnu-src-cxx-cmd.stderr.txt000066400000000000000000000002421345607646000233530ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "[^"]*/include" "-iframework" "/some/Frameworks" "-iframework" "/some/CustomFW" "-[^i] CastXML-0.2.0/test/expect/cmd.cc-gnu-std-c++11.stderr.txt000066400000000000000000000000321345607646000225220ustar00rootroot00000000000000"clang" .* "-std=c\+\+11" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-c++14.stderr.txt000066400000000000000000000000321345607646000225250ustar00rootroot00000000000000"clang" .* "-std=c\+\+14" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-c++17.stderr.txt000066400000000000000000000000321345607646000225300ustar00rootroot00000000000000"clang" .* "-std=c\+\+17" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-c++1z.stderr.txt000066400000000000000000000000321345607646000226330ustar00rootroot00000000000000"clang" .* "-std=c\+\+1z" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-c++98.stderr.txt000066400000000000000000000000321345607646000225410ustar00rootroot00000000000000"clang" .* "-std=c\+\+98" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-explicit.stderr.txt000066400000000000000000000000321345607646000236310ustar00rootroot00000000000000"clang" .* "-std=c\+\+14" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-gnu++11.stderr.txt000066400000000000000000000000341345607646000230730ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+11" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-gnu++14.stderr.txt000066400000000000000000000000341345607646000230760ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+14" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-gnu++17.stderr.txt000066400000000000000000000000341345607646000231010ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+17" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-gnu++1z.stderr.txt000066400000000000000000000000341345607646000232040ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+1z" CastXML-0.2.0/test/expect/cmd.cc-gnu-std-gnu++98.stderr.txt000066400000000000000000000000341345607646000231120ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+98" CastXML-0.2.0/test/expect/cmd.cc-gnu-tgt-amd64.stderr.txt000066400000000000000000000000261345607646000227320ustar00rootroot00000000000000Target: amd64-[^ ]+ . CastXML-0.2.0/test/expect/cmd.cc-gnu-tgt-explicit.stderr.txt000066400000000000000000000000411345607646000236350ustar00rootroot00000000000000Target: explicit-target-triple . CastXML-0.2.0/test/expect/cmd.cc-gnu-tgt-i386-opt-E.stdout.txt000066400000000000000000000010321345607646000235070ustar00rootroot00000000000000^#define __GNUC_MINOR__ 1 #define __GNUC__ 1 #define __NO_MATH_INLINES 1 #define __OPTIMIZE__ 1 #define __builtin_va_arg_pack\(\) 0 #define __builtin_va_arg_pack_len\(\) 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+ #define __cplusplus 199711L( #define __float128 __castxml__float128)? #define __i386__ 1$ CastXML-0.2.0/test/expect/cmd.cc-gnu-tgt-i386.stderr.txt000066400000000000000000000000251345607646000225070ustar00rootroot00000000000000Target: i386-[^ ]+ . CastXML-0.2.0/test/expect/cmd.cc-gnu-tgt-mingw.stderr.txt000066400000000000000000000000371345607646000231420ustar00rootroot00000000000000Target: [^ ]+-pc-windows-gnu . CastXML-0.2.0/test/expect/cmd.cc-gnu-tgt-win.stderr.txt000066400000000000000000000000401345607646000226100ustar00rootroot00000000000000Target: [^ ]+-pc-windows[^ ]+ . CastXML-0.2.0/test/expect/cmd.cc-gnu-tgt-x86_64.stderr.txt000066400000000000000000000000271345607646000227560ustar00rootroot00000000000000Target: x86_64-[^ ]+ . CastXML-0.2.0/test/expect/cmd.cc-missing.result.txt000066400000000000000000000000021345607646000221120ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-missing.stderr.txt000066400000000000000000000001271345607646000221070ustar00rootroot00000000000000^error: '--castxml-cc-gnu' must be followed by a compiler command! Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.cc-msvc-bad-cmd.result.txt000066400000000000000000000000021345607646000226760ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-msvc-bad-cmd.stderr.txt000066400000000000000000000001701345607646000226710ustar00rootroot00000000000000^error: '--castxml-cc-msvc' compiler command failed: 'cc-msvc-bad-cmd' '-c' '-FoNUL' '.*/share/castxml/detect_vs.cpp' CastXML-0.2.0/test/expect/cmd.cc-msvc-builtin-1800-E.stdout.txt000066400000000000000000000005311345607646000236400ustar00rootroot00000000000000^#define _MSC_VER 1800 #define _WIN32 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+ #define __cplusplus 199711L$ CastXML-0.2.0/test/expect/cmd.cc-msvc-builtin-1900-E.stdout.txt000066400000000000000000000010151345607646000236370ustar00rootroot00000000000000^#define _MSC_VER 1900 #define _WIN32 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+ #define __cplusplus 199711L #define __is_assignable\(_To,_Fr\) \(sizeof\(__castxml__is_assignable_check<_To,_Fr>\(0\)\) == sizeof\(char\(&\)\[1\]\)\)( #define __make_integer_seq __castxml__make_integer_seq)?$ CastXML-0.2.0/test/expect/cmd.cc-msvc-c-bad-cmd.result.txt000066400000000000000000000000021345607646000231160ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-msvc-c-bad-cmd.stderr.txt000066400000000000000000000001711345607646000231120ustar00rootroot00000000000000^error: '--castxml-cc-msvc-c' compiler command failed: 'cc-msvc-c-bad-cmd' '-c' '-FoNUL' '.*/share/castxml/detect_vs.c CastXML-0.2.0/test/expect/cmd.cc-msvc-c-src-c-E.stdout.txt000066400000000000000000000004751345607646000230420ustar00rootroot00000000000000^#define _MSC_VER 1600 #define _WIN32 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+$ CastXML-0.2.0/test/expect/cmd.cc-msvc-c-src-c-cmd.stderr.txt000066400000000000000000000001501345607646000233700ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "/some/other/include" "-[^i] CastXML-0.2.0/test/expect/cmd.cc-msvc-c-std-c89.stderr.txt000066400000000000000000000000261345607646000230150ustar00rootroot00000000000000"clang" .* "-std=c89" CastXML-0.2.0/test/expect/cmd.cc-msvc-src-c-E.result.txt000066400000000000000000000000021345607646000226000ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-msvc-src-c-E.stderr.txt000066400000000000000000000001061345607646000225720ustar00rootroot00000000000000^error: invalid argument '-std=c\+\+11' not allowed with 'C(/ObjC)?'$ CastXML-0.2.0/test/expect/cmd.cc-msvc-src-cxx-E.stdout.txt000066400000000000000000000005311345607646000231730ustar00rootroot00000000000000^#define _MSC_VER 1600 #define _WIN32 1 #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+ #define __cplusplus 199711L$ CastXML-0.2.0/test/expect/cmd.cc-msvc-src-cxx-cmd.stderr.txt000066400000000000000000000001501345607646000235300ustar00rootroot00000000000000"clang" .* "-[^i][^"]*" "[^-"][^"]*" "-isystem" "/some/include" "-isystem" "/some/other/include" "-[^i] CastXML-0.2.0/test/expect/cmd.cc-msvc-std-c++11.stderr.txt000066400000000000000000000000321345607646000227010ustar00rootroot00000000000000"clang" .* "-std=c\+\+11" CastXML-0.2.0/test/expect/cmd.cc-msvc-std-c++14.stderr.txt000066400000000000000000000000321345607646000227040ustar00rootroot00000000000000"clang" .* "-std=c\+\+14" CastXML-0.2.0/test/expect/cmd.cc-msvc-std-c++17-E.stdout.txt000066400000000000000000000011261345607646000231150ustar00rootroot00000000000000^#define _MSC_VER 1900 #define _MSVC_LANG 201703L #define _WIN32 1 #define __STDCPP_DEFAULT_NEW_ALIGNMENT__ 16ll #define __castxml__ [^ ]* #define __castxml_check[^ ]* #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ [0-9]+ #define __castxml_minor__ [0-9]+ #define __castxml_patch__ [0-9]+ #define __cplusplus 199711L #define __is_assignable\(_To,_Fr\) \(sizeof\(__castxml__is_assignable_check<_To,_Fr>\(0\)\) == sizeof\(char\(&\)\[1\]\)\)( #define __make_integer_seq __castxml__make_integer_seq)?$ CastXML-0.2.0/test/expect/cmd.cc-msvc-std-c++17.stderr.txt000066400000000000000000000000321345607646000227070ustar00rootroot00000000000000"clang" .* "-std=c\+\+17" CastXML-0.2.0/test/expect/cmd.cc-msvc-std-c++98.stderr.txt000066400000000000000000000000321345607646000227200ustar00rootroot00000000000000"clang" .* "-std=c\+\+98" CastXML-0.2.0/test/expect/cmd.cc-msvc-std-explicit.stderr.txt000066400000000000000000000000341345607646000240120ustar00rootroot00000000000000"clang" .* "-std=gnu\+\+14" CastXML-0.2.0/test/expect/cmd.cc-msvc-tgt-amd64.stderr.txt000066400000000000000000000000261345607646000231110ustar00rootroot00000000000000Target: amd64-[^ ]+ . CastXML-0.2.0/test/expect/cmd.cc-msvc-tgt-explicit.stderr.txt000066400000000000000000000000411345607646000240140ustar00rootroot00000000000000Target: explicit-target-triple . CastXML-0.2.0/test/expect/cmd.cc-msvc-tgt-i386.stderr.txt000066400000000000000000000000251345607646000226660ustar00rootroot00000000000000Target: i386-[^ ]+ . CastXML-0.2.0/test/expect/cmd.cc-msvc-tgt-win.stderr.txt000066400000000000000000000000411345607646000227700ustar00rootroot00000000000000Target: [^ -]+-pc-windows[^ ]* . CastXML-0.2.0/test/expect/cmd.cc-msvc-tgt-x86_64.stderr.txt000066400000000000000000000000271345607646000231350ustar00rootroot00000000000000Target: x86_64-[^ ]+ . CastXML-0.2.0/test/expect/cmd.cc-option.result.txt000066400000000000000000000000021345607646000217510ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-option.stderr.txt000066400000000000000000000001221345607646000217410ustar00rootroot00000000000000^error: argument to '--castxml-cc-gnu' may not start with '-' Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.cc-paren-castxml.result.txt000066400000000000000000000000021345607646000232170ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-paren-castxml.stderr.txt000066400000000000000000000001341345607646000232120ustar00rootroot00000000000000^error: arguments to '--castxml-cc-gnu' may not start with '--castxml-' Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.cc-paren-nested.result.txt000066400000000000000000000000021345607646000230260ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-paren-nested.stderr.txt000066400000000000000000000001041345607646000230160ustar00rootroot00000000000000^error: '--castxml-cc-gnu' compiler command failed: '\(' '\)' .*$ CastXML-0.2.0/test/expect/cmd.cc-paren-unbalanced.result.txt000066400000000000000000000000021345607646000236400ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-paren-unbalanced.stderr.txt000066400000000000000000000001141345607646000236310ustar00rootroot00000000000000^error: unbalanced parentheses after '--castxml-cc-gnu' Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.cc-twice.result.txt000066400000000000000000000000021345607646000215540ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-twice.stderr.txt000066400000000000000000000001131345607646000215440ustar00rootroot00000000000000^error: '--castxml-cc-' may be given at most once! Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.cc-unknown.result.txt000066400000000000000000000000021345607646000221400ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.cc-unknown.stderr.txt000066400000000000000000000000531345607646000221330ustar00rootroot00000000000000^error: '--castxml-cc-unknown' not known!$ CastXML-0.2.0/test/expect/cmd.gccxml-and-objc1.result.txt000066400000000000000000000000021345607646000230670ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.gccxml-and-objc1.stderr.txt000066400000000000000000000000731345607646000230640ustar00rootroot00000000000000^error: '--castxml-gccxml' does not work with Objective C$ CastXML-0.2.0/test/expect/cmd.gccxml-and-objc2.result.txt000066400000000000000000000000021345607646000230700ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.gccxml-and-objc2.stderr.txt000066400000000000000000000000731345607646000230650ustar00rootroot00000000000000^error: '--castxml-gccxml' does not work with Objective C$ CastXML-0.2.0/test/expect/cmd.gccxml-empty-c++98-E.stdout.txt000066400000000000000000000000361345607646000234130ustar00rootroot00000000000000^#[^ ]*/test/input/empty.cxx" CastXML-0.2.0/test/expect/cmd.gccxml-twice.result.txt000066400000000000000000000000021345607646000224440ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.gccxml-twice.stderr.txt000066400000000000000000000001121345607646000224330ustar00rootroot00000000000000^error: '--castxml-gccxml' may be given at most once! Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.help1.stdout.txt000066400000000000000000000002501345607646000211000ustar00rootroot00000000000000^Usage: castxml .* Help for the internal Clang compiler appears below. --------------------------------------------------------------- OVERVIEW: clang LLVM compiler CastXML-0.2.0/test/expect/cmd.help2.stdout.txt000066400000000000000000000002501345607646000211010ustar00rootroot00000000000000^Usage: castxml .* Help for the internal Clang compiler appears below. --------------------------------------------------------------- OVERVIEW: clang LLVM compiler CastXML-0.2.0/test/expect/cmd.input-missing.result.txt000066400000000000000000000000021345607646000226640ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.input-missing.stderr.txt000066400000000000000000000001331345607646000226560ustar00rootroot00000000000000^error: no such file or directory: '.*/test/input/does-not-exist.c' error: no input files$ CastXML-0.2.0/test/expect/cmd.o-missing.result.txt000066400000000000000000000000021345607646000217630ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.o-missing.stderr.txt000066400000000000000000000001151345607646000217550ustar00rootroot00000000000000^error: argument to '-o' is missing \(expected 1 value\) Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.predefined-macros.stdout.txt.in000066400000000000000000000011361345607646000240670ustar00rootroot00000000000000#define __castxml__ __castxml_check\(__castxml_major__,__castxml_minor__,__castxml_patch__\) #define __castxml_check\(major,minor,patch\) \(10000000000\*major \+ 100000000\*minor \+ patch\) #define __castxml_clang_major__ [0-9]+ #define __castxml_clang_minor__ [0-9]+ #define __castxml_clang_patchlevel__ [0-9]+ #define __castxml_major__ @CastXML_VERSION_MAJOR@ #define __castxml_minor__ @CastXML_VERSION_MINOR@ #define __castxml_patch__ @CastXML_VERSION_PATCH@ #define __clang__ 1 #define __clang_major__ [0-9]+ #define __clang_minor__ [0-9]+ #define __clang_patchlevel__ [0-9]+ #define __clang_version__ CastXML-0.2.0/test/expect/cmd.rsp-missing.result.txt000066400000000000000000000000021345607646000223310ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.rsp-missing.stderr.txt000066400000000000000000000001361345607646000223260ustar00rootroot00000000000000^error: no such file or directory: '@.*/test/input/does-not-exist.rsp' error: no input files$ CastXML-0.2.0/test/expect/cmd.rsp-o-missing.result.txt000066400000000000000000000000021345607646000225650ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.rsp-o-missing.stderr.txt000066400000000000000000000001151345607646000225570ustar00rootroot00000000000000^error: argument to '-o' is missing \(expected 1 value\) Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.start-missing.result.txt000066400000000000000000000000021345607646000226620ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.start-missing.stderr.txt000066400000000000000000000001321345607646000226530ustar00rootroot00000000000000^error: argument to '--castxml-start' is missing \(expected 1 value\) Usage: castxml .*$ CastXML-0.2.0/test/expect/cmd.std-c++98-src-c.result.txt000066400000000000000000000000021345607646000224040ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.std-c++98-src-c.stderr.txt000066400000000000000000000001061345607646000223760ustar00rootroot00000000000000^error: invalid argument '-std=c\+\+98' not allowed with 'C(/ObjC)?'$ CastXML-0.2.0/test/expect/cmd.std-c89-src-cxx.result.txt000066400000000000000000000000021345607646000226360ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/cmd.std-c89-src-cxx.stderr.txt000066400000000000000000000001121345607646000226250ustar00rootroot00000000000000^error: invalid argument '-std=c89' not allowed with 'C\+\+(/ObjC\+\+)?'$ CastXML-0.2.0/test/expect/cmd.version.stdout.txt000066400000000000000000000002121345607646000215520ustar00rootroot00000000000000^castxml version [0-9]+\.[0-9]+[^\n]* CastXML project maintained and supported by Kitware \(kitware.com\). clang version [0-9]+\.[0-9]+ CastXML-0.2.0/test/expect/gccxml.any.ArrayType-incomplete.xml.txt000066400000000000000000000005461345607646000247320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.ArrayType.xml.txt000066400000000000000000000005341345607646000225720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.CXXLiteral.xml.txt000066400000000000000000000002061345607646000226250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-abstract.xml.txt000066400000000000000000000031751345607646000235240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-annotate.xml.txt000066400000000000000000000023301345607646000235220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-base-offset.xml.txt000066400000000000000000000007541345607646000241170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .* $ CastXML-0.2.0/test/expect/gccxml.any.Class-base-typedef.xml.txt000066400000000000000000000044621345607646000242710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-deprecated.xml.txt000066400000000000000000000023131345607646000240120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-forward.xml.txt000066400000000000000000000020301345607646000233520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-friends.xml.txt000066400000000000000000000027431345607646000233530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-member-access-mutable.xml.txt000066400000000000000000000033631345607646000276650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-member-access.xml.txt000066400000000000000000000030341345607646000262310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-member-array.xml.txt000066400000000000000000000026601345607646000261120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-member-bad-base.xml.txt000066400000000000000000000044111345607646000264260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> ( | ) $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-member-const-aggregate.xml.txt000066400000000000000000000017541345607646000300510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-member-const.xml.txt000066400000000000000000000021131345607646000261130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-member-reference.xml.txt000066400000000000000000000021351345607646000267270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-implicit-members.xml.txt000066400000000000000000000026301345607646000251560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-incomplete-twice.xml.txt000066400000000000000000000004601345607646000251630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-incomplete.xml.txt000066400000000000000000000003601345607646000240510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-member-Struct-anonymous.xml.txt000066400000000000000000000045501345607646000264760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-member-Union-anonymous.xml.txt000066400000000000000000000045461345607646000263070ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-member-template-access.xml.txt000066400000000000000000000050311345607646000262310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-member-template.xml.txt000066400000000000000000000027361345607646000250030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-ms-dllexport.xml.txt000066400000000000000000000024611345607646000243500ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-ms-dllimport.xml.txt000066400000000000000000000024611345607646000243410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-partial-template-member-Typedef.xml.txt000066400000000000000000000031511345607646000300230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-Method-Argument-const.xml.txt000066400000000000000000000032541345607646000276540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-Method-Argument-default.xml.txt000066400000000000000000000027641345607646000301570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-Method-return-const.xml.txt000066400000000000000000000027231345607646000274110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-constructor-template.xml.txt000066400000000000000000000024251345607646000277250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-friends.xml.txt000066400000000000000000000031141345607646000251550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-member-Typedef-const.xml.txt000066400000000000000000000032221345607646000275140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-member-Typedef.xml.txt000066400000000000000000000031151345607646000263710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-member-nontemplate-Typedef.xml.txt000066400000000000000000000012471345607646000307210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-member-template.xml.txt000066400000000000000000000030621345607646000266050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template-recurse.xml.txt000066400000000000000000000024401345607646000251740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class-template.xml.txt000066400000000000000000000046111345607646000235300ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Class.xml.txt000066400000000000000000000022501345607646000217140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Constructor-annotate.xml.txt000066400000000000000000000022711345607646000250060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Constructor-deprecated.xml.txt000066400000000000000000000022541345607646000252760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Constructor-ms-dllexport.xml.txt000066400000000000000000000022551345607646000256310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Constructor-ms-dllimport.xml.txt000066400000000000000000000022551345607646000256220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Constructor.xml.txt000066400000000000000000000022111345607646000231710ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Converter-annotate.xml.txt000066400000000000000000000026331345607646000244320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Converter-deprecated.xml.txt000066400000000000000000000026161345607646000247220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Converter-ms-dllexport.xml.txt000066400000000000000000000026171345607646000252550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Converter-ms-dllimport.xml.txt000066400000000000000000000026171345607646000252460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Converter.xml.txt000066400000000000000000000025531345607646000226240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.CvQualifiedType.xml.txt000066400000000000000000000005441345607646000237110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Destructor-annotate.xml.txt000066400000000000000000000022701345607646000246160ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Destructor-deprecated.xml.txt000066400000000000000000000022531345607646000251060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Destructor-ms-dllexport.xml.txt000066400000000000000000000022541345607646000254410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Destructor-ms-dllimport.xml.txt000066400000000000000000000022541345607646000254320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Destructor.xml.txt000066400000000000000000000022101345607646000230010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Elaborated.xml.txt000066400000000000000000000164631345607646000227240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Enumeration-annotate.xml.txt000066400000000000000000000006131345607646000247450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Enumeration-anonymous.xml.txt000066400000000000000000000006341345607646000251670ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Enumeration-deprecated.xml.txt000066400000000000000000000005571345607646000252430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Enumeration.xml.txt000066400000000000000000000005311345607646000231350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Field-annotate.xml.txt000066400000000000000000000026301345607646000235030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Field-deprecated.xml.txt000066400000000000000000000026131345607646000237730ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Field.xml.txt000066400000000000000000000033231345607646000216740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-Argument-Annotate.xml.txt000066400000000000000000000010071345607646000257620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-Argument-decay.xml.txt000066400000000000000000000023021345607646000252750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-Argument-default-cast.xml.txt000066400000000000000000000072131345607646000265720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-Argument-default-ns.xml.txt000066400000000000000000000017261345607646000262630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-Argument-default.xml.txt000066400000000000000000000013751345607646000256450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-Argument-deprecated.xml.txt000066400000000000000000000007721345607646000263210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-annotate.xml.txt000066400000000000000000000007761345607646000242560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-auto.xml.txt000066400000000000000000000005031345607646000234010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-calling-convention-ms-annotate.xml.txt000066400000000000000000000032131345607646000304470ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-calling-convention-ms-deprecated.xml.txt000066400000000000000000000031211345607646000307340ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-calling-convention-ms-dllexport.xml.txt000066400000000000000000000031141345607646000306530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-calling-convention-ms-dllimport.xml.txt000066400000000000000000000031141345607646000306440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-calling-convention-ms.xml.txt000066400000000000000000000030151345607646000266400ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-deprecated.xml.txt000066400000000000000000000007611345607646000245370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-lambda.xml.txt000066400000000000000000000012011345607646000236450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-ms-dllexport.xml.txt000066400000000000000000000007621345607646000250720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-ms-dllimport.xml.txt000066400000000000000000000007621345607646000250630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-rvalue-reference.xml.txt000066400000000000000000000006311345607646000256650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-template.xml.txt000066400000000000000000000012211345607646000242420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-throw.xml.txt000066400000000000000000000010501345607646000235720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function-variadic.xml.txt000066400000000000000000000007471345607646000242250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Function.xml.txt000066400000000000000000000007161345607646000224410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.FunctionType-variadic.xml.txt000066400000000000000000000007371345607646000250660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.FunctionType.xml.txt000066400000000000000000000007061345607646000233020ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.FundamentalType-nullptr.xml.txt000066400000000000000000000010001345607646000254350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.FundamentalType.xml.txt000066400000000000000000000004611345607646000237510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.FundamentalTypes.xml.txt000066400000000000000000000046461345607646000241450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.GNU-float128-nostart.xml.txt000066400000000000000000000003011345607646000243210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-0.2.0/test/expect/gccxml.any.GNU-float128.xml.txt000066400000000000000000000015311345607646000226370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.GNU-va_arg_pack.xml.txt000066400000000000000000000006631345607646000235410ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-Argument-default-cast.xml.txt000066400000000000000000000041111345607646000262170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-Argument-default.xml.txt000066400000000000000000000032461345607646000252770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-annotate.xml.txt000066400000000000000000000027531345607646000237060ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-deprecated.xml.txt000066400000000000000000000027361345607646000241760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-ms-dllexport.xml.txt000066400000000000000000000027371345607646000245310ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-ms-dllimport.xml.txt000066400000000000000000000027371345607646000245220ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-overrides.xml.txt000066400000000000000000000054721345607646000241000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method-rvalue-reference.xml.txt000066400000000000000000000021741345607646000253240ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Method.xml.txt000066400000000000000000000026731345607646000221000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.MethodType-cv.xml.txt000066400000000000000000000011421345607646000233360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.MethodType.xml.txt000066400000000000000000000010061345607646000227270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-Class-members.xml.txt000066400000000000000000000026751345607646000252510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-Class-partial-template-members.xml.txt000066400000000000000000000002061345607646000305000ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-Class-template-members.xml.txt000066400000000000000000000002061345607646000270460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-Function-template-members.xml.txt000066400000000000000000000002061345607646000275660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-anonymous.xml.txt000066400000000000000000000005371345607646000245770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-empty.xml.txt000066400000000000000000000002061345607646000236760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-extern-C-members.xml.txt000066400000000000000000000010701345607646000256550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-inline-start.xml.txt000066400000000000000000000000641345607646000251530ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-inline-template.xml.txt000066400000000000000000000010001345607646000256200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-inline.xml.txt000066400000000000000000000006121345607646000240170ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-nested-1.xml.txt000066400000000000000000000011321345607646000241570ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-nested-2.xml.txt000066400000000000000000000011321345607646000241600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-nested.xml.txt000066400000000000000000000014261345607646000240270ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-repeat-start.xml.txt000066400000000000000000000007701345607646000251610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace-repeat.xml.txt000066400000000000000000000010551345607646000240230ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Namespace.xml.txt000066400000000000000000000002061345607646000225420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OffsetType-cv.xml.txt000066400000000000000000000010761345607646000233520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OffsetType.xml.txt000066400000000000000000000006671345607646000227510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorFunction-annotate.xml.txt000066400000000000000000000013531345607646000257620ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorFunction-deprecated.xml.txt000066400000000000000000000013361345607646000262520ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorFunction-ms-dllexport.xml.txt000066400000000000000000000013371345607646000266050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorFunction-ms-dllimport.xml.txt000066400000000000000000000013371345607646000265760ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorFunction.xml.txt000066400000000000000000000012731345607646000241540ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorMethod-annotate.xml.txt000066400000000000000000000030061345607646000254120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorMethod-deprecated.xml.txt000066400000000000000000000027711345607646000257110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorMethod-ms-dllexport.xml.txt000066400000000000000000000027721345607646000262440ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorMethod-ms-dllimport.xml.txt000066400000000000000000000027721345607646000262350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.OperatorMethod.xml.txt000066400000000000000000000027261345607646000236130ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.PointerType.xml.txt000066400000000000000000000005551345607646000231370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.RValueReferenceType.xml.txt000066400000000000000000000002061345607646000245250ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.ReferenceType.xml.txt000066400000000000000000000005611345607646000234120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.TypeAlias.xml.txt000066400000000000000000000005501345607646000225430ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.TypeAliasTemplate.xml.txt000066400000000000000000000002061345607646000242350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-annotate.xml.txt000066400000000000000000000005311345607646000240560ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-deprecated.xml.txt000066400000000000000000000005141345607646000243460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-paren.xml.txt000066400000000000000000000004571345607646000233610ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-to-Class-template.xml.txt000066400000000000000000000005341345607646000255460ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-to-Enumeration-anonymous.xml.txt000066400000000000000000000005601345607646000272030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-to-Enumeration.xml.txt000066400000000000000000000005421345607646000251550ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-to-FundamentalType-mode.xml.txt000066400000000000000000000005071345607646000267120ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-to-Struct-anonymous.xml.txt000066400000000000000000000024071345607646000262030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-to-Union-anonymous.xml.txt000066400000000000000000000024051345607646000260050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Typedef-to-extern-C-FundamentalType-mode.xml.txt000066400000000000000000000005201345607646000303700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-annotate.xml.txt000066400000000000000000000005531345607646000242070ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-deprecated.xml.txt000066400000000000000000000005361345607646000244770ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-in-Class.xml.txt000066400000000000000000000026161345607646000240510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-init-cast.xml.txt000066400000000000000000000012141345607646000242640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-init-ns.xml.txt000066400000000000000000000011101345607646000237450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-init.xml.txt000066400000000000000000000013151345607646000233360ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-lambda.xml.txt000066400000000000000000000005641345607646000236200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-ms-dllexport.xml.txt000066400000000000000000000005371345607646000250320ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable-ms-dllimport.xml.txt000066400000000000000000000005521345607646000250200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.Variable.xml.txt000066400000000000000000000004731345607646000224010ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.implicit-decl-ms.xml.txt000066400000000000000000000010371345607646000240050ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.inline-asm-ms.xml.txt000066400000000000000000000005041345607646000233200ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.invalid-decl-for-type.xml.txt000066400000000000000000000051071345607646000247510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.nostart.xml.txt000066400000000000000000000010221345607646000223350ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .* .* $ CastXML-0.2.0/test/expect/gccxml.any.qualified-type-name.xml.txt000066400000000000000000000006761345607646000245210ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.using-declaration-class.xml.txt000066400000000000000000000055361345607646000253740ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.using-declaration-ns.xml.txt000066400000000000000000000004561345607646000247030ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.using-declaration-start.xml.txt000066400000000000000000000004441345607646000254150ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.using-directive-ns.xml.txt000066400000000000000000000002061345607646000243650ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.any.using-directive-start.xml.txt000066400000000000000000000004421345607646000251040ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.broken.any.ReferenceType-to-Class-template.xml.txt000066400000000000000000000030351345607646000301640ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> (broken: duplicate ReferenceType)? (broken: duplicate ReferenceType)? $ CastXML-0.2.0/test/expect/gccxml.c++11.Class-bases.xml.txt000066400000000000000000000107151345607646000227370ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++11.Class-template-bases.xml.txt000066400000000000000000000066371345607646000245600ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++14.Class-bases.xml.txt000066400000000000000000000107151345607646000227420ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++14.Class-template-bases.xml.txt000066400000000000000000000066371345607646000245630ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++17.Class-bases.xml.txt000066400000000000000000000107151345607646000227450ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++17.Class-template-bases.xml.txt000066400000000000000000000066371345607646000245660ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++98.CXXLiteral.result.txt000066400000000000000000000000021345607646000232770ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/gccxml.c++98.CXXLiteral.stderr.txt000066400000000000000000000000271345607646000232730ustar00rootroot00000000000000error: expected a type CastXML-0.2.0/test/expect/gccxml.c++98.CXXLiteral.xml.txt000066400000000000000000000000141345607646000225640ustar00rootroot00000000000000\(missing\) CastXML-0.2.0/test/expect/gccxml.c++98.Class-bases.xml.txt000066400000000000000000000111511345607646000227510ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++98.Class-template-bases.xml.txt000066400000000000000000000070351345607646000245700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c++98.Function-rvalue-reference.stderr.txt000066400000000000000000000000631345607646000263310ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-0.2.0/test/expect/gccxml.c++98.Method-rvalue-reference.stderr.txt000066400000000000000000000000631345607646000257640ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-0.2.0/test/expect/gccxml.c++98.RValueReferenceType.stderr.txt000066400000000000000000000000631345607646000251730ustar00rootroot00000000000000warning: rvalue references are a C\+\+11 extension CastXML-0.2.0/test/expect/gccxml.c++98.TypeAlias.stderr.txt000066400000000000000000000000641345607646000232100ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-0.2.0/test/expect/gccxml.c++98.TypeAliasTemplate.stderr.txt000066400000000000000000000000641345607646000247040ustar00rootroot00000000000000warning: alias declarations are a C\+\+11 extension CastXML-0.2.0/test/expect/gccxml.c.FunctionNoProto.xml.txt000066400000000000000000000004631345607646000234140ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c.FundamentalType.xml.txt000066400000000000000000000004571345607646000234110ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c.GNU-float128-nostart.xml.txt000066400000000000000000000002771345607646000237700ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> .*.* $ CastXML-0.2.0/test/expect/gccxml.c.GNU-float128.xml.txt000066400000000000000000000006251345607646000222750ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c.GNU-va_arg_pack.xml.txt000066400000000000000000000006611345607646000231720ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c.Typedef-called-class.xml.txt000066400000000000000000000006201345607646000242260ustar00rootroot00000000000000^<\?xml version="1.0"\?> ]*> $ CastXML-0.2.0/test/expect/gccxml.c.invalid.result.txt000066400000000000000000000000021345607646000224370ustar00rootroot000000000000001 CastXML-0.2.0/test/expect/gccxml.c.invalid.stderr.txt000066400000000000000000000000411345607646000224270ustar00rootroot00000000000000error: unknown type name 'class' CastXML-0.2.0/test/input/000077500000000000000000000000001345607646000151155ustar00rootroot00000000000000CastXML-0.2.0/test/input/ArrayType-incomplete.cxx000066400000000000000000000000251345607646000217130ustar00rootroot00000000000000typedef int start[]; CastXML-0.2.0/test/input/ArrayType.cxx000066400000000000000000000000261345607646000175570ustar00rootroot00000000000000typedef int start[2]; CastXML-0.2.0/test/input/CXXLiteral.cxx000066400000000000000000000001121345607646000176120ustar00rootroot00000000000000namespace start { unsigned long long operator"" _u(unsigned long long); } CastXML-0.2.0/test/input/Class-abstract.cxx000066400000000000000000000001461345607646000205100ustar00rootroot00000000000000class start { virtual int method(int) = 0; virtual operator int() = 0; virtual ~start() = 0; }; CastXML-0.2.0/test/input/Class-annotate.cxx000066400000000000000000000000741345607646000205160ustar00rootroot00000000000000class __attribute__((annotate("an annotation"))) start { }; CastXML-0.2.0/test/input/Class-base-offset.cxx000066400000000000000000000002361345607646000211030ustar00rootroot00000000000000class base_1 { char b1; }; class base_2 { char b2; }; class base_3 { char b3; }; class start : public base_1 , public base_2 , public base_3 { }; CastXML-0.2.0/test/input/Class-base-typedef.cxx000066400000000000000000000001061345607646000212510ustar00rootroot00000000000000class base { }; typedef base base_t; class start : public base_t { }; CastXML-0.2.0/test/input/Class-bases.cxx000066400000000000000000000002571345607646000200050ustar00rootroot00000000000000class base_public { }; class base_private { }; class base_protected { }; class start : public base_public , private base_private , virtual protected base_protected { }; CastXML-0.2.0/test/input/Class-deprecated.cxx000066400000000000000000000000551345607646000210040ustar00rootroot00000000000000class __attribute__((deprecated)) start { }; CastXML-0.2.0/test/input/Class-forward.cxx000066400000000000000000000001661345607646000203530ustar00rootroot00000000000000class start; class start { public: start(); start(start const&); start& operator=(start const&); ~start(); }; CastXML-0.2.0/test/input/Class-friends.cxx000066400000000000000000000001251345607646000203340ustar00rootroot00000000000000class A { }; void f(void); class start { friend class A; friend void f(void); }; CastXML-0.2.0/test/input/Class-implicit-member-access-mutable.cxx000066400000000000000000000002421345607646000246470ustar00rootroot00000000000000class base { protected: base(); ~base(); private: base(base const&); base& operator=(base const&); mutable int data; }; class start : public base { }; CastXML-0.2.0/test/input/Class-implicit-member-access.cxx000066400000000000000000000002161345607646000232210ustar00rootroot00000000000000class base { protected: base(); ~base(); private: base(base const&); base& operator=(base const&); }; class start : public base { }; CastXML-0.2.0/test/input/Class-implicit-member-array.cxx000066400000000000000000000000401345607646000230710ustar00rootroot00000000000000class start { int data[2]; }; CastXML-0.2.0/test/input/Class-implicit-member-bad-base.cxx000066400000000000000000000002501345607646000234140ustar00rootroot00000000000000template class base { protected: T data; base(); void operator=(base const& a) { this->data = a.data; } }; class start : public base { }; CastXML-0.2.0/test/input/Class-implicit-member-const-aggregate.cxx000066400000000000000000000000441345607646000250310ustar00rootroot00000000000000struct start { int const data; }; CastXML-0.2.0/test/input/Class-implicit-member-const.cxx000066400000000000000000000000671345607646000231120ustar00rootroot00000000000000class start { int const data; public: start(); }; CastXML-0.2.0/test/input/Class-implicit-member-reference.cxx000066400000000000000000000000611345607646000237140ustar00rootroot00000000000000class start { int& ref; public: start(); }; CastXML-0.2.0/test/input/Class-implicit-members.cxx000066400000000000000000000001361345607646000221460ustar00rootroot00000000000000class start { start method(start const& x) { start s; s = x; return s; } }; CastXML-0.2.0/test/input/Class-incomplete-twice.cxx000066400000000000000000000000461345607646000221540ustar00rootroot00000000000000namespace start { class A; class A; } CastXML-0.2.0/test/input/Class-incomplete.cxx000066400000000000000000000000151345607646000210370ustar00rootroot00000000000000class start; CastXML-0.2.0/test/input/Class-member-Struct-anonymous.cxx000066400000000000000000000000451345607646000234620ustar00rootroot00000000000000class start { struct { } s; }; CastXML-0.2.0/test/input/Class-member-Union-anonymous.cxx000066400000000000000000000000441345607646000232650ustar00rootroot00000000000000class start { union { } u; }; CastXML-0.2.0/test/input/Class-member-template-access.cxx000066400000000000000000000002561345607646000232260ustar00rootroot00000000000000class start { template class member { }; public: typedef member member_char; // incomplete }; template class start::member; // instantiation CastXML-0.2.0/test/input/Class-member-template.cxx000066400000000000000000000002061345607646000217620ustar00rootroot00000000000000class start { template T method(T v) { return v; } }; template int start::method(int); // instantiation CastXML-0.2.0/test/input/Class-ms-dllexport.cxx000066400000000000000000000000471345607646000213370ustar00rootroot00000000000000class __declspec(dllexport) start { }; CastXML-0.2.0/test/input/Class-ms-dllimport.cxx000066400000000000000000000000471345607646000213300ustar00rootroot00000000000000class __declspec(dllimport) start { }; CastXML-0.2.0/test/input/Class-partial-template-member-Typedef.cxx000066400000000000000000000002251345607646000250130ustar00rootroot00000000000000template class start; template class start { typedef T Int; public: T method(Int); }; template class start; CastXML-0.2.0/test/input/Class-template-Method-Argument-const.cxx000066400000000000000000000001621345607646000246400ustar00rootroot00000000000000template class start { void method(T const&); }; template class start; // instantiation CastXML-0.2.0/test/input/Class-template-Method-Argument-default.cxx000066400000000000000000000001541345607646000251370ustar00rootroot00000000000000template class start { int method(int = 123); }; template class start; // instantiation CastXML-0.2.0/test/input/Class-template-Method-return-const.cxx000066400000000000000000000001551345607646000243770ustar00rootroot00000000000000template class start { T const method(); }; template class start; // instantiation CastXML-0.2.0/test/input/Class-template-bases.cxx000066400000000000000000000003341345607646000216120ustar00rootroot00000000000000class non_dependent_base { }; template class dependent_base { }; template class start : public non_dependent_base , public dependent_base { }; template class start; // instantiation CastXML-0.2.0/test/input/Class-template-constructor-template.cxx000066400000000000000000000002751345607646000247170ustar00rootroot00000000000000template class start { public: start(start const&); template start(start const&); }; start instantiate_and_copy(start const& x) { return x; } CastXML-0.2.0/test/input/Class-template-friends.cxx000066400000000000000000000003271345607646000221510ustar00rootroot00000000000000template class A; template int f(T); template class start { friend class A; friend int f(T); template friend int f(U); }; template class start; CastXML-0.2.0/test/input/Class-template-member-Typedef-const.cxx000066400000000000000000000001751345607646000245110ustar00rootroot00000000000000template class start { typedef T IntConst; public: T method(IntConst); }; template class start; CastXML-0.2.0/test/input/Class-template-member-Typedef.cxx000066400000000000000000000001551345607646000233630ustar00rootroot00000000000000template class start { typedef T Int; public: T method(Int); }; template class start; CastXML-0.2.0/test/input/Class-template-member-nontemplate-Typedef.cxx000066400000000000000000000002341345607646000257050ustar00rootroot00000000000000template struct A { struct B { typedef int intermediate_type; typedef intermediate_type type; }; }; typedef A::B::type start; CastXML-0.2.0/test/input/Class-template-member-template.cxx000066400000000000000000000002431345607646000235740ustar00rootroot00000000000000template class start { template T method(U) { return T(); } }; template int start::method(char); // instantiation CastXML-0.2.0/test/input/Class-template-recurse.cxx000066400000000000000000000004501345607646000221640ustar00rootroot00000000000000template struct A; template struct C; template struct B { typedef C type; }; template struct C { C() { /* clang-format off */ static_cast(sizeof(typename B< A >::type)); /* clang-format on */ } }; C start; CastXML-0.2.0/test/input/Class-template.cxx000066400000000000000000000004331345607646000205170ustar00rootroot00000000000000template class start { }; template struct start { }; // partial specialization template <> class start; // specialization template class start; // instantiation template class start; // instantiation of partial specialization CastXML-0.2.0/test/input/Class.cxx000066400000000000000000000000211345607646000166770ustar00rootroot00000000000000class start { }; CastXML-0.2.0/test/input/Constructor-annotate.cxx000066400000000000000000000001071345607646000217730ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) start(); }; CastXML-0.2.0/test/input/Constructor-deprecated.cxx000066400000000000000000000000701345607646000222610ustar00rootroot00000000000000class start { __attribute__((deprecated)) start(); }; CastXML-0.2.0/test/input/Constructor-ms-dllexport.cxx000066400000000000000000000000621345607646000226140ustar00rootroot00000000000000class start { __declspec(dllexport) start(); }; CastXML-0.2.0/test/input/Constructor-ms-dllimport.cxx000066400000000000000000000000621345607646000226050ustar00rootroot00000000000000class start { __declspec(dllimport) start(); }; CastXML-0.2.0/test/input/Constructor.cxx000066400000000000000000000000341345607646000201630ustar00rootroot00000000000000class start { start(); }; CastXML-0.2.0/test/input/Converter-annotate.cxx000066400000000000000000000001161345607646000214150ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) operator int(); }; CastXML-0.2.0/test/input/Converter-deprecated.cxx000066400000000000000000000000771345607646000217120ustar00rootroot00000000000000class start { __attribute__((deprecated)) operator int(); }; CastXML-0.2.0/test/input/Converter-ms-dllexport.cxx000066400000000000000000000000711345607646000222360ustar00rootroot00000000000000class start { __declspec(dllexport) operator int(); }; CastXML-0.2.0/test/input/Converter-ms-dllimport.cxx000066400000000000000000000000711345607646000222270ustar00rootroot00000000000000class start { __declspec(dllimport) operator int(); }; CastXML-0.2.0/test/input/Converter.cxx000066400000000000000000000000431345607646000176050ustar00rootroot00000000000000class start { operator int(); }; CastXML-0.2.0/test/input/CvQualifiedType.cxx000066400000000000000000000000311345607646000206710ustar00rootroot00000000000000typedef int const start; CastXML-0.2.0/test/input/Destructor-annotate.cxx000066400000000000000000000001101345607646000215760ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) ~start(); }; CastXML-0.2.0/test/input/Destructor-deprecated.cxx000066400000000000000000000000711345607646000220730ustar00rootroot00000000000000class start { __attribute__((deprecated)) ~start(); }; CastXML-0.2.0/test/input/Destructor-ms-dllexport.cxx000066400000000000000000000000631345607646000224260ustar00rootroot00000000000000class start { __declspec(dllexport) ~start(); }; CastXML-0.2.0/test/input/Destructor-ms-dllimport.cxx000066400000000000000000000000631345607646000224170ustar00rootroot00000000000000class start { __declspec(dllimport) ~start(); }; CastXML-0.2.0/test/input/Destructor.cxx000066400000000000000000000000351345607646000177750ustar00rootroot00000000000000class start { ~start(); }; CastXML-0.2.0/test/input/Elaborated.cxx000066400000000000000000000015731345607646000177110ustar00rootroot00000000000000namespace start { // Struct struct Foo1; Foo1* s1; struct Foo1* s2; // elaborated const Foo1* s3; const struct Foo1* s4; // elaborated typedef Foo1* s5; typedef struct Foo1* s6; // elaborated // Enum enum Foo2 { }; Foo2* e1; enum Foo2* e2; // elaborated const Foo2* e3; const enum Foo2* e4; // elaborated typedef Foo2* e5; typedef enum Foo2* e6; // elaborated // Union union Foo3 { }; Foo3* u1; union Foo3* u2; // elaborated const Foo3* u3; const union Foo3* u4; // elaborated typedef Foo3* u5; typedef union Foo3* u6; // elaborated // Class class Foo4 { }; Foo4* c1; class Foo4* c2; // elaborated const Foo3* c3; const class Foo4* c4; // elaborated typedef Foo4* c5; typedef class Foo4* c6; // elaborated // Function arguments void func1(Foo1* a1, struct Foo1* a2); void func2(Foo2* a3, enum Foo2* a4); void func3(Foo3* a5, union Foo3* a6); void func4(Foo4* a7, class Foo4* a8); } CastXML-0.2.0/test/input/Enumeration-annotate.cxx000066400000000000000000000001541345607646000217360ustar00rootroot00000000000000enum __attribute__((annotate("an annotation"))) start { ev0 __attribute__((annotate("an annotation"))) }; CastXML-0.2.0/test/input/Enumeration-anonymous.cxx000066400000000000000000000000531345607646000221530ustar00rootroot00000000000000namespace start { enum { ev0, ev1 }; } CastXML-0.2.0/test/input/Enumeration-deprecated.cxx000066400000000000000000000001161345607646000222230ustar00rootroot00000000000000enum __attribute__((deprecated)) start { ev0 __attribute__((deprecated)) }; CastXML-0.2.0/test/input/Enumeration.cxx000066400000000000000000000000411345607646000201220ustar00rootroot00000000000000enum start { ev0, ev2 = 2 }; CastXML-0.2.0/test/input/Field-annotate.cxx000066400000000000000000000001111345607646000204640ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) int field; }; CastXML-0.2.0/test/input/Field-deprecated.cxx000066400000000000000000000000721345607646000207610ustar00rootroot00000000000000class start { __attribute__((deprecated)) int field; }; CastXML-0.2.0/test/input/Field.cxx000066400000000000000000000001251345607646000166620ustar00rootroot00000000000000class start { int field; unsigned bit_field : 2; mutable int mutable_field; }; CastXML-0.2.0/test/input/Function-Argument-annotate.cxx000066400000000000000000000000741345607646000230160ustar00rootroot00000000000000void start(__attribute__((annotate("an annotation"))) int); CastXML-0.2.0/test/input/Function-Argument-decay.cxx000066400000000000000000000000601345607646000222650ustar00rootroot00000000000000void start(int[4][3], int[2], int[], int(int)); CastXML-0.2.0/test/input/Function-Argument-default-cast.cxx000066400000000000000000000006701345607646000235630ustar00rootroot00000000000000namespace start { struct Base { Base(); virtual ~Base(); }; struct Derived : public Base { Derived(); Derived(Derived const&); Derived& operator=(Derived const&); virtual ~Derived(); }; Base* b(); Base const* bc(); typedef int Int; void f(Int = (Int)0, Base* = (Base*)0, Base* = static_cast(0), Base* = reinterpret_cast(0), Base* = const_cast(bc()), Derived* = dynamic_cast(b())); } CastXML-0.2.0/test/input/Function-Argument-default-ns.cxx000066400000000000000000000001301345607646000232400ustar00rootroot00000000000000namespace start { static int const C = 0; enum { E = 0 }; void f(int = C, int = E); } CastXML-0.2.0/test/input/Function-Argument-default.cxx000066400000000000000000000002061345607646000226260ustar00rootroot00000000000000void start(int, const char*); void start(int, const char* = "abc"); void start(int = 123, const char*); void start(int, const char*); CastXML-0.2.0/test/input/Function-Argument-deprecated.cxx000066400000000000000000000000551345607646000233040ustar00rootroot00000000000000void start(__attribute__((deprecated)) int); CastXML-0.2.0/test/input/Function-annotate.cxx000066400000000000000000000000741345607646000212360ustar00rootroot00000000000000__attribute__((annotate("an annotation"))) void start(int); CastXML-0.2.0/test/input/Function-auto.cxx000066400000000000000000000000351345607646000203720ustar00rootroot00000000000000auto start() { return 1; } CastXML-0.2.0/test/input/Function-calling-convention-ms-annotate.cxx000066400000000000000000000005401345607646000254400ustar00rootroot00000000000000__attribute__((annotate("an annotation"))) void __cdecl start( void(__cdecl*)()); __attribute__((annotate("an annotation"))) void __stdcall start( void(__stdcall*)()); __attribute__((annotate("an annotation"))) void __fastcall start( void(__fastcall*)()); __attribute__((annotate("an annotation"))) void __thiscall start( void(__thiscall*)()); CastXML-0.2.0/test/input/Function-calling-convention-ms-deprecated.cxx000066400000000000000000000004301345607646000257250ustar00rootroot00000000000000__attribute__((deprecated)) void __cdecl start(void(__cdecl*)()); __attribute__((deprecated)) void __stdcall start(void(__stdcall*)()); __attribute__((deprecated)) void __fastcall start(void(__fastcall*)()); __attribute__((deprecated)) void __thiscall start(void(__thiscall*)()); CastXML-0.2.0/test/input/Function-calling-convention-ms-dllexport.cxx000066400000000000000000000004001345607646000256370ustar00rootroot00000000000000__declspec(dllexport) void __cdecl start(void(__cdecl*)()); __declspec(dllexport) void __stdcall start(void(__stdcall*)()); __declspec(dllexport) void __fastcall start(void(__fastcall*)()); __declspec(dllexport) void __thiscall start(void(__thiscall*)()); CastXML-0.2.0/test/input/Function-calling-convention-ms-dllimport.cxx000066400000000000000000000004001345607646000256300ustar00rootroot00000000000000__declspec(dllimport) void __cdecl start(void(__cdecl*)()); __declspec(dllimport) void __stdcall start(void(__stdcall*)()); __declspec(dllimport) void __fastcall start(void(__fastcall*)()); __declspec(dllimport) void __thiscall start(void(__thiscall*)()); CastXML-0.2.0/test/input/Function-calling-convention-ms.cxx000066400000000000000000000002501345607646000236270ustar00rootroot00000000000000void __cdecl start(void(__cdecl*)()); void __stdcall start(void(__stdcall*)()); void __fastcall start(void(__fastcall*)()); void __thiscall start(void(__thiscall*)()); CastXML-0.2.0/test/input/Function-deprecated.cxx000066400000000000000000000000551345607646000215240ustar00rootroot00000000000000__attribute__((deprecated)) void start(int); CastXML-0.2.0/test/input/Function-lambda.cxx000066400000000000000000000001571345607646000206470ustar00rootroot00000000000000template F start(F f) { return f; } void instantiate_start_with_lambda() { start([]() {}); } CastXML-0.2.0/test/input/Function-ms-dllexport.cxx000066400000000000000000000000471345607646000220570ustar00rootroot00000000000000__declspec(dllexport) void start(int); CastXML-0.2.0/test/input/Function-ms-dllimport.cxx000066400000000000000000000000471345607646000220500ustar00rootroot00000000000000__declspec(dllimport) void start(int); CastXML-0.2.0/test/input/Function-rvalue-reference.cxx000066400000000000000000000000711345607646000226540ustar00rootroot00000000000000int start(int); int start(int&&); int&& start(int, int); CastXML-0.2.0/test/input/Function-template.cxx000066400000000000000000000002361345607646000212400ustar00rootroot00000000000000template T start(T) { return T(); } template <> char start(char); // specialization template int start(int); // instantiation CastXML-0.2.0/test/input/Function-throw.cxx000066400000000000000000000000421345607646000205630ustar00rootroot00000000000000void start(int) throw(int, char); CastXML-0.2.0/test/input/Function-variadic.cxx000066400000000000000000000000261345607646000212040ustar00rootroot00000000000000void start(int, ...); CastXML-0.2.0/test/input/Function.cxx000066400000000000000000000000211345607646000174170ustar00rootroot00000000000000void start(int); CastXML-0.2.0/test/input/FunctionNoProto.c000066400000000000000000000000151345607646000203630ustar00rootroot00000000000000int start(); CastXML-0.2.0/test/input/FunctionType-variadic.cxx000066400000000000000000000000361345607646000220470ustar00rootroot00000000000000typedef void start(int, ...); CastXML-0.2.0/test/input/FunctionType.cxx000066400000000000000000000000311345607646000202620ustar00rootroot00000000000000typedef void start(int); CastXML-0.2.0/test/input/FundamentalType-nullptr.cxx000066400000000000000000000001451345607646000224370ustar00rootroot00000000000000namespace start { typedef decltype(nullptr) t_NullPtr; typedef decltype((nullptr)) t_ParenNullPtr; } CastXML-0.2.0/test/input/FundamentalType.c000066400000000000000000000000231345607646000203540ustar00rootroot00000000000000typedef int start; CastXML-0.2.0/test/input/FundamentalType.cxx000066400000000000000000000000231345607646000207340ustar00rootroot00000000000000typedef int start; CastXML-0.2.0/test/input/FundamentalTypes.cxx000066400000000000000000000005671345607646000211340ustar00rootroot00000000000000namespace start { typedef char t_Char; typedef signed char t_SChar; typedef unsigned char t_UChar; typedef short t_Short; typedef unsigned short t_UShort; typedef int t_Int; typedef unsigned int t_UInt; typedef long t_Long; typedef unsigned long t_ULong; typedef long long t_LongLong; typedef unsigned long long t_ULongLong; typedef float t_Float; typedef double t_Double; } CastXML-0.2.0/test/input/GNU-float128-nostart.c000066400000000000000000000000361345607646000207370ustar00rootroot00000000000000__float128 start(__float128); CastXML-0.2.0/test/input/GNU-float128-nostart.cxx000066400000000000000000000000361345607646000213170ustar00rootroot00000000000000__float128 start(__float128); CastXML-0.2.0/test/input/GNU-float128.c000066400000000000000000000000541345607646000172470ustar00rootroot00000000000000__float128 start(__float128); __float128 v; CastXML-0.2.0/test/input/GNU-float128.cxx000066400000000000000000000001571345607646000176330ustar00rootroot00000000000000template struct A; namespace start { __float128 f(__float128); __float128 v; A<__float128>* pa; } CastXML-0.2.0/test/input/GNU-va_arg_pack.c000066400000000000000000000001551345607646000201460ustar00rootroot00000000000000__inline int start(int n, ...) { return start(n + __builtin_va_arg_pack_len(), __builtin_va_arg_pack()); } CastXML-0.2.0/test/input/GNU-va_arg_pack.cxx000066400000000000000000000001551345607646000205260ustar00rootroot00000000000000__inline int start(int n, ...) { return start(n + __builtin_va_arg_pack_len(), __builtin_va_arg_pack()); } CastXML-0.2.0/test/input/Method-Argument-default-cast.cxx000066400000000000000000000002551345607646000232150ustar00rootroot00000000000000class start { class Class; typedef int Int; int f(Int = (Int)0, Class* = (Class*)0, Class* = static_cast(0), Class* = reinterpret_cast(0)); }; CastXML-0.2.0/test/input/Method-Argument-default.cxx000066400000000000000000000001021345607646000222540ustar00rootroot00000000000000class start { static int const C = 0; int method(int = C); }; CastXML-0.2.0/test/input/Method-annotate.cxx000066400000000000000000000001171345607646000206670ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) int method(int); }; CastXML-0.2.0/test/input/Method-deprecated.cxx000066400000000000000000000001001345607646000211460ustar00rootroot00000000000000class start { __attribute__((deprecated)) int method(int); }; CastXML-0.2.0/test/input/Method-ms-dllexport.cxx000066400000000000000000000000721345607646000215100ustar00rootroot00000000000000class start { __declspec(dllexport) int method(int); }; CastXML-0.2.0/test/input/Method-ms-dllimport.cxx000066400000000000000000000000721345607646000215010ustar00rootroot00000000000000class start { __declspec(dllimport) int method(int); }; CastXML-0.2.0/test/input/Method-overrides.cxx000066400000000000000000000001451345607646000210610ustar00rootroot00000000000000class base { virtual int method(int); }; class start : public base { virtual int method(int); }; CastXML-0.2.0/test/input/Method-rvalue-reference.cxx000066400000000000000000000002571345607646000223150ustar00rootroot00000000000000class start { start(start&); start(start&&); start& operator=(start&); start& operator=(start&&); int method(int); int method(int&&); int&& method(int, int); }; CastXML-0.2.0/test/input/Method.cxx000066400000000000000000000000441345607646000170570ustar00rootroot00000000000000class start { int method(int); }; CastXML-0.2.0/test/input/MethodType-cv.cxx000066400000000000000000000001051345607646000203250ustar00rootroot00000000000000class A; typedef int (A::*const volatile start)(int) const volatile; CastXML-0.2.0/test/input/MethodType.cxx000066400000000000000000000000471345607646000177240ustar00rootroot00000000000000class A; typedef int (A::*start)(int); CastXML-0.2.0/test/input/Namespace-Class-members.cxx000066400000000000000000000001011345607646000222200ustar00rootroot00000000000000namespace start { class A { static int data; }; int A::data; } CastXML-0.2.0/test/input/Namespace-Class-partial-template-members.cxx000066400000000000000000000002241345607646000254710ustar00rootroot00000000000000namespace start { template class A; template class A { static int data; }; template int A::data; } CastXML-0.2.0/test/input/Namespace-Class-template-members.cxx000066400000000000000000000001601345607646000240360ustar00rootroot00000000000000namespace start { template class A { static int data; }; template int A::data; } CastXML-0.2.0/test/input/Namespace-Function-template-members.cxx000066400000000000000000000000711345607646000245570ustar00rootroot00000000000000namespace start { template T function(T); } CastXML-0.2.0/test/input/Namespace-anonymous.cxx000066400000000000000000000000541345607646000215620ustar00rootroot00000000000000namespace start { namespace { struct A; } } CastXML-0.2.0/test/input/Namespace-empty.cxx000066400000000000000000000000261345607646000206670ustar00rootroot00000000000000namespace start { ; } CastXML-0.2.0/test/input/Namespace-extern-C-members.cxx000066400000000000000000000001071345607646000226460ustar00rootroot00000000000000namespace start { extern "C" { typedef int Int; Int function(Int); } } CastXML-0.2.0/test/input/Namespace-inline-start.cxx000066400000000000000000000001211345607646000221360ustar00rootroot00000000000000#pragma clang diagnostic ignored "-Wc++11-extensions" inline namespace start { } CastXML-0.2.0/test/input/Namespace-inline-template.cxx000066400000000000000000000002421345607646000226200ustar00rootroot00000000000000#pragma clang diagnostic ignored "-Wc++11-extensions" namespace start { inline namespace level1 { struct A; } template struct B; typedef B B_A; } CastXML-0.2.0/test/input/Namespace-inline.cxx000066400000000000000000000002261345607646000210110ustar00rootroot00000000000000#pragma clang diagnostic ignored "-Wc++11-extensions" namespace start { inline namespace level1 { struct A; inline namespace level2 { struct B; } } } CastXML-0.2.0/test/input/Namespace-nested.cxx000066400000000000000000000001531345607646000210140ustar00rootroot00000000000000namespace start { namespace ns1 { void f1(); } namespace ns2 { void f2(); } namespace ns3 { void f3(); } } CastXML-0.2.0/test/input/Namespace-repeat-start.cxx000066400000000000000000000000761345607646000221510ustar00rootroot00000000000000namespace start { void f1(); } namespace start { void f2(); } CastXML-0.2.0/test/input/Namespace-repeat.cxx000066400000000000000000000001141345607646000210070ustar00rootroot00000000000000namespace start { namespace ns { void f1(); } namespace ns { void f2(); } } CastXML-0.2.0/test/input/Namespace.cxx000066400000000000000000000000241345607646000175310ustar00rootroot00000000000000namespace start { } CastXML-0.2.0/test/input/OffsetType-cv.cxx000066400000000000000000000000761345607646000203420ustar00rootroot00000000000000class A; typedef int const volatile A::*const volatile start; CastXML-0.2.0/test/input/OffsetType.cxx000066400000000000000000000000401345607646000177230ustar00rootroot00000000000000class A; typedef int A::*start; CastXML-0.2.0/test/input/OperatorFunction-annotate.cxx000066400000000000000000000001401345607646000227440ustar00rootroot00000000000000class A; namespace start { __attribute__((annotate("an annotation"))) A& operator<<(A&, int); } CastXML-0.2.0/test/input/OperatorFunction-deprecated.cxx000066400000000000000000000001211345607646000232320ustar00rootroot00000000000000class A; namespace start { __attribute__((deprecated)) A& operator<<(A&, int); } CastXML-0.2.0/test/input/OperatorFunction-ms-dllexport.cxx000066400000000000000000000001131345607646000235650ustar00rootroot00000000000000class A; namespace start { __declspec(dllexport) A& operator<<(A&, int); } CastXML-0.2.0/test/input/OperatorFunction-ms-dllimport.cxx000066400000000000000000000001131345607646000235560ustar00rootroot00000000000000class A; namespace start { __declspec(dllimport) A& operator<<(A&, int); } CastXML-0.2.0/test/input/OperatorFunction.cxx000066400000000000000000000000651345607646000211430ustar00rootroot00000000000000class A; namespace start { A& operator<<(A&, int); } CastXML-0.2.0/test/input/OperatorMethod-annotate.cxx000066400000000000000000000001261345607646000224030ustar00rootroot00000000000000class start { __attribute__((annotate("an annotation"))) start& operator<<(int); }; CastXML-0.2.0/test/input/OperatorMethod-deprecated.cxx000066400000000000000000000001071345607646000226710ustar00rootroot00000000000000class start { __attribute__((deprecated)) start& operator<<(int); }; CastXML-0.2.0/test/input/OperatorMethod-ms-dllexport.cxx000066400000000000000000000001011345607646000232150ustar00rootroot00000000000000class start { __declspec(dllexport) start& operator<<(int); }; CastXML-0.2.0/test/input/OperatorMethod-ms-dllimport.cxx000066400000000000000000000001011345607646000232060ustar00rootroot00000000000000class start { __declspec(dllimport) start& operator<<(int); }; CastXML-0.2.0/test/input/OperatorMethod.cxx000066400000000000000000000000531345607646000205730ustar00rootroot00000000000000class start { start& operator<<(int); }; CastXML-0.2.0/test/input/PointerType.cxx000066400000000000000000000000241345607646000201170ustar00rootroot00000000000000typedef int* start; CastXML-0.2.0/test/input/RValueReferenceType.cxx000066400000000000000000000000501345607646000215130ustar00rootroot00000000000000namespace start { typedef int&& type; } CastXML-0.2.0/test/input/ReferenceType-to-Class-template.cxx000066400000000000000000000001641345607646000236760ustar00rootroot00000000000000template class A { }; void start(A&, short); void start(A&, int); void start(A&, long); CastXML-0.2.0/test/input/ReferenceType.cxx000066400000000000000000000000241345607646000203750ustar00rootroot00000000000000typedef int& start; CastXML-0.2.0/test/input/TypeAlias.cxx000066400000000000000000000000461345607646000175340ustar00rootroot00000000000000namespace start { using type = int; } CastXML-0.2.0/test/input/TypeAliasTemplate.cxx000066400000000000000000000002021345607646000212220ustar00rootroot00000000000000template struct A { typedef T type; }; namespace start { template using type = typename A::type; } CastXML-0.2.0/test/input/Typedef-annotate.cxx000066400000000000000000000000771345607646000210540ustar00rootroot00000000000000typedef int(start) __attribute__((annotate("an annotation"))); CastXML-0.2.0/test/input/Typedef-called-class.c000066400000000000000000000000501345607646000212010ustar00rootroot00000000000000typedef int class; typedef class start; CastXML-0.2.0/test/input/Typedef-deprecated.cxx000066400000000000000000000000601345607646000213330ustar00rootroot00000000000000typedef int(start) __attribute__((deprecated)); CastXML-0.2.0/test/input/Typedef-paren.cxx000066400000000000000000000000241345607646000203400ustar00rootroot00000000000000typedef int(start); CastXML-0.2.0/test/input/Typedef-to-Class-template.cxx000066400000000000000000000000651345607646000225360ustar00rootroot00000000000000template class A; typedef A start; CastXML-0.2.0/test/input/Typedef-to-Enumeration-anonymous.cxx000066400000000000000000000000301345607646000241640ustar00rootroot00000000000000typedef enum { } start; CastXML-0.2.0/test/input/Typedef-to-Enumeration.cxx000066400000000000000000000000351345607646000221430ustar00rootroot00000000000000enum E { }; typedef E start; CastXML-0.2.0/test/input/Typedef-to-FundamentalType-mode.cxx000066400000000000000000000000651345607646000237020ustar00rootroot00000000000000typedef int start __attribute__((__mode__(__HI__))); CastXML-0.2.0/test/input/Typedef-to-Struct-anonymous.cxx000066400000000000000000000000321345607646000231640ustar00rootroot00000000000000typedef struct { } start; CastXML-0.2.0/test/input/Typedef-to-Union-anonymous.cxx000066400000000000000000000000311345607646000227670ustar00rootroot00000000000000typedef union { } start; CastXML-0.2.0/test/input/Typedef-to-extern-C-FundamentalType-mode.cxx000066400000000000000000000001041345607646000253570ustar00rootroot00000000000000extern "C" { typedef int start __attribute__((__mode__(__HI__))); } CastXML-0.2.0/test/input/Variable-annotate.cxx000066400000000000000000000000661345607646000211770ustar00rootroot00000000000000__attribute__((annotate("an annotation"))) int start; CastXML-0.2.0/test/input/Variable-deprecated.cxx000066400000000000000000000000471345607646000214650ustar00rootroot00000000000000__attribute__((deprecated)) int start; CastXML-0.2.0/test/input/Variable-in-Class.cxx000066400000000000000000000000541345607646000210340ustar00rootroot00000000000000class start { static int static_field; }; CastXML-0.2.0/test/input/Variable-init-cast.cxx000066400000000000000000000001431345607646000212550ustar00rootroot00000000000000namespace start { typedef int Int; int var_int = (Int)123; int var_int2 = static_cast(123); } CastXML-0.2.0/test/input/Variable-init-ns.cxx000066400000000000000000000000771345607646000207510ustar00rootroot00000000000000namespace start { static int const C = 123; int var_int = C; } CastXML-0.2.0/test/input/Variable-init.cxx000066400000000000000000000001041345607646000203220ustar00rootroot00000000000000namespace start { int var_int = 123; const char* var_str = "abc"; } CastXML-0.2.0/test/input/Variable-lambda.cxx000066400000000000000000000000261345607646000206020ustar00rootroot00000000000000auto start = []() {}; CastXML-0.2.0/test/input/Variable-ms-dllexport.cxx000066400000000000000000000000411345607646000220110ustar00rootroot00000000000000__declspec(dllexport) int start; CastXML-0.2.0/test/input/Variable-ms-dllimport.cxx000066400000000000000000000000411345607646000220020ustar00rootroot00000000000000__declspec(dllimport) int start; CastXML-0.2.0/test/input/Variable.cxx000066400000000000000000000000131345607646000173600ustar00rootroot00000000000000int start; CastXML-0.2.0/test/input/empty.c000066400000000000000000000000001345607646000164050ustar00rootroot00000000000000CastXML-0.2.0/test/input/empty.cxx000066400000000000000000000000001345607646000167650ustar00rootroot00000000000000CastXML-0.2.0/test/input/empty.m000066400000000000000000000000001345607646000164170ustar00rootroot00000000000000CastXML-0.2.0/test/input/empty.mm000066400000000000000000000000001345607646000165740ustar00rootroot00000000000000CastXML-0.2.0/test/input/empty.rsp000066400000000000000000000000001345607646000167670ustar00rootroot00000000000000CastXML-0.2.0/test/input/has_unique_object_representations.cxx000066400000000000000000000001361345607646000246350ustar00rootroot00000000000000template struct Bool; typedef Bool<__has_unique_object_representations(int)> BoolType; CastXML-0.2.0/test/input/implicit-decl-ms.cxx000066400000000000000000000000261345607646000207730ustar00rootroot00000000000000size_t start(size_t); CastXML-0.2.0/test/input/inline-asm-ms.cxx000066400000000000000000000000431345607646000203070ustar00rootroot00000000000000void start() { __asm { int 1 } } CastXML-0.2.0/test/input/invalid-decl-for-type.cxx000066400000000000000000000002671345607646000217440ustar00rootroot00000000000000template struct A { T x; }; template struct B { B() { A a; } }; struct Incomplete; struct start { B b; typedef A type; }; CastXML-0.2.0/test/input/invalid.c000066400000000000000000000000151345607646000167030ustar00rootroot00000000000000class start; CastXML-0.2.0/test/input/make_integer_seq.cxx000066400000000000000000000004071345607646000211440ustar00rootroot00000000000000template struct seq; typedef __make_integer_seq seq_A; typedef seq seq_B; template struct assert_same; template struct assert_same { }; assert_same enforce; CastXML-0.2.0/test/input/nostart.cxx000066400000000000000000000000341345607646000173300ustar00rootroot00000000000000class A; A operator+(A, A); CastXML-0.2.0/test/input/o-missing.rsp000066400000000000000000000000031345607646000175410ustar00rootroot00000000000000-o CastXML-0.2.0/test/input/predefined.c000066400000000000000000000000301345607646000173570ustar00rootroot00000000000000#include "predefined.h" CastXML-0.2.0/test/input/predefined.cxx000066400000000000000000000000301345607646000177370ustar00rootroot00000000000000#include "predefined.h" CastXML-0.2.0/test/input/predefined.h000066400000000000000000000015041345607646000173730ustar00rootroot00000000000000#ifndef __castxml_major__ # error "__castxml_major__ not defined" #endif #ifndef __castxml_minor__ # error "__castxml_minor__ not defined" #endif #ifndef __castxml_patch__ # error "__castxml_patch__ not defined" #endif #ifndef __castxml__ # error "__castxml__ not defined" #endif #ifndef __castxml_check # error "__castxml_check not defined" #endif #if __castxml__ < __castxml_check(0, 1, 0) # error "__castxml__ < __castxml_check(0, 1, 0)" #endif #if __castxml__ < __castxml_check(0, 0, 20000000) # error "__castxml__ < __castxml_check(0, 0, 20000000)" #endif #ifndef __castxml_clang_major__ # error "__castxml_clang_major__ not defined" #endif #ifndef __castxml_clang_minor__ # error "__castxml_clang_minor__ not defined" #endif #ifndef __castxml_clang_patchlevel__ # error "__castxml_clang_patchlevel__ not defined" #endif CastXML-0.2.0/test/input/qualified-type-name.cxx000066400000000000000000000000731345607646000215010ustar00rootroot00000000000000namespace ns { typedef int type; } typedef ns::type start; CastXML-0.2.0/test/input/using-declaration-class.cxx000066400000000000000000000001501345607646000223500ustar00rootroot00000000000000class base { protected: int f(int); }; class start : public base { using base::f; int f(char); }; CastXML-0.2.0/test/input/using-declaration-ns.cxx000066400000000000000000000000501345607646000216620ustar00rootroot00000000000000class A; namespace start { using ::A; } CastXML-0.2.0/test/input/using-declaration-start.cxx000066400000000000000000000000551345607646000224040ustar00rootroot00000000000000namespace N { class start; } using N::start; CastXML-0.2.0/test/input/using-directive-ns.cxx000066400000000000000000000001001345607646000213470ustar00rootroot00000000000000namespace N { class A; } namespace start { using namespace N; } CastXML-0.2.0/test/input/using-directive-start.cxx000066400000000000000000000000601345607646000220710ustar00rootroot00000000000000namespace A { class start; } using namespace A; CastXML-0.2.0/test/run.cmake000066400000000000000000000126261345607646000155730ustar00rootroot00000000000000#============================================================================= # Copyright Kitware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #============================================================================= cmake_minimum_required(VERSION 2.8.5) if(xml) file(REMOVE "${xml}") endif() if(prologue) include(${prologue}) endif() execute_process( COMMAND ${command} OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE actual_stderr RESULT_VARIABLE actual_result ) if(xml) set(maybe_xml xml) if(EXISTS "${xml}") file(READ "${xml}" actual_xml) # Filter out arch-specific attributes. string(REGEX REPLACE "(<(Constructor|Destructor|Method|OperatorMethod|Converter)[^/>]*) attributes=\"__thiscall__\"(/?>)" "\\1\\3" actual_xml "${actual_xml}") string(REGEX REPLACE "(<(Constructor|Destructor|Method|OperatorMethod|Converter)[^/>]*) attributes=\"__thiscall__ ([^/>]+)\"(/?>)" "\\1 attributes=\"\\3\"\\4" actual_xml "${actual_xml}") else() set(actual_xml "(missing)") endif() else() set(maybe_xml) endif() set(default_result 0) set(default_stdout "^$") set(default_stderr "^$") foreach(o result stdout stderr ${maybe_xml}) string(REGEX REPLACE "(^|\n)warning: unknown platform, assuming -mfloat-abi=soft\n" "\\1" actual_${o} "${actual_${o}}") string(REGEX REPLACE "\n+$" "" actual_${o} "${actual_${o}}") string(REGEX REPLACE "\n" "\n actual-${o}> " actual-${o} " actual-${o}> ${actual_${o}}") set(actual-${o} "Actual ${o}:\n${actual-${o}}\n") set(expect-${o} "") unset(expect_${o}) foreach(e ${expect}) if(IS_ABSOLUTE "${e}") set(f "${e}.${o}.txt") else() set(f ${CMAKE_CURRENT_LIST_DIR}/expect/${e}.${o}.txt) endif() if(EXISTS "${f}") file(READ "${f}" expect_${o}) set(expect_${o}_file "${f}") break() endif() endforeach() if(NOT DEFINED expect_${o} AND DEFINED default_${o}) set(expect_${o} "${default_${o}}") endif() if(DEFINED expect_${o}) string(REGEX REPLACE "\n+$" "" expect_${o} "${expect_${o}}") if(NOT "${actual_${o}}" MATCHES "${expect_${o}}") set(msg "${msg}${o} does not match that expected.\n") string(REGEX REPLACE "\n" "\n expect-${o}> " expect-${o} " expect-${o}> ${expect_${o}}") set(expect-${o} "Expected ${o} to match:\n${expect-${o}}\n") endif() endif() endforeach() if(maybe_xml AND actual_xml MATCHES "__castxml") set(msg "xml contains disallowed text '__castxml'\n") endif() if(msg) if("$ENV{TEST_UPDATE}" AND expect_xml_file AND EXISTS "${xml}") set(update_xml "${actual_xml}") string(REGEX REPLACE "^<\\?xml version=\"1.0\"\\?>" "^<\\\\?xml version=\"1.0\"\\\\?>" update_xml "${update_xml}") string(REGEX REPLACE "([][(*)])" "\\\\\\1" update_xml "${update_xml}") string(REGEX REPLACE "]*>" "]*>" update_xml "${update_xml}") string(REGEX REPLACE "]*>" "]*>" update_xml "${update_xml}") string(REGEX REPLACE "mangled=\"[^\"]*\"" "mangled=\"[^\"]+\"" update_xml "${update_xml}") string(REGEX REPLACE "artificial=\"1\"( throw=\"\")?" "artificial=\"1\"( throw=\"\")?" update_xml "${update_xml}") string(REGEX REPLACE "size=\"[0-9]+\" align=\"[0-9]+\"" "size=\"[0-9]+\" align=\"[0-9]+\"" update_xml "${update_xml}") string(REGEX REPLACE "" "" update_xml "${update_xml}") if(update_xml MATCHES "" "" update_xml "${update_xml}") endif() string(REGEX REPLACE "$" "$" update_xml "${update_xml}") string(REGEX REPLACE "$" "$" update_xml "${update_xml}") file(WRITE "${expect_xml_file}" "${update_xml}\n") endif() string(REPLACE ";" "\" \"" command_string "\"${command}\"") set(msg "${msg}Command was:\n command> ${command_string}\n") message(SEND_ERROR "${msg}" "${expect-result}" "${expect-stdout}" "${expect-stderr}" "${expect-xml}" "${actual-result}" "${actual-stdout}" "${actual-stderr}" "${actual-xml}" ) endif() if(xmllint AND xml AND EXISTS "${xml}") execute_process( COMMAND ${xmllint} --noout --nonet "${xml}" OUTPUT_VARIABLE xmllint_stdout ERROR_VARIABLE xmllint_stderr RESULT_VARIABLE xmllint_result ) if(xmllint_result) foreach(o result stdout stderr) string(REGEX REPLACE "\n+$" "" xmllint_${o} "${xmllint_${o}}") string(REGEX REPLACE "\n" "\n xmllint-${o}> " xmllint-${o} " xmllint-${o}> ${xmllint_${o}}") set(xmllint-${o} "xmllint ${o}:\n${xmllint-${o}}\n") endforeach() message(SEND_ERROR "xmllint check failed:\n" "${msg}" "${xmllint-result}" "${xmllint-stdout}" "${xmllint-stderr}" ) endif() endif()